mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-26 08:06:23 +00:00
3 lines
No EOL
1.4 MiB (Stored with Git LFS)
3 lines
No EOL
1.4 MiB (Stored with Git LFS)
/*! For license information please see application-d4a959210a82d3d1b10f.js.LICENSE.txt */
|
|
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}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 i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));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="/packs/",n(n.s=573)}([function(t,e,n){"use strict";var r=n(3),i=n(20).f,o=n(40),a=n(16),s=n(116),u=n(119),c=n(80);t.exports=function(t,e){var n,l,h,f,d,p=t.target,v=t.global,m=t.stat;if(n=v?r:m?r[p]||s(p,{}):(r[p]||{}).prototype)for(l in e){if(f=e[l],h=t.dontCallGetSet?(d=i(n,l))&&d.value:n[l],!c(v?l:p+(m?".":"#")+l,t.forced)&&void 0!==h){if(typeof f==typeof h)continue;u(f,h)}(t.sham||h&&h.sham)&&o(f,"sham",!0),a(n,l,f,t)}}},function(t,e,n){"use strict";t.exports=function(t){try{return!!t()}catch(e){return!0}}},function(t,e,n){"use strict";var r=n(75),i=Function.prototype,o=i.call,a=r&&i.bind.bind(o,o);t.exports=r?a:function(t){return function(){return o.apply(t,arguments)}}},function(t,e,n){"use strict";(function(e){var n=function(t){return t&&t.Math===Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()}).call(this,n(64))},function(t,e,n){"use strict";var r=n(1);t.exports=!r((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(t,e,n){"use strict";var r=n(6),i=String,o=TypeError;t.exports=function(t){if(r(t))return t;throw new o(i(t)+" is not an object")}},function(t,e,n){"use strict";var r=n(8);t.exports=function(t){return"object"==typeof t?null!==t:r(t)}},function(t,e,n){"use strict";var r=n(3),i=n(67),o=n(12),a=n(77),s=n(66),u=n(156),c=r.Symbol,l=i("wks"),h=u?c.for||c:c&&c.withoutSetter||a;t.exports=function(t){return o(l,t)||(l[t]=s&&o(c,t)?c[t]:h("Symbol."+t)),l[t]}},function(t,e,n){"use strict";var r="object"==typeof document&&document.all;t.exports="undefined"==typeof r&&void 0!==r?function(t){return"function"==typeof t||t===r}:function(t){return"function"==typeof t}},function(t,e,n){"use strict";var r=n(75),i=Function.prototype.call;t.exports=r?i.bind(i):function(){return i.apply(i,arguments)}},function(t,e,n){"use strict";var r,i,o,a=n(133),s=n(4),u=n(3),c=n(8),l=n(6),h=n(12),f=n(45),d=n(59),p=n(40),v=n(16),m=n(38),g=n(36),y=n(39),b=n(54),w=n(7),_=n(77),x=n(22),k=x.enforce,S=x.get,C=u.Int8Array,M=C&&C.prototype,E=u.Uint8ClampedArray,T=E&&E.prototype,A=C&&y(C),O=M&&y(M),D=Object.prototype,P=u.TypeError,L=w("toStringTag"),N=_("TYPED_ARRAY_TAG"),R="TypedArrayConstructor",I=a&&!!b&&"Opera"!==f(u.opera),z=!1,B={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},j={BigInt64Array:8,BigUint64Array:8},F=function(t){var e=y(t);if(l(e)){var n=S(e);return n&&h(n,R)?n.TypedArrayConstructor:F(e)}},q=function(t){if(!l(t))return!1;var e=f(t);return h(B,e)||h(j,e)};for(r in B)(o=(i=u[r])&&i.prototype)?k(o).TypedArrayConstructor=i:I=!1;for(r in j)(o=(i=u[r])&&i.prototype)&&(k(o).TypedArrayConstructor=i);if((!I||!c(A)||A===Function.prototype)&&(A=function(){throw new P("Incorrect invocation")},I))for(r in B)u[r]&&b(u[r],A);if((!I||!O||O===D)&&(O=A.prototype,I))for(r in B)u[r]&&b(u[r].prototype,O);if(I&&y(T)!==O&&b(T,O),s&&!h(O,L))for(r in z=!0,m(O,L,{configurable:!0,get:function(){return l(this)?this[N]:void 0}}),B)u[r]&&p(u[r],N,r);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:I,TYPED_ARRAY_TAG:z&&N,aTypedArray:function(t){if(q(t))return t;throw new P("Target is not a typed array")},aTypedArrayConstructor:function(t){if(c(t)&&(!b||g(A,t)))return t;throw new P(d(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,e,n,r){if(s){if(n)for(var i in B){var o=u[i];if(o&&h(o.prototype,t))try{delete o.prototype[t]}catch(a){try{o.prototype[t]=e}catch(c){}}}O[t]&&!n||v(O,t,n?e:I&&M[t]||e,r)}},exportTypedArrayStaticMethod:function(t,e,n){var r,i;if(s){if(b){if(n)for(r in B)if((i=u[r])&&h(i,t))try{delete i[t]}catch(o){}if(A[t]&&!n)return;try{return v(A,t,n?e:I&&A[t]||e)}catch(o){}}for(r in B)!(i=u[r])||i[t]&&!n||v(i,t,e)}},getTypedArrayConstructor:F,isView:function(t){if(!l(t))return!1;var e=f(t);return"DataView"===e||h(B,e)||h(j,e)},isTypedArray:q,TypedArray:A,TypedArrayPrototype:O}},function(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})(t)}var i=Object.prototype.hasOwnProperty;function o(t,e){return i.call(t,e)}function a(t){return!(t>=55296&&t<=57343)&&(!(t>=64976&&t<=65007)&&(65535!==(65535&t)&&65534!==(65535&t)&&(!(t>=0&&t<=8)&&(11!==t&&(!(t>=14&&t<=31)&&(!(t>=127&&t<=159)&&!(t>1114111)))))))}function s(t){if(t>65535){var e=55296+((t-=65536)>>10),n=56320+(1023&t);return String.fromCharCode(e,n)}return String.fromCharCode(t)}var u=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,c=new RegExp(u.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),l=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,h=n(220);var f=/[&<>"]/,d=/[&<>"]/g,p={"&":"&","<":"<",">":">",'"':"""};function v(t){return p[t]}var m=/[.?*+^$[\]\\(){}|-]/g;var g=n(152);e.lib={},e.lib.mdurl=n(221),e.lib.ucmicro=n(513),e.assign=function(t){var e=Array.prototype.slice.call(arguments,1);return e.forEach((function(e){if(e){if("object"!==r(e))throw new TypeError(e+"must be object");Object.keys(e).forEach((function(n){t[n]=e[n]}))}})),t},e.isString=function(t){return"[object String]"===function(t){return Object.prototype.toString.call(t)}(t)},e.has=o,e.unescapeMd=function(t){return t.indexOf("\\")<0?t:t.replace(u,"$1")},e.unescapeAll=function(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(c,(function(t,e,n){return e||function(t,e){var n=0;return o(h,e)?h[e]:35===e.charCodeAt(0)&&l.test(e)&&a(n="x"===e[1].toLowerCase()?parseInt(e.slice(2),16):parseInt(e.slice(1),10))?s(n):t}(t,n)}))},e.isValidEntityCode=a,e.fromCodePoint=s,e.escapeHtml=function(t){return f.test(t)?t.replace(d,v):t},e.arrayReplaceAt=function(t,e,n){return[].concat(t.slice(0,e),n,t.slice(e+1))},e.isSpace=function(t){switch(t){case 9:case 32:return!0}return!1},e.isWhiteSpace=function(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1},e.isMdAsciiPunct=function(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}},e.isPunctChar=function(t){return g.test(t)},e.escapeRE=function(t){return t.replace(m,"\\$&")},e.normalizeReference=function(t){return t=t.trim().replace(/\s+/g," "),"\u1e7e"==="\u1e9e".toLowerCase()&&(t=t.replace(/\u1e9e/g,"\xdf")),t.toLowerCase().toUpperCase()}},function(t,e,n){"use strict";var r=n(2),i=n(14),o=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return o(i(t),e)}},function(t,e,n){"use strict";var r=n(45),i=String;t.exports=function(t){if("Symbol"===r(t))throw new TypeError("Cannot convert a Symbol value to a string");return i(t)}},function(t,e,n){"use strict";var r=n(24),i=Object;t.exports=function(t){return i(r(t))}},function(t,e,n){"use strict";var r=n(4),i=n(158),o=n(159),a=n(5),s=n(49),u=TypeError,c=Object.defineProperty,l=Object.getOwnPropertyDescriptor,h="enumerable",f="configurable",d="writable";e.f=r?o?function(t,e,n){if(a(t),e=s(e),a(n),"function"===typeof t&&"prototype"===e&&"value"in n&&d in n&&!n.writable){var r=l(t,e);r&&r.writable&&(t[e]=n.value,n={configurable:f in n?n.configurable:r.configurable,enumerable:h in n?n.enumerable:r.enumerable,writable:!1})}return c(t,e,n)}:c:function(t,e,n){if(a(t),e=s(e),a(n),i)try{return c(t,e,n)}catch(r){}if("get"in n||"set"in n)throw new u("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){"use strict";var r=n(8),i=n(15),o=n(117),a=n(116);t.exports=function(t,e,n,s){s||(s={});var u=s.enumerable,c=void 0!==s.name?s.name:e;if(r(n)&&o(n,c,s),s.global)u?t[e]=n:a(e,n);else{try{s.unsafe?t[e]&&(u=!0):delete t[e]}catch(l){}u?t[e]=n:i.f(t,e,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return t}},function(t,e,n){"use strict";var r=n(31);t.exports=function(t){return r(t.length)}},function(t,e,n){"use strict";var r=n(8),i=n(59),o=TypeError;t.exports=function(t){if(r(t))return t;throw new o(i(t)+" is not a function")}},function(t,e,n){"use strict";var r=n(41),i=n(2),o=n(76),a=n(14),s=n(17),u=n(82),c=i([].push),l=function(t){var e=1===t,n=2===t,i=3===t,l=4===t,h=6===t,f=7===t,d=5===t||h;return function(p,v,m,g){for(var y,b,w=a(p),_=o(w),x=s(_),k=r(v,m),S=0,C=g||u,M=e?C(p,x):n||f?C(p,0):void 0;x>S;S++)if((d||S in _)&&(b=k(y=_[S],S,w),t))if(e)M[S]=b;else if(b)switch(t){case 3:return!0;case 5:return y;case 6:return S;case 2:c(M,y)}else switch(t){case 4:return!1;case 7:c(M,y)}return h?-1:i||l?l:M}};t.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},function(t,e,n){"use strict";var r=n(4),i=n(9),o=n(93),a=n(48),s=n(23),u=n(49),c=n(12),l=n(158),h=Object.getOwnPropertyDescriptor;e.f=r?h:function(t,e){if(t=s(t),e=u(e),l)try{return h(t,e)}catch(n){}if(c(t,e))return a(!i(o.f,t,e),t[e])}},function(t,e,n){"use strict";t.exports=!1},function(t,e,n){"use strict";var r,i,o,a=n(160),s=n(3),u=n(6),c=n(40),l=n(12),h=n(115),f=n(96),d=n(78),p="Object already initialized",v=s.TypeError,m=s.WeakMap;if(a||h.state){var g=h.state||(h.state=new m);g.get=g.get,g.has=g.has,g.set=g.set,r=function(t,e){if(g.has(t))throw new v(p);return e.facade=t,g.set(t,e),e},i=function(t){return g.get(t)||{}},o=function(t){return g.has(t)}}else{var y=f("state");d[y]=!0,r=function(t,e){if(l(t,y))throw new v(p);return e.facade=t,c(t,y,e),e},i=function(t){return l(t,y)?t[y]:{}},o=function(t){return l(t,y)}}t.exports={set:r,get:i,has:o,enforce:function(t){return o(t)?i(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=i(e)).type!==t)throw new v("Incompatible receiver, "+t+" required");return n}}}},function(t,e,n){"use strict";var r=n(76),i=n(24);t.exports=function(t){return r(i(t))}},function(t,e,n){"use strict";var r=n(35),i=TypeError;t.exports=function(t){if(r(t))throw new i("Can't call method on "+t);return t}},function(t,e,n){"use strict";var r=n(3),i=n(8),o=function(t){return i(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?o(r[t]):r[t]&&r[t][e]}},function(t,e,n){"use strict";var r=n(165),i=n(12),o=n(164),a=n(15).f;t.exports=function(t){var e=r.Symbol||(r.Symbol={});i(e,t)||a(e,t,{value:o.f(t)})}},function(t,e,n){"use strict";var r=n(2),i=n(24),o=n(13),a=/"/g,s=r("".replace);t.exports=function(t,e,n,r){var u=o(i(t)),c="<"+e;return""!==n&&(c+=" "+n+'="'+s(o(r),a,""")+'"'),c+">"+u+"</"+e+">"}},function(t,e,n){"use strict";var r=n(1);t.exports=function(t){return r((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}))}},function(t,e,n){"use strict";var r=n(2),i=r({}.toString),o=r("".slice);t.exports=function(t){return o(i(t),8,-1)}},function(t,e,n){"use strict";var r=n(162);t.exports=function(t){var e=+t;return e!==e||0===e?0:r(e)}},function(t,e,n){"use strict";var r=n(30),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},function(t,e,n){"use strict";var r=n(2);t.exports=r([].slice)},function(t,e,n){"use strict";var r=n(15).f,i=n(12),o=n(7)("toStringTag");t.exports=function(t,e,n){t&&!n&&(t=t.prototype),t&&!i(t,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){var r,i,o,a;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})(t)}a=function(t){"use strict";function e(t){var e,n,r,i;for(n=1,r=arguments.length;n<r;n++)for(e in i=arguments[n])t[e]=i[e];return t}var n=Object.create||function(){function t(){}return function(e){return t.prototype=e,new t}}();function r(t,e){var n=Array.prototype.slice;if(t.bind)return t.bind.apply(t,n.call(arguments,1));var r=n.call(arguments,2);return function(){return t.apply(e,r.length?r.concat(n.call(arguments)):arguments)}}var i=0;function o(t){return t._leaflet_id=t._leaflet_id||++i,t._leaflet_id}function a(t,e,n){var r,i,o,a;return a=function(){r=!1,i&&(o.apply(n,i),i=!1)},o=function(){r?i=arguments:(t.apply(n,arguments),setTimeout(a,e),r=!0)}}function u(t,e,n){var r=e[1],i=e[0],o=r-i;return t===r&&n?t:((t-i)%o+o)%o+i}function c(){return!1}function l(t,e){var n=Math.pow(10,void 0===e?6:e);return Math.round(t*n)/n}function h(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function f(t){return h(t).split(/\s+/)}function d(t,e){for(var r in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?n(t.options):{}),e)t.options[r]=e[r];return t.options}function p(t,e,n){var r=[];for(var i in t)r.push(encodeURIComponent(n?i.toUpperCase():i)+"="+encodeURIComponent(t[i]));return(e&&-1!==e.indexOf("?")?"&":"?")+r.join("&")}var v=/\{ *([\w_-]+) *\}/g;function m(t,e){return t.replace(v,(function(t,n){var r=e[n];if(void 0===r)throw new Error("No value provided for variable "+t);return"function"===typeof r&&(r=r(e)),r}))}var g=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function y(t,e){for(var n=0;n<t.length;n++)if(t[n]===e)return n;return-1}var b="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function w(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var _=0;function x(t){var e=+new Date,n=Math.max(0,16-(e-_));return _=e+n,window.setTimeout(t,n)}var k=window.requestAnimationFrame||w("RequestAnimationFrame")||x,S=window.cancelAnimationFrame||w("CancelAnimationFrame")||w("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function C(t,e,n){if(!n||k!==x)return k.call(window,r(t,e));t.call(e)}function M(t){t&&S.call(window,t)}var E={extend:e,create:n,bind:r,lastId:i,stamp:o,throttle:a,wrapNum:u,falseFn:c,formatNum:l,trim:h,splitWords:f,setOptions:d,getParamString:p,template:m,isArray:g,indexOf:y,emptyImageUrl:b,requestFn:k,cancelFn:S,requestAnimFrame:C,cancelAnimFrame:M};function T(){}T.extend=function(t){var r=function(){this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},i=r.__super__=this.prototype,o=n(i);for(var a in o.constructor=r,r.prototype=o,this)Object.prototype.hasOwnProperty.call(this,a)&&"prototype"!==a&&"__super__"!==a&&(r[a]=this[a]);return t.statics&&(e(r,t.statics),delete t.statics),t.includes&&(function(t){if("undefined"!==typeof L&&L&&L.Mixin){t=g(t)?t:[t];for(var e=0;e<t.length;e++)t[e]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}}(t.includes),e.apply(null,[o].concat(t.includes)),delete t.includes),o.options&&(t.options=e(n(o.options),t.options)),e(o,t),o._initHooks=[],o.callInitHooks=function(){if(!this._initHooksCalled){i.callInitHooks&&i.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=o._initHooks.length;t<e;t++)o._initHooks[t].call(this)}},r},T.include=function(t){return e(this.prototype,t),this},T.mergeOptions=function(t){return e(this.prototype.options,t),this},T.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),n="function"===typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(n),this};var A={on:function(t,e,n){if("object"===s(t))for(var r in t)this._on(r,t[r],e);else for(var i=0,o=(t=f(t)).length;i<o;i++)this._on(t[i],e,n);return this},off:function(t,e,n){if(t)if("object"===s(t))for(var r in t)this._off(r,t[r],e);else for(var i=0,o=(t=f(t)).length;i<o;i++)this._off(t[i],e,n);else delete this._events;return this},_on:function(t,e,n){this._events=this._events||{};var r=this._events[t];r||(r=[],this._events[t]=r),n===this&&(n=void 0);for(var i={fn:e,ctx:n},o=r,a=0,s=o.length;a<s;a++)if(o[a].fn===e&&o[a].ctx===n)return;o.push(i)},_off:function(t,e,n){var r,i,o;if(this._events&&(r=this._events[t]))if(e){if(n===this&&(n=void 0),r)for(i=0,o=r.length;i<o;i++){var a=r[i];if(a.ctx===n&&a.fn===e)return a.fn=c,this._firingCount&&(this._events[t]=r=r.slice()),void r.splice(i,1)}}else{for(i=0,o=r.length;i<o;i++)r[i].fn=c;delete this._events[t]}},fire:function(t,n,r){if(!this.listens(t,r))return this;var i=e({},n,{type:t,target:this,sourceTarget:n&&n.sourceTarget||this});if(this._events){var o=this._events[t];if(o){this._firingCount=this._firingCount+1||1;for(var a=0,s=o.length;a<s;a++){var u=o[a];u.fn.call(u.ctx||this,i)}this._firingCount--}}return r&&this._propagateEvent(i),this},listens:function(t,e){var n=this._events&&this._events[t];if(n&&n.length)return!0;if(e)for(var r in this._eventParents)if(this._eventParents[r].listens(t,e))return!0;return!1},once:function(t,e,n){if("object"===s(t)){for(var i in t)this.once(i,t[i],e);return this}var o=r((function(){this.off(t,e,n).off(t,o,n)}),this);return this.on(t,e,n).on(t,o,n)},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[o(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[o(t)],this},_propagateEvent:function(t){for(var n in this._eventParents)this._eventParents[n].fire(t.type,e({layer:t.target,propagatedFrom:t.target},t),!0)}};A.addEventListener=A.on,A.removeEventListener=A.clearAllEventListeners=A.off,A.addOneTimeEventListener=A.once,A.fireEvent=A.fire,A.hasEventListeners=A.listens;var O=T.extend(A);function D(t,e,n){this.x=n?Math.round(t):t,this.y=n?Math.round(e):e}var P=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};function N(t,e,n){return t instanceof D?t:g(t)?new D(t[0],t[1]):void 0===t||null===t?t:"object"===s(t)&&"x"in t&&"y"in t?new D(t.x,t.y):new D(t,e,n)}function R(t,e){if(t)for(var n=e?[t,e]:t,r=0,i=n.length;r<i;r++)this.extend(n[r])}function I(t,e){return!t||t instanceof R?t:new R(t,e)}function z(t,e){if(t)for(var n=e?[t,e]:t,r=0,i=n.length;r<i;r++)this.extend(n[r])}function B(t,e){return t instanceof z?t:new z(t,e)}function j(t,e,n){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==n&&(this.alt=+n)}function F(t,e,n){return t instanceof j?t:g(t)&&"object"!==s(t[0])?3===t.length?new j(t[0],t[1],t[2]):2===t.length?new j(t[0],t[1]):null:void 0===t||null===t?t:"object"===s(t)&&"lat"in t?new j(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new j(t,e,n)}D.prototype={clone:function(){return new D(this.x,this.y)},add:function(t){return this.clone()._add(N(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(N(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new D(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new D(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=P(this.x),this.y=P(this.y),this},distanceTo:function(t){var e=(t=N(t)).x-this.x,n=t.y-this.y;return Math.sqrt(e*e+n*n)},equals:function(t){return(t=N(t)).x===this.x&&t.y===this.y},contains:function(t){return t=N(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+l(this.x)+", "+l(this.y)+")"}},R.prototype={extend:function(t){return t=N(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new D((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new D(this.min.x,this.max.y)},getTopRight:function(){return new D(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,n;return(t="number"===typeof t[0]||t instanceof D?N(t):I(t))instanceof R?(e=t.min,n=t.max):e=n=t,e.x>=this.min.x&&n.x<=this.max.x&&e.y>=this.min.y&&n.y<=this.max.y},intersects:function(t){t=I(t);var e=this.min,n=this.max,r=t.min,i=t.max,o=i.x>=e.x&&r.x<=n.x,a=i.y>=e.y&&r.y<=n.y;return o&&a},overlaps:function(t){t=I(t);var e=this.min,n=this.max,r=t.min,i=t.max,o=i.x>e.x&&r.x<n.x,a=i.y>e.y&&r.y<n.y;return o&&a},isValid:function(){return!(!this.min||!this.max)}},z.prototype={extend:function(t){var e,n,r=this._southWest,i=this._northEast;if(t instanceof j)e=t,n=t;else{if(!(t instanceof z))return t?this.extend(F(t)||B(t)):this;if(e=t._southWest,n=t._northEast,!e||!n)return this}return r||i?(r.lat=Math.min(e.lat,r.lat),r.lng=Math.min(e.lng,r.lng),i.lat=Math.max(n.lat,i.lat),i.lng=Math.max(n.lng,i.lng)):(this._southWest=new j(e.lat,e.lng),this._northEast=new j(n.lat,n.lng)),this},pad:function(t){var e=this._southWest,n=this._northEast,r=Math.abs(e.lat-n.lat)*t,i=Math.abs(e.lng-n.lng)*t;return new z(new j(e.lat-r,e.lng-i),new j(n.lat+r,n.lng+i))},getCenter:function(){return new j((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new j(this.getNorth(),this.getWest())},getSouthEast:function(){return new j(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t="number"===typeof t[0]||t instanceof j||"lat"in t?F(t):B(t);var e,n,r=this._southWest,i=this._northEast;return t instanceof z?(e=t.getSouthWest(),n=t.getNorthEast()):e=n=t,e.lat>=r.lat&&n.lat<=i.lat&&e.lng>=r.lng&&n.lng<=i.lng},intersects:function(t){t=B(t);var e=this._southWest,n=this._northEast,r=t.getSouthWest(),i=t.getNorthEast(),o=i.lat>=e.lat&&r.lat<=n.lat,a=i.lng>=e.lng&&r.lng<=n.lng;return o&&a},overlaps:function(t){t=B(t);var e=this._southWest,n=this._northEast,r=t.getSouthWest(),i=t.getNorthEast(),o=i.lat>e.lat&&r.lat<n.lat,a=i.lng>e.lng&&r.lng<n.lng;return o&&a},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=B(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}},j.prototype={equals:function(t,e){return!!t&&(t=F(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+l(this.lat,t)+", "+l(this.lng,t)+")"},distanceTo:function(t){return V.distance(this,F(t))},wrap:function(){return V.wrapLatLng(this)},toBounds:function(t){var e=180*t/40075017,n=e/Math.cos(Math.PI/180*this.lat);return B([this.lat-e,this.lng-n],[this.lat+e,this.lng+n])},clone:function(){return new j(this.lat,this.lng,this.alt)}};var q,$={latLngToPoint:function(t,e){var n=this.projection.project(t),r=this.scale(e);return this.transformation._transform(n,r)},pointToLatLng:function(t,e){var n=this.scale(e),r=this.transformation.untransform(t,n);return this.projection.unproject(r)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var e=this.projection.bounds,n=this.scale(t);return new R(this.transformation.transform(e.min,n),this.transformation.transform(e.max,n))},infinite:!1,wrapLatLng:function(t){var e=this.wrapLng?u(t.lng,this.wrapLng,!0):t.lng;return new j(this.wrapLat?u(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),n=this.wrapLatLng(e),r=e.lat-n.lat,i=e.lng-n.lng;if(0===r&&0===i)return t;var o=t.getSouthWest(),a=t.getNorthEast();return new z(new j(o.lat-r,o.lng-i),new j(a.lat-r,a.lng-i))}},V=e({},$,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var n=Math.PI/180,r=t.lat*n,i=e.lat*n,o=Math.sin((e.lat-t.lat)*n/2),a=Math.sin((e.lng-t.lng)*n/2),s=o*o+Math.cos(r)*Math.cos(i)*a*a,u=2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s));return this.R*u}}),U=6378137,H={R:U,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,n=this.MAX_LATITUDE,r=Math.max(Math.min(n,t.lat),-n),i=Math.sin(r*e);return new D(this.R*t.lng*e,this.R*Math.log((1+i)/(1-i))/2)},unproject:function(t){var e=180/Math.PI;return new j((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:(q=U*Math.PI,new R([-q,-q],[q,q]))};function W(t,e,n,r){if(g(t))return this._a=t[0],this._b=t[1],this._c=t[2],void(this._d=t[3]);this._a=t,this._b=e,this._c=n,this._d=r}function Z(t,e,n,r){return new W(t,e,n,r)}W.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new D((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}};var J=e({},V,{code:"EPSG:3857",projection:H,transformation:function(){var t=.5/(Math.PI*H.R);return Z(t,.5,-t,.5)}()}),Y=e({},J,{code:"EPSG:900913"});function K(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function G(t,e){var n,r,i,o,a,s,u="";for(n=0,i=t.length;n<i;n++){for(r=0,o=(a=t[n]).length;r<o;r++)u+=(r?"L":"M")+(s=a[r]).x+" "+s.y;u+=e?At?"z":"x":""}return u||"M0 0"}var X=document.documentElement.style,Q="ActiveXObject"in window,tt=Q&&!document.addEventListener,et="msLaunchUri"in navigator&&!("documentMode"in document),nt=Dt("webkit"),rt=Dt("android"),it=Dt("android 2")||Dt("android 3"),ot=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),at=rt&&Dt("Google")&&ot<537&&!("AudioNode"in window),st=!!window.opera,ut=!et&&Dt("chrome"),ct=Dt("gecko")&&!nt&&!st&&!Q,lt=!ut&&Dt("safari"),ht=Dt("phantom"),ft="OTransition"in X,dt=0===navigator.platform.indexOf("Win"),pt=Q&&"transition"in X,vt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!it,mt="MozPerspective"in X,gt=!window.L_DISABLE_3D&&(pt||vt||mt)&&!ft&&!ht,yt="undefined"!==typeof orientation||Dt("mobile"),bt=yt&&nt,wt=yt&&vt,_t=!window.PointerEvent&&window.MSPointerEvent,xt=!(!window.PointerEvent&&!_t),kt=!window.L_NO_TOUCH&&(xt||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch),St=yt&&st,Ct=yt&&ct,Mt=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Et=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",c,e),window.removeEventListener("testPassiveEventSupport",c,e)}catch(n){}return t}(),Tt=!!document.createElement("canvas").getContext,At=!(!document.createElementNS||!K("svg").createSVGRect),Ot=!At&&function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var e=t.firstChild;return e.style.behavior="url(#default#VML)",e&&"object"===s(e.adj)}catch(n){return!1}}();function Dt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var Pt={ie:Q,ielt9:tt,edge:et,webkit:nt,android:rt,android23:it,androidStock:at,opera:st,chrome:ut,gecko:ct,safari:lt,phantom:ht,opera12:ft,win:dt,ie3d:pt,webkit3d:vt,gecko3d:mt,any3d:gt,mobile:yt,mobileWebkit:bt,mobileWebkit3d:wt,msPointer:_t,pointer:xt,touch:kt,mobileOpera:St,mobileGecko:Ct,retina:Mt,passiveEvents:Et,canvas:Tt,svg:At,vml:Ot},Lt=_t?"MSPointerDown":"pointerdown",Nt=_t?"MSPointerMove":"pointermove",Rt=_t?"MSPointerUp":"pointerup",It=_t?"MSPointerCancel":"pointercancel",zt={},Bt=!1;function jt(t,e,n,i){return"touchstart"===e?function(t,e,n){var i=r((function(t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&Ie(t),Vt(t,e)}));t["_leaflet_touchstart"+n]=i,t.addEventListener(Lt,i,!1),Bt||(document.addEventListener(Lt,Ft,!0),document.addEventListener(Nt,qt,!0),document.addEventListener(Rt,$t,!0),document.addEventListener(It,$t,!0),Bt=!0)}(t,n,i):"touchmove"===e?function(t,e,n){var r=function(t){t.pointerType===(t.MSPOINTER_TYPE_MOUSE||"mouse")&&0===t.buttons||Vt(t,e)};t["_leaflet_touchmove"+n]=r,t.addEventListener(Nt,r,!1)}(t,n,i):"touchend"===e&&function(t,e,n){var r=function(t){Vt(t,e)};t["_leaflet_touchend"+n]=r,t.addEventListener(Rt,r,!1),t.addEventListener(It,r,!1)}(t,n,i),this}function Ft(t){zt[t.pointerId]=t}function qt(t){zt[t.pointerId]&&(zt[t.pointerId]=t)}function $t(t){delete zt[t.pointerId]}function Vt(t,e){for(var n in t.touches=[],zt)t.touches.push(zt[n]);t.changedTouches=[t],e(t)}var Ut,Ht,Wt,Zt,Jt,Yt=_t?"MSPointerDown":xt?"pointerdown":"touchstart",Kt=_t?"MSPointerUp":xt?"pointerup":"touchend",Gt="_leaflet_",Xt=pe(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Qt=pe(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),te="webkitTransition"===Qt||"OTransition"===Qt?Qt+"End":"transitionend";function ee(t){return"string"===typeof t?document.getElementById(t):t}function ne(t,e){var n=t.style[e]||t.currentStyle&&t.currentStyle[e];if((!n||"auto"===n)&&document.defaultView){var r=document.defaultView.getComputedStyle(t,null);n=r?r[e]:null}return"auto"===n?null:n}function re(t,e,n){var r=document.createElement(t);return r.className=e||"",n&&n.appendChild(r),r}function ie(t){var e=t.parentNode;e&&e.removeChild(t)}function oe(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function ae(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function se(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ue(t,e){if(void 0!==t.classList)return t.classList.contains(e);var n=fe(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)}function ce(t,e){if(void 0!==t.classList)for(var n=f(e),r=0,i=n.length;r<i;r++)t.classList.add(n[r]);else if(!ue(t,e)){var o=fe(t);he(t,(o?o+" ":"")+e)}}function le(t,e){void 0!==t.classList?t.classList.remove(e):he(t,h((" "+fe(t)+" ").replace(" "+e+" "," ")))}function he(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function fe(t){return t.correspondingElement&&(t=t.correspondingElement),void 0===t.className.baseVal?t.className:t.className.baseVal}function de(t,e){"opacity"in t.style?t.style.opacity=e:"filter"in t.style&&function(t,e){var n=!1,r="DXImageTransform.Microsoft.Alpha";try{n=t.filters.item(r)}catch(i){if(1===e)return}e=Math.round(100*e),n?(n.Enabled=100!==e,n.Opacity=e):t.style.filter+=" progid:"+r+"(opacity="+e+")"}(t,e)}function pe(t){for(var e=document.documentElement.style,n=0;n<t.length;n++)if(t[n]in e)return t[n];return!1}function ve(t,e,n){var r=e||new D(0,0);t.style[Xt]=(pt?"translate("+r.x+"px,"+r.y+"px)":"translate3d("+r.x+"px,"+r.y+"px,0)")+(n?" scale("+n+")":"")}function me(t,e){t._leaflet_pos=e,gt?ve(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function ge(t){return t._leaflet_pos||new D(0,0)}if("onselectstart"in document)Ut=function(){Me(window,"selectstart",Ie)},Ht=function(){Te(window,"selectstart",Ie)};else{var ye=pe(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Ut=function(){if(ye){var t=document.documentElement.style;Wt=t[ye],t[ye]="none"}},Ht=function(){ye&&(document.documentElement.style[ye]=Wt,Wt=void 0)}}function be(){Me(window,"dragstart",Ie)}function we(){Te(window,"dragstart",Ie)}function _e(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(xe(),Zt=t,Jt=t.style.outline,t.style.outline="none",Me(window,"keydown",xe))}function xe(){Zt&&(Zt.style.outline=Jt,Zt=void 0,Jt=void 0,Te(window,"keydown",xe))}function ke(t){do{t=t.parentNode}while((!t.offsetWidth||!t.offsetHeight)&&t!==document.body);return t}function Se(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}var Ce={TRANSFORM:Xt,TRANSITION:Qt,TRANSITION_END:te,get:ee,getStyle:ne,create:re,remove:ie,empty:oe,toFront:ae,toBack:se,hasClass:ue,addClass:ce,removeClass:le,setClass:he,getClass:fe,setOpacity:de,testProp:pe,setTransform:ve,setPosition:me,getPosition:ge,disableTextSelection:Ut,enableTextSelection:Ht,disableImageDrag:be,enableImageDrag:we,preventOutline:_e,restoreOutline:xe,getSizedParentNode:ke,getScale:Se};function Me(t,e,n,r){if("object"===s(e))for(var i in e)De(t,i,e[i],n);else for(var o=0,a=(e=f(e)).length;o<a;o++)De(t,e[o],n,r);return this}var Ee="_leaflet_events";function Te(t,e,n,r){if("object"===s(e))for(var i in e)Pe(t,i,e[i],n);else if(e)for(var o=0,a=(e=f(e)).length;o<a;o++)Pe(t,e[o],n,r);else{for(var u in t[Ee])Pe(t,u,t[Ee][u]);delete t[Ee]}return this}function Ae(){if(xt)return!(et||lt)}var Oe={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function De(t,e,n,r){var i=e+o(n)+(r?"_"+o(r):"");if(t[Ee]&&t[Ee][i])return this;var a=function(e){return n.call(r||t,e||window.event)},s=a;xt&&0===e.indexOf("touch")?jt(t,e,a,i):kt&&"dblclick"===e&&!Ae()?function(t,e,n){var r,i,o=!1;function a(t){if(xt){if(!t.isPrimary)return;if("mouse"===t.pointerType)return}else if(t.touches.length>1)return;var e=Date.now(),n=e-(r||e);i=t.touches?t.touches[0]:t,o=n>0&&n<=250,r=e}function s(t){if(o&&!i.cancelBubble){if(xt){if("mouse"===t.pointerType)return;var n,a,s={};for(a in i)n=i[a],s[a]=n&&n.bind?n.bind(i):n;i=s}i.type="dblclick",i.button=0,e(i),r=null}}t[Gt+Yt+n]=a,t[Gt+Kt+n]=s,t[Gt+"dblclick"+n]=e,t.addEventListener(Yt,a,!!Et&&{passive:!1}),t.addEventListener(Kt,s,!!Et&&{passive:!1}),t.addEventListener("dblclick",e,!1)}(t,a,i):"addEventListener"in t?"touchstart"===e||"touchmove"===e||"wheel"===e||"mousewheel"===e?t.addEventListener(Oe[e]||e,a,!!Et&&{passive:!1}):"mouseenter"===e||"mouseleave"===e?(a=function(e){e=e||window.event,Ue(t,e)&&s(e)},t.addEventListener(Oe[e],a,!1)):t.addEventListener(e,s,!1):"attachEvent"in t&&t.attachEvent("on"+e,a),t[Ee]=t[Ee]||{},t[Ee][i]=a}function Pe(t,e,n,r){var i=e+o(n)+(r?"_"+o(r):""),a=t[Ee]&&t[Ee][i];if(!a)return this;xt&&0===e.indexOf("touch")?function(t,e,n){var r=t["_leaflet_"+e+n];"touchstart"===e?t.removeEventListener(Lt,r,!1):"touchmove"===e?t.removeEventListener(Nt,r,!1):"touchend"===e&&(t.removeEventListener(Rt,r,!1),t.removeEventListener(It,r,!1))}(t,e,i):kt&&"dblclick"===e&&!Ae()?function(t,e){var n=t[Gt+Yt+e],r=t[Gt+Kt+e],i=t[Gt+"dblclick"+e];t.removeEventListener(Yt,n,!!Et&&{passive:!1}),t.removeEventListener(Kt,r,!!Et&&{passive:!1}),t.removeEventListener("dblclick",i,!1)}(t,i):"removeEventListener"in t?t.removeEventListener(Oe[e]||e,a,!1):"detachEvent"in t&&t.detachEvent("on"+e,a),t[Ee][i]=null}function Le(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,Ve(t),this}function Ne(t){return De(t,"wheel",Le),this}function Re(t){return Me(t,"mousedown touchstart dblclick",Le),De(t,"click",$e),this}function Ie(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function ze(t){return Ie(t),Le(t),this}function Be(t,e){if(!e)return new D(t.clientX,t.clientY);var n=Se(e),r=n.boundingClientRect;return new D((t.clientX-r.left)/n.x-e.clientLeft,(t.clientY-r.top)/n.y-e.clientTop)}var je=dt&&ut?2*window.devicePixelRatio:ct?window.devicePixelRatio:1;function Fe(t){return et?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/je:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}var qe={};function $e(t){qe[t.type]=!0}function Ve(t){var e=qe[t.type];return qe[t.type]=!1,e}function Ue(t,e){var n=e.relatedTarget;if(!n)return!0;try{for(;n&&n!==t;)n=n.parentNode}catch(r){return!1}return n!==t}var He={on:Me,off:Te,stopPropagation:Le,disableScrollPropagation:Ne,disableClickPropagation:Re,preventDefault:Ie,stop:ze,getMousePosition:Be,getWheelDelta:Fe,fakeStop:$e,skipped:Ve,isExternalTarget:Ue,addListener:Me,removeListener:Te},We=O.extend({run:function(t,e,n,r){this.stop(),this._el=t,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(r||.5,.2),this._startPos=ge(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=C(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,n=1e3*this._duration;e<n?this._runFrame(this._easeOut(e/n),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){var n=this._startPos.add(this._offset.multiplyBy(t));e&&n._round(),me(this._el,n),this.fire("step")},_complete:function(){M(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),Ze=O.extend({options:{crs:J,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=d(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=r(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(F(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Qt&>&&!St&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Me(this._proxy,te,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,n,r){return n=void 0===n?this._zoom:this._limitZoom(n),t=this._limitCenter(F(t),n,this.options.maxBounds),r=r||{},this._stop(),this._loaded&&!r.reset&&!0!==r&&(void 0!==r.animate&&(r.zoom=e({animate:r.animate},r.zoom),r.pan=e({animate:r.animate,duration:r.duration},r.pan)),this._zoom!==n?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,n,r.zoom):this._tryAnimatedPan(t,r.pan))?(clearTimeout(this._sizeTimer),this):(this._resetView(t,n),this)},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(gt?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(gt?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,n){var r=this.getZoomScale(e),i=this.getSize().divideBy(2),o=(t instanceof D?t:this.latLngToContainerPoint(t)).subtract(i).multiplyBy(1-1/r),a=this.containerPointToLatLng(i.add(o));return this.setView(a,e,{zoom:n})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():B(t);var n=N(e.paddingTopLeft||e.padding||[0,0]),r=N(e.paddingBottomRight||e.padding||[0,0]),i=this.getBoundsZoom(t,!1,n.add(r));if((i="number"===typeof e.maxZoom?Math.min(e.maxZoom,i):i)===1/0)return{center:t.getCenter(),zoom:i};var o=r.subtract(n).divideBy(2),a=this.project(t.getSouthWest(),i),s=this.project(t.getNorthEast(),i);return{center:this.unproject(a.add(s).divideBy(2).add(o),i),zoom:i}},fitBounds:function(t,e){if(!(t=B(t)).isValid())throw new Error("Bounds are not valid.");var n=this._getBoundsCenterZoom(t,e);return this.setView(n.center,n.zoom,e)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){if(e=e||{},!(t=N(t).round()).x&&!t.y)return this.fire("moveend");if(!0!==e.animate&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new We,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){ce(this._mapPane,"leaflet-pan-anim");var n=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,n,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,e,n){if(!1===(n=n||{}).animate||!gt)return this.setView(t,e,n);this._stop();var r=this.project(this.getCenter()),i=this.project(t),o=this.getSize(),a=this._zoom;t=F(t),e=void 0===e?a:e;var s=Math.max(o.x,o.y),u=s*this.getZoomScale(a,e),c=i.distanceTo(r)||1,l=1.42,h=2.0164;function f(t){var e=(u*u-s*s+(t?-1:1)*h*h*c*c)/(2*(t?u:s)*h*c),n=Math.sqrt(e*e+1)-e;return n<1e-9?-18:Math.log(n)}function d(t){return(Math.exp(t)-Math.exp(-t))/2}function p(t){return(Math.exp(t)+Math.exp(-t))/2}var v=f(0);function m(t){return s*(p(v)*(d(e=v+l*t)/p(e))-d(v))/h;var e}var g=Date.now(),y=(f(1)-v)/l,b=n.duration?1e3*n.duration:1e3*y*.8;return this._moveStart(!0,n.noMoveStart),function n(){var o=(Date.now()-g)/b,u=function(t){return 1-Math.pow(1-t,1.5)}(o)*y;o<=1?(this._flyToFrame=C(n,this),this._move(this.unproject(r.add(i.subtract(r).multiplyBy(m(u)/c)),a),this.getScaleZoom(s/function(t){return s*(p(v)/p(v+l*t))}(u),a),{flyTo:!0})):this._move(t,e)._moveEnd(!0)}.call(this),this},flyToBounds:function(t,e){var n=this._getBoundsCenterZoom(t,e);return this.flyTo(n.center,n.zoom,e)},setMaxBounds:function(t){return(t=B(t)).isValid()?(this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this.off("moveend",this._panInsideMaxBounds))},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var n=this.getCenter(),r=this._limitCenter(n,this._zoom,B(t));return n.equals(r)||this.panTo(r,e),this._enforcingBounds=!1,this},panInside:function(t,e){var n=N((e=e||{}).paddingTopLeft||e.padding||[0,0]),r=N(e.paddingBottomRight||e.padding||[0,0]),i=this.getCenter(),o=this.project(i),a=this.project(t),s=this.getPixelBounds(),u=s.getSize().divideBy(2),c=I([s.min.add(n),s.max.subtract(r)]);if(!c.contains(a)){this._enforcingBounds=!0;var l=o.subtract(a),h=N(a.x+l.x,a.y+l.y);(a.x<c.min.x||a.x>c.max.x)&&(h.x=o.x-l.x,l.x>0?h.x+=u.x-n.x:h.x-=u.x-r.x),(a.y<c.min.y||a.y>c.max.y)&&(h.y=o.y-l.y,l.y>0?h.y+=u.y-n.y:h.y-=u.y-r.y),this.panTo(this.unproject(h),e),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=e({animate:!1,pan:!0},!0===t?{animate:!0}:t);var n=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var i=this.getSize(),o=n.divideBy(2).round(),a=i.divideBy(2).round(),s=o.subtract(a);return s.x||s.y?(t.animate&&t.pan?this.panBy(s):(t.pan&&this._rawPanBy(s),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(r(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:n,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=e({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var n=r(this._handleGeolocationResponse,this),i=r(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,i,t):navigator.geolocation.getCurrentPosition(n,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,n=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+n+"."})},_handleGeolocationResponse:function(t){var e=new j(t.coords.latitude,t.coords.longitude),n=e.toBounds(2*t.coords.accuracy),r=this._locateOptions;if(r.setView){var i=this.getBoundsZoom(n);this.setView(e,r.maxZoom?Math.min(i,r.maxZoom):i)}var o={latlng:e,bounds:n,timestamp:t.timestamp};for(var a in t.coords)"number"===typeof t.coords[a]&&(o[a]=t.coords[a]);this.fire("locationfound",o)},addHandler:function(t,e){if(!e)return this;var n=this[t]=new e(this);return this._handlers.push(n),this.options[t]&&n.enable(),this},remove:function(){if(this._initEvents(!0),this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(e){this._container._leaflet_id=void 0,this._containerId=void 0}var t;for(t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),ie(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(M(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)ie(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){var n=re("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new z(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,n){t=B(t),n=N(n||[0,0]);var r=this.getZoom()||0,i=this.getMinZoom(),o=this.getMaxZoom(),a=t.getNorthWest(),s=t.getSouthEast(),u=this.getSize().subtract(n),c=I(this.project(s,r),this.project(a,r)).getSize(),l=gt?this.options.zoomSnap:1,h=u.x/c.x,f=u.y/c.y,d=e?Math.max(h,f):Math.min(h,f);return r=this.getScaleZoom(d,r),l&&(r=Math.round(r/(l/100))*(l/100),r=e?Math.ceil(r/l)*l:Math.floor(r/l)*l),Math.max(i,Math.min(o,r))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new D(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){var n=this._getTopLeftPoint(t,e);return new R(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"===typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var n=this.options.crs;return e=void 0===e?this._zoom:e,n.scale(t)/n.scale(e)},getScaleZoom:function(t,e){var n=this.options.crs;e=void 0===e?this._zoom:e;var r=n.zoom(t*n.scale(e));return isNaN(r)?1/0:r},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(F(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(N(t),e)},layerPointToLatLng:function(t){var e=N(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(F(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(F(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(B(t))},distance:function(t,e){return this.options.crs.distance(F(t),F(e))},containerPointToLayerPoint:function(t){return N(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return N(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(N(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(F(t)))},mouseEventToContainerPoint:function(t){return Be(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=ee(t);if(!e)throw new Error("Map container not found.");if(e._leaflet_id)throw new Error("Map container is already initialized.");Me(e,"scroll",this._onScroll,this),this._containerId=o(e)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&>,ce(t,"leaflet-container"+(kt?" leaflet-touch":"")+(Mt?" leaflet-retina":"")+(tt?" leaflet-oldie":"")+(lt?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var e=ne(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),me(this._mapPane,new D(0,0)),this.createPane("tilePane"),this.createPane("shadowPane"),this.createPane("overlayPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(ce(t.markerPane,"leaflet-zoom-hide"),ce(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e){me(this._mapPane,new D(0,0));var n=!this._loaded;this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset");var r=this._zoom!==e;this._moveStart(r,!1)._move(t,e)._moveEnd(r),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,n){void 0===e&&(e=this._zoom);var r=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),(r||n&&n.pinch)&&this.fire("zoom",n),this.fire("move",n)},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return M(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){me(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[o(this._container)]=this;var e=t?Te:Me;e(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),gt&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){M(this._resizeRequest),this._resizeRequest=C((function(){this.invalidateSize({debounceMoveend:!0})}),this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var n,r=[],i="mouseout"===e||"mouseover"===e,a=t.target||t.srcElement,s=!1;a;){if((n=this._targets[o(a)])&&("click"===e||"preclick"===e)&&!t._simulated&&this._draggableMoved(n)){s=!0;break}if(n&&n.listens(e,!0)){if(i&&!Ue(a,t))break;if(r.push(n),i)break}if(a===this._container)break;a=a.parentNode}return r.length||s||i||!Ue(a,t)||(r=[this]),r},_handleDOMEvent:function(t){if(this._loaded&&!Ve(t)){var e=t.type;"mousedown"!==e&&"keypress"!==e&&"keyup"!==e&&"keydown"!==e||_e(t.target||t.srcElement),this._fireDOMEvent(t,e)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,n,r){if("click"===t.type){var i=e({},t);i.type="preclick",this._fireDOMEvent(i,i.type,r)}if(!t._stopped&&(r=(r||[]).concat(this._findEventTargets(t,n))).length){var o=r[0];"contextmenu"===n&&o.listens(n,!0)&&Ie(t);var a={originalEvent:t};if("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type){var s=o.getLatLng&&(!o._radius||o._radius<=10);a.containerPoint=s?this.latLngToContainerPoint(o.getLatLng()):this.mouseEventToContainerPoint(t),a.layerPoint=this.containerPointToLayerPoint(a.containerPoint),a.latlng=s?o.getLatLng():this.layerPointToLatLng(a.layerPoint)}for(var u=0;u<r.length;u++)if(r[u].fire(n,a,!0),a.originalEvent._stopped||!1===r[u].options.bubblingMouseEvents&&-1!==y(this._mouseEvents,n))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return ge(this._mapPane)||new D(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var n=this.getSize()._divideBy(2);return this.project(t,e)._subtract(n)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,n){var r=this._getNewPixelOrigin(n,e);return this.project(t,e)._subtract(r)},_latLngBoundsToNewLayerBounds:function(t,e,n){var r=this._getNewPixelOrigin(n,e);return I([this.project(t.getSouthWest(),e)._subtract(r),this.project(t.getNorthWest(),e)._subtract(r),this.project(t.getSouthEast(),e)._subtract(r),this.project(t.getNorthEast(),e)._subtract(r)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,n){if(!n)return t;var r=this.project(t,e),i=this.getSize().divideBy(2),o=new R(r.subtract(i),r.add(i)),a=this._getBoundsOffset(o,n,e);return a.round().equals([0,0])?t:this.unproject(r.add(a),e)},_limitOffset:function(t,e){if(!e)return t;var n=this.getPixelBounds(),r=new R(n.min.add(t),n.max.add(t));return t.add(this._getBoundsOffset(r,e))},_getBoundsOffset:function(t,e,n){var r=I(this.project(e.getNorthEast(),n),this.project(e.getSouthWest(),n)),i=r.min.subtract(t.min),o=r.max.subtract(t.max);return new D(this._rebound(i.x,-o.x),this._rebound(i.y,-o.y))},_rebound:function(t,e){return t+e>0?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),n=this.getMaxZoom(),r=gt?this.options.zoomSnap:1;return r&&(t=Math.round(t/r)*r),Math.max(e,Math.min(n,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){le(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var n=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(n))&&(this.panBy(n,e),!0)},_createAnimProxy:function(){var t=this._proxy=re("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",(function(t){var e=Xt,n=this._proxy.style[e];ve(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),n===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()}),this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ie(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();ve(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,n){if(this._animatingZoom)return!0;if(n=n||{},!this._zoomAnimated||!1===n.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(e),i=this._getCenterOffset(t)._divideBy(1-1/r);return!(!0!==n.animate&&!this.getSize().contains(i))&&(C((function(){this._moveStart(!0,!1)._animateZoom(t,e,!0)}),this),!0)},_animateZoom:function(t,e,n,i){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,ce(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:i}),setTimeout(r(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&le(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom),C((function(){this._moveEnd(!0)}),this))}}),Je=T.extend({options:{position:"topright"},initialize:function(t){d(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),n=this.getPosition(),r=t._controlCorners[n];return ce(e,"leaflet-control"),-1!==n.indexOf("bottom")?r.insertBefore(e,r.firstChild):r.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ie(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),Ye=function(t){return new Je(t)};Ze.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},e="leaflet-",n=this._controlContainer=re("div",e+"control-container",this._container);function r(r,i){var o=e+r+" "+e+i;t[r+i]=re("div",o,n)}r("top","left"),r("top","right"),r("bottom","left"),r("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ie(this._controlCorners[t]);ie(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Ke=Je.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,n,r){return n<r?-1:r<n?1:0}},initialize:function(t,e,n){for(var r in d(this,n),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,t)this._addLayer(t[r],r);for(r in e)this._addLayer(e[r],r,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return Je.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var e=this._getLayer(o(t));return e&&this._layers.splice(this._layers.indexOf(e),1),this._map?this._update():this},expand:function(){ce(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(ce(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):le(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return le(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=re("div",t),n=this.options.collapsed;e.setAttribute("aria-haspopup",!0),Re(e),Ne(e);var r=this._section=re("section",t+"-list");n&&(this._map.on("click",this.collapse,this),rt||Me(e,{mouseenter:this.expand,mouseleave:this.collapse},this));var i=this._layersLink=re("a",t+"-toggle",e);i.href="#",i.title="Layers",kt?(Me(i,"click",ze),Me(i,"click",this.expand,this)):Me(i,"focus",this.expand,this),n||this.expand(),this._baseLayersList=re("div",t+"-base",r),this._separator=re("div",t+"-separator",r),this._overlaysList=re("div",t+"-overlays",r),e.appendChild(r)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&o(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,n){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:n}),this.options.sortLayers&&this._layers.sort(r((function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)}),this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;oe(this._baseLayersList),oe(this._overlaysList),this._layerControlInputs=[];var t,e,n,r,i=0;for(n=0;n<this._layers.length;n++)r=this._layers[n],this._addItem(r),e=e||r.overlay,t=t||!r.overlay,i+=r.overlay?0:1;return this.options.hideSingleBase&&(t=t&&i>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=e&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(o(t.target)),n=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;n&&this._map.fire(n,e)},_createRadioElement:function(t,e){var n='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",r=document.createElement("div");return r.innerHTML=n,r.firstChild},_addItem:function(t){var e,n=document.createElement("label"),r=this._map.hasLayer(t.layer);t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=r):e=this._createRadioElement("leaflet-base-layers_"+o(this),r),this._layerControlInputs.push(e),e.layerId=o(t.layer),Me(e,"click",this._onInputClick,this);var i=document.createElement("span");i.innerHTML=" "+t.name;var a=document.createElement("div");return n.appendChild(a),a.appendChild(e),a.appendChild(i),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){var t,e,n=this._layerControlInputs,r=[],i=[];this._handlingClick=!0;for(var o=n.length-1;o>=0;o--)t=n[o],e=this._getLayer(t.layerId).layer,t.checked?r.push(e):t.checked||i.push(e);for(o=0;o<i.length;o++)this._map.hasLayer(i[o])&&this._map.removeLayer(i[o]);for(o=0;o<r.length;o++)this._map.hasLayer(r[o])||this._map.addLayer(r[o]);this._handlingClick=!1,this._refocusOnMap()},_checkDisabledLayers:function(){for(var t,e,n=this._layerControlInputs,r=this._map.getZoom(),i=n.length-1;i>=0;i--)t=n[i],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&r<e.options.minZoom||void 0!==e.options.maxZoom&&r>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expand:function(){return this.expand()},_collapse:function(){return this.collapse()}}),Ge=Je.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"−",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",n=re("div",e+" leaflet-bar"),r=this.options;return this._zoomInButton=this._createButton(r.zoomInText,r.zoomInTitle,e+"-in",n,this._zoomIn),this._zoomOutButton=this._createButton(r.zoomOutText,r.zoomOutTitle,e+"-out",n,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),n},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,n,r,i){var o=re("a",n,r);return o.innerHTML=t,o.href="#",o.title=e,o.setAttribute("role","button"),o.setAttribute("aria-label",e),Re(o),Me(o,"click",ze),Me(o,"click",i,this),Me(o,"click",this._refocusOnMap,this),o},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";le(this._zoomInButton,e),le(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMinZoom())&&ce(this._zoomOutButton,e),(this._disabled||t._zoom===t.getMaxZoom())&&ce(this._zoomInButton,e)}});Ze.mergeOptions({zoomControl:!0}),Ze.addInitHook((function(){this.options.zoomControl&&(this.zoomControl=new Ge,this.addControl(this.zoomControl))}));var Xe=Je.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",n=re("div",e),r=this.options;return this._addScales(r,e+"-line",n),t.on(r.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),n},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,n){t.metric&&(this._mScale=re("div",e,n)),t.imperial&&(this._iScale=re("div",e,n))},_update:function(){var t=this._map,e=t.getSize().y/2,n=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(n)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t),n=e<1e3?e+" m":e/1e3+" km";this._updateScale(this._mScale,n,e/t)},_updateImperial:function(t){var e,n,r,i=3.2808399*t;i>5280?(e=i/5280,n=this._getRoundNum(e),this._updateScale(this._iScale,n+" mi",n/e)):(r=this._getRoundNum(i),this._updateScale(this._iScale,r+" ft",r/i))},_updateScale:function(t,e,n){t.style.width=Math.round(this.options.maxWidth*n)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),n=t/e;return e*(n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1)}}),Qe=Je.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JS library for interactive maps">Leaflet</a>'},initialize:function(t){d(this,t),this._attributions={}},onAdd:function(t){for(var e in t.attributionControl=this,this._container=re("div","leaflet-control-attribution"),Re(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),this._container},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var n=[];this.options.prefix&&n.push(this.options.prefix),t.length&&n.push(t.join(", ")),this._container.innerHTML=n.join(" | ")}}});Ze.mergeOptions({attributionControl:!0}),Ze.addInitHook((function(){this.options.attributionControl&&(new Qe).addTo(this)})),Je.Layers=Ke,Je.Zoom=Ge,Je.Scale=Xe,Je.Attribution=Qe,Ye.layers=function(t,e,n){return new Ke(t,e,n)},Ye.zoom=function(t){return new Ge(t)},Ye.scale=function(t){return new Xe(t)},Ye.attribution=function(t){return new Qe(t)};var tn=T.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});tn.addTo=function(t,e){return t.addHandler(e,this),this};var en,nn={Events:A},rn=kt?"touchstart mousedown":"mousedown",on={mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},an={mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"},sn=O.extend({options:{clickTolerance:3},initialize:function(t,e,n,r){d(this,r),this._element=t,this._dragStartTarget=e||t,this._preventOutline=n},enable:function(){this._enabled||(Me(this._dragStartTarget,rn,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(sn._dragging===this&&this.finishDrag(),Te(this._dragStartTarget,rn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(!t._simulated&&this._enabled&&(this._moved=!1,!ue(this._element,"leaflet-zoom-anim")&&!(sn._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches)&&(sn._dragging=this,this._preventOutline&&_e(this._element),be(),Ut(),!this._moving))){this.fire("down");var e=t.touches?t.touches[0]:t,n=ke(this._element);this._startPoint=new D(e.clientX,e.clientY),this._parentScale=Se(n),Me(document,an[t.type],this._onMove,this),Me(document,on[t.type],this._onUp,this)}},_onMove:function(t){if(!t._simulated&&this._enabled)if(t.touches&&t.touches.length>1)this._moved=!0;else{var e=t.touches&&1===t.touches.length?t.touches[0]:t,n=new D(e.clientX,e.clientY)._subtract(this._startPoint);(n.x||n.y)&&(Math.abs(n.x)+Math.abs(n.y)<this.options.clickTolerance||(n.x/=this._parentScale.x,n.y/=this._parentScale.y,Ie(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=ge(this._element).subtract(n),ce(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),ce(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(n),this._moving=!0,M(this._animRequest),this._lastEvent=t,this._animRequest=C(this._updatePosition,this,!0)))}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),me(this._element,this._newPos),this.fire("drag",t)},_onUp:function(t){!t._simulated&&this._enabled&&this.finishDrag()},finishDrag:function(){for(var t in le(document.body,"leaflet-dragging"),this._lastTarget&&(le(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),an)Te(document,an[t],this._onMove,this),Te(document,on[t],this._onUp,this);we(),Ht(),this._moved&&this._moving&&(M(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1,sn._dragging=!1}});function un(t,e){if(!e||!t.length)return t.slice();var n=e*e;return t=function(t,e){var n=t.length,r=new(("undefined"===typeof Uint8Array?"undefined":s(Uint8Array))!==void 0+""?Uint8Array:Array)(n);r[0]=r[n-1]=1,ln(t,r,e,0,n-1);var i,o=[];for(i=0;i<n;i++)r[i]&&o.push(t[i]);return o}(t=function(t,e){for(var n=[t[0]],r=1,i=0,o=t.length;r<o;r++)pn(t[r],t[i])>e&&(n.push(t[r]),i=r);return i<o-1&&n.push(t[o-1]),n}(t,n),n)}function cn(t,e,n){return Math.sqrt(vn(t,e,n,!0))}function ln(t,e,n,r,i){var o,a,s,u=0;for(a=r+1;a<=i-1;a++)(s=vn(t[a],t[r],t[i],!0))>u&&(o=a,u=s);u>n&&(e[o]=1,ln(t,e,n,r,o),ln(t,e,n,o,i))}function hn(t,e,n,r,i){var o,a,s,u=r?en:dn(t,n),c=dn(e,n);for(en=c;;){if(!(u|c))return[t,e];if(u&c)return!1;s=dn(a=fn(t,e,o=u||c,n,i),n),o===u?(t=a,u=s):(e=a,c=s)}}function fn(t,e,n,r,i){var o,a,s=e.x-t.x,u=e.y-t.y,c=r.min,l=r.max;return 8&n?(o=t.x+s*(l.y-t.y)/u,a=l.y):4&n?(o=t.x+s*(c.y-t.y)/u,a=c.y):2&n?(o=l.x,a=t.y+u*(l.x-t.x)/s):1&n&&(o=c.x,a=t.y+u*(c.x-t.x)/s),new D(o,a,i)}function dn(t,e){var n=0;return t.x<e.min.x?n|=1:t.x>e.max.x&&(n|=2),t.y<e.min.y?n|=4:t.y>e.max.y&&(n|=8),n}function pn(t,e){var n=e.x-t.x,r=e.y-t.y;return n*n+r*r}function vn(t,e,n,r){var i,o=e.x,a=e.y,s=n.x-o,u=n.y-a,c=s*s+u*u;return c>0&&((i=((t.x-o)*s+(t.y-a)*u)/c)>1?(o=n.x,a=n.y):i>0&&(o+=s*i,a+=u*i)),s=t.x-o,u=t.y-a,r?s*s+u*u:new D(o,a)}function mn(t){return!g(t[0])||"object"!==s(t[0][0])&&"undefined"!==typeof t[0][0]}function gn(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),mn(t)}var yn={simplify:un,pointToSegmentDistance:cn,closestPointOnSegment:function(t,e,n){return vn(t,e,n)},clipSegment:hn,_getEdgeIntersection:fn,_getBitCode:dn,_sqClosestPointOnSegment:vn,isFlat:mn,_flat:gn};function bn(t,e,n){var r,i,o,a,s,u,c,l,h,f=[1,4,2,8];for(i=0,c=t.length;i<c;i++)t[i]._code=dn(t[i],e);for(a=0;a<4;a++){for(l=f[a],r=[],i=0,o=(c=t.length)-1;i<c;o=i++)s=t[i],u=t[o],s._code&l?u._code&l||((h=fn(u,s,l,e,n))._code=dn(h,e),r.push(h)):(u._code&l&&((h=fn(u,s,l,e,n))._code=dn(h,e),r.push(h)),r.push(s));t=r}return t}var wn={clipPolygon:bn},_n={project:function(t){return new D(t.lng,t.lat)},unproject:function(t){return new j(t.y,t.x)},bounds:new R([-180,-90],[180,90])},xn={R:6378137,R_MINOR:6356752.314245179,bounds:new R([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,n=this.R,r=t.lat*e,i=this.R_MINOR/n,o=Math.sqrt(1-i*i),a=o*Math.sin(r),s=Math.tan(Math.PI/4-r/2)/Math.pow((1-a)/(1+a),o/2);return r=-n*Math.log(Math.max(s,1e-10)),new D(t.lng*e*n,r)},unproject:function(t){for(var e,n=180/Math.PI,r=this.R,i=this.R_MINOR/r,o=Math.sqrt(1-i*i),a=Math.exp(-t.y/r),s=Math.PI/2-2*Math.atan(a),u=0,c=.1;u<15&&Math.abs(c)>1e-7;u++)e=o*Math.sin(s),e=Math.pow((1-e)/(1+e),o/2),s+=c=Math.PI/2-2*Math.atan(a*e)-s;return new j(s*n,t.x*n/r)}},kn={LonLat:_n,Mercator:xn,SphericalMercator:H},Sn=e({},V,{code:"EPSG:3395",projection:xn,transformation:function(){var t=.5/(Math.PI*xn.R);return Z(t,.5,-t,.5)}()}),Cn=e({},V,{code:"EPSG:4326",projection:_n,transformation:Z(1/180,1,-1/180,.5)}),Mn=e({},$,{projection:_n,transformation:Z(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var n=e.lng-t.lng,r=e.lat-t.lat;return Math.sqrt(n*n+r*r)},infinite:!0});$.Earth=V,$.EPSG3395=Sn,$.EPSG3857=J,$.EPSG900913=Y,$.EPSG4326=Cn,$.Simple=Mn;var En=O.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[o(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[o(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e=t.target;if(e.hasLayer(this)){if(this._map=e,this._zoomAnimated=e._zoomAnimated,this.getEvents){var n=this.getEvents();e.on(n,this),this.once("remove",(function(){e.off(n,this)}),this)}this.onAdd(e),this.getAttribution&&e.attributionControl&&e.attributionControl.addAttribution(this.getAttribution()),this.fire("add"),e.fire("layeradd",{layer:this})}}});Ze.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var e=o(t);return this._layers[e]||(this._layers[e]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this},removeLayer:function(t){var e=o(t);return this._layers[e]?(this._loaded&&t.onRemove(this),t.getAttribution&&this.attributionControl&&this.attributionControl.removeAttribution(t.getAttribution()),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return!!t&&o(t)in this._layers},eachLayer:function(t,e){for(var n in this._layers)t.call(e,this._layers[n]);return this},_addLayers:function(t){for(var e=0,n=(t=t?g(t)?t:[t]:[]).length;e<n;e++)this.addLayer(t[e])},_addZoomLimit:function(t){!isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[o(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var e=o(t);this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,e=-1/0,n=this._getZoomSpan();for(var r in this._zoomBoundLayers){var i=this._zoomBoundLayers[r].options;t=void 0===i.minZoom?t:Math.min(t,i.minZoom),e=void 0===i.maxZoom?e:Math.max(e,i.maxZoom)}this._layersMaxZoom=e===-1/0?void 0:e,this._layersMinZoom=t===1/0?void 0:t,n!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var Tn=En.extend({initialize:function(t,e){var n,r;if(d(this,e),this._layers={},t)for(n=0,r=t.length;n<r;n++)this.addLayer(t[n])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return!!t&&("number"===typeof t?t:this.getLayerId(t))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,n,r=Array.prototype.slice.call(arguments,1);for(e in this._layers)(n=this._layers[e])[t]&&n[t].apply(n,r);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var n in this._layers)t.call(e,this._layers[n]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return o(t)}}),An=Tn.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),Tn.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),Tn.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new z;for(var e in this._layers){var n=this._layers[e];t.extend(n.getBounds?n.getBounds():n.getLatLng())}return t}}),On=T.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0]},initialize:function(t){d(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var n=this._getIconUrl(t);if(!n){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var r=this._createImg(n,e&&"IMG"===e.tagName?e:null);return this._setIconStyles(r,t),r},_setIconStyles:function(t,e){var n=this.options,r=n[e+"Size"];"number"===typeof r&&(r=[r,r]);var i=N(r),o=N("shadow"===e&&n.shadowAnchor||n.iconAnchor||i&&i.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(n.className||""),o&&(t.style.marginLeft=-o.x+"px",t.style.marginTop=-o.y+"px"),i&&(t.style.width=i.x+"px",t.style.height=i.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return Mt&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}}),Dn=On.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return Dn.imagePath||(Dn.imagePath=this._detectIconPath()),(this.options.imagePath||Dn.imagePath)+On.prototype._getIconUrl.call(this,t)},_detectIconPath:function(){var t=re("div","leaflet-default-icon-path",document.body),e=ne(t,"background-image")||ne(t,"backgroundImage");return document.body.removeChild(t),e=null===e||0!==e.indexOf("url")?"":e.replace(/^url\(["']?/,"").replace(/marker-icon\.png["']?\)$/,"")}}),Pn=tn.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new sn(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),ce(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&le(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,n=e._map,r=this._marker.options.autoPanSpeed,i=this._marker.options.autoPanPadding,o=ge(e._icon),a=n.getPixelBounds(),s=n.getPixelOrigin(),u=I(a.min._subtract(s).add(i),a.max._subtract(s).subtract(i));if(!u.contains(o)){var c=N((Math.max(u.max.x,o.x)-u.max.x)/(a.max.x-u.max.x)-(Math.min(u.min.x,o.x)-u.min.x)/(a.min.x-u.min.x),(Math.max(u.max.y,o.y)-u.max.y)/(a.max.y-u.max.y)-(Math.min(u.min.y,o.y)-u.min.y)/(a.min.y-u.min.y)).multiplyBy(r);n.panBy(c,{animate:!1}),this._draggable._newPos._add(c),this._draggable._startPos._add(c),me(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=C(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(M(this._panRequest),this._panRequest=C(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,n=e._shadow,r=ge(e._icon),i=e._map.layerPointToLatLng(r);n&&me(n,r),e._latlng=i,t.latlng=i,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){M(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),Ln=En.extend({options:{icon:new Dn,interactive:!0,keyboard:!0,title:"",alt:"",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){d(this,e),this._latlng=F(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=F(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),n=t.icon.createIcon(this._icon),r=!1;n!==this._icon&&(this._icon&&this._removeIcon(),r=!0,t.title&&(n.title=t.title),"IMG"===n.tagName&&(n.alt=t.alt||"")),ce(n,e),t.keyboard&&(n.tabIndex="0"),this._icon=n,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex});var i=t.icon.createShadow(this._shadow),o=!1;i!==this._shadow&&(this._removeShadow(),o=!0),i&&(ce(i,e),i.alt=""),this._shadow=i,t.opacity<1&&this._updateOpacity(),r&&this.getPane().appendChild(this._icon),this._initInteraction(),i&&o&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),ie(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ie(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&me(this._icon,t),this._shadow&&me(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.interactive&&(ce(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Pn)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Pn(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&de(this._icon,t),this._shadow&&de(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}}),Nn=En.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return d(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+this._renderer.options.tolerance}}),Rn=Nn.extend({options:{fill:!0,radius:10},initialize:function(t,e){d(this,e),this._latlng=F(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=F(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return Nn.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,n=this._clickTolerance(),r=[t+n,e+n];this._pxBounds=new R(this._point.subtract(r),this._point.add(r))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}}),In=Rn.extend({initialize:function(t,n,r){if("number"===typeof n&&(n=e({},r,{radius:n})),d(this,n),this._latlng=F(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new z(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:Nn.prototype.setStyle,_project:function(){var t=this._latlng.lng,e=this._latlng.lat,n=this._map,r=n.options.crs;if(r.distance===V.distance){var i=Math.PI/180,o=this._mRadius/V.R/i,a=n.project([e+o,t]),s=n.project([e-o,t]),u=a.add(s).divideBy(2),c=n.unproject(u).lat,l=Math.acos((Math.cos(o*i)-Math.sin(e*i)*Math.sin(c*i))/(Math.cos(e*i)*Math.cos(c*i)))/i;(isNaN(l)||0===l)&&(l=o/Math.cos(Math.PI/180*e)),this._point=u.subtract(n.getPixelOrigin()),this._radius=isNaN(l)?0:u.x-n.project([c,t-l]).x,this._radiusY=u.y-a.y}else{var h=r.unproject(r.project(this._latlng).subtract([this._mRadius,0]));this._point=n.latLngToLayerPoint(this._latlng),this._radius=this._point.x-n.latLngToLayerPoint(h).x}this._updateBounds()}}),zn=Nn.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){d(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e,n,r=1/0,i=null,o=vn,a=0,s=this._parts.length;a<s;a++)for(var u=this._parts[a],c=1,l=u.length;c<l;c++){var h=o(t,e=u[c-1],n=u[c],!0);h<r&&(r=h,i=o(t,e,n))}return i&&(i.distance=Math.sqrt(r)),i},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,n,r,i,o,a,s=this._rings[0],u=s.length;if(!u)return null;for(t=0,e=0;t<u-1;t++)e+=s[t].distanceTo(s[t+1])/2;if(0===e)return this._map.layerPointToLatLng(s[0]);for(t=0,r=0;t<u-1;t++)if(i=s[t],o=s[t+1],(r+=n=i.distanceTo(o))>e)return a=(r-e)/n,this._map.layerPointToLatLng([o.x-a*(o.x-i.x),o.y-a*(o.y-i.y)])},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=F(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new z,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return mn(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],n=mn(t),r=0,i=t.length;r<i;r++)n?(e[r]=F(t[r]),this._bounds.extend(e[r])):e[r]=this._convertLatLngs(t[r]);return e},_project:function(){var t=new R;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),e=new D(t,t);this._pxBounds=new R([this._rawPxBounds.min.subtract(e),this._rawPxBounds.max.add(e)])},_projectLatlngs:function(t,e,n){var r,i,o=t[0]instanceof j,a=t.length;if(o){for(i=[],r=0;r<a;r++)i[r]=this._map.latLngToLayerPoint(t[r]),n.extend(i[r]);e.push(i)}else for(r=0;r<a;r++)this._projectLatlngs(t[r],e,n)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else{var e,n,r,i,o,a,s,u=this._parts;for(e=0,r=0,i=this._rings.length;e<i;e++)for(n=0,o=(s=this._rings[e]).length;n<o-1;n++)(a=hn(s[n],s[n+1],t,n,!0))&&(u[r]=u[r]||[],u[r].push(a[0]),a[1]===s[n+1]&&n!==o-2||(u[r].push(a[1]),r++))}},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,n=0,r=t.length;n<r;n++)t[n]=un(t[n],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var n,r,i,o,a,s,u=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(n=0,o=this._parts.length;n<o;n++)for(r=0,i=(a=(s=this._parts[n]).length)-1;r<a;i=r++)if((e||0!==r)&&cn(t,s[i],s[r])<=u)return!0;return!1}});zn._flat=gn;var Bn=zn.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");var t,e,n,r,i,o,a,s,u,c=this._rings[0],l=c.length;if(!l)return null;for(o=a=s=0,t=0,e=l-1;t<l;e=t++)n=c[t],r=c[e],i=n.y*r.x-r.y*n.x,a+=(n.x+r.x)*i,s+=(n.y+r.y)*i,o+=3*i;return u=0===o?c[0]:[a/o,s/o],this._map.layerPointToLatLng(u)},_convertLatLngs:function(t){var e=zn.prototype._convertLatLngs.call(this,t),n=e.length;return n>=2&&e[0]instanceof j&&e[0].equals(e[n-1])&&e.pop(),e},_setLatLngs:function(t){zn.prototype._setLatLngs.call(this,t),mn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return mn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,n=new D(e,e);if(t=new R(t.min.subtract(n),t.max.add(n)),this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var r,i=0,o=this._rings.length;i<o;i++)(r=bn(this._rings[i],t,!0)).length&&this._parts.push(r)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,n,r,i,o,a,s,u,c=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(i=0,s=this._parts.length;i<s;i++)for(o=0,a=(u=(e=this._parts[i]).length)-1;o<u;a=o++)n=e[o],r=e[a],n.y>t.y!==r.y>t.y&&t.x<(r.x-n.x)*(t.y-n.y)/(r.y-n.y)+n.x&&(c=!c);return c||zn.prototype._containsPoint.call(this,t,!0)}}),jn=An.extend({initialize:function(t,e){d(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,n,r,i=g(t)?t:t.features;if(i){for(e=0,n=i.length;e<n;e++)((r=i[e]).geometries||r.geometry||r.features||r.coordinates)&&this.addData(r);return this}var o=this.options;if(o.filter&&!o.filter(t))return this;var a=Fn(t,o);return a?(a.feature=Zn(t),a.defaultOptions=a.options,this.resetStyle(a),o.onEachFeature&&o.onEachFeature(t,a),this.addLayer(a)):this},resetStyle:function(t){return void 0===t?this.eachLayer(this.resetStyle,this):(t.options=e({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer((function(e){this._setLayerStyle(e,t)}),this)},_setLayerStyle:function(t,e){t.setStyle&&("function"===typeof e&&(e=e(t.feature)),t.setStyle(e))}});function Fn(t,e){var n,r,i,o,a="Feature"===t.type?t.geometry:t,s=a?a.coordinates:null,u=[],c=e&&e.pointToLayer,l=e&&e.coordsToLatLng||$n;if(!s&&!a)return null;switch(a.type){case"Point":return qn(c,t,n=l(s),e);case"MultiPoint":for(i=0,o=s.length;i<o;i++)n=l(s[i]),u.push(qn(c,t,n,e));return new An(u);case"LineString":case"MultiLineString":return r=Vn(s,"LineString"===a.type?0:1,l),new zn(r,e);case"Polygon":case"MultiPolygon":return r=Vn(s,"Polygon"===a.type?1:2,l),new Bn(r,e);case"GeometryCollection":for(i=0,o=a.geometries.length;i<o;i++){var h=Fn({geometry:a.geometries[i],type:"Feature",properties:t.properties},e);h&&u.push(h)}return new An(u);default:throw new Error("Invalid GeoJSON object.")}}function qn(t,e,n,r){return t?t(e,n):new Ln(n,r&&r.markersInheritOptions&&r)}function $n(t){return new j(t[1],t[0],t[2])}function Vn(t,e,n){for(var r,i=[],o=0,a=t.length;o<a;o++)r=e?Vn(t[o],e-1,n):(n||$n)(t[o]),i.push(r);return i}function Un(t,e){return e="number"===typeof e?e:6,void 0!==t.alt?[l(t.lng,e),l(t.lat,e),l(t.alt,e)]:[l(t.lng,e),l(t.lat,e)]}function Hn(t,e,n,r){for(var i=[],o=0,a=t.length;o<a;o++)i.push(e?Hn(t[o],e-1,n,r):Un(t[o],r));return!e&&n&&i.push(i[0]),i}function Wn(t,n){return t.feature?e({},t.feature,{geometry:n}):Zn(n)}function Zn(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}var Jn={toGeoJSON:function(t){return Wn(this,{type:"Point",coordinates:Un(this.getLatLng(),t)})}};function Yn(t,e){return new jn(t,e)}Ln.include(Jn),In.include(Jn),Rn.include(Jn),zn.include({toGeoJSON:function(t){var e=!mn(this._latlngs);return Wn(this,{type:(e?"Multi":"")+"LineString",coordinates:Hn(this._latlngs,e?1:0,!1,t)})}}),Bn.include({toGeoJSON:function(t){var e=!mn(this._latlngs),n=e&&!mn(this._latlngs[0]),r=Hn(this._latlngs,n?2:e?1:0,!0,t);return e||(r=[r]),Wn(this,{type:(n?"Multi":"")+"Polygon",coordinates:r})}}),Tn.include({toMultiPoint:function(t){var e=[];return this.eachLayer((function(n){e.push(n.toGeoJSON(t).geometry.coordinates)})),Wn(this,{type:"MultiPoint",coordinates:e})},toGeoJSON:function(t){var e=this.feature&&this.feature.geometry&&this.feature.geometry.type;if("MultiPoint"===e)return this.toMultiPoint(t);var n="GeometryCollection"===e,r=[];return this.eachLayer((function(e){if(e.toGeoJSON){var i=e.toGeoJSON(t);if(n)r.push(i.geometry);else{var o=Zn(i);"FeatureCollection"===o.type?r.push.apply(r,o.features):r.push(o)}}})),n?Wn(this,{geometries:r,type:"GeometryCollection"}):{type:"FeatureCollection",features:r}}});var Kn=Yn,Gn=En.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,n){this._url=t,this._bounds=B(e),d(this,n)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(ce(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ie(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&ae(this._image),this},bringToBack:function(){return this._map&&se(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=B(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:re("img");ce(e,"leaflet-image-layer"),this._zoomAnimated&&ce(e,"leaflet-zoom-animated"),this.options.className&&ce(e,this.options.className),e.onselectstart=c,e.onmousemove=c,e.onload=r(this.fire,this,"load"),e.onerror=r(this._overlayOnError,this,"error"),(this.options.crossOrigin||""===this.options.crossOrigin)&&(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),n=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;ve(this._image,n,e)},_reset:function(){var t=this._image,e=new R(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),n=e.getSize();me(t,e.min),t.style.width=n.x+"px",t.style.height=n.y+"px"},_updateOpacity:function(){de(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)}}),Xn=Gn.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:re("video");if(ce(e,"leaflet-image-layer"),this._zoomAnimated&&ce(e,"leaflet-zoom-animated"),this.options.className&&ce(e,this.options.className),e.onselectstart=c,e.onmousemove=c,e.onloadeddata=r(this.fire,this,"load"),t){for(var n=e.getElementsByTagName("source"),i=[],o=0;o<n.length;o++)i.push(n[o].src);this._url=n.length>0?i:[e.src]}else{g(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted;for(var a=0;a<this._url.length;a++){var s=re("source");s.src=this._url[a],e.appendChild(s)}}}}),Qn=Gn.extend({_initImage:function(){var t=this._image=this._url;ce(t,"leaflet-image-layer"),this._zoomAnimated&&ce(t,"leaflet-zoom-animated"),this.options.className&&ce(t,this.options.className),t.onselectstart=c,t.onmousemove=c}}),tr=En.extend({options:{offset:[0,7],className:"",pane:"popupPane"},initialize:function(t,e){d(this,t),this._source=e},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&de(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&de(this._container,1),this.bringToFront()},onRemove:function(t){t._fadeAnimated?(de(this._container,0),this._removeTimeout=setTimeout(r(ie,void 0,this._container),200)):ie(this._container)},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=F(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&ae(this._container),this},bringToBack:function(){return this._map&&se(this._container),this},_prepareOpen:function(t,e,n){if(e instanceof En||(n=e,e=t),e instanceof An)for(var r in t._layers){e=t._layers[r];break}if(!n)if(e.getCenter)n=e.getCenter();else{if(!e.getLatLng)throw new Error("Unable to get source layer LatLng.");n=e.getLatLng()}return this._source=e,this.update(),n},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"===typeof this._content?this._content(this._source||this):this._content;if("string"===typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=N(this.options.offset),n=this._getAnchor();this._zoomAnimated?me(this._container,t.add(n)):e=e.add(t).add(n);var r=this._containerBottom=-e.y,i=this._containerLeft=-Math.round(this._containerWidth/2)+e.x;this._container.style.bottom=r+"px",this._container.style.left=i+"px"}},_getAnchor:function(){return[0,0]}}),er=tr.extend({options:{maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t.openPopup(this),this},onAdd:function(t){tr.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Nn||this._source.on("preclick",Le))},onRemove:function(t){tr.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Nn||this._source.off("preclick",Le))},getEvents:function(){var t=tr.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this._close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_close:function(){this._map&&this._map.closePopup(this)},_initLayout:function(){var t="leaflet-popup",e=this._container=re("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),n=this._wrapper=re("div",t+"-content-wrapper",e);if(this._contentNode=re("div",t+"-content",n),Re(e),Ne(this._contentNode),Me(e,"contextmenu",Le),this._tipContainer=re("div",t+"-tip-container",e),this._tip=re("div",t+"-tip",this._tipContainer),this.options.closeButton){var r=this._closeButton=re("a",t+"-close-button",e);r.href="#close",r.innerHTML="×",Me(r,"click",this._onCloseButtonClick,this)}},_updateLayout:function(){var t=this._contentNode,e=t.style;e.width="",e.whiteSpace="nowrap";var n=t.offsetWidth;n=Math.min(n,this.options.maxWidth),n=Math.max(n,this.options.minWidth),e.width=n+1+"px",e.whiteSpace="",e.height="";var r=t.offsetHeight,i=this.options.maxHeight,o="leaflet-popup-scrolled";i&&r>i?(e.height=i+"px",ce(t,o)):le(t,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),n=this._getAnchor();me(this._container,e.add(n))},_adjustPan:function(){if(this.options.autoPan){this._map._panAnim&&this._map._panAnim.stop();var t=this._map,e=parseInt(ne(this._container,"marginBottom"),10)||0,n=this._container.offsetHeight+e,r=this._containerWidth,i=new D(this._containerLeft,-n-this._containerBottom);i._add(ge(this._container));var o=t.layerPointToContainerPoint(i),a=N(this.options.autoPanPadding),s=N(this.options.autoPanPaddingTopLeft||a),u=N(this.options.autoPanPaddingBottomRight||a),c=t.getSize(),l=0,h=0;o.x+r+u.x>c.x&&(l=o.x+r-c.x+u.x),o.x-l-s.x<0&&(l=o.x-s.x),o.y+n+u.y>c.y&&(h=o.y+n-c.y+u.y),o.y-h-s.y<0&&(h=o.y-s.y),(l||h)&&t.fire("autopanstart").panBy([l,h])}},_onCloseButtonClick:function(t){this._close(),ze(t)},_getAnchor:function(){return N(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}});Ze.mergeOptions({closePopupOnClick:!0}),Ze.include({openPopup:function(t,e,n){return t instanceof er||(t=new er(n).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:(this._popup&&this._popup.options.autoClose&&this.closePopup(),this._popup=t,this.addLayer(t))},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&this.removeLayer(t),this}}),En.include({bindPopup:function(t,e){return t instanceof er?(d(t,e),this._popup=t,t._source=this):(this._popup&&!e||(this._popup=new er(e,this)),this._popup.setContent(t)),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t,e){return this._popup&&this._map&&(e=this._popup._prepareOpen(this,t,e),this._map.openPopup(this._popup,e)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(t){return this._popup&&(this._popup._map?this.closePopup():this.openPopup(t)),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e=t.layer||t.target;this._popup&&this._map&&(ze(t),e instanceof Nn?this.openPopup(t.layer||t.target,t.latlng):this._map.hasLayer(this._popup)&&this._popup._source===e?this.closePopup():this.openPopup(e,t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}});var nr=tr.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,interactive:!1,opacity:.9},onAdd:function(t){tr.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&this._source.fire("tooltipopen",{tooltip:this},!0)},onRemove:function(t){tr.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&this._source.fire("tooltipclose",{tooltip:this},!0)},getEvents:function(){var t=tr.prototype.getEvents.call(this);return kt&&!this.options.permanent&&(t.preclick=this._close),t},_close:function(){this._map&&this._map.closeTooltip(this)},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=re("div",t)},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,n,r=this._map,i=this._container,o=r.latLngToContainerPoint(r.getCenter()),a=r.layerPointToContainerPoint(t),s=this.options.direction,u=i.offsetWidth,c=i.offsetHeight,l=N(this.options.offset),h=this._getAnchor();"top"===s?(e=u/2,n=c):"bottom"===s?(e=u/2,n=0):"center"===s?(e=u/2,n=c/2):"right"===s?(e=0,n=c/2):"left"===s?(e=u,n=c/2):a.x<o.x?(s="right",e=0,n=c/2):(s="left",e=u+2*(l.x+h.x),n=c/2),t=t.subtract(N(e,n,!0)).add(l).add(h),le(i,"leaflet-tooltip-right"),le(i,"leaflet-tooltip-left"),le(i,"leaflet-tooltip-top"),le(i,"leaflet-tooltip-bottom"),ce(i,"leaflet-tooltip-"+s),me(i,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&de(this._container,t)},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(e)},_getAnchor:function(){return N(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}});Ze.include({openTooltip:function(t,e,n){return t instanceof nr||(t=new nr(n).setContent(t)),e&&t.setLatLng(e),this.hasLayer(t)?this:this.addLayer(t)},closeTooltip:function(t){return t&&this.removeLayer(t),this}}),En.include({bindTooltip:function(t,e){return t instanceof nr?(d(t,e),this._tooltip=t,t._source=this):(this._tooltip&&!e||(this._tooltip=new nr(e,this)),this._tooltip.setContent(t)),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(t||!this._tooltipHandlersAdded){var e=t?"off":"on",n={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?n.add=this._openTooltip:(n.mouseover=this._openTooltip,n.mouseout=this.closeTooltip,this._tooltip.options.sticky&&(n.mousemove=this._moveTooltip),kt&&(n.click=this._openTooltip)),this[e](n),this._tooltipHandlersAdded=!t}},openTooltip:function(t,e){return this._tooltip&&this._map&&(e=this._tooltip._prepareOpen(this,t,e),this._map.openTooltip(this._tooltip,e),this._tooltip.options.interactive&&this._tooltip._container&&(ce(this._tooltip._container,"leaflet-clickable"),this.addInteractiveTarget(this._tooltip._container))),this},closeTooltip:function(){return this._tooltip&&(this._tooltip._close(),this._tooltip.options.interactive&&this._tooltip._container&&(le(this._tooltip._container,"leaflet-clickable"),this.removeInteractiveTarget(this._tooltip._container))),this},toggleTooltip:function(t){return this._tooltip&&(this._tooltip._map?this.closeTooltip():this.openTooltip(t)),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_openTooltip:function(t){var e=t.layer||t.target;this._tooltip&&this._map&&this.openTooltip(e,this._tooltip.options.sticky?t.latlng:void 0)},_moveTooltip:function(t){var e,n,r=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(e=this._map.mouseEventToContainerPoint(t.originalEvent),n=this._map.containerPointToLayerPoint(e),r=this._map.layerPointToLatLng(n)),this._tooltip.setLatLng(r)}});var rr=On.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var e=t&&"DIV"===t.tagName?t:document.createElement("div"),n=this.options;if(n.html instanceof Element?(oe(e),e.appendChild(n.html)):e.innerHTML=!1!==n.html?n.html:"",n.bgPos){var r=N(n.bgPos);e.style.backgroundPosition=-r.x+"px "+-r.y+"px"}return this._setIconStyles(e,"icon"),e},createShadow:function(){return null}});On.Default=Dn;var ir=En.extend({options:{tileSize:256,opacity:1,updateWhenIdle:yt,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){d(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView(),this._update()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ie(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(ae(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(se(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){return this._map&&(this._removeAllTiles(),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=a(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof D?t:new D(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,n=this.getPane().children,r=-t(-1/0,1/0),i=0,o=n.length;i<o;i++)e=n[i].style.zIndex,n[i]!==this._container&&e&&(r=t(r,+e));isFinite(r)&&(this.options.zIndex=r+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!tt){de(this._container,this.options.opacity);var t=+new Date,e=!1,n=!1;for(var r in this._tiles){var i=this._tiles[r];if(i.current&&i.loaded){var o=Math.min(1,(t-i.loaded)/200);de(i.el,o),o<1?e=!0:(i.active?n=!0:this._onOpaqueTile(i),i.active=!0)}}n&&!this._noPrune&&this._pruneTiles(),e&&(M(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this))}},_onOpaqueTile:c,_initContainer:function(){this._container||(this._container=re("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var n in this._levels)n=Number(n),this._levels[n].el.children.length||n===t?(this._levels[n].el.style.zIndex=e-Math.abs(t-n),this._onUpdateLevel(n)):(ie(this._levels[n].el),this._removeTilesAtZoom(n),this._onRemoveLevel(n),delete this._levels[n]);var r=this._levels[t],i=this._map;return r||((r=this._levels[t]={}).el=re("div","leaflet-tile-container leaflet-zoom-animated",this._container),r.el.style.zIndex=e,r.origin=i.project(i.unproject(i.getPixelOrigin()),t).round(),r.zoom=t,this._setZoomTransform(r,i.getCenter(),i.getZoom()),r.el.offsetWidth,this._onCreateLevel(r)),this._level=r,r}},_onUpdateLevel:c,_onRemoveLevel:c,_onCreateLevel:c,_pruneTiles:function(){if(this._map){var t,e,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(e=this._tiles[t]).retain=e.current;for(t in this._tiles)if((e=this._tiles[t]).current&&!e.active){var r=e.coords;this._retainParent(r.x,r.y,r.z,r.z-5)||this._retainChildren(r.x,r.y,r.z,r.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ie(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,n,r){var i=Math.floor(t/2),o=Math.floor(e/2),a=n-1,s=new D(+i,+o);s.z=+a;var u=this._tileCoordsToKey(s),c=this._tiles[u];return c&&c.active?(c.retain=!0,!0):(c&&c.loaded&&(c.retain=!0),a>r&&this._retainParent(i,o,a,r))},_retainChildren:function(t,e,n,r){for(var i=2*t;i<2*t+2;i++)for(var o=2*e;o<2*e+2;o++){var a=new D(i,o);a.z=n+1;var s=this._tileCoordsToKey(a),u=this._tiles[s];u&&u.active?u.retain=!0:(u&&u.loaded&&(u.retain=!0),n+1<r&&this._retainChildren(i,o,n+1,r))}},_resetView:function(t){var e=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),e,e)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,n,r){var i=Math.round(e);i=void 0!==this.options.maxZoom&&i>this.options.maxZoom||void 0!==this.options.minZoom&&i<this.options.minZoom?void 0:this._clampZoom(i);var o=this.options.updateWhenZooming&&i!==this._tileZoom;r&&!o||(this._tileZoom=i,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==i&&this._update(t),n||this._pruneTiles(),this._noPrune=!!n),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var n in this._levels)this._setZoomTransform(this._levels[n],t,e)},_setZoomTransform:function(t,e,n){var r=this._map.getZoomScale(n,t.zoom),i=t.origin.multiplyBy(r).subtract(this._map._getNewPixelOrigin(e,n)).round();gt?ve(t.el,i,r):me(t.el,i)},_resetGrid:function(){var t=this._map,e=t.options.crs,n=this._tileSize=this.getTileSize(),r=this._tileZoom,i=this._map.getPixelWorldBounds(this._tileZoom);i&&(this._globalTileRange=this._pxBoundsToTileRange(i)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],r).x/n.x),Math.ceil(t.project([0,e.wrapLng[1]],r).x/n.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],r).y/n.x),Math.ceil(t.project([e.wrapLat[1],0],r).y/n.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,n=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),r=e.getZoomScale(n,this._tileZoom),i=e.project(t,this._tileZoom).floor(),o=e.getSize().divideBy(2*r);return new R(i.subtract(o),i.add(o))},_update:function(t){var e=this._map;if(e){var n=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var r=this._getTiledPixelBounds(t),i=this._pxBoundsToTileRange(r),o=i.getCenter(),a=[],s=this.options.keepBuffer,u=new R(i.getBottomLeft().subtract([s,-s]),i.getTopRight().add([s,-s]));if(!(isFinite(i.min.x)&&isFinite(i.min.y)&&isFinite(i.max.x)&&isFinite(i.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var c in this._tiles){var l=this._tiles[c].coords;l.z===this._tileZoom&&u.contains(new D(l.x,l.y))||(this._tiles[c].current=!1)}if(Math.abs(n-this._tileZoom)>1)this._setView(t,n);else{for(var h=i.min.y;h<=i.max.y;h++)for(var f=i.min.x;f<=i.max.x;f++){var d=new D(f,h);if(d.z=this._tileZoom,this._isValidTile(d)){var p=this._tiles[this._tileCoordsToKey(d)];p?p.current=!0:a.push(d)}}if(a.sort((function(t,e){return t.distanceTo(o)-e.distanceTo(o)})),0!==a.length){this._loading||(this._loading=!0,this.fire("loading"));var v=document.createDocumentFragment();for(f=0;f<a.length;f++)this._addTile(a[f],v);this._level.el.appendChild(v)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var n=this._globalTileRange;if(!e.wrapLng&&(t.x<n.min.x||t.x>n.max.x)||!e.wrapLat&&(t.y<n.min.y||t.y>n.max.y))return!1}if(!this.options.bounds)return!0;var r=this._tileCoordsToBounds(t);return B(this.options.bounds).overlaps(r)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,n=this.getTileSize(),r=t.scaleBy(n),i=r.add(n);return[e.unproject(r,t.z),e.unproject(i,t.z)]},_tileCoordsToBounds:function(t){var e=this._tileCoordsToNwSe(t),n=new z(e[0],e[1]);return this.options.noWrap||(n=this._map.wrapLatLngBounds(n)),n},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var e=t.split(":"),n=new D(+e[0],+e[1]);return n.z=+e[2],n},_removeTile:function(t){var e=this._tiles[t];e&&(ie(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){ce(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=c,t.onmousemove=c,tt&&this.options.opacity<1&&de(t,this.options.opacity),rt&&!it&&(t.style.WebkitBackfaceVisibility="hidden")},_addTile:function(t,e){var n=this._getTilePos(t),i=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),r(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&C(r(this._tileReady,this,t,null,o)),me(o,n),this._tiles[i]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,n){e&&this.fire("tileerror",{error:e,tile:n,coords:t});var i=this._tileCoordsToKey(t);(n=this._tiles[i])&&(n.loaded=+new Date,this._map._fadeAnimated?(de(n.el,0),M(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this)):(n.active=!0,this._pruneTiles()),e||(ce(n.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:n.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),tt||!this._map._fadeAnimated?C(this._pruneTiles,this):setTimeout(r(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new D(this._wrapX?u(t.x,this._wrapX):t.x,this._wrapY?u(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new R(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}}),or=ir.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1},initialize:function(t,e){this._url=t,(e=d(this,e)).detectRetina&&Mt&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom++):(e.zoomOffset++,e.maxZoom--),e.minZoom=Math.max(0,e.minZoom)),"string"===typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),rt||this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var n=document.createElement("img");return Me(n,"load",r(this._tileOnLoad,this,e,n)),Me(n,"error",r(this._tileOnError,this,e,n)),(this.options.crossOrigin||""===this.options.crossOrigin)&&(n.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),n.alt="",n.setAttribute("role","presentation"),n.src=this.getTileUrl(t),n},getTileUrl:function(t){var n={r:Mt?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var r=this._globalTileRange.max.y-t.y;this.options.tms&&(n.y=r),n["-y"]=r}return m(this._url,e(n,this.options))},_tileOnLoad:function(t,e){tt?setTimeout(r(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,n){var r=this.options.errorTileUrl;r&&e.getAttribute("src")!==r&&(e.src=r),t(n,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return this.options.zoomReverse&&(t=e-t),t+this.options.zoomOffset},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_abortLoading:function(){var t,e;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((e=this._tiles[t].el).onload=c,e.onerror=c,e.complete||(e.src=b,ie(e),delete this._tiles[t]))},_removeTile:function(t){var e=this._tiles[t];if(e)return at||e.el.setAttribute("src",b),ir.prototype._removeTile.call(this,t)},_tileReady:function(t,e,n){if(this._map&&(!n||n.getAttribute("src")!==b))return ir.prototype._tileReady.call(this,t,e,n)}});function ar(t,e){return new or(t,e)}var sr=or.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,n){this._url=t;var r=e({},this.defaultWmsParams);for(var i in n)i in this.options||(r[i]=n[i]);var o=(n=d(this,n)).detectRetina&&Mt?2:1,a=this.getTileSize();r.width=a.x*o,r.height=a.y*o,this.wmsParams=r},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,or.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),n=this._crs,r=I(n.project(e[0]),n.project(e[1])),i=r.min,o=r.max,a=(this._wmsVersion>=1.3&&this._crs===Cn?[i.y,i.x,o.y,o.x]:[i.x,i.y,o.x,o.y]).join(","),s=or.prototype.getTileUrl.call(this,t);return s+p(this.wmsParams,s,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+a},setParams:function(t,n){return e(this.wmsParams,t),n||this.redraw(),this}});or.WMS=sr,ar.wms=function(t,e){return new sr(t,e)};var ur=En.extend({options:{padding:.1,tolerance:0},initialize:function(t){d(this,t),o(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),this._zoomAnimated&&ce(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var n=this._map.getZoomScale(e,this._zoom),r=ge(this._container),i=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),a=this._map.project(t,e).subtract(o),s=i.multiplyBy(-n).add(r).add(i).subtract(a);gt?ve(this._container,s,n):me(this._container,s)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),n=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new R(n,n.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),cr=ur.extend({getEvents:function(){var t=ur.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ur.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");Me(t,"mousemove",this._onMouseMove,this),Me(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Me(t,"mouseout",this._handleMouseOut,this),this._ctx=t.getContext("2d")},_destroyContainer:function(){M(this._redrawRequest),delete this._ctx,ie(this._container),Te(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){if(!this._map._animatingZoom||!this._bounds){ur.prototype._update.call(this);var t=this._bounds,e=this._container,n=t.getSize(),r=Mt?2:1;me(e,t.min),e.width=r*n.x,e.height=r*n.y,e.style.width=n.x+"px",e.style.height=n.y+"px",Mt&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){ur.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[o(t)]=t;var e=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=e),this._drawLast=e,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,n=e.next,r=e.prev;n?n.prev=r:this._drawLast=r,r?r.next=n:this._drawFirst=n,delete t._order,delete this._layers[o(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"===typeof t.options.dashArray){var e,n,r=t.options.dashArray.split(/[, ]+/),i=[];for(n=0;n<r.length;n++){if(e=Number(r[n]),isNaN(e))return;i.push(e)}t.options._dashArray=i}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||C(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var e=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new R,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var e=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,e.x,e.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var t,e=this._redrawBounds;if(this._ctx.save(),e){var n=e.getSize();this._ctx.beginPath(),this._ctx.rect(e.min.x,e.min.y,n.x,n.y),this._ctx.clip()}this._drawing=!0;for(var r=this._drawFirst;r;r=r.next)t=r.layer,(!e||t._pxBounds&&t._pxBounds.intersects(e))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var n,r,i,o,a=t._parts,s=a.length,u=this._ctx;if(s){for(u.beginPath(),n=0;n<s;n++){for(r=0,i=a[n].length;r<i;r++)o=a[n][r],u[r?"lineTo":"moveTo"](o.x,o.y);e&&u.closePath()}this._fillStroke(u,t)}}},_updateCircle:function(t){if(this._drawing&&!t._empty()){var e=t._point,n=this._ctx,r=Math.max(Math.round(t._radius),1),i=(Math.max(Math.round(t._radiusY),1)||r)/r;1!==i&&(n.save(),n.scale(1,i)),n.beginPath(),n.arc(e.x,e.y/i,r,0,2*Math.PI,!1),1!==i&&n.restore(),this._fillStroke(n,t)}},_fillStroke:function(t,e){var n=e.options;n.fill&&(t.globalAlpha=n.fillOpacity,t.fillStyle=n.fillColor||n.color,t.fill(n.fillRule||"evenodd")),n.stroke&&0!==n.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=n.opacity,t.lineWidth=n.weight,t.strokeStyle=n.color,t.lineCap=n.lineCap,t.lineJoin=n.lineJoin,t.stroke())},_onClick:function(t){for(var e,n,r=this._map.mouseEventToLayerPoint(t),i=this._drawFirst;i;i=i.next)(e=i.layer).options.interactive&&e._containsPoint(r)&&("click"!==t.type&&"preclick"===t.type||!this._map._draggableMoved(e))&&(n=e);n&&($e(t),this._fireEvent([n],t))},_onMouseMove:function(t){if(this._map&&!this._map.dragging.moving()&&!this._map._animatingZoom){var e=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,e)}},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(le(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var n,i,o=this._drawFirst;o;o=o.next)(n=o.layer).options.interactive&&n._containsPoint(e)&&(i=n);i!==this._hoveredLayer&&(this._handleMouseOut(t),i&&(ce(this._container,"leaflet-interactive"),this._fireEvent([i],t,"mouseover"),this._hoveredLayer=i)),this._hoveredLayer&&this._fireEvent([this._hoveredLayer],t),this._mouseHoverThrottled=!0,setTimeout(r((function(){this._mouseHoverThrottled=!1}),this),32)}},_fireEvent:function(t,e,n){this._map._fireDOMEvent(e,n||e.type,t)},_bringToFront:function(t){var e=t._order;if(e){var n=e.next,r=e.prev;n&&(n.prev=r,r?r.next=n:n&&(this._drawFirst=n),e.prev=this._drawLast,this._drawLast.next=e,e.next=null,this._drawLast=e,this._requestRedraw(t))}},_bringToBack:function(t){var e=t._order;if(e){var n=e.next,r=e.prev;r&&(r.next=n,n?n.prev=r:r&&(this._drawLast=r),e.prev=null,e.next=this._drawFirst,this._drawFirst.prev=e,this._drawFirst=e,this._requestRedraw(t))}}});function lr(t){return Tt?new cr(t):null}var hr=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),fr={_initContainer:function(){this._container=re("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ur.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=hr("shape");ce(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=hr("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[o(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;ie(e),t.removeInteractiveTarget(e),delete this._layers[o(t)]},_updateStyle:function(t){var e=t._stroke,n=t._fill,r=t.options,i=t._container;i.stroked=!!r.stroke,i.filled=!!r.fill,r.stroke?(e||(e=t._stroke=hr("stroke")),i.appendChild(e),e.weight=r.weight+"px",e.color=r.color,e.opacity=r.opacity,r.dashArray?e.dashStyle=g(r.dashArray)?r.dashArray.join(" "):r.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=r.lineCap.replace("butt","flat"),e.joinstyle=r.lineJoin):e&&(i.removeChild(e),t._stroke=null),r.fill?(n||(n=t._fill=hr("fill")),i.appendChild(n),n.color=r.fillColor||r.color,n.opacity=r.fillOpacity):n&&(i.removeChild(n),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),n=Math.round(t._radius),r=Math.round(t._radiusY||n);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+n+","+r+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){ae(t._container)},_bringToBack:function(t){se(t._container)}},dr=Ot?hr:K,pr=ur.extend({getEvents:function(){var t=ur.prototype.getEvents.call(this);return t.zoomstart=this._onZoomStart,t},_initContainer:function(){this._container=dr("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=dr("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ie(this._container),Te(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_onZoomStart:function(){this._update()},_update:function(){if(!this._map._animatingZoom||!this._bounds){ur.prototype._update.call(this);var t=this._bounds,e=t.getSize(),n=this._container;this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,n.setAttribute("width",e.x),n.setAttribute("height",e.y)),me(n,t.min),n.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update")}},_initPath:function(t){var e=t._path=dr("path");t.options.className&&ce(e,t.options.className),t.options.interactive&&ce(e,"leaflet-interactive"),this._updateStyle(t),this._layers[o(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ie(t._path),t.removeInteractiveTarget(t._path),delete this._layers[o(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,n=t.options;e&&(n.stroke?(e.setAttribute("stroke",n.color),e.setAttribute("stroke-opacity",n.opacity),e.setAttribute("stroke-width",n.weight),e.setAttribute("stroke-linecap",n.lineCap),e.setAttribute("stroke-linejoin",n.lineJoin),n.dashArray?e.setAttribute("stroke-dasharray",n.dashArray):e.removeAttribute("stroke-dasharray"),n.dashOffset?e.setAttribute("stroke-dashoffset",n.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),n.fill?(e.setAttribute("fill",n.fillColor||n.color),e.setAttribute("fill-opacity",n.fillOpacity),e.setAttribute("fill-rule",n.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,G(t._parts,e))},_updateCircle:function(t){var e=t._point,n=Math.max(Math.round(t._radius),1),r="a"+n+","+(Math.max(Math.round(t._radiusY),1)||n)+" 0 1,0 ",i=t._empty()?"M0 0":"M"+(e.x-n)+","+e.y+r+2*n+",0 "+r+2*-n+",0 ";this._setPath(t,i)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){ae(t._path)},_bringToBack:function(t){se(t._path)}});function vr(t){return At||Ot?new pr(t):null}Ot&&pr.include(fr),Ze.include({getRenderer:function(t){var e=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return e||(e=this._renderer=this._createRenderer()),this.hasLayer(e)||this.addLayer(e),e},_getPaneRenderer:function(t){if("overlayPane"===t||void 0===t)return!1;var e=this._paneRenderers[t];return void 0===e&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e},_createRenderer:function(t){return this.options.preferCanvas&&lr(t)||vr(t)}});var mr=Bn.extend({initialize:function(t,e){Bn.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=B(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});pr.create=dr,pr.pointsToPath=G,jn.geometryToLayer=Fn,jn.coordsToLatLng=$n,jn.coordsToLatLngs=Vn,jn.latLngToCoords=Un,jn.latLngsToCoords=Hn,jn.getFeature=Wn,jn.asFeature=Zn,Ze.mergeOptions({boxZoom:!0});var gr=tn.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){Me(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Te(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ie(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),Ut(),be(),this._startPoint=this._map.mouseEventToContainerPoint(t),Me(document,{contextmenu:ze,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=re("div","leaflet-zoom-box",this._container),ce(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var e=new R(this._point,this._startPoint),n=e.getSize();me(this._box,e.min),this._box.style.width=n.x+"px",this._box.style.height=n.y+"px"},_finish:function(){this._moved&&(ie(this._box),le(this._container,"leaflet-crosshair")),Ht(),we(),Te(document,{contextmenu:ze,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if((1===t.which||1===t.button)&&(this._finish(),this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(r(this._resetState,this),0);var e=new z(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(e).fire("boxzoomend",{boxZoomBounds:e})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}});Ze.addInitHook("addHandler","boxZoom",gr),Ze.mergeOptions({doubleClickZoom:!0});var yr=tn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,n=e.getZoom(),r=e.options.zoomDelta,i=t.originalEvent.shiftKey?n-r:n+r;"center"===e.options.doubleClickZoom?e.setZoom(i):e.setZoomAround(t.containerPoint,i)}});Ze.addInitHook("addHandler","doubleClickZoom",yr),Ze.mergeOptions({dragging:!0,inertia:!it,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var br=tn.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new sn(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}ce(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){le(this._map._container,"leaflet-grab"),le(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var e=B(this._map.options.maxBounds);this._offsetLimit=I(this._map.latLngToContainerPoint(e.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(e.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var e=this._lastTime=+new Date,n=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(n),this._times.push(e),this._prunePositions(e)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){if(this._viscosity&&this._offsetLimit){var t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit;t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),n=this._initialWorldOffset,r=this._draggable._newPos.x,i=(r-e+n)%t+e-n,o=(r+e+n)%t-e-n,a=Math.abs(i+n)<Math.abs(o+n)?i:o;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=a},_onDragEnd:function(t){var e=this._map,n=e.options,r=!n.inertia||this._times.length<2;if(e.fire("dragend",t),r)e.fire("moveend");else{this._prunePositions(+new Date);var i=this._lastPos.subtract(this._positions[0]),o=(this._lastTime-this._times[0])/1e3,a=n.easeLinearity,s=i.multiplyBy(a/o),u=s.distanceTo([0,0]),c=Math.min(n.inertiaMaxSpeed,u),l=s.multiplyBy(c/u),h=c/(n.inertiaDeceleration*a),f=l.multiplyBy(-h/2).round();f.x||f.y?(f=e._limitOffset(f,e.options.maxBounds),C((function(){e.panBy(f,{duration:h,easeLinearity:a,noMoveStart:!0,animate:!0})}))):e.fire("moveend")}}});Ze.addInitHook("addHandler","dragging",br),Ze.mergeOptions({keyboard:!0,keyboardPanDelta:80});var wr=tn.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),Me(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Te(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,e=document.documentElement,n=t.scrollTop||e.scrollTop,r=t.scrollLeft||e.scrollLeft;this._map._container.focus(),window.scrollTo(r,n)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var e,n,r=this._panKeys={},i=this.keyCodes;for(e=0,n=i.left.length;e<n;e++)r[i.left[e]]=[-1*t,0];for(e=0,n=i.right.length;e<n;e++)r[i.right[e]]=[t,0];for(e=0,n=i.down.length;e<n;e++)r[i.down[e]]=[0,t];for(e=0,n=i.up.length;e<n;e++)r[i.up[e]]=[0,-1*t]},_setZoomDelta:function(t){var e,n,r=this._zoomKeys={},i=this.keyCodes;for(e=0,n=i.zoomIn.length;e<n;e++)r[i.zoomIn[e]]=t;for(e=0,n=i.zoomOut.length;e<n;e++)r[i.zoomOut[e]]=-t},_addHooks:function(){Me(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Te(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,n=t.keyCode,r=this._map;if(n in this._panKeys)r._panAnim&&r._panAnim._inProgress||(e=this._panKeys[n],t.shiftKey&&(e=N(e).multiplyBy(3)),r.panBy(e),r.options.maxBounds&&r.panInsideBounds(r.options.maxBounds));else if(n in this._zoomKeys)r.setZoom(r.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[n]);else{if(27!==n||!r._popup||!r._popup.options.closeOnEscapeKey)return;r.closePopup()}ze(t)}}});Ze.addInitHook("addHandler","keyboard",wr),Ze.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var _r=tn.extend({addHooks:function(){Me(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Te(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=Fe(t),n=this._map.options.wheelDebounceTime;this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var i=Math.max(n-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(r(this._performZoom,this),i),ze(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),n=this._map.options.zoomSnap||0;t._stop();var r=this._delta/(4*this._map.options.wheelPxPerZoomLevel),i=4*Math.log(2/(1+Math.exp(-Math.abs(r))))/Math.LN2,o=n?Math.ceil(i/n)*n:i,a=t._limitZoom(e+(this._delta>0?o:-o))-e;this._delta=0,this._startTime=null,a&&("center"===t.options.scrollWheelZoom?t.setZoom(e+a):t.setZoomAround(this._lastMousePos,e+a))}});Ze.addInitHook("addHandler","scrollWheelZoom",_r),Ze.mergeOptions({tap:!0,tapTolerance:15});var xr=tn.extend({addHooks:function(){Me(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Te(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(Ie(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var e=t.touches[0],n=e.target;this._startPos=this._newPos=new D(e.clientX,e.clientY),n.tagName&&"a"===n.tagName.toLowerCase()&&ce(n,"leaflet-active"),this._holdTimeout=setTimeout(r((function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",e))}),this),1e3),this._simulateEvent("mousedown",e),Me(document,{touchmove:this._onMove,touchend:this._onUp},this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),Te(document,{touchmove:this._onMove,touchend:this._onUp},this),this._fireClick&&t&&t.changedTouches){var e=t.changedTouches[0],n=e.target;n&&n.tagName&&"a"===n.tagName.toLowerCase()&&le(n,"leaflet-active"),this._simulateEvent("mouseup",e),this._isTapValid()&&this._simulateEvent("click",e)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new D(e.clientX,e.clientY),this._simulateEvent("mousemove",e)},_simulateEvent:function(t,e){var n=document.createEvent("MouseEvents");n._simulated=!0,e.target._simulatedClick=!0,n.initMouseEvent(t,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(n)}});!kt||xt&&!lt||Ze.addInitHook("addHandler","tap",xr),Ze.mergeOptions({touchZoom:kt&&!it,bounceAtZoomLimits:!0});var kr=tn.extend({addHooks:function(){ce(this._map._container,"leaflet-touch-zoom"),Me(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){le(this._map._container,"leaflet-touch-zoom"),Te(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e=this._map;if(t.touches&&2===t.touches.length&&!e._animatingZoom&&!this._zooming){var n=e.mouseEventToContainerPoint(t.touches[0]),r=e.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=e.getSize()._divideBy(2),this._startLatLng=e.containerPointToLatLng(this._centerPoint),"center"!==e.options.touchZoom&&(this._pinchStartLatLng=e.containerPointToLatLng(n.add(r)._divideBy(2))),this._startDist=n.distanceTo(r),this._startZoom=e.getZoom(),this._moved=!1,this._zooming=!0,e._stop(),Me(document,"touchmove",this._onTouchMove,this),Me(document,"touchend",this._onTouchEnd,this),Ie(t)}},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,n=e.mouseEventToContainerPoint(t.touches[0]),i=e.mouseEventToContainerPoint(t.touches[1]),o=n.distanceTo(i)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&o<1||this._zoom>e.getMaxZoom()&&o>1)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1===o)return}else{var a=n._add(i)._divideBy(2)._subtract(this._centerPoint);if(1===o&&0===a.x&&0===a.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(a),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),M(this._animRequest);var s=r(e._move,e,this._center,this._zoom,{pinch:!0,round:!1});this._animRequest=C(s,this,!0),Ie(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,M(this._animRequest),Te(document,"touchmove",this._onTouchMove,this),Te(document,"touchend",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}});Ze.addInitHook("addHandler","touchZoom",kr),Ze.BoxZoom=gr,Ze.DoubleClickZoom=yr,Ze.Drag=br,Ze.Keyboard=wr,Ze.ScrollWheelZoom=_r,Ze.Tap=xr,Ze.TouchZoom=kr,t.version="1.7.1",t.Control=Je,t.control=Ye,t.Browser=Pt,t.Evented=O,t.Mixin=nn,t.Util=E,t.Class=T,t.Handler=tn,t.extend=e,t.bind=r,t.stamp=o,t.setOptions=d,t.DomEvent=He,t.DomUtil=Ce,t.PosAnimation=We,t.Draggable=sn,t.LineUtil=yn,t.PolyUtil=wn,t.Point=D,t.point=N,t.Bounds=R,t.bounds=I,t.Transformation=W,t.transformation=Z,t.Projection=kn,t.LatLng=j,t.latLng=F,t.LatLngBounds=z,t.latLngBounds=B,t.CRS=$,t.GeoJSON=jn,t.geoJSON=Yn,t.geoJson=Kn,t.Layer=En,t.LayerGroup=Tn,t.layerGroup=function(t,e){return new Tn(t,e)},t.FeatureGroup=An,t.featureGroup=function(t,e){return new An(t,e)},t.ImageOverlay=Gn,t.imageOverlay=function(t,e,n){return new Gn(t,e,n)},t.VideoOverlay=Xn,t.videoOverlay=function(t,e,n){return new Xn(t,e,n)},t.SVGOverlay=Qn,t.svgOverlay=function(t,e,n){return new Qn(t,e,n)},t.DivOverlay=tr,t.Popup=er,t.popup=function(t,e){return new er(t,e)},t.Tooltip=nr,t.tooltip=function(t,e){return new nr(t,e)},t.Icon=On,t.icon=function(t){return new On(t)},t.DivIcon=rr,t.divIcon=function(t){return new rr(t)},t.Marker=Ln,t.marker=function(t,e){return new Ln(t,e)},t.TileLayer=or,t.tileLayer=ar,t.GridLayer=ir,t.gridLayer=function(t){return new ir(t)},t.SVG=pr,t.svg=vr,t.Renderer=ur,t.Canvas=cr,t.canvas=lr,t.Path=Nn,t.CircleMarker=Rn,t.circleMarker=function(t,e){return new Rn(t,e)},t.Circle=In,t.circle=function(t,e,n){return new In(t,e,n)},t.Polyline=zn,t.polyline=function(t,e){return new zn(t,e)},t.Polygon=Bn,t.polygon=function(t,e){return new Bn(t,e)},t.Rectangle=mr,t.rectangle=function(t,e){return new mr(t,e)},t.Map=Ze,t.map=function(t,e){return new Ze(t,e)};var Sr=window.L;t.noConflict=function(){return window.L=Sr,this},window.L=t},"object"===s(e)&&"undefined"!==typeof t?a(e):(i=[e],void 0===(o="function"===typeof(r=a)?r.apply(e,i):r)||(t.exports=o))},function(t,e,n){"use strict";t.exports=function(t){return null===t||void 0===t}},function(t,e,n){"use strict";var r=n(2);t.exports=r({}.isPrototypeOf)},function(t,e,n){"use strict";var r,i=n(5),o=n(123),a=n(121),s=n(78),u=n(163),c=n(95),l=n(96),h=l("IE_PROTO"),f=function(){},d=function(t){return"<script>"+t+"</"+"script>"},p=function(t){t.write(d("")),t.close();var e=t.parentWindow.Object;return t=null,e},v=function(){try{r=new ActiveXObject("htmlfile")}catch(i){}var t,e;v="undefined"!=typeof document?document.domain&&r?p(r):((e=c("iframe")).style.display="none",u.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(d("document.F=Object")),t.close(),t.F):p(r);for(var n=a.length;n--;)delete v.prototype[a[n]];return v()};s[h]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(f.prototype=i(t),n=new f,f.prototype=null,n[h]=t):n=v(),void 0===e?n:o.f(n,e)}},function(t,e,n){"use strict";var r=n(117),i=n(15);t.exports=function(t,e,n){return n.get&&r(n.get,e,{getter:!0}),n.set&&r(n.set,e,{setter:!0}),i.f(t,e,n)}},function(t,e,n){"use strict";var r=n(12),i=n(8),o=n(14),a=n(96),s=n(130),u=a("IE_PROTO"),c=Object,l=c.prototype;t.exports=s?c.getPrototypeOf:function(t){var e=o(t);if(r(e,u))return e[u];var n=e.constructor;return i(n)&&e instanceof n?n.prototype:e instanceof c?l:null}},function(t,e,n){"use strict";var r=n(4),i=n(15),o=n(48);t.exports=r?function(t,e,n){return i.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){"use strict";var r=n(61),i=n(18),o=n(75),a=r(r.bind);t.exports=function(t,e){return i(t),void 0===e?t:o?a(t,e):function(){return t.apply(e,arguments)}}},function(t,e,n){"use strict";var r=n(75),i=Function.prototype,o=i.apply,a=i.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(o):function(){return a.apply(o,arguments)})},function(t,e,n){"use strict";(function(t){var r=n(229),i=n(230);function o(t){return(o="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)}var a=setTimeout;function s(t){return Boolean(t&&"undefined"!==typeof t.length)}function u(){}function c(t){if(!(this instanceof c))throw new TypeError("Promises must be constructed via new");if("function"!==typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],v(t,this)}function l(t,e){for(;3===t._state;)t=t._value;0!==t._state?(t._handled=!0,c._immediateFn((function(){var n=1===t._state?e.onFulfilled:e.onRejected;if(null!==n){var r;try{r=n(t._value)}catch(i){return void f(e.promise,i)}h(e.promise,r)}else(1===t._state?h:f)(e.promise,t._value)}))):t._deferreds.push(e)}function h(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"===o(e)||"function"===typeof e)){var n=e.then;if(e instanceof c)return t._state=3,t._value=e,void d(t);if("function"===typeof n)return void v((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,d(t)}catch(a){f(t,a)}var r,i}function f(t,e){t._state=2,t._value=e,d(t)}function d(t){2===t._state&&0===t._deferreds.length&&c._immediateFn((function(){t._handled||c._unhandledRejectionFn(t._value)}));for(var e=0,n=t._deferreds.length;e<n;e++)l(t,t._deferreds[e]);t._deferreds=null}function p(t,e,n){this.onFulfilled="function"===typeof t?t:null,this.onRejected="function"===typeof e?e:null,this.promise=n}function v(t,e){var n=!1;try{t((function(t){n||(n=!0,h(e,t))}),(function(t){n||(n=!0,f(e,t))}))}catch(r){if(n)return;n=!0,f(e,r)}}c.prototype.catch=function(t){return this.then(null,t)},c.prototype.then=function(t,e){var n=new this.constructor(u);return l(this,new p(t,e,n)),n},c.prototype.finally=r.a,c.all=function(t){return new c((function(e,n){if(!s(t))return n(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(t);if(0===r.length)return e([]);var i=r.length;function a(t,s){try{if(s&&("object"===o(s)||"function"===typeof s)){var u=s.then;if("function"===typeof u)return void u.call(s,(function(e){a(t,e)}),n)}r[t]=s,0===--i&&e(r)}catch(c){n(c)}}for(var u=0;u<r.length;u++)a(u,r[u])}))},c.allSettled=i.a,c.resolve=function(t){return t&&"object"===o(t)&&t.constructor===c?t:new c((function(e){e(t)}))},c.reject=function(t){return new c((function(e,n){n(t)}))},c.race=function(t){return new c((function(e,n){if(!s(t))return n(new TypeError("Promise.race accepts an array"));for(var r=0,i=t.length;r<i;r++)c.resolve(t[r]).then(e,n)}))},c._immediateFn="function"===typeof t&&function(e){t(e)}||function(t){a(t,0)},c._unhandledRejectionFn=function(t){"undefined"!==typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)},e.a=c}).call(this,n(491).setImmediate)},function(t,e,n){"use strict";t.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},function(t,e,n){"use strict";var r=n(122),i=n(8),o=n(29),a=n(7)("toStringTag"),s=Object,u="Arguments"===o(function(){return arguments}());t.exports=r?o:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(n){}}(e=s(t),a))?n:u?o(e):"Object"===(r=o(e))&&i(e.callee)?"Arguments":r}},function(t,e,n){"use strict";var r=n(1);t.exports=function(t,e){var n=[][t];return!!n&&r((function(){n.call(null,e||function(){return 1},1)}))}},function(t,e,n){"use strict";var r=n(0),i=n(3),o=n(9),a=n(4),s=n(150),u=n(10),c=n(103),l=n(55),h=n(48),f=n(40),d=n(141),p=n(31),v=n(179),m=n(205),g=n(436),y=n(49),b=n(12),w=n(45),_=n(6),x=n(65),k=n(37),S=n(36),C=n(54),M=n(60).f,E=n(206),T=n(19).forEach,A=n(70),O=n(38),D=n(15),P=n(20),L=n(208),N=n(22),R=n(88),I=N.get,z=N.set,B=N.enforce,j=D.f,F=P.f,q=i.RangeError,$=c.ArrayBuffer,V=$.prototype,U=c.DataView,H=u.NATIVE_ARRAY_BUFFER_VIEWS,W=u.TYPED_ARRAY_TAG,Z=u.TypedArray,J=u.TypedArrayPrototype,Y=u.isTypedArray,K="BYTES_PER_ELEMENT",G="Wrong length",X=function(t,e){O(t,e,{configurable:!0,get:function(){return I(this)[e]}})},Q=function(t){var e;return S(V,t)||"ArrayBuffer"===(e=w(t))||"SharedArrayBuffer"===e},tt=function(t,e){return Y(t)&&!x(e)&&e in t&&d(+e)&&e>=0},et=function(t,e){return e=y(e),tt(t,e)?h(2,t[e]):F(t,e)},nt=function(t,e,n){return e=y(e),!(tt(t,e)&&_(n)&&b(n,"value"))||b(n,"get")||b(n,"set")||n.configurable||b(n,"writable")&&!n.writable||b(n,"enumerable")&&!n.enumerable?j(t,e,n):(t[e]=n.value,t)};a?(H||(P.f=et,D.f=nt,X(J,"buffer"),X(J,"byteOffset"),X(J,"byteLength"),X(J,"length")),r({target:"Object",stat:!0,forced:!H},{getOwnPropertyDescriptor:et,defineProperty:nt}),t.exports=function(t,e,n){var a=t.match(/\d+/)[0]/8,u=t+(n?"Clamped":"")+"Array",c="get"+t,h="set"+t,d=i[u],y=d,b=y&&y.prototype,w={},x=function(t,e){j(t,e,{get:function(){return function(t,e){var n=I(t);return n.view[c](e*a+n.byteOffset,!0)}(this,e)},set:function(t){return function(t,e,r){var i=I(t);i.view[h](e*a+i.byteOffset,n?g(r):r,!0)}(this,e,t)},enumerable:!0})};H?s&&(y=e((function(t,e,n,r){return l(t,b),R(_(e)?Q(e)?void 0!==r?new d(e,m(n,a),r):void 0!==n?new d(e,m(n,a)):new d(e):Y(e)?L(y,e):o(E,y,e):new d(v(e)),t,y)})),C&&C(y,Z),T(M(d),(function(t){t in y||f(y,t,d[t])})),y.prototype=b):(y=e((function(t,e,n,r){l(t,b);var i,s,u,c=0,h=0;if(_(e)){if(!Q(e))return Y(e)?L(y,e):o(E,y,e);i=e,h=m(n,a);var f=e.byteLength;if(void 0===r){if(f%a)throw new q(G);if((s=f-h)<0)throw new q(G)}else if((s=p(r)*a)+h>f)throw new q(G);u=s/a}else u=v(e),i=new $(s=u*a);for(z(t,{buffer:i,byteOffset:h,byteLength:s,length:u,view:new U(i)});c<u;)x(t,c++)})),C&&C(y,Z),b=y.prototype=k(J)),b.constructor!==y&&f(b,"constructor",y),B(b).TypedArrayConstructor=y,W&&f(b,W,u);var S=y!==d;w[u]=y,r({global:!0,constructor:!0,forced:S,sham:!H},w),K in y||f(y,K,a),K in b||f(b,K,a),A(u)}):t.exports=function(){}},function(t,e,n){"use strict";t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){"use strict";var r=n(94),i=n(65);t.exports=function(t){var e=r(t,"string");return i(e)?e:e+""}},function(t,e,n){"use strict";var r,i,o=n(3),a=n(44),s=o.process,u=o.Deno,c=s&&s.versions||u&&u.version,l=c&&c.v8;l&&(i=(r=l.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!i&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(i=+r[1]),t.exports=i},function(t,e,n){"use strict";var r=n(30),i=Math.max,o=Math.min;t.exports=function(t,e){var n=r(t);return n<0?i(n+e,0):o(n,e)}},function(t,e,n){"use strict";var r=n(29);t.exports=Array.isArray||function(t){return"Array"===r(t)}},function(t,e,n){"use strict";var r=n(7),i=n(37),o=n(15).f,a=r("unscopables"),s=Array.prototype;void 0===s[a]&&o(s,a,{configurable:!0,value:i(null)}),t.exports=function(t){s[a][t]=!0}},function(t,e,n){"use strict";var r=n(274),i=n(5),o=n(175);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=r(Object.prototype,"__proto__","set"))(n,[]),e=n instanceof Array}catch(a){}return function(n,r){return i(n),o(r),e?t(n,r):n.__proto__=r,n}}():void 0)},function(t,e,n){"use strict";var r=n(36),i=TypeError;t.exports=function(t,e){if(r(e,t))return t;throw new i("Incorrect invocation")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return I})),n.d(e,"b",(function(){return B}));var r=function(){function t(t,e){this.eventTarget=t,this.eventName=e,this.unorderedBindings=new Set}return t.prototype.connect=function(){this.eventTarget.addEventListener(this.eventName,this,!1)},t.prototype.disconnect=function(){this.eventTarget.removeEventListener(this.eventName,this,!1)},t.prototype.bindingConnected=function(t){this.unorderedBindings.add(t)},t.prototype.bindingDisconnected=function(t){this.unorderedBindings.delete(t)},t.prototype.handleEvent=function(t){for(var e=function(t){if("immediatePropagationStopped"in t)return t;var e=t.stopImmediatePropagation;return Object.assign(t,{immediatePropagationStopped:!1,stopImmediatePropagation:function(){this.immediatePropagationStopped=!0,e.call(this)}})}(t),n=0,r=this.bindings;n<r.length;n++){var i=r[n];if(e.immediatePropagationStopped)break;i.handleEvent(e)}},Object.defineProperty(t.prototype,"bindings",{get:function(){return Array.from(this.unorderedBindings).sort((function(t,e){var n=t.index,r=e.index;return n<r?-1:n>r?1:0}))},enumerable:!0,configurable:!0}),t}();var i=function(){function t(t){this.application=t,this.eventListenerMaps=new Map,this.started=!1}return t.prototype.start=function(){this.started||(this.started=!0,this.eventListeners.forEach((function(t){return t.connect()})))},t.prototype.stop=function(){this.started&&(this.started=!1,this.eventListeners.forEach((function(t){return t.disconnect()})))},Object.defineProperty(t.prototype,"eventListeners",{get:function(){return Array.from(this.eventListenerMaps.values()).reduce((function(t,e){return t.concat(Array.from(e.values()))}),[])},enumerable:!0,configurable:!0}),t.prototype.bindingConnected=function(t){this.fetchEventListenerForBinding(t).bindingConnected(t)},t.prototype.bindingDisconnected=function(t){this.fetchEventListenerForBinding(t).bindingDisconnected(t)},t.prototype.handleError=function(t,e,n){void 0===n&&(n={}),this.application.handleError(t,"Error "+e,n)},t.prototype.fetchEventListenerForBinding=function(t){var e=t.eventTarget,n=t.eventName;return this.fetchEventListener(e,n)},t.prototype.fetchEventListener=function(t,e){var n=this.fetchEventListenerMapForEventTarget(t),r=n.get(e);return r||(r=this.createEventListener(t,e),n.set(e,r)),r},t.prototype.createEventListener=function(t,e){var n=new r(t,e);return this.started&&n.connect(),n},t.prototype.fetchEventListenerMapForEventTarget=function(t){var e=this.eventListenerMaps.get(t);return e||(e=new Map,this.eventListenerMaps.set(t,e)),e},t}(),o=/^((.+?)(@(window|document))?->)?(.+?)(#(.+))?$/;function a(t){return"window"==t?window:"document"==t?document:void 0}var s=function(){function t(t,e,n){this.element=t,this.index=e,this.eventTarget=n.eventTarget||t,this.eventName=n.eventName||function(t){var e=t.tagName.toLowerCase();if(e in u)return u[e](t)}(t)||c("missing event name"),this.identifier=n.identifier||c("missing identifier"),this.methodName=n.methodName||c("missing method name")}return t.forToken=function(t){return new this(t.element,t.index,(e=t.content,{eventTarget:a((n=e.trim().match(o)||[])[4]),eventName:n[2],identifier:n[5],methodName:n[7]}));var e,n},t.prototype.toString=function(){var t=this.eventTargetName?"@"+this.eventTargetName:"";return""+this.eventName+t+"->"+this.identifier+"#"+this.methodName},Object.defineProperty(t.prototype,"eventTargetName",{get:function(){return(t=this.eventTarget)==window?"window":t==document?"document":void 0;var t},enumerable:!0,configurable:!0}),t}(),u={a:function(t){return"click"},button:function(t){return"click"},form:function(t){return"submit"},input:function(t){return"submit"==t.getAttribute("type")?"click":"change"},select:function(t){return"change"},textarea:function(t){return"change"}};function c(t){throw new Error(t)}var l=function(){function t(t,e){this.context=t,this.action=e}return Object.defineProperty(t.prototype,"index",{get:function(){return this.action.index},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"eventTarget",{get:function(){return this.action.eventTarget},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"identifier",{get:function(){return this.context.identifier},enumerable:!0,configurable:!0}),t.prototype.handleEvent=function(t){this.willBeInvokedByEvent(t)&&this.invokeWithEvent(t)},Object.defineProperty(t.prototype,"eventName",{get:function(){return this.action.eventName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"method",{get:function(){var t=this.controller[this.methodName];if("function"==typeof t)return t;throw new Error('Action "'+this.action+'" references undefined method "'+this.methodName+'"')},enumerable:!0,configurable:!0}),t.prototype.invokeWithEvent=function(t){try{this.method.call(this.controller,t)}catch(c){var e=this,n={identifier:e.identifier,controller:e.controller,element:e.element,index:e.index,event:t};this.context.handleError(c,'invoking action "'+this.action+'"',n)}},t.prototype.willBeInvokedByEvent=function(t){var e=t.target;return this.element===e||(!(e instanceof Element&&this.element.contains(e))||this.scope.containsElement(e))},Object.defineProperty(t.prototype,"controller",{get:function(){return this.context.controller},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"methodName",{get:function(){return this.action.methodName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.scope.element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scope",{get:function(){return this.context.scope},enumerable:!0,configurable:!0}),t}(),h=function(){function t(t,e){var n=this;this.element=t,this.started=!1,this.delegate=e,this.elements=new Set,this.mutationObserver=new MutationObserver((function(t){return n.processMutations(t)}))}return t.prototype.start=function(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,childList:!0,subtree:!0}),this.refresh())},t.prototype.stop=function(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)},t.prototype.refresh=function(){if(this.started){for(var t=new Set(this.matchElementsInTree()),e=0,n=Array.from(this.elements);e<n.length;e++){var r=n[e];t.has(r)||this.removeElement(r)}for(var i=0,o=Array.from(t);i<o.length;i++){r=o[i];this.addElement(r)}}},t.prototype.processMutations=function(t){if(this.started)for(var e=0,n=t;e<n.length;e++){var r=n[e];this.processMutation(r)}},t.prototype.processMutation=function(t){"attributes"==t.type?this.processAttributeChange(t.target,t.attributeName):"childList"==t.type&&(this.processRemovedNodes(t.removedNodes),this.processAddedNodes(t.addedNodes))},t.prototype.processAttributeChange=function(t,e){var n=t;this.elements.has(n)?this.delegate.elementAttributeChanged&&this.matchElement(n)?this.delegate.elementAttributeChanged(n,e):this.removeElement(n):this.matchElement(n)&&this.addElement(n)},t.prototype.processRemovedNodes=function(t){for(var e=0,n=Array.from(t);e<n.length;e++){var r=n[e],i=this.elementFromNode(r);i&&this.processTree(i,this.removeElement)}},t.prototype.processAddedNodes=function(t){for(var e=0,n=Array.from(t);e<n.length;e++){var r=n[e],i=this.elementFromNode(r);i&&this.elementIsActive(i)&&this.processTree(i,this.addElement)}},t.prototype.matchElement=function(t){return this.delegate.matchElement(t)},t.prototype.matchElementsInTree=function(t){return void 0===t&&(t=this.element),this.delegate.matchElementsInTree(t)},t.prototype.processTree=function(t,e){for(var n=0,r=this.matchElementsInTree(t);n<r.length;n++){var i=r[n];e.call(this,i)}},t.prototype.elementFromNode=function(t){if(t.nodeType==Node.ELEMENT_NODE)return t},t.prototype.elementIsActive=function(t){return t.isConnected==this.element.isConnected&&this.element.contains(t)},t.prototype.addElement=function(t){this.elements.has(t)||this.elementIsActive(t)&&(this.elements.add(t),this.delegate.elementMatched&&this.delegate.elementMatched(t))},t.prototype.removeElement=function(t){this.elements.has(t)&&(this.elements.delete(t),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(t))},t}(),f=function(){function t(t,e,n){this.attributeName=e,this.delegate=n,this.elementObserver=new h(t,this)}return Object.defineProperty(t.prototype,"element",{get:function(){return this.elementObserver.element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"selector",{get:function(){return"["+this.attributeName+"]"},enumerable:!0,configurable:!0}),t.prototype.start=function(){this.elementObserver.start()},t.prototype.stop=function(){this.elementObserver.stop()},t.prototype.refresh=function(){this.elementObserver.refresh()},Object.defineProperty(t.prototype,"started",{get:function(){return this.elementObserver.started},enumerable:!0,configurable:!0}),t.prototype.matchElement=function(t){return t.hasAttribute(this.attributeName)},t.prototype.matchElementsInTree=function(t){var e=this.matchElement(t)?[t]:[],n=Array.from(t.querySelectorAll(this.selector));return e.concat(n)},t.prototype.elementMatched=function(t){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(t,this.attributeName)},t.prototype.elementUnmatched=function(t){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(t,this.attributeName)},t.prototype.elementAttributeChanged=function(t,e){this.delegate.elementAttributeValueChanged&&this.attributeName==e&&this.delegate.elementAttributeValueChanged(t,e)},t}();function d(t,e,n){v(t,e).add(n)}function p(t,e,n){v(t,e).delete(n),function(t,e){var n=t.get(e);null!=n&&0==n.size&&t.delete(e)}(t,e)}function v(t,e){var n=t.get(e);return n||(n=new Set,t.set(e,n)),n}var m,g=function(){function t(){this.valuesByKey=new Map}return Object.defineProperty(t.prototype,"values",{get:function(){return Array.from(this.valuesByKey.values()).reduce((function(t,e){return t.concat(Array.from(e))}),[])},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return Array.from(this.valuesByKey.values()).reduce((function(t,e){return t+e.size}),0)},enumerable:!0,configurable:!0}),t.prototype.add=function(t,e){d(this.valuesByKey,t,e)},t.prototype.delete=function(t,e){p(this.valuesByKey,t,e)},t.prototype.has=function(t,e){var n=this.valuesByKey.get(t);return null!=n&&n.has(e)},t.prototype.hasKey=function(t){return this.valuesByKey.has(t)},t.prototype.hasValue=function(t){return Array.from(this.valuesByKey.values()).some((function(e){return e.has(t)}))},t.prototype.getValuesForKey=function(t){var e=this.valuesByKey.get(t);return e?Array.from(e):[]},t.prototype.getKeysForValue=function(t){return Array.from(this.valuesByKey).filter((function(e){e[0];return e[1].has(t)})).map((function(t){var e=t[0];t[1];return e}))},t}(),y=(m=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}m(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),b=(function(t){function e(){var e=t.call(this)||this;return e.keysByValue=new Map,e}y(e,t),Object.defineProperty(e.prototype,"values",{get:function(){return Array.from(this.keysByValue.keys())},enumerable:!0,configurable:!0}),e.prototype.add=function(e,n){t.prototype.add.call(this,e,n),d(this.keysByValue,n,e)},e.prototype.delete=function(e,n){t.prototype.delete.call(this,e,n),p(this.keysByValue,n,e)},e.prototype.hasValue=function(t){return this.keysByValue.has(t)},e.prototype.getKeysForValue=function(t){var e=this.keysByValue.get(t);return e?Array.from(e):[]}}(g),function(){function t(t,e,n){this.attributeObserver=new f(t,e,this),this.delegate=n,this.tokensByElement=new g}return Object.defineProperty(t.prototype,"started",{get:function(){return this.attributeObserver.started},enumerable:!0,configurable:!0}),t.prototype.start=function(){this.attributeObserver.start()},t.prototype.stop=function(){this.attributeObserver.stop()},t.prototype.refresh=function(){this.attributeObserver.refresh()},Object.defineProperty(t.prototype,"element",{get:function(){return this.attributeObserver.element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"attributeName",{get:function(){return this.attributeObserver.attributeName},enumerable:!0,configurable:!0}),t.prototype.elementMatchedAttribute=function(t){this.tokensMatched(this.readTokensForElement(t))},t.prototype.elementAttributeValueChanged=function(t){var e=this.refreshTokensForElement(t),n=e[0],r=e[1];this.tokensUnmatched(n),this.tokensMatched(r)},t.prototype.elementUnmatchedAttribute=function(t){this.tokensUnmatched(this.tokensByElement.getValuesForKey(t))},t.prototype.tokensMatched=function(t){var e=this;t.forEach((function(t){return e.tokenMatched(t)}))},t.prototype.tokensUnmatched=function(t){var e=this;t.forEach((function(t){return e.tokenUnmatched(t)}))},t.prototype.tokenMatched=function(t){this.delegate.tokenMatched(t),this.tokensByElement.add(t.element,t)},t.prototype.tokenUnmatched=function(t){this.delegate.tokenUnmatched(t),this.tokensByElement.delete(t.element,t)},t.prototype.refreshTokensForElement=function(t){var e,n,r,i=this.tokensByElement.getValuesForKey(t),o=this.readTokensForElement(t),a=(e=i,n=o,r=Math.max(e.length,n.length),Array.from({length:r},(function(t,r){return[e[r],n[r]]}))).findIndex((function(t){return!function(t,e){return t&&e&&t.index==e.index&&t.content==e.content}(t[0],t[1])}));return-1==a?[[],[]]:[i.slice(a),o.slice(a)]},t.prototype.readTokensForElement=function(t){var e=this.attributeName;return function(t,e,n){return t.trim().split(/\s+/).filter((function(t){return t.length})).map((function(t,r){return{element:e,attributeName:n,content:t,index:r}}))}(t.getAttribute(e)||"",t,e)},t}());var w=function(){function t(t,e,n){this.tokenListObserver=new b(t,e,this),this.delegate=n,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}return Object.defineProperty(t.prototype,"started",{get:function(){return this.tokenListObserver.started},enumerable:!0,configurable:!0}),t.prototype.start=function(){this.tokenListObserver.start()},t.prototype.stop=function(){this.tokenListObserver.stop()},t.prototype.refresh=function(){this.tokenListObserver.refresh()},Object.defineProperty(t.prototype,"element",{get:function(){return this.tokenListObserver.element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"attributeName",{get:function(){return this.tokenListObserver.attributeName},enumerable:!0,configurable:!0}),t.prototype.tokenMatched=function(t){var e=t.element,n=this.fetchParseResultForToken(t).value;n&&(this.fetchValuesByTokenForElement(e).set(t,n),this.delegate.elementMatchedValue(e,n))},t.prototype.tokenUnmatched=function(t){var e=t.element,n=this.fetchParseResultForToken(t).value;n&&(this.fetchValuesByTokenForElement(e).delete(t),this.delegate.elementUnmatchedValue(e,n))},t.prototype.fetchParseResultForToken=function(t){var e=this.parseResultsByToken.get(t);return e||(e=this.parseToken(t),this.parseResultsByToken.set(t,e)),e},t.prototype.fetchValuesByTokenForElement=function(t){var e=this.valuesByTokenByElement.get(t);return e||(e=new Map,this.valuesByTokenByElement.set(t,e)),e},t.prototype.parseToken=function(t){try{return{value:this.delegate.parseValueForToken(t)}}catch(c){return{error:c}}},t}(),_=function(){function t(t,e){this.context=t,this.delegate=e,this.bindingsByAction=new Map}return t.prototype.start=function(){this.valueListObserver||(this.valueListObserver=new w(this.element,this.actionAttribute,this),this.valueListObserver.start())},t.prototype.stop=function(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())},Object.defineProperty(t.prototype,"element",{get:function(){return this.context.element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"identifier",{get:function(){return this.context.identifier},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"actionAttribute",{get:function(){return this.schema.actionAttribute},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return this.context.schema},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bindings",{get:function(){return Array.from(this.bindingsByAction.values())},enumerable:!0,configurable:!0}),t.prototype.connectAction=function(t){var e=new l(this.context,t);this.bindingsByAction.set(t,e),this.delegate.bindingConnected(e)},t.prototype.disconnectAction=function(t){var e=this.bindingsByAction.get(t);e&&(this.bindingsByAction.delete(t),this.delegate.bindingDisconnected(e))},t.prototype.disconnectAllActions=function(){var t=this;this.bindings.forEach((function(e){return t.delegate.bindingDisconnected(e)})),this.bindingsByAction.clear()},t.prototype.parseValueForToken=function(t){var e=s.forToken(t);if(e.identifier==this.identifier)return e},t.prototype.elementMatchedValue=function(t,e){this.connectAction(e)},t.prototype.elementUnmatchedValue=function(t,e){this.disconnectAction(e)},t}(),x=function(){function t(t,e){this.module=t,this.scope=e,this.controller=new t.controllerConstructor(this),this.bindingObserver=new _(this,this.dispatcher);try{this.controller.initialize()}catch(c){this.handleError(c,"initializing controller")}}return t.prototype.connect=function(){this.bindingObserver.start();try{this.controller.connect()}catch(c){this.handleError(c,"connecting controller")}},t.prototype.disconnect=function(){try{this.controller.disconnect()}catch(c){this.handleError(c,"disconnecting controller")}this.bindingObserver.stop()},Object.defineProperty(t.prototype,"application",{get:function(){return this.module.application},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"identifier",{get:function(){return this.module.identifier},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return this.application.schema},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dispatcher",{get:function(){return this.application.dispatcher},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.scope.element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentElement",{get:function(){return this.element.parentElement},enumerable:!0,configurable:!0}),t.prototype.handleError=function(t,e,n){void 0===n&&(n={});var r=this,i=r.identifier,o=r.controller,a=r.element;n=Object.assign({identifier:i,controller:o,element:a},n),this.application.handleError(t,"Error "+e,n)},t}(),k=function(){var t=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])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function S(t){var e=C(t);return e.bless(),e}var C=function(){function t(t){function e(){var n=this&&this instanceof e?this.constructor:void 0;return Reflect.construct(t,arguments,n)}return e.prototype=Object.create(t.prototype,{constructor:{value:e}}),Reflect.setPrototypeOf(e,t),e}try{return(e=t((function(){this.a.call(this)}))).prototype.a=function(){},new e,t}catch(c){return function(t){return function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return k(e,t),e}(t)}}var e}(),M=function(){function t(t,e){this.application=t,this.definition=function(t){return{identifier:t.identifier,controllerConstructor:S(t.controllerConstructor)}}(e),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}return Object.defineProperty(t.prototype,"identifier",{get:function(){return this.definition.identifier},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"controllerConstructor",{get:function(){return this.definition.controllerConstructor},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"contexts",{get:function(){return Array.from(this.connectedContexts)},enumerable:!0,configurable:!0}),t.prototype.connectContextForScope=function(t){var e=this.fetchContextForScope(t);this.connectedContexts.add(e),e.connect()},t.prototype.disconnectContextForScope=function(t){var e=this.contextsByScope.get(t);e&&(this.connectedContexts.delete(e),e.disconnect())},t.prototype.fetchContextForScope=function(t){var e=this.contextsByScope.get(t);return e||(e=new x(this,t),this.contextsByScope.set(t,e)),e},t}(),E=function(){function t(t){this.scope=t}return Object.defineProperty(t.prototype,"element",{get:function(){return this.scope.element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"identifier",{get:function(){return this.scope.identifier},enumerable:!0,configurable:!0}),t.prototype.get=function(t){return t=this.getFormattedKey(t),this.element.getAttribute(t)},t.prototype.set=function(t,e){return t=this.getFormattedKey(t),this.element.setAttribute(t,e),this.get(t)},t.prototype.has=function(t){return t=this.getFormattedKey(t),this.element.hasAttribute(t)},t.prototype.delete=function(t){return!!this.has(t)&&(t=this.getFormattedKey(t),this.element.removeAttribute(t),!0)},t.prototype.getFormattedKey=function(t){return"data-"+this.identifier+"-"+t.replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))},t}();function T(t,e){return"["+t+'~="'+e+'"]'}var A=function(){function t(t){this.scope=t}return Object.defineProperty(t.prototype,"element",{get:function(){return this.scope.element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"identifier",{get:function(){return this.scope.identifier},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return this.scope.schema},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return null!=this.find(t)},t.prototype.find=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.getSelectorForTargetNames(t);return this.scope.findElement(n)},t.prototype.findAll=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.getSelectorForTargetNames(t);return this.scope.findAllElements(n)},t.prototype.getSelectorForTargetNames=function(t){var e=this;return t.map((function(t){return e.getSelectorForTargetName(t)})).join(", ")},t.prototype.getSelectorForTargetName=function(t){var e=this.identifier+"."+t;return T(this.schema.targetAttribute,e)},t}(),O=function(){function t(t,e,n){this.schema=t,this.identifier=e,this.element=n,this.targets=new A(this),this.data=new E(this)}return t.prototype.findElement=function(t){return this.findAllElements(t)[0]},t.prototype.findAllElements=function(t){var e=this.element.matches(t)?[this.element]:[],n=this.filterElements(Array.from(this.element.querySelectorAll(t)));return e.concat(n)},t.prototype.filterElements=function(t){var e=this;return t.filter((function(t){return e.containsElement(t)}))},t.prototype.containsElement=function(t){return t.closest(this.controllerSelector)===this.element},Object.defineProperty(t.prototype,"controllerSelector",{get:function(){return T(this.schema.controllerAttribute,this.identifier)},enumerable:!0,configurable:!0}),t}(),D=function(){function t(t,e,n){this.element=t,this.schema=e,this.delegate=n,this.valueListObserver=new w(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}return t.prototype.start=function(){this.valueListObserver.start()},t.prototype.stop=function(){this.valueListObserver.stop()},Object.defineProperty(t.prototype,"controllerAttribute",{get:function(){return this.schema.controllerAttribute},enumerable:!0,configurable:!0}),t.prototype.parseValueForToken=function(t){var e=t.element,n=t.content,r=this.fetchScopesByIdentifierForElement(e),i=r.get(n);return i||(i=new O(this.schema,n,e),r.set(n,i)),i},t.prototype.elementMatchedValue=function(t,e){var n=(this.scopeReferenceCounts.get(e)||0)+1;this.scopeReferenceCounts.set(e,n),1==n&&this.delegate.scopeConnected(e)},t.prototype.elementUnmatchedValue=function(t,e){var n=this.scopeReferenceCounts.get(e);n&&(this.scopeReferenceCounts.set(e,n-1),1==n&&this.delegate.scopeDisconnected(e))},t.prototype.fetchScopesByIdentifierForElement=function(t){var e=this.scopesByIdentifierByElement.get(t);return e||(e=new Map,this.scopesByIdentifierByElement.set(t,e)),e},t}(),P=function(){function t(t){this.application=t,this.scopeObserver=new D(this.element,this.schema,this),this.scopesByIdentifier=new g,this.modulesByIdentifier=new Map}return Object.defineProperty(t.prototype,"element",{get:function(){return this.application.element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"schema",{get:function(){return this.application.schema},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"controllerAttribute",{get:function(){return this.schema.controllerAttribute},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"modules",{get:function(){return Array.from(this.modulesByIdentifier.values())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"contexts",{get:function(){return this.modules.reduce((function(t,e){return t.concat(e.contexts)}),[])},enumerable:!0,configurable:!0}),t.prototype.start=function(){this.scopeObserver.start()},t.prototype.stop=function(){this.scopeObserver.stop()},t.prototype.loadDefinition=function(t){this.unloadIdentifier(t.identifier);var e=new M(this.application,t);this.connectModule(e)},t.prototype.unloadIdentifier=function(t){var e=this.modulesByIdentifier.get(t);e&&this.disconnectModule(e)},t.prototype.getContextForElementAndIdentifier=function(t,e){var n=this.modulesByIdentifier.get(e);if(n)return n.contexts.find((function(e){return e.element==t}))},t.prototype.handleError=function(t,e,n){this.application.handleError(t,e,n)},t.prototype.scopeConnected=function(t){this.scopesByIdentifier.add(t.identifier,t);var e=this.modulesByIdentifier.get(t.identifier);e&&e.connectContextForScope(t)},t.prototype.scopeDisconnected=function(t){this.scopesByIdentifier.delete(t.identifier,t);var e=this.modulesByIdentifier.get(t.identifier);e&&e.disconnectContextForScope(t)},t.prototype.connectModule=function(t){this.modulesByIdentifier.set(t.identifier,t),this.scopesByIdentifier.getValuesForKey(t.identifier).forEach((function(e){return t.connectContextForScope(e)}))},t.prototype.disconnectModule=function(t){this.modulesByIdentifier.delete(t.identifier),this.scopesByIdentifier.getValuesForKey(t.identifier).forEach((function(e){return t.disconnectContextForScope(e)}))},t}(),L={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target"},N=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(e){o(e)}}function s(t){try{u(r.throw(t))}catch(e){o(e)}}function u(t){t.done?i(t.value):new n((function(e){e(t.value)})).then(a,s)}u((r=r.apply(t,e||[])).next())}))},R=function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=r[2&o[0]?"return":o[0]?"throw":"next"])&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[0,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},I=function(){function t(t,e){void 0===t&&(t=document.documentElement),void 0===e&&(e=L),this.element=t,this.schema=e,this.dispatcher=new i(this),this.router=new P(this)}return t.start=function(e,n){var r=new t(e,n);return r.start(),r},t.prototype.start=function(){return N(this,void 0,void 0,(function(){return R(this,(function(t){switch(t.label){case 0:return[4,new Promise((function(t){"loading"==document.readyState?document.addEventListener("DOMContentLoaded",t):t()}))];case 1:return t.sent(),this.router.start(),this.dispatcher.start(),[2]}}))}))},t.prototype.stop=function(){this.router.stop(),this.dispatcher.stop()},t.prototype.register=function(t,e){this.load({identifier:t,controllerConstructor:e})},t.prototype.load=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=Array.isArray(t)?t:[t].concat(n);i.forEach((function(t){return e.router.loadDefinition(t)}))},t.prototype.unload=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=Array.isArray(t)?t:[t].concat(n);i.forEach((function(t){return e.router.unloadIdentifier(t)}))},Object.defineProperty(t.prototype,"controllers",{get:function(){return this.router.contexts.map((function(t){return t.controller}))},enumerable:!0,configurable:!0}),t.prototype.getControllerForElementAndIdentifier=function(t,e){var n=this.router.getContextForElementAndIdentifier(t,e);return n?n.controller:null},t.prototype.handleError=function(t,e,n){console.error("%s\n\n%o\n\n%o",e,t,n)},t}();function z(t){var e=t.prototype;(function(t){var e=function(t){var e=[];for(;t;)e.push(t),t=Object.getPrototypeOf(t);return e}(t);return Array.from(e.reduce((function(t,e){return function(t){var e=t.targets;return Array.isArray(e)?e:[]}(e).forEach((function(e){return t.add(e)})),t}),new Set))})(t).forEach((function(t){var n,r,i;return r=e,(n={})[t+"Target"]={get:function(){var e=this.targets.find(t);if(e)return e;throw new Error('Missing target element "'+this.identifier+"."+t+'"')}},n[t+"Targets"]={get:function(){return this.targets.findAll(t)}},n["has"+function(t){return t.charAt(0).toUpperCase()+t.slice(1)}(t)+"Target"]={get:function(){return this.targets.has(t)}},i=n,void Object.keys(i).forEach((function(t){if(!(t in r)){var e=i[t];Object.defineProperty(r,t,e)}}))}))}var B=function(){function t(t){this.context=t}return t.bless=function(){z(this)},Object.defineProperty(t.prototype,"application",{get:function(){return this.context.application},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"scope",{get:function(){return this.context.scope},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this.scope.element},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"identifier",{get:function(){return this.scope.identifier},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"targets",{get:function(){return this.scope.targets},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"data",{get:function(){return this.scope.data},enumerable:!0,configurable:!0}),t.prototype.initialize=function(){},t.prototype.connect=function(){},t.prototype.disconnect=function(){},t.targets=[],t}()},function(t,e,n){t.exports=n(215)},function(t,e,n){"use strict";var r=n(18),i=n(35);t.exports=function(t,e){var n=t[e];return i(n)?void 0:r(n)}},function(t,e,n){"use strict";var r=String;t.exports=function(t){try{return r(t)}catch(e){return"Object"}}},function(t,e,n){"use strict";var r=n(161),i=n(121).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},function(t,e,n){"use strict";var r=n(29),i=n(2);t.exports=function(t){if("Function"===r(t))return i(t)}},function(t,e,n){"use strict";var r=n(49),i=n(15),o=n(48);t.exports=function(t,e,n){var a=r(e);a in t?i.f(t,a,o(0,n)):t[a]=n}},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(78),a=n(6),s=n(12),u=n(15).f,c=n(60),l=n(124),h=n(138),f=n(77),d=n(71),p=!1,v=f("meta"),m=0,g=function(t){u(t,v,{value:{objectID:"O"+m++,weakData:{}}})},y=t.exports={enable:function(){y.enable=function(){},p=!0;var t=c.f,e=i([].splice),n={};n[v]=1,t(n).length&&(c.f=function(n){for(var r=t(n),i=0,o=r.length;i<o;i++)if(r[i]===v){e(r,i,1);break}return r},r({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:l.f}))},fastKey:function(t,e){if(!a(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!s(t,v)){if(!h(t))return"F";if(!e)return"E";g(t)}return t[v].objectID},getWeakData:function(t,e){if(!s(t,v)){if(!h(t))return!0;if(!e)return!1;g(t)}return t[v].weakData},onFreeze:function(t){return d&&p&&h(t)&&!s(t,v)&&g(t),t}};o[v]=!0},function(t,e){function n(t){return(n="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)}var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(i){"object"===("undefined"===typeof window?"undefined":n(window))&&(r=window)}t.exports=r},function(t,e,n){"use strict";var r=n(25),i=n(8),o=n(36),a=n(156),s=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return i(e)&&o(e.prototype,s(t))}},function(t,e,n){"use strict";var r=n(50),i=n(1),o=n(3).String;t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var t=Symbol("symbol detection");return!o(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},function(t,e,n){"use strict";var r=n(21),i=n(115);(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.35.0",mode:r?"pure":"global",copyright:"\xa9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.35.0/LICENSE",source:"https://github.com/zloirock/core-js"})},function(t,e,n){"use strict";var r=n(4),i=n(12),o=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=i(o,"name"),u=s&&"something"===function(){}.name,c=s&&(!r||r&&a(o,"name").configurable);t.exports={EXISTS:s,PROPER:u,CONFIGURABLE:c}},function(t,e,n){"use strict";var r=n(3),i=n(29);t.exports="process"===i(r.process)},function(t,e,n){"use strict";var r=n(25),i=n(38),o=n(7),a=n(4),s=o("species");t.exports=function(t){var e=r(t);a&&e&&!e[s]&&i(e,s,{configurable:!0,get:function(){return this}})}},function(t,e,n){"use strict";var r=n(1);t.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},function(t,e,n){"use strict";var r=n(41),i=n(9),o=n(5),a=n(59),s=n(128),u=n(17),c=n(36),l=n(98),h=n(86),f=n(172),d=TypeError,p=function(t,e){this.stopped=t,this.result=e},v=p.prototype;t.exports=function(t,e,n){var m,g,y,b,w,_,x,k=n&&n.that,S=!(!n||!n.AS_ENTRIES),C=!(!n||!n.IS_RECORD),M=!(!n||!n.IS_ITERATOR),E=!(!n||!n.INTERRUPTED),T=r(e,k),A=function(t){return m&&f(m,"normal",t),new p(!0,t)},O=function(t){return S?(o(t),E?T(t[0],t[1],A):T(t[0],t[1])):E?T(t,A):T(t)};if(C)m=t.iterator;else if(M)m=t;else{if(!(g=h(t)))throw new d(a(t)+" is not iterable");if(s(g)){for(y=0,b=u(t);b>y;y++)if((w=O(t[y]))&&c(v,w))return w;return new p(!1)}m=l(t,g)}for(_=C?t.next:m.next;!(x=i(_,m)).done;){try{w=O(x.value)}catch(D){f(m,"throw",D)}if("object"==typeof w&&w&&c(v,w))return w}return new p(!1)}},function(t,e,n){"use strict";var r=n(2),i=n(24),o=n(13),a=n(106),s=r("".replace),u=RegExp("^["+a+"]+"),c=RegExp("(^|[^"+a+"])["+a+"]+$"),l=function(t){return function(e){var n=o(i(e));return 1&t&&(n=s(n,u,"")),2&t&&(n=s(n,c,"$1")),n}};t.exports={start:l(1),end:l(2),trim:l(3)}},function(t,e,n){"use strict";var r=n(3);t.exports=r.Promise},function(t,e,n){"use strict";var r=n(1);t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},function(t,e,n){"use strict";var r=n(2),i=n(1),o=n(29),a=Object,s=r("".split);t.exports=i((function(){return!a("z").propertyIsEnumerable(0)}))?function(t){return"String"===o(t)?s(t,""):a(t)}:a},function(t,e,n){"use strict";var r=n(2),i=0,o=Math.random(),a=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++i+o,36)}},function(t,e,n){"use strict";t.exports={}},function(t,e,n){"use strict";var r=n(23),i=n(51),o=n(17),a=function(t){return function(e,n,a){var s,u=r(e),c=o(u),l=i(a,c);if(t&&n!==n){for(;c>l;)if((s=u[l++])!==s)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},function(t,e,n){"use strict";var r=n(1),i=n(8),o=/#|\.prototype\./,a=function(t,e){var n=u[s(t)];return n===l||n!==c&&(i(e)?r(e):!!e)},s=a.normalize=function(t){return String(t).replace(o,".").toLowerCase()},u=a.data={},c=a.NATIVE="N",l=a.POLYFILL="P";t.exports=a},function(t,e,n){"use strict";var r=n(161),i=n(121);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e,n){"use strict";var r=n(240);t.exports=function(t,e){return new(r(t))(0===e?0:e)}},function(t,e,n){"use strict";var r=n(2),i=n(1),o=n(8),a=n(45),s=n(25),u=n(118),c=function(){},l=[],h=s("Reflect","construct"),f=/^\s*(?:class|function)\b/,d=r(f.exec),p=!f.test(c),v=function(t){if(!o(t))return!1;try{return h(c,l,t),!0}catch(e){return!1}},m=function(t){if(!o(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!d(f,u(t))}catch(e){return!0}};m.sham=!0,t.exports=!h||i((function(){var t;return v(v.call)||!v(Object)||!v((function(){t=!0}))||t}))?m:v},function(t,e,n){"use strict";var r=n(1),i=n(7),o=n(50),a=i("species");t.exports=function(t){return o>=51||!r((function(){var e=[];return(e.constructor={})[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},function(t,e,n){"use strict";t.exports={}},function(t,e,n){"use strict";var r=n(45),i=n(58),o=n(35),a=n(85),s=n(7)("iterator");t.exports=function(t){if(!o(t))return i(t,s)||i(t,"@@iterator")||a[r(t)]}},function(t,e,n){"use strict";var r=n(16);t.exports=function(t,e,n){for(var i in e)r(t,i,e[i],n);return t}},function(t,e,n){"use strict";var r=n(8),i=n(6),o=n(54);t.exports=function(t,e,n){var a,s;return o&&r(a=e.constructor)&&a!==n&&i(s=a.prototype)&&s!==n.prototype&&o(t,s),t}},function(t,e,n){"use strict";var r=n(5),i=n(135),o=n(35),a=n(7)("species");t.exports=function(t,e){var n,s=r(t).constructor;return void 0===s||o(n=r(s)[a])?e:i(n)}},function(t,e,n){"use strict";var r=TypeError;t.exports=function(t,e){if(t<e)throw new r("Not enough arguments");return t}},function(t,e,n){"use strict";var r=n(3),i=n(74),o=n(8),a=n(80),s=n(118),u=n(7),c=n(376),l=n(193),h=n(21),f=n(50),d=i&&i.prototype,p=u("species"),v=!1,m=o(r.PromiseRejectionEvent),g=a("Promise",(function(){var t=s(i),e=t!==String(i);if(!e&&66===f)return!0;if(h&&(!d.catch||!d.finally))return!0;if(!f||f<51||!/native code/.test(t)){var n=new i((function(t){t(1)})),r=function(t){t((function(){}),(function(){}))};if((n.constructor={})[p]=r,!(v=n.then((function(){}))instanceof r))return!0}return!e&&(c||l)&&!m}));t.exports={CONSTRUCTOR:g,REJECTION_EVENT:m,SUBCLASSING:v}},function(t,e,n){"use strict";var r=n(18),i=TypeError,o=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw new i("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)};t.exports.f=function(t){return new o(t)}},function(t,e,n){"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,o=i&&!r.call({1:2},1);e.f=o?function(t){var e=i(this,t);return!!e&&e.enumerable}:r},function(t,e,n){"use strict";var r=n(9),i=n(6),o=n(65),a=n(58),s=n(157),u=n(7),c=TypeError,l=u("toPrimitive");t.exports=function(t,e){if(!i(t)||o(t))return t;var n,u=a(t,l);if(u){if(void 0===e&&(e="default"),n=r(u,t,e),!i(n)||o(n))return n;throw new c("Can't convert object to primitive value")}return void 0===e&&(e="number"),s(t,e)}},function(t,e,n){"use strict";var r=n(3),i=n(6),o=r.document,a=i(o)&&i(o.createElement);t.exports=function(t){return a?o.createElement(t):{}}},function(t,e,n){"use strict";var r=n(67),i=n(77),o=r("keys");t.exports=function(t){return o[t]||(o[t]=i(t))}},function(t,e,n){"use strict";e.f=Object.getOwnPropertySymbols},function(t,e,n){"use strict";var r=n(9),i=n(18),o=n(5),a=n(59),s=n(86),u=TypeError;t.exports=function(t,e){var n=arguments.length<2?s(t):e;if(i(n))return o(r(n,t));throw new u(a(t)+" is not iterable")}},function(t,e,n){"use strict";var r=n(7)("iterator"),i=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){i=!0}};a[r]=function(){return this},Array.from(a,(function(){throw 2}))}catch(s){}t.exports=function(t,e){try{if(!e&&!i)return!1}catch(s){return!1}var n=!1;try{var o={};o[r]=function(){return{next:function(){return{done:n=!0}}}},t(o)}catch(s){}return n}},function(t,e,n){"use strict";var r=n(23),i=n(53),o=n(85),a=n(22),s=n(15).f,u=n(129),c=n(101),l=n(21),h=n(4),f="Array Iterator",d=a.set,p=a.getterFor(f);t.exports=u(Array,"Array",(function(t,e){d(this,{type:f,target:r(t),index:0,kind:e})}),(function(){var t=p(this),e=t.target,n=t.index++;if(!e||n>=e.length)return t.target=void 0,c(void 0,!0);switch(t.kind){case"keys":return c(n,!1);case"values":return c(e[n],!1)}return c([n,e[n]],!1)}),"values");var v=o.Arguments=o.Array;if(i("keys"),i("values"),i("entries"),!l&&h&&"values"!==v.name)try{s(v,"name",{value:"values"})}catch(m){}},function(t,e,n){"use strict";t.exports=function(t,e){return{value:t,done:e}}},function(t,e,n){"use strict";var r=n(18),i=n(14),o=n(76),a=n(17),s=TypeError,u=function(t){return function(e,n,u,c){var l=i(e),h=o(l),f=a(l);r(n);var d=t?f-1:0,p=t?-1:1;if(u<2)for(;;){if(d in h){c=h[d],d+=p;break}if(d+=p,t?d<0:f<=d)throw new s("Reduce of empty array with no initial value")}for(;t?d>=0:f>d;d+=p)d in h&&(c=n(c,h[d],d,l));return c}};t.exports={left:u(!1),right:u(!0)}},function(t,e,n){"use strict";var r=n(3),i=n(2),o=n(4),a=n(133),s=n(68),u=n(40),c=n(38),l=n(87),h=n(1),f=n(55),d=n(30),p=n(31),v=n(179),m=n(180),g=n(293),y=n(39),b=n(54),w=n(127),_=n(32),x=n(88),k=n(119),S=n(33),C=n(22),M=s.PROPER,E=s.CONFIGURABLE,T="ArrayBuffer",A="DataView",O="Wrong index",D=C.getterFor(T),P=C.getterFor(A),L=C.set,N=r.ArrayBuffer,R=N,I=R&&R.prototype,z=r.DataView,B=z&&z.prototype,j=Object.prototype,F=r.Array,q=r.RangeError,$=i(w),V=i([].reverse),U=g.pack,H=g.unpack,W=function(t){return[255&t]},Z=function(t){return[255&t,t>>8&255]},J=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},Y=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},K=function(t){return U(m(t),23,4)},G=function(t){return U(t,52,8)},X=function(t,e,n){c(t.prototype,e,{configurable:!0,get:function(){return n(this)[e]}})},Q=function(t,e,n,r){var i=P(t),o=v(n),a=!!r;if(o+e>i.byteLength)throw new q(O);var s=i.bytes,u=o+i.byteOffset,c=_(s,u,u+e);return a?c:V(c)},tt=function(t,e,n,r,i,o){var a=P(t),s=v(n),u=r(+i),c=!!o;if(s+e>a.byteLength)throw new q(O);for(var l=a.bytes,h=s+a.byteOffset,f=0;f<e;f++)l[h+f]=u[c?f:e-f-1]};if(a){var et=M&&N.name!==T;h((function(){N(1)}))&&h((function(){new N(-1)}))&&!h((function(){return new N,new N(1.5),new N(NaN),1!==N.length||et&&!E}))?et&&E&&u(N,"name",T):((R=function(t){return f(this,I),x(new N(v(t)),this,R)}).prototype=I,I.constructor=R,k(R,N)),b&&y(B)!==j&&b(B,j);var nt=new z(new R(2)),rt=i(B.setInt8);nt.setInt8(0,2147483648),nt.setInt8(1,2147483649),!nt.getInt8(0)&&nt.getInt8(1)||l(B,{setInt8:function(t,e){rt(this,t,e<<24>>24)},setUint8:function(t,e){rt(this,t,e<<24>>24)}},{unsafe:!0})}else I=(R=function(t){f(this,I);var e=v(t);L(this,{type:T,bytes:$(F(e),0),byteLength:e}),o||(this.byteLength=e,this.detached=!1)}).prototype,B=(z=function(t,e,n){f(this,B),f(t,I);var r=D(t),i=r.byteLength,a=d(e);if(a<0||a>i)throw new q("Wrong offset");if(a+(n=void 0===n?i-a:p(n))>i)throw new q("Wrong length");L(this,{type:A,buffer:t,byteLength:n,byteOffset:a,bytes:r.bytes}),o||(this.buffer=t,this.byteLength=n,this.byteOffset=a)}).prototype,o&&(X(R,"byteLength",D),X(z,"buffer",P),X(z,"byteLength",P),X(z,"byteOffset",P)),l(B,{getInt8:function(t){return Q(this,1,t)[0]<<24>>24},getUint8:function(t){return Q(this,1,t)[0]},getInt16:function(t){var e=Q(this,2,t,arguments.length>1&&arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=Q(this,2,t,arguments.length>1&&arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return Y(Q(this,4,t,arguments.length>1&&arguments[1]))},getUint32:function(t){return Y(Q(this,4,t,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(t){return H(Q(this,4,t,arguments.length>1&&arguments[1]),23)},getFloat64:function(t){return H(Q(this,8,t,arguments.length>1&&arguments[1]),52)},setInt8:function(t,e){tt(this,1,t,W,e)},setUint8:function(t,e){tt(this,1,t,W,e)},setInt16:function(t,e){tt(this,2,t,Z,e,arguments.length>2&&arguments[2])},setUint16:function(t,e){tt(this,2,t,Z,e,arguments.length>2&&arguments[2])},setInt32:function(t,e){tt(this,4,t,J,e,arguments.length>2&&arguments[2])},setUint32:function(t,e){tt(this,4,t,J,e,arguments.length>2&&arguments[2])},setFloat32:function(t,e){tt(this,4,t,K,e,arguments.length>2&&arguments[2])},setFloat64:function(t,e){tt(this,8,t,G,e,arguments.length>2&&arguments[2])}});S(R,T),S(z,A),t.exports={ArrayBuffer:R,DataView:z}},function(t,e,n){"use strict";var r=n(0),i=n(3),o=n(2),a=n(80),s=n(16),u=n(63),c=n(72),l=n(55),h=n(8),f=n(35),d=n(6),p=n(1),v=n(99),m=n(33),g=n(88);t.exports=function(t,e,n){var y=-1!==t.indexOf("Map"),b=-1!==t.indexOf("Weak"),w=y?"set":"add",_=i[t],x=_&&_.prototype,k=_,S={},C=function(t){var e=o(x[t]);s(x,t,"add"===t?function(t){return e(this,0===t?0:t),this}:"delete"===t?function(t){return!(b&&!d(t))&&e(this,0===t?0:t)}:"get"===t?function(t){return b&&!d(t)?void 0:e(this,0===t?0:t)}:"has"===t?function(t){return!(b&&!d(t))&&e(this,0===t?0:t)}:function(t,n){return e(this,0===t?0:t,n),this})};if(a(t,!h(_)||!(b||x.forEach&&!p((function(){(new _).entries().next()})))))k=n.getConstructor(e,t,y,w),u.enable();else if(a(t,!0)){var M=new k,E=M[w](b?{}:-0,1)!==M,T=p((function(){M.has(1)})),A=v((function(t){new _(t)})),O=!b&&p((function(){for(var t=new _,e=5;e--;)t[w](e,e);return!t.has(-0)}));A||((k=e((function(t,e){l(t,x);var n=g(new _,t,k);return f(e)||c(e,n[w],{that:n,AS_ENTRIES:y}),n}))).prototype=x,x.constructor=k),(T||O)&&(C("delete"),C("has"),y&&C("get")),(O||E)&&C(w),b&&x.clear&&delete x.clear}return S[t]=k,r({global:!0,constructor:!0,forced:k!==_},S),m(k,t),b||n.setStrong(k,t,y),k}},function(t,e,n){"use strict";var r=Math.expm1,i=Math.exp;t.exports=!r||r(10)>22025.465794806718||r(10)<22025.465794806718||-2e-17!==r(-2e-17)?function(t){var e=+t;return 0===e?e:e>-1e-6&&e<1e-6?e+e*e/2:i(e)-1}:r},function(t,e,n){"use strict";t.exports="\t\n\v\f\r \xa0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\ufeff"},function(t,e,n){"use strict";var r=n(21),i=n(3),o=n(1),a=n(132);t.exports=r||!o((function(){if(!(a&&a<535)){var t=Math.random();__defineSetter__.call(null,t,(function(){})),delete i[t]}}))},function(t,e,n){"use strict";var r,i,o,a,s=n(3),u=n(42),c=n(41),l=n(8),h=n(12),f=n(1),d=n(163),p=n(32),v=n(95),m=n(90),g=n(189),y=n(69),b=s.setImmediate,w=s.clearImmediate,_=s.process,x=s.Dispatch,k=s.Function,S=s.MessageChannel,C=s.String,M=0,E={},T="onreadystatechange";f((function(){r=s.location}));var A=function(t){if(h(E,t)){var e=E[t];delete E[t],e()}},O=function(t){return function(){A(t)}},D=function(t){A(t.data)},P=function(t){s.postMessage(C(t),r.protocol+"//"+r.host)};b&&w||(b=function(t){m(arguments.length,1);var e=l(t)?t:k(t),n=p(arguments,1);return E[++M]=function(){u(e,void 0,n)},i(M),M},w=function(t){delete E[t]},y?i=function(t){_.nextTick(O(t))}:x&&x.now?i=function(t){x.now(O(t))}:S&&!g?(a=(o=new S).port2,o.port1.onmessage=D,i=c(a.postMessage,a)):s.addEventListener&&l(s.postMessage)&&!s.importScripts&&r&&"file:"!==r.protocol&&!f(P)?(i=P,s.addEventListener("message",D,!1)):i=T in v("script")?function(t){d.appendChild(v("script")).onreadystatechange=function(){d.removeChild(this),A(t)}}:function(t){setTimeout(O(t),0)}),t.exports={set:b,clear:w}},function(t,e,n){"use strict";var r,i,o=n(9),a=n(2),s=n(13),u=n(144),c=n(145),l=n(67),h=n(37),f=n(22).get,d=n(198),p=n(199),v=l("native-string-replace",String.prototype.replace),m=RegExp.prototype.exec,g=m,y=a("".charAt),b=a("".indexOf),w=a("".replace),_=a("".slice),x=(i=/b*/g,o(m,r=/a/,"a"),o(m,i,"a"),0!==r.lastIndex||0!==i.lastIndex),k=c.BROKEN_CARET,S=void 0!==/()??/.exec("")[1];(x||S||k||d||p)&&(g=function(t){var e,n,r,i,a,c,l,d=this,p=f(d),C=s(t),M=p.raw;if(M)return M.lastIndex=d.lastIndex,e=o(g,M,C),d.lastIndex=M.lastIndex,e;var E=p.groups,T=k&&d.sticky,A=o(u,d),O=d.source,D=0,P=C;if(T&&(A=w(A,"y",""),-1===b(A,"g")&&(A+="g"),P=_(C,d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&"\n"!==y(C,d.lastIndex-1))&&(O="(?: "+O+")",P=" "+P,D++),n=new RegExp("^(?:"+O+")",A)),S&&(n=new RegExp("^"+O+"$(?!\\s)",A)),x&&(r=d.lastIndex),i=o(m,T?n:d,P),T?i?(i.input=_(i.input,D),i[0]=_(i[0],D),i.index=d.lastIndex,d.lastIndex+=i[0].length):d.lastIndex=0:x&&i&&(d.lastIndex=d.global?i.index+i[0].length:r),S&&i&&i.length>1&&o(v,i[0],n,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(i[a]=void 0)})),i&&E)for(i.groups=c=h(null),a=0;a<E.length;a++)c[(l=E[a])[0]]=i[l[1]];return i}),t.exports=g},function(t,e,n){"use strict";var r=n(2),i=n(30),o=n(13),a=n(24),s=r("".charAt),u=r("".charCodeAt),c=r("".slice),l=function(t){return function(e,n){var r,l,h=o(a(e)),f=i(n),d=h.length;return f<0||f>=d?t?"":void 0:(r=u(h,f))<55296||r>56319||f+1===d||(l=u(h,f+1))<56320||l>57343?t?s(h,f):r:t?c(h,f,f+2):l-56320+(r-55296<<10)+65536}};t.exports={codeAt:l(!1),charAt:l(!0)}},function(t,e,n){"use strict";n(200);var r=n(61),i=n(16),o=n(109),a=n(1),s=n(7),u=n(40),c=s("species"),l=RegExp.prototype;t.exports=function(t,e,n,h){var f=s(t),d=!a((function(){var e={};return e[f]=function(){return 7},7!==""[t](e)})),p=d&&!a((function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[c]=function(){return n},n.flags="",n[f]=/./[f]),n.exec=function(){return e=!0,null},n[f](""),!e}));if(!d||!p||n){var v=r(/./[f]),m=e(f,""[t],(function(t,e,n,i,a){var s=r(t),u=e.exec;return u===o||u===l.exec?d&&!a?{done:!0,value:v(e,n,i)}:{done:!0,value:s(n,e,i)}:{done:!1}}));i(String.prototype,t,m[0]),i(l,f,m[1])}h&&u(l[f],"sham",!0)}},function(t,e,n){"use strict";var r=n(9),i=n(5),o=n(8),a=n(29),s=n(109),u=TypeError;t.exports=function(t,e){var n=t.exec;if(o(n)){var c=r(n,t,e);return null!==c&&i(c),c}if("RegExp"===a(t))return r(s,t,e);throw new u("RegExp#exec called on incompatible receiver")}},function(t,e,n){"use strict";var r=n(10),i=n(89),o=r.aTypedArrayConstructor,a=r.getTypedArrayConstructor;t.exports=function(t){return o(i(t,a(t)))}},function(t,e,n){var r,i,o,a;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})(t)}a=function(t){"use strict";var e=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t,e){t.exports=function(t){var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(t,e){var n=t[0],r=t[1],i=t[2],o=t[3];r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+e[0]-680876936|0)<<7|n>>>25)+r|0)&r|~n&i)+e[1]-389564586|0)<<12|o>>>20)+n|0)&n|~o&r)+e[2]+606105819|0)<<17|i>>>15)+o|0)&o|~i&n)+e[3]-1044525330|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+e[4]-176418897|0)<<7|n>>>25)+r|0)&r|~n&i)+e[5]+1200080426|0)<<12|o>>>20)+n|0)&n|~o&r)+e[6]-1473231341|0)<<17|i>>>15)+o|0)&o|~i&n)+e[7]-45705983|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+e[8]+1770035416|0)<<7|n>>>25)+r|0)&r|~n&i)+e[9]-1958414417|0)<<12|o>>>20)+n|0)&n|~o&r)+e[10]-42063|0)<<17|i>>>15)+o|0)&o|~i&n)+e[11]-1990404162|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+e[12]+1804603682|0)<<7|n>>>25)+r|0)&r|~n&i)+e[13]-40341101|0)<<12|o>>>20)+n|0)&n|~o&r)+e[14]-1502002290|0)<<17|i>>>15)+o|0)&o|~i&n)+e[15]+1236535329|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[1]-165796510|0)<<5|n>>>27)+r|0)&i|r&~i)+e[6]-1069501632|0)<<9|o>>>23)+n|0)&r|n&~r)+e[11]+643717713|0)<<14|i>>>18)+o|0)&n|o&~n)+e[0]-373897302|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[5]-701558691|0)<<5|n>>>27)+r|0)&i|r&~i)+e[10]+38016083|0)<<9|o>>>23)+n|0)&r|n&~r)+e[15]-660478335|0)<<14|i>>>18)+o|0)&n|o&~n)+e[4]-405537848|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[9]+568446438|0)<<5|n>>>27)+r|0)&i|r&~i)+e[14]-1019803690|0)<<9|o>>>23)+n|0)&r|n&~r)+e[3]-187363961|0)<<14|i>>>18)+o|0)&n|o&~n)+e[8]+1163531501|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[13]-1444681467|0)<<5|n>>>27)+r|0)&i|r&~i)+e[2]-51403784|0)<<9|o>>>23)+n|0)&r|n&~r)+e[7]+1735328473|0)<<14|i>>>18)+o|0)&n|o&~n)+e[12]-1926607734|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[5]-378558|0)<<4|n>>>28)+r|0)^r^i)+e[8]-2022574463|0)<<11|o>>>21)+n|0)^n^r)+e[11]+1839030562|0)<<16|i>>>16)+o|0)^o^n)+e[14]-35309556|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[1]-1530992060|0)<<4|n>>>28)+r|0)^r^i)+e[4]+1272893353|0)<<11|o>>>21)+n|0)^n^r)+e[7]-155497632|0)<<16|i>>>16)+o|0)^o^n)+e[10]-1094730640|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[13]+681279174|0)<<4|n>>>28)+r|0)^r^i)+e[0]-358537222|0)<<11|o>>>21)+n|0)^n^r)+e[3]-722521979|0)<<16|i>>>16)+o|0)^o^n)+e[6]+76029189|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[9]-640364487|0)<<4|n>>>28)+r|0)^r^i)+e[12]-421815835|0)<<11|o>>>21)+n|0)^n^r)+e[15]+530742520|0)<<16|i>>>16)+o|0)^o^n)+e[2]-995338651|0)<<23|r>>>9)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[0]-198630844|0)<<6|n>>>26)+r|0)|~i))+e[7]+1126891415|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[14]-1416354905|0)<<15|i>>>17)+o|0)|~n))+e[5]-57434055|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[12]+1700485571|0)<<6|n>>>26)+r|0)|~i))+e[3]-1894986606|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[10]-1051523|0)<<15|i>>>17)+o|0)|~n))+e[1]-2054922799|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[8]+1873313359|0)<<6|n>>>26)+r|0)|~i))+e[15]-30611744|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[6]-1560198380|0)<<15|i>>>17)+o|0)|~n))+e[13]+1309151649|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[4]-145523070|0)<<6|n>>>26)+r|0)|~i))+e[11]-1120210379|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[2]+718787259|0)<<15|i>>>17)+o|0)|~n))+e[9]-343485551|0)<<21|r>>>11)+i|0,t[0]=n+t[0]|0,t[1]=r+t[1]|0,t[2]=i+t[2]|0,t[3]=o+t[3]|0}function r(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return n}function i(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t[e]+(t[e+1]<<8)+(t[e+2]<<16)+(t[e+3]<<24);return n}function o(t){var e,i,o,a,s,u,c=t.length,l=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=c;e+=64)n(l,r(t.substring(e-64,e)));for(i=(t=t.substring(e-64)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e=0;e<i;e+=1)o[e>>2]|=t.charCodeAt(e)<<(e%4<<3);if(o[e>>2]|=128<<(e%4<<3),e>55)for(n(l,o),e=0;e<16;e+=1)o[e]=0;return a=(a=8*c).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(a[2],16),u=parseInt(a[1],16)||0,o[14]=s,o[15]=u,n(l,o),l}function a(t){var e,r,o,a,s,u,c=t.length,l=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=c;e+=64)n(l,i(t.subarray(e-64,e)));for(r=(t=e-64<c?t.subarray(e-64):new Uint8Array(0)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e=0;e<r;e+=1)o[e>>2]|=t[e]<<(e%4<<3);if(o[e>>2]|=128<<(e%4<<3),e>55)for(n(l,o),e=0;e<16;e+=1)o[e]=0;return a=(a=8*c).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(a[2],16),u=parseInt(a[1],16)||0,o[14]=s,o[15]=u,n(l,o),l}function s(t){var n,r="";for(n=0;n<4;n+=1)r+=e[t>>8*n+4&15]+e[t>>8*n&15];return r}function u(t){var e;for(e=0;e<t.length;e+=1)t[e]=s(t[e]);return t.join("")}function c(t){return/[\u0080-\uFFFF]/.test(t)&&(t=unescape(encodeURIComponent(t))),t}function l(t,e){var n,r=t.length,i=new ArrayBuffer(r),o=new Uint8Array(i);for(n=0;n<r;n+=1)o[n]=t.charCodeAt(n);return e?o:i}function h(t){return String.fromCharCode.apply(null,new Uint8Array(t))}function f(t,e,n){var r=new Uint8Array(t.byteLength+e.byteLength);return r.set(new Uint8Array(t)),r.set(new Uint8Array(e),t.byteLength),n?r:r.buffer}function d(t){var e,n=[],r=t.length;for(e=0;e<r-1;e+=2)n.push(parseInt(t.substr(e,2),16));return String.fromCharCode.apply(String,n)}function p(){this.reset()}return u(o("hello")),"undefined"===typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function e(t,e){return(t=0|t||0)<0?Math.max(t+e,0):Math.min(t,e)}ArrayBuffer.prototype.slice=function(n,r){var i,o,a,s,u=this.byteLength,c=e(n,u),l=u;return r!==t&&(l=e(r,u)),c>l?new ArrayBuffer(0):(i=l-c,o=new ArrayBuffer(i),a=new Uint8Array(o),s=new Uint8Array(this,c,i),a.set(s),o)}}(),p.prototype.append=function(t){return this.appendBinary(c(t)),this},p.prototype.appendBinary=function(t){this._buff+=t,this._length+=t.length;var e,i=this._buff.length;for(e=64;e<=i;e+=64)n(this._hash,r(this._buff.substring(e-64,e)));return this._buff=this._buff.substring(e-64),this},p.prototype.end=function(t){var e,n,r=this._buff,i=r.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<i;e+=1)o[e>>2]|=r.charCodeAt(e)<<(e%4<<3);return this._finish(o,i),n=u(this._hash),t&&(n=d(n)),this.reset(),n},p.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},p.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash}},p.prototype.setState=function(t){return this._buff=t.buff,this._length=t.length,this._hash=t.hash,this},p.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},p.prototype._finish=function(t,e){var r,i,o,a=e;if(t[a>>2]|=128<<(a%4<<3),a>55)for(n(this._hash,t),a=0;a<16;a+=1)t[a]=0;r=(r=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(r[2],16),o=parseInt(r[1],16)||0,t[14]=i,t[15]=o,n(this._hash,t)},p.hash=function(t,e){return p.hashBinary(c(t),e)},p.hashBinary=function(t,e){var n=u(o(t));return e?d(n):n},p.ArrayBuffer=function(){this.reset()},p.ArrayBuffer.prototype.append=function(t){var e,r=f(this._buff.buffer,t,!0),o=r.length;for(this._length+=t.byteLength,e=64;e<=o;e+=64)n(this._hash,i(r.subarray(e-64,e)));return this._buff=e-64<o?new Uint8Array(r.buffer.slice(e-64)):new Uint8Array(0),this},p.ArrayBuffer.prototype.end=function(t){var e,n,r=this._buff,i=r.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<i;e+=1)o[e>>2]|=r[e]<<(e%4<<3);return this._finish(o,i),n=u(this._hash),t&&(n=d(n)),this.reset(),n},p.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},p.ArrayBuffer.prototype.getState=function(){var t=p.prototype.getState.call(this);return t.buff=h(t.buff),t},p.ArrayBuffer.prototype.setState=function(t){return t.buff=l(t.buff,!0),p.prototype.setState.call(this,t)},p.ArrayBuffer.prototype.destroy=p.prototype.destroy,p.ArrayBuffer.prototype._finish=p.prototype._finish,p.ArrayBuffer.hash=function(t,e){var n=u(a(new Uint8Array(t)));return e?d(n):n},p}()})),n=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),i=File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice,o=function(){function t(e){n(this,t),this.file=e,this.chunkSize=2097152,this.chunkCount=Math.ceil(this.file.size/this.chunkSize),this.chunkIndex=0}return r(t,null,[{key:"create",value:function(e,n){new t(e).create(n)}}]),r(t,[{key:"create",value:function(t){var n=this;this.callback=t,this.md5Buffer=new e.ArrayBuffer,this.fileReader=new FileReader,this.fileReader.addEventListener("load",(function(t){return n.fileReaderDidLoad(t)})),this.fileReader.addEventListener("error",(function(t){return n.fileReaderDidError(t)})),this.readNextChunk()}},{key:"fileReaderDidLoad",value:function(t){if(this.md5Buffer.append(t.target.result),!this.readNextChunk()){var e=this.md5Buffer.end(!0),n=btoa(e);this.callback(null,n)}}},{key:"fileReaderDidError",value:function(t){this.callback("Error reading "+this.file.name)}},{key:"readNextChunk",value:function(){if(this.chunkIndex<this.chunkCount||0==this.chunkIndex&&0==this.chunkCount){var t=this.chunkIndex*this.chunkSize,e=Math.min(t+this.chunkSize,this.file.size),n=i.call(this.file,t,e);return this.fileReader.readAsArrayBuffer(n),this.chunkIndex++,!0}return!1}}]),t}();function a(t,e){return"string"==typeof t&&(e=t,t=document),t.querySelector(e)}function s(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.disabled,i=n.bubbles,o=n.cancelable,a=n.detail,s=document.createEvent("Event");s.initEvent(e,i||!0,o||!0),s.detail=a||{};try{t.disabled=!1,t.dispatchEvent(s)}finally{t.disabled=r}return s}function u(t){return Array.isArray(t)?t:Array.from?Array.from(t):[].slice.call(t)}var c=function(){function t(e,r,i){var o=this;n(this,t),this.file=e,this.attributes={filename:e.name,content_type:e.type||"application/octet-stream",byte_size:e.size,checksum:r},this.xhr=new XMLHttpRequest,this.xhr.open("POST",i,!0),this.xhr.responseType="json",this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.setRequestHeader("Accept","application/json"),this.xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");var s=function(t){var e=a(document.head,'meta[name="'+t+'"]');if(e)return e.getAttribute("content")}("csrf-token");void 0!=s&&this.xhr.setRequestHeader("X-CSRF-Token",s),this.xhr.addEventListener("load",(function(t){return o.requestDidLoad(t)})),this.xhr.addEventListener("error",(function(t){return o.requestDidError(t)}))}return r(t,[{key:"create",value:function(t){this.callback=t,this.xhr.send(JSON.stringify({blob:this.attributes}))}},{key:"requestDidLoad",value:function(t){if(this.status>=200&&this.status<300){var e=this.response,n=e.direct_upload;delete e.direct_upload,this.attributes=e,this.directUploadData=n,this.callback(null,this.toJSON())}else this.requestDidError(t)}},{key:"requestDidError",value:function(t){this.callback('Error creating Blob for "'+this.file.name+'". Status: '+this.status)}},{key:"toJSON",value:function(){var t={};for(var e in this.attributes)t[e]=this.attributes[e];return t}},{key:"status",get:function(){return this.xhr.status}},{key:"response",get:function(){var t=this.xhr,e=t.responseType,n=t.response;return"json"==e?n:JSON.parse(n)}}]),t}(),l=function(){function t(e){var r=this;n(this,t),this.blob=e,this.file=e.file;var i=e.directUploadData,o=i.url,a=i.headers;for(var s in this.xhr=new XMLHttpRequest,this.xhr.open("PUT",o,!0),this.xhr.responseType="text",a)this.xhr.setRequestHeader(s,a[s]);this.xhr.addEventListener("load",(function(t){return r.requestDidLoad(t)})),this.xhr.addEventListener("error",(function(t){return r.requestDidError(t)}))}return r(t,[{key:"create",value:function(t){this.callback=t,this.xhr.send(this.file.slice())}},{key:"requestDidLoad",value:function(t){var e=this.xhr,n=e.status,r=e.response;n>=200&&n<300?this.callback(null,r):this.requestDidError(t)}},{key:"requestDidError",value:function(t){this.callback('Error storing "'+this.file.name+'". Status: '+this.xhr.status)}}]),t}(),h=0,f=function(){function t(e,r,i){n(this,t),this.id=++h,this.file=e,this.url=r,this.delegate=i}return r(t,[{key:"create",value:function(t){var e=this;o.create(this.file,(function(n,r){if(n)t(n);else{var i=new c(e.file,r,e.url);d(e.delegate,"directUploadWillCreateBlobWithXHR",i.xhr),i.create((function(n){if(n)t(n);else{var r=new l(i);d(e.delegate,"directUploadWillStoreFileWithXHR",r.xhr),r.create((function(e){e?t(e):t(null,i.toJSON())}))}}))}}))}}]),t}();function d(t,e){if(t&&"function"==typeof t[e]){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return t[e].apply(t,r)}}var p=function(){function t(e,r){n(this,t),this.input=e,this.file=r,this.directUpload=new f(this.file,this.url,this),this.dispatch("initialize")}return r(t,[{key:"start",value:function(t){var e=this,n=document.createElement("input");n.type="hidden",n.name=this.input.name,this.input.insertAdjacentElement("beforebegin",n),this.dispatch("start"),this.directUpload.create((function(r,i){r?(n.parentNode.removeChild(n),e.dispatchError(r)):n.value=i.signed_id,e.dispatch("end"),t(r)}))}},{key:"uploadRequestDidProgress",value:function(t){var e=t.loaded/t.total*100;e&&this.dispatch("progress",{progress:e})}},{key:"dispatch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.file=this.file,e.id=this.directUpload.id,s(this.input,"direct-upload:"+t,{detail:e})}},{key:"dispatchError",value:function(t){this.dispatch("error",{error:t}).defaultPrevented||alert(t)}},{key:"directUploadWillCreateBlobWithXHR",value:function(t){this.dispatch("before-blob-request",{xhr:t})}},{key:"directUploadWillStoreFileWithXHR",value:function(t){var e=this;this.dispatch("before-storage-request",{xhr:t}),t.upload.addEventListener("progress",(function(t){return e.uploadRequestDidProgress(t)}))}},{key:"url",get:function(){return this.input.getAttribute("data-direct-upload-url")}}]),t}(),v=function(){function t(e){var r,i;n(this,t),this.form=e,this.inputs=(r=e,i="input[type=file][data-direct-upload-url]:not([disabled])","string"==typeof r&&(i=r,r=document),u(r.querySelectorAll(i))).filter((function(t){return t.files.length}))}return r(t,[{key:"start",value:function(t){var e=this,n=this.createDirectUploadControllers();this.dispatch("start"),function r(){var i=n.shift();i?i.start((function(n){n?(t(n),e.dispatch("end")):r()})):(t(),e.dispatch("end"))}()}},{key:"createDirectUploadControllers",value:function(){var t=[];return this.inputs.forEach((function(e){u(e.files).forEach((function(n){var r=new p(e,n);t.push(r)}))})),t}},{key:"dispatch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(this.form,"direct-uploads:"+t,{detail:e})}}]),t}(),m="data-direct-uploads-processing",g=new WeakMap,y=!1;function b(){y||(y=!0,document.addEventListener("click",w,!0),document.addEventListener("submit",_),document.addEventListener("ajax:before",x))}function w(t){var e=t.target;"INPUT"!=e.tagName&&"BUTTON"!=e.tagName||"submit"!=e.type||!e.form||g.set(e.form,e)}function _(t){k(t)}function x(t){"FORM"==t.target.tagName&&k(t)}function k(t){var e=t.target;if(e.hasAttribute(m))t.preventDefault();else{var n=new v(e),r=n.inputs;r.length&&(t.preventDefault(),e.setAttribute(m,""),r.forEach(S),n.start((function(t){e.removeAttribute(m),t?r.forEach(C):function(t){var e=g.get(t)||a(t,"input[type=submit], button[type=submit]");if(e){var n=e.disabled;e.disabled=!1,e.focus(),e.click(),e.disabled=n}else(e=document.createElement("input")).type="submit",e.style.display="none",t.appendChild(e),e.click(),t.removeChild(e);g.delete(t)}(e)})))}}function S(t){t.disabled=!0}function C(t){t.disabled=!1}setTimeout((function(){window.ActiveStorage&&b()}),1),t.start=b,t.DirectUpload=f,Object.defineProperty(t,"__esModule",{value:!0})},"object"===s(e)&&"undefined"!==typeof t?a(e):(i=[e],void 0===(o="function"===typeof(r=a)?r.apply(e,i):r)||(t.exports=o))},function(t,e,n){"use strict";var r=n(3),i=n(116),o="__core-js_shared__",a=r[o]||i(o,{});t.exports=a},function(t,e,n){"use strict";var r=n(3),i=Object.defineProperty;t.exports=function(t,e){try{i(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},function(t,e,n){"use strict";var r=n(2),i=n(1),o=n(8),a=n(12),s=n(4),u=n(68).CONFIGURABLE,c=n(118),l=n(22),h=l.enforce,f=l.get,d=String,p=Object.defineProperty,v=r("".slice),m=r("".replace),g=r([].join),y=s&&!i((function(){return 8!==p((function(){}),"length",{value:8}).length})),b=String(String).split("String"),w=t.exports=function(t,e,n){"Symbol("===v(d(e),0,7)&&(e="["+m(d(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!a(t,"name")||u&&t.name!==e)&&(s?p(t,"name",{value:e,configurable:!0}):t.name=e),y&&n&&a(n,"arity")&&t.length!==n.arity&&p(t,"length",{value:n.arity});try{n&&a(n,"constructor")&&n.constructor?s&&p(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(i){}var r=h(t);return a(r,"source")||(r.source=g(b,"string"==typeof e?e:"")),t};Function.prototype.toString=w((function(){return o(this)&&f(this).source||c(this)}),"toString")},function(t,e,n){"use strict";var r=n(2),i=n(8),o=n(115),a=r(Function.toString);i(o.inspectSource)||(o.inspectSource=function(t){return a(t)}),t.exports=o.inspectSource},function(t,e,n){"use strict";var r=n(12),i=n(120),o=n(20),a=n(15);t.exports=function(t,e,n){for(var s=i(e),u=a.f,c=o.f,l=0;l<s.length;l++){var h=s[l];r(t,h)||n&&r(n,h)||u(t,h,c(e,h))}}},function(t,e,n){"use strict";var r=n(25),i=n(2),o=n(60),a=n(97),s=n(5),u=i([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=o.f(s(t)),n=a.f;return n?u(e,n(t)):e}},function(t,e,n){"use strict";t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,e,n){"use strict";var r={};r[n(7)("toStringTag")]="z",t.exports="[object z]"===String(r)},function(t,e,n){"use strict";var r=n(4),i=n(159),o=n(15),a=n(5),s=n(23),u=n(81);e.f=r&&!i?Object.defineProperties:function(t,e){a(t);for(var n,r=s(e),i=u(e),c=i.length,l=0;c>l;)o.f(t,n=i[l++],r[n]);return t}},function(t,e,n){"use strict";var r=n(29),i=n(23),o=n(60).f,a=n(32),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return s&&"Window"===r(t)?function(t){try{return o(t)}catch(e){return a(s)}}(t):o(i(t))}},function(t,e,n){"use strict";var r=TypeError;t.exports=function(t){if(t>9007199254740991)throw r("Maximum allowed index exceeded");return t}},function(t,e,n){"use strict";var r=n(59),i=TypeError;t.exports=function(t,e){if(!delete t[e])throw new i("Cannot delete property "+r(e)+" of "+r(t))}},function(t,e,n){"use strict";var r=n(14),i=n(51),o=n(17);t.exports=function(t){for(var e=r(this),n=o(e),a=arguments.length,s=i(a>1?arguments[1]:void 0,n),u=a>2?arguments[2]:void 0,c=void 0===u?n:i(u,n);c>s;)e[s++]=t;return e}},function(t,e,n){"use strict";var r=n(7),i=n(85),o=r("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(i.Array===t||a[o]===t)}},function(t,e,n){"use strict";var r=n(0),i=n(9),o=n(21),a=n(68),s=n(8),u=n(173),c=n(39),l=n(54),h=n(33),f=n(40),d=n(16),p=n(7),v=n(85),m=n(174),g=a.PROPER,y=a.CONFIGURABLE,b=m.IteratorPrototype,w=m.BUGGY_SAFARI_ITERATORS,_=p("iterator"),x="keys",k="values",S="entries",C=function(){return this};t.exports=function(t,e,n,a,p,m,M){u(n,e,a);var E,T,A,O=function(t){if(t===p&&R)return R;if(!w&&t&&t in L)return L[t];switch(t){case x:case k:case S:return function(){return new n(this,t)}}return function(){return new n(this)}},D=e+" Iterator",P=!1,L=t.prototype,N=L[_]||L["@@iterator"]||p&&L[p],R=!w&&N||O(p),I="Array"===e&&L.entries||N;if(I&&(E=c(I.call(new t)))!==Object.prototype&&E.next&&(o||c(E)===b||(l?l(E,b):s(E[_])||d(E,_,C)),h(E,D,!0,!0),o&&(v[D]=C)),g&&p===k&&N&&N.name!==k&&(!o&&y?f(L,"name",k):(P=!0,R=function(){return i(N,this)})),p)if(T={values:O(k),keys:m?R:O(x),entries:O(S)},M)for(A in T)(w||P||!(A in L))&&d(L,A,T[A]);else r({target:e,proto:!0,forced:w||P},T);return o&&!M||L[_]===R||d(L,_,R,{name:p}),v[e]=R,T}},function(t,e,n){"use strict";var r=n(1);t.exports=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},function(t,e,n){"use strict";var r=n(32),i=Math.floor,o=function(t,e){var n=t.length;if(n<8)for(var a,s,u=1;u<n;){for(s=u,a=t[u];s&&e(t[s-1],a)>0;)t[s]=t[--s];s!==u++&&(t[s]=a)}else for(var c=i(n/2),l=o(r(t,0,c),e),h=o(r(t,c),e),f=l.length,d=h.length,p=0,v=0;p<f||v<d;)t[p+v]=p<f&&v<d?e(l[p],h[v])<=0?l[p++]:h[v++]:p<f?l[p++]:h[v++];return t};t.exports=o},function(t,e,n){"use strict";var r=n(44).match(/AppleWebKit\/(\d+)\./);t.exports=!!r&&+r[1]},function(t,e,n){"use strict";t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},function(t,e,n){"use strict";t.exports=Math.sign||function(t){var e=+t;return 0===e||e!==e?e:e<0?-1:1}},function(t,e,n){"use strict";var r=n(83),i=n(59),o=TypeError;t.exports=function(t){if(r(t))return t;throw new o(i(t)+" is not a constructor")}},function(t,e,n){"use strict";var r=n(2),i=n(31),o=n(13),a=n(137),s=n(24),u=r(a),c=r("".slice),l=Math.ceil,h=function(t){return function(e,n,r){var a,h,f=o(s(e)),d=i(n),p=f.length,v=void 0===r?" ":o(r);return d<=p||""===v?f:((h=u(v,l((a=d-p)/v.length))).length>a&&(h=c(h,0,a)),t?f+h:h+f)}};t.exports={start:h(!1),end:h(!0)}},function(t,e,n){"use strict";var r=n(30),i=n(13),o=n(24),a=RangeError;t.exports=function(t){var e=i(o(this)),n="",s=r(t);if(s<0||s===1/0)throw new a("Wrong number of repetitions");for(;s>0;(s>>>=1)&&(e+=e))1&s&&(n+=e);return n}},function(t,e,n){"use strict";var r=n(1),i=n(6),o=n(29),a=n(139),s=Object.isExtensible,u=r((function(){s(1)}));t.exports=u||a?function(t){return!!i(t)&&((!a||"ArrayBuffer"!==o(t))&&(!s||s(t)))}:s},function(t,e,n){"use strict";var r=n(1);t.exports=r((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},function(t,e,n){"use strict";var r=n(2);t.exports=r(1..valueOf)},function(t,e,n){"use strict";var r=n(6),i=Math.floor;t.exports=Number.isInteger||function(t){return!r(t)&&isFinite(t)&&i(t)===t}},function(t,e,n){"use strict";t.exports=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}},function(t,e,n){"use strict";var r=n(6),i=n(29),o=n(7)("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[o])?!!e:"RegExp"===i(t))}},function(t,e,n){"use strict";var r=n(5);t.exports=function(){var t=r(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},function(t,e,n){"use strict";var r=n(1),i=n(3).RegExp,o=r((function(){var t=i("a","y");return t.lastIndex=2,null!==t.exec("abcd")})),a=o||r((function(){return!i("a","y").sticky})),s=o||r((function(){var t=i("^r","gy");return t.lastIndex=2,null!==t.exec("str")}));t.exports={BROKEN_CARET:s,MISSED_STICKY:a,UNSUPPORTED_Y:o}},function(t,e,n){"use strict";var r=n(143),i=TypeError;t.exports=function(t){if(r(t))throw new i("The method doesn't accept regular expressions");return t}},function(t,e,n){"use strict";var r=n(7)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,"/./"[t](e)}catch(i){}}return!1}},function(t,e,n){"use strict";var r=n(110).charAt;t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},function(t,e,n){"use strict";var r=n(68).PROPER,i=n(1),o=n(106);t.exports=function(t){return i((function(){return!!o[t]()||"\u200b\x85\u180e"!=="\u200b\x85\u180e"[t]()||r&&o[t].name!==t}))}},function(t,e,n){"use strict";var r=n(3),i=n(1),o=n(99),a=n(10).NATIVE_ARRAY_BUFFER_VIEWS,s=r.ArrayBuffer,u=r.Int8Array;t.exports=!a||!i((function(){u(1)}))||!i((function(){new u(-1)}))||!o((function(t){new u,new u(null),new u(1.5),new u(t)}),!0)||i((function(){return 1!==new u(new s(2),1,void 0).length}))},function(t,e,n){"use strict";var r,i=n(3),o=n(42),a=n(8),s=n(481),u=n(44),c=n(32),l=n(90),h=i.Function,f=/MSIE .\./.test(u)||s&&((r=i.Bun.version.split(".")).length<3||"0"===r[0]&&(r[1]<3||"3"===r[1]&&"0"===r[2]));t.exports=function(t,e){var n=e?2:1;return f?function(r,i){var s=l(arguments.length,1)>n,u=a(r)?r:h(r),f=s?c(arguments,n):[],d=s?function(){o(u,this,f)}:u;return e?t(d,i):t(d)}:t}},function(t,e){t.exports=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/},function(t,e,n){"use strict";function r(){this.__rules__=[],this.__cache__=null}r.prototype.__find__=function(t){for(var e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===t)return e;return-1},r.prototype.__compile__=function(){var t=this,e=[""];t.__rules__.forEach((function(t){t.enabled&&t.alt.forEach((function(t){e.indexOf(t)<0&&e.push(t)}))})),t.__cache__={},e.forEach((function(e){t.__cache__[e]=[],t.__rules__.forEach((function(n){n.enabled&&(e&&n.alt.indexOf(e)<0||t.__cache__[e].push(n.fn))}))}))},r.prototype.at=function(t,e,n){var r=this.__find__(t),i=n||{};if(-1===r)throw new Error("Parser rule not found: "+t);this.__rules__[r].fn=e,this.__rules__[r].alt=i.alt||[],this.__cache__=null},r.prototype.before=function(t,e,n,r){var i=this.__find__(t),o=r||{};if(-1===i)throw new Error("Parser rule not found: "+t);this.__rules__.splice(i,0,{name:e,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},r.prototype.after=function(t,e,n,r){var i=this.__find__(t),o=r||{};if(-1===i)throw new Error("Parser rule not found: "+t);this.__rules__.splice(i+1,0,{name:e,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},r.prototype.push=function(t,e,n){var r=n||{};this.__rules__.push({name:t,enabled:!0,fn:e,alt:r.alt||[]}),this.__cache__=null},r.prototype.enable=function(t,e){Array.isArray(t)||(t=[t]);var n=[];return t.forEach((function(t){var r=this.__find__(t);if(r<0){if(e)return;throw new Error("Rules manager: invalid rule name "+t)}this.__rules__[r].enabled=!0,n.push(t)}),this),this.__cache__=null,n},r.prototype.enableOnly=function(t,e){Array.isArray(t)||(t=[t]),this.__rules__.forEach((function(t){t.enabled=!1})),this.enable(t,e)},r.prototype.disable=function(t,e){Array.isArray(t)||(t=[t]);var n=[];return t.forEach((function(t){var r=this.__find__(t);if(r<0){if(e)return;throw new Error("Rules manager: invalid rule name "+t)}this.__rules__[r].enabled=!1,n.push(t)}),this),this.__cache__=null,n},r.prototype.getRules=function(t){return null===this.__cache__&&this.__compile__(),this.__cache__[t]||[]},t.exports=r},function(t,e,n){"use strict";function r(t,e,n){this.type=t,this.tag=e,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}r.prototype.attrIndex=function(t){var e,n,r;if(!this.attrs)return-1;for(n=0,r=(e=this.attrs).length;n<r;n++)if(e[n][0]===t)return n;return-1},r.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]},r.prototype.attrSet=function(t,e){var n=this.attrIndex(t),r=[t,e];n<0?this.attrPush(r):this.attrs[n]=r},r.prototype.attrGet=function(t){var e=this.attrIndex(t),n=null;return e>=0&&(n=this.attrs[e][1]),n},r.prototype.attrJoin=function(t,e){var n=this.attrIndex(t);n<0?this.attrPush([t,e]):this.attrs[n][1]=this.attrs[n][1]+" "+e},t.exports=r},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";var r=n(66);t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,e,n){"use strict";var r=n(9),i=n(8),o=n(6),a=TypeError;t.exports=function(t,e){var n,s;if("string"===e&&i(n=t.toString)&&!o(s=r(n,t)))return s;if(i(n=t.valueOf)&&!o(s=r(n,t)))return s;if("string"!==e&&i(n=t.toString)&&!o(s=r(n,t)))return s;throw new a("Can't convert object to primitive value")}},function(t,e,n){"use strict";var r=n(4),i=n(1),o=n(95);t.exports=!r&&!i((function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},function(t,e,n){"use strict";var r=n(4),i=n(1);t.exports=r&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},function(t,e,n){"use strict";var r=n(3),i=n(8),o=r.WeakMap;t.exports=i(o)&&/native code/.test(String(o))},function(t,e,n){"use strict";var r=n(2),i=n(12),o=n(23),a=n(79).indexOf,s=n(78),u=r([].push);t.exports=function(t,e){var n,r=o(t),c=0,l=[];for(n in r)!i(s,n)&&i(r,n)&&u(l,n);for(;e.length>c;)i(r,n=e[c++])&&(~a(l,n)||u(l,n));return l}},function(t,e,n){"use strict";var r=Math.ceil,i=Math.floor;t.exports=Math.trunc||function(t){var e=+t;return(e>0?i:r)(e)}},function(t,e,n){"use strict";var r=n(25);t.exports=r("document","documentElement")},function(t,e,n){"use strict";var r=n(7);e.f=r},function(t,e,n){"use strict";var r=n(3);t.exports=r},function(t,e,n){"use strict";var r=n(9),i=n(25),o=n(7),a=n(16);t.exports=function(){var t=i("Symbol"),e=t&&t.prototype,n=e&&e.valueOf,s=o("toPrimitive");e&&!e[s]&&a(e,s,(function(t){return r(n,this)}),{arity:1})}},function(t,e,n){"use strict";var r=n(66);t.exports=r&&!!Symbol.for&&!!Symbol.keyFor},function(t,e,n){"use strict";var r=n(14),i=n(51),o=n(17),a=n(126),s=Math.min;t.exports=[].copyWithin||function(t,e){var n=r(this),u=o(n),c=i(t,u),l=i(e,u),h=arguments.length>2?arguments[2]:void 0,f=s((void 0===h?u:i(h,u))-l,u-c),d=1;for(l<c&&c<l+f&&(d=-1,l+=f-1,c+=f-1);f-- >0;)l in n?n[c]=n[l]:a(n,c),c+=d,l+=d;return n}},function(t,e,n){"use strict";var r=n(52),i=n(17),o=n(125),a=n(41),s=function(t,e,n,u,c,l,h,f){for(var d,p,v=c,m=0,g=!!h&&a(h,f);m<u;)m in n&&(d=g?g(n[m],m,e):n[m],l>0&&r(d)?(p=i(d),v=s(t,e,d,p,v,l-1)-1):(o(v+1),t[v]=d),v++),m++;return v};t.exports=s},function(t,e,n){"use strict";var r=n(19).forEach,i=n(46)("forEach");t.exports=i?[].forEach:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}},function(t,e,n){"use strict";var r=n(41),i=n(9),o=n(14),a=n(270),s=n(128),u=n(83),c=n(17),l=n(62),h=n(98),f=n(86),d=Array;t.exports=function(t){var e=o(t),n=u(this),p=arguments.length,v=p>1?arguments[1]:void 0,m=void 0!==v;m&&(v=r(v,p>2?arguments[2]:void 0));var g,y,b,w,_,x,k=f(e),S=0;if(!k||this===d&&s(k))for(g=c(e),y=n?new this(g):d(g);g>S;S++)x=m?v(e[S],S):e[S],l(y,S,x);else for(_=(w=h(e,k)).next,y=n?new this:[];!(b=i(_,w)).done;S++)x=m?a(w,v,[b.value,S],!0):b.value,l(y,S,x);return y.length=S,y}},function(t,e,n){"use strict";var r=n(9),i=n(5),o=n(58);t.exports=function(t,e,n){var a,s;i(t);try{if(!(a=o(t,"return"))){if("throw"===e)throw n;return n}a=r(a,t)}catch(u){s=!0,a=u}if("throw"===e)throw n;if(s)throw a;return i(a),n}},function(t,e,n){"use strict";var r=n(174).IteratorPrototype,i=n(37),o=n(48),a=n(33),s=n(85),u=function(){return this};t.exports=function(t,e,n,c){var l=e+" Iterator";return t.prototype=i(r,{next:o(+!c,n)}),a(t,l,!1,!0),s[l]=u,t}},function(t,e,n){"use strict";var r,i,o,a=n(1),s=n(8),u=n(6),c=n(37),l=n(39),h=n(16),f=n(7),d=n(21),p=f("iterator"),v=!1;[].keys&&("next"in(o=[].keys())?(i=l(l(o)))!==Object.prototype&&(r=i):v=!0),!u(r)||a((function(){var t={};return r[p].call(t)!==t}))?r={}:d&&(r=c(r)),s(r[p])||h(r,p,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:v}},function(t,e,n){"use strict";var r=n(275),i=String,o=TypeError;t.exports=function(t){if(r(t))return t;throw new o("Can't set "+i(t)+" as a prototype")}},function(t,e,n){"use strict";var r=n(42),i=n(23),o=n(30),a=n(17),s=n(46),u=Math.min,c=[].lastIndexOf,l=!!c&&1/[1].lastIndexOf(1,-0)<0,h=s("lastIndexOf"),f=l||!h;t.exports=f?function(t){if(l)return r(c,this,arguments)||0;var e=i(this),n=a(e),s=n-1;for(arguments.length>1&&(s=u(s,o(arguments[1]))),s<0&&(s=n+s);s>=0;s--)if(s in e&&e[s]===t)return s||0;return-1}:c},function(t,e,n){"use strict";var r=n(44).match(/firefox\/(\d+)/i);t.exports=!!r&&+r[1]},function(t,e,n){"use strict";var r=n(44);t.exports=/MSIE|Trident/.test(r)},function(t,e,n){"use strict";var r=n(30),i=n(31),o=RangeError;t.exports=function(t){if(void 0===t)return 0;var e=r(t),n=i(e);if(e!==n)throw new o("Wrong length or index");return n}},function(t,e,n){"use strict";var r=n(292);t.exports=Math.fround||function(t){return r(t,1.1920928955078125e-7,34028234663852886e22,11754943508222875e-54)}},function(t,e,n){"use strict";var r=n(2),i=n(18),o=n(6),a=n(12),s=n(32),u=n(75),c=Function,l=r([].concat),h=r([].join),f={},d=function(t,e,n){if(!a(f,e)){for(var r=[],i=0;i<e;i++)r[i]="a["+i+"]";f[e]=c("C,a","return new C("+h(r,",")+")")}return f[e](t,n)};t.exports=u?c.bind:function(t){var e=i(this),n=e.prototype,r=s(arguments,1),a=function(){var n=l(r,s(arguments));return this instanceof a?d(e,n.length,n):e.apply(t,n)};return o(n)&&(a.prototype=n),a}},function(t,e,n){"use strict";var r=n(37),i=n(38),o=n(87),a=n(41),s=n(55),u=n(35),c=n(72),l=n(129),h=n(101),f=n(70),d=n(4),p=n(63).fastKey,v=n(22),m=v.set,g=v.getterFor;t.exports={getConstructor:function(t,e,n,l){var h=t((function(t,i){s(t,f),m(t,{type:e,index:r(null),first:void 0,last:void 0,size:0}),d||(t.size=0),u(i)||c(i,t[l],{that:t,AS_ENTRIES:n})})),f=h.prototype,v=g(e),y=function(t,e,n){var r,i,o=v(t),a=b(t,e);return a?a.value=n:(o.last=a={index:i=p(e,!0),key:e,value:n,previous:r=o.last,next:void 0,removed:!1},o.first||(o.first=a),r&&(r.next=a),d?o.size++:t.size++,"F"!==i&&(o.index[i]=a)),t},b=function(t,e){var n,r=v(t),i=p(e);if("F"!==i)return r.index[i];for(n=r.first;n;n=n.next)if(n.key===e)return n};return o(f,{clear:function(){for(var t=v(this),e=t.first;e;)e.removed=!0,e.previous&&(e.previous=e.previous.next=void 0),e=e.next;t.first=t.last=void 0,t.index=r(null),d?t.size=0:this.size=0},delete:function(t){var e=this,n=v(e),r=b(e,t);if(r){var i=r.next,o=r.previous;delete n.index[r.index],r.removed=!0,o&&(o.next=i),i&&(i.previous=o),n.first===r&&(n.first=i),n.last===r&&(n.last=o),d?n.size--:e.size--}return!!r},forEach:function(t){for(var e,n=v(this),r=a(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:n.first;)for(r(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!b(this,t)}}),o(f,n?{get:function(t){var e=b(this,t);return e&&e.value},set:function(t,e){return y(this,0===t?0:t,e)}}:{add:function(t){return y(this,t=0===t?0:t,t)}}),d&&i(f,"size",{configurable:!0,get:function(){return v(this).size}}),h},setStrong:function(t,e,n){var r=e+" Iterator",i=g(e),o=g(r);l(t,e,(function(t,e){m(this,{type:r,target:t,state:i(t),kind:e,last:void 0})}),(function(){for(var t=o(this),e=t.kind,n=t.last;n&&n.removed;)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?h("keys"===e?n.key:"values"===e?n.value:[n.key,n.value],!1):(t.target=void 0,h(void 0,!0))}),n?"entries":"values",!n,!0),f(e)}}},function(t,e,n){"use strict";var r=Math.log;t.exports=Math.log1p||function(t){var e=+t;return e>-1e-8&&e<1e-8?e-e*e/2:r(1+e)}},function(t,e,n){"use strict";var r=n(3),i=n(1),o=n(2),a=n(13),s=n(73).trim,u=n(106),c=o("".charAt),l=r.parseFloat,h=r.Symbol,f=h&&h.iterator,d=1/l(u+"-0")!==-1/0||f&&!i((function(){l(Object(f))}));t.exports=d?function(t){var e=s(a(t)),n=l(e);return 0===n&&"-"===c(e,0)?-0:n}:l},function(t,e,n){"use strict";var r=n(3),i=n(1),o=n(2),a=n(13),s=n(73).trim,u=n(106),c=r.parseInt,l=r.Symbol,h=l&&l.iterator,f=/^[+-]?0x/i,d=o(f.exec),p=8!==c(u+"08")||22!==c(u+"0x16")||h&&!i((function(){c(Object(h))}));t.exports=p?function(t,e){var n=s(a(t));return c(n,e>>>0||(d(f,n)?16:10))}:c},function(t,e,n){"use strict";var r=n(4),i=n(2),o=n(9),a=n(1),s=n(81),u=n(97),c=n(93),l=n(14),h=n(76),f=Object.assign,d=Object.defineProperty,p=i([].concat);t.exports=!f||a((function(){if(r&&1!==f({b:1},f(d({},"a",{enumerable:!0,get:function(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol("assign detection"),i="abcdefghijklmnopqrst";return t[n]=7,i.split("").forEach((function(t){e[t]=t})),7!==f({},t)[n]||s(f({},e)).join("")!==i}))?function(t,e){for(var n=l(t),i=arguments.length,a=1,f=u.f,d=c.f;i>a;)for(var v,m=h(arguments[a++]),g=f?p(s(m),f(m)):s(m),y=g.length,b=0;y>b;)v=g[b++],r&&!o(d,m,v)||(n[v]=m[v]);return n}:f},function(t,e,n){"use strict";var r=n(4),i=n(1),o=n(2),a=n(39),s=n(81),u=n(23),c=o(n(93).f),l=o([].push),h=r&&i((function(){var t=Object.create(null);return t[2]=2,!c(t,2)})),f=function(t){return function(e){for(var n,i=u(e),o=s(i),f=h&&null===a(i),d=o.length,p=0,v=[];d>p;)n=o[p++],r&&!(f?n in i:c(i,n))||l(v,t?[n,i[n]]:i[n]);return v}};t.exports={entries:f(!0),values:f(!1)}},function(t,e,n){"use strict";t.exports=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!==t&&e!==e}},function(t,e,n){"use strict";var r=n(44);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},function(t,e,n){"use strict";var r,i,o,a,s,u=n(3),c=n(191),l=n(41),h=n(108).set,f=n(192),d=n(189),p=n(373),v=n(374),m=n(69),g=u.MutationObserver||u.WebKitMutationObserver,y=u.document,b=u.process,w=u.Promise,_=c("queueMicrotask");if(!_){var x=new f,k=function(){var t,e;for(m&&(t=b.domain)&&t.exit();e=x.get();)try{e()}catch(n){throw x.head&&r(),n}t&&t.enter()};d||m||v||!g||!y?!p&&w&&w.resolve?((a=w.resolve(void 0)).constructor=w,s=l(a.then,a),r=function(){s(k)}):m?r=function(){b.nextTick(k)}:(h=l(h,u),r=function(){h(k)}):(i=!0,o=y.createTextNode(""),new g(k).observe(o,{characterData:!0}),r=function(){o.data=i=!i}),_=function(t){x.head||r(),x.add(t)}}t.exports=_},function(t,e,n){"use strict";var r=n(3),i=n(4),o=Object.getOwnPropertyDescriptor;t.exports=function(t){if(!i)return r[t];var e=o(r,t);return e&&e.value}},function(t,e,n){"use strict";var r=function(){this.head=null,this.tail=null};r.prototype={add:function(t){var e={item:t,next:null},n=this.tail;n?n.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return null===(this.head=t.next)&&(this.tail=null),t.item}},t.exports=r},function(t,e,n){"use strict";t.exports="object"==typeof Deno&&Deno&&"object"==typeof Deno.version},function(t,e,n){"use strict";var r=n(74),i=n(99),o=n(91).CONSTRUCTOR;t.exports=o||!i((function(t){r.all(t).then(void 0,(function(){}))}))},function(t,e,n){"use strict";var r=n(5),i=n(6),o=n(92);t.exports=function(t,e){if(r(t),i(e)&&e.constructor===t)return e;var n=o.f(t);return(0,n.resolve)(e),n.promise}},function(t,e,n){"use strict";var r=n(12);t.exports=function(t){return void 0!==t&&(r(t,"value")||r(t,"writable"))}},function(t,e,n){"use strict";var r=n(9),i=n(12),o=n(36),a=n(144),s=RegExp.prototype;t.exports=function(t){var e=t.flags;return void 0!==e||"flags"in s||i(t,"flags")||!o(s,t)?e:r(a,t)}},function(t,e,n){"use strict";var r=n(1),i=n(3).RegExp;t.exports=r((function(){var t=i(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)}))},function(t,e,n){"use strict";var r=n(1),i=n(3).RegExp;t.exports=r((function(){var t=i("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},function(t,e,n){"use strict";var r=n(0),i=n(109);r({target:"RegExp",proto:!0,forced:/./.exec!==i},{exec:i})},function(t,e,n){"use strict";var r=n(110).charAt,i=n(13),o=n(22),a=n(129),s=n(101),u="String Iterator",c=o.set,l=o.getterFor(u);a(String,"String",(function(t){c(this,{type:u,string:i(t),index:0})}),(function(){var t,e=l(this),n=e.string,i=e.index;return i>=n.length?s(void 0,!0):(t=r(n,i),e.index+=t.length,s(t,!1))}))},function(t,e,n){"use strict";var r=n(44);t.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(r)},function(t,e,n){"use strict";var r=n(73).end,i=n(149);t.exports=i("trimEnd")?function(){return r(this)}:"".trimEnd},function(t,e,n){"use strict";var r=n(73).start,i=n(149);t.exports=i("trimStart")?function(){return r(this)}:"".trimStart},function(t,e,n){"use strict";var r=n(435),i=RangeError;t.exports=function(t,e){var n=r(t);if(n%e)throw new i("Wrong offset");return n}},function(t,e,n){"use strict";var r=n(41),i=n(9),o=n(135),a=n(14),s=n(17),u=n(98),c=n(86),l=n(128),h=n(437),f=n(10).aTypedArrayConstructor,d=n(207);t.exports=function(t){var e,n,p,v,m,g,y,b,w=o(this),_=a(t),x=arguments.length,k=x>1?arguments[1]:void 0,S=void 0!==k,C=c(_);if(C&&!l(C))for(b=(y=u(_,C)).next,_=[];!(g=i(b,y)).done;)_.push(g.value);for(S&&x>2&&(k=r(k,arguments[2])),n=s(_),p=new(f(w))(n),v=h(p),e=0;n>e;e++)m=S?k(_[e],e):_[e],p[e]=v?d(m):+m;return p}},function(t,e,n){"use strict";var r=n(94),i=TypeError;t.exports=function(t){var e=r(t,"number");if("number"==typeof e)throw new i("Can't convert number to bigint");return BigInt(e)}},function(t,e,n){"use strict";var r=n(17);t.exports=function(t,e,n){for(var i=0,o=arguments.length>2?n:r(e),a=new t(o);o>i;)a[i]=e[i++];return a}},function(t,e,n){"use strict";var r=n(2),i=n(87),o=n(63).getWeakData,a=n(55),s=n(5),u=n(35),c=n(6),l=n(72),h=n(19),f=n(12),d=n(22),p=d.set,v=d.getterFor,m=h.find,g=h.findIndex,y=r([].splice),b=0,w=function(t){return t.frozen||(t.frozen=new _)},_=function(){this.entries=[]},x=function(t,e){return m(t.entries,(function(t){return t[0]===e}))};_.prototype={get:function(t){var e=x(this,t);if(e)return e[1]},has:function(t){return!!x(this,t)},set:function(t,e){var n=x(this,t);n?n[1]=e:this.entries.push([t,e])},delete:function(t){var e=g(this.entries,(function(e){return e[0]===t}));return~e&&y(this.entries,e,1),!!~e}},t.exports={getConstructor:function(t,e,n,r){var h=t((function(t,i){a(t,d),p(t,{type:e,id:b++,frozen:void 0}),u(i)||l(i,t[r],{that:t,AS_ENTRIES:n})})),d=h.prototype,m=v(e),g=function(t,e,n){var r=m(t),i=o(s(e),!0);return!0===i?w(r).set(e,n):i[r.id]=n,t};return i(d,{delete:function(t){var e=m(this);if(!c(t))return!1;var n=o(t);return!0===n?w(e).delete(t):n&&f(n,e.id)&&delete n[e.id]},has:function(t){var e=m(this);if(!c(t))return!1;var n=o(t);return!0===n?w(e).has(t):n&&f(n,e.id)}}),i(d,n?{get:function(t){var e=m(this);if(c(t)){var n=o(t);return!0===n?w(e).get(t):n?n[e.id]:void 0}},set:function(t,e){return g(this,t,e)}}:{add:function(t){return g(this,t,!0)}}),h}}},function(t,e,n){"use strict";t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(t,e,n){"use strict";var r=n(95)("span").classList,i=r&&r.constructor&&r.constructor.prototype;t.exports=i===Object.prototype?void 0:i},function(t,e,n){"use strict";var r=n(1),i=n(7),o=n(4),a=n(21),s=i("iterator");t.exports=!r((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),e=t.searchParams,n=new URLSearchParams("a=1&a=2&b=3"),r="";return t.pathname="c%20d",e.forEach((function(t,n){e.delete("b"),r+=n+t})),n.delete("a",2),n.delete("b",void 0),a&&(!t.toJSON||!n.has("a",1)||n.has("a",2)||!n.has("a",void 0)||n.has("b"))||!e.size&&(a||!o)||!e.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[s]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://\u0442\u0435\u0441\u0442").host||"#%D0%B1"!==new URL("http://a#\u0431").hash||"a1c3"!==r||"x"!==new URL("http://x",void 0).host}))},function(t,e,n){"use strict";n(100);var r=n(0),i=n(3),o=n(191),a=n(9),s=n(2),u=n(4),c=n(212),l=n(16),h=n(38),f=n(87),d=n(33),p=n(173),v=n(22),m=n(55),g=n(8),y=n(12),b=n(41),w=n(45),_=n(5),x=n(6),k=n(13),S=n(37),C=n(48),M=n(98),E=n(86),T=n(101),A=n(90),O=n(7),D=n(131),P=O("iterator"),L="URLSearchParams",N="URLSearchParamsIterator",R=v.set,I=v.getterFor(L),z=v.getterFor(N),B=o("fetch"),j=o("Request"),F=o("Headers"),q=j&&j.prototype,$=F&&F.prototype,V=i.RegExp,U=i.TypeError,H=i.decodeURIComponent,W=i.encodeURIComponent,Z=s("".charAt),J=s([].join),Y=s([].push),K=s("".replace),G=s([].shift),X=s([].splice),Q=s("".split),tt=s("".slice),et=/\+/g,nt=Array(4),rt=function(t){return nt[t-1]||(nt[t-1]=V("((?:%[\\da-f]{2}){"+t+"})","gi"))},it=function(t){try{return H(t)}catch(e){return t}},ot=function(t){var e=K(t,et," "),n=4;try{return H(e)}catch(r){for(;n;)e=K(e,rt(n--),it);return e}},at=/[!'()~]|%20/g,st={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},ut=function(t){return st[t]},ct=function(t){return K(W(t),at,ut)},lt=p((function(t,e){R(this,{type:N,target:I(t).entries,index:0,kind:e})}),L,(function(){var t=z(this),e=t.target,n=t.index++;if(!e||n>=e.length)return t.target=void 0,T(void 0,!0);var r=e[n];switch(t.kind){case"keys":return T(r.key,!1);case"values":return T(r.value,!1)}return T([r.key,r.value],!1)}),!0),ht=function(t){this.entries=[],this.url=null,void 0!==t&&(x(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===Z(t,0)?tt(t,1):t:k(t)))};ht.prototype={type:L,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var e,n,r,i,o,s,u,c=this.entries,l=E(t);if(l)for(n=(e=M(t,l)).next;!(r=a(n,e)).done;){if(o=(i=M(_(r.value))).next,(s=a(o,i)).done||(u=a(o,i)).done||!a(o,i).done)throw new U("Expected sequence with length 2");Y(c,{key:k(s.value),value:k(u.value)})}else for(var h in t)y(t,h)&&Y(c,{key:h,value:k(t[h])})},parseQuery:function(t){if(t)for(var e,n,r=this.entries,i=Q(t,"&"),o=0;o<i.length;)(e=i[o++]).length&&(n=Q(e,"="),Y(r,{key:ot(G(n)),value:ot(J(n,"="))}))},serialize:function(){for(var t,e=this.entries,n=[],r=0;r<e.length;)t=e[r++],Y(n,ct(t.key)+"="+ct(t.value));return J(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ft=function(){m(this,dt);var t=arguments.length>0?arguments[0]:void 0,e=R(this,new ht(t));u||(this.size=e.entries.length)},dt=ft.prototype;if(f(dt,{append:function(t,e){var n=I(this);A(arguments.length,2),Y(n.entries,{key:k(t),value:k(e)}),u||this.length++,n.updateURL()},delete:function(t){for(var e=I(this),n=A(arguments.length,1),r=e.entries,i=k(t),o=n<2?void 0:arguments[1],a=void 0===o?o:k(o),s=0;s<r.length;){var c=r[s];if(c.key!==i||void 0!==a&&c.value!==a)s++;else if(X(r,s,1),void 0!==a)break}u||(this.size=r.length),e.updateURL()},get:function(t){var e=I(this).entries;A(arguments.length,1);for(var n=k(t),r=0;r<e.length;r++)if(e[r].key===n)return e[r].value;return null},getAll:function(t){var e=I(this).entries;A(arguments.length,1);for(var n=k(t),r=[],i=0;i<e.length;i++)e[i].key===n&&Y(r,e[i].value);return r},has:function(t){for(var e=I(this).entries,n=A(arguments.length,1),r=k(t),i=n<2?void 0:arguments[1],o=void 0===i?i:k(i),a=0;a<e.length;){var s=e[a++];if(s.key===r&&(void 0===o||s.value===o))return!0}return!1},set:function(t,e){var n=I(this);A(arguments.length,1);for(var r,i=n.entries,o=!1,a=k(t),s=k(e),c=0;c<i.length;c++)(r=i[c]).key===a&&(o?X(i,c--,1):(o=!0,r.value=s));o||Y(i,{key:a,value:s}),u||(this.size=i.length),n.updateURL()},sort:function(){var t=I(this);D(t.entries,(function(t,e){return t.key>e.key?1:-1})),t.updateURL()},forEach:function(t){for(var e,n=I(this).entries,r=b(t,arguments.length>1?arguments[1]:void 0),i=0;i<n.length;)r((e=n[i++]).value,e.key,this)},keys:function(){return new lt(this,"keys")},values:function(){return new lt(this,"values")},entries:function(){return new lt(this,"entries")}},{enumerable:!0}),l(dt,P,dt.entries,{name:"entries"}),l(dt,"toString",(function(){return I(this).serialize()}),{enumerable:!0}),u&&h(dt,"size",{get:function(){return I(this).entries.length},configurable:!0,enumerable:!0}),d(ft,L),r({global:!0,constructor:!0,forced:!c},{URLSearchParams:ft}),!c&&g(F)){var pt=s($.has),vt=s($.set),mt=function(t){if(x(t)){var e,n=t.body;if(w(n)===L)return e=t.headers?new F(t.headers):new F,pt(e,"content-type")||vt(e,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),S(t,{body:C(0,k(n)),headers:C(0,e)})}return t};if(g(B)&&r({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return B(t,arguments.length>1?mt(arguments[1]):{})}}),g(j)){var gt=function(t){return m(this,q),new j(t,arguments.length>1?mt(arguments[1]):{})};q.constructor=gt,gt.prototype=q,r({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:gt})}}t.exports={URLSearchParams:ft,getState:I}},function(t,e){function n(){}function r(t){this._tree=t,this._ancestors=[],this._cursor=null}n.prototype.clear=function(){this._root=null,this.size=0},n.prototype.find=function(t){for(var e=this._root;null!==e;){var n=this._comparator(t,e.data);if(0===n)return e.data;e=e.get_child(n>0)}return null},n.prototype.findIter=function(t){for(var e=this._root,n=this.iterator();null!==e;){var r=this._comparator(t,e.data);if(0===r)return n._cursor=e,n;n._ancestors.push(e),e=e.get_child(r>0)}return null},n.prototype.lowerBound=function(t){for(var e=this._root,n=this.iterator(),r=this._comparator;null!==e;){var i=r(t,e.data);if(0===i)return n._cursor=e,n;n._ancestors.push(e),e=e.get_child(i>0)}for(var o=n._ancestors.length-1;o>=0;--o)if(r(t,(e=n._ancestors[o]).data)<0)return n._cursor=e,n._ancestors.length=o,n;return n._ancestors.length=0,n},n.prototype.upperBound=function(t){for(var e=this.lowerBound(t),n=this._comparator;null!==e.data()&&0===n(e.data(),t);)e.next();return e},n.prototype.min=function(){var t=this._root;if(null===t)return null;for(;null!==t.left;)t=t.left;return t.data},n.prototype.max=function(){var t=this._root;if(null===t)return null;for(;null!==t.right;)t=t.right;return t.data},n.prototype.iterator=function(){return new r(this)},n.prototype.each=function(t){for(var e,n=this.iterator();null!==(e=n.next());)t(e)},n.prototype.reach=function(t){for(var e,n=this.iterator();null!==(e=n.prev());)t(e)},r.prototype.data=function(){return null!==this._cursor?this._cursor.data:null},r.prototype.next=function(){if(null===this._cursor){var t=this._tree._root;null!==t&&this._minNode(t)}else{var e;if(null===this._cursor.right)do{if(e=this._cursor,!this._ancestors.length){this._cursor=null;break}this._cursor=this._ancestors.pop()}while(this._cursor.right===e);else this._ancestors.push(this._cursor),this._minNode(this._cursor.right)}return null!==this._cursor?this._cursor.data:null},r.prototype.prev=function(){if(null===this._cursor){var t=this._tree._root;null!==t&&this._maxNode(t)}else{var e;if(null===this._cursor.left)do{if(e=this._cursor,!this._ancestors.length){this._cursor=null;break}this._cursor=this._ancestors.pop()}while(this._cursor.left===e);else this._ancestors.push(this._cursor),this._maxNode(this._cursor.left)}return null!==this._cursor?this._cursor.data:null},r.prototype._minNode=function(t){for(;null!==t.left;)this._ancestors.push(t),t=t.left;this._cursor=t},r.prototype._maxNode=function(t){for(;null!==t.right;)this._ancestors.push(t),t=t.right;this._cursor=t},t.exports=n},function(t,e,n){var r=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,i="function"===typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(D){u=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var i=e&&e.prototype instanceof m?e:m,o=Object.create(i.prototype),a=new T(r||[]);return o._invoke=function(t,e,n){var r=h;return function(i,o){if(r===d)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw o;return O()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=C(a,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var u=l(t,e,n);if("normal"===u.type){if(r=n.done?p:f,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=p,n.method="throw",n.arg=u.arg)}}}(t,n,a),o}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(D){return{type:"throw",arg:D}}}t.wrap=c;var h="suspendedStart",f="suspendedYield",d="executing",p="completed",v={};function m(){}function g(){}function y(){}var b={};b[o]=function(){return this};var w=Object.getPrototypeOf,_=w&&w(w(A([])));_&&_!==n&&r.call(_,o)&&(b=_);var x=y.prototype=m.prototype=Object.create(b);function k(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(i,o,a,s){var u=l(t[i],t,o);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"===typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(h).then((function(t){c.value=t,a(c)}),(function(t){return n("throw",t,a,s)}))}s(u.arg)}var i;this._invoke=function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}}function C(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,C(t,n),"throw"===n.method))return v;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=l(r,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var o=i.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function M(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(M,this),this.reset(!0)}function A(t){if(t){var n=t[o];if(n)return n.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var i=-1,a=function n(){for(;++i<t.length;)if(r.call(t,i))return n.value=t[i],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}return{next:O}}function O(){return{value:e,done:!0}}return g.prototype=x.constructor=y,y.constructor=g,g.displayName=u(y,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,u(t,s,"GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},k(S.prototype),S.prototype[a]=function(){return this},t.AsyncIterator=S,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new S(c(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},k(x),u(x,s,"Generator"),x[o]=function(){return this},x.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=A,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(E),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function i(r,i){return s.type="throw",s.arg=t,n.next=r,i&&(n.method="next",n.arg=e),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),E(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:A(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}(t.exports);try{regeneratorRuntime=r}catch(i){Function("r","regeneratorRuntime = r")(r)}},function(t,e,n){},function(t,e,n){t.exports=n.p+"media/images/marker-icon-2x-680f69f3.png"},function(t,e,n){t.exports=n.p+"media/images/marker-icon-2b3e1faf.png"},function(t,e,n){t.exports=n.p+"media/images/marker-shadow-a0c6cc14.png"},function(t,e,n){"use strict";t.exports=n(508)},function(t,e,n){"use strict";t.exports.encode=n(509),t.exports.decode=n(510),t.exports.format=n(511),t.exports.parse=n(512)},function(t,e){t.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/},function(t,e){t.exports=/[\0-\x1F\x7F-\x9F]/},function(t,e){t.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/},function(t,e,n){"use strict";var r="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",i="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",o=new RegExp("^(?:"+r+"|"+i+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|<[?].*?[?]>|<![A-Z]+\\s+[^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)"),a=new RegExp("^(?:"+r+"|"+i+")");t.exports.HTML_TAG_RE=o,t.exports.HTML_OPEN_CLOSE_TAG_RE=a},function(t,e,n){"use strict";function r(t,e){var n,r,i,o,a,s=[],u=e.length;for(n=0;n<u;n++)126===(i=e[n]).marker&&-1!==i.end&&(o=e[i.end],(a=t.tokens[i.token]).type="s_open",a.tag="s",a.nesting=1,a.markup="~~",a.content="",(a=t.tokens[o.token]).type="s_close",a.tag="s",a.nesting=-1,a.markup="~~",a.content="","text"===t.tokens[o.token-1].type&&"~"===t.tokens[o.token-1].content&&s.push(o.token-1));for(;s.length;){for(r=(n=s.pop())+1;r<t.tokens.length&&"s_close"===t.tokens[r].type;)r++;n!==--r&&(a=t.tokens[r],t.tokens[r]=t.tokens[n],t.tokens[n]=a)}}t.exports.tokenize=function(t,e){var n,r,i,o,a=t.pos,s=t.src.charCodeAt(a);if(e)return!1;if(126!==s)return!1;if(i=(r=t.scanDelims(t.pos,!0)).length,o=String.fromCharCode(s),i<2)return!1;for(i%2&&(t.push("text","",0).content=o,i--),n=0;n<i;n+=2)t.push("text","",0).content=o+o,t.delimiters.push({marker:s,length:0,jump:n,token:t.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return t.pos+=r.length,!0},t.exports.postProcess=function(t){var e,n=t.tokens_meta,i=t.tokens_meta.length;for(r(t,t.delimiters),e=0;e<i;e++)n[e]&&n[e].delimiters&&r(t,n[e].delimiters)}},function(t,e,n){"use strict";function r(t,e){var n,r,i,o,a,s;for(n=e.length-1;n>=0;n--)95!==(r=e[n]).marker&&42!==r.marker||-1!==r.end&&(i=e[r.end],s=n>0&&e[n-1].end===r.end+1&&e[n-1].token===r.token-1&&e[r.end+1].token===i.token+1&&e[n-1].marker===r.marker,a=String.fromCharCode(r.marker),(o=t.tokens[r.token]).type=s?"strong_open":"em_open",o.tag=s?"strong":"em",o.nesting=1,o.markup=s?a+a:a,o.content="",(o=t.tokens[i.token]).type=s?"strong_close":"em_close",o.tag=s?"strong":"em",o.nesting=-1,o.markup=s?a+a:a,o.content="",s&&(t.tokens[e[n-1].token].content="",t.tokens[e[r.end+1].token].content="",n--))}t.exports.tokenize=function(t,e){var n,r,i=t.pos,o=t.src.charCodeAt(i);if(e)return!1;if(95!==o&&42!==o)return!1;for(r=t.scanDelims(t.pos,42===o),n=0;n<r.length;n++)t.push("text","",0).content=String.fromCharCode(o),t.delimiters.push({marker:o,length:r.length,jump:n,token:t.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return t.pos+=r.length,!0},t.exports.postProcess=function(t){var e,n=t.tokens_meta,i=t.tokens_meta.length;for(r(t,t.delimiters),e=0;e<i;e++)n[e]&&n[e].delimiters&&r(t,n[e].delimiters)}},function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e,n){"use strict";e.a=function(t){var e=this.constructor;return this.then((function(n){return e.resolve(t()).then((function(){return n}))}),(function(n){return e.resolve(t()).then((function(){return e.reject(n)}))}))}},function(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})(t)}e.a=function(t){return new this((function(e,n){if(!t||"undefined"===typeof t.length)return n(new TypeError(r(t)+" "+t+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var i=Array.prototype.slice.call(t);if(0===i.length)return e([]);var o=i.length;function a(t,n){if(n&&("object"===r(n)||"function"===typeof n)){var s=n.then;if("function"===typeof s)return void s.call(n,(function(e){a(t,e)}),(function(n){i[t]={status:"rejected",reason:n},0===--o&&e(i)}))}i[t]={status:"fulfilled",value:n},0===--o&&e(i)}for(var s=0;s<i.length;s++)a(s,i[s])}))}},function(t,e,n){var r,i,o;!function(a,s){"use strict";i=[n(494)],void 0===(o="function"===typeof(r=function(t){var e=/(^|@)\S+:\d+/,n=/^\s*at .*(\S+:\d+|\(native\))/m,r=/^(eval@)?(\[native code])?$/;return{parse:function(t){if("undefined"!==typeof t.stacktrace||"undefined"!==typeof t["opera#sourceloc"])return this.parseOpera(t);if(t.stack&&t.stack.match(n))return this.parseV8OrIE(t);if(t.stack)return this.parseFFOrSafari(t);throw new Error("Cannot parse given Error object")},extractLocation:function(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(e){return e.stack.split("\n").filter((function(t){return!!t.match(n)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var n=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),r=n.match(/ (\((.+):(\d+):(\d+)\)$)/),i=(n=r?n.replace(r[0],""):n).split(/\s+/).slice(1),o=this.extractLocation(r?r[1]:i.pop()),a=i.join(" ")||void 0,s=["eval","<anonymous>"].indexOf(o[0])>-1?void 0:o[0];return new t({functionName:a,fileName:s,lineNumber:o[1],columnNumber:o[2],source:e})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(t){return!t.match(r)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new t({functionName:e});var n=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(n),i=r&&r[1]?r[1]:void 0,o=this.extractLocation(e.replace(n,""));return new t({functionName:i,fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:e})}),this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(e){for(var n=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],o=2,a=r.length;o<a;o+=2){var s=n.exec(r[o]);s&&i.push(new t({fileName:s[2],lineNumber:s[1],source:r[o]}))}return i},parseOpera10:function(e){for(var n=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],o=0,a=r.length;o<a;o+=2){var s=n.exec(r[o]);s&&i.push(new t({functionName:s[3]||void 0,fileName:s[2],lineNumber:s[1],source:r[o]}))}return i},parseOpera11:function(n){return n.stack.split("\n").filter((function(t){return!!t.match(e)&&!t.match(/^Error created at/)}),this).map((function(e){var n,r=e.split("@"),i=this.extractLocation(r.pop()),o=r.shift()||"",a=o.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;o.match(/\(([^)]*)\)/)&&(n=o.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var s=void 0===n||"[arguments not available]"===n?void 0:n.split(",");return new t({functionName:a,args:s,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:e})}),this)}}})?r.apply(e,i):r)||(t.exports=o)}()},function(t,e){var n=function(t){function e(){this.fetch=!1,this.DOMException=t.DOMException}return e.prototype=t,new e}("undefined"!==typeof self?self:this);!function(t){!function(e){var n="URLSearchParams"in t,r="Symbol"in t&&"iterator"in Symbol,i="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),o="FormData"in t,a="ArrayBuffer"in t;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function c(t){if("string"!==typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function l(t){return"string"!==typeof t&&(t=String(t)),t}function h(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return r&&(e[Symbol.iterator]=function(){return e}),e}function f(t){this.map={},t instanceof f?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function d(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function v(t){var e=new FileReader,n=p(e);return e.readAsArrayBuffer(t),n}function m(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"===typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:n&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&i&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=m(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||u(t))?this._bodyArrayBuffer=m(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"===typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=d(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(v)}),this.text=function(){var t,e,n,r=d(this);if(r)return r;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,n=p(e),e.readAsText(t),n;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r<e.length;r++)n[r]=String.fromCharCode(e[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(t,e){t=c(t),e=l(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},f.prototype.delete=function(t){delete this.map[c(t)]},f.prototype.get=function(t){return t=c(t),this.has(t)?this.map[t]:null},f.prototype.has=function(t){return this.map.hasOwnProperty(c(t))},f.prototype.set=function(t,e){this.map[c(t)]=l(e)},f.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},f.prototype.keys=function(){var t=[];return this.forEach((function(e,n){t.push(n)})),h(t)},f.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),h(t)},f.prototype.entries=function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),h(t)},r&&(f.prototype[Symbol.iterator]=f.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(t,e){var n,r,i=(e=e||{}).body;if(t instanceof b){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new f(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new f(e.headers)),this.method=(n=e.method||this.method||"GET",r=n.toUpperCase(),y.indexOf(r)>-1?r:n),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}})),e}function _(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new f(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},g.call(b.prototype),g.call(_.prototype),_.prototype.clone=function(){return new _(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},_.error=function(){var t=new _(null,{status:0,statusText:""});return t.type="error",t};var x=[301,302,303,307,308];_.redirect=function(t,e){if(-1===x.indexOf(e))throw new RangeError("Invalid status code");return new _(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(S){e.DOMException=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function k(t,n){return new Promise((function(r,o){var a=new b(t,n);if(a.signal&&a.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var t,e,n={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new f,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var n=t.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();e.append(r,i)}})),e)};n.url="responseURL"in s?s.responseURL:n.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;r(new _(i,n))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",u)}),s.send("undefined"===typeof a._bodyInit?null:a._bodyInit)}))}k.polyfill=!0,t.fetch||(t.fetch=k,t.Headers=f,t.Request=b,t.Response=_),e.Headers=f,e.Request=b,e.Response=_,e.fetch=k}({})}(n),delete n.fetch.polyfill,(e=n.fetch).default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,t.exports=e},function(t,e,n){"use strict";t.exports=n(507)},function(t,e,n){"use strict";(function(t,r){n.d(e,"a",(function(){return Rc}));var i,o,a=n(57),s=n.n(a);function u(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(c){return void n(c)}s.done?e(u):Promise.resolve(u).then(r,i)}function c(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){u(o,r,i,a,s,"next",t)}function s(t){u(o,r,i,a,s,"throw",t)}a(void 0)}))}}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 h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){f(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function f(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function d(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=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(u){i=!0,o=u}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||A(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 p(t,e,n){return(p="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=k(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function v(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&&x(t,e)}function m(t){var e=_();return function(){var n,r=k(t);if(e){var i=k(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return g(this,n)}}function g(t,e){return!e||"object"!==D(e)&&"function"!==typeof e?y(t):e}function y(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function b(t){var e="function"===typeof Map?new Map:void 0;return(b=function(t){if(null===t||!function(t){return-1!==Function.toString.call(t).indexOf("[native code]")}(t))return t;if("function"!==typeof t)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return w(t,arguments,k(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),x(n,t)})(t)}function w(t,e,n){return(w=_()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&x(i,n.prototype),i}).apply(null,arguments)}function _(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function x(t,e){return(x=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function k(t){return(k=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function S(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=A(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){throw t})),f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){s=!0,o=t})),f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function C(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function M(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function E(t,e,n){return e&&M(t.prototype,e),n&&M(t,n),t}function T(t){return function(t){if(Array.isArray(t))return O(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||A(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 A(t,e){if(t){if("string"===typeof t)return O(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?O(t,e):void 0}}function O(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function D(t){return(D="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function P(){}function L(t){return t()}function N(){return Object.create(null)}function R(t){t.forEach(L)}function I(t){return"function"==typeof t}function z(t,e){return t!=t?e==e:t!==e||t&&"object"==D(t)||"function"==typeof t}function B(t,e){return i||(i=document.createElement("a")),i.href=e,t===i.href}function j(t){if(null==t)return P;for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];var i=t.subscribe.apply(t,n);return i.unsubscribe?function(){return i.unsubscribe()}:i}function F(t,e,n){t.$$.on_destroy.push(j(e,n))}function q(t,e,n){return t.set(n),e}function $(t,e){t.appendChild(e)}function V(t,e,n){t.insertBefore(e,n||null)}function U(t){t.parentNode&&t.parentNode.removeChild(t)}function H(t,e){for(var n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function W(t){return document.createElement(t)}function Z(t){return document.createTextNode(t)}function J(){return Z(" ")}function Y(t,e,n,r){return t.addEventListener(e,n,r),function(){return t.removeEventListener(e,n,r)}}function K(t){return function(e){return e.preventDefault(),t.call(this,e)}}function G(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function X(t){return Array.from(t.childNodes)}function Q(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function tt(t,e,n,r){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,r?"important":"")}function et(t,e,n){t.classList[n?"add":"remove"](e)}function nt(t){o=t}function rt(){if(!o)throw new Error("Function called outside component initialization");return o}function it(t){rt().$$.on_mount.push(t)}function ot(t){rt().$$.on_destroy.push(t)}var at=[],st=[],ut=[],ct=[],lt=Promise.resolve(),ht=!1;function ft(t){ut.push(t)}var dt=new Set,pt=0;function vt(){if(0===pt){var t=o;do{try{for(;pt<at.length;){var e=at[pt];pt++,nt(e),mt(e.$$)}}catch(e){throw at.length=0,pt=0,e}for(nt(null),at.length=0,pt=0;st.length;)st.pop()();for(var n=0;n<ut.length;n+=1){var r=ut[n];dt.has(r)||(dt.add(r),r())}ut.length=0}while(at.length);for(;ct.length;)ct.pop()();ht=!1,dt.clear(),nt(t)}}function mt(t){if(null!==t.fragment){t.update(),R(t.before_update);var e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(ft)}}var gt,yt=new Set;function bt(){gt={r:0,c:[],p:gt}}function wt(){gt.r||R(gt.c),gt=gt.p}function _t(t,e){t&&t.i&&(yt.delete(t),t.i(e))}function xt(t,e,n,r){if(t&&t.o){if(yt.has(t))return;yt.add(t),gt.c.push((function(){yt.delete(t),r&&(n&&t.d(1),r())})),t.o(e)}else r&&r()}function kt(t){t&&t.c()}function St(t,e,n,r){var i=t.$$,o=i.fragment,a=i.after_update;o&&o.m(e,n),r||ft((function(){var e,n=t.$$.on_mount.map(L).filter(I);t.$$.on_destroy?(e=t.$$.on_destroy).push.apply(e,T(n)):R(n),t.$$.on_mount=[]})),a.forEach(ft)}function Ct(t,e){var n=t.$$;null!==n.fragment&&(function(t){var e=[],n=[];ut.forEach((function(r){return-1===t.indexOf(r)?e.push(r):n.push(r)})),n.forEach((function(t){return t()})),ut=e}(n.after_update),R(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function Mt(t,e){-1===t.$$.dirty[0]&&(at.push(t),ht||(ht=!0,lt.then(vt)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function Et(t,e,n,r,i,a,s){var u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:[-1],c=o;nt(t);var l=t.$$={fragment:null,ctx:[],props:a,update:P,not_equal:i,bound:N(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:N(),dirty:u,skip_bound:!1,root:e.target||c.$$.root};s&&s(l.root);var h=!1;if(l.ctx=n?n(t,e.props||{},(function(e,n){var r=!(arguments.length<=2)&&arguments.length-2?arguments.length<=2?void 0:arguments[2]:n;return l.ctx&&i(l.ctx[e],l.ctx[e]=r)&&(!l.skip_bound&&l.bound[e]&&l.bound[e](r),h&&Mt(t,e)),n})):[],l.update(),h=!0,R(l.before_update),l.fragment=!!r&&r(l.ctx),e.target){if(e.hydrate){var f=X(e.target);l.fragment&&l.fragment.l(f),f.forEach(U)}else l.fragment&&l.fragment.c();e.intro&&_t(t.$$.fragment),St(t,e.target,e.anchor,e.customElement),vt()}nt(c)}var Tt=function(){function t(){C(this,t)}return E(t,[{key:"$destroy",value:function(){Ct(this,1),this.$destroy=P}},{key:"$on",value:function(t,e){if(!I(e))return P;var n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}}},{key:"$set",value:function(t){this.$$set&&!function(t){return 0===Object.keys(t).length}(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}]),t}(),At=[];function Ot(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:P,r=new Set;function i(n){if(z(t,n)&&(t=n,e)){var i,o=!At.length,a=S(r);try{for(a.s();!(i=a.n()).done;){var s=i.value;s[1](),At.push(s,t)}}catch(c){a.e(c)}finally{a.f()}if(o){for(var u=0;u<At.length;u+=2)At[u][0](At[u+1]);At.length=0}}}function o(e){i(e(t))}function a(o){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:P,s=[o,a];return r.add(s),1===r.size&&(e=n(i)||P),o(t),function(){r.delete(s),0===r.size&&e&&(e(),e=null)}}return{set:i,update:o,subscribe:a}}function Dt(t,e,n){var r=!Array.isArray(t),i=r?[t]:t,o=e.length<2;return function(t,e){return{subscribe:Ot(t,e).subscribe}}(n,(function(t){var n=!1,a=[],s=0,u=P,c=function(){if(!s){u();var n=e(r?a[0]:a,t);o?t(n):u=I(n)?n:P}},l=i.map((function(t,e){return j(t,(function(t){a[e]=t,s&=~(1<<e),n&&c()}),(function(){s|=1<<e}))}));return n=!0,c(),function(){R(l),u(),n=!1}}))}var Pt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:21;return crypto.getRandomValues(new Uint8Array(t)).reduce((function(t,e){return t+=(e&=63)<36?e.toString(36):e<62?(e-26).toString(36).toUpperCase():e>62?"-":"_"}),"")},Lt=200,Nt=function(){};Nt.prototype.append=function(t){return t.length?(t=Nt.from(t),!this.length&&t||t.length<Lt&&this.leafAppend(t)||this.length<Lt&&t.leafPrepend(this)||this.appendInner(t)):this},Nt.prototype.prepend=function(t){return t.length?Nt.from(t).append(this):this},Nt.prototype.appendInner=function(t){return new It(this,t)},Nt.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?Nt.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Nt.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Nt.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},Nt.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},Nt.from=function(t){return t instanceof Nt?t:t&&t.length?new Rt(t):Nt.empty};var Rt=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var i=e;i<n;i++)if(!1===t(this.values[i],r+i))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var i=e-1;i>=n;i--)if(!1===t(this.values[i],r+i))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=Lt)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=Lt)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Nt);Nt.empty=new Rt([]);var It=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var i=this.left.length;if(e<i&&!1===this.left.forEachInner(t,e,Math.min(n,i),r)||n>i&&!1===this.right.forEachInner(t,Math.max(e-i,0),Math.min(this.length,n)-i,r+i))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){var i=this.left.length;if(e>i&&!1===this.right.forEachInvertedInner(t,e-i,Math.max(n,i)-i,r+i)||n<i&&!1===this.left.forEachInvertedInner(t,Math.min(e,i),n,r))return!1},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(Nt),zt=Nt;function Bt(t){this.content=t}function jt(t,e,n){for(var r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;var i=t.child(r),o=e.child(r);if(i!=o){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(var a=0;i.text[a]==o.text[a];a++)n++;return n}if(i.content.size||o.content.size){var s=jt(i.content,o.content,n+1);if(null!=s)return s}n+=i.nodeSize}else n+=i.nodeSize}}function Ft(t,e,n,r){for(var i=t.childCount,o=e.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};var a=t.child(--i),s=e.child(--o),u=a.nodeSize;if(a!=s){if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){for(var c=0,l=Math.min(a.text.length,s.text.length);c<l&&a.text[a.text.length-c-1]==s.text[s.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(a.content.size||s.content.size){var h=Ft(a.content,s.content,n-1,r-1);if(h)return h}n-=u,r-=u}else n-=u,r-=u}}Bt.prototype={constructor:Bt,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return-1==e?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return-1==i?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new Bt(o)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new Bt(n)},addToStart:function(t,e){return new Bt([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Bt(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(-1==o?i.length:o,0,e,n),new Bt(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=Bt.from(t)).size?new Bt(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=Bt.from(t)).size?new Bt(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Bt.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach((function(e,n){t[e]=n})),t},get size(){return this.content.length>>1}},Bt.from=function(t){if(t instanceof Bt)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Bt(e)};var qt=function(){function t(e,n){if(C(this,t),this.content=e,this.size=n||0,null==n)for(var r=0;r<e.length;r++)this.size+=e[r].nodeSize}return E(t,[{key:"nodesBetween",value:function(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4?arguments[4]:void 0,o=0,a=0;a<e;o++){var s=this.content[o],u=a+s.nodeSize;if(u>t&&!1!==n(s,r+a,i||null,o)&&s.content.size){var c=a+1;s.nodesBetween(Math.max(0,t-c),Math.min(s.content.size,e-c),n,r+c)}a=u}}},{key:"descendants",value:function(t){this.nodesBetween(0,this.size,t)}},{key:"textBetween",value:function(t,e,n,r){var i="",o=!0;return this.nodesBetween(t,e,(function(a,s){a.isText?(i+=a.text.slice(Math.max(t,s)-s,e-s),o=!n):a.isLeaf?(r?i+="function"==typeof r?r(a):r:a.type.spec.leafText&&(i+=a.type.spec.leafText(a)),o=!n):!o&&a.isBlock&&(i+=n,o=!0)}),0),i}},{key:"append",value:function(e){if(!e.size)return this;if(!this.size)return e;var n=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new t(i,this.size+e.size)}},{key:"cut",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size;if(0==e&&n==this.size)return this;var r=[],i=0;if(n>e)for(var o=0,a=0;a<n;o++){var s=this.content[o],u=a+s.nodeSize;u>e&&((a<e||u>n)&&(s=s.isText?s.cut(Math.max(0,e-a),Math.min(s.text.length,n-a)):s.cut(Math.max(0,e-a-1),Math.min(s.content.size,n-a-1))),r.push(s),i+=s.nodeSize),a=u}return new t(r,i)}},{key:"cutByIndex",value:function(e,n){return e==n?t.empty:0==e&&n==this.content.length?this:new t(this.content.slice(e,n))}},{key:"replaceChild",value:function(e,n){var r=this.content[e];if(r==n)return this;var i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new t(i,o)}},{key:"addToStart",value:function(e){return new t([e].concat(this.content),this.size+e.nodeSize)}},{key:"addToEnd",value:function(e){return new t(this.content.concat(e),this.size+e.nodeSize)}},{key:"eq",value:function(t){if(this.content.length!=t.content.length)return!1;for(var e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}},{key:"firstChild",get:function(){return this.content.length?this.content[0]:null}},{key:"lastChild",get:function(){return this.content.length?this.content[this.content.length-1]:null}},{key:"childCount",get:function(){return this.content.length}},{key:"child",value:function(t){var e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}},{key:"maybeChild",value:function(t){return this.content[t]||null}},{key:"forEach",value:function(t){for(var e=0,n=0;e<this.content.length;e++){var r=this.content[e];t(r,n,e),n+=r.nodeSize}}},{key:"findDiffStart",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return jt(this,t,e)}},{key:"findDiffEnd",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.size;return Ft(this,t,e,n)}},{key:"findIndex",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==t)return Vt(0,t);if(t==this.size)return Vt(this.content.length,t);if(t>this.size||t<0)throw new RangeError("Position ".concat(t," outside of fragment (").concat(this,")"));for(var n=0,r=0;;n++){var i=this.child(n),o=r+i.nodeSize;if(o>=t)return o==t||e>0?Vt(n+1,o):Vt(n,r);r=o}}},{key:"toString",value:function(){return"<"+this.toStringInner()+">"}},{key:"toStringInner",value:function(){return this.content.join(", ")}},{key:"toJSON",value:function(){return this.content.length?this.content.map((function(t){return t.toJSON()})):null}}],[{key:"fromJSON",value:function(e,n){if(!n)return t.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new t(n.map(e.nodeFromJSON))}},{key:"fromArray",value:function(e){if(!e.length)return t.empty;for(var n,r=0,i=0;i<e.length;i++){var o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new t(n||e,r)}},{key:"from",value:function(e){if(!e)return t.empty;if(e instanceof t)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new t([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}]),t}();qt.empty=new qt([],0);var $t={index:0,offset:0};function Vt(t,e){return $t.index=t,$t.offset=e,$t}function Ut(t,e){if(t===e)return!0;if(!t||"object"!=D(t)||!e||"object"!=D(e))return!1;var n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(var r=0;r<t.length;r++)if(!Ut(t[r],e[r]))return!1}else{for(var i in t)if(!(i in e)||!Ut(t[i],e[i]))return!1;for(var o in e)if(!(o in t))return!1}return!0}var Ht=function(){function t(e,n){C(this,t),this.type=e,this.attrs=n}return E(t,[{key:"addToSet",value:function(t){for(var e,n=!1,r=0;r<t.length;r++){var i=t[r];if(this.eq(i))return t;if(this.type.excludes(i.type))e||(e=t.slice(0,r));else{if(i.type.excludes(this.type))return t;!n&&i.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=t.slice()),n||e.push(this),e}},{key:"removeFromSet",value:function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}},{key:"isInSet",value:function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}},{key:"eq",value:function(t){return this==t||this.type==t.type&&Ut(this.attrs,t.attrs)}},{key:"toJSON",value:function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return t}}],[{key:"fromJSON",value:function(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");var n=t.marks[e.type];if(!n)throw new RangeError("There is no mark type ".concat(e.type," in this schema"));return n.create(e.attrs)}},{key:"sameSet",value:function(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0}},{key:"setFrom",value:function(e){if(!e||Array.isArray(e)&&0==e.length)return t.none;if(e instanceof t)return[e];var n=e.slice();return n.sort((function(t,e){return t.type.rank-e.type.rank})),n}}]),t}();Ht.none=[];var Wt=function(t){v(n,t);var e=m(n);function n(){return C(this,n),e.apply(this,arguments)}return n}(b(Error)),Zt=function(){function t(e,n,r){C(this,t),this.content=e,this.openStart=n,this.openEnd=r}return E(t,[{key:"size",get:function(){return this.content.size-this.openStart-this.openEnd}},{key:"insertAt",value:function(e,n){var r=Yt(this.content,e+this.openStart,n);return r&&new t(r,this.openStart,this.openEnd)}},{key:"removeBetween",value:function(e,n){return new t(Jt(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}},{key:"eq",value:function(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}},{key:"toString",value:function(){return this.content+"("+this.openStart+","+this.openEnd+")"}},{key:"toJSON",value:function(){if(!this.content.size)return null;var t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}}],[{key:"fromJSON",value:function(e,n){if(!n)return t.empty;var r=n.openStart||0,i=n.openEnd||0;if("number"!=typeof r||"number"!=typeof i)throw new RangeError("Invalid input for Slice.fromJSON");return new t(qt.fromJSON(e,n.content),r,i)}},{key:"maxOpen",value:function(e){for(var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=0,i=0,o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(var a=e.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)i++;return new t(e,r,i)}}]),t}();function Jt(t,e,n){var r=t.findIndex(e),i=r.index,o=r.offset,a=t.maybeChild(i),s=t.findIndex(n),u=s.index,c=s.offset;if(o==e||a.isText){if(c!=n&&!t.child(u).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(i!=u)throw new RangeError("Removing non-flat range");return t.replaceChild(i,a.copy(Jt(a.content,e-o-1,n-o-1)))}function Yt(t,e,n,r){var i=t.findIndex(e),o=i.index,a=i.offset,s=t.maybeChild(o);if(a==e||s.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));var u=Yt(s.content,e-a-1,n);return u&&t.replaceChild(o,s.copy(u))}function Kt(t,e,n){if(n.openStart>t.depth)throw new Wt("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Wt("Inconsistent open depths");return Gt(t,e,n,0)}function Gt(t,e,n,r){var i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){var a=Gt(t,e,n,r+1);return o.copy(o.content.replaceChild(i,a))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=r||e.depth!=r){var s=function(t,e){for(var n=e.depth-t.openStart,r=e.node(n).copy(t.content),i=n-1;i>=0;i--)r=e.node(i).copy(qt.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return ne(o,re(t,s.start,s.end,e,r))}var u=t.parent,c=u.content;return ne(u,c.cut(0,t.parentOffset).append(n.content).append(c.cut(e.parentOffset)))}return ne(o,ie(t,e,r))}function Xt(t,e){if(!e.type.compatibleContent(t.type))throw new Wt("Cannot join "+e.type.name+" onto "+t.type.name)}function Qt(t,e,n){var r=t.node(n);return Xt(r,e.node(n)),r}function te(t,e){var n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function ee(t,e,n,r){var i=(e||t).node(n),o=0,a=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(te(t.nodeAfter,r),o++));for(var s=o;s<a;s++)te(i.child(s),r);e&&e.depth==n&&e.textOffset&&te(e.nodeBefore,r)}function ne(t,e){return t.type.checkContent(e),t.copy(e)}function re(t,e,n,r,i){var o=t.depth>i&&Qt(t,e,i+1),a=r.depth>i&&Qt(n,r,i+1),s=[];return ee(null,t,i,s),o&&a&&e.index(i)==n.index(i)?(Xt(o,a),te(ne(o,re(t,e,n,r,i+1)),s)):(o&&te(ne(o,ie(t,e,i+1)),s),ee(e,n,i,s),a&&te(ne(a,ie(n,r,i+1)),s)),ee(r,null,i,s),new qt(s)}function ie(t,e,n){var r=[];(ee(null,t,n,r),t.depth>n)&&te(ne(Qt(t,e,n+1),ie(t,e,n+1)),r);return ee(e,null,n,r),new qt(r)}Zt.empty=new Zt(qt.empty,0,0);var oe=function(){function t(e,n,r){C(this,t),this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}return E(t,[{key:"resolveDepth",value:function(t){return null==t?this.depth:t<0?this.depth+t:t}},{key:"parent",get:function(){return this.node(this.depth)}},{key:"doc",get:function(){return this.node(0)}},{key:"node",value:function(t){return this.path[3*this.resolveDepth(t)]}},{key:"index",value:function(t){return this.path[3*this.resolveDepth(t)+1]}},{key:"indexAfter",value:function(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}},{key:"start",value:function(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1}},{key:"end",value:function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}},{key:"before",value:function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]}},{key:"after",value:function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize}},{key:"textOffset",get:function(){return this.pos-this.path[this.path.length-1]}},{key:"nodeAfter",get:function(){var t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r}},{key:"nodeBefore",get:function(){var t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)}},{key:"posAtIndex",value:function(t,e){e=this.resolveDepth(e);for(var n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1,i=0;i<t;i++)r+=n.child(i).nodeSize;return r}},{key:"marks",value:function(){var t=this.parent,e=this.index();if(0==t.content.size)return Ht.none;if(this.textOffset)return t.child(e).marks;var n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){var i=n;n=r,r=i}for(var o=n.marks,a=0;a<o.length;a++)!1===o[a].type.spec.inclusive&&(!r||!o[a].isInSet(r.marks))&&(o=o[a--].removeFromSet(o));return o}},{key:"marksAcross",value:function(t){var e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;for(var n=e.marks,r=t.parent.maybeChild(t.index()),i=0;i<n.length;i++)!1===n[i].type.spec.inclusive&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}},{key:"sharedDepth",value:function(t){for(var e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}},{key:"blockRange",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this,e=arguments.length>1?arguments[1]:void 0;if(t.pos<this.pos)return t.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new ce(this,t,n);return null}},{key:"sameParent",value:function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}},{key:"max",value:function(t){return t.pos>this.pos?t:this}},{key:"min",value:function(t){return t.pos<this.pos?t:this}},{key:"toString",value:function(){for(var t="",e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}}],[{key:"resolve",value:function(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");for(var r=[],i=0,o=n,a=e;;){var s=a.content.findIndex(o),u=s.index,c=s.offset,l=o-c;if(r.push(a,u,i+c),!l||(a=a.child(u)).isText)break;o=l-1,i+=c+1}return new t(n,r,o)}},{key:"resolveCached",value:function(e,n){for(var r=0;r<ae.length;r++){var i=ae[r];if(i.pos==n&&i.doc==e)return i}var o=ae[se]=t.resolve(e,n);return se=(se+1)%ue,o}}]),t}(),ae=[],se=0,ue=12,ce=function(){function t(e,n,r){C(this,t),this.$from=e,this.$to=n,this.depth=r}return E(t,[{key:"start",get:function(){return this.$from.before(this.depth+1)}},{key:"end",get:function(){return this.$to.after(this.depth+1)}},{key:"parent",get:function(){return this.$from.node(this.depth)}},{key:"startIndex",get:function(){return this.$from.index(this.depth)}},{key:"endIndex",get:function(){return this.$to.indexAfter(this.depth)}}]),t}(),le=Object.create(null),he=function(){function t(e,n,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Ht.none;C(this,t),this.type=e,this.attrs=n,this.marks=i,this.content=r||qt.empty}return E(t,[{key:"nodeSize",get:function(){return this.isLeaf?1:2+this.content.size}},{key:"childCount",get:function(){return this.content.childCount}},{key:"child",value:function(t){return this.content.child(t)}},{key:"maybeChild",value:function(t){return this.content.maybeChild(t)}},{key:"forEach",value:function(t){this.content.forEach(t)}},{key:"nodesBetween",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.content.nodesBetween(t,e,n,r,this)}},{key:"descendants",value:function(t){this.nodesBetween(0,this.content.size,t)}},{key:"textContent",get:function(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}},{key:"textBetween",value:function(t,e,n,r){return this.content.textBetween(t,e,n,r)}},{key:"firstChild",get:function(){return this.content.firstChild}},{key:"lastChild",get:function(){return this.content.lastChild}},{key:"eq",value:function(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}},{key:"sameMarkup",value:function(t){return this.hasMarkup(t.type,t.attrs,t.marks)}},{key:"hasMarkup",value:function(t,e,n){return this.type==t&&Ut(this.attrs,e||t.defaultAttrs||le)&&Ht.sameSet(this.marks,n||Ht.none)}},{key:"copy",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return e==this.content?this:new t(this.type,this.attrs,e,this.marks)}},{key:"mark",value:function(e){return e==this.marks?this:new t(this.type,this.attrs,this.content,e)}},{key:"cut",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size;return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))}},{key:"slice",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t==e)return Zt.empty;var r=this.resolve(t),i=this.resolve(e),o=n?0:r.sharedDepth(e),a=r.start(o),s=r.node(o).content.cut(r.pos-a,i.pos-a);return new Zt(s,r.depth-o,i.depth-o)}},{key:"replace",value:function(t,e,n){return Kt(this.resolve(t),this.resolve(e),n)}},{key:"nodeAt",value:function(t){for(var e=this;;){var n=e.content.findIndex(t),r=n.index,i=n.offset;if(!(e=e.maybeChild(r)))return null;if(i==t||e.isText)return e;t-=i+1}}},{key:"childAfter",value:function(t){var e=this.content.findIndex(t),n=e.index,r=e.offset;return{node:this.content.maybeChild(n),index:n,offset:r}}},{key:"childBefore",value:function(t){if(0==t)return{node:null,index:0,offset:0};var e=this.content.findIndex(t),n=e.index,r=e.offset;if(r<t)return{node:this.content.child(n),index:n,offset:r};var i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}},{key:"resolve",value:function(t){return oe.resolveCached(this,t)}},{key:"resolveNoCache",value:function(t){return oe.resolve(this,t)}},{key:"rangeHasMark",value:function(t,e,n){var r=!1;return e>t&&this.nodesBetween(t,e,(function(t){return n.isInSet(t.marks)&&(r=!0),!r})),r}},{key:"isBlock",get:function(){return this.type.isBlock}},{key:"isTextblock",get:function(){return this.type.isTextblock}},{key:"inlineContent",get:function(){return this.type.inlineContent}},{key:"isInline",get:function(){return this.type.isInline}},{key:"isText",get:function(){return this.type.isText}},{key:"isLeaf",get:function(){return this.type.isLeaf}},{key:"isAtom",get:function(){return this.type.isAtom}},{key:"toString",value:function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),de(this.marks,t)}},{key:"contentMatchAt",value:function(t){var e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}},{key:"canReplace",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:qt.empty,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:n.childCount,o=this.contentMatchAt(t).matchFragment(n,r,i),a=o&&o.matchFragment(this.content,e);if(!a||!a.validEnd)return!1;for(var s=r;s<i;s++)if(!this.type.allowsMarks(n.child(s).marks))return!1;return!0}},{key:"canReplaceWith",value:function(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;var i=this.contentMatchAt(t).matchType(n),o=i&&i.matchFragment(this.content,e);return!!o&&o.validEnd}},{key:"canAppend",value:function(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}},{key:"check",value:function(){this.type.checkContent(this.content);for(var t=Ht.none,e=0;e<this.marks.length;e++)t=this.marks[e].addToSet(t);if(!Ht.sameSet(t,this.marks))throw new RangeError("Invalid collection of marks for node ".concat(this.type.name,": ").concat(this.marks.map((function(t){return t.type.name}))));this.content.forEach((function(t){return t.check()}))}},{key:"toJSON",value:function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map((function(t){return t.toJSON()}))),t}}],[{key:"fromJSON",value:function(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}var r=qt.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)}}]),t}();he.prototype.text=void 0;var fe=function(t){v(n,t);var e=m(n);function n(t,r,i,o){var a;if(C(this,n),a=e.call(this,t,r,null,o),!i)throw new RangeError("Empty text nodes are not allowed");return a.text=i,g(a)}return E(n,[{key:"toString",value:function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):de(this.marks,JSON.stringify(this.text))}},{key:"textContent",get:function(){return this.text}},{key:"textBetween",value:function(t,e){return this.text.slice(t,e)}},{key:"nodeSize",get:function(){return this.text.length}},{key:"mark",value:function(t){return t==this.marks?this:new n(this.type,this.attrs,this.text,t)}},{key:"withText",value:function(t){return t==this.text?this:new n(this.type,this.attrs,t,this.marks)}},{key:"cut",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.text.length;return 0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))}},{key:"eq",value:function(t){return this.sameMarkup(t)&&this.text==t.text}},{key:"toJSON",value:function(){var t=p(k(n.prototype),"toJSON",this).call(this);return t.text=this.text,t}}]),n}(he);function de(t,e){for(var n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var pe=function(){function t(e){C(this,t),this.validEnd=e,this.next=[],this.wrapCache=[]}return E(t,[{key:"matchType",value:function(t){for(var e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}},{key:"matchFragment",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.childCount,r=this,i=e;r&&i<n;i++)r=r.matchType(t.child(i).type);return r}},{key:"inlineContent",get:function(){return 0!=this.next.length&&this.next[0].type.isInline}},{key:"defaultType",get:function(){for(var t=0;t<this.next.length;t++){var e=this.next[t].type;if(!e.isText&&!e.hasRequiredAttrs())return e}return null}},{key:"compatible",value:function(t){for(var e=0;e<this.next.length;e++)for(var n=0;n<t.next.length;n++)if(this.next[e].type==t.next[n].type)return!0;return!1}},{key:"fillBefore",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=[this];function i(o,a){var s=o.matchFragment(t,n);if(s&&(!e||s.validEnd))return qt.from(a.map((function(t){return t.createAndFill()})));for(var u=0;u<o.next.length;u++){var c=o.next[u],l=c.type,h=c.next;if(!l.isText&&!l.hasRequiredAttrs()&&-1==r.indexOf(h)){r.push(h);var f=i(h,a.concat(l));if(f)return f}}return null}return i(this,[])}},{key:"findWrapping",value:function(t){for(var e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];var n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}},{key:"computeWrapping",value:function(t){for(var e=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var r=n.shift(),i=r.match;if(i.matchType(t)){for(var o=[],a=r;a.type;a=a.via)o.push(a.type);return o.reverse()}for(var s=0;s<i.next.length;s++){var u=i.next[s],c=u.type,l=u.next;!c.isLeaf&&!c.hasRequiredAttrs()&&!(c.name in e)&&(!r.type||l.validEnd)&&(n.push({match:c.contentMatch,type:c,via:r}),e[c.name]=!0)}}return null}},{key:"edgeCount",get:function(){return this.next.length}},{key:"edge",value:function(t){if(t>=this.next.length)throw new RangeError("There's no ".concat(t,"th edge in this content match"));return this.next[t]}},{key:"toString",value:function(){var t=[];return function e(n){t.push(n);for(var r=0;r<n.next.length;r++)-1==t.indexOf(n.next[r].next)&&e(n.next[r].next)}(this),t.map((function(e,n){for(var r=n+(e.validEnd?"*":" ")+" ",i=0;i<e.next.length;i++)r+=(i?", ":"")+e.next[i].type.name+"->"+t.indexOf(e.next[i].next);return r})).join("\n")}}],[{key:"parse",value:function(e,n){var r=new ve(e,n);if(null==r.next)return t.empty;var i=me(r);r.next&&r.err("Unexpected trailing text");var o=ke(function(t){var e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){var i={term:r,to:n};return e[t].push(i),i}function i(t,e){t.forEach((function(t){return t.to=e}))}function o(t,e){if("choice"==t.type)return t.exprs.reduce((function(t,n){return t.concat(o(n,e))}),[]);if("seq"!=t.type){if("star"==t.type){var a=n();return r(e,a),i(o(t.expr,a),a),[r(a)]}if("plus"==t.type){var s=n();return i(o(t.expr,e),s),i(o(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(e)].concat(o(t.expr,e));if("range"==t.type){for(var u=e,c=0;c<t.min;c++){var l=n();i(o(t.expr,u),l),u=l}if(-1==t.max)i(o(t.expr,u),u);else for(var h=t.min;h<t.max;h++){var f=n();r(u,f),i(o(t.expr,u),f),u=f}return[r(u)]}if("name"==t.type)return[r(e,void 0,t.value)];throw new Error("Unknown expr type")}for(var d=0;;d++){var p=o(t.exprs[d],e);if(d==t.exprs.length-1)return p;i(p,e=n())}}}(i));return function(t,e){for(var n=0,r=[t];n<r.length;n++){for(var i=r[n],o=!i.validEnd,a=[],s=0;s<i.next.length;s++){var u=i.next[s],c=u.type,l=u.next;a.push(c.name),o&&!(c.isText||c.hasRequiredAttrs())&&(o=!1),-1==r.indexOf(l)&&r.push(l)}o&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,r),o}}]),t}();pe.empty=new pe(!0);var ve=function(){function t(e,n){C(this,t),this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}return E(t,[{key:"next",get:function(){return this.tokens[this.pos]}},{key:"eat",value:function(t){return this.next==t&&(this.pos++||!0)}},{key:"err",value:function(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}]),t}();function me(t){var e=[];do{e.push(ge(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function ge(t){var e=[];do{e.push(ye(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function ye(t){for(var e=function(t){if(t.eat("(")){var e=me(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){var n=function(t,e){var n=t.nodeTypes,r=n[e];if(r)return[r];var i=[];for(var o in n){var a=n[o];a.groups.indexOf(e)>-1&&i.push(a)}return 0==i.length&&t.err("No node type or group '"+e+"' found"),i}(t,t.next).map((function(e){return null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}}));return t.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}t.err("Unexpected token '"+t.next+"'")}(t);;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=we(t,e)}return e}function be(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");var e=Number(t.next);return t.pos++,e}function we(t,e){var n=be(t),r=n;return t.eat(",")&&(r="}"!=t.next?be(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function _e(t,e){return e-t}function xe(t,e){var n=[];return function e(r){var i=t[r];if(1==i.length&&!i[0].term)return e(i[0].to);n.push(r);for(var o=0;o<i.length;o++){var a=i[o],s=a.term,u=a.to;!s&&-1==n.indexOf(u)&&e(u)}}(e),n.sort(_e)}function ke(t){var e=Object.create(null);return function n(r){var i=[];r.forEach((function(e){t[e].forEach((function(e){var n=e.term,r=e.to;if(n){for(var o,a=0;a<i.length;a++)i[a][0]==n&&(o=i[a][1]);xe(t,r).forEach((function(t){o||i.push([n,o=[]]),-1==o.indexOf(t)&&o.push(t)}))}}))}));for(var o=e[r.join(",")]=new pe(r.indexOf(t.length-1)>-1),a=0;a<i.length;a++){var s=i[a][1].sort(_e);o.next.push({type:i[a][0],next:e[s.join(",")]||n(s)})}return o}(xe(t,0))}function Se(t){var e=Object.create(null);for(var n in t){var r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function Ce(t,e){var n=Object.create(null);for(var r in t){var i=e&&e[r];if(void 0===i){var o=t[r];if(!o.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=o.default}n[r]=i}return n}function Me(t){var e=Object.create(null);if(t)for(var n in t)e[n]=new Te(t[n]);return e}var Ee=function(){function t(e,n,r){C(this,t),this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Me(r.attrs),this.defaultAttrs=Se(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||"text"==e),this.isText="text"==e}return E(t,[{key:"isInline",get:function(){return!this.isBlock}},{key:"isTextblock",get:function(){return this.isBlock&&this.inlineContent}},{key:"isLeaf",get:function(){return this.contentMatch==pe.empty}},{key:"isAtom",get:function(){return this.isLeaf||!!this.spec.atom}},{key:"whitespace",get:function(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}},{key:"hasRequiredAttrs",value:function(){for(var t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}},{key:"compatibleContent",value:function(t){return this==t||this.contentMatch.compatible(t.contentMatch)}},{key:"computeAttrs",value:function(t){return!t&&this.defaultAttrs?this.defaultAttrs:Ce(this.attrs,t)}},{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new he(this,this.computeAttrs(t),qt.from(e),Ht.setFrom(n))}},{key:"createChecked",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;return e=qt.from(e),this.checkContent(e),new he(this,this.computeAttrs(t),e,Ht.setFrom(n))}},{key:"createAndFill",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(t=this.computeAttrs(t),(e=qt.from(e)).size){var r=this.contentMatch.fillBefore(e);if(!r)return null;e=r.append(e)}var i=this.contentMatch.matchFragment(e),o=i&&i.fillBefore(qt.empty,!0);return o?new he(this,t,e.append(o),Ht.setFrom(n)):null}},{key:"validContent",value:function(t){var e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(var n=0;n<t.childCount;n++)if(!this.allowsMarks(t.child(n).marks))return!1;return!0}},{key:"checkContent",value:function(t){if(!this.validContent(t))throw new RangeError("Invalid content for node ".concat(this.name,": ").concat(t.toString().slice(0,50)))}},{key:"allowsMarkType",value:function(t){return null==this.markSet||this.markSet.indexOf(t)>-1}},{key:"allowsMarks",value:function(t){if(null==this.markSet)return!0;for(var e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}},{key:"allowedMarks",value:function(t){if(null==this.markSet)return t;for(var e,n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:Ht.none:t}}],[{key:"compile",value:function(e,n){var r=Object.create(null);e.forEach((function(e,i){return r[e]=new t(e,n,i)}));var i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(var o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}}]),t}(),Te=function(){function t(e){C(this,t),this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}return E(t,[{key:"isRequired",get:function(){return!this.hasDefault}}]),t}(),Ae=function(){function t(e,n,r,i){C(this,t),this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=Me(i.attrs),this.excluded=null;var o=Se(this.attrs);this.instance=o?new Ht(this,o):null}return E(t,[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return!t&&this.instance?this.instance:new Ht(this,Ce(this.attrs,t))}},{key:"removeFromSet",value:function(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}},{key:"isInSet",value:function(t){for(var e=0;e<t.length;e++)if(t[e].type==this)return t[e]}},{key:"excludes",value:function(t){return this.excluded.indexOf(t)>-1}}],[{key:"compile",value:function(e,n){var r=Object.create(null),i=0;return e.forEach((function(e,o){return r[e]=new t(e,i++,n,o)})),r}}]),t}(),Oe=function(){function t(e){C(this,t),this.cached=Object.create(null);var n=this.spec={};for(var r in e)n[r]=e[r];n.nodes=Bt.from(e.nodes),n.marks=Bt.from(e.marks||{}),this.nodes=Ee.compile(this.spec.nodes,this),this.marks=Ae.compile(this.spec.marks,this);var i=Object.create(null);for(var o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");var a=this.nodes[o],s=a.spec.content||"",u=a.spec.marks;a.contentMatch=i[s]||(i[s]=pe.parse(s,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.markSet="_"==u?null:u?De(this,u.split(" ")):""!=u&&a.inlineContent?null:[]}for(var c in this.marks){var l=this.marks[c],h=l.spec.excludes;l.excluded=null==h?[l]:""==h?[]:De(this,h.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}return E(t,[{key:"node",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof Ee))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)}},{key:"text",value:function(t,e){var n=this.nodes.text;return new fe(n,n.defaultAttrs,t,Ht.setFrom(e))}},{key:"mark",value:function(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)}},{key:"nodeFromJSON",value:function(t){return he.fromJSON(this,t)}},{key:"markFromJSON",value:function(t){return Ht.fromJSON(this,t)}},{key:"nodeType",value:function(t){var e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e}}]),t}();function De(t,e){for(var n=[],r=0;r<e.length;r++){var i=e[r],o=t.marks[i],a=o;if(o)n.push(o);else for(var s in t.marks){var u=t.marks[s];("_"==i||u.spec.group&&u.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=u)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}var Pe=function(){function t(e,n){var r=this;C(this,t),this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach((function(t){t.tag?r.tags.push(t):t.style&&r.styles.push(t)})),this.normalizeLists=!this.tags.some((function(t){if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;var n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}return E(t,[{key:"parse",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new Be(this,e,!1);return n.addAll(t,e.from,e.to),n.finish()}},{key:"parseSlice",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new Be(this,e,!0);return n.addAll(t,e.from,e.to),Zt.maxOpen(n.finish())}},{key:"matchTag",value:function(t,e,n){for(var r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){var i=this.tags[r];if(je(t,i.tag)&&(void 0===i.namespace||t.namespaceURI==i.namespace)&&(!i.context||e.matchesContext(i.context))){if(i.getAttrs){var o=i.getAttrs(t);if(!1===o)continue;i.attrs=o||void 0}return i}}}},{key:"matchStyle",value:function(t,e,n,r){for(var i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){var o=this.styles[i],a=o.style;if(!(0!=a.indexOf(t)||o.context&&!n.matchesContext(o.context)||a.length>t.length&&(61!=a.charCodeAt(t.length)||a.slice(t.length+1)!=e))){if(o.getAttrs){var s=o.getAttrs(e);if(!1===s)continue;o.attrs=s||void 0}return o}}}}],[{key:"schemaRules",value:function(t){var e=[];function n(t){for(var n=null==t.priority?50:t.priority,r=0;r<e.length;r++){var i=e[r];if((null==i.priority?50:i.priority)<n)break}e.splice(r,0,t)}var r=function(e){var r=t.marks[e].spec.parseDOM;r&&r.forEach((function(t){n(t=Fe(t)),t.mark||t.ignore||t.clearMark||(t.mark=e)}))};for(var i in t.marks)r(i);var o=function(e){var r=t.nodes[e].spec.parseDOM;r&&r.forEach((function(t){n(t=Fe(t)),t.node||t.ignore||t.mark||(t.node=e)}))};for(var a in t.nodes)o(a);return e}},{key:"fromSchema",value:function(e){return e.cached.domParser||(e.cached.domParser=new t(e,t.schemaRules(e)))}}]),t}(),Le={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Ne={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Re={ol:!0,ul:!0};function Ie(t,e,n){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&n}var ze=function(){function t(e,n,r,i,o,a,s){C(this,t),this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=s,this.content=[],this.activeMarks=Ht.none,this.stashMarks=[],this.match=a||(4&s?null:e.contentMatch)}return E(t,[{key:"findWrapping",value:function(t){if(!this.match){if(!this.type)return[];var e=this.type.contentMatch.fillBefore(qt.from(t));if(!e){var n,r=this.type.contentMatch;return(n=r.findWrapping(t.type))?(this.match=r,n):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}},{key:"finish",value:function(t){if(!(1&this.options)){var e,n=this.content[this.content.length-1];if(n&&n.isText&&(e=/[ \t\r\n\u000c]+$/.exec(n.text))){var r=n;n.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=r.withText(r.text.slice(0,r.text.length-e[0].length))}}var i=qt.from(this.content);return!t&&this.match&&(i=i.append(this.match.fillBefore(qt.empty,!0))),this.type?this.type.create(this.attrs,i,this.marks):i}},{key:"popFromStashMark",value:function(t){for(var e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]}},{key:"applyPending",value:function(t){for(var e=0,n=this.pendingMarks;e<n.length;e++){var r=n[e];(this.type?this.type.allowsMarkType(r.type):qe(r.type,t))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}},{key:"inlineContext",value:function(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!Le.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}]),t}(),Be=function(){function t(e,n,r){C(this,t),this.parser=e,this.options=n,this.isOpen=r,this.open=0;var i,o=n.topNode,a=Ie(null,n.preserveWhitespace,0)|(r?4:0);i=o?new ze(o.type,o.attrs,Ht.none,Ht.none,!0,n.topMatch||o.type.contentMatch,a):new ze(r?null:e.schema.topNodeType,null,Ht.none,Ht.none,!0,null,a),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}return E(t,[{key:"top",get:function(){return this.nodes[this.open]}},{key:"addDOM",value:function(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){var e=t.getAttribute("style");if(e){var n=this.readStyles(function(t){for(var e,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];e=n.exec(t);)r.push(e[1],e[2].trim());return r}(e));if(!n)return;for(var r=d(n,2),i=r[0],o=r[1],a=this.top,s=0;s<o.length;s++)this.removePendingMark(o[s],a);for(var u=0;u<i.length;u++)this.addPendingMark(i[u]);this.addElement(t);for(var c=0;c<i.length;c++)this.removePendingMark(i[c],a);for(var l=0;l<o.length;l++)this.addPendingMark(o[l])}else this.addElement(t)}}},{key:"addTextNode",value:function(t){var e=t.nodeValue,n=this.top;if(2&n.options||n.inlineContext(t)||/[^ \t\r\n\u000c]/.test(e)){if(1&n.options)e=2&n.options?e.replace(/\r\n?/g,"\n"):e.replace(/\r?\n|\r/g," ");else if(e=e.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(e)&&this.open==this.nodes.length-1){var r=n.content[n.content.length-1],i=t.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e)),this.findInText(t)}else this.findInside(t)}},{key:"addElement",value:function(t,e){var n,r=t.nodeName.toLowerCase();Re.hasOwnProperty(r)&&this.parser.normalizeLists&&function(t){for(var e=t.firstChild,n=null;e;e=e.nextSibling){var r=1==e.nodeType?e.nodeName.toLowerCase():null;r&&Re.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):"li"==r?n=e:r&&(n=null)}}(t);var i=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(n=this.parser.matchTag(t,this,e));if(i?i.ignore:Ne.hasOwnProperty(r))this.findInside(t),this.ignoreFallback(t);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(t=i.skip);var o,a=this.top,s=this.needsBlock;if(Le.hasOwnProperty(r))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),o=!0,a.type||(this.needsBlock=!0);else if(!t.firstChild)return void this.leafFallback(t);this.addAll(t),o&&this.sync(a),this.needsBlock=s}else this.addElementByRule(t,i,!1===i.consuming?n:void 0)}},{key:"leafFallback",value:function(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"))}},{key:"ignoreFallback",value:function(t){"BR"==t.nodeName&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}},{key:"readStyles",value:function(t){var e=this,n=Ht.none,r=Ht.none;t:for(var i=0;i<t.length;i+=2)for(var o=function(o){var s=e.parser.matchStyle(t[i],t[i+1],e,o);return s?s.ignore?(a=o,{v:null}):(s.clearMark?e.top.pendingMarks.forEach((function(t){s.clearMark(t)&&(r=t.addToSet(r))})):n=e.parser.schema.marks[s.mark].create(s.attrs).addToSet(n),!1!==s.consuming?(a=o,"break"):void(a=o=s)):(a=o,"continue|e")},a=void 0;;){var s=o(a);if("continue|e"===s)continue t;if("break"===s)break;if("object"===D(s))return s.v}return[n,r]}},{key:"addElementByRule",value:function(t,e,n){var r,i,o,a=this;e.node?(i=this.parser.schema.nodes[e.node]).isLeaf?this.insertNode(i.create(e.attrs))||this.leafFallback(t):r=this.enter(i,e.attrs||null,e.preserveWhitespace):(o=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(o));var s=this.top;if(i&&i.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((function(t){return a.insertNode(t)}));else{var u=t;"string"==typeof e.contentElement?u=t.querySelector(e.contentElement):"function"==typeof e.contentElement?u=e.contentElement(t):e.contentElement&&(u=e.contentElement),this.findAround(t,u,!0),this.addAll(u)}r&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}},{key:"addAll",value:function(t,e,n){for(var r=e||0,i=e?t.childNodes[e]:t.firstChild,o=null==n?null:t.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(t,r),this.addDOM(i);this.findAtPoint(t,r)}},{key:"findPlace",value:function(t){for(var e,n,r=this.open;r>=0;r--){var i=this.nodes[r],o=i.findWrapping(t);if(o&&(!e||e.length>o.length)&&(e=o,n=i,!o.length)||i.solid)break}if(!e)return!1;this.sync(n);for(var a=0;a<e.length;a++)this.enterInner(e[a],null,!1);return!0}},{key:"insertNode",value:function(t){if(t.isInline&&this.needsBlock&&!this.top.type){var e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(t)){this.closeExtra();var n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));for(var r=n.activeMarks,i=0;i<t.marks.length;i++)(!n.type||n.type.allowsMarkType(t.marks[i].type))&&(r=t.marks[i].addToSet(r));return n.content.push(t.mark(r)),!0}return!1}},{key:"enter",value:function(t,e,n){var r=this.findPlace(t.create(e));return r&&this.enterInner(t,e,!0,n),r}},{key:"enterInner",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;this.closeExtra();var i=this.top;i.applyPending(t),i.match=i.match&&i.match.matchType(t);var o=Ie(t,r,i.options);4&i.options&&0==i.content.length&&(o|=4),this.nodes.push(new ze(t,e,i.activeMarks,i.pendingMarks,n,null,o)),this.open++}},{key:"closeExtra",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}},{key:"finish",value:function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}},{key:"sync",value:function(t){for(var e=this.open;e>=0;e--)if(this.nodes[e]==t)return this.open=e,!0;return!1}},{key:"currentPos",get:function(){this.closeExtra();for(var t=0,e=this.open;e>=0;e--){for(var n=this.nodes[e].content,r=n.length-1;r>=0;r--)t+=n[r].nodeSize;e&&t++}return t}},{key:"findAtPoint",value:function(t,e){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)}},{key:"findInside",value:function(t){if(this.find)for(var e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}},{key:"findAround",value:function(t,e,n){if(t!=e&&this.find)for(var r=0;r<this.find.length;r++)null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node)&&e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}},{key:"findInText",value:function(t){if(this.find)for(var e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}},{key:"matchesContext",value:function(t){var e=this;if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1);return function t(a,s){for(;a>=0;a--){var u=n[a];if(""==u){if(a==n.length-1||0==a)continue;for(;s>=o;s--)if(t(a-1,s))return!0;return!1}var c=s>0||0==s&&i?e.nodes[s].type:r&&s>=o?r.node(s-o).type:null;if(!c||c.name!=u&&-1==c.groups.indexOf(u))return!1;s--}return!0}(n.length-1,this.open)}},{key:"textblockFromContext",value:function(){var t=this.options.context;if(t)for(var e=t.depth;e>=0;e--){var n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var i=this.parser.schema.nodes[r];if(i.isTextblock&&i.defaultAttrs)return i}}},{key:"addPendingMark",value:function(t){var e=function(t,e){for(var n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)}},{key:"removePendingMark",value:function(t,e){for(var n=this.open;n>=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);var i=r.popFromStashMark(t);i&&r.type&&r.type.allowsMarkType(i.type)&&(r.activeMarks=i.addToSet(r.activeMarks))}if(r==e)break}}}]),t}();function je(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Fe(t){var e={};for(var n in t)e[n]=t[n];return e}function qe(t,e){var n=e.schema.nodes,r=function(r){var i=n[r];if(!i.allowsMarkType(t))return"continue";var o=[];return function t(n){o.push(n);for(var r=0;r<n.edgeCount;r++){var i=n.edge(r),a=i.type,s=i.next;if(a==e||o.indexOf(s)<0&&t(s))return!0}}(i.contentMatch)?{v:!0}:void 0};for(var i in n){var o=r(i);if("continue"!==o&&"object"===D(o))return o.v}}var $e=function(){function t(e,n){C(this,t),this.nodes=e,this.marks=n}return E(t,[{key:"serializeFragment",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;r||(r=Ue(n).createDocumentFragment());var i=r,o=[];return t.forEach((function(t){if(o.length||t.marks.length){for(var r=0,a=0;r<o.length&&a<t.marks.length;){var s=t.marks[a];if(e.marks[s.type.name]){if(!s.eq(o[r][0])||!1===s.type.spec.spanning)break;r++,a++}else a++}for(;r<o.length;)i=o.pop()[1];for(;a<t.marks.length;){var u=t.marks[a++],c=e.serializeMark(u,t.isInline,n);c&&(o.push([u,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(e.serializeNodeInner(t,n))})),r}},{key:"serializeNodeInner",value:function(e,n){var r=t.renderSpec(Ue(n),this.nodes[e.type.name](e)),i=r.dom,o=r.contentDOM;if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return i}},{key:"serializeNode",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.serializeNodeInner(t,e),r=t.marks.length-1;r>=0;r--){var i=this.serializeMark(t.marks[r],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}},{key:"serializeMark",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.marks[e.type.name];return i&&t.renderSpec(Ue(r),i(e,n))}}],[{key:"renderSpec",value:function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("string"==typeof n)return{dom:e.createTextNode(n)};if(null!=n.nodeType)return{dom:n};if(n.dom&&null!=n.dom.nodeType)return n;var i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));var a,s=r?e.createElementNS(r,i):e.createElement(i),u=n[1],c=1;if(u&&"object"==D(u)&&null==u.nodeType&&!Array.isArray(u))for(var l in c=2,u)if(null!=u[l]){var h=l.indexOf(" ");h>0?s.setAttributeNS(l.slice(0,h),l.slice(h+1),u[l]):s.setAttribute(l,u[l])}for(var f=c;f<n.length;f++){var d=n[f];if(0===d){if(f<n.length-1||f>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}var p=t.renderSpec(e,d,r),v=p.dom,m=p.contentDOM;if(s.appendChild(v),m){if(a)throw new RangeError("Multiple content holes");a=m}}return{dom:s,contentDOM:a}}},{key:"fromSchema",value:function(e){return e.cached.domSerializer||(e.cached.domSerializer=new t(this.nodesFromSchema(e),this.marksFromSchema(e)))}},{key:"nodesFromSchema",value:function(t){var e=Ve(t.nodes);return e.text||(e.text=function(t){return t.text}),e}},{key:"marksFromSchema",value:function(t){return Ve(t.marks)}}]),t}();function Ve(t){var e={};for(var n in t){var r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Ue(t){return t.document||window.document}var He=Math.pow(2,16);function We(t,e){return t+e*He}function Ze(t){return 65535&t}var Je=function(){function t(e,n,r){C(this,t),this.pos=e,this.delInfo=n,this.recover=r}return E(t,[{key:"deleted",get:function(){return(8&this.delInfo)>0}},{key:"deletedBefore",get:function(){return(5&this.delInfo)>0}},{key:"deletedAfter",get:function(){return(6&this.delInfo)>0}},{key:"deletedAcross",get:function(){return(4&this.delInfo)>0}}]),t}(),Ye=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(C(this,t),this.ranges=e,this.inverted=n,!e.length&&t.empty)return t.empty}return E(t,[{key:"recover",value:function(t){var e=0,n=Ze(t);if(!this.inverted)for(var r=0;r<n;r++)e+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+e+function(t){return(t-(65535&t))/He}(t)}},{key:"mapResult",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(t,e,!1)}},{key:"map",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(t,e,!0)}},{key:"_map",value:function(t,e,n){for(var r=0,i=this.inverted?2:1,o=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var s=this.ranges[a]-(this.inverted?r:0);if(s>t)break;var u=this.ranges[a+i],c=this.ranges[a+o],l=s+u;if(t<=l){var h=s+r+((u?t==s?-1:t==l?1:e:e)<0?0:c);if(n)return h;var f=t==(e<0?s:l)?null:We(a/3,t-s),d=t==s?2:t==l?1:4;return(e<0?t!=s:t!=l)&&(d|=8),new Je(h,d,f)}r+=c-u}return n?t+r:new Je(t+r,0,null)}},{key:"touches",value:function(t,e){for(var n=0,r=Ze(e),i=this.inverted?2:1,o=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var s=this.ranges[a]-(this.inverted?n:0);if(s>t)break;var u=this.ranges[a+i];if(t<=s+u&&a==3*r)return!0;n+=this.ranges[a+o]-u}return!1}},{key:"forEach",value:function(t){for(var e=this.inverted?2:1,n=this.inverted?1:2,r=0,i=0;r<this.ranges.length;r+=3){var o=this.ranges[r],a=o-(this.inverted?i:0),s=o+(this.inverted?0:i),u=this.ranges[r+e],c=this.ranges[r+n];t(a,a+u,s,s+c),i+=c-u}}},{key:"invert",value:function(){return new t(this.ranges,!this.inverted)}},{key:"toString",value:function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}}],[{key:"offset",value:function(e){return 0==e?t.empty:new t(e<0?[0,-e,0]:[0,0,e])}}]),t}();Ye.empty=new Ye([]);var Ke=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.length;C(this,t),this.maps=e,this.mirror=n,this.from=r,this.to=i}return E(t,[{key:"slice",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.maps.length;return new t(this.maps,this.mirror,e,n)}},{key:"copy",value:function(){return new t(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}},{key:"appendMap",value:function(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)}},{key:"appendMapping",value:function(t){for(var e=0,n=this.maps.length;e<t.maps.length;e++){var r=t.getMirror(e);this.appendMap(t.maps[e],null!=r&&r<e?n+r:void 0)}}},{key:"getMirror",value:function(t){if(this.mirror)for(var e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}},{key:"setMirror",value:function(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}},{key:"appendMappingInverted",value:function(t){for(var e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=0;e--){var r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:void 0)}}},{key:"invert",value:function(){var e=new t;return e.appendMappingInverted(this),e}},{key:"map",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this.mirror)return this._map(t,e,!0);for(var n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t}},{key:"mapResult",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(t,e,!1)}},{key:"_map",value:function(t,e,n){for(var r=0,i=this.from;i<this.to;i++){var o=this.maps[i].mapResult(t,e);if(null!=o.recover){var a=this.getMirror(i);if(null!=a&&a>i&&a<this.to){i=a,t=this.maps[a].recover(o.recover);continue}}r|=o.delInfo,t=o.pos}return n?t:new Je(t,r,null)}}]),t}(),Ge=Object.create(null),Xe=function(){function t(){C(this,t)}return E(t,[{key:"getMap",value:function(){return Ye.empty}},{key:"merge",value:function(t){return null}}],[{key:"fromJSON",value:function(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=Ge[e.stepType];if(!n)throw new RangeError("No step type ".concat(e.stepType," defined"));return n.fromJSON(t,e)}},{key:"jsonID",value:function(t,e){if(t in Ge)throw new RangeError("Duplicate use of step JSON ID "+t);return Ge[t]=e,e.prototype.jsonID=t,e}}]),t}(),Qe=function(){function t(e,n){C(this,t),this.doc=e,this.failed=n}return E(t,null,[{key:"ok",value:function(e){return new t(e,null)}},{key:"fail",value:function(e){return new t(null,e)}},{key:"fromReplace",value:function(e,n,r,i){try{return t.ok(e.replace(n,r,i))}catch(o){if(o instanceof Wt)return t.fail(o.message);throw o}}}]),t}();function tn(t,e,n){for(var r=[],i=0;i<t.childCount;i++){var o=t.child(i);o.content.size&&(o=o.copy(tn(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return qt.fromArray(r)}var en=function(t){v(n,t);var e=m(n);function n(t,r,i){var o;return C(this,n),(o=e.call(this)).from=t,o.to=r,o.mark=i,o}return E(n,[{key:"apply",value:function(t){var e=this,n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new Zt(tn(n.content,(function(t,n){return t.isAtom&&n.type.allowsMarkType(e.mark.type)?t.mark(e.mark.addToSet(t.marks)):t}),i),n.openStart,n.openEnd);return Qe.fromReplace(t,this.from,this.to,o)}},{key:"invert",value:function(){return new nn(this.from,this.to,this.mark)}},{key:"map",value:function(t){var e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new n(e.pos,r.pos,this.mark)}},{key:"merge",value:function(t){return t instanceof n&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new n(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}},{key:"toJSON",value:function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new n(e.from,e.to,t.markFromJSON(e.mark))}}]),n}(Xe);Xe.jsonID("addMark",en);var nn=function(t){v(n,t);var e=m(n);function n(t,r,i){var o;return C(this,n),(o=e.call(this)).from=t,o.to=r,o.mark=i,o}return E(n,[{key:"apply",value:function(t){var e=this,n=t.slice(this.from,this.to),r=new Zt(tn(n.content,(function(t){return t.mark(e.mark.removeFromSet(t.marks))}),t),n.openStart,n.openEnd);return Qe.fromReplace(t,this.from,this.to,r)}},{key:"invert",value:function(){return new en(this.from,this.to,this.mark)}},{key:"map",value:function(t){var e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new n(e.pos,r.pos,this.mark)}},{key:"merge",value:function(t){return t instanceof n&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new n(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}},{key:"toJSON",value:function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new n(e.from,e.to,t.markFromJSON(e.mark))}}]),n}(Xe);Xe.jsonID("removeMark",nn);var rn=function(t){v(n,t);var e=m(n);function n(t,r){var i;return C(this,n),(i=e.call(this)).pos=t,i.mark=r,i}return E(n,[{key:"apply",value:function(t){var e=t.nodeAt(this.pos);if(!e)return Qe.fail("No node at mark step's position");var n=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return Qe.fromReplace(t,this.pos,this.pos+1,new Zt(qt.from(n),0,e.isLeaf?0:1))}},{key:"invert",value:function(t){var e=t.nodeAt(this.pos);if(e){var r=this.mark.addToSet(e.marks);if(r.length==e.marks.length){for(var i=0;i<e.marks.length;i++)if(!e.marks[i].isInSet(r))return new n(this.pos,e.marks[i]);return new n(this.pos,this.mark)}}return new on(this.pos,this.mark)}},{key:"map",value:function(t){var e=t.mapResult(this.pos,1);return e.deletedAfter?null:new n(e.pos,this.mark)}},{key:"toJSON",value:function(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new n(e.pos,t.markFromJSON(e.mark))}}]),n}(Xe);Xe.jsonID("addNodeMark",rn);var on=function(t){v(n,t);var e=m(n);function n(t,r){var i;return C(this,n),(i=e.call(this)).pos=t,i.mark=r,i}return E(n,[{key:"apply",value:function(t){var e=t.nodeAt(this.pos);if(!e)return Qe.fail("No node at mark step's position");var n=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return Qe.fromReplace(t,this.pos,this.pos+1,new Zt(qt.from(n),0,e.isLeaf?0:1))}},{key:"invert",value:function(t){var e=t.nodeAt(this.pos);return e&&this.mark.isInSet(e.marks)?new rn(this.pos,this.mark):this}},{key:"map",value:function(t){var e=t.mapResult(this.pos,1);return e.deletedAfter?null:new n(e.pos,this.mark)}},{key:"toJSON",value:function(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new n(e.pos,t.markFromJSON(e.mark))}}]),n}(Xe);Xe.jsonID("removeNodeMark",on);var an=function(t){v(n,t);var e=m(n);function n(t,r,i){var o,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return C(this,n),(o=e.call(this)).from=t,o.to=r,o.slice=i,o.structure=a,o}return E(n,[{key:"apply",value:function(t){return this.structure&&un(t,this.from,this.to)?Qe.fail("Structure replace would overwrite content"):Qe.fromReplace(t,this.from,this.to,this.slice)}},{key:"getMap",value:function(){return new Ye([this.from,this.to-this.from,this.slice.size])}},{key:"invert",value:function(t){return new n(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}},{key:"map",value:function(t){var e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deletedAcross&&r.deletedAcross?null:new n(e.pos,Math.max(e.pos,r.pos),this.slice)}},{key:"merge",value:function(t){if(!(t instanceof n)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;var e=this.slice.size+t.slice.size==0?Zt.empty:new Zt(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new n(t.from,this.to,e,this.structure)}var r=this.slice.size+t.slice.size==0?Zt.empty:new Zt(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new n(this.from,this.to+(t.to-t.from),r,this.structure)}},{key:"toJSON",value:function(){var t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new n(e.from,e.to,Zt.fromJSON(t,e.slice),!!e.structure)}}]),n}(Xe);Xe.jsonID("replace",an);var sn=function(t){v(n,t);var e=m(n);function n(t,r,i,o,a,s){var u,c=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return C(this,n),(u=e.call(this)).from=t,u.to=r,u.gapFrom=i,u.gapTo=o,u.slice=a,u.insert=s,u.structure=c,u}return E(n,[{key:"apply",value:function(t){if(this.structure&&(un(t,this.from,this.gapFrom)||un(t,this.gapTo,this.to)))return Qe.fail("Structure gap-replace would overwrite content");var e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return Qe.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,e.content);return n?Qe.fromReplace(t,this.from,this.to,n):Qe.fail("Content does not fit in gap")}},{key:"getMap",value:function(){return new Ye([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}},{key:"invert",value:function(t){var e=this.gapTo-this.gapFrom;return new n(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}},{key:"map",value:function(t){var e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return e.deletedAcross&&r.deletedAcross||i<e.pos||o>r.pos?null:new n(e.pos,r.pos,i,o,this.slice,this.insert,this.structure)}},{key:"toJSON",value:function(){var t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new n(e.from,e.to,e.gapFrom,e.gapTo,Zt.fromJSON(t,e.slice),e.insert,!!e.structure)}}]),n}(Xe);function un(t,e,n){for(var r=t.resolve(e),i=n-e,o=r.depth;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0)for(var a=r.node(o).maybeChild(r.indexAfter(o));i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}return!1}function cn(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function ln(t){for(var e=t.parent.content.cutByIndex(t.startIndex,t.endIndex),n=t.depth;;--n){var r=t.$from.node(n),i=t.$from.index(n),o=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(i,o,e))return n;if(0==n||r.type.spec.isolating||!cn(r,i,o))break}return null}function hn(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t,i=dn(t,e),o=i&&pn(r,e);return o?i.map(fn).concat({type:e,attrs:n}).concat(o.map(fn)):null}function fn(t){return{type:t,attrs:null}}function dn(t,e){var n=t.parent,r=t.startIndex,i=t.endIndex,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;var a=o.length?o[0]:e;return n.canReplaceWith(r,i,a)?o:null}function pn(t,e){var n=t.parent,r=t.startIndex,i=t.endIndex,o=n.child(r),a=e.contentMatch.findWrapping(o.type);if(!a)return null;for(var s=(a.length?a[a.length-1]:e).contentMatch,u=r;s&&u<i;u++)s=s.matchType(n.child(u).type);return s&&s.validEnd?a:null}function vn(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var o=t.steps.length;t.doc.nodesBetween(e,n,(function(e,n){if(e.isTextblock&&!e.hasMarkup(r,i)&&function(t,e,n){var r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(t.doc,t.mapping.slice(o).map(n),r)){t.clearIncompatible(t.mapping.slice(o).map(n,1),r);var a=t.mapping.slice(o),s=a.map(n,1),u=a.map(n+e.nodeSize,1);return t.step(new sn(s,u,s+1,u-1,new Zt(qt.from(r.create(i,null,e.marks)),0,0),1,!0)),!1}}))}function mn(t,e,n,r,i){var o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);var a=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,a);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new sn(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new Zt(qt.from(a),0,0),1,!0))}function gn(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,i=t.resolve(e),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(var s=i.depth-1,u=n-2;s>o;s--,u--){var c=i.node(s),l=i.index(s);if(c.type.spec.isolating)return!1;var h=c.content.cutByIndex(l,c.childCount),f=r&&r[u]||c;if(f!=c&&(h=h.replaceChild(0,f.type.create(f.attrs))),!c.canReplace(l+1,c.childCount)||!f.type.validContent(h))return!1}var d=i.indexAfter(o),p=r&&r[0];return i.node(o).canReplaceWith(d,d,p?p.type:i.node(o+1).type)}function yn(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,i=t.doc.resolve(e),o=qt.empty,a=qt.empty,s=i.depth,u=i.depth-n,c=n-1;s>u;s--,c--){o=qt.from(i.node(s).copy(o));var l=r&&r[c];a=qt.from(l?l.type.create(l.attrs,a):i.node(s).copy(a))}t.step(new an(e,e,new Zt(o.append(a),n,n),!0))}function bn(t,e){var n=t.resolve(e),r=n.index();return function(t,e){return!(!t||!e||t.isLeaf||!t.canAppend(e))}(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function wn(t,e,n){var r=new an(e-n,e+n,Zt.empty,!0);t.step(r)}function _n(t,e,n){var r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(var i=r.depth-1;i>=0;i--){var o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(var a=r.depth-1;a>=0;a--){var s=r.indexAfter(a);if(r.node(a).canReplaceWith(s,s,n))return r.after(a+1);if(s<r.node(a).childCount)return null}return null}function xn(t,e,n){var r=t.resolve(e);if(!n.content.size)return e;for(var i=n.content,o=0;o<n.openStart;o++)i=i.firstChild.content;for(var a=1;a<=(0==n.openStart&&n.size?2:1);a++)for(var s=r.depth;s>=0;s--){var u=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,c=r.index(s)+(u>0?1:0),l=r.node(s),h=!1;if(1==a)h=l.canReplace(c,c,i);else{var f=l.contentMatchAt(c).findWrapping(i.firstChild.type);h=f&&l.canReplaceWith(c,c,f[0])}if(h)return 0==u?r.pos:u<0?r.before(s+1):r.after(s+1)}return null}function kn(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Zt.empty;if(e==n&&!r.size)return null;var i=t.resolve(e),o=t.resolve(n);return Sn(i,o,r)?new an(e,n,r):new Cn(i,o,r).fit()}function Sn(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}Xe.jsonID("replaceAround",sn);var Cn=function(){function t(e,n,r){C(this,t),this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=qt.empty;for(var i=0;i<=e.depth;i++){var o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(var a=e.depth;a>0;a--)this.placed=qt.from(e.node(a).copy(this.placed))}return E(t,[{key:"depth",get:function(){return this.frontier.length-1}},{key:"fit",value:function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;for(var o=this.placed,a=r.depth,s=i.depth;a&&s&&1==o.childCount;)o=o.firstChild.content,a--,s--;var u=new Zt(o,a,s);return e>-1?new sn(r.pos,e,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new an(r.pos,i.pos,u):null}},{key:"findFittable",value:function(){for(var t=this.unplaced.openStart,e=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<t;n++){var i=e.firstChild;if(e.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){t=n;break}e=i.content}for(var o=1;o<=2;o++)for(var a=1==o?t:this.unplaced.openStart;a>=0;a--){var s=void 0,u=null;a?s=(u=Tn(this.unplaced.content,a-1).firstChild).content:s=this.unplaced.content;for(var c=s.firstChild,l=this.depth;l>=0;l--){var h=this.frontier[l],f=h.type,d=h.match,p=void 0,v=null;if(1==o&&(c?d.matchType(c.type)||(v=d.fillBefore(qt.from(c),!1)):u&&f.compatibleContent(u.type)))return{sliceDepth:a,frontierDepth:l,parent:u,inject:v};if(2==o&&c&&(p=d.findWrapping(c.type)))return{sliceDepth:a,frontierDepth:l,parent:u,wrap:p};if(u&&d.matchType(u.type))break}}}},{key:"openMore",value:function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,i=Tn(e,n);return!(!i.childCount||i.firstChild.isLeaf)&&(this.unplaced=new Zt(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}},{key:"dropNode",value:function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,i=Tn(e,n);if(i.childCount<=1&&n>0){var o=e.size-n<=n+i.size;this.unplaced=new Zt(Mn(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new Zt(Mn(e,n,1),n,r)}},{key:"placeNodes",value:function(t){for(var e=t.sliceDepth,n=t.frontierDepth,r=t.parent,i=t.inject,o=t.wrap;this.depth>n;)this.closeFrontierNode();if(o)for(var a=0;a<o.length;a++)this.openFrontierNode(o[a]);var s=this.unplaced,u=r?r.content:s.content,c=s.openStart-e,l=0,h=[],f=this.frontier[n],d=f.match,p=f.type;if(i){for(var v=0;v<i.childCount;v++)h.push(i.child(v));d=d.matchFragment(i)}for(var m=u.size+e-(s.content.size-s.openEnd);l<u.childCount;){var g=u.child(l),y=d.matchType(g.type);if(!y)break;(++l>1||0==c||g.content.size)&&(d=y,h.push(An(g.mark(p.allowedMarks(g.marks)),1==l?c:0,l==u.childCount?m:-1)))}var b=l==u.childCount;b||(m=-1),this.placed=En(this.placed,n,qt.from(h)),this.frontier[n].match=d,b&&m<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var w=0,_=u;w<m;w++){var x=_.lastChild;this.frontier.push({type:x.type,match:x.contentMatchAt(x.childCount)}),_=x.content}this.unplaced=b?0==e?Zt.empty:new Zt(Mn(s.content,e-1,1),e-1,m<0?s.openEnd:e-1):new Zt(Mn(s.content,e,l),s.openStart,s.openEnd)}},{key:"mustMoveInline",value:function(){if(!this.$to.parent.isTextblock)return-1;var t,e=this.frontier[this.depth];if(!e.type.isTextblock||!On(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;for(var n=this.$to.depth,r=this.$to.after(n);n>1&&r==this.$to.end(--n);)++r;return r}},{key:"findCloseLevel",value:function(t){t:for(var e=Math.min(this.depth,t.depth);e>=0;e--){var n=this.frontier[e],r=n.match,i=n.type,o=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),a=On(t,e,i,r,o);if(a){for(var s=e-1;s>=0;s--){var u=this.frontier[s],c=u.match,l=On(t,s,u.type,c,!0);if(!l||l.childCount)continue t}return{depth:e,fit:a,move:o?t.doc.resolve(t.after(e+1)):t}}}}},{key:"close",value:function(t){var e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=En(this.placed,e.depth,e.fit)),t=e.move;for(var n=e.depth+1;n<=t.depth;n++){var r=t.node(n),i=r.type.contentMatch.fillBefore(r.content,!0,t.index(n));this.openFrontierNode(r.type,r.attrs,i)}return t}},{key:"openFrontierNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=En(this.placed,this.depth,qt.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})}},{key:"closeFrontierNode",value:function(){var t=this.frontier.pop().match.fillBefore(qt.empty,!0);t.childCount&&(this.placed=En(this.placed,this.frontier.length,t))}}]),t}();function Mn(t,e,n){return 0==e?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Mn(t.firstChild.content,e-1,n)))}function En(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(En(t.lastChild.content,e-1,n)))}function Tn(t,e){for(var n=0;n<e;n++)t=t.firstChild.content;return t}function An(t,e,n){if(e<=0)return t;var r=t.content;return e>1&&(r=r.replaceChild(0,An(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(qt.empty,!0)))),t.copy(r)}function On(t,e,n,r,i){var o=t.node(e),a=i?t.indexAfter(e):t.index(e);if(a==o.childCount&&!n.compatibleContent(o.type))return null;var s=r.fillBefore(o.content,!0,a);return s&&!function(t,e,n){for(var r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,o.content,a)?s:null}function Dn(t){return t.spec.defining||t.spec.definingForContent}function Pn(t,e,n,r,i){if(e<n){var o=t.firstChild;t=t.replaceChild(0,o.copy(Pn(o.content,e+1,n,r,o)))}if(e>r){var a=i.contentMatchAt(0),s=a.fillBefore(t).append(t);t=s.append(a.matchFragment(s).fillBefore(qt.empty,!0))}return t}function Ln(t,e){for(var n=[],r=Math.min(t.depth,e.depth);r>=0;r--){var i=t.start(r);if(i<t.pos-(t.depth-r)||e.end(r)>e.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(i==e.start(r)||r==t.depth&&r==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==i-1)&&n.push(r)}return n}var Nn=function(t){v(n,t);var e=m(n);function n(t,r,i){var o;return C(this,n),(o=e.call(this)).pos=t,o.attr=r,o.value=i,o}return E(n,[{key:"apply",value:function(t){var e=t.nodeAt(this.pos);if(!e)return Qe.fail("No node at attribute step's position");var n=Object.create(null);for(var r in e.attrs)n[r]=e.attrs[r];n[this.attr]=this.value;var i=e.type.create(n,null,e.marks);return Qe.fromReplace(t,this.pos,this.pos+1,new Zt(qt.from(i),0,e.isLeaf?0:1))}},{key:"getMap",value:function(){return Ye.empty}},{key:"invert",value:function(t){return new n(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}},{key:"map",value:function(t){var e=t.mapResult(this.pos,1);return e.deletedAfter?null:new n(e.pos,this.attr,this.value)}},{key:"toJSON",value:function(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new n(e.pos,e.attr,e.value)}}]),n}(Xe);Xe.jsonID("attr",Nn);var Rn=Error;((Rn=function t(e){var n=Error.call(this,e);return n.__proto__=t.prototype,n}).prototype=Object.create(Error.prototype)).constructor=Rn,Rn.prototype.name="TransformError";var In=function(){function t(e){C(this,t),this.doc=e,this.steps=[],this.docs=[],this.mapping=new Ke}return E(t,[{key:"before",get:function(){return this.docs.length?this.docs[0]:this.doc}},{key:"step",value:function(t){var e=this.maybeStep(t);if(e.failed)throw new Rn(e.failed);return this}},{key:"maybeStep",value:function(t){var e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}},{key:"docChanged",get:function(){return this.steps.length>0}},{key:"addStep",value:function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}},{key:"replace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Zt.empty,r=kn(this.doc,t,e,n);return r&&this.step(r),this}},{key:"replaceWith",value:function(t,e,n){return this.replace(t,e,new Zt(qt.from(n),0,0))}},{key:"delete",value:function(t,e){return this.replace(t,e,Zt.empty)}},{key:"insert",value:function(t,e){return this.replaceWith(t,t,e)}},{key:"replaceRange",value:function(t,e,n){return function(t,e,n,r){if(!r.size)return t.deleteRange(e,n);var i=t.doc.resolve(e),o=t.doc.resolve(n);if(Sn(i,o,r))return t.step(new an(e,n,r));var a=Ln(i,t.doc.resolve(n));0==a[a.length-1]&&a.pop();var s=-(i.depth+1);a.unshift(s);for(var u=i.depth,c=i.pos-1;u>0;u--,c--){var l=i.node(u).type.spec;if(l.defining||l.definingAsContext||l.isolating)break;a.indexOf(u)>-1?s=u:i.before(u)==c&&a.splice(1,0,-u)}for(var h=a.indexOf(s),f=[],d=r.openStart,p=r.content,v=0;;v++){var m=p.firstChild;if(f.push(m),v==r.openStart)break;p=m.content}for(var g=d-1;g>=0;g--){var y=f[g].type,b=Dn(y);if(b&&i.node(h).type!=y)d=g;else if(b||!y.isTextblock)break}for(var w=r.openStart;w>=0;w--){var _=(w+d+1)%(r.openStart+1),x=f[_];if(x)for(var k=0;k<a.length;k++){var S=a[(k+h)%a.length],C=!0;S<0&&(C=!1,S=-S);var M=i.node(S-1),E=i.index(S-1);if(M.canReplaceWith(E,E,x.type,x.marks))return t.replace(i.before(S),C?o.after(S):n,new Zt(Pn(r.content,0,r.openStart,_),_,r.openEnd))}}for(var T=t.steps.length,A=a.length-1;A>=0&&(t.replace(e,n,r),!(t.steps.length>T));A--){var O=a[A];O<0||(e=i.before(O),n=o.after(O))}}(this,t,e,n),this}},{key:"replaceRangeWith",value:function(t,e,n){return function(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){var i=_n(t.doc,e,r.type);null!=i&&(e=n=i)}t.replaceRange(e,n,new Zt(qt.from(r),0,0))}(this,t,e,n),this}},{key:"deleteRange",value:function(t,e){return function(t,e,n){for(var r=t.doc.resolve(e),i=t.doc.resolve(n),o=Ln(r,i),a=0;a<o.length;a++){var s=o[a],u=a==o.length-1;if(u&&0==s||r.node(s).type.contentMatch.validEnd)return t.delete(r.start(s),i.end(s));if(s>0&&(u||r.node(s-1).canReplace(r.index(s-1),i.indexAfter(s-1))))return t.delete(r.before(s),i.after(s))}for(var c=1;c<=r.depth&&c<=i.depth;c++)if(e-r.start(c)==r.depth-c&&n>r.end(c)&&i.end(c)-n!=i.depth-c)return t.delete(r.before(c),n);t.delete(e,n)}(this,t,e),this}},{key:"lift",value:function(t,e){return function(t,e,n){for(var r=e.$from,i=e.$to,o=e.depth,a=r.before(o+1),s=i.after(o+1),u=a,c=s,l=qt.empty,h=0,f=o,d=!1;f>n;f--)d||r.index(f)>0?(d=!0,l=qt.from(r.node(f).copy(l)),h++):u--;for(var p=qt.empty,v=0,m=o,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,p=qt.from(i.node(m).copy(p)),v++):c++;t.step(new sn(u,c,a,s,new Zt(l.append(p),h,v),l.size-h,!0))}(this,t,e),this}},{key:"join",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return wn(this,t,e),this}},{key:"wrap",value:function(t,e){return function(t,e,n){for(var r=qt.empty,i=n.length-1;i>=0;i--){if(r.size){var o=n[i].type.contentMatch.matchFragment(r);if(!o||!o.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=qt.from(n[i].type.create(n[i].attrs,r))}var a=e.start,s=e.end;t.step(new sn(a,s,a,s,new Zt(r,0,0),n.length,!0))}(this,t,e),this}},{key:"setBlockType",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return vn(this,t,e,n,r),this}},{key:"setNodeMarkup",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0;return mn(this,t,e,n,r),this}},{key:"setNodeAttribute",value:function(t,e,n){return this.step(new Nn(t,e,n)),this}},{key:"addNodeMark",value:function(t,e){return this.step(new rn(t,e)),this}},{key:"removeNodeMark",value:function(t,e){if(!(e instanceof Ht)){var n=this.doc.nodeAt(t);if(!n)throw new RangeError("No node at position "+t);if(!(e=e.isInSet(n.marks)))return this}return this.step(new on(t,e)),this}},{key:"split",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2?arguments[2]:void 0;return yn(this,t,e,n),this}},{key:"addMark",value:function(t,e,n){return function(t,e,n,r){var i,o,a=[],s=[];t.doc.nodesBetween(e,n,(function(t,u,c){if(t.isInline){var l=t.marks;if(!r.isInSet(l)&&c.type.allowsMarkType(r.type)){for(var h=Math.max(u,e),f=Math.min(u+t.nodeSize,n),d=r.addToSet(l),p=0;p<l.length;p++)l[p].isInSet(d)||(i&&i.to==h&&i.mark.eq(l[p])?i.to=f:a.push(i=new nn(h,f,l[p])));o&&o.to==h?o.to=f:s.push(o=new en(h,f,r))}}})),a.forEach((function(e){return t.step(e)})),s.forEach((function(e){return t.step(e)}))}(this,t,e,n),this}},{key:"removeMark",value:function(t,e,n){return function(t,e,n,r){var i=[],o=0;t.doc.nodesBetween(e,n,(function(t,a){if(t.isInline){o++;var s=null;if(r instanceof Ae)for(var u,c=t.marks;u=r.isInSet(c);)(s||(s=[])).push(u),c=u.removeFromSet(c);else r?r.isInSet(t.marks)&&(s=[r]):s=t.marks;if(s&&s.length)for(var l=Math.min(a+t.nodeSize,n),h=0;h<s.length;h++){for(var f=s[h],d=void 0,p=0;p<i.length;p++){var v=i[p];v.step==o-1&&f.eq(i[p].style)&&(d=v)}d?(d.to=l,d.step=o):i.push({style:f,from:Math.max(a,e),to:l,step:o})}}})),i.forEach((function(e){return t.step(new nn(e.from,e.to,e.style))}))}(this,t,e,n),this}},{key:"clearIncompatible",value:function(t,e,n){return function(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n.contentMatch,i=t.doc.nodeAt(e),o=[],a=e+1,s=0;s<i.childCount;s++){var u=i.child(s),c=a+u.nodeSize,l=r.matchType(u.type);if(l){r=l;for(var h=0;h<u.marks.length;h++)n.allowsMarkType(u.marks[h].type)||t.step(new nn(a,c,u.marks[h]))}else o.push(new an(a,c,Zt.empty));a=c}if(!r.validEnd){var f=r.fillBefore(qt.empty,!0);t.replace(a,a,new Zt(f,0,0))}for(var d=o.length-1;d>=0;d--)t.step(o[d])}(this,t,e,n),this}}]),t}(),zn=Object.create(null),Bn=function(){function t(e,n,r){C(this,t),this.$anchor=e,this.$head=n,this.ranges=r||[new jn(e.min(n),e.max(n))]}return E(t,[{key:"anchor",get:function(){return this.$anchor.pos}},{key:"head",get:function(){return this.$head.pos}},{key:"from",get:function(){return this.$from.pos}},{key:"to",get:function(){return this.$to.pos}},{key:"$from",get:function(){return this.ranges[0].$from}},{key:"$to",get:function(){return this.ranges[0].$to}},{key:"empty",get:function(){for(var t=this.ranges,e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}},{key:"content",value:function(){return this.$from.doc.slice(this.from,this.to,!0)}},{key:"replace",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zt.empty,n=e.content.lastChild,r=null,i=0;i<e.openEnd;i++)r=n,n=n.lastChild;for(var o=t.steps.length,a=this.ranges,s=0;s<a.length;s++){var u=a[s],c=u.$from,l=u.$to,h=t.mapping.slice(o);t.replaceRange(h.map(c.pos),h.map(l.pos),s?Zt.empty:e),0==s&&Yn(t,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}},{key:"replaceWith",value:function(t,e){for(var n=t.steps.length,r=this.ranges,i=0;i<r.length;i++){var o=r[i],a=o.$from,s=o.$to,u=t.mapping.slice(n),c=u.map(a.pos),l=u.map(s.pos);i?t.deleteRange(c,l):(t.replaceRangeWith(c,l,e),Yn(t,n,e.isInline?-1:1))}}},{key:"getBookmark",value:function(){return $n.between(this.$anchor,this.$head).getBookmark()}}],[{key:"findFrom",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t.parent.inlineContent?new $n(t):Jn(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(var i=t.depth-1;i>=0;i--){var o=e<0?Jn(t.node(0),t.node(i),t.before(i+1),t.index(i),e,n):Jn(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,e,n);if(o)return o}return null}},{key:"near",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.findFrom(t,e)||this.findFrom(t,-e)||new Wn(t.node(0))}},{key:"atStart",value:function(t){return Jn(t,t,0,0,1)||new Wn(t)}},{key:"atEnd",value:function(t){return Jn(t,t,t.content.size,t.childCount,-1)||new Wn(t)}},{key:"fromJSON",value:function(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=zn[e.type];if(!n)throw new RangeError("No selection type ".concat(e.type," defined"));return n.fromJSON(t,e)}},{key:"jsonID",value:function(t,e){if(t in zn)throw new RangeError("Duplicate use of selection JSON ID "+t);return zn[t]=e,e.prototype.jsonID=t,e}}]),t}();Bn.prototype.visible=!0;var jn=function t(e,n){C(this,t),this.$from=e,this.$to=n},Fn=!1;function qn(t){!Fn&&!t.parent.inlineContent&&(Fn=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}var $n=function(t){v(n,t);var e=m(n);function n(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;return C(this,n),qn(t),qn(r),e.call(this,t,r)}return E(n,[{key:"$cursor",get:function(){return this.$anchor.pos==this.$head.pos?this.$head:null}},{key:"map",value:function(t,e){var r=t.resolve(e.map(this.head));if(!r.parent.inlineContent)return Bn.near(r);var i=t.resolve(e.map(this.anchor));return new n(i.parent.inlineContent?i:r,r)}},{key:"replace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zt.empty;if(p(k(n.prototype),"replace",this).call(this,t,e),e==Zt.empty){var r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}},{key:"eq",value:function(t){return t instanceof n&&t.anchor==this.anchor&&t.head==this.head}},{key:"getBookmark",value:function(){return new Vn(this.anchor,this.head)}},{key:"toJSON",value:function(){return{type:"text",anchor:this.anchor,head:this.head}}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new n(t.resolve(e.anchor),t.resolve(e.head))}},{key:"create",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e,r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))}},{key:"between",value:function(t,e,r){var i=t.pos-e.pos;if((!r||i)&&(r=i>=0?1:-1),!e.parent.inlineContent){var o=Bn.findFrom(e,r,!0)||Bn.findFrom(e,-r,!0);if(!o)return Bn.near(e,r);e=o.$head}return t.parent.inlineContent||(0==i?t=e:(t=(Bn.findFrom(t,-r,!0)||Bn.findFrom(t,r,!0)).$anchor).pos<e.pos!=i<0&&(t=e)),new n(t,e)}}]),n}(Bn);Bn.jsonID("text",$n);var Vn=function(){function t(e,n){C(this,t),this.anchor=e,this.head=n}return E(t,[{key:"map",value:function(e){return new t(e.map(this.anchor),e.map(this.head))}},{key:"resolve",value:function(t){return $n.between(t.resolve(this.anchor),t.resolve(this.head))}}]),t}(),Un=function(t){v(n,t);var e=m(n);function n(t){var r;C(this,n);var i=t.nodeAfter,o=t.node(0).resolve(t.pos+i.nodeSize);return(r=e.call(this,t,o)).node=i,r}return E(n,[{key:"map",value:function(t,e){var r=e.mapResult(this.anchor),i=r.deleted,o=r.pos,a=t.resolve(o);return i?Bn.near(a):new n(a)}},{key:"content",value:function(){return new Zt(qt.from(this.node),0,0)}},{key:"eq",value:function(t){return t instanceof n&&t.anchor==this.anchor}},{key:"toJSON",value:function(){return{type:"node",anchor:this.anchor}}},{key:"getBookmark",value:function(){return new Hn(this.anchor)}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new n(t.resolve(e.anchor))}},{key:"create",value:function(t,e){return new n(t.resolve(e))}},{key:"isSelectable",value:function(t){return!t.isText&&!1!==t.type.spec.selectable}}]),n}(Bn);Un.prototype.visible=!1,Bn.jsonID("node",Un);var Hn=function(){function t(e){C(this,t),this.anchor=e}return E(t,[{key:"map",value:function(e){var n=e.mapResult(this.anchor),r=n.deleted,i=n.pos;return r?new Vn(i,i):new t(i)}},{key:"resolve",value:function(t){var e=t.resolve(this.anchor),n=e.nodeAfter;return n&&Un.isSelectable(n)?new Un(e):Bn.near(e)}}]),t}(),Wn=function(t){v(n,t);var e=m(n);function n(t){return C(this,n),e.call(this,t.resolve(0),t.resolve(t.content.size))}return E(n,[{key:"replace",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zt.empty;if(e==Zt.empty){t.delete(0,t.doc.content.size);var r=Bn.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else p(k(n.prototype),"replace",this).call(this,t,e)}},{key:"toJSON",value:function(){return{type:"all"}}},{key:"map",value:function(t){return new n(t)}},{key:"eq",value:function(t){return t instanceof n}},{key:"getBookmark",value:function(){return Zn}}],[{key:"fromJSON",value:function(t){return new n(t)}}]),n}(Bn);Bn.jsonID("all",Wn);var Zn={map:function(){return this},resolve:function(t){return new Wn(t)}};function Jn(t,e,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(e.inlineContent)return $n.create(t,n);for(var a=r-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){var s=e.child(a);if(s.isAtom){if(!o&&Un.isSelectable(s))return Un.create(t,n-(i<0?s.nodeSize:0))}else{var u=Jn(t,s,n+i,i<0?s.childCount:0,i,o);if(u)return u}n+=s.nodeSize*i}return null}function Yn(t,e,n){var r=t.steps.length-1;if(!(r<e)){var i,o=t.steps[r];if(o instanceof an||o instanceof sn)t.mapping.maps[r].forEach((function(t,e,n,r){null==i&&(i=r)})),t.setSelection(Bn.near(t.doc.resolve(i),n))}}var Kn=function(t){v(n,t);var e=m(n);function n(t){var r;return C(this,n),(r=e.call(this,t.doc)).curSelectionFor=0,r.updated=0,r.meta=Object.create(null),r.time=Date.now(),r.curSelection=t.selection,r.storedMarks=t.storedMarks,r}return E(n,[{key:"selection",get:function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}},{key:"setSelection",value:function(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this}},{key:"selectionSet",get:function(){return(1&this.updated)>0}},{key:"setStoredMarks",value:function(t){return this.storedMarks=t,this.updated|=2,this}},{key:"ensureMarks",value:function(t){return Ht.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}},{key:"addStoredMark",value:function(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}},{key:"removeStoredMark",value:function(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}},{key:"storedMarksSet",get:function(){return(2&this.updated)>0}},{key:"addStep",value:function(t,e){p(k(n.prototype),"addStep",this).call(this,t,e),this.updated=-3&this.updated,this.storedMarks=null}},{key:"setTime",value:function(t){return this.time=t,this}},{key:"replaceSelection",value:function(t){return this.selection.replace(this,t),this}},{key:"replaceSelectionWith",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.selection;return e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Ht.none))),n.replaceWith(this,t),this}},{key:"deleteSelection",value:function(){return this.selection.replace(this),this}},{key:"insertText",value:function(t,e,n){var r,i=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();if(null==n&&(n=e),n=null!==(r=n)&&void 0!==r?r:e,!t)return this.deleteRange(e,n);var o=this.storedMarks;if(!o){var a=this.doc.resolve(e);o=n==e?a.marks():a.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,i.text(t,o)),this.selection.empty||this.setSelection(Bn.near(this.selection.$to)),this}},{key:"setMeta",value:function(t,e){return this.meta["string"==typeof t?t:t.key]=e,this}},{key:"getMeta",value:function(t){return this.meta["string"==typeof t?t:t.key]}},{key:"isGeneric",get:function(){for(var t in this.meta)return!1;return!0}},{key:"scrollIntoView",value:function(){return this.updated|=4,this}},{key:"scrolledIntoView",get:function(){return(4&this.updated)>0}}]),n}(In);function Gn(t,e){return e&&t?t.bind(e):t}var Xn=function t(e,n,r){C(this,t),this.name=e,this.init=Gn(n.init,r),this.apply=Gn(n.apply,r)},Qn=[new Xn("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new Xn("selection",{init:function(t,e){return t.selection||Bn.atStart(e.doc)},apply:function(t){return t.selection}}),new Xn("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Xn("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],tr=function t(e,n){var r=this;C(this,t),this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Qn.slice(),n&&n.forEach((function(t){if(r.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");r.plugins.push(t),r.pluginsByKey[t.key]=t,t.spec.state&&r.fields.push(new Xn(t.key,t.spec.state,t))}))},er=function(){function t(e){C(this,t),this.config=e}return E(t,[{key:"schema",get:function(){return this.config.schema}},{key:"plugins",get:function(){return this.config.plugins}},{key:"apply",value:function(t){return this.applyTransaction(t).state}},{key:"filterTransaction",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=0;n<this.config.plugins.length;n++)if(n!=e){var r=this.config.plugins[n];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,t,this))return!1}return!0}},{key:"applyTransaction",value:function(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};for(var e=[t],n=this.applyInner(t),r=null;;){for(var i=!1,o=0;o<this.config.plugins.length;o++){var a=this.config.plugins[o];if(a.spec.appendTransaction){var s=r?r[o].n:0,u=r?r[o].state:this,c=s<e.length&&a.spec.appendTransaction.call(a,s?e.slice(s):e,u,n);if(c&&n.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",t),!r){r=[];for(var l=0;l<this.config.plugins.length;l++)r.push(l<o?{state:n,n:e.length}:{state:this,n:0})}e.push(c),n=n.applyInner(c),i=!0}r&&(r[o]={state:n,n:e.length})}}if(!i)return{state:n,transactions:e}}}},{key:"applyInner",value:function(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var n=new t(this.config),r=this.config.fields,i=0;i<r.length;i++){var o=r[i];n[o.name]=o.apply(e,this[o.name],this,n)}return n}},{key:"tr",get:function(){return new Kn(this)}},{key:"reconfigure",value:function(e){for(var n=new tr(this.schema,e.plugins),r=n.fields,i=new t(n),o=0;o<r.length;o++){var a=r[o].name;i[a]=this.hasOwnProperty(a)?this[a]:r[o].init(e,i)}return i}},{key:"toJSON",value:function(t){var e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map((function(t){return t.toJSON()}))),t&&"object"==D(t))for(var n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var r=t[n],i=r.spec.state;i&&i.toJSON&&(e[n]=i.toJSON.call(r,this[r.key]))}return e}}],[{key:"create",value:function(e){for(var n=new tr(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new t(n),i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}},{key:"fromJSON",value:function(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");var i=new tr(e.schema,e.plugins),o=new t(i);return i.fields.forEach((function(t){if("doc"==t.name)o.doc=he.fromJSON(e.schema,n.doc);else if("selection"==t.name)o.selection=Bn.fromJSON(o.doc,n.selection);else if("storedMarks"==t.name)n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(var i in r){var a=r[i],s=a.spec.state;if(a.key==t.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i))return void(o[t.name]=s.fromJSON.call(a,e,n[i],o))}o[t.name]=t.init(e,o)}})),o}}]),t}();function nr(t,e,n){for(var r in t){var i=t[r];i instanceof Function?i=i.bind(e):"handleDOMEvents"==r&&(i=nr(i,e,{})),n[r]=i}return n}var rr=function(){function t(e){C(this,t),this.spec=e,this.props={},e.props&&nr(e.props,this,this.props),this.key=e.key?e.key.key:or("plugin")}return E(t,[{key:"getState",value:function(t){return t[this.key]}}]),t}(),ir=Object.create(null);function or(t){return t in ir?t+"$"+ ++ir[t]:(ir[t]=0,t+"$")}var ar=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"key";C(this,t),this.key=or(e)}return E(t,[{key:"get",value:function(t){return t.config.pluginsByKey[this.key]}},{key:"getState",value:function(t){return t[this.key]}}]),t}(),sr=function(){function t(e,n){C(this,t),this.items=e,this.eventCount=n}return E(t,[{key:"popEvent",value:function(e,n){var r=this;if(0==this.eventCount)return null;for(var i,o,a=this.items.length;;a--)if(this.items.get(a-1).selection){--a;break}n&&(i=this.remapping(a,this.items.length),o=i.maps.length);var s,u,c=e.tr,l=[],h=[];return this.items.forEach((function(e,n){if(!e.step)return i||(i=r.remapping(a,n+1),o=i.maps.length),o--,void h.push(e);if(i){h.push(new ur(e.map));var f,d=e.step.map(i.slice(o));d&&c.maybeStep(d).doc&&(f=c.mapping.maps[c.mapping.maps.length-1],l.push(new ur(f,void 0,void 0,l.length+h.length))),o--,f&&i.appendMap(f,o)}else c.maybeStep(e.step);return e.selection?(s=i?e.selection.map(i.slice(o)):e.selection,u=new t(r.items.slice(0,a).append(h.reverse().concat(l)),r.eventCount-1),!1):void 0}),this.items.length,0),{remaining:u,transform:c,selection:s}}},{key:"addTransform",value:function(e,n,r,i){for(var o=[],a=this.eventCount,s=this.items,u=!i&&s.length?s.get(s.length-1):null,c=0;c<e.steps.length;c++){var l,h=e.steps[c].invert(e.docs[c]),f=new ur(e.mapping.maps[c],h,n);(l=u&&u.merge(f))&&(f=l,c?o.pop():s=s.slice(0,s.length-1)),o.push(f),n&&(a++,n=void 0),i||(u=f)}var d=a-r.depth;return d>lr&&(s=function(t,e){var n;return t.forEach((function(t,r){if(t.selection&&0==e--)return n=r,!1})),t.slice(n)}(s,d),a-=d),new t(s.append(o),a)}},{key:"remapping",value:function(t,e){var n=new Ke;return this.items.forEach((function(e,r){var i=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:void 0;n.appendMap(e.map,i)}),t,e),n}},{key:"addMaps",value:function(e){return 0==this.eventCount?this:new t(this.items.append(e.map((function(t){return new ur(t)}))),this.eventCount)}},{key:"rebased",value:function(e,n){if(!this.eventCount)return this;var r=[],i=Math.max(0,this.items.length-n),o=e.mapping,a=e.steps.length,s=this.eventCount;this.items.forEach((function(t){t.selection&&s--}),i);var u=n;this.items.forEach((function(t){var n=o.getMirror(--u);if(null!=n){a=Math.min(a,n);var i=o.maps[n];if(t.step){var c=e.steps[n].invert(e.docs[n]),l=t.selection&&t.selection.map(o.slice(u+1,n));l&&s++,r.push(new ur(i,c,l))}else r.push(new ur(i))}}),i);for(var c=[],l=n;l<a;l++)c.push(new ur(o.maps[l]));var h=new t(this.items.slice(0,i).append(c).append(r),s);return h.emptyItemCount()>500&&(h=h.compress(this.items.length-r.length)),h}},{key:"emptyItemCount",value:function(){var t=0;return this.items.forEach((function(e){e.step||t++})),t}},{key:"compress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.items.length,n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((function(t,a){if(a>=e)i.push(t),t.selection&&o++;else if(t.step){var s=t.step.map(n.slice(r)),u=s&&s.getMap();if(r--,u&&n.appendMap(u,r),s){var c=t.selection&&t.selection.map(n.slice(r));c&&o++;var l,h=new ur(u.invert(),s,c),f=i.length-1;(l=i.length&&i[f].merge(h))?i[f]=l:i.push(h)}}else t.map&&r--}),this.items.length,0),new t(zt.from(i.reverse()),o)}}]),t}();sr.empty=new sr(zt.empty,0);var ur=function(){function t(e,n,r,i){C(this,t),this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}return E(t,[{key:"merge",value:function(e){if(this.step&&e.step&&!e.selection){var n=e.step.merge(this.step);if(n)return new t(n.getMap().invert(),n,this.selection)}}}]),t}(),cr=function t(e,n,r,i){C(this,t),this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i},lr=20;function hr(t,e,n,r){var i,o=n.getMeta(yr);if(o)return o.historyState;n.getMeta(br)&&(t=new cr(t.done,t.undone,null,0));var a=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(a&&a.getMeta(yr))return a.getMeta(yr).redo?new cr(t.done.addTransform(n,void 0,r,gr(e)),t.undone,fr(n.mapping.maps[n.steps.length-1]),t.prevTime):new cr(t.done,t.undone.addTransform(n,void 0,r,gr(e)),null,t.prevTime);if(!1===n.getMeta("addToHistory")||a&&!1===a.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new cr(t.done.rebased(n,i),t.undone.rebased(n,i),dr(t.prevRanges,n.mapping),t.prevTime):new cr(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),dr(t.prevRanges,n.mapping),t.prevTime);var s=0==t.prevTime||!a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;var n=!1;return t.mapping.maps[0].forEach((function(t,r){for(var i=0;i<e.length;i+=2)t<=e[i+1]&&r>=e[i]&&(n=!0)})),n}(n,t.prevRanges)),u=a?dr(t.prevRanges,n.mapping):fr(n.mapping.maps[n.steps.length-1]);return new cr(t.done.addTransform(n,s?e.selection.getBookmark():void 0,r,gr(e)),sr.empty,u,n.time)}function fr(t){var e=[];return t.forEach((function(t,n,r,i){return e.push(r,i)})),e}function dr(t,e){if(!t)return null;for(var n=[],r=0;r<t.length;r+=2){var i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}function pr(t,e,n,r){var i=gr(e),o=yr.get(e).spec.config,a=(r?t.undone:t.done).popEvent(e,i);if(a){var s=a.selection.resolve(a.transform.doc),u=(r?t.done:t.undone).addTransform(a.transform,e.selection.getBookmark(),o,i),c=new cr(r?u:a.remaining,r?a.remaining:u,null,0);n(a.transform.setSelection(s).setMeta(yr,{redo:r,historyState:c}).scrollIntoView())}}var vr=!1,mr=null;function gr(t){var e=t.plugins;if(mr!=e){vr=!1,mr=e;for(var n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){vr=!0;break}}return vr}var yr=new ar("history"),br=new ar("closeHistory");function wr(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new rr({key:yr,state:{init:function(){return new cr(sr.empty,sr.empty,null,0)},apply:function(e,n,r){return hr(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput:function(t,e){var n=e.inputType,r="historyUndo"==n?_r:"historyRedo"==n?xr:null;return!!r&&(e.preventDefault(),r(t.state,t.dispatch))}}}})}for(var _r=function(t,e){var n=yr.getState(t);return!(!n||0==n.done.eventCount)&&(e&&pr(n,t,e,!1),!0)},xr=function(t,e){var n=yr.getState(t);return!(!n||0==n.undone.eventCount)&&(e&&pr(n,t,e,!0),!0)},kr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Sr={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Cr=("undefined"===typeof navigator?"undefined":D(navigator))<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),Mr=("undefined"===typeof navigator?"undefined":D(navigator))<"u"&&/Mac/.test(navigator.platform),Er=("undefined"===typeof navigator?"undefined":D(navigator))<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Tr=Mr||Cr&&+Cr[1]<57,Ar=0;Ar<10;Ar++)kr[48+Ar]=kr[96+Ar]=String(Ar);for(Ar=1;Ar<=24;Ar++)kr[Ar+111]="F"+Ar;for(Ar=65;Ar<=90;Ar++)kr[Ar]=String.fromCharCode(Ar+32),Sr[Ar]=String.fromCharCode(Ar);for(var Or in kr)Sr.hasOwnProperty(Or)||(Sr[Or]=kr[Or]);var Dr=("undefined"===typeof navigator?"undefined":D(navigator))<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Pr(t){var e,n,r,i,o=t.split(/-(?!$)/),a=o[o.length-1];"Space"==a&&(a=" ");for(var s=0;s<o.length-1;s++){var u=o[s];if(/^(cmd|meta|m)$/i.test(u))i=!0;else if(/^a(lt)?$/i.test(u))e=!0;else if(/^(c|ctrl|control)$/i.test(u))n=!0;else if(/^s(hift)?$/i.test(u))r=!0;else{if(!/^mod$/i.test(u))throw new Error("Unrecognized modifier name: "+u);Dr?i=!0:n=!0}}return e&&(a="Alt-"+a),n&&(a="Ctrl-"+a),i&&(a="Meta-"+a),r&&(a="Shift-"+a),a}function Lr(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function Nr(t){return new rr({props:{handleKeyDown:Rr(t)}})}function Rr(t){var e=function(t){var e=Object.create(null);for(var n in t)e[Pr(n)]=t[n];return e}(t);return function(t,n){var r,i=function(t){var e=!(Tr&&(t.ctrlKey||t.altKey||t.metaKey)||Er&&t.shiftKey&&t.key&&1==t.key.length||"Unidentified"==t.key)&&t.key||(t.shiftKey?Sr:kr)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(n),o=e[Lr(i,n)];if(o&&o(t.state,t.dispatch,t))return!0;if(1==i.length&&" "!=i){if(n.shiftKey){var a=e[Lr(i,n,!1)];if(a&&a(t.state,t.dispatch,t))return!0}if((n.shiftKey||n.altKey||n.metaKey||i.charCodeAt(0)>127)&&(r=kr[n.keyCode])&&r!=i){var s=e[Lr(r,n)];if(s&&s(t.state,t.dispatch,t))return!0}}return!1}}var Ir=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},zr=function(t){var e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e},Br=null,jr=function(t,e,n){var r=Br||(Br=document.createRange());return r.setEnd(t,null!==n&&void 0!==n?n:t.nodeValue.length),r.setStart(t,e||0),r},Fr=function(t,e,n,r){return n&&($r(t,e,n,r,-1)||$r(t,e,n,r,1))},qr=/^(img|br|input|textarea|hr)$/i;function $r(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Vr(t))){var o=t.parentNode;if(!o||1!=o.nodeType||Hr(t)||qr.test(t.nodeName)||"false"==t.contentEditable)return!1;e=Ir(t)+(i<0?0:1),t=o}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(i<0?-1:0)]).contentEditable)return!1;e=i<0?Vr(t):0}}}function Vr(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Ur(t,e,n){for(var r=0==e,i=e==Vr(t);r||i;){if(t==n)return!0;var o=Ir(t);if(!(t=t.parentNode))return!1;r=r&&0==o,i=i&&o==Vr(t)}}function Hr(t){for(var e,n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}var Wr=function(t){return t.focusNode&&Fr(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Zr(t,e){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}var Jr=("undefined"===typeof navigator?"undefined":D(navigator))<"u"?navigator:null,Yr=("undefined"===typeof document?"undefined":D(document))<"u"?document:null,Kr=Jr&&Jr.userAgent||"",Gr=/Edge\/(\d+)/.exec(Kr),Xr=/MSIE \d/.exec(Kr),Qr=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Kr),ti=!!(Xr||Qr||Gr),ei=Xr?document.documentMode:Qr?+Qr[1]:Gr?+Gr[1]:0,ni=!ti&&/gecko\/(\d+)/i.test(Kr);ni&&(/Firefox\/(\d+)/.exec(Kr)||[0,0])[1];var ri=!ti&&/Chrome\/(\d+)/.exec(Kr),ii=!!ri,oi=ri?+ri[1]:0,ai=!ti&&!!Jr&&/Apple Computer/.test(Jr.vendor),si=ai&&(/Mobile\/\w+/.test(Kr)||!!Jr&&Jr.maxTouchPoints>2),ui=si||!!Jr&&/Mac/.test(Jr.platform),ci=/Android \d/.test(Kr),li=!!Yr&&"webkitFontSmoothing"in Yr.documentElement.style,hi=li?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function fi(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function di(t,e){return"number"==typeof t?t:t[e]}function pi(t){var e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function vi(t,e,n){for(var r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument,a=n||t.dom;a;a=zr(a))if(1==a.nodeType){var s=a,u=s==o.body,c=u?fi(o):pi(s),l=0,h=0;if(e.top<c.top+di(r,"top")?h=-(c.top-e.top+di(i,"top")):e.bottom>c.bottom-di(r,"bottom")&&(h=e.bottom-c.bottom+di(i,"bottom")),e.left<c.left+di(r,"left")?l=-(c.left-e.left+di(i,"left")):e.right>c.right-di(r,"right")&&(l=e.right-c.right+di(i,"right")),l||h)if(u)o.defaultView.scrollBy(l,h);else{var f=s.scrollLeft,d=s.scrollTop;h&&(s.scrollTop+=h),l&&(s.scrollLeft+=l);var p=s.scrollLeft-f,v=s.scrollTop-d;e={left:e.left-p,top:e.top-v,right:e.right-p,bottom:e.bottom-v}}if(u)break}}function mi(t){for(var e=[],n=t.ownerDocument,r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=zr(r));return e}function gi(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=r.dom,o=r.top,a=r.left;i.scrollTop!=o+e&&(i.scrollTop=o+e),i.scrollLeft!=a&&(i.scrollLeft=a)}}var yi=null;function bi(t,e){for(var n,r,i=2e8,o=0,a=e.top,s=e.top,u=t.firstChild,c=0;u;u=u.nextSibling,c++){var l=void 0;if(1==u.nodeType)l=u.getClientRects();else{if(3!=u.nodeType)continue;l=jr(u).getClientRects()}for(var h=0;h<l.length;h++){var f=l[h];if(f.top<=a&&f.bottom>=s){a=Math.max(f.bottom,a),s=Math.min(f.top,s);var d=f.left>e.left?f.left-e.left:f.right<e.left?e.left-f.right:0;if(d<i){n=u,i=d,r=d&&3==n.nodeType?{left:f.right<e.left?f.right:f.left,top:e.top}:e,1==u.nodeType&&d&&(o=c+(e.left>=(f.left+f.right)/2?1:0));continue}}!n&&(e.left>=f.right&&e.top>=f.top||e.left>=f.left&&e.top>=f.bottom)&&(o=c+1)}}return n&&3==n.nodeType?function(t,e){for(var n=t.nodeValue.length,r=document.createRange(),i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);var o=ki(r,1);if(o.top!=o.bottom&&wi(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}(n,r):!n||i&&1==n.nodeType?{node:t,offset:o}:bi(n,r)}function wi(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function _i(t,e,n){var r=t.childNodes.length;if(r&&n.top<n.bottom)for(var i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){var a=t.childNodes[o];if(1==a.nodeType)for(var s=a.getClientRects(),u=0;u<s.length;u++){var c=s[u];if(wi(e,c))return _i(a,e,c)}if((o=(o+1)%r)==i)break}return t}function xi(t,e){var n,r=t.dom.ownerDocument,i=0;if(r.caretPositionFromPoint)try{var o,a=r.caretPositionFromPoint(e.left,e.top);a&&(n=(o=a).offsetNode,i=o.offset)}catch(m){}if(!n&&r.caretRangeFromPoint){var s,u=r.caretRangeFromPoint(e.left,e.top);u&&(n=(s=u).startContainer,i=s.startOffset)}var c,l=(t.root.elementFromPoint?t.root:r).elementFromPoint(e.left,e.top);if(!l||!t.dom.contains(1!=l.nodeType?l.parentNode:l)){var h=t.dom.getBoundingClientRect();if(!wi(e,h)||!(l=_i(t.dom,e,h)))return null}if(ai)for(var f=l;n&&f;f=zr(f))f.draggable&&(n=void 0);if(l=function(t,e){var n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}(l,e),n){if(ni&&1==n.nodeType&&(i=Math.min(i,n.childNodes.length))<n.childNodes.length){var d,p=n.childNodes[i];"IMG"==p.nodeName&&(d=p.getBoundingClientRect()).right<=e.left&&d.bottom>e.top&&i++}n==t.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&e.top>n.lastChild.getBoundingClientRect().bottom?c=t.state.doc.content.size:(0==i||1!=n.nodeType||"BR"!=n.childNodes[i-1].nodeName)&&(c=function(t,e,n,r){for(var i=-1,o=e;o!=t.dom;){var a=t.docView.nearestDesc(o,!0);if(!a)return null;if(a.node.isBlock&&a.parent){var s=a.dom.getBoundingClientRect();if(s.left>r.left||s.top>r.top)i=a.posBefore;else{if(!(s.right<r.left||s.bottom<r.top))break;i=a.posAfter}}o=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,1)}(t,n,i,e))}null==c&&(c=function(t,e,n){var r=bi(e,n),i=r.node,o=r.offset,a=-1;if(1==i.nodeType&&!i.firstChild){var s=i.getBoundingClientRect();a=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(i,o,a)}(t,l,e));var v=t.docView.nearestDesc(l,!0);return{pos:c,inside:v?v.posAtStart-v.border:-1}}function ki(t,e){var n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}var Si=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Ci(t,e,n){var r=t.docView.domFromPos(e,n<0?-1:1),i=r.node,o=r.offset,a=r.atom,s=li||ni;if(3==i.nodeType){if(!s||!Si.test(i.nodeValue)&&(n<0?o:o!=i.nodeValue.length)){var u=o,c=o,l=n<0?1:-1;return n<0&&!o?(c++,l=-1):n>=0&&o==i.nodeValue.length?(u--,l=1):n<0?u--:c++,Mi(ki(jr(i,u,c),1),l<0)}var h=ki(jr(i,o,o),n);if(ni&&o&&/\s/.test(i.nodeValue[o-1])&&o<i.nodeValue.length){var f=ki(jr(i,o-1,o-1),-1);if(f.top==h.top){var d=ki(jr(i,o,o+1),-1);if(d.top!=h.top)return Mi(d,d.left<f.left)}}return h}if(!t.state.doc.resolve(e-(a||0)).parent.inlineContent){if(null==a&&o&&(n<0||o==Vr(i))){var p=i.childNodes[o-1];if(1==p.nodeType)return Ei(p.getBoundingClientRect(),!1)}if(null==a&&o<Vr(i)){var v=i.childNodes[o];if(1==v.nodeType)return Ei(v.getBoundingClientRect(),!0)}return Ei(i.getBoundingClientRect(),n>=0)}if(null==a&&o&&(n<0||o==Vr(i))){var m=i.childNodes[o-1],g=3==m.nodeType?jr(m,Vr(m)-(s?0:1)):1!=m.nodeType||"BR"==m.nodeName&&m.nextSibling?null:m;if(g)return Mi(ki(g,1),!1)}if(null==a&&o<Vr(i)){for(var y=i.childNodes[o];y.pmViewDesc&&y.pmViewDesc.ignoreForCoords;)y=y.nextSibling;var b=y?3==y.nodeType?jr(y,0,s?0:1):1==y.nodeType?y:null:null;if(b)return Mi(ki(b,-1),!0)}return Mi(ki(3==i.nodeType?jr(i):i,-n),n>=0)}function Mi(t,e){if(0==t.width)return t;var n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Ei(t,e){if(0==t.height)return t;var n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Ti(t,e,n){var r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}var Ai=/[\u0590-\u08ac]/;var Oi=null,Di=null,Pi=!1;function Li(t,e,n){return Oi==e&&Di==n?Pi:(Oi=e,Di=n,Pi="up"==n||"down"==n?function(t,e,n){var r=e.selection,i="up"==n?r.$from:r.$to;return Ti(t,e,(function(){for(var e=t.docView.domFromPos(i.pos,"up"==n?-1:1).node;;){var r=t.docView.nearestDesc(e,!0);if(!r)break;if(r.node.isBlock){e=r.contentDOM||r.dom;break}e=r.dom.parentNode}for(var o=Ci(t,i.pos,1),a=e.firstChild;a;a=a.nextSibling){var s=void 0;if(1==a.nodeType)s=a.getClientRects();else{if(3!=a.nodeType)continue;s=jr(a,0,a.nodeValue.length).getClientRects()}for(var u=0;u<s.length;u++){var c=s[u];if(c.bottom>c.top+1&&("up"==n?o.top-c.top>2*(c.bottom-o.top):c.bottom-o.bottom>2*(o.bottom-c.top)))return!1}}return!0}))}(t,e,n):function(t,e,n){var r=e.selection.$head;if(!r.parent.isTextblock)return!1;var i=r.parentOffset,o=!i,a=i==r.parent.content.size,s=t.domSelection();return Ai.test(r.parent.textContent)&&s.modify?Ti(t,e,(function(){var e=t.domSelectionRange(),i=e.focusNode,o=e.focusOffset,a=e.anchorNode,u=e.anchorOffset,c=s.caretBidiLevel;s.modify("move",n,"character");var l=r.depth?t.docView.domAfterPos(r.before()):t.dom,h=t.domSelectionRange(),f=h.focusNode,d=h.focusOffset,p=f&&!l.contains(1==f.nodeType?f:f.parentNode)||i==f&&o==d;try{s.collapse(a,u),i&&(i!=a||o!=u)&&s.extend&&s.extend(i,o)}catch(v){}return null!=c&&(s.caretBidiLevel=c),p})):"left"==n||"backward"==n?o:a}(t,e,n))}var Ni=function(){function t(e,n,r,i){C(this,t),this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=0,r.pmViewDesc=this}return E(t,[{key:"matchesWidget",value:function(t){return!1}},{key:"matchesMark",value:function(t){return!1}},{key:"matchesNode",value:function(t,e,n){return!1}},{key:"matchesHack",value:function(t){return!1}},{key:"parseRule",value:function(){return null}},{key:"stopEvent",value:function(t){return!1}},{key:"size",get:function(){for(var t=0,e=0;e<this.children.length;e++)t+=this.children[e].size;return t}},{key:"border",get:function(){return 0}},{key:"destroy",value:function(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(var t=0;t<this.children.length;t++)this.children[t].destroy()}},{key:"posBeforeChild",value:function(t){for(var e=0,n=this.posAtStart;;e++){var r=this.children[e];if(r==t)return n;n+=r.size}}},{key:"posBefore",get:function(){return this.parent.posBeforeChild(this)}},{key:"posAtStart",get:function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}},{key:"posAfter",get:function(){return this.posBefore+this.size}},{key:"posAtEnd",get:function(){return this.posAtStart+this.size-2*this.border}},{key:"localPosFromDOM",value:function(t,e,n){var r,i;if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(n<0){var o,a;if(t==this.contentDOM)o=t.childNodes[e-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.previousSibling}for(;o&&(!(a=o.pmViewDesc)||a.parent!=this);)o=o.previousSibling;return o?this.posBeforeChild(a)+a.size:this.posAtStart}var s,u;if(t==this.contentDOM)s=t.childNodes[e];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;s=t.nextSibling}for(;s&&(!(u=s.pmViewDesc)||u.parent!=this);)s=s.nextSibling;return s?this.posBeforeChild(u):this.posAtEnd}if(t==this.dom&&this.contentDOM)i=e>Ir(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(var c=t;;c=c.parentNode){if(c==this.dom){i=!1;break}if(c.previousSibling)break}if(null==i&&e==t.childNodes.length)for(var l=t;;l=l.parentNode){if(l==this.dom){i=!0;break}if(l.nextSibling)break}}return(null!==(r=i)&&void 0!==r?r:n>0)?this.posAtEnd:this.posAtStart}},{key:"nearestDesc",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!0,r=t;r;r=r.parentNode){var i=this.getDesc(r),o=void 0;if(i&&(!e||i.node)){if(!n||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==t.nodeType?t:t.parentNode):o==t))return i;n=!1}}}},{key:"getDesc",value:function(t){for(var e=t.pmViewDesc,n=e;n;n=n.parent)if(n==this)return e}},{key:"posFromDOM",value:function(t,e,n){for(var r=t;r;r=r.parentNode){var i=this.getDesc(r);if(i)return i.localPosFromDOM(t,e,n)}return-1}},{key:"descAt",value:function(t){for(var e=0,n=0;e<this.children.length;e++){var r=this.children[e],i=n+r.size;if(n==t&&i!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(t<i)return r.descAt(t-n-r.border);n=i}}},{key:"domFromPos",value:function(t,e){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};for(var n,r=0,i=0,o=0;r<this.children.length;r++){var a=this.children[r],s=o+a.size;if(s>t||a instanceof qi){i=t-o;break}o=s}if(i)return this.children[r].domFromPos(i-this.children[r].border,e);for(;r&&!(n=this.children[r-1]).size&&n instanceof Ri&&n.side>=0;r--);if(e<=0){for(var u,c=!0;(u=r?this.children[r-1]:null)&&u.dom.parentNode!=this.contentDOM;r--,c=!1);return u&&e&&c&&!u.border&&!u.domAtom?u.domFromPos(u.size,e):{node:this.contentDOM,offset:u?Ir(u.dom)+1:0}}for(var l,h=!0;(l=r<this.children.length?this.children[r]:null)&&l.dom.parentNode!=this.contentDOM;r++,h=!1);return l&&h&&!l.border&&!l.domAtom?l.domFromPos(0,e):{node:this.contentDOM,offset:l?Ir(l.dom):this.contentDOM.childNodes.length}}},{key:"parseRange",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(0==this.children.length)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,i=-1,o=n,a=0;;a++){var s=this.children[a],u=o+s.size;if(-1==r&&t<=u){var c=o+s.border;if(t>=c&&e<=u-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(t,e,c);t=o;for(var l=a;l>0;l--){var h=this.children[l-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){r=Ir(h.dom)+1;break}t-=h.size}-1==r&&(r=0)}if(r>-1&&(u>e||a==this.children.length-1)){e=u;for(var f=a+1;f<this.children.length;f++){var d=this.children[f];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){i=Ir(d.dom);break}e+=d.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=u}return{node:this.contentDOM,from:t,to:e,fromOffset:r,toOffset:i}}},{key:"emptyChildAt",value:function(t){if(this.border||!this.contentDOM||!this.children.length)return!1;var e=this.children[t<0?0:this.children.length-1];return 0==e.size||e.emptyChildAt(t)}},{key:"domAfterPos",value:function(t){var e=this.domFromPos(t,0),n=e.node,r=e.offset;if(1!=n.nodeType||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}},{key:"setSelection",value:function(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=Math.min(t,e),o=Math.max(t,e),a=0,s=0;a<this.children.length;a++){var u=this.children[a],c=s+u.size;if(i>s&&o<c)return u.setSelection(t-s-u.border,e-s-u.border,n,r);s=c}var l=this.domFromPos(t,t?-1:1),h=e==t?l:this.domFromPos(e,e?-1:1),f=n.getSelection(),d=!1;if((ni||ai)&&t==e){var p=l,v=p.node,m=p.offset;if(3==v.nodeType){if((d=!(!m||"\n"!=v.nodeValue[m-1]))&&m==v.nodeValue.length)for(var g,y=v;y;y=y.parentNode){if(g=y.nextSibling){"BR"==g.nodeName&&(l=h={node:g.parentNode,offset:Ir(g)+1});break}var b=y.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{var w=v.childNodes[m-1];d=w&&("BR"==w.nodeName||"false"==w.contentEditable)}}if(ni&&f.focusNode&&f.focusNode!=h.node&&1==f.focusNode.nodeType){var _=f.focusNode.childNodes[f.focusOffset];_&&"false"==_.contentEditable&&(r=!0)}if(r||d&&ai||!Fr(l.node,l.offset,f.anchorNode,f.anchorOffset)||!Fr(h.node,h.offset,f.focusNode,f.focusOffset)){var x=!1;if((f.extend||t==e)&&!d){f.collapse(l.node,l.offset);try{t!=e&&f.extend(h.node,h.offset),x=!0}catch(C){}}if(!x){if(t>e){var k=l;l=h,h=k}var S=document.createRange();S.setEnd(h.node,h.offset),S.setStart(l.node,l.offset),f.removeAllRanges(),f.addRange(S)}}}},{key:"ignoreMutation",value:function(t){return!this.contentDOM&&"selection"!=t.type}},{key:"contentLost",get:function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}},{key:"markDirty",value:function(t,e){for(var n=0,r=0;r<this.children.length;r++){var i=this.children[r],o=n+i.size;if(n==o?t<=o&&e>=n:t<o&&e>n){var a=n+i.border,s=o-i.border;if(t>=a&&e<=s)return this.dirty=t==n||e==o?2:1,void(t!=a||e!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(t-a,e-a):i.dirty=3);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}this.dirty=2}},{key:"markParentsDirty",value:function(){for(var t=1,e=this.parent;e;e=e.parent,t++){var n=1==t?2:1;e.dirty<n&&(e.dirty=n)}}},{key:"domAtom",get:function(){return!1}},{key:"ignoreForCoords",get:function(){return!1}}]),t}(),Ri=function(t){v(n,t);var e=m(n);function n(t,r,i,o){var a;C(this,n);var s,u=r.type.toDOM;if("function"==typeof u&&(u=u(i,(function(){return s?s.parent?s.parent.posBeforeChild(s):void 0:o}))),!r.type.spec.raw){if(1!=u.nodeType){var c=document.createElement("span");c.appendChild(u),u=c}u.contentEditable="false",u.classList.add("ProseMirror-widget")}return(a=e.call(this,t,[],u,null)).widget=r,a.widget=r,s=y(a),a}return E(n,[{key:"matchesWidget",value:function(t){return 0==this.dirty&&t.type.eq(this.widget.type)}},{key:"parseRule",value:function(){return{ignore:!0}}},{key:"stopEvent",value:function(t){var e=this.widget.spec.stopEvent;return!!e&&e(t)}},{key:"ignoreMutation",value:function(t){return"selection"!=t.type||this.widget.spec.ignoreSelection}},{key:"destroy",value:function(){this.widget.type.destroy(this.dom),p(k(n.prototype),"destroy",this).call(this)}},{key:"domAtom",get:function(){return!0}},{key:"side",get:function(){return this.widget.type.side}}]),n}(Ni),Ii=function(t){v(n,t);var e=m(n);function n(t,r,i,o){var a;return C(this,n),(a=e.call(this,t,[],r,null)).textDOM=i,a.text=o,a}return E(n,[{key:"size",get:function(){return this.text.length}},{key:"localPosFromDOM",value:function(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e}},{key:"domFromPos",value:function(t){return{node:this.textDOM,offset:t}}},{key:"ignoreMutation",value:function(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue}}]),n}(Ni),zi=function(t){v(n,t);var e=m(n);function n(t,r,i,o){var a;return C(this,n),(a=e.call(this,t,[],i,o)).mark=r,a}return E(n,[{key:"parseRule",value:function(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}},{key:"matchesMark",value:function(t){return 3!=this.dirty&&this.mark.eq(t)}},{key:"markDirty",value:function(t,e){if(p(k(n.prototype),"markDirty",this).call(this,t,e),0!=this.dirty){for(var r=this.parent;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}}},{key:"slice",value:function(t,e,r){var i=n.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;e<a&&(o=to(o,e,a,r)),t>0&&(o=to(o,0,t,r));for(var s=0;s<o.length;s++)o[s].parent=i;return i.children=o,i}}],[{key:"create",value:function(t,e,r,i){var o=i.nodeViews[e.type.name],a=o&&o(e,i,r);return(!a||!a.dom)&&(a=$e.renderSpec(document,e.type.spec.toDOM(e,r))),new n(t,e,a.dom,a.contentDOM||a.dom)}}]),n}(Ni),Bi=function(t){v(n,t);var e=m(n);function n(t,r,i,o,a,s,u,c,l){var h;return C(this,n),(h=e.call(this,t,[],a,s)).node=r,h.outerDeco=i,h.innerDeco=o,h.nodeDOM=u,s&&h.updateChildren(c,l),h}return E(n,[{key:"parseRule",value:function(){var t=this;if(this.node.type.spec.reparseInView)return null;var e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(var n=this.children.length-1;n>=0;n--){var r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=function(){return qt.empty})}else e.contentElement=this.contentDOM;else e.getContent=function(){return t.node.content};return e}},{key:"matchesNode",value:function(t,e,n){return 0==this.dirty&&t.eq(this.node)&&Ki(e,this.outerDeco)&&n.eq(this.innerDeco)}},{key:"size",get:function(){return this.node.nodeSize}},{key:"border",get:function(){return this.node.isLeaf?0:1}},{key:"updateChildren",value:function(t,e){var n=this,r=this.node.inlineContent,i=e,o=t.composing?this.localCompositionInfo(t,e):null,a=o&&o.pos>-1?o:null,s=o&&o.pos<0,u=new Xi(this,a&&a.node,t);(function(t,e,n,r){var i=e.locals(t),o=0;if(0==i.length){for(var a=0;a<t.childCount;a++){var s=t.child(a);r(s,i,e.forChild(o,s),a),o+=s.nodeSize}return}for(var u=0,c=[],l=null,h=0;;){if(u<i.length&&i[u].to==o){for(var f=i[u++],d=void 0;u<i.length&&i[u].to==o;)(d||(d=[f])).push(i[u++]);if(d){d.sort(Qi);for(var p=0;p<d.length;p++)n(d[p],h,!!l)}else n(f,h,!!l)}var v=void 0,m=void 0;if(l)m=-1,v=l,l=null;else{if(!(h<t.childCount))break;m=h,v=t.child(h++)}for(var g=0;g<c.length;g++)c[g].to<=o&&c.splice(g--,1);for(;u<i.length&&i[u].from<=o&&i[u].to>o;)c.push(i[u++]);var y=o+v.nodeSize;if(v.isText){var b=y;u<i.length&&i[u].from<b&&(b=i[u].from);for(var w=0;w<c.length;w++)c[w].to<b&&(b=c[w].to);b<y&&(l=v.cut(b-o),v=v.cut(0,b-o),y=b,m=-1)}r(v,v.isInline&&!v.isLeaf?c.filter((function(t){return!t.inline})):c.slice(),e.forChild(o,v),m),o=y}})(this.node,this.innerDeco,(function(e,o,a){e.spec.marks?u.syncToMarks(e.spec.marks,r,t):e.type.side>=0&&!a&&u.syncToMarks(o==n.node.childCount?Ht.none:n.node.child(o).marks,r,t),u.placeWidget(e,t,i)}),(function(e,n,a,c){var l;u.syncToMarks(e.marks,r,t),u.findNodeMatch(e,n,a,c)||s&&t.state.selection.from>i&&t.state.selection.to<i+e.nodeSize&&(l=u.findIndexWithChild(o.node))>-1&&u.updateNodeAt(e,n,a,l,t)||u.updateNextNode(e,n,a,t,c)||u.addNode(e,n,a,t,i),i+=e.nodeSize})),u.syncToMarks([],r,t),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||2==this.dirty)&&(a&&this.protectLocalComposition(t,a),Vi(this.contentDOM,this.children,t),si&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){var e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))}},{key:"localCompositionInfo",value:function(t,e){var n=t.state.selection,r=n.from,i=n.to;if(!(t.state.selection instanceof $n)||r<e||i>e+this.node.content.size)return null;var o=t.domSelectionRange(),a=function(t,e){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&e>0){if(t.childNodes.length>e&&3==t.childNodes[e].nodeType)return t.childNodes[e];e=Vr(t=t.childNodes[e-1])}else{if(!(1==t.nodeType&&e<t.childNodes.length))return null;t=t.childNodes[e],e=0}}}(o.focusNode,o.focusOffset);if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){var s=a.nodeValue,u=function(t,e,n,r){for(var i=0,o=0;i<t.childCount&&o<=r;){var a=t.child(i++),s=o;if(o+=a.nodeSize,a.isText){for(var u=a.text;i<t.childCount;){var c=t.child(i++);if(o+=c.nodeSize,!c.isText)break;u+=c.text}if(o>=n){var l=s<r?u.lastIndexOf(e,r-s-1):-1;if(l>=0&&l+e.length+s>=n)return s+l;if(n==r&&u.length>=r+e.length-s&&u.slice(r-s,r-s+e.length)==e)return r}}}return-1}(this.node.content,s,r-e,i-e);return u<0?null:{node:a,pos:u,text:s}}return{node:a,pos:-1,text:""}}},{key:"protectLocalComposition",value:function(t,e){var n=e.node,r=e.pos,i=e.text;if(!this.getDesc(n)){for(var o=n;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}var a=new Ii(this,o,n,i);t.input.compositionNodes.push(a),this.children=to(this.children,r,r+i.length,t,a)}}},{key:"update",value:function(t,e,n,r){return!(3==this.dirty||!t.sameMarkup(this.node))&&(this.updateInner(t,e,n,r),!0)}},{key:"updateInner",value:function(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}},{key:"updateOuterDeco",value:function(t){if(!Ki(t,this.outerDeco)){var e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Zi(this.dom,this.nodeDOM,Wi(this.outerDeco,this.node,e),Wi(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}}},{key:"selectNode",value:function(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}},{key:"deselectNode",value:function(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}},{key:"domAtom",get:function(){return this.node.isAtom}}],[{key:"create",value:function(t,e,r,i,o,a){var s,u,c=o.nodeViews[e.type.name],l=c&&c(e,o,(function(){return u?u.parent?u.parent.posBeforeChild(u):void 0:a}),r,i),h=l&&l.dom,f=l&&l.contentDOM;if(e.isText)if(h){if(3!=h.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else h=document.createTextNode(e.text);else h||(h=(s=$e.renderSpec(document,e.type.spec.toDOM(e))).dom,f=s.contentDOM);!f&&!e.isText&&"BR"!=h.nodeName&&(h.hasAttribute("contenteditable")||(h.contentEditable="false"),e.type.spec.draggable&&(h.draggable=!0));var d=h;return h=Yi(h,r,e),l?u=new $i(t,e,r,i,h,f||null,d,l,o,a+1):e.isText?new Fi(t,e,r,i,h,d,o):new n(t,e,r,i,h,f||null,d,o,a+1)}}]),n}(Ni);function ji(t,e,n,r,i){return Yi(r,e,t),new Bi(void 0,t,e,n,r,r,r,i,0)}var Fi=function(t){v(n,t);var e=m(n);function n(t,r,i,o,a,s,u){return C(this,n),e.call(this,t,r,i,o,a,null,s,u,0)}return E(n,[{key:"parseRule",value:function(){for(var t=this.nodeDOM.parentNode;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}},{key:"update",value:function(t,e,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),(0!=this.dirty||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=0,!0)}},{key:"inParent",value:function(){for(var t=this.parent.contentDOM,e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1}},{key:"domFromPos",value:function(t){return{node:this.nodeDOM,offset:t}}},{key:"localPosFromDOM",value:function(t,e,r){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):p(k(n.prototype),"localPosFromDOM",this).call(this,t,e,r)}},{key:"ignoreMutation",value:function(t){return"characterData"!=t.type&&"selection"!=t.type}},{key:"slice",value:function(t,e,r){var i=this.node.cut(t,e),o=document.createTextNode(i.text);return new n(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}},{key:"markDirty",value:function(t,e){p(k(n.prototype),"markDirty",this).call(this,t,e),this.dom!=this.nodeDOM&&(0==t||e==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}},{key:"domAtom",get:function(){return!1}}]),n}(Bi),qi=function(t){v(n,t);var e=m(n);function n(){return C(this,n),e.apply(this,arguments)}return E(n,[{key:"parseRule",value:function(){return{ignore:!0}}},{key:"matchesHack",value:function(t){return 0==this.dirty&&this.dom.nodeName==t}},{key:"domAtom",get:function(){return!0}},{key:"ignoreForCoords",get:function(){return"IMG"==this.dom.nodeName}}]),n}(Ni),$i=function(t){v(n,t);var e=m(n);function n(t,r,i,o,a,s,u,c,l,h){var f;return C(this,n),(f=e.call(this,t,r,i,o,a,s,u,l,h)).spec=c,f}return E(n,[{key:"update",value:function(t,e,r,i){if(3==this.dirty)return!1;if(this.spec.update){var o=this.spec.update(t,e,r);return o&&this.updateInner(t,e,r,i),o}return!(!this.contentDOM&&!t.isLeaf)&&p(k(n.prototype),"update",this).call(this,t,e,r,i)}},{key:"selectNode",value:function(){this.spec.selectNode?this.spec.selectNode():p(k(n.prototype),"selectNode",this).call(this)}},{key:"deselectNode",value:function(){this.spec.deselectNode?this.spec.deselectNode():p(k(n.prototype),"deselectNode",this).call(this)}},{key:"setSelection",value:function(t,e,r,i){this.spec.setSelection?this.spec.setSelection(t,e,r):p(k(n.prototype),"setSelection",this).call(this,t,e,r,i)}},{key:"destroy",value:function(){this.spec.destroy&&this.spec.destroy(),p(k(n.prototype),"destroy",this).call(this)}},{key:"stopEvent",value:function(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}},{key:"ignoreMutation",value:function(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):p(k(n.prototype),"ignoreMutation",this).call(this,t)}}]),n}(Bi);function Vi(t,e,n){for(var r=t.firstChild,i=!1,o=0;o<e.length;o++){var a=e[o],s=a.dom;if(s.parentNode==t){for(;s!=r;)r=Gi(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(s,r);if(a instanceof zi){var u=r?r.previousSibling:t.lastChild;Vi(a.contentDOM,a.children,n),r=u?u.nextSibling:t.firstChild}}for(;r;)r=Gi(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}var Ui=function(t){t&&(this.nodeName=t)};Ui.prototype=Object.create(null);var Hi=[new Ui];function Wi(t,e,n){if(0==t.length)return Hi;for(var r=n?Hi[0]:new Ui,i=[r],o=0;o<t.length;o++){var a=t[o].type.attrs;if(a)for(var s in a.nodeName&&i.push(r=new Ui(a.nodeName)),a){var u=a[s];null!=u&&(n&&1==i.length&&i.push(r=new Ui(e.isInline?"span":"div")),"class"==s?r.class=(r.class?r.class+" ":"")+u:"style"==s?r.style=(r.style?r.style+";":"")+u:"nodeName"!=s&&(r[s]=u))}}return i}function Zi(t,e,n,r){if(n==Hi&&r==Hi)return e;for(var i=e,o=0;o<r.length;o++){var a=r[o],s=n[o];if(o){var u=void 0;s&&s.nodeName==a.nodeName&&i!=t&&(u=i.parentNode)&&u.nodeName.toLowerCase()==a.nodeName||((u=document.createElement(a.nodeName)).pmIsDeco=!0,u.appendChild(i),s=Hi[0]),i=u}Ji(i,s||Hi[0],a)}return i}function Ji(t,e,n){for(var r in e)"class"!=r&&"style"!=r&&"nodeName"!=r&&!(r in n)&&t.removeAttribute(r);for(var i in n)"class"!=i&&"style"!=i&&"nodeName"!=i&&n[i]!=e[i]&&t.setAttribute(i,n[i]);if(e.class!=n.class){for(var o=e.class?e.class.split(" ").filter(Boolean):[],a=n.class?n.class.split(" ").filter(Boolean):[],s=0;s<o.length;s++)-1==a.indexOf(o[s])&&t.classList.remove(o[s]);for(var u=0;u<a.length;u++)-1==o.indexOf(a[u])&&t.classList.add(a[u]);0==t.classList.length&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style)for(var c,l=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;c=l.exec(e.style);)t.style.removeProperty(c[1]);n.style&&(t.style.cssText+=n.style)}}function Yi(t,e,n){return Zi(t,t,Hi,Wi(e,n,1!=t.nodeType))}function Ki(t,e){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function Gi(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e}var Xi=function(){function t(e,n,r){C(this,t),this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(t,e){var n=e,r=n.children.length,i=t.childCount,o=new Map,a=[];t:for(;i>0;){for(var s=void 0;;)if(r){var u=n.children[r-1];if(!(u instanceof zi)){s=u,r--;break}n=u,r=u.children.length}else{if(n==e)break t;r=n.parent.children.indexOf(n),n=n.parent}var c=s.node;if(c){if(c!=t.child(i-1))break;--i,o.set(s,i),a.push(s)}}return{index:i,matched:o,matches:a.reverse()}}(e.node.content,e)}return E(t,[{key:"destroyBetween",value:function(t,e){if(t!=e){for(var n=t;n<e;n++)this.top.children[n].destroy();this.top.children.splice(t,e-t),this.changed=!0}}},{key:"destroyRest",value:function(){this.destroyBetween(this.index,this.top.children.length)}},{key:"syncToMarks",value:function(t,e,n){for(var r=0,i=this.stack.length>>1,o=Math.min(i,t.length);r<o&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(t[r])&&!1!==t[r].type.spec.spanning;)r++;for(;r<i;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<t.length;){this.stack.push(this.top,this.index+1);for(var a=-1,s=this.index;s<Math.min(this.index+3,this.top.children.length);s++){var u=this.top.children[s];if(u.matchesMark(t[i])&&!this.isLocked(u.dom)){a=s;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{var c=zi.create(this.top,t[i],e,n);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,i++}}},{key:"findNodeMatch",value:function(t,e,n,r){var i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(t,e,n))o=this.top.children.indexOf(i,this.index);else for(var a=this.index,s=Math.min(this.top.children.length,a+5);a<s;a++){var u=this.top.children[a];if(u.matchesNode(t,e,n)&&!this.preMatch.matched.has(u)){o=a;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}},{key:"updateNodeAt",value:function(t,e,n,r,i){var o=this.top.children[r];return 3==o.dirty&&o.dom==o.contentDOM&&(o.dirty=2),!!o.update(t,e,n,i)&&(this.destroyBetween(this.index,r),this.index++,!0)}},{key:"findIndexWithChild",value:function(t){for(;;){var e=t.parentNode;if(!e)return-1;if(e==this.top.contentDOM){var n=t.pmViewDesc;if(n)for(var r=this.index;r<this.top.children.length;r++)if(this.top.children[r]==n)return r;return-1}t=e}}},{key:"updateNextNode",value:function(t,e,n,r,i){for(var o=this.index;o<this.top.children.length;o++){var a=this.top.children[o];if(a instanceof Bi){var s=this.preMatch.matched.get(a);if(null!=s&&s!=i)return!1;var u=a.dom;if((!this.isLocked(u)||t.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==t.text&&3!=a.dirty&&Ki(e,a.outerDeco))&&a.update(t,e,n,r))return this.destroyBetween(this.index,o),a.dom!=u&&(this.changed=!0),this.index++,!0;break}}return!1}},{key:"addNode",value:function(t,e,n,r,i){this.top.children.splice(this.index++,0,Bi.create(this.top,t,e,n,r,i)),this.changed=!0}},{key:"placeWidget",value:function(t,e,n){var r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(t)||t!=r.widget&&r.widget.type.toDOM.parentNode){var i=new Ri(this.top,t,e,n);this.top.children.splice(this.index++,0,i),this.changed=!0}else this.index++}},{key:"addTextblockHacks",value:function(){for(var t=this.top.children[this.index-1],e=this.top;t instanceof zi;)t=(e=t).children[e.children.length-1];(!t||!(t instanceof Fi)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((ai||ii)&&t&&"false"==t.dom.contentEditable&&this.addHackNode("IMG",e),this.addHackNode("BR",this.top))}},{key:"addHackNode",value:function(t,e){if(e==this.top&&this.index<e.children.length&&e.children[this.index].matchesHack(t))this.index++;else{var n=document.createElement(t);"IMG"==t&&(n.className="ProseMirror-separator",n.alt=""),"BR"==t&&(n.className="ProseMirror-trailingBreak");var r=new qi(this.top,[],n,null);e!=this.top?e.children.push(r):e.children.splice(this.index++,0,r),this.changed=!0}}},{key:"isLocked",value:function(t){return this.lock&&(t==this.lock||1==t.nodeType&&t.contains(this.lock.parentNode))}}]),t}();function Qi(t,e){return t.type.side-e.type.side}function to(t,e,n,r,i){for(var o=[],a=0,s=0;a<t.length;a++){var u=t[a],c=s,l=s+=u.size;c>=n||l<=e?o.push(u):(c<e&&o.push(u.slice(0,e-c,r)),i&&(o.push(i),i=void 0),l>n&&o.push(u.slice(n-c,u.size,r)))}return o}function eo(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;var i=t.docView.nearestDesc(n.focusNode),o=i&&0==i.size,a=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;var s,u,c=r.resolve(a);if(Wr(n)){for(s=c;i&&!i.node;)i=i.parent;var l=i.node;if(i&&l.isAtom&&Un.isSelectable(l)&&i.parent&&(!l.isInline||!Ur(n.focusNode,n.focusOffset,i.dom))){var h=i.posBefore;u=new Un(a==h?c:r.resolve(h))}}else{var f=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(f<0)return null;s=r.resolve(f)}if(!u){var d="pointer"==e||t.state.selection.head<c.pos&&!o?1:-1;u=fo(t,s,c,d)}return u}function no(t){return t.editable?t.hasFocus():vo(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function ro(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.state.selection;if(lo(t,n),no(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&ii){var r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Fr(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset))return t.input.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)co(t);else{var o,a,s=n.anchor,u=n.head;io&&!(n instanceof $n)&&(n.$from.parent.inlineContent||(o=oo(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=oo(t,n.to))),t.docView.setSelection(s,u,t.root,e),io&&(o&&so(o),a&&so(a)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&uo(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}var io=ai||ii&&oi<63;function oo(t,e){var n=t.docView.domFromPos(e,0),r=n.node,i=n.offset,o=i<r.childNodes.length?r.childNodes[i]:null,a=i?r.childNodes[i-1]:null;if(ai&&o&&"false"==o.contentEditable)return ao(o);if((!o||"false"==o.contentEditable)&&(!a||"false"==a.contentEditable)){if(o)return ao(o);if(a)return ao(a)}}function ao(t){return t.contentEditable="true",ai&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function so(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function uo(t){var e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);var n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=function(){(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout((function(){(!no(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")}),20))})}function co(t){var e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,i="IMG"==r.nodeName;i?n.setEnd(r.parentNode,Ir(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&ti&&ei<=11&&(r.disabled=!0,r.disabled=!1)}function lo(t,e){if(e instanceof Un){var n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(ho(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else ho(t)}function ho(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function fo(t,e,n,r){return t.someProp("createSelectionBetween",(function(r){return r(t,e,n)}))||$n.between(e,n,r)}function po(t){return!(t.editable&&!t.hasFocus())&&vo(t)}function vo(t){var e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(n){return!1}}function mo(t,e){var n=t.selection,r=n.$anchor,i=n.$head,o=e>0?r.max(i):r.min(i),a=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return a&&Bn.findFrom(a,e)}function go(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function yo(t,e,n){var r=t.state.selection;if(!(r instanceof $n)){if(r instanceof Un&&r.node.isInline)return go(t,new $n(e>0?r.$to:r.$from));var i=mo(t.state,e);return!!i&&go(t,i)}if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){var o=mo(t.state,e);return!!(o&&o instanceof Un)&&go(t,o)}if(!(ui&&n.indexOf("m")>-1)){var a,s=r.$head,u=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!u||u.isText)return!1;var c=e<0?s.pos-u.nodeSize:s.pos;return!!(u.isAtom||(a=t.docView.descAt(c))&&!a.contentDOM)&&(Un.isSelectable(u)?go(t,new Un(e<0?t.state.doc.resolve(s.pos-u.nodeSize):s)):!!li&&go(t,new $n(t.state.doc.resolve(e<0?c:c+u.nodeSize))))}}function bo(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function wo(t){var e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function _o(t){var e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(n){var i,o,a=!1;for(ni&&1==n.nodeType&&r<bo(n)&&wo(n.childNodes[r])&&(a=!0);;)if(r>0){if(1!=n.nodeType)break;var s=n.childNodes[r-1];if(wo(s))i=n,o=--r;else{if(3!=s.nodeType)break;r=(n=s).nodeValue.length}}else{if(ko(n))break;for(var u=n.previousSibling;u&&wo(u);)i=n.parentNode,o=Ir(u),u=u.previousSibling;if(u)r=bo(n=u);else{if((n=n.parentNode)==t.dom)break;r=0}}a?So(t,n,r):i&&So(t,i,o)}}function xo(t){var e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(n){for(var i,o,a=bo(n);;)if(r<a){if(1!=n.nodeType)break;if(!wo(n.childNodes[r]))break;i=n,o=++r}else{if(ko(n))break;for(var s=n.nextSibling;s&&wo(s);)i=s.parentNode,o=Ir(s)+1,s=s.nextSibling;if(s)r=0,a=bo(n=s);else{if((n=n.parentNode)==t.dom)break;r=a=0}}i&&So(t,i,o)}}function ko(t){var e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function So(t,e,n){var r=t.domSelection();if(Wr(r)){var i=document.createRange();i.setEnd(e,n),i.setStart(e,n),r.removeAllRanges(),r.addRange(i)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();var o=t.state;setTimeout((function(){t.state==o&&ro(t)}),50)}function Co(t,e,n){var r=t.state.selection;if(r instanceof $n&&!r.empty||n.indexOf("s")>-1||ui&&n.indexOf("m")>-1)return!1;var i=r.$from,o=r.$to;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){var a=mo(t.state,e);if(a&&a instanceof Un)return go(t,a)}if(!i.parent.inlineContent){var s=e<0?i:o,u=r instanceof Wn?Bn.near(s,e):Bn.findFrom(s,e);return!!u&&go(t,u)}return!1}function Mo(t,e){if(!(t.state.selection instanceof $n))return!0;var n=t.state.selection,r=n.$head,i=n.$anchor,o=n.empty;if(!r.sameParent(i))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;var a=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(a&&!a.isText){var s=t.state.tr;return e<0?s.delete(r.pos-a.nodeSize,r.pos):s.delete(r.pos,r.pos+a.nodeSize),t.dispatch(s),!0}return!1}function Eo(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function To(t,e){var n=e.keyCode,r=function(t){var e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);return 8==n||ui&&72==n&&"c"==r?Mo(t,-1)||_o(t):46==n||ui&&68==n&&"c"==r?Mo(t,1)||xo(t):13==n||27==n||(37==n||ui&&66==n&&"c"==r?yo(t,-1,r)||_o(t):39==n||ui&&70==n&&"c"==r?yo(t,1,r)||xo(t):38==n||ui&&80==n&&"c"==r?Co(t,-1,r)||_o(t):40==n||ui&&78==n&&"c"==r?function(t){if(!ai||t.state.selection.$head.parentOffset>0)return!1;var e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var i=n.firstChild;Eo(t,i,"true"),setTimeout((function(){return Eo(t,i,"false")}),20)}return!1}(t)||Co(t,1,r)||xo(t):r==(ui?"m":"c")&&(66==n||73==n||89==n||90==n))}function Ao(t,e){t.someProp("transformCopied",(function(n){e=n(e,t)}));for(var n=[],r=e,i=r.content,o=r.openStart,a=r.openEnd;o>1&&a>1&&1==i.childCount&&1==i.firstChild.childCount;){o--,a--;var s=i.firstChild;n.push(s.type.name,s.attrs!=s.type.defaultAttrs?s.attrs:null),i=s.content}var u=t.someProp("clipboardSerializer")||$e.fromSchema(t.state.schema),c=jo(),l=c.createElement("div");l.appendChild(u.serializeFragment(i,{document:c}));for(var h,f=l.firstChild,d=0;f&&1==f.nodeType&&(h=zo[f.nodeName.toLowerCase()]);){for(var p=h.length-1;p>=0;p--){for(var v=c.createElement(h[p]);l.firstChild;)v.appendChild(l.firstChild);l.appendChild(v),d++}f=l.firstChild}return f&&1==f.nodeType&&f.setAttribute("data-pm-slice","".concat(o," ").concat(a).concat(d?" -".concat(d):""," ").concat(JSON.stringify(n))),{dom:l,text:t.someProp("clipboardTextSerializer",(function(n){return n(e,t)}))||e.content.textBetween(0,e.content.size,"\n\n")}}function Oo(t,e,n,r,i){var o,a,s=i.parent.type.spec.code;if(!n&&!e)return null;var u=e&&(r||s||!n);if(u){if(t.someProp("transformPastedText",(function(n){e=n(e,s||r,t)})),s)return e?new Zt(qt.from(t.state.schema.text(e.replace(/\r\n?/g,"\n"))),0,0):Zt.empty;var c=t.someProp("clipboardTextParser",(function(n){return n(e,i,r,t)}));if(c)a=c;else{var l=i.marks(),h=t.state.schema,f=$e.fromSchema(h);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach((function(t){var e=o.appendChild(document.createElement("p"));t&&e.appendChild(f.serializeNode(h.text(t,l)))}))}}else t.someProp("transformPastedHTML",(function(e){n=e(n,t)})),o=function(t){var e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));var n,r=jo().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(t);if((n=i&&zo[i[1].toLowerCase()])&&(t=n.map((function(t){return"<"+t+">"})).join("")+t+n.map((function(t){return"</"+t+">"})).reverse().join("")),r.innerHTML=t,n)for(var o=0;o<n.length;o++)r=r.querySelector(n[o])||r;return r}(n),li&&function(t){for(var e=t.querySelectorAll(ii?"span:not([class]):not([style])":"span.Apple-converted-space"),n=0;n<e.length;n++){var r=e[n];1==r.childNodes.length&&"\xa0"==r.textContent&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}(o);var d=o&&o.querySelector("[data-pm-slice]"),p=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(p&&p[3])for(var v=+p[3];v>0;v--){for(var m=o.firstChild;m&&1!=m.nodeType;)m=m.nextSibling;if(!m)break;o=m}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Pe.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!(!u&&!p),context:i,ruleFromNode:function(t){return"BR"!=t.nodeName||t.nextSibling||!t.parentNode||Do.test(t.parentNode.nodeName)?null:{ignore:!0}}})),p)a=function(t,e){if(!t.size)return t;var n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(c){return t}for(var i=t.content,o=t.openStart,a=t.openEnd,s=n.length-2;s>=0;s-=2){var u=r.nodes[n[s]];if(!u||u.hasRequiredAttrs())break;i=qt.from(u.create(n[s+1],i)),o++,a++}return new Zt(i,o,a)}(Io(a,+p[1],+p[2]),p[4]);else if((a=Zt.maxOpen(function(t,e){if(t.childCount<2)return t;for(var n=function(n){var r=e.node(n).contentMatchAt(e.index(n)),i=void 0,o=[];if(t.forEach((function(t){if(o){var e,n=r.findWrapping(t.type);if(!n)return o=null;if(e=o.length&&i.length&&Lo(n,i,t,o[o.length-1],0))o[o.length-1]=e;else{o.length&&(o[o.length-1]=No(o[o.length-1],i.length));var a=Po(t,n);o.push(a),r=r.matchType(a.type),i=n}}})),o)return{v:qt.from(o)}},r=e.depth;r>=0;r--){var i=n(r);if("object"===D(i))return i.v}return t}(a.content,i),!0)).openStart||a.openEnd){for(var g=0,y=0,b=a.content.firstChild;g<a.openStart&&!b.type.spec.isolating;g++,b=b.firstChild);for(var w=a.content.lastChild;y<a.openEnd&&!w.type.spec.isolating;y++,w=w.lastChild);a=Io(a,g,y)}return t.someProp("transformPasted",(function(e){a=e(a,t)})),a}var Do=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function Po(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=e.length-1;r>=n;r--)t=e[r].create(null,qt.from(t));return t}function Lo(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){var o=Lo(t,e,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(qt.from(Po(n,t,i+1))))}}function No(t,e){if(0==e)return t;var n=t.content.replaceChild(t.childCount-1,No(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(qt.empty,!0);return t.copy(n.append(r))}function Ro(t,e,n,r,i,o){var a=e<0?t.firstChild:t.lastChild,s=a.content;return i<r-1&&(s=Ro(s,e,n,r,i+1,o)),i>=n&&(s=e<0?a.contentMatchAt(0).fillBefore(s,t.childCount>1||o<=i).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(qt.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(s))}function Io(t,e,n){return e<t.openStart&&(t=new Zt(Ro(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new Zt(Ro(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}var zo={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Bo=null;function jo(){return Bo||(Bo=document.implementation.createHTMLDocument("title"))}var Fo={},qo={},$o={touchstart:!0,touchmove:!0},Vo=function t(){C(this,t),this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null};function Uo(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function Ho(t){t.someProp("handleDOMEvents",(function(e){for(var n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=function(e){return Wo(t,e)})}))}function Wo(t,e){return t.someProp("handleDOMEvents",(function(n){var r=n[e.type];return!!r&&(r(t,e)||e.defaultPrevented)}))}function Zo(t){return{left:t.clientX,top:t.clientY}}function Jo(t,e,n,r,i){if(-1==r)return!1;for(var o=t.state.doc.resolve(r),a=function(r){if(t.someProp(e,(function(e){return r>o.depth?e(t,n,o.nodeAfter,o.before(r),i,!0):e(t,n,o.node(r),o.before(r),i,!1)})))return{v:!0}},s=o.depth+1;s>0;s--){var u=a(s);if("object"===D(u))return u.v}return!1}function Yo(t,e,n){t.focused||t.focus();var r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function Ko(t,e,n,r,i){return Jo(t,"handleClickOn",e,n,r)||t.someProp("handleClick",(function(n){return n(t,e,r)}))||(i?function(t,e){if(-1==e)return!1;var n,r,i=t.state.selection;i instanceof Un&&(n=i.node);for(var o=t.state.doc.resolve(e),a=o.depth+1;a>0;a--){var s=a>o.depth?o.nodeAfter:o.node(a);if(Un.isSelectable(s)){r=n&&i.$from.depth>0&&a>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(a);break}}return null!=r&&(Yo(t,Un.create(t.state.doc,r),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;var n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&Un.isSelectable(r))&&(Yo(t,new Un(n),"pointer"),!0)}(t,n))}function Go(t,e,n,r){return Jo(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(function(n){return n(t,e,r)}))}function Xo(t,e,n,r){return Jo(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",(function(n){return n(t,e,r)}))||function(t,e,n){if(0!=n.button)return!1;var r=t.state.doc;if(-1==e)return!!r.inlineContent&&(Yo(t,$n.create(r,0,r.content.size),"pointer"),!0);for(var i=r.resolve(e),o=i.depth+1;o>0;o--){var a=o>i.depth?i.nodeAfter:i.node(o),s=i.before(o);if(a.inlineContent)Yo(t,$n.create(r,s+1,s+1+a.content.size),"pointer");else{if(!Un.isSelectable(a))continue;Yo(t,Un.create(r,s),"pointer")}return!0}}(t,n,r)}function Qo(t){return aa(t)}qo.keydown=function(t,e){var n=e;if(t.input.shiftKey=16==n.keyCode||n.shiftKey,!na(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!ci||!ii||13!=n.keyCode))if(229!=n.keyCode&&t.domObserver.forceFlush(),!si||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",(function(e){return e(t,n)}))||To(t,n)?n.preventDefault():Uo(t,"key");else{var r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout((function(){t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",(function(e){return e(t,Zr(13,"Enter"))})),t.input.lastIOSEnter=0)}),200)}},qo.keyup=function(t,e){16==e.keyCode&&(t.input.shiftKey=!1)},qo.keypress=function(t,e){var n=e;if(!(na(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||ui&&n.metaKey))if(t.someProp("handleKeyPress",(function(e){return e(t,n)})))n.preventDefault();else{var r=t.state.selection;if(!(r instanceof $n)||!r.$from.sameParent(r.$to)){var i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",(function(e){return e(t,r.$from.pos,r.$to.pos,i)}))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}}};var ta=ui?"metaKey":"ctrlKey";Fo.mousedown=function(t,e){var n=e;t.input.shiftKey=n.shiftKey;var r=Qo(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&function(t,e){var n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(n,t.input.lastClick)&&!n[ta]&&("singleClick"==t.input.lastClick.type?o="doubleClick":"doubleClick"==t.input.lastClick.type&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};var a=t.posAtCoords(Zo(n));a&&("singleClick"==o?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new ea(t,a,n,!!r)):("doubleClick"==o?Go:Xo)(t,a.pos,a.inside,n)?n.preventDefault():Uo(t,"pointer"))};var ea=function(){function t(e,n,r,i){var o,a,s=this;if(C(this,t),this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[ta],this.allowDefault=r.shiftKey,n.inside>-1)o=e.state.doc.nodeAt(n.inside),a=n.inside;else{var u=e.state.doc.resolve(n.pos);o=u.parent,a=u.depth?u.before():0}var c=i?null:r.target,l=c?e.docView.nearestDesc(c,!0):null;this.target=l?l.dom:null;var h=e.state.selection;(0==r.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||h instanceof Un&&h.from<=a&&h.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!ni||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((function(){s.view.input.mouseDown==s&&s.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Uo(e,"pointer")}return E(t,[{key:"done",value:function(){var t=this;this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((function(){return ro(t.view)})),this.view.input.mouseDown=null}},{key:"up",value:function(t){if(this.done(),this.view.dom.contains(t.target)){var e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(Zo(t))),this.updateAllowDefault(t),this.allowDefault||!e?Uo(this.view,"pointer"):Ko(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||ai&&this.mightDrag&&!this.mightDrag.node.isAtom||ii&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(Yo(this.view,Bn.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):Uo(this.view,"pointer")}}},{key:"move",value:function(t){this.updateAllowDefault(t),Uo(this.view,"pointer"),0==t.buttons&&this.done()}},{key:"updateAllowDefault",value:function(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}]),t}();function na(t,e){return!!t.composing||!!(ai&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}Fo.touchstart=function(t){t.input.lastTouch=Date.now(),Qo(t),Uo(t,"pointer")},Fo.touchmove=function(t){t.input.lastTouch=Date.now(),Uo(t,"pointer")},Fo.contextmenu=function(t){return Qo(t)};var ra=ci?5e3:-1;function ia(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout((function(){return aa(t)}),e))}function oa(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function(){var t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function aa(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(ci&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),oa(t),e||t.docView&&t.docView.dirty){var n=eo(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}qo.compositionstart=qo.compositionupdate=function(t){if(!t.composing){t.domObserver.flush();var e=t.state,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(t){return!1===t.type.spec.inclusive}))))t.markCursor=t.state.storedMarks||n.marks(),aa(t,!0),t.markCursor=null;else if(aa(t),ni&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=t.domSelectionRange(),i=r.focusNode,o=r.focusOffset;i&&1==i.nodeType&&0!=o;){var a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(3==a.nodeType){t.domSelection().collapse(a,a.nodeValue.length);break}i=a,o=-1}t.input.composing=!0}ia(t,ra)},qo.compositionend=function(t,e){t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,ia(t,20))};var sa=ti&&ei<15||si&&hi<604;function ua(t,e,n,r){var i=Oo(t,e,n,t.input.shiftKey,t.state.selection.$from);if(t.someProp("handlePaste",(function(e){return e(t,r,i||Zt.empty)})))return!0;if(!i)return!1;var o=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(i),a=o?t.state.tr.replaceSelectionWith(o,t.input.shiftKey):t.state.tr.replaceSelection(i);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Fo.copy=qo.cut=function(t,e){var n=e,r=t.state.selection,i="cut"==n.type;if(!r.empty){var o=sa?null:n.clipboardData,a=Ao(t,r.content()),s=a.dom,u=a.text;o?(n.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",u)):function(t,e){if(t.dom.parentNode){var n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}}(t,s),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},qo.paste=function(t,e){var n=e;if(!t.composing||ci){var r=sa?null:n.clipboardData;r&&ua(t,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(t,e){if(t.dom.parentNode){var n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((function(){t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ua(t,r.value,null,e):ua(t,r.textContent,r.innerHTML,e)}),50)}}(t,n)}};var ca=function t(e,n){C(this,t),this.slice=e,this.move=n},la=ui?"altKey":"ctrlKey";for(var ha in Fo.dragstart=function(t,e){var n=e,r=t.input.mouseDown;if(r&&r.done(),n.dataTransfer){var i=t.state.selection,o=i.empty?null:t.posAtCoords(Zo(n));if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof Un?i.to-1:i.to)))if(r&&r.mightDrag)t.dispatch(t.state.tr.setSelection(Un.create(t.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){var a=t.docView.nearestDesc(n.target,!0);a&&a.node.type.spec.draggable&&a!=t.docView&&t.dispatch(t.state.tr.setSelection(Un.create(t.state.doc,a.posBefore)))}var s=t.state.selection.content(),u=Ao(t,s),c=u.dom,l=u.text;n.dataTransfer.clearData(),n.dataTransfer.setData(sa?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",sa||n.dataTransfer.setData("text/plain",l),t.dragging=new ca(s,!n[la])}},Fo.dragend=function(t){var e=t.dragging;window.setTimeout((function(){t.dragging==e&&(t.dragging=null)}),50)},qo.dragover=qo.dragenter=function(t,e){return e.preventDefault()},qo.drop=function(t,e){var n=e,r=t.dragging;if(t.dragging=null,n.dataTransfer){var i=t.posAtCoords(Zo(n));if(i){var o=t.state.doc.resolve(i.pos),a=r&&r.slice;a?t.someProp("transformPasted",(function(e){a=e(a,t)})):a=Oo(t,n.dataTransfer.getData(sa?"Text":"text/plain"),sa?null:n.dataTransfer.getData("text/html"),!1,o);var s=!(!r||n[la]);if(t.someProp("handleDrop",(function(e){return e(t,n,a||Zt.empty,s)})))n.preventDefault();else if(a){n.preventDefault();var u=a?xn(t.state.doc,o.pos,a):o.pos;null==u&&(u=o.pos);var c=t.state.tr;s&&c.deleteSelection();var l=c.mapping.map(u),h=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,f=c.doc;if(h?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),!c.doc.eq(f)){var d=c.doc.resolve(l);if(h&&Un.isSelectable(a.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new Un(d));else{var p=c.mapping.map(u);c.mapping.maps[c.mapping.maps.length-1].forEach((function(t,e,n,r){return p=r})),c.setSelection(fo(t,d,c.doc.resolve(p)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))}}}}},Fo.focus=function(t){t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((function(){t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&ro(t)}),20))},Fo.blur=function(t,e){var n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},Fo.beforeinput=function(t,e){if(ii&&ci&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();var n=t.input.domChangeCount;setTimeout((function(){if(t.input.domChangeCount==n&&(t.dom.blur(),t.focus(),!t.someProp("handleKeyDown",(function(e){return e(t,Zr(8,"Backspace"))})))){var e=t.state.selection.$cursor;e&&e.pos>0&&t.dispatch(t.state.tr.delete(e.pos-1,e.pos).scrollIntoView())}}),50)}},qo)Fo[ha]=qo[ha];function fa(t,e){if(t==e)return!0;for(var n in t)if(t[n]!==e[n])return!1;for(var r in e)if(!(r in t))return!1;return!0}var da=function(){function t(e,n){C(this,t),this.toDOM=e,this.spec=n||ya,this.side=this.spec.side||0}return E(t,[{key:"map",value:function(t,e,n,r){var i=t.mapResult(e.from+r,this.side<0?-1:1),o=i.pos;return i.deleted?null:new ma(o-n,o-n,this)}},{key:"valid",value:function(){return!0}},{key:"eq",value:function(e){return this==e||e instanceof t&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&fa(this.spec,e.spec))}},{key:"destroy",value:function(t){this.spec.destroy&&this.spec.destroy(t)}}]),t}(),pa=function(){function t(e,n){C(this,t),this.attrs=e,this.spec=n||ya}return E(t,[{key:"map",value:function(t,e,n,r){var i=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,o=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new ma(i,o,this)}},{key:"valid",value:function(t,e){return e.from<e.to}},{key:"eq",value:function(e){return this==e||e instanceof t&&fa(this.attrs,e.attrs)&&fa(this.spec,e.spec)}},{key:"destroy",value:function(){}}],[{key:"is",value:function(e){return e.type instanceof t}}]),t}(),va=function(){function t(e,n){C(this,t),this.attrs=e,this.spec=n||ya}return E(t,[{key:"map",value:function(t,e,n,r){var i=t.mapResult(e.from+r,1);if(i.deleted)return null;var o=t.mapResult(e.to+r,-1);return o.deleted||o.pos<=i.pos?null:new ma(i.pos-n,o.pos-n,this)}},{key:"valid",value:function(t,e){var n,r=t.content.findIndex(e.from),i=r.index,o=r.offset;return o==e.from&&!(n=t.child(i)).isText&&o+n.nodeSize==e.to}},{key:"eq",value:function(e){return this==e||e instanceof t&&fa(this.attrs,e.attrs)&&fa(this.spec,e.spec)}},{key:"destroy",value:function(){}}]),t}(),ma=function(){function t(e,n,r){C(this,t),this.from=e,this.to=n,this.type=r}return E(t,[{key:"copy",value:function(e,n){return new t(e,n,this.type)}},{key:"eq",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to}},{key:"map",value:function(t,e,n){return this.type.map(t,this,e,n)}},{key:"spec",get:function(){return this.type.spec}},{key:"inline",get:function(){return this.type instanceof pa}}],[{key:"widget",value:function(e,n,r){return new t(e,e,new da(n,r))}},{key:"inline",value:function(e,n,r,i){return new t(e,n,new pa(r,i))}},{key:"node",value:function(e,n,r,i){return new t(e,n,new va(r,i))}}]),t}(),ga=[],ya={},ba=function(){function t(e,n){C(this,t),this.local=e.length?e:ga,this.children=n.length?n:ga}return E(t,[{key:"find",value:function(t,e,n){var r=[];return this.findInner(null!==t&&void 0!==t?t:0,null!==e&&void 0!==e?e:1e9,r,0,n),r}},{key:"findInner",value:function(t,e,n,r,i){for(var o=0;o<this.local.length;o++){var a=this.local[o];a.from<=e&&a.to>=t&&(!i||i(a.spec))&&n.push(a.copy(a.from+r,a.to+r))}for(var s=0;s<this.children.length;s+=3)if(this.children[s]<e&&this.children[s+1]>t){var u=this.children[s]+1;this.children[s+2].findInner(t-u,e-u,n,r+u,i)}}},{key:"map",value:function(t,e,n){return this==wa||0==t.maps.length?this:this.mapInner(t,e,0,0,n||ya)}},{key:"mapInner",value:function(e,n,r,i,o){for(var a,s=0;s<this.local.length;s++){var u=this.local[s].map(e,r,i);u&&u.type.valid(n,u)?(a||(a=[])).push(u):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?xa(this.children,a||[],e,n,r,i,o):a?new t(a.sort(Ea),ga):wa}},{key:"add",value:function(e,n){return n.length?this==wa?t.create(e,n):this.addInner(e,n,0):this}},{key:"addInner",value:function(e,n,r){var i,o=this,a=0;e.forEach((function(t,e){var s,u=e+r;if(s=Sa(n,t,u)){for(i||(i=o.children.slice());a<i.length&&i[a]<e;)a+=3;i[a]==e?i[a+2]=i[a+2].addInner(t,s,u+1):i.splice(a,0,e,e+t.nodeSize,Ma(s,t,u+1,ya)),a+=3}}));for(var s=ka(a?Ca(n):n,-r),u=0;u<s.length;u++)s[u].type.valid(e,s[u])||s.splice(u--,1);return new t(s.length?this.local.concat(s).sort(Ea):this.local,i||this.children)}},{key:"remove",value:function(t){return 0==t.length||this==wa?this:this.removeInner(t,0)}},{key:"removeInner",value:function(e,n){for(var r=this.children,i=this.local,o=0;o<r.length;o+=3){for(var a,s=void 0,u=r[o]+n,c=r[o+1]+n,l=0;l<e.length;l++)(a=e[l])&&a.from>u&&a.to<c&&(e[l]=null,(s||(s=[])).push(a));if(s){r==this.children&&(r=this.children.slice());var h=r[o+2].removeInner(s,u+1);h!=wa?r[o+2]=h:(r.splice(o,3),o-=3)}}if(i.length)for(var f,d=0;d<e.length;d++)if(f=e[d])for(var p=0;p<i.length;p++)i[p].eq(f,n)&&(i==this.local&&(i=this.local.slice()),i.splice(p--,1));return r==this.children&&i==this.local?this:i.length||r.length?new t(i,r):wa}},{key:"forChild",value:function(e,n){if(this==wa)return this;if(n.isLeaf)return t.empty;for(var r,i,o=0;o<this.children.length;o+=3)if(this.children[o]>=e){this.children[o]==e&&(r=this.children[o+2]);break}for(var a=e+1,s=a+n.content.size,u=0;u<this.local.length;u++){var c=this.local[u];if(c.from<s&&c.to>a&&c.type instanceof pa){var l=Math.max(a,c.from)-a,h=Math.min(s,c.to)-a;l<h&&(i||(i=[])).push(c.copy(l,h))}}if(i){var f=new t(i.sort(Ea),ga);return r?new _a([f,r]):f}return r||wa}},{key:"eq",value:function(e){if(this==e)return!0;if(!(e instanceof t)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(var n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(var r=0;r<this.children.length;r+=3)if(this.children[r]!=e.children[r]||this.children[r+1]!=e.children[r+1]||!this.children[r+2].eq(e.children[r+2]))return!1;return!0}},{key:"locals",value:function(t){return Ta(this.localsInner(t))}},{key:"localsInner",value:function(t){if(this==wa)return ga;if(t.inlineContent||!this.local.some(pa.is))return this.local;for(var e=[],n=0;n<this.local.length;n++)this.local[n].type instanceof pa||e.push(this.local[n]);return e}}],[{key:"create",value:function(t,e){return e.length?Ma(e,t,0,ya):wa}}]),t}();ba.empty=new ba([],[]),ba.removeOverlap=Ta;var wa=ba.empty,_a=function(){function t(e){C(this,t),this.members=e}return E(t,[{key:"map",value:function(e,n){var r=this.members.map((function(t){return t.map(e,n,ya)}));return t.from(r)}},{key:"forChild",value:function(e,n){if(n.isLeaf)return ba.empty;for(var r=[],i=0;i<this.members.length;i++){var o=this.members[i].forChild(e,n);o!=wa&&(o instanceof t?r=r.concat(o.members):r.push(o))}return t.from(r)}},{key:"eq",value:function(e){if(!(e instanceof t)||e.members.length!=this.members.length)return!1;for(var n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}},{key:"locals",value:function(t){for(var e,n=!0,r=0;r<this.members.length;r++){var i=this.members[r].localsInner(t);if(i.length)if(e){n&&(e=e.slice(),n=!1);for(var o=0;o<i.length;o++)e.push(i[o])}else e=i}return e?Ta(n?e:e.sort(Ea)):ga}}],[{key:"from",value:function(e){switch(e.length){case 0:return wa;case 1:return e[0];default:return new t(e.every((function(t){return t instanceof ba}))?e:e.reduce((function(t,e){return t.concat(e instanceof ba?e:e.members)}),[]))}}}]),t}();function xa(t,e,n,r,i,o,a){for(var s=t.slice(),u=function(t,e){var r=0;n.maps[t].forEach((function(t,n,o,a){for(var u=a-o-(n-t),c=0;c<s.length;c+=3){var l=s[c+1];if(!(l<0||t>l+e-r)){var h=s[c]+e-r;n>=h?s[c+1]=t<=h?-2:-1:o>=i&&u&&(s[c]+=u,s[c+1]+=u)}}r+=u})),e=n.maps[t].map(e,-1),l=e},c=0,l=o;c<n.maps.length;c++)u(c,l);for(var h=!1,f=0;f<s.length;f+=3)if(s[f+1]<0){if(-2==s[f+1]){h=!0,s[f+1]=-1;continue}var d=n.map(t[f]+o),p=d-i;if(p<0||p>=r.content.size){h=!0;continue}var v=n.map(t[f+1]+o,-1)-i,m=r.content.findIndex(p),g=m.index,y=m.offset,b=r.maybeChild(g);if(b&&y==p&&y+b.nodeSize==v){var w=s[f+2].mapInner(n,b,d+1,t[f]+o+1,a);w!=wa?(s[f]=p,s[f+1]=v,s[f+2]=w):(s[f+1]=-2,h=!0)}else h=!0}if(h){var _=Ma(function(t,e,n,r,i,o,a){function s(t,e){for(var o=0;o<t.local.length;o++){var u=t.local[o].map(r,i,e);u?n.push(u):a.onRemove&&a.onRemove(t.local[o].spec)}for(var c=0;c<t.children.length;c+=3)s(t.children[c+2],t.children[c]+e+1)}for(var u=0;u<t.length;u+=3)-1==t[u+1]&&s(t[u+2],e[u]+o+1);return n}(s,t,e,n,i,o,a),r,0,a);e=_.local;for(var x=0;x<s.length;x+=3)s[x+1]<0&&(s.splice(x,3),x-=3);for(var k=0,S=0;k<_.children.length;k+=3){for(var C=_.children[k];S<s.length&&s[S]<C;)S+=3;s.splice(S,0,_.children[k],_.children[k+1],_.children[k+2])}}return new ba(e.sort(Ea),s)}function ka(t,e){if(!e||!t.length)return t;for(var n=[],r=0;r<t.length;r++){var i=t[r];n.push(new ma(i.from+e,i.to+e,i.type))}return n}function Sa(t,e,n){if(e.isLeaf)return null;for(var r,i=n+e.nodeSize,o=null,a=0;a<t.length;a++)(r=t[a])&&r.from>n&&r.to<i&&((o||(o=[])).push(r),t[a]=null);return o}function Ca(t){for(var e=[],n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function Ma(t,e,n,r){var i=[],o=!1;e.forEach((function(e,a){var s=Sa(t,e,a+n);if(s){o=!0;var u=Ma(s,e,n+a+1,r);u!=wa&&i.push(a,a+e.nodeSize,u)}}));for(var a=ka(o?Ca(t):t,-n).sort(Ea),s=0;s<a.length;s++)a[s].type.valid(e,a[s])||(r.onRemove&&r.onRemove(a[s].spec),a.splice(s--,1));return a.length||i.length?new ba(a,i):wa}function Ea(t,e){return t.from-e.from||t.to-e.to}function Ta(t){for(var e=t,n=0;n<e.length-1;n++){var r=e[n];if(r.from!=r.to)for(var i=n+1;i<e.length;i++){var o=e[i];if(o.from!=r.from){o.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,o.from),Aa(e,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,r.to),Aa(e,i+1,o.copy(r.to,o.to)))}}return e}function Aa(t,e,n){for(;e<t.length&&Ea(n,t[e])>0;)e++;t.splice(e,0,n)}function Oa(t){var e=[];return t.someProp("decorations",(function(n){var r=n(t.state);r&&r!=wa&&e.push(r)})),t.cursorWrapper&&e.push(ba.create(t.state.doc,[t.cursorWrapper.deco])),_a.from(e)}var Da={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Pa=ti&&ei<=11,La=function(){function t(){C(this,t),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return E(t,[{key:"set",value:function(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}},{key:"clear",value:function(){this.anchorNode=this.focusNode=null}},{key:"eq",value:function(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}]),t}(),Na=function(){function t(e,n){var r=this;C(this,t),this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new La,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((function(t){for(var e=0;e<t.length;e++)r.queue.push(t[e]);ti&&ei<=11&&t.some((function(t){return"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length}))?r.flushSoon():r.flush()})),Pa&&(this.onCharData=function(t){r.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),r.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}return E(t,[{key:"flushSoon",value:function(){var t=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){t.flushingSoon=-1,t.flush()}),20))}},{key:"forceFlush",value:function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}},{key:"start",value:function(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Da)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}},{key:"stop",value:function(){var t=this;if(this.observer){var e=this.observer.takeRecords();if(e.length){for(var n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout((function(){return t.flush()}),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}},{key:"connectSelection",value:function(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}},{key:"disconnectSelection",value:function(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}},{key:"suppressSelectionUpdates",value:function(){var t=this;this.suppressingSelectionUpdates=!0,setTimeout((function(){return t.suppressingSelectionUpdates=!1}),50)}},{key:"onSelectionChange",value:function(){if(po(this.view)){if(this.suppressingSelectionUpdates)return ro(this.view);if(ti&&ei<=11&&!this.view.state.selection.empty){var t=this.view.domSelectionRange();if(t.focusNode&&Fr(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}},{key:"setCurSelection",value:function(){this.currentSelection.set(this.view.domSelectionRange())}},{key:"ignoreSelectionChange",value:function(t){if(!t.focusNode)return!0;for(var e,n=new Set,r=t.focusNode;r;r=zr(r))n.add(r);for(var i=t.anchorNode;i;i=zr(i))if(n.has(i)){e=i;break}var o=e&&this.view.docView.nearestDesc(e);return o&&o.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0}},{key:"flush",value:function(){var t=this.view;if(t.docView&&!(this.flushingSoon>-1)){var e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);var n=t.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&po(t)&&!this.ignoreSelectionChange(n),i=-1,o=-1,a=!1,s=[];if(t.editable)for(var u=0;u<e.length;u++){var c=this.registerMutation(e[u],s);c&&(i=i<0?c.from:Math.min(c.from,i),o=o<0?c.to:Math.max(c.to,o),c.typeOver&&(a=!0))}if(ni&&s.length>1){var l=s.filter((function(t){return"BR"==t.nodeName}));if(2==l.length){var h=l[0],f=l[1];h.parentNode&&h.parentNode.parentNode==f.parentNode?f.remove():h.remove()}}var d=null;i<0&&r&&t.input.lastFocus>Date.now()-200&&t.input.lastTouch<Date.now()-300&&Wr(n)&&(d=eo(t))&&d.eq(Bn.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,ro(t),this.currentSelection.set(n),t.scrollToSelection()):(i>-1||r)&&(i>-1&&(t.docView.markDirty(i,o),function(t){if(!Ra.has(t)&&(Ra.set(t,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace))){if(t.requiresGeckoHackNode=ni,Ia)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Ia=!0}}(t)),this.handleDOMChange(i,o,a,s),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(n)||ro(t),this.currentSelection.set(n))}}},{key:"registerMutation",value:function(t,e){if(e.indexOf(t.target)>-1)return null;var n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style"))||!n||n.ignoreMutation(t))return null;if("childList"==t.type){for(var r=0;r<t.addedNodes.length;r++)e.push(t.addedNodes[r]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(t.target))return{from:n.posBefore,to:n.posAfter};var i=t.previousSibling,o=t.nextSibling;if(ti&&ei<=11&&t.addedNodes.length)for(var a=0;a<t.addedNodes.length;a++){var s=t.addedNodes[a],u=s.previousSibling,c=s.nextSibling;(!u||Array.prototype.indexOf.call(t.addedNodes,u)<0)&&(i=u),(!c||Array.prototype.indexOf.call(t.addedNodes,c)<0)&&(o=c)}var l=i&&i.parentNode==t.target?Ir(i)+1:0,h=n.localPosFromDOM(t.target,l,-1),f=o&&o.parentNode==t.target?Ir(o):t.target.childNodes.length;return{from:h,to:n.localPosFromDOM(t.target,f,1)}}return"attributes"==t.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}}}]),t}(),Ra=new WeakMap,Ia=!1;function za(t){var e=t.pmViewDesc;if(e)return e.parseRule();if("BR"==t.nodeName&&t.parentNode){if(ai&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){var n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(t.parentNode.lastChild==t||ai&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}function Ba(t,e,n,r,i){if(e<0){var o=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,a=eo(t,o);if(a&&!t.state.selection.eq(a)){if(ii&&ci&&13===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",(function(e){return e(t,Zr(13,"Enter"))})))return;var s=t.state.tr.setSelection(a);"pointer"==o?s.setMeta("pointer",!0):"key"==o&&s.scrollIntoView(),t.dispatch(s)}}else{var u=t.state.doc.resolve(e),c=u.sharedDepth(n);e=u.before(c+1),n=t.state.doc.resolve(n).after(c+1);var l,h,f=t.state.selection,d=function(t,e,n){var r,i=t.docView.parseRange(e,n),o=i.node,a=i.fromOffset,s=i.toOffset,u=i.from,c=i.to,l=t.domSelectionRange(),h=l.anchorNode;if(h&&t.dom.contains(1==h.nodeType?h:h.parentNode)&&(r=[{node:h,offset:l.anchorOffset}],Wr(l)||r.push({node:l.focusNode,offset:l.focusOffset})),ii&&8===t.input.lastKeyCode)for(var f=s;f>a;f--){var d=o.childNodes[f-1],p=d.pmViewDesc;if("BR"==d.nodeName&&!p){s=f;break}if(!p||p.size)break}var v=t.state.doc,m=t.someProp("domParser")||Pe.fromSchema(t.state.schema),g=v.resolve(u),y=null,b=m.parse(o,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:a,to:s,preserveWhitespace:"pre"!=g.parent.type.whitespace||"full",findPositions:r,ruleFromNode:za,context:g});if(r&&null!=r[0].pos){var w=r[0].pos,_=r[1]&&r[1].pos;null==_&&(_=w),y={anchor:w+u,head:_+u}}return{doc:b,sel:y,from:u,to:c}}(t,e,n),p=t.state.doc,v=p.slice(d.from,d.to);8===t.input.lastKeyCode&&Date.now()-100<t.input.lastKeyCodeTime?(l=t.state.selection.to,h="end"):(l=t.state.selection.from,h="start"),t.input.lastKeyCode=null;var m=function(t,e,n,r,i){var o=t.findDiffStart(e,n);if(null==o)return null;var a=t.findDiffEnd(e,n+t.size,n+e.size),s=a.a,u=a.b;if("end"==i){r-=s+Math.max(0,o-Math.min(s,u))-o}if(s<o&&t.size<e.size){u=(o-=r<=o&&r>=s?o-r:0)+(u-s),s=o}else if(u<o){s=(o-=r<=o&&r>=u?o-r:0)+(s-u),u=o}return{start:o,endA:s,endB:u}}(v.content,d.doc.content,d.from,l,h);if((si&&t.input.lastIOSEnter>Date.now()-225||ci)&&i.some((function(t){return"DIV"==t.nodeName||"P"==t.nodeName||"LI"==t.nodeName}))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",(function(e){return e(t,Zr(13,"Enter"))})))t.input.lastIOSEnter=0;else{if(!m){if(!(r&&f instanceof $n&&!f.empty&&f.$head.sameParent(f.$anchor))||t.composing||d.sel&&d.sel.anchor!=d.sel.head){if(d.sel){var g=ja(t,t.state.doc,d.sel);g&&!g.eq(t.state.selection)&&t.dispatch(t.state.tr.setSelection(g))}return}m={start:f.from,endA:f.to,endB:f.to}}if(ii&&t.cursorWrapper&&d.sel&&d.sel.anchor==t.cursorWrapper.deco.from&&d.sel.head==d.sel.anchor){var y=m.endB-m.start;d.sel={anchor:d.sel.anchor+y,head:d.sel.anchor+y}}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&m.start==m.endB&&t.state.selection instanceof $n&&(m.start>t.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?m.start=t.state.selection.from:m.endA<t.state.selection.to&&m.endA>=t.state.selection.to-2&&t.state.selection.to<=d.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),ti&&ei<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>d.from&&" \xa0"==d.doc.textBetween(m.start-d.from-1,m.start-d.from+1)&&(m.start--,m.endA--,m.endB--);var b,w=d.doc.resolveNoCache(m.start-d.from),_=d.doc.resolveNoCache(m.endB-d.from),x=p.resolve(m.start),k=w.sameParent(_)&&w.parent.inlineContent&&x.end()>=m.endA;if((si&&t.input.lastIOSEnter>Date.now()-225&&(!k||i.some((function(t){return"DIV"==t.nodeName||"P"==t.nodeName})))||!k&&w.pos<d.doc.content.size&&(b=Bn.findFrom(d.doc.resolve(w.pos+1),1,!0))&&b.head==_.pos)&&t.someProp("handleKeyDown",(function(e){return e(t,Zr(13,"Enter"))})))t.input.lastIOSEnter=0;else if(t.state.selection.anchor>m.start&&function(t,e,n,r,i){if(!r.parent.isTextblock||n-e<=i.pos-r.pos||Fa(r,!0,!1)<i.pos)return!1;var o=t.resolve(e);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;var a=t.resolve(Fa(o,!0,!0));return!(!a.parent.isTextblock||a.pos>n||Fa(a,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(a.parent.content)}(p,m.start,m.endA,w,_)&&t.someProp("handleKeyDown",(function(e){return e(t,Zr(8,"Backspace"))})))ci&&ii&&t.domObserver.suppressSelectionUpdates();else{ii&&ci&&m.endB==m.start&&(t.input.lastAndroidDelete=Date.now()),ci&&!k&&w.start()!=_.start()&&0==_.parentOffset&&w.depth==_.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==m.endA&&(m.endB-=2,_=d.doc.resolveNoCache(m.endB-d.from),setTimeout((function(){t.someProp("handleKeyDown",(function(e){return e(t,Zr(13,"Enter"))}))}),20));var S,C,M,E=m.start,T=m.endA;if(k)if(w.pos==_.pos)ti&&ei<=11&&0==w.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout((function(){return ro(t)}),20)),S=t.state.tr.delete(E,T),C=p.resolve(m.start).marksAcross(p.resolve(m.endA));else if(m.endA==m.endB&&(M=function(t,e){for(var n,r,i,o=t.firstChild.marks,a=e.firstChild.marks,s=o,u=a,c=0;c<a.length;c++)s=a[c].removeFromSet(s);for(var l=0;l<o.length;l++)u=o[l].removeFromSet(u);if(1==s.length&&0==u.length)r=s[0],n="add",i=function(t){return t.mark(r.addToSet(t.marks))};else{if(0!=s.length||1!=u.length)return null;r=u[0],n="remove",i=function(t){return t.mark(r.removeFromSet(t.marks))}}for(var h=[],f=0;f<e.childCount;f++)h.push(i(e.child(f)));if(qt.from(h).eq(t))return{mark:r,type:n}}(w.parent.content.cut(w.parentOffset,_.parentOffset),x.parent.content.cut(x.parentOffset,m.endA-x.start()))))S=t.state.tr,"add"==M.type?S.addMark(E,T,M.mark):S.removeMark(E,T,M.mark);else if(w.parent.child(w.index()).isText&&w.index()==_.index()-(_.textOffset?0:1)){var A=w.parent.textBetween(w.parentOffset,_.parentOffset);if(t.someProp("handleTextInput",(function(e){return e(t,E,T,A)})))return;S=t.state.tr.insertText(A,E,T)}if(S||(S=t.state.tr.replace(E,T,d.doc.slice(m.start-d.from,m.endB-d.from))),d.sel){var O=ja(t,S.doc,d.sel);O&&!(ii&&ci&&t.composing&&O.empty&&(m.start!=m.endB||t.input.lastAndroidDelete<Date.now()-100)&&(O.head==E||O.head==S.mapping.map(T)-1)||ti&&O.empty&&O.head==E)&&S.setSelection(O)}C&&S.ensureMarks(C),t.dispatch(S.scrollIntoView())}}}}function ja(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:fo(t,e.resolve(n.anchor),e.resolve(n.head))}function Fa(t,e,n){for(var r=t.depth,i=e?t.end():t.pos;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n)for(var o=t.node(r).maybeChild(t.indexAfter(r));o&&!o.isLeaf;)o=o.firstChild,i++;return i}var qa=function(){function t(e,n){var r=this;C(this,t),this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Vo,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Wa),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Ua(this),Va(this),this.nodeViews=Ha(this),this.docView=ji(this.state.doc,$a(this),Oa(this),this.dom,this),this.domObserver=new Na(this,(function(t,e,n,i){return Ba(r,t,e,n,i)})),this.domObserver.start(),function(t){var e=function(e){var n=Fo[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=function(e){(function(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(var n=e.target;n!=t.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0})(t,e)&&!Wo(t,e)&&(t.editable||!(e.type in qo))&&n(t,e)},$o[e]?{passive:!0}:void 0)};for(var n in Fo)e(n);ai&&t.dom.addEventListener("input",(function(){return null})),Ho(t)}(this),this.updatePluginViews()}return E(t,[{key:"composing",get:function(){return this.input.composing}},{key:"props",get:function(){if(this._props.state!=this.state){var t=this._props;for(var e in this._props={},t)this._props[e]=t[e];this._props.state=this.state}return this._props}},{key:"update",value:function(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Ho(this);var e=this._props;this._props=t,t.plugins&&(t.plugins.forEach(Wa),this.directPlugins=t.plugins),this.updateStateInner(t.state,e)}},{key:"setProps",value:function(t){var e={};for(var n in this._props)e[n]=this._props[n];for(var r in e.state=this.state,t)e[r]=t[r];this.update(e)}},{key:"updateState",value:function(t){this.updateStateInner(t,this._props)}},{key:"updateStateInner",value:function(t,e){var n=this.state,r=!1,i=!1;t.storedMarks&&this.composing&&(oa(this),i=!0),this.state=t;var o=n.plugins!=t.plugins||this._props.plugins!=e.plugins;if(o||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){var a=Ha(this);(function(t,e){var n=0,r=0;for(var i in t){if(t[i]!=e[i])return!0;n++}for(var o in e)r++;return n!=r})(a,this.nodeViews)&&(this.nodeViews=a,r=!0)}(o||e.handleDOMEvents!=this._props.handleDOMEvents)&&Ho(this),this.editable=Ua(this),Va(this);var s=Oa(this),u=$a(this),c=n.plugins==t.plugins||n.doc.eq(t.doc)?t.scrollToSelection>n.scrollToSelection?"to selection":"preserve":"reset",l=r||!this.docView.matchesNode(t.doc,u,s);(l||!t.selection.eq(n.selection))&&(i=!0);var h="preserve"==c&&i&&null==this.dom.style.overflowAnchor&&function(t){for(var e,n,r=t.dom.getBoundingClientRect(),i=Math.max(0,r.top),o=(r.left+r.right)/2,a=i+1;a<Math.min(innerHeight,r.bottom);a+=5){var s=t.root.elementFromPoint(o,a);if(s&&s!=t.dom&&t.dom.contains(s)){var u=s.getBoundingClientRect();if(u.top>=i-20){e=s,n=u.top;break}}}return{refDOM:e,refTop:n,stack:mi(t.dom)}}(this);if(i){this.domObserver.stop();var f=l&&(ti||ii)&&!this.composing&&!n.selection.empty&&!t.selection.empty&&function(t,e){var n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}(n.selection,t.selection);if(l){var d=ii?this.trackWrites=this.domSelectionRange().focusNode:null;(r||!this.docView.update(t.doc,u,s,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=ji(t.doc,u,s,this.dom,this)),d&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(t){var e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return Fr(e.node,e.offset,n.anchorNode,n.anchorOffset)}(this))?ro(this,f):(lo(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():h&&function(t){var e=t.refDOM,n=t.refTop,r=t.stack,i=e?e.getBoundingClientRect().top:0;gi(r,0==i?0:i-n)}(h)}},{key:"scrollToSelection",value:function(){var t=this,e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",(function(e){return e(t)})))if(this.state.selection instanceof Un){var n=this.docView.domAfterPos(this.state.selection.from);1==n.nodeType&&vi(this,n.getBoundingClientRect(),e)}else vi(this,this.coordsAtPos(this.state.selection.head,1),e)}},{key:"destroyPluginViews",value:function(){for(var t;t=this.pluginViews.pop();)t.destroy&&t.destroy()}},{key:"updatePluginViews",value:function(t){if(t&&t.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(var e=0;e<this.pluginViews.length;e++){var n=this.pluginViews[e];n.update&&n.update(this,t)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(var r=0;r<this.directPlugins.length;r++){var i=this.directPlugins[r];i.spec.view&&this.pluginViews.push(i.spec.view(this))}for(var o=0;o<this.state.plugins.length;o++){var a=this.state.plugins[o];a.spec.view&&this.pluginViews.push(a.spec.view(this))}}}},{key:"someProp",value:function(t,e){var n,r=this._props&&this._props[t];if(null!=r&&(n=e?e(r):r))return n;for(var i=0;i<this.directPlugins.length;i++){var o=this.directPlugins[i].props[t];if(null!=o&&(n=e?e(o):o))return n}var a=this.state.plugins;if(a)for(var s=0;s<a.length;s++){var u=a[s].props[t];if(null!=u&&(n=e?e(u):u))return n}}},{key:"hasFocus",value:function(){if(ti){var t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if("false"==t.contentEditable)return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}},{key:"focus",value:function(){this.domObserver.stop(),this.editable&&function(t){if(t.setActive)return t.setActive();if(yi)return t.focus(yi);var e=mi(t);t.focus(null==yi?{get preventScroll(){return yi={preventScroll:!0},!0}}:void 0),yi||(yi=!1,gi(e,0))}(this.dom),ro(this),this.domObserver.start()}},{key:"root",get:function(){var t=this,e=this._root;if(null==e)for(var n=function(e){if(9==e.nodeType||11==e.nodeType&&e.host)return{v:(e.getSelection||(Object.getPrototypeOf(e).getSelection=function(){return e.ownerDocument.getSelection()}),t._root=e)}},r=this.dom.parentNode;r;r=r.parentNode){var i=n(r);if("object"===D(i))return i.v}return e||document}},{key:"posAtCoords",value:function(t){return xi(this,t)}},{key:"coordsAtPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Ci(this,t,e)}},{key:"domAtPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.domFromPos(t,e)}},{key:"nodeDOM",value:function(t){var e=this.docView.descAt(t);return e?e.nodeDOM:null}},{key:"posAtDOM",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=this.docView.posFromDOM(t,e,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}},{key:"endOfTextblock",value:function(t,e){return Li(this,e||this.state,t)}},{key:"destroy",value:function(){this.docView&&(function(t){for(var e in t.domObserver.stop(),t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Oa(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}},{key:"isDestroyed",get:function(){return null==this.docView}},{key:"dispatchEvent",value:function(t){return function(t,e){!Wo(t,e)&&Fo[e.type]&&(t.editable||!(e.type in qo))&&Fo[e.type](t,e)}(this,t)}},{key:"dispatch",value:function(t){var e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))}},{key:"domSelectionRange",value:function(){return ai&&11===this.root.nodeType&&function(t){for(var e=t.activeElement;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}(this.dom.ownerDocument)==this.dom?function(t){var e,n;function r(t){t.preventDefault(),t.stopImmediatePropagation(),n=t.getTargetRanges()[0]}t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0);var i=n.startContainer,o=n.startOffset,a=n.endContainer,s=n.endOffset,u=t.domAtPos(t.state.selection.anchor);return Fr(u.node,u.offset,a,s)&&(i=(e=[a,s,i,o])[0],o=e[1],a=e[2],s=e[3]),{anchorNode:i,anchorOffset:o,focusNode:a,focusOffset:s}}(this):this.domSelection()}},{key:"domSelection",value:function(){return this.root.getSelection()}}]),t}();function $a(t){var e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),e.translate="no",t.someProp("attributes",(function(n){if("function"==typeof n&&(n=n(t.state)),n)for(var r in n)"class"==r&&(e.class+=" "+n[r]),"style"==r?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&"contenteditable"!=r&&"nodeName"!=r&&(e[r]=String(n[r]))})),[ma.node(0,t.state.doc.content.size,e)]}function Va(t){if(t.markCursor){var e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:ma.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Ua(t){return!t.someProp("editable",(function(e){return!1===e(t.state)}))}function Ha(t){var e=Object.create(null);function n(t){for(var n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function Wa(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}function Za(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new rr({view:function(e){return new Ja(e,t)}})}var Ja=function(){function t(e,n){var r,i=this;C(this,t),this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(r=n.width)&&void 0!==r?r:1,this.color=!1===n.color?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map((function(t){var n=function(e){i[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}}))}return E(t,[{key:"destroy",value:function(){var t=this;this.handlers.forEach((function(e){var n=e.name,r=e.handler;return t.editorView.dom.removeEventListener(n,r)}))}},{key:"update",value:function(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}},{key:"setCursor",value:function(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}},{key:"updateOverlay",value:function(){var t,e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent;if(n){var r=e.nodeBefore,i=e.nodeAfter;if(r||i){var o=this.editorView.nodeDOM(this.cursorPos-(r?r.nodeSize:0));if(o){var a=o.getBoundingClientRect(),s=r?a.bottom:a.top;r&&i&&(s=(s+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),t={left:a.left,right:a.right,top:s-this.width/2,bottom:s+this.width/2}}}}if(!t){var u=this.editorView.coordsAtPos(this.cursorPos);t={left:u.left-this.width/2,right:u.left+this.width/2,top:u.top,bottom:u.bottom}}var c,l,h=this.editorView.dom.offsetParent;if(this.element||(this.element=h.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),!h||h==document.body&&"static"==getComputedStyle(h).position)c=-pageXOffset,l=-pageYOffset;else{var f=h.getBoundingClientRect();c=f.left-h.scrollLeft,l=f.top-h.scrollTop}this.element.style.left=t.left-c+"px",this.element.style.top=t.top-l+"px",this.element.style.width=t.right-t.left+"px",this.element.style.height=t.bottom-t.top+"px"}},{key:"scheduleRemoval",value:function(t){var e=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return e.setCursor(null)}),t)}},{key:"dragover",value:function(t){if(this.editorView.editable){var e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),n=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,e,t):r;if(e&&!i){var o=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){var a=xn(this.editorView.state.doc,o,this.editorView.dragging.slice);null!=a&&(o=a)}this.setCursor(o),this.scheduleRemoval(5e3)}}}},{key:"dragend",value:function(){this.scheduleRemoval(20)}},{key:"drop",value:function(){this.scheduleRemoval(20)}},{key:"dragleave",value:function(t){(t.target==this.editorView.dom||!this.editorView.dom.contains(t.relatedTarget))&&this.setCursor(null)}}]),t}(),Ya=function(t){v(n,t);var e=m(n);function n(t){return C(this,n),e.call(this,t,t)}return E(n,[{key:"map",value:function(t,e){var r=t.resolve(e.map(this.head));return n.valid(r)?new n(r):Bn.near(r)}},{key:"content",value:function(){return Zt.empty}},{key:"eq",value:function(t){return t instanceof n&&t.head==this.head}},{key:"toJSON",value:function(){return{type:"gapcursor",pos:this.head}}},{key:"getBookmark",value:function(){return new Ka(this.anchor)}}],[{key:"fromJSON",value:function(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new n(t.resolve(e.pos))}},{key:"valid",value:function(t){var e=t.parent;if(e.isTextblock||!function(t){for(var e=t.depth;e>=0;e--){var n=t.index(e),r=t.node(e);if(0!=n)for(var i=r.child(n-1);;i=i.lastChild){if(0==i.childCount&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(t)||!function(t){for(var e=t.depth;e>=0;e--){var n=t.indexAfter(e),r=t.node(e);if(n!=r.childCount)for(var i=r.child(n);;i=i.firstChild){if(0==i.childCount&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(t))return!1;var n=e.type.spec.allowGapCursor;if(null!=n)return n;var r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock}},{key:"findGapCursorFrom",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t:for(;;){if(!r&&n.valid(t))return t;for(var i=t.pos,o=null,a=t.depth;;a--){var s=t.node(a);if(e>0?t.indexAfter(a)<s.childCount:t.index(a)>0){o=s.child(e>0?t.indexAfter(a):t.index(a)-1);break}if(0==a)return null;i+=e;var u=t.doc.resolve(i);if(n.valid(u))return u}for(;;){var c=e>0?o.firstChild:o.lastChild;if(!c){if(o.isAtom&&!o.isText&&!Un.isSelectable(o)){t=t.doc.resolve(i+o.nodeSize*e),r=!1;continue t}break}o=c,i+=e;var l=t.doc.resolve(i);if(n.valid(l))return l}return null}}}]),n}(Bn);Ya.prototype.visible=!1,Ya.findFrom=Ya.findGapCursorFrom,Bn.jsonID("gapcursor",Ya);var Ka=function(){function t(e){C(this,t),this.pos=e}return E(t,[{key:"map",value:function(e){return new t(e.map(this.pos))}},{key:"resolve",value:function(t){var e=t.resolve(this.pos);return Ya.valid(e)?new Ya(e):Bn.near(e)}}]),t}();var Ga=Rr({ArrowLeft:Xa("horiz",-1),ArrowRight:Xa("horiz",1),ArrowUp:Xa("vert",-1),ArrowDown:Xa("vert",1)});function Xa(t,e){var n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,r,i){var o=t.selection,a=e>0?o.$to:o.$from,s=o.empty;if(o instanceof $n){if(!i.endOfTextblock(n)||0==a.depth)return!1;s=!1,a=t.doc.resolve(e>0?a.after():a.before())}var u=Ya.findGapCursorFrom(a,e,s);return!!u&&(r&&r(t.tr.setSelection(new Ya(u))),!0)}}function Qa(t,e,n){if(!t||!t.editable)return!1;var r=t.state.doc.resolve(e);if(!Ya.valid(r))return!1;var i=t.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&Un.isSelectable(t.state.doc.nodeAt(i.inside)))&&(t.dispatch(t.state.tr.setSelection(new Ya(r))),!0)}function ts(t,e){if("insertCompositionText"!=e.inputType||!(t.state.selection instanceof Ya))return!1;var n=t.state.selection.$from,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;for(var i=qt.empty,o=r.length-1;o>=0;o--)i=qt.from(r[o].createAndFill(null,i));var a=t.state.tr.replace(n.pos,n.pos,new Zt(i,0,0));return a.setSelection($n.near(a.doc.resolve(n.pos+1))),t.dispatch(a),!1}function es(t){if(!(t.selection instanceof Ya))return null;var e=document.createElement("div");return e.className="ProseMirror-gapcursor",ba.create(t.doc,[ma.widget(t.selection.head,e,{key:"gapcursor"})])}("undefined"===typeof globalThis?"undefined":D(globalThis))<"u"?globalThis:("undefined"===typeof window?"undefined":D(window))<"u"?window:("undefined"===typeof t?"undefined":D(t))<"u"||("undefined"===typeof self?"undefined":D(self))<"u"&&self;var ns={};function rs(t,e){if(t===e)return!0;if(!t||"object"!=D(t)||!e||"object"!=D(e))return!1;var n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(var r=0;r<t.length;r++)if(!rs(t[r],e[r]))return!1}else{for(var i in t)if(!(i in e)||!rs(t[i],e[i]))return!1;for(var o in e)if(!(o in t))return!1}return!0}!function(t){var e=function(){function t(t,e){return null!=e&&t instanceof e}var e,n,i;try{e=Map}catch(u){e=function(){}}try{n=Set}catch(c){n=function(){}}try{i=Promise}catch(l){i=function(){}}function o(a,u,c,l,h){"object"==D(u)&&(c=u.depth,l=u.prototype,h=u.includeNonEnumerable,u=u.circular);var f=[],d=[],p=("undefined"===typeof r?"undefined":D(r))<"u";return D(u)>"u"&&(u=!0),D(c)>"u"&&(c=1/0),function a(c,v){if(null===c)return null;if(0===v)return c;var m,g;if("object"!=D(c))return c;if(t(c,e))m=new e;else if(t(c,n))m=new n;else if(t(c,i))m=new i((function(t,e){c.then((function(e){t(a(e,v-1))}),(function(t){e(a(t,v-1))}))}));else if(o.__isArray(c))m=[];else if(o.__isRegExp(c))m=new RegExp(c.source,s(c)),c.lastIndex&&(m.lastIndex=c.lastIndex);else if(o.__isDate(c))m=new Date(c.getTime());else{if(p&&r.isBuffer(c))return m=r.allocUnsafe?r.allocUnsafe(c.length):new r(c.length),c.copy(m),m;t(c,Error)?m=Object.create(c):D(l)>"u"?(g=Object.getPrototypeOf(c),m=Object.create(g)):(m=Object.create(l),g=l)}if(u){var y=f.indexOf(c);if(-1!=y)return d[y];f.push(c),d.push(m)}for(var b in t(c,e)&&c.forEach((function(t,e){var n=a(e,v-1),r=a(t,v-1);m.set(n,r)})),t(c,n)&&c.forEach((function(t){var e=a(t,v-1);m.add(e)})),c){var w;g&&(w=Object.getOwnPropertyDescriptor(g,b)),(!w||null!=w.set)&&(m[b]=a(c[b],v-1))}if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(c);for(b=0;b<_.length;b++){var x=_[b];(S=Object.getOwnPropertyDescriptor(c,x))&&!S.enumerable&&!h||(m[x]=a(c[x],v-1),S.enumerable||Object.defineProperty(m,x,{enumerable:!1}))}}if(h){var k=Object.getOwnPropertyNames(c);for(b=0;b<k.length;b++){var S,C=k[b];(S=Object.getOwnPropertyDescriptor(c,C))&&S.enumerable||(m[C]=a(c[C],v-1),Object.defineProperty(m,C,{enumerable:!1}))}}return m}(a,c)}function a(t){return Object.prototype.toString.call(t)}function s(t){var e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),e}return o.clonePrototype=function(t){if(null===t)return null;var e=function(){};return e.prototype=t,new e},o.__objToStr=a,o.__isDate=function(t){return"object"==D(t)&&"[object Date]"===a(t)},o.__isArray=function(t){return"object"==D(t)&&"[object Array]"===a(t)},o.__isRegExp=function(t){return"object"==D(t)&&"[object RegExp]"===a(t)},o.__getRegExpFlags=s,o}();t.exports&&(t.exports=e)}({get exports(){return ns},set exports(t){ns=t}});var is=function(){function t(e,n,r,i,o){var a,s=this;C(this,t),this.node=r,this.view=i,this.getPos=o,this.ignoreMutation=function(t){return!("attributes"!==t.type&&!s.isComponentUpdating&&!Array.from(s.dom.querySelectorAll("[contenteditable=false]")).find((function(e){return t.target==e||e.contains(t.target)})))},this.node=r,this.view=i,this.getPos=o;var u=document.createElement("div"),c={attrs:ns(r.attrs),contentDOM:function(t){return s.contentDOM=t},rootDOM:function(t){return s.dom=t},view:i,controls:{delete:function(){return s.deleteNode()},update:function(t){var e=t(s.view.state,r,o);s.view.dispatch(e)}}};(function(t,e){var n=new RegExp("was created with unknown prop '(".concat(Object.keys(t).join("|"),")'")),r=console.warn;console.warn=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];return!("string"==typeof t&&n.test(t))&&r.apply(void 0,[t].concat(i))},e(),console.warn=r})(c,(function(){s.component=new e({target:u,props:c})})),this.component.$$.before_update.push((function(){return s.isComponentUpdating=!0})),this.component.$$.after_update.push((function(){window.setTimeout((function(){return s.isComponentUpdating=!1}))})),this.dom=null!=(a=this.dom)?a:u,this.dom.classList.add("svelte-node-view"),this.dom.classList.add("svelte-node-view--".concat(n.name));var l=this.component.$$.props.attrs;this.component.$$.bound[l]=function(t){rs(t,s.node.attrs)||s.view.dispatch(s.view.state.tr.setNodeMarkup(o(),null,t))}}return E(t,[{key:"deleteNode",value:function(){var t=this.view.state.tr.delete(this.getPos(),this.getPos()+1);this.view.dispatch(t)}},{key:"update",value:function(t){return t.type===this.node.type&&(this.component.$set({attrs:ns(t.attrs)}),this.node=t,!0)}},{key:"stopEvent",value:function(t){return!(t instanceof DragEvent)}}]),t}();var as,ss,us=function(t){var e=function(t,e){var n=Object.entries(t).map((function(t){var n=d(t,2),r=n[0],i=n[1];return[r,e(i,r)]}));return Object.fromEntries(n)}(t.nodes,(function(t,e){return function(t,e){return function(n,r,i){return new is(t,e,n,r,i)}}(t,{name:e})}));return new rr({key:new ar("prosemirror-svelte"),props:{nodeViews:e}})};if(("undefined"===typeof WeakMap?"undefined":D(WeakMap))<"u"){var cs=new WeakMap;as=function(t){return cs.get(t)},ss=function(t,e){return cs.set(t,e),e}}else{var ls=[],hs=0;as=function(t){for(var e=0;e<ls.length;e+=2)if(ls[e]==t)return ls[e+1]},ss=function(t,e){return 10==hs&&(hs=0),ls[hs++]=t,ls[hs++]=e}}var fs=function(){function t(e,n,r,i){C(this,t),this.width=e,this.height=n,this.map=r,this.problems=i}return E(t,[{key:"findCell",value:function(t){for(var e=0;e<this.map.length;e++){var n=this.map[e];if(n==t){for(var r=e%this.width,i=e/this.width|0,o=r+1,a=i+1,s=1;o<this.width&&this.map[e+s]==n;s++)o++;for(var u=1;a<this.height&&this.map[e+this.width*u]==n;u++)a++;return{left:r,top:i,right:o,bottom:a}}}throw new RangeError("No cell with offset ".concat(t," found"))}},{key:"colCount",value:function(t){for(var e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError("No cell with offset ".concat(t," found"))}},{key:"nextCell",value:function(t,e,n){var r=this.findCell(t),i=r.left,o=r.right,a=r.top,s=r.bottom;return"horiz"==e?(n<0?0==i:o==this.width)?null:this.map[a*this.width+(n<0?i-1:o)]:(n<0?0==a:s==this.height)?null:this.map[i+this.width*(n<0?a-1:s)]}},{key:"rectBetween",value:function(t,e){var n=this.findCell(t),r=n.left,i=n.right,o=n.top,a=n.bottom,s=this.findCell(e),u=s.left,c=s.right,l=s.top,h=s.bottom;return{left:Math.min(r,u),top:Math.min(o,l),right:Math.max(i,c),bottom:Math.max(a,h)}}},{key:"cellsInRect",value:function(t){for(var e=[],n={},r=t.top;r<t.bottom;r++)for(var i=t.left;i<t.right;i++){var o=r*this.width+i,a=this.map[o];n[a]||(n[a]=!0,!(i==t.left&&i&&this.map[o-1]==a||r==t.top&&r&&this.map[o-this.width]==a)&&e.push(a))}return e}},{key:"positionAt",value:function(t,e,n){for(var r=0,i=0;;r++){var o=i+n.child(r).nodeSize;if(r==t){for(var a=e+t*this.width,s=(t+1)*this.width;a<s&&this.map[a]<i;)a++;return a==s?o-1:this.map[a]}i=o}}}],[{key:"get",value:function(t){return as(t)||ss(t,ds(t))}}]),t}();function ds(t){if("table"!=t.type.spec.tableRole)throw new RangeError("Not a table node: "+t.type.name);for(var e=function(t){for(var e=-1,n=!1,r=0;r<t.childCount;r++){var i=t.child(r),o=0;if(n)for(var a=0;a<r;a++)for(var s=t.child(a),u=0;u<s.childCount;u++){var c=s.child(u);a+c.attrs.rowspan>r&&(o+=c.attrs.colspan)}for(var l=0;l<i.childCount;l++){var h=i.child(l);o+=h.attrs.colspan,h.attrs.rowspan>1&&(n=!0)}-1==e?e=o:e!=o&&(e=Math.max(e,o))}return e}(t),n=t.childCount,r=[],i=0,o=null,a=[],s=0,u=e*n;s<u;s++)r[s]=0;for(var c=0,l=0;c<n;c++){var h=t.child(c);l++;for(var f=0;;f++){for(;i<r.length&&0!=r[i];)i++;if(f==h.childCount)break;for(var d=h.child(f),p=d.attrs,v=p.colspan,m=p.rowspan,g=p.colwidth,y=0;y<m;y++){if(y+c>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:l,n:m-y});break}for(var b=i+y*e,w=0;w<v;w++){0==r[b+w]?r[b+w]=l:(o||(o=[])).push({type:"collision",row:c,pos:l,n:v-w});var _=g&&g[w];if(_){var x=(b+w)%e*2,k=a[x];null==k||k!=_&&1==a[x+1]?(a[x]=_,a[x+1]=1):k==_&&a[x+1]++}}}i+=v,l+=d.nodeSize}for(var S=(c+1)*e,C=0;i<S;)0==r[i++]&&C++;C&&(o||(o=[])).push({type:"missing",row:c,n:C}),l++}for(var M=new fs(e,n,r,o),E=!1,T=0;!E&&T<a.length;T+=2)null!=a[T]&&a[T+1]<n&&(E=!0);return E&&function(t,e,n){t.problems||(t.problems=[]);for(var r={},i=0;i<t.map.length;i++){var o=t.map[i];if(!r[o]){r[o]=!0;var a=n.nodeAt(o);if(!a)throw new RangeError("No cell with offset ".concat(o," found"));for(var s=null,u=a.attrs,c=0;c<u.colspan;c++){var l=e[2*((i+c)%t.width)];null!=l&&(!u.colwidth||u.colwidth[c]!=l)&&((s||(s=ps(u)))[c]=l)}s&&t.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:s})}}}(M,a,t),M}function ps(t){if(t.colwidth)return t.colwidth.slice();for(var e=[],n=0;n<t.colspan;n++)e.push(0);return e}function vs(t,e){if("string"==typeof t)return{};var n=t.getAttribute("data-colwidth"),r=n&&/^\d+(,\d+)*$/.test(n)?n.split(",").map((function(t){return Number(t)})):null,i=Number(t.getAttribute("colspan")||1),o={colspan:i,rowspan:Number(t.getAttribute("rowspan")||1),colwidth:r&&r.length==i?r:null};for(var a in e){var s=e[a].getFromDOM,u=s&&s(t);null!=u&&(o[a]=u)}return o}function ms(t,e){var n={};for(var r in 1!=t.attrs.colspan&&(n.colspan=t.attrs.colspan),1!=t.attrs.rowspan&&(n.rowspan=t.attrs.rowspan),t.attrs.colwidth&&(n["data-colwidth"]=t.attrs.colwidth.join(",")),e){var i=e[r].setDOMAttr;i&&i(t.attrs[r],n)}return n}function gs(t){var e=t.cached.tableNodeTypes;if(!e)for(var n in e=t.cached.tableNodeTypes={},t.nodes){var r=t.nodes[n],i=r.spec.tableRole;i&&(e[i]=r)}return e}function ys(t){for(var e=t.selection.$head,n=e.depth;n>0;n--)if("row"==e.node(n).type.spec.tableRole)return!0;return!1}function bs(t){return"row"==t.parent.type.spec.tableRole&&!!t.nodeAfter}function ws(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function _s(t,e,n){var r=t.node(-1),i=fs.get(r),o=t.start(-1),a=i.nextCell(t.pos-o,e,n);return null==a?null:t.node(0).resolve(o+a)}function xs(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=h(h({},t),{},{colspan:t.colspan-n});return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some((function(t){return t>0}))||(r.colwidth=null)),r}new ar("selectingCells");var ks=function(t){v(n,t);var e=m(n);function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;C(this,n);var o=t.node(-1),a=fs.get(o),s=t.start(-1),u=a.rectBetween(t.pos-s,i.pos-s),c=t.node(0),l=a.cellsInRect(u).filter((function(t){return t!=i.pos-s}));l.unshift(i.pos-s);var h=l.map((function(t){var e=o.nodeAt(t);if(!e)throw RangeError("No cell with offset ".concat(t," found"));var n=s+t+1;return new jn(c.resolve(n),c.resolve(n+e.content.size))}));return(r=e.call(this,h[0].$from,h[0].$to,h)).$anchorCell=t,r.$headCell=i,r}return E(n,[{key:"map",value:function(t,e){var r=t.resolve(e.map(this.$anchorCell.pos)),i=t.resolve(e.map(this.$headCell.pos));if(bs(r)&&bs(i)&&ws(r,i)){var o=this.$anchorCell.node(-1)!=r.node(-1);return o&&this.isRowSelection()?n.rowSelection(r,i):o&&this.isColSelection()?n.colSelection(r,i):new n(r,i)}return $n.between(r,i)}},{key:"content",value:function(){for(var t=this.$anchorCell.node(-1),e=fs.get(t),n=this.$anchorCell.start(-1),r=e.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},o=[],a=r.top;a<r.bottom;a++){for(var s=[],u=a*e.width+r.left,c=r.left;c<r.right;c++,u++){var l=e.map[u];if(!i[l]){i[l]=!0;var f=e.findCell(l),d=t.nodeAt(l);if(!d)throw RangeError("No cell with offset ".concat(l," found"));var p=r.left-f.left,v=f.right-r.right;if(p>0||v>0){var m=d.attrs;if(p>0&&(m=xs(m,0,p)),v>0&&(m=xs(m,m.colspan-v,v)),f.left<r.left){if(!(d=d.type.createAndFill(m)))throw RangeError("Could not create cell with attrs ".concat(JSON.stringify(m)))}else d=d.type.create(m,d.content)}if(f.top<r.top||f.bottom>r.bottom){var g=h(h({},d.attrs),{},{rowspan:Math.min(f.bottom,r.bottom)-Math.max(f.top,r.top)});d=f.top<r.top?d.type.createAndFill(g):d.type.create(g,d.content)}s.push(d)}}o.push(t.child(a).copy(qt.from(s)))}var y=this.isColSelection()&&this.isRowSelection()?t:o;return new Zt(qt.from(y),1,1)}},{key:"replace",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Zt.empty,n=t.steps.length,r=this.ranges,i=0;i<r.length;i++){var o=r[i],a=o.$from,s=o.$to,u=t.mapping.slice(n);t.replace(u.map(a.pos),u.map(s.pos),i?Zt.empty:e)}var c=Bn.findFrom(t.doc.resolve(t.mapping.slice(n).map(this.to)),-1);c&&t.setSelection(c)}},{key:"replaceWith",value:function(t,e){this.replace(t,new Zt(qt.from(e),0,0))}},{key:"forEachCell",value:function(t){for(var e=this.$anchorCell.node(-1),n=fs.get(e),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r)),o=0;o<i.length;o++)t(e.nodeAt(i[o]),r+i[o])}},{key:"isColSelection",value:function(){var t=this.$anchorCell.index(-1),e=this.$headCell.index(-1);if(Math.min(t,e)>0)return!1;var n=t+this.$anchorCell.nodeAfter.attrs.rowspan,r=e+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}},{key:"isRowSelection",value:function(){var t=this.$anchorCell.node(-1),e=fs.get(t),n=this.$anchorCell.start(-1),r=e.colCount(this.$anchorCell.pos-n),i=e.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;var o=r+this.$anchorCell.nodeAfter.attrs.colspan,a=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,a)==e.width}},{key:"eq",value:function(t){return t instanceof n&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}},{key:"toJSON",value:function(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}},{key:"getBookmark",value:function(){return new Ss(this.$anchorCell.pos,this.$headCell.pos)}}],[{key:"colSelection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,r=t.node(-1),i=fs.get(r),o=t.start(-1),a=i.findCell(t.pos-o),s=i.findCell(e.pos-o),u=t.node(0);return a.top<=s.top?(a.top>0&&(t=u.resolve(o+i.map[a.left])),s.bottom<i.height&&(e=u.resolve(o+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(e=u.resolve(o+i.map[s.left])),a.bottom<i.height&&(t=u.resolve(o+i.map[i.width*(i.height-1)+a.right-1]))),new n(t,e)}},{key:"rowSelection",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,r=t.node(-1),i=fs.get(r),o=t.start(-1),a=i.findCell(t.pos-o),s=i.findCell(e.pos-o),u=t.node(0);return a.left<=s.left?(a.left>0&&(t=u.resolve(o+i.map[a.top*i.width])),s.right<i.width&&(e=u.resolve(o+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(e=u.resolve(o+i.map[s.top*i.width])),a.right<i.width&&(t=u.resolve(o+i.map[i.width*(a.top+1)-1]))),new n(t,e)}},{key:"fromJSON",value:function(t,e){return new n(t.resolve(e.anchor),t.resolve(e.head))}},{key:"create",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return new n(t.resolve(e),t.resolve(r))}}]),n}(Bn);ks.prototype.visible=!1,Bn.jsonID("cell",ks);var Ss=function(){function t(e,n){C(this,t),this.anchor=e,this.head=n}return E(t,[{key:"map",value:function(e){return new t(e.map(this.anchor),e.map(this.head))}},{key:"resolve",value:function(t){var e=t.resolve(this.anchor),n=t.resolve(this.head);return"row"==e.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&e.index()<e.parent.childCount&&n.index()<n.parent.childCount&&ws(e,n)?new ks(e,n):Bn.near(n,1)}}]),t}();function Cs(t,e,n){return!n.eq(t.selection)&&(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Ms(t,e){return function(n,r,i){if(!i)return!1;var o=n.selection;if(o instanceof ks)return Cs(n,r,Bn.near(o.$headCell,e));if("horiz"!=t&&!o.empty)return!1;var a=As(i,t,e);if(null==a)return!1;if("horiz"==t)return Cs(n,r,Bn.near(n.doc.resolve(o.head+e),e));var s,u=n.doc.resolve(a),c=_s(u,t,e);return s=c?Bn.near(c,1):e<0?Bn.near(n.doc.resolve(u.before(-1)),-1):Bn.near(n.doc.resolve(u.after(-1)),1),Cs(n,r,s)}}function Es(t,e){return function(n,r,i){if(!i)return!1;var o,a=n.selection;if(a instanceof ks)o=a;else{var s=As(i,t,e);if(null==s)return!1;o=new ks(n.doc.resolve(s))}var u=_s(o.$headCell,t,e);return!!u&&Cs(n,r,new ks(o.$anchorCell,u))}}function Ts(t,e){var n=t.selection;if(!(n instanceof ks))return!1;if(e){var r=t.tr,i=gs(t.schema).cell.createAndFill().content;n.forEachCell((function(t,e){t.content.eq(i)||r.replace(r.mapping.map(e+1),r.mapping.map(e+t.nodeSize-1),new Zt(i,0,0))})),r.docChanged&&e(r)}return!0}function As(t,e,n){if(!(t.state.selection instanceof $n))return null;for(var r=t.state.selection.$head,i=r.depth-1;i>=0;i--){var o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if("cell"==o.type.spec.tableRole||"header_cell"==o.type.spec.tableRole){var a=r.before(i),s="vert"==e?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(s)?a:null}}return null}function Os(t){var e=t.selection,n=function(t){var e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&"cell"==e.node.type.spec.tableRole)return e.$anchor;var n=function(t){for(var e=t.depth-1;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return t.node(0).resolve(t.before(e+1));return null}(e.$head)||function(t){for(var e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){var r=e.type.spec.tableRole;if("cell"==r||"header_cell"==r)return t.doc.resolve(n)}for(var i=t.nodeBefore,o=t.pos;i;i=i.lastChild,o--){var a=i.type.spec.tableRole;if("cell"==a||"header_cell"==a)return t.doc.resolve(o-i.nodeSize)}}(e.$head);if(n)return n;throw new RangeError("No cell found around position ".concat(e.head))}(t),r=n.node(-1),i=n.start(-1),o=fs.get(r);return h(h({},e instanceof ks?o.rectBetween(e.$anchorCell.pos-i,e.$headCell.pos-i):o.findCell(n.pos-i)),{},{tableStart:i,map:o,table:r})}function Ds(t,e,n){for(var r=e.map.cellsInRect({left:0,top:0,right:"row"==t?e.map.width:1,bottom:"column"==t?e.map.height:1}),i=0;i<r.length;i++){var o=e.table.nodeAt(r[i]);if(o&&o.type!==n.header_cell)return!1}return!0}function Ps(t,e){return(e=e||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(t){return function(e,n){if(!ys(e))return!1;if(n){for(var r=gs(e.schema),i=Os(e),o=e.tr,a=i.map.cellsInRect("column"==t?{left:i.left,top:0,right:i.right,bottom:i.map.height}:"row"==t?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=a.map((function(t){return i.table.nodeAt(t)})),u=0;u<a.length;u++)s[u].type==r.header_cell&&o.setNodeMarkup(i.tableStart+a[u],r.cell,s[u].attrs);if(0==o.steps.length)for(var c=0;c<a.length;c++)o.setNodeMarkup(i.tableStart+a[c],r.header_cell,s[c].attrs);n(o)}return!0}}(t):function(e,n){if(!ys(e))return!1;if(n){var r=gs(e.schema),i=Os(e),o=e.tr,a=Ds("row",i,r),s=Ds("column",i,r),u=("column"===t?a:"row"===t&&s)?1:0,c="column"==t?{left:0,top:u,right:1,bottom:i.map.height}:"row"==t?{left:u,top:0,right:i.map.width,bottom:1}:i,l="column"==t?s?r.cell:r.header_cell:"row"==t?a?r.cell:r.header_cell:r.cell;i.map.cellsInRect(c).forEach((function(t){var e=t+i.tableStart,n=o.doc.nodeAt(e);n&&o.setNodeMarkup(e,l,n.attrs)})),n(o)}return!0}}new ar("fix-tables"),Rr({ArrowLeft:Ms("horiz",-1),ArrowRight:Ms("horiz",1),ArrowUp:Ms("vert",-1),ArrowDown:Ms("vert",1),"Shift-ArrowLeft":Es("horiz",-1),"Shift-ArrowRight":Es("horiz",1),"Shift-ArrowUp":Es("vert",-1),"Shift-ArrowDown":Es("vert",1),Backspace:Ts,"Mod-Backspace":Ts,Delete:Ts,"Mod-Delete":Ts}),new ar("tableColumnResizing"),Ps("row",{useDeprecatedLogic:!0}),Ps("column",{useDeprecatedLogic:!0}),Ps("cell",{useDeprecatedLogic:!0});var Ls=/[A-Z]/g,Ns=/^ms-/,Rs={};function Is(t){return"-"+t.toLowerCase()}function zs(t){if(Rs.hasOwnProperty(t))return Rs[t];var e=t.replace(Ls,Is);return Rs[t]=Ns.test(e)?"-"+e:e}var Bs={};!function(t,e){var n;n=function(){var t=JSON.parse('{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","\xa2":"cent","\xa3":"pound","\xa4":"currency","\xa5":"yen","\xa9":"(c)","\xaa":"a","\xae":"(r)","\xba":"o","\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xc6":"AE","\xc7":"C","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xd0":"D","\xd1":"N","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xdd":"Y","\xde":"TH","\xdf":"ss","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xe6":"ae","\xe7":"c","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xf0":"d","\xf1":"n","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xfd":"y","\xfe":"th","\xff":"y","\u0100":"A","\u0101":"a","\u0102":"A","\u0103":"a","\u0104":"A","\u0105":"a","\u0106":"C","\u0107":"c","\u010c":"C","\u010d":"c","\u010e":"D","\u010f":"d","\u0110":"DJ","\u0111":"dj","\u0112":"E","\u0113":"e","\u0116":"E","\u0117":"e","\u0118":"e","\u0119":"e","\u011a":"E","\u011b":"e","\u011e":"G","\u011f":"g","\u0122":"G","\u0123":"g","\u0128":"I","\u0129":"i","\u012a":"i","\u012b":"i","\u012e":"I","\u012f":"i","\u0130":"I","\u0131":"i","\u0136":"k","\u0137":"k","\u013b":"L","\u013c":"l","\u013d":"L","\u013e":"l","\u0141":"L","\u0142":"l","\u0143":"N","\u0144":"n","\u0145":"N","\u0146":"n","\u0147":"N","\u0148":"n","\u014c":"O","\u014d":"o","\u0150":"O","\u0151":"o","\u0152":"OE","\u0153":"oe","\u0154":"R","\u0155":"r","\u0158":"R","\u0159":"r","\u015a":"S","\u015b":"s","\u015e":"S","\u015f":"s","\u0160":"S","\u0161":"s","\u0162":"T","\u0163":"t","\u0164":"T","\u0165":"t","\u0168":"U","\u0169":"u","\u016a":"u","\u016b":"u","\u016e":"U","\u016f":"u","\u0170":"U","\u0171":"u","\u0172":"U","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017a":"z","\u017b":"Z","\u017c":"z","\u017d":"Z","\u017e":"z","\u018f":"E","\u0192":"f","\u01a0":"O","\u01a1":"o","\u01af":"U","\u01b0":"u","\u01c8":"LJ","\u01c9":"lj","\u01cb":"NJ","\u01cc":"nj","\u0218":"S","\u0219":"s","\u021a":"T","\u021b":"t","\u0259":"e","\u02da":"o","\u0386":"A","\u0388":"E","\u0389":"H","\u038a":"I","\u038c":"O","\u038e":"Y","\u038f":"W","\u0390":"i","\u0391":"A","\u0392":"B","\u0393":"G","\u0394":"D","\u0395":"E","\u0396":"Z","\u0397":"H","\u0398":"8","\u0399":"I","\u039a":"K","\u039b":"L","\u039c":"M","\u039d":"N","\u039e":"3","\u039f":"O","\u03a0":"P","\u03a1":"R","\u03a3":"S","\u03a4":"T","\u03a5":"Y","\u03a6":"F","\u03a7":"X","\u03a8":"PS","\u03a9":"W","\u03aa":"I","\u03ab":"Y","\u03ac":"a","\u03ad":"e","\u03ae":"h","\u03af":"i","\u03b0":"y","\u03b1":"a","\u03b2":"b","\u03b3":"g","\u03b4":"d","\u03b5":"e","\u03b6":"z","\u03b7":"h","\u03b8":"8","\u03b9":"i","\u03ba":"k","\u03bb":"l","\u03bc":"m","\u03bd":"n","\u03be":"3","\u03bf":"o","\u03c0":"p","\u03c1":"r","\u03c2":"s","\u03c3":"s","\u03c4":"t","\u03c5":"y","\u03c6":"f","\u03c7":"x","\u03c8":"ps","\u03c9":"w","\u03ca":"i","\u03cb":"y","\u03cc":"o","\u03cd":"y","\u03ce":"w","\u0401":"Yo","\u0402":"DJ","\u0404":"Ye","\u0406":"I","\u0407":"Yi","\u0408":"J","\u0409":"LJ","\u040a":"NJ","\u040b":"C","\u040f":"DZ","\u0410":"A","\u0411":"B","\u0412":"V","\u0413":"G","\u0414":"D","\u0415":"E","\u0416":"Zh","\u0417":"Z","\u0418":"I","\u0419":"J","\u041a":"K","\u041b":"L","\u041c":"M","\u041d":"N","\u041e":"O","\u041f":"P","\u0420":"R","\u0421":"S","\u0422":"T","\u0423":"U","\u0424":"F","\u0425":"H","\u0426":"C","\u0427":"Ch","\u0428":"Sh","\u0429":"Sh","\u042a":"U","\u042b":"Y","\u042c":"","\u042d":"E","\u042e":"Yu","\u042f":"Ya","\u0430":"a","\u0431":"b","\u0432":"v","\u0433":"g","\u0434":"d","\u0435":"e","\u0436":"zh","\u0437":"z","\u0438":"i","\u0439":"j","\u043a":"k","\u043b":"l","\u043c":"m","\u043d":"n","\u043e":"o","\u043f":"p","\u0440":"r","\u0441":"s","\u0442":"t","\u0443":"u","\u0444":"f","\u0445":"h","\u0446":"c","\u0447":"ch","\u0448":"sh","\u0449":"sh","\u044a":"u","\u044b":"y","\u044c":"","\u044d":"e","\u044e":"yu","\u044f":"ya","\u0451":"yo","\u0452":"dj","\u0454":"ye","\u0456":"i","\u0457":"yi","\u0458":"j","\u0459":"lj","\u045a":"nj","\u045b":"c","\u045d":"u","\u045f":"dz","\u0490":"G","\u0491":"g","\u0492":"GH","\u0493":"gh","\u049a":"KH","\u049b":"kh","\u04a2":"NG","\u04a3":"ng","\u04ae":"UE","\u04af":"ue","\u04b0":"U","\u04b1":"u","\u04ba":"H","\u04bb":"h","\u04d8":"AE","\u04d9":"ae","\u04e8":"OE","\u04e9":"oe","\u0531":"A","\u0532":"B","\u0533":"G","\u0534":"D","\u0535":"E","\u0536":"Z","\u0537":"E\'","\u0538":"Y\'","\u0539":"T\'","\u053a":"JH","\u053b":"I","\u053c":"L","\u053d":"X","\u053e":"C\'","\u053f":"K","\u0540":"H","\u0541":"D\'","\u0542":"GH","\u0543":"TW","\u0544":"M","\u0545":"Y","\u0546":"N","\u0547":"SH","\u0549":"CH","\u054a":"P","\u054b":"J","\u054c":"R\'","\u054d":"S","\u054e":"V","\u054f":"T","\u0550":"R","\u0551":"C","\u0553":"P\'","\u0554":"Q\'","\u0555":"O\'\'","\u0556":"F","\u0587":"EV","\u0621":"a","\u0622":"aa","\u0623":"a","\u0624":"u","\u0625":"i","\u0626":"e","\u0627":"a","\u0628":"b","\u0629":"h","\u062a":"t","\u062b":"th","\u062c":"j","\u062d":"h","\u062e":"kh","\u062f":"d","\u0630":"th","\u0631":"r","\u0632":"z","\u0633":"s","\u0634":"sh","\u0635":"s","\u0636":"dh","\u0637":"t","\u0638":"z","\u0639":"a","\u063a":"gh","\u0641":"f","\u0642":"q","\u0643":"k","\u0644":"l","\u0645":"m","\u0646":"n","\u0647":"h","\u0648":"w","\u0649":"a","\u064a":"y","\u064b":"an","\u064c":"on","\u064d":"en","\u064e":"a","\u064f":"u","\u0650":"e","\u0652":"","\u0660":"0","\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u067e":"p","\u0686":"ch","\u0698":"zh","\u06a9":"k","\u06af":"g","\u06cc":"y","\u06f0":"0","\u06f1":"1","\u06f2":"2","\u06f3":"3","\u06f4":"4","\u06f5":"5","\u06f6":"6","\u06f7":"7","\u06f8":"8","\u06f9":"9","\u0e3f":"baht","\u10d0":"a","\u10d1":"b","\u10d2":"g","\u10d3":"d","\u10d4":"e","\u10d5":"v","\u10d6":"z","\u10d7":"t","\u10d8":"i","\u10d9":"k","\u10da":"l","\u10db":"m","\u10dc":"n","\u10dd":"o","\u10de":"p","\u10df":"zh","\u10e0":"r","\u10e1":"s","\u10e2":"t","\u10e3":"u","\u10e4":"f","\u10e5":"k","\u10e6":"gh","\u10e7":"q","\u10e8":"sh","\u10e9":"ch","\u10ea":"ts","\u10eb":"dz","\u10ec":"ts","\u10ed":"ch","\u10ee":"kh","\u10ef":"j","\u10f0":"h","\u1e62":"S","\u1e63":"s","\u1e80":"W","\u1e81":"w","\u1e82":"W","\u1e83":"w","\u1e84":"W","\u1e85":"w","\u1e9e":"SS","\u1ea0":"A","\u1ea1":"a","\u1ea2":"A","\u1ea3":"a","\u1ea4":"A","\u1ea5":"a","\u1ea6":"A","\u1ea7":"a","\u1ea8":"A","\u1ea9":"a","\u1eaa":"A","\u1eab":"a","\u1eac":"A","\u1ead":"a","\u1eae":"A","\u1eaf":"a","\u1eb0":"A","\u1eb1":"a","\u1eb2":"A","\u1eb3":"a","\u1eb4":"A","\u1eb5":"a","\u1eb6":"A","\u1eb7":"a","\u1eb8":"E","\u1eb9":"e","\u1eba":"E","\u1ebb":"e","\u1ebc":"E","\u1ebd":"e","\u1ebe":"E","\u1ebf":"e","\u1ec0":"E","\u1ec1":"e","\u1ec2":"E","\u1ec3":"e","\u1ec4":"E","\u1ec5":"e","\u1ec6":"E","\u1ec7":"e","\u1ec8":"I","\u1ec9":"i","\u1eca":"I","\u1ecb":"i","\u1ecc":"O","\u1ecd":"o","\u1ece":"O","\u1ecf":"o","\u1ed0":"O","\u1ed1":"o","\u1ed2":"O","\u1ed3":"o","\u1ed4":"O","\u1ed5":"o","\u1ed6":"O","\u1ed7":"o","\u1ed8":"O","\u1ed9":"o","\u1eda":"O","\u1edb":"o","\u1edc":"O","\u1edd":"o","\u1ede":"O","\u1edf":"o","\u1ee0":"O","\u1ee1":"o","\u1ee2":"O","\u1ee3":"o","\u1ee4":"U","\u1ee5":"u","\u1ee6":"U","\u1ee7":"u","\u1ee8":"U","\u1ee9":"u","\u1eea":"U","\u1eeb":"u","\u1eec":"U","\u1eed":"u","\u1eee":"U","\u1eef":"u","\u1ef0":"U","\u1ef1":"u","\u1ef2":"Y","\u1ef3":"y","\u1ef4":"Y","\u1ef5":"y","\u1ef6":"Y","\u1ef7":"y","\u1ef8":"Y","\u1ef9":"y","\u2013":"-","\u2018":"\'","\u2019":"\'","\u201c":"\\"","\u201d":"\\"","\u201e":"\\"","\u2020":"+","\u2022":"*","\u2026":"...","\u20a0":"ecu","\u20a2":"cruzeiro","\u20a3":"french franc","\u20a4":"lira","\u20a5":"mill","\u20a6":"naira","\u20a7":"peseta","\u20a8":"rupee","\u20a9":"won","\u20aa":"new shequel","\u20ab":"dong","\u20ac":"euro","\u20ad":"kip","\u20ae":"tugrik","\u20af":"drachma","\u20b0":"penny","\u20b1":"peso","\u20b2":"guarani","\u20b3":"austral","\u20b4":"hryvnia","\u20b5":"cedi","\u20b8":"kazakhstani tenge","\u20b9":"indian rupee","\u20ba":"turkish lira","\u20bd":"russian ruble","\u20bf":"bitcoin","\u2120":"sm","\u2122":"tm","\u2202":"d","\u2206":"delta","\u2211":"sum","\u221e":"infinity","\u2665":"love","\u5143":"yuan","\u5186":"yen","\ufdfc":"rial","\ufef5":"laa","\ufef7":"laa","\ufef9":"lai","\ufefb":"la"}'),e=JSON.parse('{"bg":{"\u0419":"Y","\u0426":"Ts","\u0429":"Sht","\u042a":"A","\u042c":"Y","\u0439":"y","\u0446":"ts","\u0449":"sht","\u044a":"a","\u044c":"y"},"de":{"\xc4":"AE","\xe4":"ae","\xd6":"OE","\xf6":"oe","\xdc":"UE","\xfc":"ue","\xdf":"ss","%":"prozent","&":"und","|":"oder","\u2211":"summe","\u221e":"unendlich","\u2665":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","\xa2":"centavos","\xa3":"libras","\xa4":"moneda","\u20a3":"francos","\u2211":"suma","\u221e":"infinito","\u2665":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","\xa2":"centime","\xa3":"livre","\xa4":"devise","\u20a3":"franc","\u2211":"somme","\u221e":"infini","\u2665":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","\xa2":"centavo","\u2211":"soma","\xa3":"libra","\u221e":"infinito","\u2665":"amor"},"uk":{"\u0418":"Y","\u0438":"y","\u0419":"Y","\u0439":"y","\u0426":"Ts","\u0446":"ts","\u0425":"Kh","\u0445":"kh","\u0429":"Shch","\u0449":"shch","\u0413":"H","\u0433":"h"},"vi":{"\u0110":"D","\u0111":"d"},"da":{"\xd8":"OE","\xf8":"oe","\xc5":"AA","\xe5":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"st\xf8rre end"},"nb":{"&":"og","\xc5":"AA","\xc6":"AE","\xd8":"OE","\xe5":"aa","\xe6":"ae","\xf8":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","\xc5":"AA","\xc4":"AE","\xd6":"OE","\xe5":"aa","\xe4":"ae","\xf6":"oe"}}');function n(n,r){if("string"!=typeof n)throw new Error("slugify: string argument expected");var i=e[(r="string"==typeof r?{replacement:r}:r||{}).locale]||{},o=void 0===r.replacement?"-":r.replacement,a=void 0===r.trim||r.trim,s=n.normalize().split("").reduce((function(e,n){var a=i[n]||t[n]||n;return a===o&&(a=" "),e+a.replace(r.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")}),"");return r.strict&&(s=s.replace(/[^A-Za-z0-9\s]/g,"")),a&&(s=s.trim()),s=s.replace(/\s+/g,o),r.lower&&(s=s.toLowerCase()),s}return n.extend=function(e){Object.assign(t,e)},n},t.exports=n(),t.exports.default=n()}({get exports(){return Bs},set exports(t){Bs=t}});var js=Bs;function Fs(t){try{if(!(t instanceof HTMLAnchorElement))return null;for(var e=t.parentElement;e.parentElement;)e=e.parentElement;var n=new URL(t.href),r=n.hash.match(/^#fn([0-9]+)$/);if(!r||r.length<2)return null;var i=r[1],o=e.querySelector(n.hash);if(!o)return null;if(!((o=o.cloneNode(!0))instanceof HTMLElement))throw new Error("footnote no es HTMLElement");var a=o.querySelector('a[href="#fnef'.concat(i,'"]'));return null==a||a.remove(),o}catch(s){return null}}var qs=function(t){return("0"+parseInt(t).toString(16)).slice(-2)};function $s(t){var e=t.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);if(!e)throw new Error("no pude parsear el rgb()");return"#"+qs(e[1])+qs(e[2])+qs(e[3])}function Vs(t){var e=t.style.textAlign||t.getAttribute("data-align")||"start";switch(!(t.style.textAlign||t.getAttribute("data-align"))&&"DIV"===t.parentElement.tagName&&t.parentElement.dataset.align&&(e=t.parentElement.dataset.align),e){case"left":return"start";case"right":return"end";case"justify":return null;default:return[null,"center","start","end"].includes(e)?e:(console.error("align invalido!",{node:t,align:e}),null)}}function Us(t){return function(e){return{level:t,align:Vs(e),id:e.id}}}var Hs=new Oe({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",attrs:{align:{default:"start"}},parseDOM:[{tag:"p",skip:!0,getAttrs:function(t){return!(1!==t.children.length||!["VIDEO","AUDIO","IFRAME","IMG"].includes(t.children[0].nodeName))&&null}},{tag:"p",getAttrs:function(t){return{align:Vs(t)}}}],toDOM:function(t){return["p",{style:"text-align: ".concat(t.attrs.align)},0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM:function(){return["blockquote",{class:"blockquote"},0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:function(){return["div",["hr"]]}},heading:{attrs:{level:{default:1},align:{default:"start"},id:{default:null}},content:"inline*",group:"block",defining:!0,parseDOM:[{tag:"h1",getAttrs:Us(1)},{tag:"h2",getAttrs:Us(2)},{tag:"h3",getAttrs:Us(3)},{tag:"h4",getAttrs:Us(4)},{tag:"h5",getAttrs:Us(5)},{tag:"h6",getAttrs:Us(6)}],toDOM:function(t){var e,n,r=null==(n=null==(e=t.content)?void 0:e.firstChild)?void 0:n.textContent,i={style:"text-align: ".concat(t.attrs.align),id:r?js(r,{lower:!0}):null};return["h"+t.attrs.level,i,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:function(t){return{params:t.getAttribute("data-params")||""}}}],toDOM:function(t){return["pre",t.attrs.params?{"data-params":t.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1}},parseDOM:[{tag:"ol",ignore:!0,getAttrs:function(t){var e,n=S(t.children);try{for(n.s();!(e=n.n()).done;){return!!e.value.id.match(/^fn([0-9]+)$/)&&null}}catch(r){n.e(r)}finally{n.f()}}},{tag:"ol",getAttrs:function(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1}}}],toDOM:function(t){return 1==t.attrs.order?["ol",0]:["ol",{start:t.attrs.order},0]}},bullet_list:{content:"list_item+",group:"block",parseDOM:[{tag:"ul"}],toDOM:function(){return["ul",0]}},list_item:{content:"paragraph block*",defining:!0,parseDOM:[{tag:"li",ignore:!0,getAttrs:function(t){return!!t.id.match(/^fn([0-9]+)$/)&&null}},{tag:"li"}],toDOM:function(){return["li",0]}},text:{group:"inline"},multimedia:{group:"block",attrs:{src:{},kind:{},alt:{default:""}},content:"text*",parseDOM:[{tag:"figure",getAttrs:function(t){var e=t.querySelector("img")||t.querySelector("video")||t.querySelector("audio")||t.querySelector("iframe");return e instanceof HTMLImageElement?{src:e.src,kind:"img"}:e instanceof HTMLVideoElement?{src:e.src,kind:"video"}:e instanceof HTMLAudioElement?{src:e.src,kind:"audio"}:e instanceof HTMLIFrameElement&&{src:e.src,kind:"iframe"}}},{tag:"img",getAttrs:function(t){return{src:t.src,kind:"img",alt:t.alt}}},{tag:"video",getAttrs:function(t){return{src:t.src,kind:"video"}},getContent:function(){return qt.empty}},{tag:"audio",getAttrs:function(t){return{src:t.src,kind:"audio"}},getContent:function(){return qt.empty}},{tag:"iframe",getAttrs:function(t){return{src:t.src,kind:"iframe"}}}],toDOM:function(t){var e=t.attrs,n=e.kind;return["figure",[n,{src:e.src,class:"iframe"===n?"w-100":"img-fluid",controls:["video","audio"].includes(n),alt:"img"===n&&t.attrs.alt||void 0}]]},draggable:!0},footnote:{group:"inline",content:"text*",inline:!0,atom:!0,toDOM:function(){return["footnote"]},parseDOM:[{tag:"footnote"},{tag:"a",priority:100,getAttrs:function(t){return!!Fs(t)&&{}},contentElement:function(t){return Fs(t)}}]},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:function(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:function(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:function(t){return"normal"!=t.style.fontWeight&&null}},{style:"font-weight",getAttrs:function(t){return/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}}],toDOM:function(){return["strong"]}},underline:{parseDOM:[{tag:"u"}],toDOM:function(){return["u"]}},strikethrough:{parseDOM:[{tag:"del"}],toDOM:function(){return["del"]}},sub:{parseDOM:[{tag:"sub"}],toDOM:function(){return["sub"]}},sup:{parseDOM:[{tag:"sup"}],toDOM:function(){return["sup"]}},small:{parseDOM:[{tag:"small"}],toDOM:function(){return["small"]}},mark:{attrs:{color:{default:null},backgroundColor:{default:null},outline:{default:null}},parseDOM:[{tag:"mark",getAttrs:function(t){for(var e={},n=t,r=0,i=["color","backgroundColor"];r<i.length;r++){var o=i[r],a=n.style[o];a&&(e[o]="inherit"===a?a:$s(a))}return e}}],toDOM:function(t){var e=[],n=h({},t.attrs);for(var r in Object.values(n).every((function(t){return null===t||"inherit"===t}))&&(n.outline="1px solid pink"),n){var i=n[r];i&&e.push("".concat(zs(r),":").concat(i))}return["mark",{style:e.join(";")}]}},link:{attrs:{href:{}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:function(t){return{href:t.getAttribute("href")}}}],toDOM:function(t){return["a",h(h({},t.attrs),{},{rel:"noopener",target:"_blank",referrerpolicy:"strict-origin-when-cross-origin"})]}},code:{parseDOM:[{tag:"code"}],toDOM:function(){return["code"]}}}}),Ws=new Oe({marks:Hs.spec.marks,nodes:Hs.spec.nodes.append(function(t){var e=t.cellAttributes||{},n={colspan:{default:1},rowspan:{default:1},colwidth:{default:null}};for(var r in e)n[r]={default:e[r].default};return{table:{content:"table_row+",tableRole:"table",isolating:!0,group:t.tableGroup,parseDOM:[{tag:"table"}],toDOM:function(){return["table",["tbody",0]]}},table_row:{content:"(table_cell | table_header)*",tableRole:"row",parseDOM:[{tag:"tr"}],toDOM:function(){return["tr",0]}},table_cell:{content:t.cellContent,attrs:n,tableRole:"cell",isolating:!0,parseDOM:[{tag:"td",getAttrs:function(t){return vs(t,e)}}],toDOM:function(t){return["td",ms(t,e),0]}},table_header:{content:t.cellContent,attrs:n,tableRole:"header_cell",isolating:!0,parseDOM:[{tag:"th",getAttrs:function(t){return vs(t,e)}}],toDOM:function(t){return["th",ms(t,e),0]}}}}({tableGroup:"block",cellContent:"block+",cellAttributes:{}}))});function Zs(){var t,e=null==(t=document.body.parentElement)?void 0:t.lang;return!e||"es"!=e&&"en"!=e?e?(console.error("docLang no es ni en ni es! Seteando `en` de prepo..."),"en"):(console.error("No hay docLang! Seteando `es` de prepo..."),"es"):e}var Js=function(t,e){return!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0)};function Ys(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t;r;r="start"==e?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function Ks(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function Gs(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){var n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}function Xs(t){for(var e=0;e<t.edgeCount;e++){var n=t.edge(e).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var Qs=function(t){return function(e,n){var r=e.selection,i=r.$from,o=r.$to;if(e.selection instanceof Un&&e.selection.node.isBlock)return!(!i.parentOffset||!gn(e.doc,i.pos))&&(n&&n(e.tr.split(i.pos).scrollIntoView()),!0);if(!i.parent.isBlock)return!1;if(n){var a=o.parentOffset==o.parent.content.size,s=e.tr;(e.selection instanceof $n||e.selection instanceof Wn)&&s.deleteSelection();var u=0==i.depth?null:Xs(i.node(-1).contentMatchAt(i.indexAfter(-1))),c=t&&t(o.parent,a),l=c?[c]:a&&u?[{type:u}]:void 0,h=gn(s.doc,s.mapping.map(i.pos),1,l);if(!l&&!h&&gn(s.doc,s.mapping.map(i.pos),1,u?[{type:u}]:void 0)&&(u&&(l=[{type:u}]),h=!0),h&&(s.split(s.mapping.map(i.pos),1,l),!a&&!i.parentOffset&&i.parent.type!=u)){var f=s.mapping.map(i.before()),d=s.doc.resolve(f);u&&i.node(-1).canReplaceWith(d.index(),d.index()+1,u)&&s.setNodeMarkup(s.mapping.map(i.before()),u)}n(s.scrollIntoView())}return!0}}();function tu(t,e,n){var r,i,o=e.nodeBefore,a=e.nodeAfter;if(o.type.spec.isolating||a.type.spec.isolating)return!1;if(function(t,e,n){var r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!!(r&&i&&r.type.compatibleContent(i.type))&&(!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!(!e.parent.canReplace(o,o+1)||!i.isTextblock&&!bn(t.doc,e.pos))&&(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0))}(t,e,n))return!0;var s=e.parent.canReplace(e.index(),e.index()+1);if(s&&(r=(i=o.contentMatchAt(o.childCount)).findWrapping(a.type))&&i.matchType(r[0]||a.type).validEnd){if(n){for(var u=e.pos+a.nodeSize,c=qt.empty,l=r.length-1;l>=0;l--)c=qt.from(r[l].create(null,c));c=qt.from(o.copy(c));var h=t.tr.step(new sn(e.pos-1,u,e.pos,u,new Zt(c,1,0),r.length,!0)),f=u+2*r.length;bn(h.doc,f)&&h.join(f),n(h.scrollIntoView())}return!0}var d=Bn.findFrom(e,1),p=d&&d.$from.blockRange(d.$to),v=p&&ln(p);if(null!=v&&v>=e.depth)return n&&n(t.tr.lift(p,v).scrollIntoView()),!0;if(s&&Ys(a,"start",!0)&&Ys(o,"end")){for(var m=o,g=[];g.push(m),!m.isTextblock;)m=m.lastChild;for(var y=a,b=1;!y.isTextblock;y=y.firstChild)b++;if(m.canReplace(m.childCount,m.childCount,y.content)){if(n){for(var w=qt.empty,_=g.length-1;_>=0;_--)w=qt.from(g[_].copy(w));n(t.tr.step(new sn(e.pos-g.length,e.pos+a.nodeSize,e.pos+b,e.pos+a.nodeSize-b,new Zt(w,g.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function eu(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){for(var i=!1,o=0;o<n.selection.ranges.length&&!i;o++){var a=n.selection.ranges[o],s=a.$from.pos,u=a.$to.pos;n.doc.nodesBetween(s,u,(function(r,o){if(i)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)i=!0;else{var a=n.doc.resolve(o),s=a.index();i=a.parent.canReplaceWith(s,s+1,t)}}))}if(!i)return!1;if(r){for(var c=n.tr,l=0;l<n.selection.ranges.length;l++){var h=n.selection.ranges[l],f=h.$from.pos,d=h.$to.pos;c.setBlockType(f,d,t,e)}r(c.scrollIntoView())}return!0}}function nu(t,e,n){for(var r=function(r){var i=e[r],o=i.$from,a=i.$to,s=0==o.depth&&(t.inlineContent&&t.type.allowsMarkType(n));if(t.nodesBetween(o.pos,a.pos,(function(t){if(s)return!1;s=t.inlineContent&&t.type.allowsMarkType(n)})),s)return{v:!0}},i=0;i<e.length;i++){var o=r(i);if("object"===D(o))return o.v}return!1}function ru(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t,n,r){for(var i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}function iu(t,e,n){var r=t.slice();return r[9]=e[n],r}function ou(t,e,n){var r=t.slice();return r[9]=e[n],r}function au(t){var e,n,r;return{c:function(){G(e=W("input"),"id",t[9].id),G(e,"name",t[2]),e.value=t[9].value,G(e,"type","radio")},m:function(i,o){V(i,e,o),n||(r=Y(e,"change",t[4]),n=!0)},p:P,d:function(t){t&&U(e),n=!1,r()}}}function su(t){var e,n=t[9].label[t[1]]+"";return{c:function(){e=Z(n)},m:function(t,n){V(t,e,n)},p:P,d:function(t){t&&U(e)}}}function uu(t){var e,n,r,i,o=t[9].label[t[1]]+"";return{c:function(){e=W("i"),n=J(),r=W("span"),i=Z(o),G(e,"aria-hidden","true"),G(e,"class","fa fa-"+t[9].icon),G(r,"class","sr-only")},m:function(t,o){V(t,e,o),V(t,n,o),V(t,r,o),$(r,i)},p:P,d:function(t){t&&U(e),t&&U(n),t&&U(r)}}}function cu(t){var e,n,r,i;var o=(t[9].icon?uu:su)(t);return{c:function(){e=W("label"),o.c(),n=J(),G(e,"for",t[9].id),G(e,"aria-pressed",r=t[0]===t[9].value),G(e,"title",t[9].title?t[9].title[t[1]]:t[9].label[t[1]]),G(e,"class",i="btn btn-info mb-0 "+(t[0]===t[9].value?"active":""))},m:function(t,r){V(t,e,r),o.m(e,null),$(e,n)},p:function(t,n){o.p(t,n),1&n&&r!==(r=t[0]===t[9].value)&&G(e,"aria-pressed",r),1&n&&i!==(i="btn btn-info mb-0 "+(t[0]===t[9].value?"active":""))&&G(e,"class",i)},d:function(t){t&&U(e),o.d()}}}function lu(t){for(var e,n,r,i=t[3],o=[],a=0;a<i.length;a+=1)o[a]=au(ou(t,i,a));for(var s=t[3],u=[],c=0;c<s.length;c+=1)u[c]=cu(iu(t,s,c));return{c:function(){e=W("div");for(var t=0;t<o.length;t+=1)o[t].c();n=J(),r=W("div");for(var i=0;i<u.length;i+=1)u[i].c();G(e,"class","d-none"),G(r,"class","btn-group")},m:function(t,i){V(t,e,i);for(var a=0;a<o.length;a+=1)o[a]&&o[a].m(e,null);V(t,n,i),V(t,r,i);for(var s=0;s<u.length;s+=1)u[s]&&u[s].m(r,null)},p:function(t,n){var a=d(n,1)[0];if(28&a){var c;for(i=t[3],c=0;c<i.length;c+=1){var l=ou(t,i,c);o[c]?o[c].p(l,a):(o[c]=au(l),o[c].c(),o[c].m(e,null))}for(;c<o.length;c+=1)o[c].d(1);o.length=i.length}if(11&a){var h;for(s=t[3],h=0;h<s.length;h+=1){var f=iu(t,s,h);u[h]?u[h].p(f,a):(u[h]=cu(f),u[h].c(),u[h].m(r,null))}for(;h<u.length;h+=1)u[h].d(1);u.length=s.length}},i:P,o:P,d:function(t){t&&U(e),H(o,t),t&&U(n),t&&U(r),H(u,t)}}}function hu(t,e,n){var r,i=e.view,o=e.state,a=o.schema.nodes.paragraph,s=o.schema.nodes.heading,u=Zs(),c=Pt(),l=[{id:Pt(),value:"paragraph",icon:"paragraph",label:{es:"P\xe1rrafo",en:"Paragraph"}},{id:Pt(),value:"heading:1",icon:"heading",label:{es:"T\xedtulo 1",en:"Heading 1"}},{id:Pt(),value:"heading:2",label:{es:"2",en:"2"},title:{es:"T\xedtulo 2",en:"Heading 2"}},{id:Pt(),value:"heading:3",label:{es:"3",en:"3"},title:{es:"T\xedtulo 3",en:"Heading 3"}},{id:Pt(),value:"heading:4",label:{es:"4",en:"4"},title:{es:"T\xedtulo 4",en:"Heading 4"}},{id:Pt(),value:"heading:5",label:{es:"5",en:"5"},title:{es:"T\xedtulo 5",en:"Heading 5"}},{id:Pt(),value:"heading:6",label:{es:"6",en:"6"},title:{es:"T\xedtulo 6",en:"Heading 6"}}];return t.$$set=function(t){"view"in t&&n(5,i=t.view),"state"in t&&n(6,o=t.state)},t.$$.update=function(){64&t.$$.dirty&&n(0,r=o.selection.to<=o.selection.$from.end()&&(o.selection.$from.parent.type==s?"heading:".concat(o.selection.$from.parent.attrs.level):o.selection.$from.parent.type==a?"paragraph":null))},[r,u,c,l,function(t){t.preventDefault();var e=d(t.target.value.split(":"),2),n=e[0],r=e[1];"paragraph"===n?eu(a,{align:o.selection.$from.parent.attrs.align})(o,i.dispatch):"heading"===n?eu(s,{level:parseInt(r),align:o.selection.$from.parent.attrs.align})(o,i.dispatch):console.error("\xa1type no es heading ni paragraph! Es",n)},i,o]}("undefined"===typeof navigator?"undefined":D(navigator))<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):("undefined"===typeof os?"undefined":D(os))<"u"&&os.platform&&os.platform();var fu=function(t){v(n,t);var e=m(n);function n(t){var r;return C(this,n),Et(y(r=e.call(this)),t,hu,lu,z,{view:5,state:6}),r}return n}(Tt);function du(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t||!e)return!1;var n=t.parent.childAfter(t.parentOffset);if(!n.node)return!1;var r=n.node.marks.find((function(t){return t.type===e}));if(!r)return!1;for(var i=t.index(),o=t.start()+n.offset,a=i+1,s=o+n.node.nodeSize;i>0&&r.isInSet(t.parent.child(i-1).marks);)i-=1,o-=t.parent.child(i).nodeSize;for(;a<t.parent.childCount&&r.isInSet(t.parent.child(a).marks);)s+=t.parent.child(a).nodeSize,a+=1;return{from:o,to:s}}function pu(t,e){return function(n,r){var i=n.tr,o=n.selection,a=n.doc,s=o.ranges;if(o.empty){var u=du(o.$from,t);if(!u)throw new Error("What the fuck");var c=u.from,l=u.to;a.rangeHasMark(c,l,t)&&i.removeMark(c,l,t),i.addMark(c,l,t.create(e))}else s.forEach((function(n){var r=n.$to,o=n.$from;a.rangeHasMark(o.pos,r.pos,t)&&i.removeMark(o.pos,r.pos,t),i.addMark(o.pos,r.pos,t.create(e))}));return r&&r(i),!0}}function vu(t){return function(e,n){var r=e.tr,i=e.selection,o=i.from,a=i.to,s=i.$from;if(i.empty){var u=du(s,t);if(!u)throw new Error("No");o=u.from,a=u.to}return r.removeMark(o,a,t),n&&n(r),!0}}function mu(t,e){return function(n){n.preventDefault(),e(t.state,t.dispatch)}}function gu(t,e){for(var n=t.depth;n>0;n-=1){var r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function yu(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(r){var i=r.selection,o=i.$from;return i.to<=o.end()&&(n?!!gu(o,(function(e){return e.type==t})):o.parent.hasMarkup(t,e))}}function bu(t,e){var n=t.selection,r=n.empty,i=n.ranges;if(r)return!1;var o=0,a=[];if(i.forEach((function(e){var n=e.$from,r=e.$to,i=n.pos,s=r.pos;t.doc.nodesBetween(i,s,(function(t,e){if(t.isText||t.marks.length){var n=Math.max(i,e),r=Math.min(s,e+t.nodeSize);o+=r-n,a.push.apply(a,T(t.marks.map((function(t){return{mark:t,from:n,to:r}}))))}}))})),0===o)return!1;var s=a.filter((function(t){return e.name===t.mark.type.name})).reduce((function(t,e){return t+e.to-e.from}),0),u=a.filter((function(t){return t.mark.type!==e&&t.mark.type.excludes(e)})).reduce((function(t,e){return t+e.to-e.from}),0);return(s>0?s+u:s)>=o}function wu(t,e){var n,r=t.selection,i=r.to,o=r.from;if(!r.empty)return t.selection.$from.doc.nodesBetween(o,i,(function(r,i){if(!n){var o=e.isInSet(r.marks);if(!o||!bu(t,e))return;n={node:r,position:i,mark:o}}})),n}function _u(t){return function(e,n){var r=e.selection,i=r.from,o=r.to,a=null;return e.doc.nodesBetween(i,o,(function(t,n){if(a)return!1;t.isTextblock&&(t.type==e.schema.nodes.paragraph||t.type==e.schema.nodes.heading)&&(a=t)})),!!a&&(!n||eu(a.type,h(h({},a.attrs),{},{align:t}))(e,n))}}function xu(t,e,n){var r=t.slice();return r[9]=e[n],r}function ku(t,e,n){var r=t.slice();return r[9]=e[n],r}function Su(t){var e,n,r,i;return{c:function(){(e=W("input")).disabled=n=!t[1],G(e,"id",t[9].id),G(e,"name",t[3]),e.value=t[9].value[t[2]],G(e,"type","radio")},m:function(n,o){V(n,e,o),r||(i=Y(e,"change",t[5]),r=!0)},p:function(t,r){2&r&&n!==(n=!t[1])&&(e.disabled=n)},d:function(t){t&&U(e),r=!1,i()}}}function Cu(t){var e,n,r,i,o,a,s,u,c=t[9].label[t[2]]+"";return{c:function(){e=W("label"),n=W("i"),r=J(),i=W("span"),o=Z(c),a=J(),G(n,"aria-hidden","true"),G(n,"class","fa fa-"+t[9].icon),G(i,"class","sr-only"),G(e,"for",t[9].id),G(e,"title",t[9].label[t[2]]),G(e,"aria-pressed",s=t[0]===t[9].value[t[2]]),G(e,"class",u="btn btn-info mb-0 "+(t[0]===t[9].value[t[2]]?"active":"")),et(e,"disabled",!t[1])},m:function(t,s){V(t,e,s),$(e,n),$(e,r),$(e,i),$(i,o),$(e,a)},p:function(t,n){1&n&&s!==(s=t[0]===t[9].value[t[2]])&&G(e,"aria-pressed",s),1&n&&u!==(u="btn btn-info mb-0 "+(t[0]===t[9].value[t[2]]?"active":""))&&G(e,"class",u),3&n&&et(e,"disabled",!t[1])},d:function(t){t&&U(e)}}}function Mu(t){for(var e,n,r,i=t[4],o=[],a=0;a<i.length;a+=1)o[a]=Su(ku(t,i,a));for(var s=t[4],u=[],c=0;c<s.length;c+=1)u[c]=Cu(xu(t,s,c));return{c:function(){e=W("div");for(var t=0;t<o.length;t+=1)o[t].c();n=J(),r=W("div");for(var i=0;i<u.length;i+=1)u[i].c();G(e,"class","d-none"),G(r,"class","btn-group mr-1")},m:function(t,i){V(t,e,i);for(var a=0;a<o.length;a+=1)o[a]&&o[a].m(e,null);V(t,n,i),V(t,r,i);for(var s=0;s<u.length;s+=1)u[s]&&u[s].m(r,null)},p:function(t,n){var a=d(n,1)[0];if(62&a){var c;for(i=t[4],c=0;c<i.length;c+=1){var l=ku(t,i,c);o[c]?o[c].p(l,a):(o[c]=Su(l),o[c].c(),o[c].m(e,null))}for(;c<o.length;c+=1)o[c].d(1);o.length=i.length}if(23&a){var h;for(s=t[4],h=0;h<s.length;h+=1){var f=xu(t,s,h);u[h]?u[h].p(f,a):(u[h]=Cu(f),u[h].c(),u[h].m(r,null))}for(;h<u.length;h+=1)u[h].d(1);u.length=s.length}},i:P,o:P,d:function(t){t&&U(e),H(o,t),t&&U(n),t&&U(r),H(u,t)}}}function Eu(t,e,n){var r,i,o=e.view,a=e.state,s=Zs();!function(){var t;null==(t=document.body.parentElement)||t.dir}();var u=Pt(),c=[{id:Pt(),value:{es:"start",en:"start"},icon:"align-left",label:{es:"Izquierda",en:"Left"}},{id:Pt(),value:{es:"center",en:"center"},icon:"align-center",label:{es:"Centro",en:"Center"}},{id:Pt(),value:{es:"end",en:"end"},icon:"align-right",label:{es:"Derecha",en:"Right"}}];return t.$$set=function(t){"view"in t&&n(6,o=t.view),"state"in t&&n(7,a=t.state)},t.$$.update=function(){128&t.$$.dirty&&n(1,r=_u(null)(a,null)),128&t.$$.dirty&&n(0,i=function(t){return function(e){var n,r=e.selection,i=r.from,o=r.to;return e.doc.nodesBetween(i,o,(function(e,r){if(void 0!==n)return!1;e.isTextblock&&t in e.attrs&&(n=e.attrs[t])})),n}}("align")(a))},[i,r,s,u,c,function(t){t.preventDefault(),_u(t.target.value)(a,o.dispatch)},o,a]}var Tu=function(t){v(n,t);var e=m(n);function n(t){var r;return C(this,n),Et(y(r=e.call(this)),t,Eu,Mu,z,{view:6,state:7}),r}return n}(Tt),Au={};function Ou(t,e,n){var r=document.createElement(t);if(e.class&&r.setAttribute("class",e.class),e.dataset)for(var i=0,o=Object.entries(e.dataset);i<o.length;i++){var a=d(o[i],2),s=a[0],u=a[1];r.dataset[s]=u}if(e.contenteditable&&(r.contentEditable=e.contenteditable),e.style)for(var c=0,l=Object.entries(e.style);c<l.length;c++){var h=d(l[c],2),f=h[0],p=h[1];r.style[f]=p}if(e.attributes)for(var v=0,m=Object.entries(e.attributes);v<m.length;v++){var g=d(m[v],2),y=g[0],b=g[1];r.setAttribute(y,b)}if(e.on)for(var w=0,_=Object.entries(e.on);w<_.length;w++){var x=d(_[w],2),k=x[0],C=x[1];r.addEventListener(k,C)}var M,E=S(n);try{for(E.s();!(M=E.n()).done;){var T=M.value;"string"==typeof T?r.appendChild(document.createTextNode(T)):T&&r.appendChild(T)}}catch(A){E.e(A)}finally{E.f()}return r}(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n=e((function(t,e){var n;n=function(t){var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(t,e){var n=t[0],r=t[1],i=t[2],o=t[3];r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+e[0]-680876936|0)<<7|n>>>25)+r|0)&r|~n&i)+e[1]-389564586|0)<<12|o>>>20)+n|0)&n|~o&r)+e[2]+606105819|0)<<17|i>>>15)+o|0)&o|~i&n)+e[3]-1044525330|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+e[4]-176418897|0)<<7|n>>>25)+r|0)&r|~n&i)+e[5]+1200080426|0)<<12|o>>>20)+n|0)&n|~o&r)+e[6]-1473231341|0)<<17|i>>>15)+o|0)&o|~i&n)+e[7]-45705983|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+e[8]+1770035416|0)<<7|n>>>25)+r|0)&r|~n&i)+e[9]-1958414417|0)<<12|o>>>20)+n|0)&n|~o&r)+e[10]-42063|0)<<17|i>>>15)+o|0)&o|~i&n)+e[11]-1990404162|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+e[12]+1804603682|0)<<7|n>>>25)+r|0)&r|~n&i)+e[13]-40341101|0)<<12|o>>>20)+n|0)&n|~o&r)+e[14]-1502002290|0)<<17|i>>>15)+o|0)&o|~i&n)+e[15]+1236535329|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[1]-165796510|0)<<5|n>>>27)+r|0)&i|r&~i)+e[6]-1069501632|0)<<9|o>>>23)+n|0)&r|n&~r)+e[11]+643717713|0)<<14|i>>>18)+o|0)&n|o&~n)+e[0]-373897302|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[5]-701558691|0)<<5|n>>>27)+r|0)&i|r&~i)+e[10]+38016083|0)<<9|o>>>23)+n|0)&r|n&~r)+e[15]-660478335|0)<<14|i>>>18)+o|0)&n|o&~n)+e[4]-405537848|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[9]+568446438|0)<<5|n>>>27)+r|0)&i|r&~i)+e[14]-1019803690|0)<<9|o>>>23)+n|0)&r|n&~r)+e[3]-187363961|0)<<14|i>>>18)+o|0)&n|o&~n)+e[8]+1163531501|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+e[13]-1444681467|0)<<5|n>>>27)+r|0)&i|r&~i)+e[2]-51403784|0)<<9|o>>>23)+n|0)&r|n&~r)+e[7]+1735328473|0)<<14|i>>>18)+o|0)&n|o&~n)+e[12]-1926607734|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[5]-378558|0)<<4|n>>>28)+r|0)^r^i)+e[8]-2022574463|0)<<11|o>>>21)+n|0)^n^r)+e[11]+1839030562|0)<<16|i>>>16)+o|0)^o^n)+e[14]-35309556|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[1]-1530992060|0)<<4|n>>>28)+r|0)^r^i)+e[4]+1272893353|0)<<11|o>>>21)+n|0)^n^r)+e[7]-155497632|0)<<16|i>>>16)+o|0)^o^n)+e[10]-1094730640|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[13]+681279174|0)<<4|n>>>28)+r|0)^r^i)+e[0]-358537222|0)<<11|o>>>21)+n|0)^n^r)+e[3]-722521979|0)<<16|i>>>16)+o|0)^o^n)+e[6]+76029189|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+e[9]-640364487|0)<<4|n>>>28)+r|0)^r^i)+e[12]-421815835|0)<<11|o>>>21)+n|0)^n^r)+e[15]+530742520|0)<<16|i>>>16)+o|0)^o^n)+e[2]-995338651|0)<<23|r>>>9)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[0]-198630844|0)<<6|n>>>26)+r|0)|~i))+e[7]+1126891415|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[14]-1416354905|0)<<15|i>>>17)+o|0)|~n))+e[5]-57434055|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[12]+1700485571|0)<<6|n>>>26)+r|0)|~i))+e[3]-1894986606|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[10]-1051523|0)<<15|i>>>17)+o|0)|~n))+e[1]-2054922799|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[8]+1873313359|0)<<6|n>>>26)+r|0)|~i))+e[15]-30611744|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[6]-1560198380|0)<<15|i>>>17)+o|0)|~n))+e[13]+1309151649|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+e[4]-145523070|0)<<6|n>>>26)+r|0)|~i))+e[11]-1120210379|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+e[2]+718787259|0)<<15|i>>>17)+o|0)|~n))+e[9]-343485551|0)<<21|r>>>11)+i|0,t[0]=n+t[0]|0,t[1]=r+t[1]|0,t[2]=i+t[2]|0,t[3]=o+t[3]|0}function r(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return n}function i(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t[e]+(t[e+1]<<8)+(t[e+2]<<16)+(t[e+3]<<24);return n}function o(t){var e,i,o,a,s,u,c=t.length,l=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=c;e+=64)n(l,r(t.substring(e-64,e)));for(i=(t=t.substring(e-64)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e=0;e<i;e+=1)o[e>>2]|=t.charCodeAt(e)<<(e%4<<3);if(o[e>>2]|=128<<(e%4<<3),e>55)for(n(l,o),e=0;e<16;e+=1)o[e]=0;return a=(a=8*c).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(a[2],16),u=parseInt(a[1],16)||0,o[14]=s,o[15]=u,n(l,o),l}function a(t){var e,r,o,a,s,u,c=t.length,l=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=c;e+=64)n(l,i(t.subarray(e-64,e)));for(r=(t=e-64<c?t.subarray(e-64):new Uint8Array(0)).length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e=0;e<r;e+=1)o[e>>2]|=t[e]<<(e%4<<3);if(o[e>>2]|=128<<(e%4<<3),e>55)for(n(l,o),e=0;e<16;e+=1)o[e]=0;return a=(a=8*c).toString(16).match(/(.*?)(.{0,8})$/),s=parseInt(a[2],16),u=parseInt(a[1],16)||0,o[14]=s,o[15]=u,n(l,o),l}function s(t){var n,r="";for(n=0;n<4;n+=1)r+=e[t>>8*n+4&15]+e[t>>8*n&15];return r}function u(t){var e;for(e=0;e<t.length;e+=1)t[e]=s(t[e]);return t.join("")}function c(t){return/[\u0080-\uFFFF]/.test(t)&&(t=unescape(encodeURIComponent(t))),t}function l(t,e){var n,r=t.length,i=new ArrayBuffer(r),o=new Uint8Array(i);for(n=0;n<r;n+=1)o[n]=t.charCodeAt(n);return e?o:i}function h(t){return String.fromCharCode.apply(null,new Uint8Array(t))}function f(t,e,n){var r=new Uint8Array(t.byteLength+e.byteLength);return r.set(new Uint8Array(t)),r.set(new Uint8Array(e),t.byteLength),n?r:r.buffer}function d(t){var e,n=[],r=t.length;for(e=0;e<r-1;e+=2)n.push(parseInt(t.substr(e,2),16));return String.fromCharCode.apply(String,n)}function p(){this.reset()}return u(o("hello")),("undefined"===typeof ArrayBuffer?"undefined":D(ArrayBuffer))<"u"&&!ArrayBuffer.prototype.slice&&function(){function e(t,e){return(t=0|t||0)<0?Math.max(t+e,0):Math.min(t,e)}ArrayBuffer.prototype.slice=function(n,r){var i,o,a,s,u=this.byteLength,c=e(n,u),l=u;return r!==t&&(l=e(r,u)),c>l?new ArrayBuffer(0):(i=l-c,o=new ArrayBuffer(i),a=new Uint8Array(o),s=new Uint8Array(this,c,i),a.set(s),o)}}(),p.prototype.append=function(t){return this.appendBinary(c(t)),this},p.prototype.appendBinary=function(t){this._buff+=t,this._length+=t.length;var e,i=this._buff.length;for(e=64;e<=i;e+=64)n(this._hash,r(this._buff.substring(e-64,e)));return this._buff=this._buff.substring(e-64),this},p.prototype.end=function(t){var e,n,r=this._buff,i=r.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<i;e+=1)o[e>>2]|=r.charCodeAt(e)<<(e%4<<3);return this._finish(o,i),n=u(this._hash),t&&(n=d(n)),this.reset(),n},p.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},p.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash}},p.prototype.setState=function(t){return this._buff=t.buff,this._length=t.length,this._hash=t.hash,this},p.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},p.prototype._finish=function(t,e){var r,i,o,a=e;if(t[a>>2]|=128<<(a%4<<3),a>55)for(n(this._hash,t),a=0;a<16;a+=1)t[a]=0;r=(r=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(r[2],16),o=parseInt(r[1],16)||0,t[14]=i,t[15]=o,n(this._hash,t)},p.hash=function(t,e){return p.hashBinary(c(t),e)},p.hashBinary=function(t,e){var n=u(o(t));return e?d(n):n},p.ArrayBuffer=function(){this.reset()},p.ArrayBuffer.prototype.append=function(t){var e,r=f(this._buff.buffer,t,!0),o=r.length;for(this._length+=t.byteLength,e=64;e<=o;e+=64)n(this._hash,i(r.subarray(e-64,e)));return this._buff=e-64<o?new Uint8Array(r.buffer.slice(e-64)):new Uint8Array(0),this},p.ArrayBuffer.prototype.end=function(t){var e,n,r=this._buff,i=r.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<i;e+=1)o[e>>2]|=r[e]<<(e%4<<3);return this._finish(o,i),n=u(this._hash),t&&(n=d(n)),this.reset(),n},p.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},p.ArrayBuffer.prototype.getState=function(){var t=p.prototype.getState.call(this);return t.buff=h(t.buff),t},p.ArrayBuffer.prototype.setState=function(t){return t.buff=l(t.buff,!0),p.prototype.setState.call(this,t)},p.ArrayBuffer.prototype.destroy=p.prototype.destroy,p.ArrayBuffer.prototype._finish=p.prototype._finish,p.ArrayBuffer.hash=function(t,e){var n=u(a(new Uint8Array(t)));return e?d(n):n},p},t.exports=n()})),r=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice,a=function(){function t(e){r(this,t),this.file=e,this.chunkSize=2097152,this.chunkCount=Math.ceil(this.file.size/this.chunkSize),this.chunkIndex=0}return i(t,null,[{key:"create",value:function(e,n){new t(e).create(n)}}]),i(t,[{key:"create",value:function(t){var e=this;this.callback=t,this.md5Buffer=new n.ArrayBuffer,this.fileReader=new FileReader,this.fileReader.addEventListener("load",(function(t){return e.fileReaderDidLoad(t)})),this.fileReader.addEventListener("error",(function(t){return e.fileReaderDidError(t)})),this.readNextChunk()}},{key:"fileReaderDidLoad",value:function(t){if(this.md5Buffer.append(t.target.result),!this.readNextChunk()){var e=this.md5Buffer.end(!0),n=btoa(e);this.callback(null,n)}}},{key:"fileReaderDidError",value:function(t){this.callback("Error reading "+this.file.name)}},{key:"readNextChunk",value:function(){if(this.chunkIndex<this.chunkCount||0==this.chunkIndex&&0==this.chunkCount){var t=this.chunkIndex*this.chunkSize,e=Math.min(t+this.chunkSize,this.file.size),n=o.call(this.file,t,e);return this.fileReader.readAsArrayBuffer(n),this.chunkIndex++,!0}return!1}}]),t}();function s(t){var e=c(document.head,'meta[name="'+t+'"]');if(e)return e.getAttribute("content")}function u(t,e){return"string"==typeof t&&(e=t,t=document),h(t.querySelectorAll(e))}function c(t,e){return"string"==typeof t&&(e=t,t=document),t.querySelector(e)}function l(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.disabled,i=n.bubbles,o=n.cancelable,a=n.detail,s=document.createEvent("Event");s.initEvent(e,i||!0,o||!0),s.detail=a||{};try{t.disabled=!1,t.dispatchEvent(s)}finally{t.disabled=r}return s}function h(t){return Array.isArray(t)?t:Array.from?Array.from(t):[].slice.call(t)}var f=function(){function t(e,n,i){var o=this;r(this,t),this.file=e,this.attributes={filename:e.name,content_type:e.type||"application/octet-stream",byte_size:e.size,checksum:n},this.xhr=new XMLHttpRequest,this.xhr.open("POST",i,!0),this.xhr.responseType="json",this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.setRequestHeader("Accept","application/json"),this.xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");var a=s("csrf-token");null!=a&&this.xhr.setRequestHeader("X-CSRF-Token",a),this.xhr.addEventListener("load",(function(t){return o.requestDidLoad(t)})),this.xhr.addEventListener("error",(function(t){return o.requestDidError(t)}))}return i(t,[{key:"create",value:function(t){this.callback=t,this.xhr.send(JSON.stringify({blob:this.attributes}))}},{key:"requestDidLoad",value:function(t){if(this.status>=200&&this.status<300){var e=this.response,n=e.direct_upload;delete e.direct_upload,this.attributes=e,this.directUploadData=n,this.callback(null,this.toJSON())}else this.requestDidError(t)}},{key:"requestDidError",value:function(t){this.callback('Error creating Blob for "'+this.file.name+'". Status: '+this.status)}},{key:"toJSON",value:function(){var t={};for(var e in this.attributes)t[e]=this.attributes[e];return t}},{key:"status",get:function(){return this.xhr.status}},{key:"response",get:function(){var t=this.xhr,e=t.responseType,n=t.response;return"json"==e?n:JSON.parse(n)}}]),t}(),d=function(){function t(e){var n=this;r(this,t),this.blob=e,this.file=e.file;var i=e.directUploadData,o=i.url,a=i.headers;for(var s in this.xhr=new XMLHttpRequest,this.xhr.open("PUT",o,!0),this.xhr.responseType="text",a)this.xhr.setRequestHeader(s,a[s]);this.xhr.addEventListener("load",(function(t){return n.requestDidLoad(t)})),this.xhr.addEventListener("error",(function(t){return n.requestDidError(t)}))}return i(t,[{key:"create",value:function(t){this.callback=t,this.xhr.send(this.file.slice())}},{key:"requestDidLoad",value:function(t){var e=this.xhr,n=e.status,r=e.response;n>=200&&n<300?this.callback(null,r):this.requestDidError(t)}},{key:"requestDidError",value:function(t){this.callback('Error storing "'+this.file.name+'". Status: '+this.xhr.status)}}]),t}(),p=0,v=function(){function t(e,n,i){r(this,t),this.id=++p,this.file=e,this.url=n,this.delegate=i}return i(t,[{key:"create",value:function(t){var e=this;a.create(this.file,(function(n,r){if(n)t(n);else{var i=new f(e.file,r,e.url);m(e.delegate,"directUploadWillCreateBlobWithXHR",i.xhr),i.create((function(n){if(n)t(n);else{var r=new d(i);m(e.delegate,"directUploadWillStoreFileWithXHR",r.xhr),r.create((function(e){e?t(e):t(null,i.toJSON())}))}}))}}))}}]),t}();function m(t,e){if(t&&"function"==typeof t[e]){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return t[e].apply(t,r)}}var g=function(){function t(e,n){r(this,t),this.input=e,this.file=n,this.directUpload=new v(this.file,this.url,this),this.dispatch("initialize")}return i(t,[{key:"start",value:function(t){var e=this,n=document.createElement("input");n.type="hidden",n.name=this.input.name,this.input.insertAdjacentElement("beforebegin",n),this.dispatch("start"),this.directUpload.create((function(r,i){r?(n.parentNode.removeChild(n),e.dispatchError(r)):n.value=i.signed_id,e.dispatch("end"),t(r)}))}},{key:"uploadRequestDidProgress",value:function(t){var e=t.loaded/t.total*100;e&&this.dispatch("progress",{progress:e})}},{key:"dispatch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.file=this.file,e.id=this.directUpload.id,l(this.input,"direct-upload:"+t,{detail:e})}},{key:"dispatchError",value:function(t){this.dispatch("error",{error:t}).defaultPrevented||alert(t)}},{key:"directUploadWillCreateBlobWithXHR",value:function(t){this.dispatch("before-blob-request",{xhr:t})}},{key:"directUploadWillStoreFileWithXHR",value:function(t){var e=this;this.dispatch("before-storage-request",{xhr:t}),t.upload.addEventListener("progress",(function(t){return e.uploadRequestDidProgress(t)}))}},{key:"url",get:function(){return this.input.getAttribute("data-direct-upload-url")}}]),t}(),y="input[type=file][data-direct-upload-url]:not([disabled])",b=function(){function t(e){r(this,t),this.form=e,this.inputs=u(e,y).filter((function(t){return t.files.length}))}return i(t,[{key:"start",value:function(t){var e=this,n=this.createDirectUploadControllers(),r=function r(){var i=n.shift();i?i.start((function(n){n?(t(n),e.dispatch("end")):r()})):(t(),e.dispatch("end"))};this.dispatch("start"),r()}},{key:"createDirectUploadControllers",value:function(){var t=[];return this.inputs.forEach((function(e){h(e.files).forEach((function(n){var r=new g(e,n);t.push(r)}))})),t}},{key:"dispatch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return l(this.form,"direct-uploads:"+t,{detail:e})}}]),t}(),w="data-direct-uploads-processing",_=new WeakMap,x=!1;function k(){x||(x=!0,document.addEventListener("click",S,!0),document.addEventListener("submit",C),document.addEventListener("ajax:before",M))}function S(t){var e=t.target;("INPUT"==e.tagName||"BUTTON"==e.tagName)&&"submit"==e.type&&e.form&&_.set(e.form,e)}function C(t){E(t)}function M(t){"FORM"==t.target.tagName&&E(t)}function E(t){var e=t.target;if(e.hasAttribute(w))t.preventDefault();else{var n=new b(e),r=n.inputs;r.length&&(t.preventDefault(),e.setAttribute(w,""),r.forEach(A),n.start((function(t){e.removeAttribute(w),t?r.forEach(O):T(e)})))}}function T(t){var e=_.get(t)||c(t,"input[type=submit], button[type=submit]");if(e){var n=e.disabled;e.disabled=!1,e.focus(),e.click(),e.disabled=n}else(e=document.createElement("input")).type="submit",e.style.display="none",t.appendChild(e),e.click(),t.removeChild(e);_.delete(t)}function A(t){t.disabled=!0}function O(t){t.disabled=!1}function P(){window.ActiveStorage&&k()}setTimeout(P,1),t.start=k,t.DirectUpload=v,Object.defineProperty(t,"__esModule",{value:!0})})(Au);var Du=function(t){return t[t.Unordered=0]="Unordered",t[t.Ordered=1]="Ordered",t}(Du||{}),Pu="".concat(origin,"/rails/active_storage");function Lu(t,e){return new Promise((function(n,r){new Au.DirectUpload(t,"".concat(Pu,"/direct_uploads"),{directUploadWillStoreFileWithXHR:function(t){t.upload.addEventListener("progress",(function(t){!function(t,e){var n=document.querySelector(".sutty-editor-placeholder-".concat(t," .progress-bar"));if(n){var r=""+100*e;n.style.width="".concat(r,"%"),n.setAttribute("aria-value-now",r)}}(e,t.loaded/t.total)}))}}).create(function(){var t=c(s.a.mark((function t(e,i){var o,a;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=4;break}r(e),t.next=15;break;case 4:return o="".concat(Pu,"/blobs/").concat(i.signed_id,"/").concat(i.filename),t.prev=5,t.next=8,fetch(o,{method:"HEAD"});case 8:a=t.sent,n({url:o,contentType:a.headers.get("content-type")}),t.next=15;break;case 12:t.prev=12,t.t0=t.catch(5),r(t.t0);case 15:case"end":return t.stop()}}),t,null,[[5,12]])})));return function(e,n){return t.apply(this,arguments)}}())}))}var Nu=new rr({state:{init:function(){return ba.empty},apply:function(t,e){e=e.map(t.mapping,t.doc);var n=t.getMeta(this);if(n){var r,i=S(n);try{var o=function(){var n=r.value;if(n.add){var i=Ou("div",{class:"ProseMirror-placeholder sutty-editor-placeholder-".concat(n.add.id)},["Subiendo archivo...",Ou("div",{class:"progress"},[Ou("div",{class:"progress-bar ".concat(n.add.unknownProgress?"progress-bar-striped progress-bar-animated":""),attributes:{role:"progressbar","aria-valuenow":"0","aria-valuemin":"0","aria-valuemax":"100"},style:{width:"0%"}},[])])]),o=ma.widget(n.add.pos,i,{id:n.add.id});e=e.add(t.doc,[o])}else n.remove&&(e=e.remove(e.find(void 0,void 0,(function(t){return t.id==n.remove.id}))))};for(i.s();!(r=i.n()).done;)o()}catch(a){i.e(a)}finally{i.f()}}return e}},props:{decorations:function(t){return this.getState(t)}}});function Ru(t,e){var n;return null==(n=function(t,e){var n=Nu.getState(t).find(void 0,void 0,(function(t){return t.id==e}));return n.length?n[0]:null}(t,e))?void 0:n.from}function Iu(t){if(t.match(/^image\/.+$/))return"img";if(t.match(/^video\/.+$/))return"video";if(t.match(/^audio\/.+$/))return"audio";if(t.match(/^application\/pdf$/))return"iframe";throw new Error("Tipo de archivo no reconocido")}function zu(t){var e,n,r,i,o,a,s,u;return{c:function(){e=W("button"),n=W("i"),r=J(),(i=W("span")).textContent="".concat(t[2][t[1]]),o=J(),a=W("input"),G(n,"class","fa fa-upload"),G(i,"class","sr-only"),G(e,"type","button"),G(e,"title",t[2][t[1]]),G(e,"class","btn btn-info"),G(a,"type","file"),a.hidden=!0},m:function(c,l){V(c,e,l),$(e,n),$(e,r),$(e,i),V(c,o,l),V(c,a,l),t[7](a),s||(u=[Y(e,"mousedown",K(t[3])),Y(a,"change",K(t[4]))],s=!0)},p:P,i:P,o:P,d:function(n){n&&U(e),n&&U(o),n&&U(a),t[7](null),s=!1,R(u)}}}function Bu(t,e,n){var r,i=e.view,o=e.state,a=o.schema.nodes.multimedia,s=Zs();return t.$$set=function(t){"view"in t&&n(5,i=t.view),"state"in t&&n(6,o=t.state)},[r,s,{es:"Subir imagen, video, audio o PDF",en:"Upload image, video, audio or PDF"},function(){r.click()},function(){if(r.files.length>0&&o.selection.$from.parent.inlineContent){var t=Pt(),e=i.state.tr,n=_n(o.doc,o.selection.to,a);e.setMeta(Nu,[{add:{id:t,pos:n}}]),i.dispatch(e);var s=r.files[0];Lu(s,t).then((function(e){var n=e.url,r=Ru(i.state,t);if(null!=r){var a=o.schema.nodes.multimedia.createChecked({src:n,kind:Iu(s.type)});i.dispatch(i.state.tr.replaceWith(r,r,a).setMeta(Nu,[{remove:{id:t}}]))}})).catch((function(n){console.error(n),i.dispatch(e.setMeta(Nu,[{remove:{id:t}}]))}))}i.focus()},i,o,function(t){st[t?"unshift":"push"]((function(){n(0,r=t)}))}]}var ju=function(t){v(n,t);var e=m(n);function n(t){var r;return C(this,n),Et(y(r=e.call(this)),t,Bu,zu,z,{view:5,state:6}),r}return n}(Tt);function Fu(t,e,n,r,i){for(var o=qt.empty,a=n.length-1;a>=0;a--)o=qt.from(n[a].type.create(n[a].attrs,o));t.step(new sn(e.start-(r?2:0),e.end,e.start,e.end,new Zt(o,0,0),n.length,!0));for(var s=0,u=0;u<n.length;u++)n[u].type==i&&(s=u+1);for(var c=n.length-s,l=e.start+n.length-(r?2:0),h=e.parent,f=e.startIndex,d=e.endIndex,p=!0;f<d;f++,p=!1)!p&&gn(t.doc,l,c)&&(t.split(l,c),l+=2*c),l+=h.child(f).nodeSize;return t}function qu(t){return function(e,n){var r=e.selection,i=r.$from,o=r.$to,a=i.blockRange(o,(function(e){return e.childCount>0&&e.firstChild.type==t}));return!!a&&(!n||(i.node(a.depth-1).type==t?function(t,e,n,r){var i=t.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new sn(o-1,a,o,a,new Zt(qt.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ce(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));var s=ln(r);if(null==s)return!1;i.lift(r,s);var u=i.mapping.map(o,-1)-1;return bn(i.doc,u)&&i.join(u),e(i.scrollIntoView()),!0}(e,n,t,a):function(t,e,n){for(var r=t.tr,i=n.parent,o=n.end,a=n.endIndex-1,s=n.startIndex;a>s;a--)o-=i.child(a).nodeSize,r.delete(o-1,o+1);var u=r.doc.resolve(n.start),c=u.nodeAfter;if(r.mapping.map(n.end)!=n.start+u.nodeAfter.nodeSize)return!1;var l=0==n.startIndex,h=n.endIndex==i.childCount,f=u.node(-1),d=u.index(-1);if(!f.canReplace(d+(l?0:1),d+1,c.content.append(h?qt.empty:qt.from(i))))return!1;var p=u.pos,v=p+c.nodeSize;return r.step(new sn(p-(l?1:0),v+(h?1:0),p+1,v-1,new Zt((l?qt.empty:qt.from(i.copy(qt.empty))).append(h?qt.empty:qt.from(i.copy(qt.empty))),l?0:1,h?0:1),l?0:1)),e(r.scrollIntoView()),!0}(e,n,a)))}}function $u(t){var e,n,r,i,o,a;return{c:function(){e=W("button"),G(n=W("i"),"class",r="fa ".concat(t[4])),G(e,"type","button"),G(e,"class","btn btn-info"),e.disabled=i=!t[2],et(e,"active",t[3](t[0]))},m:function(r,i){V(r,e,i),$(e,n),o||(a=Y(e,"mousedown",(function(){I(t[1])&&t[1].apply(this,arguments)})),o=!0)},p:function(o,a){var s=d(a,1)[0];t=o,16&s&&r!==(r="fa ".concat(t[4]))&&G(n,"class",r),4&s&&i!==(i=!t[2])&&(e.disabled=i),9&s&&et(e,"active",t[3](t[0]))},i:P,o:P,d:function(t){t&&U(e),o=!1,a()}}}function Vu(t,e,n){var r,i,o,a,s,u,c=e.view,l=e.state,h=e.kind,f=l.schema.nodes.list_item;return t.$$set=function(t){"view"in t&&n(5,c=t.view),"state"in t&&n(0,l=t.state),"kind"in t&&n(6,h=t.kind)},t.$$.update=function(){65&t.$$.dirty&&n(8,r=h===Du.Unordered?l.schema.nodes.bullet_list:h===Du.Ordered?l.schema.nodes.ordered_list:null),64&t.$$.dirty&&n(4,i=h===Du.Unordered?"fa-list-ul":h===Du.Ordered?"fa-list-ol":"fa-warning"),256&t.$$.dirty&&n(3,o=yu(r,null,!0)),256&t.$$.dirty&&n(7,a=ru(qu(f),function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var i=n.selection,o=i.$from,a=i.$to,s=o.blockRange(a),u=!1,c=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(t)&&0==s.startIndex){if(0==o.index(s.depth-1))return!1;var l=n.doc.resolve(s.start-2);c=new ce(l,l,s.depth),s.endIndex<s.parent.childCount&&(s=new ce(o,n.doc.resolve(a.end(s.depth)),s.depth)),u=!0}var h=hn(c,t,e,s);return!!h&&(r&&r(Fu(n.tr,s,h,u,t).scrollIntoView()),!0)}}(r))),129&t.$$.dirty&&n(2,s=a(l,null)),160&t.$$.dirty&&n(1,u=mu(c,a))},[l,u,s,o,i,c,h,a,r]}var Uu=function(t){v(n,t);var e=m(n);function n(t){var r;return C(this,n),Et(y(r=e.call(this)),t,Vu,$u,z,{view:5,state:0,kind:6}),r}return n}(Tt);function Hu(t){var e,n,r,i,o,a,s;return{c:function(){e=W("button"),n=W("i"),r=J(),(i=W("span")).textContent="".concat(t[5][t[4]]),G(n,"class","fa fa-quote-left"),G(i,"class","sr-only"),G(e,"type","button"),G(e,"title",t[5][t[4]]),G(e,"class","btn btn-info"),e.disabled=o=!t[2],et(e,"active",t[3](t[0]))},m:function(o,u){V(o,e,u),$(e,n),$(e,r),$(e,i),a||(s=Y(e,"mousedown",(function(){I(t[1])&&t[1].apply(this,arguments)})),a=!0)},p:function(n,r){var i=d(r,1)[0];t=n,4&i&&o!==(o=!t[2])&&(e.disabled=o),9&i&&et(e,"active",t[3](t[0]))},i:P,o:P,d:function(t){t&&U(e),a=!1,s()}}}function Wu(t,e,n){var r,i,o,a,s=e.view,u=e.state,c=u.schema.nodes.blockquote,l=Zs();return t.$$set=function(t){"view"in t&&n(6,s=t.view),"state"in t&&n(0,u=t.state)},t.$$.update=function(){129&t.$$.dirty&&n(2,o=i(u,null)),192&t.$$.dirty&&n(1,a=mu(s,i))},n(3,r=yu(c,null,!0)),n(7,i=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var i=n.selection,o=i.$from,a=i.$to,s=o.blockRange(a),u=s&&hn(s,t,e);return!!u&&(r&&r(n.tr.wrap(s,u).scrollIntoView()),!0)}}(c)),[u,a,o,r,l,{es:"Bloque de cita",en:"Blockquote"},s,i]}var Zu=function(t){v(n,t);var e=m(n);function n(t){var r;return C(this,n),Et(y(r=e.call(this)),t,Wu,Hu,z,{view:6,state:0}),r}return n}(Tt);function Ju(t){var e,n;return{c:function(){G(e=W("i"),"class",n="fa fa-".concat(t[2]))},m:function(t,n){V(t,e,n)},p:function(t,r){4&r&&n!==(n="fa fa-".concat(t[2]))&&G(e,"class",n)},d:function(t){t&&U(e)}}}function Yu(t){var e,n,r;return{c:function(){e=W("small"),G(n=W("i"),"class",r="fa fa-".concat(t[2]))},m:function(t,r){V(t,e,r),$(e,n)},p:function(t,e){4&e&&r!==(r="fa fa-".concat(t[2]))&&G(n,"class",r)},d:function(t){t&&U(e)}}}function Ku(t){var e,n,r,i,o,a,s,u=t[7][t[1].name][t[6]]+"";function c(t,e){return t[3]?Yu:Ju}var l=c(t),h=l(t);return{c:function(){e=W("button"),h.c(),n=J(),r=W("span"),i=Z(u),G(r,"class","sr-only"),G(e,"title",o=t[7][t[1].name][t[6]]),G(e,"type","button"),G(e,"class","btn btn-info"),et(e,"active",t[5])},m:function(o,u){V(o,e,u),h.m(e,null),$(e,n),$(e,r),$(r,i),a||(s=Y(e,"mousedown",(function(){I(t[4])&&t[4].apply(this,arguments)})),a=!0)},p:function(r,a){var s=d(a,1)[0];l===(l=c(t=r))&&h?h.p(t,s):(h.d(1),(h=l(t))&&(h.c(),h.m(e,n))),2&s&&u!==(u=t[7][t[1].name][t[6]]+"")&&Q(i,u),2&s&&o!==(o=t[7][t[1].name][t[6]])&&G(e,"title",o),32&s&&et(e,"active",t[5])},i:P,o:P,d:function(t){t&&U(e),h.d(),a=!1,s()}}}function Gu(t,e,n){var r,i,o,a=P,s=function(){return a(),a=j(c,(function(t){return n(10,o=t)})),c};t.$$.on_destroy.push((function(){return a()}));var u=e.view,c=e.alert;s();var l=e.state,h=e.type,f=e.faIcon,d=e.small,p=void 0!==d&&d,v=Zs(),m={es:"Perd\xf3n, no pude pintar esta selecci\xf3n porque contiene una nota al pie. Deseleccionala para poder pintar.",en:"Sorry, I couldn't mark this selection because it contains a footnote. Deselect it to be able to mark."},g=function(t){return function(e,n){var r=!1;return e.selection.content().content.descendants((function(t){return!r&&("footnote"===t.type.name?(r=!0,!1):void 0)})),r?(n&&q(c,o=m[Zs()],o),!1):function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var i=n.selection,o=i.empty,a=i.$cursor,s=i.ranges;if(o&&!a||!nu(n.doc,s,t))return!1;if(r)if(a)t.isInSet(n.storedMarks||a.marks())?r(n.tr.removeStoredMark(t)):r(n.tr.addStoredMark(t.create(e)));else{for(var u=!1,c=n.tr,l=0;!u&&l<s.length;l++){var h=s[l],f=h.$from,d=h.$to;u=n.doc.rangeHasMark(f.pos,d.pos,t)}for(var p=0;p<s.length;p++){var v=s[p],m=v.$from,g=v.$to;if(u)c.removeMark(m.pos,g.pos,t);else{var y=m.pos,b=g.pos,w=m.nodeAfter,_=g.nodeBefore,x=w&&w.isText?/^\s*/.exec(w.text)[0].length:0,k=_&&_.isText?/\s*$/.exec(_.text)[0].length:0;y+x<b&&(y+=x,b-=k),c.addMark(y,b,t.create(e))}}r(c.scrollIntoView())}return!0}}(t)(e,n)}};return t.$$set=function(t){"view"in t&&n(8,u=t.view),"alert"in t&&s(n(0,c=t.alert)),"state"in t&&n(9,l=t.state),"type"in t&&n(1,h=t.type),"faIcon"in t&&n(2,f=t.faIcon),"small"in t&&n(3,p=t.small)},t.$$.update=function(){514&t.$$.dirty&&n(5,r=bu(l,h)),258&t.$$.dirty&&n(4,i=mu(u,g(h)))},[c,h,f,p,i,r,v,{strong:{es:"Fuertecita",en:"Bold"},em:{es:"\xc9nfasis",en:"Emphasis"},underline:{es:"Subrayado",en:"Underline"},strikethrough:{es:"Tachado",en:"Strikethrough"},sub:{es:"Sub-\xedndice",en:"Sub-script"},sup:{es:"\xcdndice",en:"Super-script"},small:{es:"Texto peque\xf1o",en:"Smaller text"}},u,l]}var Xu=function(t){v(n,t);var e=m(n);function n(t){var r;return C(this,n),Et(y(r=e.call(this)),t,Gu,Ku,z,{view:8,alert:0,state:9,type:1,faIcon:2,small:3}),r}return n}(Tt);function Qu(t,e,n){var r=t.slice();return r[28]=e[n],r[29]=e,r[30]=n,r}function tc(t){var e,n,r,i,o,a;return{c:function(){e=W("div"),n=Z(t[6]),r=J(),(i=W("button")).innerHTML='<span aria-hidden="true">\xd7</span>',G(i,"type","button"),G(i,"class","close"),G(i,"data-dismiss","alert"),G(i,"aria-label","Close"),G(e,"class","alert alert-info"),G(e,"role","alert")},m:function(s,u){V(s,e,u),$(e,n),$(e,r),$(e,i),o||(a=Y(i,"click",K(t[20])),o=!0)},p:function(t,e){64&e&&Q(n,t[6])},d:function(t){t&&U(e),o=!1,a()}}}function ec(t){var e,n,r,i,o;return{c:function(){e=W("div"),G(n=W("input"),"type","url"),G(n,"class","form-control"),G(n,"placeholder","https://"),n.value=r=t[4].mark.attrs.href,G(e,"class","mb-2")},m:function(r,a){V(r,e,a),$(e,n),i||(o=Y(n,"change",K(t[13])),i=!0)},p:function(t,e){16&e&&r!==(r=t[4].mark.attrs.href)&&n.value!==r&&(n.value=r)},d:function(t){t&&U(e),i=!1,o()}}}function nc(t){for(var e,n=t[3],r=[],i=0;i<n.length;i+=1)r[i]=rc(Qu(t,n,i));return{c:function(){e=W("div");for(var t=0;t<r.length;t+=1)r[t].c();G(e,"class","row row-cols-1 row-cols-md-2 mb-2")},m:function(t,n){V(t,e,n);for(var i=0;i<r.length;i+=1)r[i]&&r[i].m(e,null)},p:function(t,i){if(99496&i){var o;for(n=t[3],o=0;o<n.length;o+=1){var a=Qu(t,n,o);r[o]?r[o].p(a,i):(r[o]=rc(a),r[o].c(),r[o].m(e,null))}for(;o<r.length;o+=1)r[o].d(1);r.length=n.length}},d:function(t){t&&U(e),H(r,t)}}}function rc(t){var e,n,r,i,o,a,s,u,c,l,h,f,d,p,v,m,g,y,b,w,_,x,k,S,C=t[28].label[t[7]]+"",M=t[28].help[t[7]]+"",E=t[29],T=t[30];function A(){t[21].call(d,t[29],t[30])}var O=function(){return t[22](d,E,T)},D=function(){return t[22](null,E,T)};return{c:function(){e=W("div"),n=W("label"),r=Z(C),o=J(),a=W("div"),s=W("div"),u=W("div"),c=W("label"),l=Z(M),f=J(),d=W("input"),m=J(),g=W("input"),x=J(),G(n,"for",i=t[28].id),G(c,"for",h=t[28].id+"-checkbox"),G(c,"class","sr-only"),G(d,"type","checkbox"),G(d,"title",p=t[28].help[t[7]]),d.__value=v=t[28].name,d.value=d.__value,G(u,"class","input-group-text"),G(s,"class","input-group-prepend"),G(g,"type","color"),G(g,"id",y=t[28].id),G(g,"class","form-control"),G(g,"name",b=t[28].name),g.disabled=w=!t[28].enabled,g.value=_=t[10]("mark-".concat(t[5].position),t[28].name,t[5].mark.attrs[t[28].name]),G(a,"class","input-group"),G(e,"class","col form-group")},m:function(i,h){V(i,e,h),$(e,n),$(n,r),$(e,o),$(e,a),$(a,s),$(s,u),$(u,c),$(c,l),$(u,f),$(u,d),d.checked=t[28].enabled,O(),$(a,m),$(a,g),$(e,x),k||(S=[Y(d,"change",A),Y(d,"change",K(t[16])),Y(g,"change",K(t[15]))],k=!0)},p:function(e,o){t=e,8&o&&C!==(C=t[28].label[t[7]]+"")&&Q(r,C),8&o&&i!==(i=t[28].id)&&G(n,"for",i),8&o&&M!==(M=t[28].help[t[7]]+"")&&Q(l,M),8&o&&h!==(h=t[28].id+"-checkbox")&&G(c,"for",h),8&o&&p!==(p=t[28].help[t[7]])&&G(d,"title",p),8&o&&v!==(v=t[28].name)&&(d.__value=v,d.value=d.__value),8&o&&(d.checked=t[28].enabled),(E!==t[29]||T!==t[30])&&(D(),E=t[29],T=t[30],O()),8&o&&y!==(y=t[28].id)&&G(g,"id",y),8&o&&b!==(b=t[28].name)&&G(g,"name",b),8&o&&w!==(w=!t[28].enabled)&&(g.disabled=w),40&o&&_!==(_=t[10]("mark-".concat(t[5].position),t[28].name,t[5].mark.attrs[t[28].name]))&&(g.value=_)},d:function(t){t&&U(e),D(),k=!1,R(S)}}}function ic(t){var e,n,r,i,o,a,s,u,c,l,h,f,p,v,m,g,y,b,w,_,x,k,S,C,M,E,T,A,O,D,P,L,N,I,z,B,j,F,q,H,Z,X,Q,nt,rt,it,ot;r=new ju({props:{view:t[2],state:t[2].state||t[0]}}),a=new Xu({props:{view:t[2],alert:t[17],state:t[2].state||t[0],type:t[2].state.schema.marks.strong,faIcon:"bold"}}),u=new Xu({props:{view:t[2],alert:t[17],state:t[2].state||t[0],type:t[2].state.schema.marks.em,faIcon:"italic"}}),l=new Xu({props:{view:t[2],alert:t[17],state:t[2].state||t[0],type:t[2].state.schema.marks.underline,faIcon:"underline"}}),f=new Xu({props:{view:t[2],alert:t[17],state:t[2].state||t[0],type:t[2].state.schema.marks.strikethrough,faIcon:"strikethrough"}}),v=new Xu({props:{view:t[2],alert:t[17],state:t[2].state||t[0],type:t[2].state.schema.marks.sub,faIcon:"subscript"}}),g=new Xu({props:{view:t[2],alert:t[17],state:t[2].state||t[0],type:t[2].state.schema.marks.sup,faIcon:"superscript"}}),b=new Xu({props:{view:t[2],alert:t[17],state:t[2].state||t[0],type:t[2].state.schema.marks.small,faIcon:"font",small:!0}}),L=new fu({props:{view:t[2],state:t[2].state||t[0]}}),z=new Uu({props:{view:t[2],state:t[2].state||t[0],kind:Du.Unordered}}),j=new Uu({props:{view:t[2],state:t[2].state||t[0],kind:Du.Ordered}}),q=new Tu({props:{view:t[2],state:t[2].state||t[0]}}),Z=new Zu({props:{view:t[2],state:t[2].state||t[0]}});var at=t[6]&&tc(t),st=t[4]&&ec(t),ut=t[5]&&nc(t);return{c:function(){e=W("div"),n=W("div"),kt(r.$$.fragment),i=J(),o=W("div"),kt(a.$$.fragment),s=J(),kt(u.$$.fragment),c=J(),kt(l.$$.fragment),h=J(),kt(f.$$.fragment),p=J(),kt(v.$$.fragment),m=J(),kt(g.$$.fragment),y=J(),kt(b.$$.fragment),w=J(),_=W("button"),x=J(),k=W("button"),S=W("i"),C=J(),(M=W("span")).textContent="".concat(t[8].link[t[7]]),E=J(),T=W("button"),A=W("i"),O=J(),(D=W("span")).textContent="".concat(t[8].mark[t[7]]),P=J(),kt(L.$$.fragment),N=J(),I=W("div"),kt(z.$$.fragment),B=J(),kt(j.$$.fragment),F=J(),kt(q.$$.fragment),H=J(),kt(Z.$$.fragment),X=J(),at&&at.c(),Q=J(),st&&st.c(),nt=J(),ut&&ut.c(),G(_,"type","button"),G(_,"class","btn btn-info"),G(_,"title",t[8].footnote[t[7]]),G(S,"class","fa fa-external-link"),G(M,"class","sr-only"),G(k,"type","button"),G(k,"class","btn btn-info"),G(k,"title",t[8].link[t[7]]),et(k,"active",bu(t[2].state||t[0],t[2].state.schema.marks.link)),G(A,"class","fa fa-tint"),G(D,"class","sr-only"),G(T,"type","button"),G(T,"class","btn btn-info"),G(T,"title",t[8].mark[t[7]]),et(T,"active",bu(t[2].state||t[0],t[2].state.schema.marks.mark)),G(o,"class","btn-group mx-1"),G(I,"class","btn-group mx-1"),G(n,"class","d-flex flex-row flex-wrap align-items-center"),G(e,"class","menubar mb-2 position-sticky py-1 svelte-1wlr09m"),tt(e,"top","0"),tt(e,"background-color","var(--background)")},m:function(d,R){V(d,e,R),$(e,n),St(r,n,null),$(n,i),$(n,o),St(a,o,null),$(o,s),St(u,o,null),$(o,c),St(l,o,null),$(o,h),St(f,o,null),$(o,p),St(v,o,null),$(o,m),St(g,o,null),$(o,y),St(b,o,null),$(o,w),$(o,_),_.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="437.786" height="500.628" viewBox="0 0 115.831 132.458"><g fill="currentColor" stroke-width="8.949" aria-label="[1]" font-size="107.384"><path d="M30.584 132.458H0V19.452h30.584V32.8H16.458v86.31h14.126z" font-weight="700"/><path d="M68.613 60.144h-12.72V21.817q.085-2.106.17-4.38.083-2.275.168-4.043-.422.505-1.854 1.853-1.347 1.263-2.527 2.274l-6.907 5.56-6.15-7.666L58.169 0h10.445Z" baseline-shift="super"/><path d="M85.247 119.11h14.125V32.8H85.247V19.452h30.584v113.006H85.247z"/></g></svg>',$(o,x),$(o,k),$(k,S),$(k,C),$(k,M),$(o,E),$(o,T),$(T,A),$(T,O),$(T,D),$(n,P),St(L,n,null),$(n,N),$(n,I),St(z,I,null),$(I,B),St(j,I,null),$(n,F),St(q,n,null),$(n,H),St(Z,n,null),$(e,X),at&&at.m(e,null),$(e,Q),st&&st.m(e,null),$(e,nt),ut&&ut.m(e,null),rt=!0,it||(ot=[Y(_,"mousedown",K(t[11])),Y(k,"mousedown",K(t[12])),Y(T,"mousedown",K(t[14]))],it=!0)},p:function(t,n){var i=d(n,1)[0],o={};4&i&&(o.view=t[2]),5&i&&(o.state=t[2].state||t[0]),r.$set(o);var s={};4&i&&(s.view=t[2]),5&i&&(s.state=t[2].state||t[0]),4&i&&(s.type=t[2].state.schema.marks.strong),a.$set(s);var c={};4&i&&(c.view=t[2]),5&i&&(c.state=t[2].state||t[0]),4&i&&(c.type=t[2].state.schema.marks.em),u.$set(c);var h={};4&i&&(h.view=t[2]),5&i&&(h.state=t[2].state||t[0]),4&i&&(h.type=t[2].state.schema.marks.underline),l.$set(h);var p={};4&i&&(p.view=t[2]),5&i&&(p.state=t[2].state||t[0]),4&i&&(p.type=t[2].state.schema.marks.strikethrough),f.$set(p);var m={};4&i&&(m.view=t[2]),5&i&&(m.state=t[2].state||t[0]),4&i&&(m.type=t[2].state.schema.marks.sub),v.$set(m);var y={};4&i&&(y.view=t[2]),5&i&&(y.state=t[2].state||t[0]),4&i&&(y.type=t[2].state.schema.marks.sup),g.$set(y);var w={};4&i&&(w.view=t[2]),5&i&&(w.state=t[2].state||t[0]),4&i&&(w.type=t[2].state.schema.marks.small),b.$set(w),(!rt||5&i)&&et(k,"active",bu(t[2].state||t[0],t[2].state.schema.marks.link)),(!rt||5&i)&&et(T,"active",bu(t[2].state||t[0],t[2].state.schema.marks.mark));var _={};4&i&&(_.view=t[2]),5&i&&(_.state=t[2].state||t[0]),L.$set(_);var x={};4&i&&(x.view=t[2]),5&i&&(x.state=t[2].state||t[0]),z.$set(x);var S={};4&i&&(S.view=t[2]),5&i&&(S.state=t[2].state||t[0]),j.$set(S);var C={};4&i&&(C.view=t[2]),5&i&&(C.state=t[2].state||t[0]),q.$set(C);var M={};4&i&&(M.view=t[2]),5&i&&(M.state=t[2].state||t[0]),Z.$set(M),t[6]?at?at.p(t,i):((at=tc(t)).c(),at.m(e,Q)):at&&(at.d(1),at=null),t[4]?st?st.p(t,i):((st=ec(t)).c(),st.m(e,nt)):st&&(st.d(1),st=null),t[5]?ut?ut.p(t,i):((ut=nc(t)).c(),ut.m(e,null)):ut&&(ut.d(1),ut=null)},i:function(t){rt||(_t(r.$$.fragment,t),_t(a.$$.fragment,t),_t(u.$$.fragment,t),_t(l.$$.fragment,t),_t(f.$$.fragment,t),_t(v.$$.fragment,t),_t(g.$$.fragment,t),_t(b.$$.fragment,t),_t(L.$$.fragment,t),_t(z.$$.fragment,t),_t(j.$$.fragment,t),_t(q.$$.fragment,t),_t(Z.$$.fragment,t),rt=!0)},o:function(t){xt(r.$$.fragment,t),xt(a.$$.fragment,t),xt(u.$$.fragment,t),xt(l.$$.fragment,t),xt(f.$$.fragment,t),xt(v.$$.fragment,t),xt(g.$$.fragment,t),xt(b.$$.fragment,t),xt(L.$$.fragment,t),xt(z.$$.fragment,t),xt(j.$$.fragment,t),xt(q.$$.fragment,t),xt(Z.$$.fragment,t),rt=!1},d:function(t){t&&U(e),Ct(r),Ct(a),Ct(u),Ct(l),Ct(f),Ct(v),Ct(g),Ct(b),Ct(L),Ct(z),Ct(j),Ct(q),Ct(Z),at&&at.d(),st&&st.d(),ut&&ut.d(),it=!1,R(ot)}}}function oc(t,e,n){var r,i,o,a,s=P,u=function(){return s(),s=j(_,(function(t){return n(18,i=t)})),_};t.$$.on_destroy.push((function(){return s()}));var c=Zs(),l=[{name:"color",id:Pt(),label:{es:"Color",en:"Color"},help:{es:"Habilita este casillero para elegir un color",en:"Enable this checkbox to pick a color"},enabled:!0},{name:"backgroundColor",id:Pt(),label:{es:"Resaltado",en:"Highlight"},help:{es:"Habilita este casillero para elegir un color",en:"Enable this checkbox to pick a color"},enabled:!0}],f={},d={color:"inherit",backgroundColor:"#fcf8e3"};var p,v,m=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:300,e=null,n=Ot(!1);function r(r){return r?(n.set(!1),!0):(e&&clearTimeout(e),e=setTimeout((function(){n.set(!0),e=null}),t),!1)}return Dt(n,(function(t){return{up:function(){return r(t)}}}))}(300);function g(t,e,n){return f[t]&&f[t][e]||n}function y(t){t(r.state,r.dispatch)}F(t,m,(function(t){return n(19,o=t)}));var b=Ot(null);F(t,b,(function(t){return n(6,a=t)}));var w=e.state,_=e.focusedView;u();return t.$$set=function(t){"state"in t&&n(0,w=t.state),"focusedView"in t&&u(n(1,_=t.focusedView))},t.$$.update=function(){262144&t.$$.dirty&&n(2,r=i),524293&t.$$.dirty&&o.up()&&(n(4,p=wu(r.state,r.state.schema.marks.link)),n(5,v=function(t){var e=wu(r.state,r.state.schema.marks.mark);if(e){var n,i=S(l);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=e.mark.attrs[o.name];o.enabled=!(null===a||"inherit"===a),o.checkbox&&(o.checkbox.checked=o.enabled)}}catch(s){i.e(s)}finally{i.f()}}return e}(r.state)))},[w,_,r,l,p,v,a,c,{link:{es:"Enlace externo",en:"External link"},mark:{es:"Resaltado",en:"Highlight"},footnote:{es:"Nota al pie",en:"Footnote"}},m,g,function(){if(r.state===w){var t=w.schema.nodes.footnote.create(null,qt.empty),e=_n(w.doc,w.selection.to,w.schema.nodes.footnote);r.dispatch(r.state.tr.insert(e,t))}},function(){var t=r.state.schema.marks.link;wu(r.state,t)?y(vu(t)):y(pu(t,{href:""}))},function(t){var e=t.target,n=e.parentElement;if(n.classList.remove("was-validated"),e.checkValidity()){var i=e.value;y(i?pu(r.state.schema.marks.link,{href:i}):vu(r.state.schema.marks.link))}else n.classList.add("was-validated")},function(){var t=r.state.schema.marks.mark;wu(r.state,t)?y(vu(t)):y(pu(t,h({},d)))},function(t){var e=r.state.schema.marks.mark,n=t.target,i=n.name,o=n.value;if(o){var a=h({},v.mark.attrs);a[i]=o,d[i]=o,y(pu(e,a))}else y(vu(e))},function(t){var e=t.target,n="mark-".concat(v.position),i=e.value,o=h({},v.mark.attrs);e.checked?o[i]=g(n,i,d[i]):(function(t,e,n){f[t]||(f[t]={}),f[t][e]=n}(n,i,o[i]),o[i]="inherit",d[i]="inherit"),y(pu(r.state.schema.marks.mark,o))},b,i,o,function(){return q(b,a=null,a)},function(t,e){t[e].enabled=this.checked,n(3,l)},function(t,e,r){st[t?"unshift":"push"]((function(){e[r].checkbox=t,n(3,l)}))}]}var ac=function(t){v(n,t);var e=m(n);function n(t){var r;return C(this,n),Et(y(r=e.call(this)),t,oc,ic,z,{state:0,focusedView:1}),r}return n}(Tt);function sc(t,e){var n=null,r=0;return t.descendants((function(t,i){if(null!==n)return!1;if("footnote"===t.type.name){if(i===e)return n=r,!1;r++}})),n}var uc=function(t){return new rr({props:{handleClickOn:function(e,n,r,i,o,a){if(a&&"footnote"===r.type.name){var s=sc(e.state.doc,i);if(null===s)return console.error("Clickearon",r,"pero no pude encontrar la footnote en el documento"),!1;var u=document.querySelector("#sutty-editor-".concat(t,"-footnote-").concat(s," .ProseMirror"));return u?(u.focus(),u.scrollIntoView({behavior:"smooth",block:"center"}),!0):(console.error("Clickearon",r,"que es la footnote con index",s,"pero no pude encontrar el contenido de la footnote en el documento"),!1)}}}})};function cc(t){var e,n,r,i;return{c:function(){e=W("li"),n=W("div"),G(e,"id",t[2])},m:function(o,a){V(o,e,a),$(e,n),t[9](n),r||(i=Y(e,"click",t[3]),r=!0)},p:function(t,n){4&d(n,1)[0]&&G(e,"id",t[2])},i:P,o:P,d:function(n){n&&U(e),t[9](null),r=!1,i()}}}function lc(t,e,n){var r,i,o=P,a=function(){return o(),o=j(c,(function(t){return n(10,i=t)})),c};t.$$.on_destroy.push((function(){return o()}));var s=e.outerView,u=e.footnote,c=e.focusedView;a();var l,h=e.editorId,f=e.index,d=null;function p(t){if(d){var e=d.state.applyTransaction(t),n=e.state,r=e.transactions;if(d.updateState(n),!t.getMeta("fromOutside")){for(var i=s.state.tr,o=Ye.offset(u.position+1),a=0;a<r.length;a++)for(var c=r[a].steps,l=0;l<c.length;l++)i.step(c[l].map(o));s.dispatch(i)}}}return it((function(){n(8,d=new qa(l,{state:er.create({doc:u.node,plugins:[Nr({"Mod-z":function(){return _r(s.state,s.dispatch)},"Mod-y":function(){return xr(s.state,s.dispatch)}})]}),dispatchTransaction:p,handleDOMEvents:{focus:function(){q(c,i=d,i)}}}))})),ot((function(){d.destroy()})),t.$$set=function(t){"outerView"in t&&n(4,s=t.outerView),"footnote"in t&&n(5,u=t.footnote),"focusedView"in t&&a(n(0,c=t.focusedView)),"editorId"in t&&n(6,h=t.editorId),"index"in t&&n(7,f=t.index)},t.$$.update=function(){if(192&t.$$.dirty&&n(2,r="sutty-editor-".concat(h,"-footnote-").concat(f)),288&t.$$.dirty&&d){var e=d.state,i=u.node.content.findDiffStart(e.doc.content);if(null!=i){var o=u.node.content.findDiffEnd(e.doc.content),a=o.a,s=o.b,c=i-Math.min(a,s);c>0&&(a+=c,s+=c),d.dispatch(e.tr.replace(i,s,u.node.slice(i,a)).setMeta("fromOutside",!0))}}},[c,l,r,function(t){var e=t.target;if(e.id===r){var n=sc(s.state.doc,u.position);if(null===n)return console.error("Clickearon",e,"pero no pude encontrar la footnote en el documento"),!1;var i=s.dom.querySelectorAll("footnote")[n];return i.parentElement.focus(),i.scrollIntoView({behavior:"smooth",block:"center"}),!0}},s,u,h,f,d,function(t){st[t?"unshift":"push"]((function(){n(1,l=t)}))}]}var hc=function(t){v(n,t);var e=m(n);function n(t){var r;return C(this,n),Et(y(r=e.call(this)),t,lc,cc,z,{outerView:4,footnote:5,focusedView:0,editorId:6,index:7}),r}return n}(Tt);function fc(t,e,n){var r=t.slice();return r[5]=e[n],r[7]=n,r}function dc(t){for(var e,n,r=t[3],i=[],o=0;o<r.length;o+=1)i[o]=pc(fc(t,r,o));var a=function(t){return xt(i[t],1,1,(function(){i[t]=null}))};return{c:function(){e=W("ol");for(var t=0;t<i.length;t+=1)i[t].c()},m:function(t,r){V(t,e,r);for(var o=0;o<i.length;o+=1)i[o]&&i[o].m(e,null);n=!0},p:function(t,n){if(15&n){var o;for(r=t[3],o=0;o<r.length;o+=1){var s=fc(t,r,o);i[o]?(i[o].p(s,n),_t(i[o],1)):(i[o]=pc(s),i[o].c(),_t(i[o],1),i[o].m(e,null))}for(bt(),o=r.length;o<i.length;o+=1)a(o);wt()}},i:function(t){if(!n){for(var e=0;e<r.length;e+=1)_t(i[e]);n=!0}},o:function(t){i=i.filter(Boolean);for(var e=0;e<i.length;e+=1)xt(i[e]);n=!1},d:function(t){t&&U(e),H(i,t)}}}function pc(t){var e,n;return e=new hc({props:{footnote:t[5],outerView:t[0],focusedView:t[1],editorId:t[2],index:t[7]}}),{c:function(){kt(e.$$.fragment)},m:function(t,r){St(e,t,r),n=!0},p:function(t,n){var r={};8&n&&(r.footnote=t[5]),1&n&&(r.outerView=t[0]),2&n&&(r.focusedView=t[1]),4&n&&(r.editorId=t[2]),e.$set(r)},i:function(t){n||(_t(e.$$.fragment,t),n=!0)},o:function(t){xt(e.$$.fragment,t),n=!1},d:function(t){Ct(e,t)}}}function vc(t){var e,n,r=t[3].length>0&&dc(t);return{c:function(){r&&r.c(),e=Z("")},m:function(t,i){r&&r.m(t,i),V(t,e,i),n=!0},p:function(t,n){var i=d(n,1)[0];t[3].length>0?r?(r.p(t,i),8&i&&_t(r,1)):((r=dc(t)).c(),_t(r,1),r.m(e.parentNode,e)):r&&(bt(),xt(r,1,1,(function(){r=null})),wt())},i:function(t){n||(_t(r),n=!0)},o:function(t){xt(r),n=!1},d:function(t){r&&r.d(t),t&&U(e)}}}function mc(t,e,n){var r,i=e.view,o=e.state,a=e.focusedView,s=e.editorId;return t.$$set=function(t){"view"in t&&n(0,i=t.view),"state"in t&&n(4,o=t.state),"focusedView"in t&&n(1,a=t.focusedView),"editorId"in t&&n(2,s=t.editorId)},t.$$.update=function(){16&t.$$.dirty&&n(3,r=function(t){var e=[];return t.doc.descendants((function(t,n,r,i){"footnote"===t.type.name&&e.push({node:t,position:n})})),e}(o))},[i,a,s,r,o]}var gc=function(t){v(n,t);var e=m(n);function n(t){var r;return C(this,n),Et(y(r=e.call(this)),t,mc,vc,z,{view:0,state:4,focusedView:1,editorId:2}),r}return n}(Tt);var yc=new rr({view:function(){return{update:function(t){for(var e=t.state.tr,n=[],r=function(){var r=!1;if(e.doc.descendants((function(i,o){if(r)return!1;if("multimedia"===i.type.name&&!i.attrs.src.startsWith(Pu)){var a=d(function(t,e,n,r){var i=n.attrs.src,o=_n(t.doc,r,e.state.schema.nodes.multimedia),a=Pt();return Lu(new File([i],Pt()+i.slice(i.lastIndexOf("/")+1),{type:"sutty/download-from-url"}),a).then(function(){var t=c(s.a.mark((function t(n){var r,i,o,u;return s.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=n.url,i=n.contentType,null!=(o=Ru(e.state,a))){t.next=4;break}return t.abrupt("return");case 4:u=e.state.schema.nodes.multimedia.createChecked({src:r,kind:Iu(i)}),e.dispatch(e.state.tr.replaceWith(o,o,u).setMeta(Nu,[{remove:{id:a}}]));case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){return console.error("No pude fetchear el src",t)})),[t,{add:{id:a,pos:o,unknownProgress:!0}}]}(e=e.delete(o,o+1),t,i,o),2),u=a[0],l=a[1];return e=u,n.push(l),r=!0,!1}})),!r)return"break"};;){if("break"===r())break}(e.docChanged||n.length>0)&&t.dispatch(e.setMeta(Nu,n))}}}}),bc=ru(Js,(function(t,e,n){var r=function(t,e){var n=t.selection.$cursor;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}(t,n);if(!r)return!1;var i=Ks(r);if(!i){var o=r.blockRange(),a=o&&ln(o);return null!=a&&(e&&e(t.tr.lift(o,a).scrollIntoView()),!0)}var s=i.nodeBefore;if(!s.type.spec.isolating&&tu(t,i,e))return!0;if(0==r.parent.content.size&&(Ys(s,"end")||Un.isSelectable(s))){var u=kn(t.doc,r.before(),r.after(),Zt.empty);if(u&&u.slice.size<u.to-u.from){if(e){var c=t.tr.step(u);c.setSelection(Ys(s,"end")?Bn.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):Un.create(c.doc,i.pos-s.nodeSize)),e(c.scrollIntoView())}return!0}}return!(!s.isAtom||i.depth!=r.depth-1)&&(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0)}),(function(t,e,n){var r=t.selection,i=r.$head,o=i;if(!r.empty)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):i.parentOffset>0)return!1;o=Ks(i)}var a=o&&o.nodeBefore;return!(!a||!Un.isSelectable(a))&&(e&&e(t.tr.setSelection(Un.create(t.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)})),wc=ru(Js,(function(t,e,n){var r=function(t,e){var n=t.selection.$cursor;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}(t,n);if(!r)return!1;var i=Gs(r);if(!i)return!1;var o=i.nodeAfter;if(tu(t,i,e))return!0;if(0==r.parent.content.size&&(Ys(o,"start")||Un.isSelectable(o))){var a=kn(t.doc,r.before(),r.after(),Zt.empty);if(a&&a.slice.size<a.to-a.from){if(e){var s=t.tr.step(a);s.setSelection(Ys(o,"start")?Bn.findFrom(s.doc.resolve(s.mapping.map(i.pos)),1):Un.create(s.doc,s.mapping.map(i.pos))),e(s.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1)&&(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0)}),(function(t,e,n){var r=t.selection,i=r.$head,o=i;if(!r.empty)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):i.parentOffset<i.parent.content.size)return!1;o=Gs(i)}var a=o&&o.nodeAfter;return!(!a||!Un.isSelectable(a))&&(e&&e(t.tr.setSelection(Un.create(t.doc,o.pos)).scrollIntoView()),!0)})),_c={Enter:ru((function(t,e){var n=t.selection,r=n.$head,i=n.$anchor;return!(!r.parent.type.spec.code||!r.sameParent(i))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)}),(function(t,e){var n=t.selection,r=n.$from,i=n.$to;if(n instanceof Wn||r.parent.inlineContent||i.parent.inlineContent)return!1;var o=Xs(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){var a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=t.tr.insert(a,o.createAndFill());s.setSelection($n.create(s.doc,a+1)),e(s.scrollIntoView())}return!0}),(function(t,e){var n=t.selection.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var r=n.before();if(gn(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}var i=n.blockRange(),o=i&&ln(i);return null!=o&&(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)}),function(t){return function(e,n){var r=e.selection,i=r.$from,o=r.$to,a=r.node;if(a&&a.isBlock||i.depth<2||!i.sameParent(o))return!1;var s=i.node(-1);if(s.type!=t)return!1;if(0==i.parent.content.size&&i.node(-1).childCount==i.indexAfter(-1)){if(3==i.depth||i.node(-3).type!=t||i.index(-2)!=i.node(-2).childCount-1)return!1;if(n){for(var u=qt.empty,c=i.index(-1)?1:i.index(-2)?2:3,l=i.depth-c;l>=i.depth-3;l--)u=qt.from(i.node(l).copy(u));var h=i.indexAfter(-1)<i.node(-2).childCount?1:i.indexAfter(-2)<i.node(-3).childCount?2:3;u=u.append(qt.from(t.createAndFill()));var f=i.before(i.depth-(c-1)),d=e.tr.replace(f,i.after(-h),new Zt(u,4-c,0)),p=-1;d.doc.nodesBetween(f,d.doc.content.size,(function(t,e){if(p>-1)return!1;t.isTextblock&&0==t.content.size&&(p=e+1)})),p>-1&&d.setSelection(Bn.near(d.doc.resolve(p))),n(d.scrollIntoView())}return!0}var v=o.pos==i.end()?s.contentMatchAt(0).defaultType:null,m=e.tr.delete(i.pos,o.pos),g=v?[null,{type:v}]:void 0;return!!gn(m.doc,i.pos,2,g)&&(n&&n(m.split(i.pos,2,g).scrollIntoView()),!0)}}(Ws.nodes.list_item),Qs),"Mod-Enter":ru((function(t,e){var n=t.selection,r=n.$head,i=n.$anchor;if(!r.parent.type.spec.code||!r.sameParent(i))return!1;var o=r.node(-1),a=r.indexAfter(-1),s=Xs(o.contentMatchAt(a));if(!s||!o.canReplaceWith(a,a,s))return!1;if(e){var u=r.after(),c=t.tr.replaceWith(u,u,s.createAndFill());c.setSelection(Bn.near(c.doc.resolve(u),1)),e(c.scrollIntoView())}return!0}),Qs),Backspace:bc,"Mod-Backspace":bc,Delete:wc,"Mod-Delete":wc,"Mod-a":function(t,e){return e&&e(t.tr.setSelection(new Wn(t.doc))),!0},"Shift-Tab":qu(Ws.nodes.list_item),Tab:function(t){return function(e,n){var r=e.selection,i=r.$from,o=r.$to,a=i.blockRange(o,(function(e){return e.childCount>0&&e.firstChild.type==t}));if(!a)return!1;var s=a.startIndex;if(0==s)return!1;var u=a.parent,c=u.child(s-1);if(c.type!=t)return!1;if(n){var l=c.lastChild&&c.lastChild.type==u.type,h=qt.from(l?t.create():null),f=new Zt(qt.from(t.create(null,qt.from(u.type.create(null,h)))),l?3:1,0),d=a.start,p=a.end;n(e.tr.step(new sn(d-(l?3:1),p,d,p,f,1,!0)).scrollIntoView())}return!0}}(Ws.nodes.list_item)},xc=h(h({},_c),{},{"Ctrl-h":_c.Backspace,"Alt-Backspace":_c["Mod-Backspace"],"Ctrl-d":_c.Delete,"Ctrl-Alt-Backspace":_c["Mod-Delete"],"Alt-Delete":_c["Mod-Delete"],"Alt-d":_c["Mod-Delete"]}),kc=h(h({},("undefined"===typeof navigator?"undefined":D(navigator))<"u"&&/Mac/.test(navigator.platform)?xc:_c),{},{"Mod-z":_r,"Mod-y":xr});function Sc(t){var e,n;return{c:function(){G(e=W("iframe"),"class","w-100"),B(e.src,n=t[2])||G(e,"src",n)},m:function(t,n){V(t,e,n)},p:function(t,r){4&r&&!B(e.src,n=t[2])&&G(e,"src",n)},d:function(t){t&&U(e)}}}function Cc(t){var e,n;return{c:function(){G(e=W("video"),"class","max-w-100"),B(e.src,n=t[2])||G(e,"src",n),e.controls=!0},m:function(t,n){V(t,e,n)},p:function(t,r){4&r&&!B(e.src,n=t[2])&&G(e,"src",n)},d:function(t){t&&U(e)}}}function Mc(t){var e,n;return{c:function(){G(e=W("video"),"class","max-w-100"),B(e.src,n=t[2])||G(e,"src",n),e.controls=!0},m:function(t,n){V(t,e,n)},p:function(t,r){4&r&&!B(e.src,n=t[2])&&G(e,"src",n)},d:function(t){t&&U(e)}}}function Ec(t){var e,n,r,i,o,a,s;return{c:function(){e=W("div"),n=W("textarea"),r=J(),i=W("img"),G(n,"class","form-control svelte-1qyw5ki"),G(n,"placeholder",t[5].inputPlaceholder[t[4]]),n.value=t[0],G(i,"class","max-w-100"),B(i.src,o=t[2])||G(i,"src",o),G(i,"alt",t[0]),G(e,"class","svelte-1qyw5ki")},m:function(o,u){V(o,e,u),$(e,n),$(e,r),$(e,i),a||(s=Y(n,"input",t[8]),a=!0)},p:function(t,e){1&e&&(n.value=t[0]),4&e&&!B(i.src,o=t[2])&&G(i,"src",o),1&e&&G(i,"alt",t[0])},d:function(t){t&&U(e),a=!1,s()}}}function Tc(t){var e;function n(t,e){return"img"===t[1]?Ec:"video"===t[1]?Mc:"audio"===t[1]?Cc:"iframe"===t[1]?Sc:void 0}var r=n(t),i=r&&r(t);return{c:function(){e=W("figure"),i&&i.c()},m:function(t,n){V(t,e,n),i&&i.m(e,null)},p:function(t,o){var a=d(o,1)[0];r===(r=n(t))&&i?i.p(t,a):(i&&i.d(1),(i=r&&r(t))&&(i.c(),i.m(e,null)))},i:P,o:P,d:function(t){t&&U(e),i&&i.d()}}}function Ac(t,e,n){var r,i,o,a,s=Zs(),u=e.attrs,c=e.controls;return t.$$set=function(t){"attrs"in t&&n(6,u=t.attrs),"controls"in t&&n(7,c=t.controls)},t.$$.update=function(){128&t.$$.dirty&&n(3,r=function(t){return c.update((function(e,n,r){return e.tr.setNodeAttribute(r(),"alt",t)}))}),64&t.$$.dirty&&n(2,i=u.src),64&t.$$.dirty&&n(1,o=u.kind),64&t.$$.dirty&&n(0,a=u.alt)},[a,o,i,r,s,{inputPlaceholder:{es:"Describ\xed la imagen para hacerla accesible y encontrable por buscadores",en:"Describe the image to make it accessible and findable in search engines"}},u,c,function(t){return r(t.currentTarget.value)}]}var Oc=function(t){v(n,t);var e=m(n);function n(t){var r;return C(this,n),Et(y(r=e.call(this)),t,Ac,Tc,z,{attrs:6,controls:7}),r}return n}(Tt);function Dc(t){var e,n;return e=new ac({props:{state:t[0],focusedView:t[6]}}),{c:function(){kt(e.$$.fragment)},m:function(t,r){St(e,t,r),n=!0},p:function(t,n){var r={};1&n&&(r.state=t[0]),e.$set(r)},i:function(t){n||(_t(e.$$.fragment,t),n=!0)},o:function(t){xt(e.$$.fragment,t),n=!1},d:function(t){Ct(e,t)}}}function Pc(t){var e,n;return e=new gc({props:{view:t[2],state:t[0],focusedView:t[6],editorId:t[5]}}),{c:function(){kt(e.$$.fragment)},m:function(t,r){St(e,t,r),n=!0},p:function(t,n){var r={};4&n&&(r.view=t[2]),1&n&&(r.state=t[0]),e.$set(r)},i:function(t){n||(_t(e.$$.fragment,t),n=!0)},o:function(t){xt(e.$$.fragment,t),n=!1},d:function(t){Ct(e,t)}}}function Lc(t){var e,n,r,i,o,a,s=t[2]&&t[4]&&Dc(t),u=t[2]&&Pc(t);return{c:function(){e=W("div"),s&&s.c(),n=J(),r=W("div"),i=J(),u&&u.c(),o=J(),G(e,"class","editor svelte-afi34z")},m:function(c,l){V(c,e,l),s&&s.m(e,null),$(e,n),$(e,r),t[8](r),$(e,i),u&&u.m(e,null),$(e,o),a=!0},p:function(t,r){var i=d(r,1)[0];t[2]&&t[4]?s?(s.p(t,i),20&i&&_t(s,1)):((s=Dc(t)).c(),_t(s,1),s.m(e,n)):s&&(bt(),xt(s,1,1,(function(){s=null})),wt()),t[2]?u?(u.p(t,i),4&i&&_t(u,1)):((u=Pc(t)).c(),_t(u,1),u.m(e,o)):u&&(bt(),xt(u,1,1,(function(){u=null})),wt())},i:function(t){a||(_t(s),_t(u),a=!0)},o:function(t){xt(s),xt(u),a=!1},d:function(n){n&&U(e),s&&s.d(),t[8](null),u&&u.d()}}}function Nc(t,e,n){var r,i=Pt(),o=Pe.fromSchema(Ws),a=new $e(h(h({},$e.nodesFromSchema(Ws)),{},{footnote:function(){return["will-fix-afterwards-footnote",0]}}),$e.marksFromSchema(Ws));var s,u,c,l=e.textareaEl;it((function(){var t=document.createElement("div");t.innerHTML=l.value;var e=o.parse(t);n(0,u=er.create({schema:Ws,doc:e,plugins:[new rr({view:function(t){return t.dom.parentElement.replaceWith(t.dom),{update:function(t,e){n(0,u=t.state)}}}}),Za(),new rr({props:{decorations:es,createSelectionBetween:function(t,e,n){return e.pos==n.pos&&Ya.valid(n)?new Ya(n):null},handleClick:Qa,handleKeyDown:Ga,handleDOMEvents:{beforeinput:ts}}}),wr(),Nr(kc),Nu,uc(i),yc,us({nodes:{multimedia:Oc}})]})),n(2,c=new qa(s,{state:u,handleDOMEvents:{focus:function(){q(f,r=c,r)}}})),q(f,r=c,r),c.dom.classList.add("form-control","h-auto")})),ot((function(){c.destroy(),n(7,l.hidden=!1,l)}));var f=Ot(c);F(t,f,(function(t){return n(4,r=t)}));return t.$$set=function(t){"textareaEl"in t&&n(7,l=t.textareaEl)},t.$$.update=function(){if(1&t.$$.dirty&&u){var e=function(t){var e=a.serializeFragment(t);if(e instanceof HTMLElement){var n=e;(e=new DocumentFragment).append(n)}var r=e.querySelectorAll("will-fix-afterwards-footnote");if(r.length>0){var i=document.createElement("ol");e.appendChild(i);var o,s=1,u=S(r);try{for(u.s();!(o=u.n()).done;){var c=o.value,l=document.createElement("li");l.id="fn".concat(s),l.append.apply(l,T(c.childNodes));var h=document.createElement("a");h.href="#fnef".concat(s),h.append("\u21a9\ufe0e\ufe0e"),h.setAttribute("role","doc-backlink"),h.dataset.turbo="false",l.append(" ",h),i.appendChild(l);var f=document.createElement("a");f.href="#fn".concat(s),f.id="fnef".concat(s),f.setAttribute("role","doc-noteref"),f.dataset.turbo="false";var d=document.createElement("sup");d.append(""+s),f.appendChild(d),c.replaceWith(f),s++}}catch(p){u.e(p)}finally{u.f()}}return e}(u.doc.content),r=document.createElement("div");r.appendChild(e),n(7,l.innerHTML=r.innerHTML,l)}},n(7,l.hidden=!0,l),[u,s,c,"",r,i,f,l,function(t){st[t?"unshift":"push"]((function(){n(1,s=t)}))}]}var Rc=function(t){v(n,t);var e=m(n);function n(t){var r;return C(this,n),Et(y(r=e.call(this)),t,Nc,Lc,z,{textareaEl:7}),r}return n}(Tt)}).call(this,n(64),n(568).Buffer)},function(t,e,n){(function(t){var r,i;function o(t){return(o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}(function(){(function(){(function(){this.Rails={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]",buttonClickSelector:{selector:"button[data-remote]:not([form]), button[data-confirm]:not([form])",exclude:"form button"},inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])",formDisableSelector:"input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled",formEnableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled",fileInputSelector:"input[name][type=file]:not([disabled])",linkDisableSelector:"a[data-disable-with], a[data-disable]",buttonDisableSelector:"button[data-remote][data-disable-with], button[data-remote][data-disable]"}}).call(this)}).call(this);var a=this.Rails;(function(){(function(){var t;t=null,a.loadCSPNonce=function(){var e;return t=null!=(e=document.querySelector("meta[name=csp-nonce]"))?e.content:void 0},a.cspNonce=function(){return null!=t?t:a.loadCSPNonce()}}).call(this),function(){var t;t=Element.prototype.matches||Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector,a.matches=function(e,n){return null!=n.exclude?t.call(e,n.selector)&&!t.call(e,n.exclude):t.call(e,n)},a.getData=function(t,e){var n;return null!=(n=t._ujsData)?n[e]:void 0},a.setData=function(t,e,n){return null==t._ujsData&&(t._ujsData={}),t._ujsData[e]=n},a.$=function(t){return Array.prototype.slice.call(document.querySelectorAll(t))}}.call(this),function(){var t,e,n;t=a.$,n=a.csrfToken=function(){var t;return(t=document.querySelector("meta[name=csrf-token]"))&&t.content},e=a.csrfParam=function(){var t;return(t=document.querySelector("meta[name=csrf-param]"))&&t.content},a.CSRFProtection=function(t){var e;if(null!=(e=n()))return t.setRequestHeader("X-CSRF-Token",e)},a.refreshCSRFTokens=function(){var r,i;if(i=n(),r=e(),null!=i&&null!=r)return t('form input[name="'+r+'"]').forEach((function(t){return t.value=i}))}}.call(this),function(){var t,e,n,r;n=a.matches,"function"!==typeof(t=window.CustomEvent)&&((t=function(t,e){var n;return(n=document.createEvent("CustomEvent")).initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}).prototype=window.Event.prototype,r=t.prototype.preventDefault,t.prototype.preventDefault=function(){var t;return t=r.call(this),this.cancelable&&!this.defaultPrevented&&Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}}),t}),e=a.fire=function(e,n,r){var i;return i=new t(n,{bubbles:!0,cancelable:!0,detail:r}),e.dispatchEvent(i),!i.defaultPrevented},a.stopEverything=function(t){return e(t.target,"ujs:everythingStopped"),t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()},a.delegate=function(t,e,r,i){return t.addEventListener(r,(function(t){var r;for(r=t.target;r instanceof Element&&!n(r,e);)r=r.parentNode;if(r instanceof Element&&!1===i.call(r,t))return t.preventDefault(),t.stopPropagation()}))}}.call(this),function(){var t,e,n,r,i,o;r=a.cspNonce,e=a.CSRFProtection,a.fire,t={"*":"*/*",text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript",script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},a.ajax=function(t){var e;return t=i(t),e=n(t,(function(){var n,r;return r=o(null!=(n=e.response)?n:e.responseText,e.getResponseHeader("Content-Type")),2===Math.floor(e.status/100)?"function"===typeof t.success&&t.success(r,e.statusText,e):"function"===typeof t.error&&t.error(r,e.statusText,e),"function"===typeof t.complete?t.complete(e,e.statusText):void 0})),!(null!=t.beforeSend&&!t.beforeSend(e,t))&&(e.readyState===XMLHttpRequest.OPENED?e.send(t.data):void 0)},i=function(e){return e.url=e.url||location.href,e.type=e.type.toUpperCase(),"GET"===e.type&&e.data&&(e.url.indexOf("?")<0?e.url+="?"+e.data:e.url+="&"+e.data),null==t[e.dataType]&&(e.dataType="*"),e.accept=t[e.dataType],"*"!==e.dataType&&(e.accept+=", */*; q=0.01"),e},n=function(t,n){var r;return(r=new XMLHttpRequest).open(t.type,t.url,!0),r.setRequestHeader("Accept",t.accept),"string"===typeof t.data&&r.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),t.crossDomain||(r.setRequestHeader("X-Requested-With","XMLHttpRequest"),e(r)),r.withCredentials=!!t.withCredentials,r.onreadystatechange=function(){if(r.readyState===XMLHttpRequest.DONE)return n(r)},r},o=function(t,e){var n,i;if("string"===typeof t&&"string"===typeof e)if(e.match(/\bjson\b/))try{t=JSON.parse(t)}catch(o){}else if(e.match(/\b(?:java|ecma)script\b/))(i=document.createElement("script")).setAttribute("nonce",r()),i.text=t,document.head.appendChild(i).parentNode.removeChild(i);else if(e.match(/\b(xml|html|svg)\b/)){n=new DOMParser,e=e.replace(/;.+/,"");try{t=n.parseFromString(t,e)}catch(o){}}return t},a.href=function(t){return t.href},a.isCrossDomain=function(t){var e,n;(e=document.createElement("a")).href=location.href,n=document.createElement("a");try{return n.href=t,!((!n.protocol||":"===n.protocol)&&!n.host||e.protocol+"//"+e.host===n.protocol+"//"+n.host)}catch(r){return r,!0}}}.call(this),function(){var t,e;t=a.matches,e=function(t){return Array.prototype.slice.call(t)},a.serializeElement=function(n,r){var i,o;return i=[n],t(n,"form")&&(i=e(n.elements)),o=[],i.forEach((function(n){if(n.name&&!n.disabled&&!t(n,"fieldset[disabled] *"))return t(n,"select")?e(n.options).forEach((function(t){if(t.selected)return o.push({name:n.name,value:t.value})})):n.checked||-1===["radio","checkbox","submit"].indexOf(n.type)?o.push({name:n.name,value:n.value}):void 0})),r&&o.push(r),o.map((function(t){return null!=t.name?encodeURIComponent(t.name)+"="+encodeURIComponent(t.value):t})).join("&")},a.formElements=function(n,r){return t(n,"form")?e(n.elements).filter((function(e){return t(e,r)})):e(n.querySelectorAll(r))}}.call(this),function(){var t,e,n;e=a.fire,n=a.stopEverything,a.handleConfirm=function(e){if(!t(this))return n(e)},a.confirm=function(t,e){return confirm(t)},t=function(t){var n,r,i;if(!(i=t.getAttribute("data-confirm")))return!0;if(n=!1,e(t,"confirm")){try{n=a.confirm(i,t)}catch(o){}r=e(t,"confirm:complete",[n])}return n&&r}}.call(this),function(){var t,e,n,r,i,o,s,u,c,l,h,f;l=a.matches,u=a.getData,h=a.setData,f=a.stopEverything,s=a.formElements,a.handleDisabledElement=function(t){if(this,this.disabled)return f(t)},a.enableElement=function(t){var e;if(t instanceof Event){if(c(t))return;e=t.target}else e=t;return l(e,a.linkDisableSelector)?o(e):l(e,a.buttonDisableSelector)||l(e,a.formEnableSelector)?r(e):l(e,a.formSubmitSelector)?i(e):void 0},a.disableElement=function(r){var i;return i=r instanceof Event?r.target:r,l(i,a.linkDisableSelector)?n(i):l(i,a.buttonDisableSelector)||l(i,a.formDisableSelector)?t(i):l(i,a.formSubmitSelector)?e(i):void 0},n=function(t){var e;if(!u(t,"ujs:disabled"))return null!=(e=t.getAttribute("data-disable-with"))&&(h(t,"ujs:enable-with",t.innerHTML),t.innerHTML=e),t.addEventListener("click",f),h(t,"ujs:disabled",!0)},o=function(t){var e;return null!=(e=u(t,"ujs:enable-with"))&&(t.innerHTML=e,h(t,"ujs:enable-with",null)),t.removeEventListener("click",f),h(t,"ujs:disabled",null)},e=function(e){return s(e,a.formDisableSelector).forEach(t)},t=function(t){var e;if(!u(t,"ujs:disabled"))return null!=(e=t.getAttribute("data-disable-with"))&&(l(t,"button")?(h(t,"ujs:enable-with",t.innerHTML),t.innerHTML=e):(h(t,"ujs:enable-with",t.value),t.value=e)),t.disabled=!0,h(t,"ujs:disabled",!0)},i=function(t){return s(t,a.formEnableSelector).forEach(r)},r=function(t){var e;return null!=(e=u(t,"ujs:enable-with"))&&(l(t,"button")?t.innerHTML=e:t.value=e,h(t,"ujs:enable-with",null)),t.disabled=!1,h(t,"ujs:disabled",null)},c=function(t){var e,n;return null!=(null!=(n=null!=(e=t.detail)?e[0]:void 0)?n.getResponseHeader("X-Xhr-Redirect"):void 0)}}.call(this),function(){var t;t=a.stopEverything,a.handleMethod=function(e){var n,r,i,o,s,u,c;if(c=(u=this).getAttribute("data-method"))return s=a.href(u),r=a.csrfToken(),n=a.csrfParam(),i=document.createElement("form"),o="<input name='_method' value='"+c+"' type='hidden' />",null==n||null==r||a.isCrossDomain(s)||(o+="<input name='"+n+"' value='"+r+"' type='hidden' />"),o+='<input type="submit" />',i.method="post",i.action=s,i.target=u.target,i.innerHTML=o,i.style.display="none",document.body.appendChild(i),i.querySelector('[type="submit"]').click(),t(e)}}.call(this),function(){var t,e,n,r,i,o,s,u,c,l=[].slice;o=a.matches,n=a.getData,u=a.setData,e=a.fire,c=a.stopEverything,t=a.ajax,r=a.isCrossDomain,s=a.serializeElement,i=function(t){var e;return null!=(e=t.getAttribute("data-remote"))&&"false"!==e},a.handleRemote=function(h){var f,d,p,v,m,g,y;return!i(v=this)||(e(v,"ajax:before")?(y=v.getAttribute("data-with-credentials"),p=v.getAttribute("data-type")||"script",o(v,a.formSubmitSelector)?(f=n(v,"ujs:submit-button"),m=n(v,"ujs:submit-button-formmethod")||v.method,g=n(v,"ujs:submit-button-formaction")||v.getAttribute("action")||location.href,"GET"===m.toUpperCase()&&(g=g.replace(/\?.*$/,"")),"multipart/form-data"===v.enctype?(d=new FormData(v),null!=f&&d.append(f.name,f.value)):d=s(v,f),u(v,"ujs:submit-button",null),u(v,"ujs:submit-button-formmethod",null),u(v,"ujs:submit-button-formaction",null)):o(v,a.buttonClickSelector)||o(v,a.inputChangeSelector)?(m=v.getAttribute("data-method"),g=v.getAttribute("data-url"),d=s(v,v.getAttribute("data-params"))):(m=v.getAttribute("data-method"),g=a.href(v),d=v.getAttribute("data-params")),t({type:m||"GET",url:g,data:d,dataType:p,beforeSend:function(t,n){return e(v,"ajax:beforeSend",[t,n])?e(v,"ajax:send",[t]):(e(v,"ajax:stopped"),!1)},success:function(){var t;return t=1<=arguments.length?l.call(arguments,0):[],e(v,"ajax:success",t)},error:function(){var t;return t=1<=arguments.length?l.call(arguments,0):[],e(v,"ajax:error",t)},complete:function(){var t;return t=1<=arguments.length?l.call(arguments,0):[],e(v,"ajax:complete",t)},crossDomain:r(g),withCredentials:null!=y&&"false"!==y}),c(h)):(e(v,"ajax:stopped"),!1))},a.formSubmitButtonClick=function(t){var e,n;if(n=(e=this).form)return e.name&&u(n,"ujs:submit-button",{name:e.name,value:e.value}),u(n,"ujs:formnovalidate-button",e.formNoValidate),u(n,"ujs:submit-button-formaction",e.getAttribute("formaction")),u(n,"ujs:submit-button-formmethod",e.getAttribute("formmethod"))},a.preventInsignificantClick=function(t){var e,n,r;if(this,r=(this.getAttribute("data-method")||"GET").toUpperCase(),e=this.getAttribute("data-params"),n=(t.metaKey||t.ctrlKey)&&"GET"===r&&!e,null!=t.button&&0!==t.button||n)return t.stopImmediatePropagation()}}.call(this),function(){var t,e,n,r,i,o,s,u,c,l,h,f,d,p,v;if(o=a.fire,n=a.delegate,u=a.getData,t=a.$,v=a.refreshCSRFTokens,e=a.CSRFProtection,d=a.loadCSPNonce,i=a.enableElement,r=a.disableElement,l=a.handleDisabledElement,c=a.handleConfirm,p=a.preventInsignificantClick,f=a.handleRemote,s=a.formSubmitButtonClick,h=a.handleMethod,"undefined"!==typeof jQuery&&null!==jQuery&&null!=jQuery.ajax){if(jQuery.rails)throw new Error("If you load both jquery_ujs and rails-ujs, use rails-ujs only.");jQuery.rails=a,jQuery.ajaxPrefilter((function(t,n,r){if(!t.crossDomain)return e(r)}))}a.start=function(){if(window._rails_loaded)throw new Error("rails-ujs has already been loaded!");return window.addEventListener("pageshow",(function(){return t(a.formEnableSelector).forEach((function(t){if(u(t,"ujs:disabled"))return i(t)})),t(a.linkDisableSelector).forEach((function(t){if(u(t,"ujs:disabled"))return i(t)}))})),n(document,a.linkDisableSelector,"ajax:complete",i),n(document,a.linkDisableSelector,"ajax:stopped",i),n(document,a.buttonDisableSelector,"ajax:complete",i),n(document,a.buttonDisableSelector,"ajax:stopped",i),n(document,a.linkClickSelector,"click",p),n(document,a.linkClickSelector,"click",l),n(document,a.linkClickSelector,"click",c),n(document,a.linkClickSelector,"click",r),n(document,a.linkClickSelector,"click",f),n(document,a.linkClickSelector,"click",h),n(document,a.buttonClickSelector,"click",p),n(document,a.buttonClickSelector,"click",l),n(document,a.buttonClickSelector,"click",c),n(document,a.buttonClickSelector,"click",r),n(document,a.buttonClickSelector,"click",f),n(document,a.inputChangeSelector,"change",l),n(document,a.inputChangeSelector,"change",c),n(document,a.inputChangeSelector,"change",f),n(document,a.formSubmitSelector,"submit",l),n(document,a.formSubmitSelector,"submit",c),n(document,a.formSubmitSelector,"submit",f),n(document,a.formSubmitSelector,"submit",(function(t){return setTimeout((function(){return r(t)}),13)})),n(document,a.formSubmitSelector,"ajax:send",r),n(document,a.formSubmitSelector,"ajax:complete",i),n(document,a.formInputClickSelector,"click",p),n(document,a.formInputClickSelector,"click",l),n(document,a.formInputClickSelector,"click",c),n(document,a.formInputClickSelector,"click",s),document.addEventListener("DOMContentLoaded",v),document.addEventListener("DOMContentLoaded",d),window._rails_loaded=!0},window.Rails===a&&o(document,"rails:attachBindings")&&a.start()}.call(this)}).call(this),"object"===o(t)&&t.exports?t.exports=a:void 0===(i="function"===typeof(r=a)?r.call(e,n,e,t):r)||(t.exports=i)}).call(this)}).call(this,n(155)(t))},function(t,e,n){(function(t){var r,i;function o(t){return(o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}(function(){(function(){(function(){this.Turbolinks={supported:null!=window.history.pushState&&null!=window.requestAnimationFrame&&null!=window.addEventListener,visit:function(t,e){return a.controller.visit(t,e)},clearCache:function(){return a.controller.clearCache()},setProgressBarDelay:function(t){return a.controller.setProgressBarDelay(t)}}}).call(this)}).call(this);var a=this.Turbolinks;(function(){(function(){var t,e,n,r=[].slice;a.copyObject=function(t){var e,n,r;for(e in n={},t)r=t[e],n[e]=r;return n},a.closest=function(e,n){return t.call(e,n)},t=function(){var t;return null!=(t=document.documentElement.closest)?t:function(t){var n;for(n=this;n;){if(n.nodeType===Node.ELEMENT_NODE&&e.call(n,t))return n;n=n.parentNode}}}(),a.defer=function(t){return setTimeout(t,1)},a.throttle=function(t){var e;return e=null,function(){var n;return n=1<=arguments.length?r.call(arguments,0):[],null!=e?e:e=requestAnimationFrame(function(r){return function(){return e=null,t.apply(r,n)}}(this))}},a.dispatch=function(t,e){var r,i,o,a,s,u;return u=(s=null!=e?e:{}).target,r=s.cancelable,i=s.data,(o=document.createEvent("Events")).initEvent(t,!0,!0===r),o.data=null!=i?i:{},o.cancelable&&!n&&(a=o.preventDefault,o.preventDefault=function(){return this.defaultPrevented||Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}}),a.call(this)}),(null!=u?u:document).dispatchEvent(o),o},n=function(){var t;return(t=document.createEvent("Events")).initEvent("test",!0,!0),t.preventDefault(),t.defaultPrevented}(),a.match=function(t,n){return e.call(t,n)},e=function(){var t,e,n,r;return null!=(e=null!=(n=null!=(r=(t=document.documentElement).matchesSelector)?r:t.webkitMatchesSelector)?n:t.msMatchesSelector)?e:t.mozMatchesSelector}(),a.uuid=function(){var t,e,n;for(n="",t=e=1;36>=e;t=++e)n+=9===t||14===t||19===t||24===t?"-":15===t?"4":20===t?(Math.floor(4*Math.random())+8).toString(16):Math.floor(15*Math.random()).toString(16);return n}}).call(this),function(){a.Location=function(){function t(t){var e,n;null==t&&(t=""),(n=document.createElement("a")).href=t.toString(),this.absoluteURL=n.href,2>(e=n.hash.length)?this.requestURL=this.absoluteURL:(this.requestURL=this.absoluteURL.slice(0,-e),this.anchor=n.hash.slice(1))}var e,n,r,i;return t.wrap=function(t){return t instanceof this?t:new this(t)},t.prototype.getOrigin=function(){return this.absoluteURL.split("/",3).join("/")},t.prototype.getPath=function(){var t,e;return null!=(t=null!=(e=this.requestURL.match(/\/\/[^\/]*(\/[^?;]*)/))?e[1]:void 0)?t:"/"},t.prototype.getPathComponents=function(){return this.getPath().split("/").slice(1)},t.prototype.getLastPathComponent=function(){return this.getPathComponents().slice(-1)[0]},t.prototype.getExtension=function(){var t,e;return null!=(t=null!=(e=this.getLastPathComponent().match(/\.[^.]*$/))?e[0]:void 0)?t:""},t.prototype.isHTML=function(){return this.getExtension().match(/^(?:|\.(?:htm|html|xhtml))$/)},t.prototype.isPrefixedBy=function(t){var e;return e=n(t),this.isEqualTo(t)||i(this.absoluteURL,e)},t.prototype.isEqualTo=function(t){return this.absoluteURL===(null!=t?t.absoluteURL:void 0)},t.prototype.toCacheKey=function(){return this.requestURL},t.prototype.toJSON=function(){return this.absoluteURL},t.prototype.toString=function(){return this.absoluteURL},t.prototype.valueOf=function(){return this.absoluteURL},n=function(t){return e(t.getOrigin()+t.getPath())},e=function(t){return r(t,"/")?t:t+"/"},i=function(t,e){return t.slice(0,e.length)===e},r=function(t,e){return t.slice(-e.length)===e},t}()}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};a.HttpRequest=function(){function e(e,n,r){this.delegate=e,this.requestCanceled=t(this.requestCanceled,this),this.requestTimedOut=t(this.requestTimedOut,this),this.requestFailed=t(this.requestFailed,this),this.requestLoaded=t(this.requestLoaded,this),this.requestProgressed=t(this.requestProgressed,this),this.url=a.Location.wrap(n).requestURL,this.referrer=a.Location.wrap(r).absoluteURL,this.createXHR()}return e.NETWORK_FAILURE=0,e.TIMEOUT_FAILURE=-1,e.timeout=60,e.prototype.send=function(){var t;return this.xhr&&!this.sent?(this.notifyApplicationBeforeRequestStart(),this.setProgress(0),this.xhr.send(),this.sent=!0,"function"==typeof(t=this.delegate).requestStarted?t.requestStarted():void 0):void 0},e.prototype.cancel=function(){return this.xhr&&this.sent?this.xhr.abort():void 0},e.prototype.requestProgressed=function(t){return t.lengthComputable?this.setProgress(t.loaded/t.total):void 0},e.prototype.requestLoaded=function(){return this.endRequest(function(t){return function(){var e;return 200<=(e=t.xhr.status)&&300>e?t.delegate.requestCompletedWithResponse(t.xhr.responseText,t.xhr.getResponseHeader("Turbolinks-Location")):(t.failed=!0,t.delegate.requestFailedWithStatusCode(t.xhr.status,t.xhr.responseText))}}(this))},e.prototype.requestFailed=function(){return this.endRequest(function(t){return function(){return t.failed=!0,t.delegate.requestFailedWithStatusCode(t.constructor.NETWORK_FAILURE)}}(this))},e.prototype.requestTimedOut=function(){return this.endRequest(function(t){return function(){return t.failed=!0,t.delegate.requestFailedWithStatusCode(t.constructor.TIMEOUT_FAILURE)}}(this))},e.prototype.requestCanceled=function(){return this.endRequest()},e.prototype.notifyApplicationBeforeRequestStart=function(){return a.dispatch("turbolinks:request-start",{data:{url:this.url,xhr:this.xhr}})},e.prototype.notifyApplicationAfterRequestEnd=function(){return a.dispatch("turbolinks:request-end",{data:{url:this.url,xhr:this.xhr}})},e.prototype.createXHR=function(){return this.xhr=new XMLHttpRequest,this.xhr.open("GET",this.url,!0),this.xhr.timeout=1e3*this.constructor.timeout,this.xhr.setRequestHeader("Accept","text/html, application/xhtml+xml"),this.xhr.setRequestHeader("Turbolinks-Referrer",this.referrer),this.xhr.onprogress=this.requestProgressed,this.xhr.onload=this.requestLoaded,this.xhr.onerror=this.requestFailed,this.xhr.ontimeout=this.requestTimedOut,this.xhr.onabort=this.requestCanceled},e.prototype.endRequest=function(t){return this.xhr?(this.notifyApplicationAfterRequestEnd(),null!=t&&t.call(this),this.destroy()):void 0},e.prototype.setProgress=function(t){var e;return this.progress=t,"function"==typeof(e=this.delegate).requestProgressed?e.requestProgressed(this.progress):void 0},e.prototype.destroy=function(){var t;return this.setProgress(1),"function"==typeof(t=this.delegate).requestFinished&&t.requestFinished(),this.delegate=null,this.xhr=null},e}()}.call(this),function(){a.ProgressBar=function(){function t(){this.trickle=function(t,e){return function(){return t.apply(e,arguments)}}(this.trickle,this),this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement()}var e;return e=300,t.defaultCSS=".turbolinks-progress-bar {\n position: fixed;\n display: block;\n top: 0;\n left: 0;\n height: 3px;\n background: #0076ff;\n z-index: 9999;\n transition: width 300ms ease-out, opacity 150ms 150ms ease-in;\n transform: translate3d(0, 0, 0);\n}",t.prototype.show=function(){return this.visible?void 0:(this.visible=!0,this.installStylesheetElement(),this.installProgressElement(),this.startTrickling())},t.prototype.hide=function(){return this.visible&&!this.hiding?(this.hiding=!0,this.fadeProgressElement(function(t){return function(){return t.uninstallProgressElement(),t.stopTrickling(),t.visible=!1,t.hiding=!1}}(this))):void 0},t.prototype.setValue=function(t){return this.value=t,this.refresh()},t.prototype.installStylesheetElement=function(){return document.head.insertBefore(this.stylesheetElement,document.head.firstChild)},t.prototype.installProgressElement=function(){return this.progressElement.style.width=0,this.progressElement.style.opacity=1,document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()},t.prototype.fadeProgressElement=function(t){return this.progressElement.style.opacity=0,setTimeout(t,450)},t.prototype.uninstallProgressElement=function(){return this.progressElement.parentNode?document.documentElement.removeChild(this.progressElement):void 0},t.prototype.startTrickling=function(){return null!=this.trickleInterval?this.trickleInterval:this.trickleInterval=setInterval(this.trickle,e)},t.prototype.stopTrickling=function(){return clearInterval(this.trickleInterval),this.trickleInterval=null},t.prototype.trickle=function(){return this.setValue(this.value+Math.random()/100)},t.prototype.refresh=function(){return requestAnimationFrame(function(t){return function(){return t.progressElement.style.width=10+90*t.value+"%"}}(this))},t.prototype.createStylesheetElement=function(){var t;return(t=document.createElement("style")).type="text/css",t.textContent=this.constructor.defaultCSS,t},t.prototype.createProgressElement=function(){var t;return(t=document.createElement("div")).className="turbolinks-progress-bar",t},t}()}.call(this),function(){a.BrowserAdapter=function(){function t(t){this.controller=t,this.showProgressBar=function(t,e){return function(){return t.apply(e,arguments)}}(this.showProgressBar,this),this.progressBar=new a.ProgressBar}var e,n,r;return r=a.HttpRequest,e=r.NETWORK_FAILURE,n=r.TIMEOUT_FAILURE,t.prototype.visitProposedToLocationWithAction=function(t,e){return this.controller.startVisitToLocationWithAction(t,e)},t.prototype.visitStarted=function(t){return t.issueRequest(),t.changeHistory(),t.loadCachedSnapshot()},t.prototype.visitRequestStarted=function(t){return this.progressBar.setValue(0),t.hasCachedSnapshot()||"restore"!==t.action?this.showProgressBarAfterDelay():this.showProgressBar()},t.prototype.visitRequestProgressed=function(t){return this.progressBar.setValue(t.progress)},t.prototype.visitRequestCompleted=function(t){return t.loadResponse()},t.prototype.visitRequestFailedWithStatusCode=function(t,r){switch(r){case e:case n:return this.reload();default:return t.loadResponse()}},t.prototype.visitRequestFinished=function(t){return this.hideProgressBar()},t.prototype.visitCompleted=function(t){return t.followRedirect()},t.prototype.pageInvalidated=function(){return this.reload()},t.prototype.showProgressBarAfterDelay=function(){return this.progressBarTimeout=setTimeout(this.showProgressBar,this.controller.progressBarDelay)},t.prototype.showProgressBar=function(){return this.progressBar.show()},t.prototype.hideProgressBar=function(){return this.progressBar.hide(),clearTimeout(this.progressBarTimeout)},t.prototype.reload=function(){return window.location.reload()},t}()}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};a.History=function(){function e(e){this.delegate=e,this.onPageLoad=t(this.onPageLoad,this),this.onPopState=t(this.onPopState,this)}return e.prototype.start=function(){return this.started?void 0:(addEventListener("popstate",this.onPopState,!1),addEventListener("load",this.onPageLoad,!1),this.started=!0)},e.prototype.stop=function(){return this.started?(removeEventListener("popstate",this.onPopState,!1),removeEventListener("load",this.onPageLoad,!1),this.started=!1):void 0},e.prototype.push=function(t,e){return t=a.Location.wrap(t),this.update("push",t,e)},e.prototype.replace=function(t,e){return t=a.Location.wrap(t),this.update("replace",t,e)},e.prototype.onPopState=function(t){var e,n,r,i;return this.shouldHandlePopState()&&(i=null!=(n=t.state)?n.turbolinks:void 0)?(e=a.Location.wrap(window.location),r=i.restorationIdentifier,this.delegate.historyPoppedToLocationWithRestorationIdentifier(e,r)):void 0},e.prototype.onPageLoad=function(t){return a.defer(function(t){return function(){return t.pageLoaded=!0}}(this))},e.prototype.shouldHandlePopState=function(){return this.pageIsLoaded()},e.prototype.pageIsLoaded=function(){return this.pageLoaded||"complete"===document.readyState},e.prototype.update=function(t,e,n){var r;return r={turbolinks:{restorationIdentifier:n}},history[t+"State"](r,null,e)},e}()}.call(this),function(){a.HeadDetails=function(){function t(t){var e,n,r,a,s;for(this.elements={},n=0,a=t.length;a>n;n++)(s=t[n]).nodeType===Node.ELEMENT_NODE&&(r=s.outerHTML,(null!=(e=this.elements)[r]?e[r]:e[r]={type:o(s),tracked:i(s),elements:[]}).elements.push(s))}var e,n,r,i,o;return t.fromHeadElement=function(t){var e;return new this(null!=(e=null!=t?t.childNodes:void 0)?e:[])},t.prototype.hasElementWithKey=function(t){return t in this.elements},t.prototype.getTrackedElementSignature=function(){var t;return function(){var e,n;for(t in n=[],e=this.elements)e[t].tracked&&n.push(t);return n}.call(this).join("")},t.prototype.getScriptElementsNotInDetails=function(t){return this.getElementsMatchingTypeNotInDetails("script",t)},t.prototype.getStylesheetElementsNotInDetails=function(t){return this.getElementsMatchingTypeNotInDetails("stylesheet",t)},t.prototype.getElementsMatchingTypeNotInDetails=function(t,e){var n,r,i,o,a,s;for(r in a=[],i=this.elements)s=(o=i[r]).type,n=o.elements,s!==t||e.hasElementWithKey(r)||a.push(n[0]);return a},t.prototype.getProvisionalElements=function(){var t,e,n,r,i,o,a;for(e in n=[],r=this.elements)a=(i=r[e]).type,o=i.tracked,t=i.elements,null!=a||o?t.length>1&&n.push.apply(n,t.slice(1)):n.push.apply(n,t);return n},t.prototype.getMetaValue=function(t){var e;return null!=(e=this.findMetaElementByName(t))?e.getAttribute("content"):void 0},t.prototype.findMetaElementByName=function(t){var n,r,i,o;for(i in n=void 0,o=this.elements)r=o[i].elements,e(r[0],t)&&(n=r[0]);return n},o=function(t){return n(t)?"script":r(t)?"stylesheet":void 0},i=function(t){return"reload"===t.getAttribute("data-turbolinks-track")},n=function(t){return"script"===t.tagName.toLowerCase()},r=function(t){var e;return"style"===(e=t.tagName.toLowerCase())||"link"===e&&"stylesheet"===t.getAttribute("rel")},e=function(t,e){return"meta"===t.tagName.toLowerCase()&&t.getAttribute("name")===e},t}()}.call(this),function(){a.Snapshot=function(){function t(t,e){this.headDetails=t,this.bodyElement=e}return t.wrap=function(t){return t instanceof this?t:"string"==typeof t?this.fromHTMLString(t):this.fromHTMLElement(t)},t.fromHTMLString=function(t){var e;return(e=document.createElement("html")).innerHTML=t,this.fromHTMLElement(e)},t.fromHTMLElement=function(t){var e,n,r;return n=t.querySelector("head"),e=null!=(r=t.querySelector("body"))?r:document.createElement("body"),new this(a.HeadDetails.fromHeadElement(n),e)},t.prototype.clone=function(){return new this.constructor(this.headDetails,this.bodyElement.cloneNode(!0))},t.prototype.getRootLocation=function(){var t,e;return e=null!=(t=this.getSetting("root"))?t:"/",new a.Location(e)},t.prototype.getCacheControlValue=function(){return this.getSetting("cache-control")},t.prototype.getElementForAnchor=function(t){try{return this.bodyElement.querySelector("[id='"+t+"'], a[name='"+t+"']")}catch(a){}},t.prototype.getPermanentElements=function(){return this.bodyElement.querySelectorAll("[id][data-turbolinks-permanent]")},t.prototype.getPermanentElementById=function(t){return this.bodyElement.querySelector("#"+t+"[data-turbolinks-permanent]")},t.prototype.getPermanentElementsPresentInSnapshot=function(t){var e,n,r,i,o;for(o=[],n=0,r=(i=this.getPermanentElements()).length;r>n;n++)e=i[n],t.getPermanentElementById(e.id)&&o.push(e);return o},t.prototype.findFirstAutofocusableElement=function(){return this.bodyElement.querySelector("[autofocus]")},t.prototype.hasAnchor=function(t){return null!=this.getElementForAnchor(t)},t.prototype.isPreviewable=function(){return"no-preview"!==this.getCacheControlValue()},t.prototype.isCacheable=function(){return"no-cache"!==this.getCacheControlValue()},t.prototype.isVisitable=function(){return"reload"!==this.getSetting("visit-control")},t.prototype.getSetting=function(t){return this.headDetails.getMetaValue("turbolinks-"+t)},t}()}.call(this),function(){var t=[].slice;a.Renderer=function(){function e(){}var n;return e.render=function(){var e,n,r;return n=arguments[0],e=arguments[1],(r=function(t,e,n){n.prototype=t.prototype;var r=new n,i=t.apply(r,e);return Object(i)===i?i:r}(this,3<=arguments.length?t.call(arguments,2):[],(function(){}))).delegate=n,r.render(e),r},e.prototype.renderView=function(t){return this.delegate.viewWillRender(this.newBody),t(),this.delegate.viewRendered(this.newBody)},e.prototype.invalidateView=function(){return this.delegate.viewInvalidated()},e.prototype.createScriptElement=function(t){var e;return"false"===t.getAttribute("data-turbolinks-eval")?t:((e=document.createElement("script")).textContent=t.textContent,e.async=!1,n(e,t),e)},n=function(t,e){var n,r,i,o,a,s,u;for(s=[],n=0,r=(o=e.attributes).length;r>n;n++)i=(a=o[n]).name,u=a.value,s.push(t.setAttribute(i,u));return s},e}()}.call(this),function(){var t,e,n=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;a.SnapshotRenderer=function(r){function i(t,e,n){this.currentSnapshot=t,this.newSnapshot=e,this.isPreview=n,this.currentHeadDetails=this.currentSnapshot.headDetails,this.newHeadDetails=this.newSnapshot.headDetails,this.currentBody=this.currentSnapshot.bodyElement,this.newBody=this.newSnapshot.bodyElement}return n(i,r),i.prototype.render=function(t){return this.shouldRender()?(this.mergeHead(),this.renderView(function(e){return function(){return e.replaceBody(),e.isPreview||e.focusFirstAutofocusableElement(),t()}}(this))):this.invalidateView()},i.prototype.mergeHead=function(){return this.copyNewHeadStylesheetElements(),this.copyNewHeadScriptElements(),this.removeCurrentHeadProvisionalElements(),this.copyNewHeadProvisionalElements()},i.prototype.replaceBody=function(){var t;return t=this.relocateCurrentBodyPermanentElements(),this.activateNewBodyScriptElements(),this.assignNewBody(),this.replacePlaceholderElementsWithClonedPermanentElements(t)},i.prototype.shouldRender=function(){return this.newSnapshot.isVisitable()&&this.trackedElementsAreIdentical()},i.prototype.trackedElementsAreIdentical=function(){return this.currentHeadDetails.getTrackedElementSignature()===this.newHeadDetails.getTrackedElementSignature()},i.prototype.copyNewHeadStylesheetElements=function(){var t,e,n,r,i;for(i=[],e=0,n=(r=this.getNewHeadStylesheetElements()).length;n>e;e++)t=r[e],i.push(document.head.appendChild(t));return i},i.prototype.copyNewHeadScriptElements=function(){var t,e,n,r,i;for(i=[],e=0,n=(r=this.getNewHeadScriptElements()).length;n>e;e++)t=r[e],i.push(document.head.appendChild(this.createScriptElement(t)));return i},i.prototype.removeCurrentHeadProvisionalElements=function(){var t,e,n,r,i;for(i=[],e=0,n=(r=this.getCurrentHeadProvisionalElements()).length;n>e;e++)t=r[e],i.push(document.head.removeChild(t));return i},i.prototype.copyNewHeadProvisionalElements=function(){var t,e,n,r,i;for(i=[],e=0,n=(r=this.getNewHeadProvisionalElements()).length;n>e;e++)t=r[e],i.push(document.head.appendChild(t));return i},i.prototype.relocateCurrentBodyPermanentElements=function(){var n,r,i,o,a,s,u;for(u=[],n=0,r=(s=this.getCurrentBodyPermanentElements()).length;r>n;n++)o=s[n],a=t(o),i=this.newSnapshot.getPermanentElementById(o.id),e(o,a.element),e(i,o),u.push(a);return u},i.prototype.replacePlaceholderElementsWithClonedPermanentElements=function(t){var n,r,i,o,a,s;for(s=[],i=0,o=t.length;o>i;i++)r=(a=t[i]).element,n=a.permanentElement.cloneNode(!0),s.push(e(r,n));return s},i.prototype.activateNewBodyScriptElements=function(){var t,n,r,i,o,a;for(a=[],n=0,i=(o=this.getNewBodyScriptElements()).length;i>n;n++)r=o[n],t=this.createScriptElement(r),a.push(e(r,t));return a},i.prototype.assignNewBody=function(){return document.body=this.newBody},i.prototype.focusFirstAutofocusableElement=function(){var t;return null!=(t=this.newSnapshot.findFirstAutofocusableElement())?t.focus():void 0},i.prototype.getNewHeadStylesheetElements=function(){return this.newHeadDetails.getStylesheetElementsNotInDetails(this.currentHeadDetails)},i.prototype.getNewHeadScriptElements=function(){return this.newHeadDetails.getScriptElementsNotInDetails(this.currentHeadDetails)},i.prototype.getCurrentHeadProvisionalElements=function(){return this.currentHeadDetails.getProvisionalElements()},i.prototype.getNewHeadProvisionalElements=function(){return this.newHeadDetails.getProvisionalElements()},i.prototype.getCurrentBodyPermanentElements=function(){return this.currentSnapshot.getPermanentElementsPresentInSnapshot(this.newSnapshot)},i.prototype.getNewBodyScriptElements=function(){return this.newBody.querySelectorAll("script")},i}(a.Renderer),t=function(t){var e;return(e=document.createElement("meta")).setAttribute("name","turbolinks-permanent-placeholder"),e.setAttribute("content",t.id),{element:e,permanentElement:t}},e=function(t,e){var n;return(n=t.parentNode)?n.replaceChild(e,t):void 0}}.call(this),function(){var t=function(t,n){function r(){this.constructor=t}for(var i in n)e.call(n,i)&&(t[i]=n[i]);return r.prototype=n.prototype,t.prototype=new r,t.__super__=n.prototype,t},e={}.hasOwnProperty;a.ErrorRenderer=function(e){function n(t){var e;(e=document.createElement("html")).innerHTML=t,this.newHead=e.querySelector("head"),this.newBody=e.querySelector("body")}return t(n,e),n.prototype.render=function(t){return this.renderView(function(e){return function(){return e.replaceHeadAndBody(),e.activateBodyScriptElements(),t()}}(this))},n.prototype.replaceHeadAndBody=function(){var t,e;return e=document.head,t=document.body,e.parentNode.replaceChild(this.newHead,e),t.parentNode.replaceChild(this.newBody,t)},n.prototype.activateBodyScriptElements=function(){var t,e,n,r,i,o;for(o=[],e=0,n=(r=this.getScriptElements()).length;n>e;e++)i=r[e],t=this.createScriptElement(i),o.push(i.parentNode.replaceChild(t,i));return o},n.prototype.getScriptElements=function(){return document.documentElement.querySelectorAll("script")},n}(a.Renderer)}.call(this),function(){a.View=function(){function t(t){this.delegate=t,this.htmlElement=document.documentElement}return t.prototype.getRootLocation=function(){return this.getSnapshot().getRootLocation()},t.prototype.getElementForAnchor=function(t){return this.getSnapshot().getElementForAnchor(t)},t.prototype.getSnapshot=function(){return a.Snapshot.fromHTMLElement(this.htmlElement)},t.prototype.render=function(t,e){var n,r,i;return i=t.snapshot,n=t.error,r=t.isPreview,this.markAsPreview(r),null!=i?this.renderSnapshot(i,r,e):this.renderError(n,e)},t.prototype.markAsPreview=function(t){return t?this.htmlElement.setAttribute("data-turbolinks-preview",""):this.htmlElement.removeAttribute("data-turbolinks-preview")},t.prototype.renderSnapshot=function(t,e,n){return a.SnapshotRenderer.render(this.delegate,n,this.getSnapshot(),a.Snapshot.wrap(t),e)},t.prototype.renderError=function(t,e){return a.ErrorRenderer.render(this.delegate,e,t)},t}()}.call(this),function(){a.ScrollManager=function(){function t(t){this.delegate=t,this.onScroll=function(t,e){return function(){return t.apply(e,arguments)}}(this.onScroll,this),this.onScroll=a.throttle(this.onScroll)}return t.prototype.start=function(){return this.started?void 0:(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)},t.prototype.stop=function(){return this.started?(removeEventListener("scroll",this.onScroll,!1),this.started=!1):void 0},t.prototype.scrollToElement=function(t){return t.scrollIntoView()},t.prototype.scrollToPosition=function(t){var e,n;return e=t.x,n=t.y,window.scrollTo(e,n)},t.prototype.onScroll=function(t){return this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})},t.prototype.updatePosition=function(t){var e;return this.position=t,null!=(e=this.delegate)?e.scrollPositionChanged(this.position):void 0},t}()}.call(this),function(){a.SnapshotCache=function(){function t(t){this.size=t,this.keys=[],this.snapshots={}}var e;return t.prototype.has=function(t){return e(t)in this.snapshots},t.prototype.get=function(t){var e;if(this.has(t))return e=this.read(t),this.touch(t),e},t.prototype.put=function(t,e){return this.write(t,e),this.touch(t),e},t.prototype.read=function(t){var n;return n=e(t),this.snapshots[n]},t.prototype.write=function(t,n){var r;return r=e(t),this.snapshots[r]=n},t.prototype.touch=function(t){var n,r;return r=e(t),(n=this.keys.indexOf(r))>-1&&this.keys.splice(n,1),this.keys.unshift(r),this.trim()},t.prototype.trim=function(){var t,e,n,r,i;for(i=[],t=0,n=(r=this.keys.splice(this.size)).length;n>t;t++)e=r[t],i.push(delete this.snapshots[e]);return i},e=function(t){return a.Location.wrap(t).toCacheKey()},t}()}.call(this),function(){a.Visit=function(){function t(t,e,n){this.controller=t,this.action=n,this.performScroll=function(t,e){return function(){return t.apply(e,arguments)}}(this.performScroll,this),this.identifier=a.uuid(),this.location=a.Location.wrap(e),this.adapter=this.controller.adapter,this.state="initialized",this.timingMetrics={}}var e;return t.prototype.start=function(){return"initialized"===this.state?(this.recordTimingMetric("visitStart"),this.state="started",this.adapter.visitStarted(this)):void 0},t.prototype.cancel=function(){var t;return"started"===this.state?(null!=(t=this.request)&&t.cancel(),this.cancelRender(),this.state="canceled"):void 0},t.prototype.complete=function(){var t;return"started"===this.state?(this.recordTimingMetric("visitEnd"),this.state="completed","function"==typeof(t=this.adapter).visitCompleted&&t.visitCompleted(this),this.controller.visitCompleted(this)):void 0},t.prototype.fail=function(){var t;return"started"===this.state?(this.state="failed","function"==typeof(t=this.adapter).visitFailed?t.visitFailed(this):void 0):void 0},t.prototype.changeHistory=function(){var t,n;return this.historyChanged?void 0:(t=this.location.isEqualTo(this.referrer)?"replace":this.action,n=e(t),this.controller[n](this.location,this.restorationIdentifier),this.historyChanged=!0)},t.prototype.issueRequest=function(){return this.shouldIssueRequest()&&null==this.request?(this.progress=0,this.request=new a.HttpRequest(this,this.location,this.referrer),this.request.send()):void 0},t.prototype.getCachedSnapshot=function(){var t;return!(t=this.controller.getCachedSnapshotForLocation(this.location))||null!=this.location.anchor&&!t.hasAnchor(this.location.anchor)||"restore"!==this.action&&!t.isPreviewable()?void 0:t},t.prototype.hasCachedSnapshot=function(){return null!=this.getCachedSnapshot()},t.prototype.loadCachedSnapshot=function(){var t,e;return(e=this.getCachedSnapshot())?(t=this.shouldIssueRequest(),this.render((function(){var n;return this.cacheSnapshot(),this.controller.render({snapshot:e,isPreview:t},this.performScroll),"function"==typeof(n=this.adapter).visitRendered&&n.visitRendered(this),t?void 0:this.complete()}))):void 0},t.prototype.loadResponse=function(){return null!=this.response?this.render((function(){var t,e;return this.cacheSnapshot(),this.request.failed?(this.controller.render({error:this.response},this.performScroll),"function"==typeof(t=this.adapter).visitRendered&&t.visitRendered(this),this.fail()):(this.controller.render({snapshot:this.response},this.performScroll),"function"==typeof(e=this.adapter).visitRendered&&e.visitRendered(this),this.complete())})):void 0},t.prototype.followRedirect=function(){return this.redirectedToLocation&&!this.followedRedirect?(this.location=this.redirectedToLocation,this.controller.replaceHistoryWithLocationAndRestorationIdentifier(this.redirectedToLocation,this.restorationIdentifier),this.followedRedirect=!0):void 0},t.prototype.requestStarted=function(){var t;return this.recordTimingMetric("requestStart"),"function"==typeof(t=this.adapter).visitRequestStarted?t.visitRequestStarted(this):void 0},t.prototype.requestProgressed=function(t){var e;return this.progress=t,"function"==typeof(e=this.adapter).visitRequestProgressed?e.visitRequestProgressed(this):void 0},t.prototype.requestCompletedWithResponse=function(t,e){return this.response=t,null!=e&&(this.redirectedToLocation=a.Location.wrap(e)),this.adapter.visitRequestCompleted(this)},t.prototype.requestFailedWithStatusCode=function(t,e){return this.response=e,this.adapter.visitRequestFailedWithStatusCode(this,t)},t.prototype.requestFinished=function(){var t;return this.recordTimingMetric("requestEnd"),"function"==typeof(t=this.adapter).visitRequestFinished?t.visitRequestFinished(this):void 0},t.prototype.performScroll=function(){return this.scrolled?void 0:("restore"===this.action?this.scrollToRestoredPosition()||this.scrollToTop():this.scrollToAnchor()||this.scrollToTop(),this.scrolled=!0)},t.prototype.scrollToRestoredPosition=function(){var t,e;return null!=(t=null!=(e=this.restorationData)?e.scrollPosition:void 0)?(this.controller.scrollToPosition(t),!0):void 0},t.prototype.scrollToAnchor=function(){return null!=this.location.anchor?(this.controller.scrollToAnchor(this.location.anchor),!0):void 0},t.prototype.scrollToTop=function(){return this.controller.scrollToPosition({x:0,y:0})},t.prototype.recordTimingMetric=function(t){var e;return null!=(e=this.timingMetrics)[t]?e[t]:e[t]=(new Date).getTime()},t.prototype.getTimingMetrics=function(){return a.copyObject(this.timingMetrics)},e=function(t){switch(t){case"replace":return"replaceHistoryWithLocationAndRestorationIdentifier";case"advance":case"restore":return"pushHistoryWithLocationAndRestorationIdentifier"}},t.prototype.shouldIssueRequest=function(){return"restore"!==this.action||!this.hasCachedSnapshot()},t.prototype.cacheSnapshot=function(){return this.snapshotCached?void 0:(this.controller.cacheSnapshot(),this.snapshotCached=!0)},t.prototype.render=function(t){return this.cancelRender(),this.frame=requestAnimationFrame(function(e){return function(){return e.frame=null,t.call(e)}}(this))},t.prototype.cancelRender=function(){return this.frame?cancelAnimationFrame(this.frame):void 0},t}()}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};a.Controller=function(){function e(){this.clickBubbled=t(this.clickBubbled,this),this.clickCaptured=t(this.clickCaptured,this),this.pageLoaded=t(this.pageLoaded,this),this.history=new a.History(this),this.view=new a.View(this),this.scrollManager=new a.ScrollManager(this),this.restorationData={},this.clearCache(),this.setProgressBarDelay(500)}return e.prototype.start=function(){return a.supported&&!this.started?(addEventListener("click",this.clickCaptured,!0),addEventListener("DOMContentLoaded",this.pageLoaded,!1),this.scrollManager.start(),this.startHistory(),this.started=!0,this.enabled=!0):void 0},e.prototype.disable=function(){return this.enabled=!1},e.prototype.stop=function(){return this.started?(removeEventListener("click",this.clickCaptured,!0),removeEventListener("DOMContentLoaded",this.pageLoaded,!1),this.scrollManager.stop(),this.stopHistory(),this.started=!1):void 0},e.prototype.clearCache=function(){return this.cache=new a.SnapshotCache(10)},e.prototype.visit=function(t,e){var n,r;return null==e&&(e={}),t=a.Location.wrap(t),this.applicationAllowsVisitingLocation(t)?this.locationIsVisitable(t)?(n=null!=(r=e.action)?r:"advance",this.adapter.visitProposedToLocationWithAction(t,n)):window.location=t:void 0},e.prototype.startVisitToLocationWithAction=function(t,e,n){var r;return a.supported?(r=this.getRestorationDataForIdentifier(n),this.startVisit(t,e,{restorationData:r})):window.location=t},e.prototype.setProgressBarDelay=function(t){return this.progressBarDelay=t},e.prototype.startHistory=function(){return this.location=a.Location.wrap(window.location),this.restorationIdentifier=a.uuid(),this.history.start(),this.history.replace(this.location,this.restorationIdentifier)},e.prototype.stopHistory=function(){return this.history.stop()},e.prototype.pushHistoryWithLocationAndRestorationIdentifier=function(t,e){return this.restorationIdentifier=e,this.location=a.Location.wrap(t),this.history.push(this.location,this.restorationIdentifier)},e.prototype.replaceHistoryWithLocationAndRestorationIdentifier=function(t,e){return this.restorationIdentifier=e,this.location=a.Location.wrap(t),this.history.replace(this.location,this.restorationIdentifier)},e.prototype.historyPoppedToLocationWithRestorationIdentifier=function(t,e){var n;return this.restorationIdentifier=e,this.enabled?(n=this.getRestorationDataForIdentifier(this.restorationIdentifier),this.startVisit(t,"restore",{restorationIdentifier:this.restorationIdentifier,restorationData:n,historyChanged:!0}),this.location=a.Location.wrap(t)):this.adapter.pageInvalidated()},e.prototype.getCachedSnapshotForLocation=function(t){var e;return null!=(e=this.cache.get(t))?e.clone():void 0},e.prototype.shouldCacheSnapshot=function(){return this.view.getSnapshot().isCacheable()},e.prototype.cacheSnapshot=function(){var t,e;return this.shouldCacheSnapshot()?(this.notifyApplicationBeforeCachingSnapshot(),e=this.view.getSnapshot(),t=this.lastRenderedLocation,a.defer(function(n){return function(){return n.cache.put(t,e.clone())}}(this))):void 0},e.prototype.scrollToAnchor=function(t){var e;return(e=this.view.getElementForAnchor(t))?this.scrollToElement(e):this.scrollToPosition({x:0,y:0})},e.prototype.scrollToElement=function(t){return this.scrollManager.scrollToElement(t)},e.prototype.scrollToPosition=function(t){return this.scrollManager.scrollToPosition(t)},e.prototype.scrollPositionChanged=function(t){return this.getCurrentRestorationData().scrollPosition=t},e.prototype.render=function(t,e){return this.view.render(t,e)},e.prototype.viewInvalidated=function(){return this.adapter.pageInvalidated()},e.prototype.viewWillRender=function(t){return this.notifyApplicationBeforeRender(t)},e.prototype.viewRendered=function(){return this.lastRenderedLocation=this.currentVisit.location,this.notifyApplicationAfterRender()},e.prototype.pageLoaded=function(){return this.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()},e.prototype.clickCaptured=function(){return removeEventListener("click",this.clickBubbled,!1),addEventListener("click",this.clickBubbled,!1)},e.prototype.clickBubbled=function(t){var e,n,r;return this.enabled&&this.clickEventIsSignificant(t)&&(n=this.getVisitableLinkForNode(t.target))&&(r=this.getVisitableLocationForLink(n))&&this.applicationAllowsFollowingLinkToLocation(n,r)?(t.preventDefault(),e=this.getActionForLink(n),this.visit(r,{action:e})):void 0},e.prototype.applicationAllowsFollowingLinkToLocation=function(t,e){return!this.notifyApplicationAfterClickingLinkToLocation(t,e).defaultPrevented},e.prototype.applicationAllowsVisitingLocation=function(t){return!this.notifyApplicationBeforeVisitingLocation(t).defaultPrevented},e.prototype.notifyApplicationAfterClickingLinkToLocation=function(t,e){return a.dispatch("turbolinks:click",{target:t,data:{url:e.absoluteURL},cancelable:!0})},e.prototype.notifyApplicationBeforeVisitingLocation=function(t){return a.dispatch("turbolinks:before-visit",{data:{url:t.absoluteURL},cancelable:!0})},e.prototype.notifyApplicationAfterVisitingLocation=function(t){return a.dispatch("turbolinks:visit",{data:{url:t.absoluteURL}})},e.prototype.notifyApplicationBeforeCachingSnapshot=function(){return a.dispatch("turbolinks:before-cache")},e.prototype.notifyApplicationBeforeRender=function(t){return a.dispatch("turbolinks:before-render",{data:{newBody:t}})},e.prototype.notifyApplicationAfterRender=function(){return a.dispatch("turbolinks:render")},e.prototype.notifyApplicationAfterPageLoad=function(t){return null==t&&(t={}),a.dispatch("turbolinks:load",{data:{url:this.location.absoluteURL,timing:t}})},e.prototype.startVisit=function(t,e,n){var r;return null!=(r=this.currentVisit)&&r.cancel(),this.currentVisit=this.createVisit(t,e,n),this.currentVisit.start(),this.notifyApplicationAfterVisitingLocation(t)},e.prototype.createVisit=function(t,e,n){var r,i,o,s,u;return s=(i=null!=n?n:{}).restorationIdentifier,o=i.restorationData,r=i.historyChanged,(u=new a.Visit(this,t,e)).restorationIdentifier=null!=s?s:a.uuid(),u.restorationData=a.copyObject(o),u.historyChanged=r,u.referrer=this.location,u},e.prototype.visitCompleted=function(t){return this.notifyApplicationAfterPageLoad(t.getTimingMetrics())},e.prototype.clickEventIsSignificant=function(t){return!(t.defaultPrevented||t.target.isContentEditable||t.which>1||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)},e.prototype.getVisitableLinkForNode=function(t){return this.nodeIsVisitable(t)?a.closest(t,"a[href]:not([target]):not([download])"):void 0},e.prototype.getVisitableLocationForLink=function(t){var e;return e=new a.Location(t.getAttribute("href")),this.locationIsVisitable(e)?e:void 0},e.prototype.getActionForLink=function(t){var e;return null!=(e=t.getAttribute("data-turbolinks-action"))?e:"advance"},e.prototype.nodeIsVisitable=function(t){var e;return!(e=a.closest(t,"[data-turbolinks]"))||"false"!==e.getAttribute("data-turbolinks")},e.prototype.locationIsVisitable=function(t){return t.isPrefixedBy(this.view.getRootLocation())&&t.isHTML()},e.prototype.getCurrentRestorationData=function(){return this.getRestorationDataForIdentifier(this.restorationIdentifier)},e.prototype.getRestorationDataForIdentifier=function(t){var e;return null!=(e=this.restorationData)[t]?e[t]:e[t]={}},e}()}.call(this),function(){!function(){var t,e;if((t=e=document.currentScript)&&!e.hasAttribute("data-turbolinks-suppress-warning"))for(;t=t.parentNode;)if(t===document.body)return console.warn("You are loading Turbolinks from a <script> element inside the <body> element. This is probably not what you meant to do!\n\nLoad your application\u2019s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.\n\nFor more information, see: https://github.com/turbolinks/turbolinks#working-with-script-elements\n\n\u2014\u2014\nSuppress this warning by adding a `data-turbolinks-suppress-warning` attribute to: %s",e.outerHTML)}()}.call(this),function(){var t,e,n;a.start=function(){return e()?(null==a.controller&&(a.controller=t()),a.controller.start()):void 0},e=function(){return null==window.Turbolinks&&(window.Turbolinks=a),n()},t=function(){var t;return t=new a.Controller,t.adapter=new a.BrowserAdapter(t),t},(n=function(){return window.Turbolinks===a})()&&a.start()}.call(this)}).call(this),"object"==o(t)&&t.exports?t.exports=a:void 0===(i="function"===typeof(r=a)?r.call(e,n,e,t):r)||(t.exports=i)}).call(this)}).call(this,n(155)(t))},function(t,e,n){var r,i,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})(t)}o=function(){"use strict";function t(t){return"[object Array]"===Object.prototype.toString.call(t)}function e(t){return t instanceof Function}function n(t){return"[object Object]"===Object.prototype.toString.call(t)&&!e(t)&&t instanceof Object}function r(e,i){var o;for(o in i)"__proto__"!==o&&(n(i[o])||t(i[o])?(n(i[o])&&!n(e[o])&&(e[o]={}),t(i[o])&&!t(e[o])&&(e[o]=[]),r(e[o],i[o])):void 0!==i[o]&&(e[o]=i[o]))}function i(t,e){var n={};return r(n,t),r(n,e),n}var o=/^(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)$/i;function s(t){return""+t}function u(t){return parseFloat(t)}function c(t){var e,n,r,i;if("object"!==a(t))if("number"===typeof t)t=new Date(1e3*t);else{if(e=(t=s(t)).match(o))return n=parseInt(e[1],10),r=parseInt(e[3],10)-1,i=parseInt(e[5],10),new Date(n,r,i);var u=t.replace(/ /,"T").replace(" ","").replace("UTC","Z");t=new Date(Date.parse(u)||t)}return t}function l(e){if(!t(e)){var n,r=[];for(n in e)e.hasOwnProperty(n)&&r.push([n,e[n]]);e=r}return e}function h(t,e,n,r,o,a,s,u){return function(c,l,h){var f=c.data,d=i({},t);return d=i(d,h||{}),(c.singleSeriesFormat||"legend"in l)&&e(d,l.legend,c.singleSeriesFormat),l.title&&n(d,l.title),"min"in l?r(d,l.min):function(t){var e,n,r;for(e=0;e<t.length;e++)for(r=t[e].data,n=0;n<r.length;n++)if(r[n][1]<0)return!0;return!1}(f)||r(d,0),l.max&&o(d,l.max),"stacked"in l&&a(d,l.stacked),l.colors&&(d.colors=l.colors),l.xtitle&&s(d,l.xtitle),l.ytitle&&u(d,l.ytitle),d=i(d,l.library||{})}}function f(t,e){return t[0].getTime()-e[0].getTime()}function d(t,e){return t[0]-e[0]}function p(t,e){return t-e}function v(t){return 0===t.getMilliseconds()&&0===t.getSeconds()}function m(t){return v(t)&&0===t.getMinutes()}function g(t){return m(t)&&0===t.getHours()}function y(t,e){return g(t)&&t.getDay()===e}function b(t){return g(t)&&1===t.getDate()}function w(t){return b(t)&&0===t.getMonth()}function _(t){return!isNaN(c(t))&&s(t).length>=6}function x(t){return"number"===typeof t}var k=["bytes","KB","MB","GB","TB","PB","EB"];function S(t,e,n,r){t=t||"",n.prefix&&(e<0&&(e*=-1,t+="-"),t+=n.prefix);var i=n.suffix||"",o=n.precision,a=n.round;if(n.byteScale){var u,c=r?n.byteScale:e;c>=0x1000000000000000?(e/=0x1000000000000000,u=6):c>=0x4000000000000?(e/=0x4000000000000,u=5):c>=1099511627776?(e/=1099511627776,u=4):c>=1073741824?(e/=1073741824,u=3):c>=1048576?(e/=1048576,u=2):c>=1024?(e/=1024,u=1):u=0,void 0===o&&void 0===a&&(e>=1023.5&&u<k.length-1&&(e=1,u+=1),o=e>=1e3?4:3),i=" "+k[u]}if(void 0!==o&&void 0!==a)throw Error("Use either round or precision, not both");if(!r&&(void 0!==o&&(e=e.toPrecision(o),n.zeros||(e=parseFloat(e))),void 0!==a))if(a<0){var l=Math.pow(10,-1*a);e=parseInt((1*e/l).toFixed(0))*l}else e=e.toFixed(a),n.zeros||(e=parseFloat(e));if(n.thousands||n.decimal){var h=(e=s(e)).split(".");e=h[0],n.thousands&&(e=e.replace(/\B(?=(\d{3})+(?!\d))/g,n.thousands)),h.length>1&&(e+=(n.decimal||".")+h[1])}return t+e+i}function C(t,e,n){return n in e?e[n]:n in t.options?t.options[n]:null}var M={maintainAspectRatio:!1,animation:!1,plugins:{legend:{},tooltip:{displayColors:!1,callbacks:{}},title:{font:{size:20},color:"#333"}},interaction:{}},E={scales:{y:{ticks:{maxTicksLimit:4},title:{font:{size:16},color:"#333"},grid:{}},x:{grid:{drawOnChartArea:!1},title:{font:{size:16},color:"#333"},time:{},ticks:{}}}},T=["#3366CC","#DC3912","#FF9900","#109618","#990099","#3B3EAC","#0099C6","#DD4477","#66AA00","#B82E2E","#316395","#994499","#22AA99","#AAAA11","#6633CC","#E67300","#8B0707","#329262","#5574A6","#651067"],A=function(t,e,n){void 0!==e?(t.plugins.legend.display=!!e,e&&!0!==e&&(t.plugins.legend.position=e)):n&&(t.plugins.legend.display=!1)},O=function(t,e){t.plugins.title.display=!0,t.plugins.title.text=e},D=function(t,e){null!==e&&(t.scales.x.min=u(e))},P=function(t,e){t.scales.x.max=u(e)},L=function(t,e){t.scales.x.stacked=!!e,t.scales.y.stacked=!!e},N=function(t,e){t.scales.x.title.display=!0,t.scales.x.title.text=e},R=function(t,e){t.scales.y.title.display=!0,t.scales.y.title.text=e},I=function(t,e){var n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return n?"rgba("+parseInt(n[1],16)+", "+parseInt(n[2],16)+", "+parseInt(n[3],16)+", "+e+")":t},z=function(t){return null!=t},B=function(e,n,r){var i={prefix:e.options.prefix,suffix:e.options.suffix,thousands:e.options.thousands,decimal:e.options.decimal,precision:e.options.precision,round:e.options.round,zeros:e.options.zeros};if(e.options.bytes){var o=e.data;"pie"===r&&(o=[{data:o}]);for(var a=0,s=0;s<o.length;s++)for(var u=o[s],c=0;c<u.data.length;c++)u.data[c][1]>a&&(a=u.data[c][1]);for(var l=1;a>=1024;)l*=1024,a/=1024;i.byteScale=l}if("pie"!==r){var h=n.scales.y;"bar"===r&&(h=n.scales.x),i.byteScale&&(h.ticks.stepSize||(h.ticks.stepSize=i.byteScale/2),h.ticks.maxTicksLimit||(h.ticks.maxTicksLimit=4)),h.ticks.callback||(h.ticks.callback=function(t){return S("",t,i,!0)})}if(!n.plugins.tooltip.callbacks.label)if("scatter"===r)n.plugins.tooltip.callbacks.label=function(t){var e=t.dataset.label||"";return e&&(e+=": "),e+"("+t.label+", "+t.formattedValue+")"};else if("bubble"===r)n.plugins.tooltip.callbacks.label=function(t){var e=t.dataset.label||"";e&&(e+=": ");var n=t.raw;return e+"("+n.x+", "+n.y+", "+n.v+")"};else if("pie"===r)n.plugins.tooltip.callbacks.label=function(e){var n=e.label;return t(n)?(n=n.slice())[0]+=": ":n+=": ",S(n,e.parsed,i)};else{var f="bar"===r?"x":"y";n.plugins.tooltip.callbacks.label=function(t){if(null!==t.parsed[f]){var e=t.dataset.label||"";return e&&(e+=": "),S(e,t.parsed[f],i)}}}},j=h(i(M,E),A,O,(function(t,e){null!==e&&(t.scales.y.min=u(e))}),(function(t,e){t.scales.y.max=u(e)}),L,N,R),F=function(e,n,r){var o,a=[],s=[],l=e.options.colors||T,h=!0,f=!0,d=!0,_=!0,x=!0,k=!0,S=e.data,M=0;if("bubble"===r)for(var E=0;E<S.length;E++)for(var A=S[E],O=0;O<A.data.length;O++)A.data[O][2]>M&&(M=A.data[O][2]);var D,P,L,N,R,B,j,F=[],q=[];if("bar"===r||"column"===r||"number"!==e.xtype&&"bubble"!==e.xtype){var $,V,U=[];for(D=0;D<S.length;D++)for(L=S[D],P=0;P<L.data.length;P++)N=L.data[P],F[R="datetime"==e.xtype?N[0].getTime():N[0]]||(F[R]=new Array(S.length)),F[R][D]=u(N[1]),-1===U.indexOf(R)&&U.push(R);for("datetime"!==e.xtype&&"number"!==e.xtype||U.sort(p),P=0;P<S.length;P++)q.push([]);for(V=0;V<U.length;V++)for(D=U[V],"datetime"===e.xtype?($=new Date(u(D)),h=h&&g($),o||(o=$.getDay()),f=f&&y($,o),d=d&&b($),_=_&&w($),x=x&&m($),k=k&&v($)):$=D,s.push($),P=0;P<S.length;P++)q[P].push(void 0===F[D][P]?null:F[D][P])}else for(var H=0;H<S.length;H++){for(var W=S[H],Z=[],J=0;J<W.data.length;J++){var Y={x:u(W.data[J][0]),y:u(W.data[J][1])};"bubble"===r&&(Y.r=20*u(W.data[J][2])/M,Y.v=W.data[J][2]),Z.push(Y)}q.push(Z)}for(D=0;D<S.length;D++){if(L=S[D],!e.options.colors||!e.singleSeriesFormat||"bar"!==r&&"column"!==r||L.color||!t(e.options.colors)||t(e.options.colors[0]))B=L.color||l[D],j="line"!==r?I(B,.5):B;else{B=l,j=[];for(var K=0;K<l.length;K++)j[K]=I(B[K],.5)}var G={label:L.name||"",data:q[D],fill:"area"===r,borderColor:B,backgroundColor:j,borderWidth:2},X="line"===r||"area"===r||"scatter"===r||"bubble"===r;X&&(G.pointBackgroundColor=B,G.pointHoverBackgroundColor=B,G.pointHitRadius=50),"bubble"===r&&(G.pointBackgroundColor=j,G.pointHoverBackgroundColor=j,G.pointHoverBorderWidth=2),L.stack&&(G.stack=L.stack),!1===C(e,L,"curve")?G.tension=0:X&&(G.tension=.4),!1===C(e,L,"points")&&(G.pointRadius=0,G.pointHoverRadius=0),G=i(G,e.options.dataset||{}),G=i(G,L.library||{}),G=i(G,L.dataset||{}),a.push(G)}var Q=e.options.xmin,tt=e.options.xmax;if("datetime"===e.xtype?(z(Q)&&(n.scales.x.ticks.min=c(Q).getTime()),z(tt)&&(n.scales.x.ticks.max=c(tt).getTime())):"number"===e.xtype&&(z(Q)&&(n.scales.x.ticks.min=Q),z(tt)&&(n.scales.x.ticks.max=tt)),"datetime"===e.xtype&&0===s.length&&(z(Q)&&s.push(c(Q)),z(tt)&&s.push(c(tt)),h=!1,f=!1,d=!1,_=!1,x=!1,k=!1),"datetime"===e.xtype&&s.length>0){var et=(z(Q)?c(Q):s[0]).getTime(),nt=(z(tt)?c(tt):s[0]).getTime();for(D=1;D<s.length;D++){var rt=s[D].getTime();rt<et&&(et=rt),rt>nt&&(nt=rt)}var it,ot=(nt-et)/864e5;if(!n.scales.x.time.unit&&(_||ot>3650?(n.scales.x.time.unit="year",it=365):d||ot>300?(n.scales.x.time.unit="month",it=30):h||ot>10?(n.scales.x.time.unit="day",it=1):x||ot>.5?(n.scales.x.time.displayFormats={hour:"MMM d, h a"},n.scales.x.time.unit="hour",it=1/24):k&&(n.scales.x.time.displayFormats={minute:"h:mm a"},n.scales.x.time.unit="minute",it=1/24/60),it&&ot>0)){var at=e.element.offsetWidth;if(at>0){var st=Math.ceil(ot/it/(at/100));f&&1===it&&(st=7*Math.ceil(st/7)),n.scales.x.time.stepSize=st}}n.scales.x.time.tooltipFormat||(h?n.scales.x.time.tooltipFormat="PP":x?n.scales.x.time.tooltipFormat="MMM d, h a":k&&(n.scales.x.time.tooltipFormat="h:mm a"))}return{labels:s,datasets:a}},q=function(t){this.name="chartjs",this.library=t};q.prototype.renderLineChart=function(t,e){var n={};!t.options.max&&function(t){var e,n,r;for(e=0;e<t.length;e++)for(r=t[e].data,n=0;n<r.length;n++)if(0!=r[n][1])return!1;return!0}(t.data)&&(n.max=1);var r=j(t,i(n,t.options));B(t,r,e);var o=F(t,r,e||"line");"number"===t.xtype?(r.scales.x.type=r.scales.x.type||"linear",r.scales.x.position=r.scales.x.position||"bottom"):r.scales.x.type="string"===t.xtype?"category":"time",this.drawChart(t,"line",o,r)},q.prototype.renderPieChart=function(t){var e=i({},M);t.options.donut&&(e.cutout="50%"),"legend"in t.options&&A(e,t.options.legend),t.options.title&&O(e,t.options.title),e=i(e,t.options.library||{}),B(t,e,"pie");for(var n=[],r=[],o=0;o<t.data.length;o++){var a=t.data[o];n.push(a[0]),r.push(a[1])}var s={data:r,backgroundColor:t.options.colors||T},u={labels:n,datasets:[s=i(s,t.options.dataset||{})]};this.drawChart(t,"pie",u,e)},q.prototype.renderColumnChart=function(t,e){var n;if("bar"===e){var r=i(M,E);r.indexAxis="y",r.scales.x.grid.drawOnChartArea=!0,r.scales.y.grid.drawOnChartArea=!1,delete r.scales.y.ticks.maxTicksLimit,n=h(r,A,O,D,P,L,N,R)(t,t.options)}else n=j(t,t.options);B(t,n,e);var o=F(t,n,"column");"bar"!==e&&function(t,e,n){var r=Math.ceil(t.element.offsetWidth/4/e.labels.length);r>25?r=25:r<10&&(r=10),n.scales.x.ticks.callback||(n.scales.x.ticks.callback=function(t){return(t=s(this.getLabelForValue(t))).length>r?t.substring(0,r-2)+"...":t})}(t,o,n),this.drawChart(t,"bar",o,n)},q.prototype.renderAreaChart=function(t){this.renderLineChart(t,"area")},q.prototype.renderBarChart=function(t){this.renderColumnChart(t,"bar")},q.prototype.renderScatterChart=function(t,e){e=e||"scatter";var n=j(t,t.options);B(t,n,e),"showLine"in n||(n.showLine=!1);var r=F(t,n,e);n.scales.x.type=n.scales.x.type||"linear",n.scales.x.position=n.scales.x.position||"bottom","mode"in n.interaction||(n.interaction.mode="nearest"),this.drawChart(t,e,r,n)},q.prototype.renderBubbleChart=function(t){this.renderScatterChart(t,"bubble")},q.prototype.destroy=function(t){t.chart&&t.chart.destroy()},q.prototype.drawChart=function(t,e,n,r){if(this.destroy(t),!t.destroyed){var i={type:e,data:n,options:r};t.options.code&&window.console.log("new Chart(ctx, "+JSON.stringify(i)+");"),t.element.innerHTML="<canvas></canvas>";var o=t.element.getElementsByTagName("CANVAS")[0];t.chart=new this.library(o,i)}};var $={chart:{},xAxis:{title:{text:null},labels:{style:{fontSize:"12px"}}},yAxis:{title:{text:null},labels:{style:{fontSize:"12px"}}},title:{text:null},credits:{enabled:!1},legend:{borderWidth:0},tooltip:{style:{fontSize:"12px"}},plotOptions:{areaspline:{},area:{},series:{marker:{}}},time:{useUTC:!1}},V=function(t,e,n){void 0!==e?(t.legend.enabled=!!e,e&&!0!==e&&("top"===e||"bottom"===e?t.legend.verticalAlign=e:(t.legend.layout="vertical",t.legend.verticalAlign="middle",t.legend.align=e))):n&&(t.legend.enabled=!1)},U=function(t,e){t.title.text=e},H=h($,V,U,(function(t,e){t.yAxis.min=e}),(function(t,e){t.yAxis.max=e}),(function(t,e){var n=e?!0===e?"normal":e:null;t.plotOptions.series.stacking=n,t.plotOptions.area.stacking=n,t.plotOptions.areaspline.stacking=n}),(function(t,e){t.xAxis.title.text=e}),(function(t,e){t.yAxis.title.text=e})),W=function(t,e,n){var r={prefix:t.options.prefix,suffix:t.options.suffix,thousands:t.options.thousands,decimal:t.options.decimal,precision:t.options.precision,round:t.options.round,zeros:t.options.zeros};"pie"===n||e.yAxis.labels.formatter||(e.yAxis.labels.formatter=function(){return S("",this.value,r)}),e.tooltip.pointFormatter||e.tooltip.pointFormat||(e.tooltip.pointFormatter=function(){return'<span style="color:'+this.color+'">\u25cf</span> '+S(this.series.name+": <b>",this.y,r)+"</b><br/>"})},Z=function(t){this.name="highcharts",this.library=t};Z.prototype.renderLineChart=function(t,e){var n={};"areaspline"===(e=e||"spline")&&(n={plotOptions:{areaspline:{stacking:"normal"},area:{stacking:"normal"},series:{marker:{enabled:!1}}}}),!1===t.options.curve&&("areaspline"===e?e="area":"spline"===e&&(e="line"));var r,i,o,a=H(t,t.options,n);"number"===t.xtype?a.xAxis.type=a.xAxis.type||"linear":a.xAxis.type="string"===t.xtype?"category":"datetime",a.chart.type||(a.chart.type=e),W(t,a,e);var s=t.data;for(i=0;i<s.length;i++){if(s[i].name=s[i].name||"Value",r=s[i].data,"datetime"===t.xtype)for(o=0;o<r.length;o++)r[o][0]=r[o][0].getTime();s[i].marker={symbol:"circle"},!1===t.options.points&&(s[i].marker.enabled=!1)}this.drawChart(t,s,a)},Z.prototype.renderScatterChart=function(t){var e=H(t,t.options,{});e.chart.type="scatter",this.drawChart(t,t.data,e)},Z.prototype.renderPieChart=function(t){var e=i($,{});t.options.colors&&(e.colors=t.options.colors),t.options.donut&&(e.plotOptions={pie:{innerSize:"50%"}}),"legend"in t.options&&V(e,t.options.legend),t.options.title&&U(e,t.options.title);var n=i(e,t.options.library||{});W(t,n,"pie");var r=[{type:"pie",name:t.options.label||"Value",data:t.data}];this.drawChart(t,r,n)},Z.prototype.renderColumnChart=function(t,e){e=e||"column";var n,r,i,o,a=t.data,s=H(t,t.options),u=[],c=[];for(s.chart.type=e,W(t,s,e),n=0;n<a.length;n++)for(i=a[n],r=0;r<i.data.length;r++)u[(o=i.data[r])[0]]||(u[o[0]]=new Array(a.length),c.push(o[0])),u[o[0]][n]=o[1];"number"===t.xtype&&c.sort(p),s.xAxis.categories=c;var l,h=[];for(n=0;n<a.length;n++){for(o=[],r=0;r<c.length;r++)o.push(u[c[r]][n]||0);l={name:a[n].name||"Value",data:o},a[n].stack&&(l.stack=a[n].stack),h.push(l)}this.drawChart(t,h,s)},Z.prototype.renderBarChart=function(t){this.renderColumnChart(t,"bar")},Z.prototype.renderAreaChart=function(t){this.renderLineChart(t,"areaspline")},Z.prototype.destroy=function(t){t.chart&&t.chart.destroy()},Z.prototype.drawChart=function(t,e,n){this.destroy(t),t.destroyed||(n.chart.renderTo=t.element.id,n.series=e,t.options.code&&window.console.log("new Highcharts.Chart("+JSON.stringify(n)+");"),t.chart=new this.library.Chart(n))};var J={},Y=[],K={chartArea:{},fontName:"'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif",pointSize:6,legend:{textStyle:{fontSize:12,color:"#444"},alignment:"center",position:"right"},curveType:"function",hAxis:{textStyle:{color:"#666",fontSize:12},titleTextStyle:{},gridlines:{color:"transparent"},baselineColor:"#ccc",viewWindow:{}},vAxis:{textStyle:{color:"#666",fontSize:12},titleTextStyle:{},baselineColor:"#ccc",viewWindow:{}},tooltip:{textStyle:{color:"#666",fontSize:12}}},G=function(t,e,n){var r;void 0!==e?(r=e?!0===e?"right":e:"none",t.legend.position=r):n&&(t.legend.position="none")},X=function(t,e){t.title=e,t.titleTextStyle={color:"#333",fontSize:"20px"}},Q=function(t,e){t.hAxis.viewWindow.min=e},tt=function(t,e){t.hAxis.viewWindow.max=e},et=function(t,e){t.isStacked=e||!1},nt=function(t,e){t.hAxis.title=e,t.hAxis.titleTextStyle.italic=!1},rt=function(t,e){t.vAxis.title=e,t.vAxis.titleTextStyle.italic=!1},it=h(K,G,X,(function(t,e){t.vAxis.viewWindow.min=e}),(function(t,e){t.vAxis.viewWindow.max=e}),et,nt,rt),ot=function(t){this.name="google",this.library=t};function at(t,e){var n,r,i=[];if(r="number"===e?u:"datetime"===e?c:s,"bubble"===e)for(n=0;n<t.length;n++)i.push([u(t[n][0]),u(t[n][1]),u(t[n][2])]);else for(n=0;n<t.length;n++)i.push([r(t[n][0]),u(t[n][1])]);return"datetime"===e?i.sort(f):"number"===e&&i.sort(d),i}function st(t,e){var n,r,i;for(n=0;n<t.length;n++)for(i=l(t[n].data),r=0;r<i.length;r++)if(!e(i[r][0]))return!1;return!0}function ut(e,n,r){var i,o=e.options,s=e.rawData;for(e.singleSeriesFormat=!t(s)||"object"!==a(s[0])||t(s[0]),e.singleSeriesFormat&&(s=[{name:o.label,data:s}]),s=function(t){var e,n,r=[];for(e=0;e<t.length;e++){var i={};for(n in t[e])t[e].hasOwnProperty(n)&&(i[n]=t[e][n]);r.push(i)}return r}(s),i=0;i<s.length;i++)s[i].data=l(s[i].data);for(e.xtype=n||(o.discrete?"string":function(t,e,n){return lt(t)?!n.xmin&&!n.xmax||n.xmin&&!_(n.xmin)||n.xmax&&!_(n.xmax)?"number":"datetime":st(t,x)?"number":!e&&st(t,_)?"datetime":"string"}(s,r,o)),i=0;i<s.length;i++)s[i].data=at(s[i].data,e.xtype);return s}function ct(t){var e,n=l(t.rawData);for(e=0;e<n.length;e++)n[e]=[s(n[e][0]),u(n[e][1])];return n}function lt(t,e){if("PieChart"===e||"GeoChart"===e||"Timeline"===e)return 0===t.length;for(var n=0;n<t.length;n++)if(t[n].data.length>0)return!1;return!0}function ht(t,e,n){if(t.addEventListener)return t.addEventListener(e,n,!1),n;var r=function(){return n.call(t,window.event)};return t.attachEvent("on"+e,r),r}function ft(t,e,n){t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent("on"+e,n)}function dt(t,e){if(t===e)return!1;for(;e&&e!==t;)e=e.parentNode;return e===t}ot.prototype.renderLineChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n={};!1===t.options.curve&&(n.curveType="none"),!1===t.options.points&&(n.pointSize=0);var r=it(t,t.options,n),i=e.createDataTable(t.data,t.xtype);e.drawChart(t,"LineChart",i,r)}))},ot.prototype.renderPieChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n={chartArea:{top:"10%",height:"80%"},legend:{}};t.options.colors&&(n.colors=t.options.colors),t.options.donut&&(n.pieHole=.5),"legend"in t.options&&G(n,t.options.legend),t.options.title&&X(n,t.options.title);var r=i(i(K,n),t.options.library||{}),o=new e.library.visualization.DataTable;o.addColumn("string",""),o.addColumn("number","Value"),o.addRows(t.data),e.drawChart(t,"PieChart",o,r)}))},ot.prototype.renderColumnChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n=it(t,t.options),r=e.createDataTable(t.data,t.xtype);e.drawChart(t,"ColumnChart",r,n)}))},ot.prototype.renderBarChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n=h(K,G,X,Q,tt,et,nt,rt)(t,t.options,{hAxis:{gridlines:{color:"#ccc"}}}),r=e.createDataTable(t.data,t.xtype);e.drawChart(t,"BarChart",r,n)}))},ot.prototype.renderAreaChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n=it(t,t.options,{isStacked:!0,pointSize:0,areaOpacity:.5}),r=e.createDataTable(t.data,t.xtype);e.drawChart(t,"AreaChart",r,n)}))},ot.prototype.renderGeoChart=function(t){var e=this;this.waitForLoaded(t,"geochart",(function(){var n={legend:"none",colorAxis:{colors:t.options.colors||["#f6c7b6","#ce502d"]}},r=i(i(K,n),t.options.library||{}),o=new e.library.visualization.DataTable;o.addColumn("string",""),o.addColumn("number",t.options.label||"Value"),o.addRows(t.data),e.drawChart(t,"GeoChart",o,r)}))},ot.prototype.renderScatterChart=function(t){var e=this;this.waitForLoaded(t,(function(){var n,r,i,o,a=it(t,t.options,{}),s=t.data,u=[];for(n=0;n<s.length;n++)for(s[n].name=s[n].name||"Value",o=s[n].data,r=0;r<o.length;r++){var c=new Array(s.length+1);c[0]=o[r][0],c[n+1]=o[r][1],u.push(c)}for((i=new e.library.visualization.DataTable).addColumn("number",""),n=0;n<s.length;n++)i.addColumn("number",s[n].name);i.addRows(u),e.drawChart(t,"ScatterChart",i,a)}))},ot.prototype.renderTimeline=function(t){var e=this;this.waitForLoaded(t,"timeline",(function(){var n={legend:"none"};t.options.colors&&(n.colors=t.options.colors);var r=i(i(K,n),t.options.library||{}),o=new e.library.visualization.DataTable;o.addColumn({type:"string",id:"Name"}),o.addColumn({type:"date",id:"Start"}),o.addColumn({type:"date",id:"End"}),o.addRows(t.data),t.element.style.lineHeight="normal",e.drawChart(t,"Timeline",o,r)}))},ot.prototype.destroy=function(t){t.chart&&t.chart.clearChart()},ot.prototype.drawChart=function(t,e,n,r){var i;this.destroy(t),t.destroyed||(t.options.code&&window.console.log("var data = new google.visualization.DataTable("+n.toJSON()+");\nvar chart = new google.visualization."+e+"(element);\nchart.draw(data, "+JSON.stringify(r)+");"),t.chart=new this.library.visualization[e](t.element),i=function(){t.chart.draw(n,r)},window.attachEvent?window.attachEvent("onresize",i):window.addEventListener&&window.addEventListener("resize",i,!0),i())},ot.prototype.waitForLoaded=function(t,e,n){var r=this;if(n||(n=e,e="corechart"),Y.push({pack:e,callback:n}),J[e])this.runCallbacks();else{J[e]=!0;var i={packages:[e],callback:function(){r.runCallbacks()}},o=t.__config();o.language&&(i.language=o.language),"geochart"===e&&o.mapsApiKey&&(i.mapsApiKey=o.mapsApiKey),this.library.charts.load("current",i)}},ot.prototype.runCallbacks=function(){for(var t,e=0;e<Y.length;e++)t=Y[e],this.library.visualization&&("corechart"===t.pack&&this.library.visualization.LineChart||"timeline"===t.pack&&this.library.visualization.Timeline||"geochart"===t.pack&&this.library.visualization.GeoChart)&&(t.callback(),Y.splice(e,1),e--)},ot.prototype.createDataTable=function(t,e){var n,r,i,o,a,c=[],l=[];for(n=0;n<t.length;n++)for(i=t[n],t[n].name=t[n].name||"Value",r=0;r<i.data.length;r++)o=i.data[r],c[a="datetime"===e?o[0].getTime():o[0]]||(c[a]=new Array(t.length),l.push(a)),c[a][n]=u(o[1]);var h,p=[],v=!0;for(r=0;r<l.length;r++)n=l[r],"datetime"===e?(h=new Date(u(n)),v=v&&g(h)):h="number"===e?u(n):n,p.push([h].concat(c[n]));if("datetime"===e)p.sort(f);else if("number"===e){for(p.sort(d),n=0;n<p.length;n++)p[n][0]=s(p[n][0]);e="string"}var m=new this.library.visualization.DataTable;for(e="datetime"===e&&v?"date":e,m.addColumn(e,""),n=0;n<t.length;n++)m.addColumn("number",t[n].name);return m.addRows(p),m};var pt=[],vt=0;function mt(){if(vt<4){var t=pt.shift();t&&(vt++,e=t[0],n=t[1],r=t[2],function(t,e,n){var r=window.jQuery||window.Zepto||window.$;if(r&&r.ajax)r.ajax({dataType:"json",url:t,success:e,error:n,complete:gt});else{var i=new XMLHttpRequest;i.open("GET",t,!0),i.setRequestHeader("Content-Type","application/json"),i.onload=function(){gt(),200===i.status?e(JSON.parse(i.responseText),i.statusText,i):n(i,"error",i.statusText)},i.send()}}(e,n,(function(t,e,n){var i="string"===typeof n?n:n.message;r(i)})),mt())}var e,n,r}function gt(){vt--,mt()}var yt={},bt=[];function wt(t,e){document.body.innerText?t.innerText=e:t.textContent=e}function _t(t,e,n){n||(e="Error Loading Chart: "+e),wt(t,e),t.style.color="#ff0000"}function xt(t){try{t.__render()}catch(e){throw _t(t.element,e.message),e}}function kt(t,e,n){if(n&&t.options.loading&&("string"===typeof e||"function"===typeof e)&&wt(t.element,t.options.loading),"string"===typeof e)r=e,i=function(e){t.rawData=e,xt(t)},o=function(e){_t(t.element,e)},pt.push([r,i,o]),mt();else if("function"===typeof e)try{e((function(e){t.rawData=e,xt(t)}),(function(e){_t(t.element,e,!0)}))}catch(a){_t(t.element,a,!0)}else t.rawData=e,xt(t);var r,i,o}function St(t){var n=new(function(t){if(t){if("Highcharts"===t.product)return Z;if(t.charts)return ot;if(e(t))return q}throw new Error("Unknown adapter")}(t))(t);-1===bt.indexOf(n)&&bt.push(n)}function Ct(t,n){if(lt(n.data,t)){var r=n.options.empty||n.options.messages&&n.options.messages.empty||"No data";wt(n.element,r)}else!function(t,n){var r,i,o,a;for((o="render"+t,a=n.options.adapter,"Chart"in window&&St(window.Chart),"Highcharts"in window&&St(window.Highcharts),window.google&&window.google.charts&&St(window.google),r=0);r<bt.length;r++)if(i=bt[r],(!a||a===i.name)&&e(i[o]))return n.adapter=i.name,n.__adapterObject=i,i[o](n);throw bt.length>0?new Error("No charting library found for "+t):new Error("No charting libraries found - be sure to include one before your charts")}(t,n),n.options.download&&!n.__downloadAttached&&"chartjs"===n.adapter&&function(t){var e=t.element,n=document.createElement("a"),r=t.options.download;!0===r?r={}:"string"===typeof r&&(r={filename:r}),n.download=r.filename||"chart.png",n.style.position="absolute",n.style.top="20px",n.style.right="20px",n.style.zIndex=1e3,n.style.lineHeight="20px",n.target="_blank";var i=document.createElement("img");i.alt="Download",i.style.border="none",i.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABCFBMVEUAAADMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMywEsqxAAAAV3RSTlMAAQIDBggJCgsMDQ4PERQaHB0eISIjJCouLzE0OTo/QUJHSUpLTU5PUllhYmltcHh5foWLjI+SlaCio6atr7S1t7m6vsHHyM7R2tze5Obo7fHz9ff5+/1hlxK2AAAA30lEQVQYGUXBhVYCQQBA0TdYWAt2d3d3YWAHyur7/z9xgD16Lw0DW+XKx+1GgX+FRzM3HWQWrHl5N/oapW5RPe0PkBu+UYeICvozTWZVK23Ao04B79oJrOsJDOoxkZoQPWgX29pHpCZEk7rEvQYiNSFq1UMqvlCjJkRBS1R8hb00Vb/TajtBL7nTHE1X1vyMQF732dQhyF2o6SAwrzP06iUQzvwsArlnzcOdrgBhJyHa1QOgO9U1GsKuvjUTjavliZYQ8nNPapG6sap/3nrIdJ6bOWzmX/fy0XVpfzZP3S8OJT3g9EEiJwAAAABJRU5ErkJggg==",n.appendChild(i),e.style.position="relative",t.__downloadAttached=!0,t.__enterEvent=ht(e,"mouseover",(function(i){var o=i.relatedTarget;o&&(o===this||dt(this,o))||!t.options.download||(n.href=t.toImage(r),e.appendChild(n))})),t.__leaveEvent=ht(e,"mouseout",(function(t){var e=t.relatedTarget;e&&(e===this||dt(this,e))||n.parentNode&&n.parentNode.removeChild(n)}))}(n)}var Mt=function(t,e,n){var r;if("string"===typeof t&&(r=t,!(t=document.getElementById(t))))throw new Error("No element with id "+r);this.element=t,this.options=i(Et.options,n||{}),this.dataSource=e,Et.charts[t.id]=this,kt(this,e,!0),this.options.refresh&&this.startRefresh()};Mt.prototype.getElement=function(){return this.element},Mt.prototype.getDataSource=function(){return this.dataSource},Mt.prototype.getData=function(){return this.data},Mt.prototype.getOptions=function(){return this.options},Mt.prototype.getChartObject=function(){return this.chart},Mt.prototype.getAdapter=function(){return this.adapter},Mt.prototype.updateData=function(t,e){this.dataSource=t,e&&this.__updateOptions(e),kt(this,t,!0)},Mt.prototype.setOptions=function(t){this.__updateOptions(t),this.redraw()},Mt.prototype.redraw=function(){kt(this,this.rawData)},Mt.prototype.refreshData=function(){if("string"===typeof this.dataSource){var t=-1===this.dataSource.indexOf("?")?"?":"&";kt(this,this.dataSource+t+"_="+(new Date).getTime())}else"function"===typeof this.dataSource&&kt(this,this.dataSource)},Mt.prototype.startRefresh=function(){var t=this,e=this.options.refresh;if(e&&"string"!==typeof this.dataSource&&"function"!==typeof this.dataSource)throw new Error("Data source must be a URL or callback for refresh");if(!this.intervalId){if(!e)throw new Error("No refresh interval");this.intervalId=setInterval((function(){t.refreshData()}),1e3*e)}},Mt.prototype.stopRefresh=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)},Mt.prototype.toImage=function(t){if("chartjs"===this.adapter){if(t&&t.background&&"transparent"!==t.background){var e=this.chart.canvas,n=this.chart.ctx,r=document.createElement("canvas"),i=r.getContext("2d");return r.width=n.canvas.width,r.height=n.canvas.height,i.fillStyle=t.background,i.fillRect(0,0,r.width,r.height),i.drawImage(e,0,0),r.toDataURL("image/png")}return this.chart.toBase64Image()}throw new Error("Feature only available for Chart.js")},Mt.prototype.destroy=function(){this.destroyed=!0,this.stopRefresh(),this.__adapterObject&&this.__adapterObject.destroy(this),this.__enterEvent&&ft(this.element,"mouseover",this.__enterEvent),this.__leaveEvent&&ft(this.element,"mouseout",this.__leaveEvent)},Mt.prototype.__updateOptions=function(t){var e=t.refresh&&t.refresh!==this.options.refresh;this.options=i(Et.options,t),e&&(this.stopRefresh(),this.startRefresh())},Mt.prototype.__render=function(){this.data=this.__processData(),Ct(this.__chartName(),this)},Mt.prototype.__config=function(){return yt};var Et={LineChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return ut(this)},e.prototype.__chartName=function(){return"LineChart"},e}(Mt),PieChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return ct(this)},e.prototype.__chartName=function(){return"PieChart"},e}(Mt),ColumnChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return ut(this,null,!0)},e.prototype.__chartName=function(){return"ColumnChart"},e}(Mt),BarChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return ut(this,null,!0)},e.prototype.__chartName=function(){return"BarChart"},e}(Mt),AreaChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return ut(this)},e.prototype.__chartName=function(){return"AreaChart"},e}(Mt),GeoChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return ct(this)},e.prototype.__chartName=function(){return"GeoChart"},e}(Mt),ScatterChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return ut(this,"number")},e.prototype.__chartName=function(){return"ScatterChart"},e}(Mt),BubbleChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){return ut(this,"bubble")},e.prototype.__chartName=function(){return"BubbleChart"},e}(Mt),Timeline:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__processData=function(){var t,e=this.rawData;for(t=0;t<e.length;t++)e[t][1]=c(e[t][1]),e[t][2]=c(e[t][2]);return e},e.prototype.__chartName=function(){return"Timeline"},e}(Mt),charts:{},configure:function(t){for(var e in t)t.hasOwnProperty(e)&&(yt[e]=t[e])},setDefaultOptions:function(t){Et.options=t},eachChart:function(t){for(var e in Et.charts)Et.charts.hasOwnProperty(e)&&t(Et.charts[e])},destroyAll:function(){for(var t in Et.charts)Et.charts.hasOwnProperty(t)&&(Et.charts[t].destroy(),delete Et.charts[t])},config:yt,options:{},adapters:bt,addAdapter:St,use:function(t){return St(t),Et}};return"undefined"===typeof window||window.Chartkick||(window.Chartkick=Et,document.addEventListener("turbolinks:before-render",(function(){Et.destroyAll()})),setTimeout((function(){window.dispatchEvent(new Event("chartkick:load"))}),0)),Et.default=Et,Et},"object"===a(e)&&"undefined"!==typeof t?t.exports=o():void 0===(i="function"===typeof(r=o)?r.call(e,n,e,t):r)||(t.exports=i)},function(t,e,n){"use strict";n(239),n(241),n(242),n(243),n(245)},function(t,e,n){"use strict";var r=n(0),i=n(3),o=n(9),a=n(2),s=n(21),u=n(4),c=n(66),l=n(1),h=n(12),f=n(36),d=n(5),p=n(23),v=n(49),m=n(13),g=n(48),y=n(37),b=n(81),w=n(60),_=n(124),x=n(97),k=n(20),S=n(15),C=n(123),M=n(93),E=n(16),T=n(38),A=n(67),O=n(96),D=n(78),P=n(77),L=n(7),N=n(164),R=n(26),I=n(166),z=n(33),B=n(22),j=n(19).forEach,F=O("hidden"),q="Symbol",$=B.set,V=B.getterFor(q),U=Object.prototype,H=i.Symbol,W=H&&H.prototype,Z=i.RangeError,J=i.TypeError,Y=i.QObject,K=k.f,G=S.f,X=_.f,Q=M.f,tt=a([].push),et=A("symbols"),nt=A("op-symbols"),rt=A("wks"),it=!Y||!Y.prototype||!Y.prototype.findChild,ot=function(t,e,n){var r=K(U,e);r&&delete U[e],G(t,e,n),r&&t!==U&&G(U,e,r)},at=u&&l((function(){return 7!==y(G({},"a",{get:function(){return G(this,"a",{value:7}).a}})).a}))?ot:G,st=function(t,e){var n=et[t]=y(W);return $(n,{type:q,tag:t,description:e}),u||(n.description=e),n},ut=function(t,e,n){t===U&&ut(nt,e,n),d(t);var r=v(e);return d(n),h(et,r)?(n.enumerable?(h(t,F)&&t[F][r]&&(t[F][r]=!1),n=y(n,{enumerable:g(0,!1)})):(h(t,F)||G(t,F,g(1,y(null))),t[F][r]=!0),at(t,r,n)):G(t,r,n)},ct=function(t,e){d(t);var n=p(e),r=b(n).concat(dt(n));return j(r,(function(e){u&&!o(lt,n,e)||ut(t,e,n[e])})),t},lt=function(t){var e=v(t),n=o(Q,this,e);return!(this===U&&h(et,e)&&!h(nt,e))&&(!(n||!h(this,e)||!h(et,e)||h(this,F)&&this[F][e])||n)},ht=function(t,e){var n=p(t),r=v(e);if(n!==U||!h(et,r)||h(nt,r)){var i=K(n,r);return!i||!h(et,r)||h(n,F)&&n[F][r]||(i.enumerable=!0),i}},ft=function(t){var e=X(p(t)),n=[];return j(e,(function(t){h(et,t)||h(D,t)||tt(n,t)})),n},dt=function(t){var e=t===U,n=X(e?nt:p(t)),r=[];return j(n,(function(t){!h(et,t)||e&&!h(U,t)||tt(r,et[t])})),r};c||(E(W=(H=function(){if(f(W,this))throw new J("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?m(arguments[0]):void 0,e=P(t),n=function(t){var r=void 0===this?i:this;r===U&&o(n,nt,t),h(r,F)&&h(r[F],e)&&(r[F][e]=!1);var a=g(1,t);try{at(r,e,a)}catch(s){if(!(s instanceof Z))throw s;ot(r,e,a)}};return u&&it&&at(U,e,{configurable:!0,set:n}),st(e,t)}).prototype,"toString",(function(){return V(this).tag})),E(H,"withoutSetter",(function(t){return st(P(t),t)})),M.f=lt,S.f=ut,C.f=ct,k.f=ht,w.f=_.f=ft,x.f=dt,N.f=function(t){return st(L(t),t)},u&&(T(W,"description",{configurable:!0,get:function(){return V(this).description}}),s||E(U,"propertyIsEnumerable",lt,{unsafe:!0}))),r({global:!0,constructor:!0,wrap:!0,forced:!c,sham:!c},{Symbol:H}),j(b(rt),(function(t){R(t)})),r({target:q,stat:!0,forced:!c},{useSetter:function(){it=!0},useSimple:function(){it=!1}}),r({target:"Object",stat:!0,forced:!c,sham:!u},{create:function(t,e){return void 0===e?y(t):ct(y(t),e)},defineProperty:ut,defineProperties:ct,getOwnPropertyDescriptor:ht}),r({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:ft}),I(),z(H,q),D[F]=!0},function(t,e,n){"use strict";var r=n(52),i=n(83),o=n(6),a=n(7)("species"),s=Array;t.exports=function(t){var e;return r(t)&&(e=t.constructor,(i(e)&&(e===s||r(e.prototype))||o(e)&&null===(e=e[a]))&&(e=void 0)),void 0===e?s:e}},function(t,e,n){"use strict";var r=n(0),i=n(25),o=n(12),a=n(13),s=n(67),u=n(167),c=s("string-to-symbol-registry"),l=s("symbol-to-string-registry");r({target:"Symbol",stat:!0,forced:!u},{for:function(t){var e=a(t);if(o(c,e))return c[e];var n=i("Symbol")(e);return c[e]=n,l[n]=e,n}})},function(t,e,n){"use strict";var r=n(0),i=n(12),o=n(65),a=n(59),s=n(67),u=n(167),c=s("symbol-to-string-registry");r({target:"Symbol",stat:!0,forced:!u},{keyFor:function(t){if(!o(t))throw new TypeError(a(t)+" is not a symbol");if(i(c,t))return c[t]}})},function(t,e,n){"use strict";var r=n(0),i=n(25),o=n(42),a=n(9),s=n(2),u=n(1),c=n(8),l=n(65),h=n(32),f=n(244),d=n(66),p=String,v=i("JSON","stringify"),m=s(/./.exec),g=s("".charAt),y=s("".charCodeAt),b=s("".replace),w=s(1..toString),_=/[\uD800-\uDFFF]/g,x=/^[\uD800-\uDBFF]$/,k=/^[\uDC00-\uDFFF]$/,S=!d||u((function(){var t=i("Symbol")("stringify detection");return"[null]"!==v([t])||"{}"!==v({a:t})||"{}"!==v(Object(t))})),C=u((function(){return'"\\udf06\\ud834"'!==v("\udf06\ud834")||'"\\udead"'!==v("\udead")})),M=function(t,e){var n=h(arguments),r=f(e);if(c(r)||void 0!==t&&!l(t))return n[1]=function(t,e){if(c(r)&&(e=a(r,this,p(t),e)),!l(e))return e},o(v,null,n)},E=function(t,e,n){var r=g(n,e-1),i=g(n,e+1);return m(x,t)&&!m(k,i)||m(k,t)&&!m(x,r)?"\\u"+w(y(t,0),16):t};v&&r({target:"JSON",stat:!0,arity:3,forced:S||C},{stringify:function(t,e,n){var r=h(arguments),i=o(S?M:v,null,r);return C&&"string"==typeof i?b(i,_,E):i}})},function(t,e,n){"use strict";var r=n(2),i=n(52),o=n(8),a=n(29),s=n(13),u=r([].push);t.exports=function(t){if(o(t))return t;if(i(t)){for(var e=t.length,n=[],r=0;r<e;r++){var c=t[r];"string"==typeof c?u(n,c):"number"!=typeof c&&"Number"!==a(c)&&"String"!==a(c)||u(n,s(c))}var l=n.length,h=!0;return function(t,e){if(h)return h=!1,e;if(i(this))return e;for(var r=0;r<l;r++)if(n[r]===t)return e}}}},function(t,e,n){"use strict";var r=n(0),i=n(66),o=n(1),a=n(97),s=n(14);r({target:"Object",stat:!0,forced:!i||o((function(){a.f(1)}))},{getOwnPropertySymbols:function(t){var e=a.f;return e?e(s(t)):[]}})},function(t,e,n){"use strict";var r=n(0),i=n(4),o=n(3),a=n(2),s=n(12),u=n(8),c=n(36),l=n(13),h=n(38),f=n(119),d=o.Symbol,p=d&&d.prototype;if(i&&u(d)&&(!("description"in p)||void 0!==d().description)){var v={},m=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:l(arguments[0]),e=c(p,this)?new d(t):void 0===t?d():d(t);return""===t&&(v[e]=!0),e};f(m,d),m.prototype=p,p.constructor=m;var g="Symbol(description detection)"===String(d("description detection")),y=a(p.valueOf),b=a(p.toString),w=/^Symbol\((.*)\)[^)]+$/,_=a("".replace),x=a("".slice);h(p,"description",{configurable:!0,get:function(){var t=y(this);if(s(v,t))return"";var e=b(t),n=g?x(e,7,-1):_(e,w,"$1");return""===n?void 0:n}}),r({global:!0,constructor:!0,forced:!0},{Symbol:m})}},function(t,e,n){"use strict";n(26)("asyncIterator")},function(t,e,n){"use strict";n(26)("hasInstance")},function(t,e,n){"use strict";n(26)("isConcatSpreadable")},function(t,e,n){"use strict";n(26)("iterator")},function(t,e,n){"use strict";n(26)("match")},function(t,e,n){"use strict";n(26)("replace")},function(t,e,n){"use strict";n(26)("search")},function(t,e,n){"use strict";n(26)("species")},function(t,e,n){"use strict";n(26)("split")},function(t,e,n){"use strict";var r=n(26),i=n(166);r("toPrimitive"),i()},function(t,e,n){"use strict";var r=n(25),i=n(26),o=n(33);i("toStringTag"),o(r("Symbol"),"Symbol")},function(t,e,n){"use strict";n(26)("unscopables")},function(t,e,n){"use strict";var r=n(0),i=n(1),o=n(52),a=n(6),s=n(14),u=n(17),c=n(125),l=n(62),h=n(82),f=n(84),d=n(7),p=n(50),v=d("isConcatSpreadable"),m=p>=51||!i((function(){var t=[];return t[v]=!1,t.concat()[0]!==t})),g=function(t){if(!a(t))return!1;var e=t[v];return void 0!==e?!!e:o(t)};r({target:"Array",proto:!0,arity:1,forced:!m||!f("concat")},{concat:function(t){var e,n,r,i,o,a=s(this),f=h(a,0),d=0;for(e=-1,r=arguments.length;e<r;e++)if(g(o=-1===e?a:arguments[e]))for(i=u(o),c(d+i),n=0;n<i;n++,d++)n in o&&l(f,d,o[n]);else c(d+1),l(f,d++,o);return f.length=d,f}})},function(t,e,n){"use strict";var r=n(0),i=n(168),o=n(53);r({target:"Array",proto:!0},{copyWithin:i}),o("copyWithin")},function(t,e,n){"use strict";var r=n(0),i=n(19).every;r({target:"Array",proto:!0,forced:!n(46)("every")},{every:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";var r=n(0),i=n(127),o=n(53);r({target:"Array",proto:!0},{fill:i}),o("fill")},function(t,e,n){"use strict";var r=n(0),i=n(19).filter;r({target:"Array",proto:!0,forced:!n(84)("filter")},{filter:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";var r=n(0),i=n(19).find,o=n(53),a="find",s=!0;a in[]&&Array(1).find((function(){s=!1})),r({target:"Array",proto:!0,forced:s},{find:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),o(a)},function(t,e,n){"use strict";var r=n(0),i=n(19).findIndex,o=n(53),a="findIndex",s=!0;a in[]&&Array(1).findIndex((function(){s=!1})),r({target:"Array",proto:!0,forced:s},{findIndex:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),o(a)},function(t,e,n){"use strict";var r=n(0),i=n(169),o=n(14),a=n(17),s=n(30),u=n(82);r({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,e=o(this),n=a(e),r=u(e,0);return r.length=i(r,e,e,n,0,void 0===t?1:s(t)),r}})},function(t,e,n){"use strict";var r=n(0),i=n(169),o=n(18),a=n(14),s=n(17),u=n(82);r({target:"Array",proto:!0},{flatMap:function(t){var e,n=a(this),r=s(n);return o(t),(e=u(n,0)).length=i(e,n,n,r,0,1,t,arguments.length>1?arguments[1]:void 0),e}})},function(t,e,n){"use strict";var r=n(0),i=n(170);r({target:"Array",proto:!0,forced:[].forEach!==i},{forEach:i})},function(t,e,n){"use strict";var r=n(0),i=n(171);r({target:"Array",stat:!0,forced:!n(99)((function(t){Array.from(t)}))},{from:i})},function(t,e,n){"use strict";var r=n(5),i=n(172);t.exports=function(t,e,n,o){try{return o?e(r(n)[0],n[1]):e(n)}catch(a){i(t,"throw",a)}}},function(t,e,n){"use strict";var r=n(0),i=n(79).includes,o=n(1),a=n(53);r({target:"Array",proto:!0,forced:o((function(){return!Array(1).includes()}))},{includes:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),a("includes")},function(t,e,n){"use strict";var r=n(0),i=n(61),o=n(79).indexOf,a=n(46),s=i([].indexOf),u=!!s&&1/s([1],1,-0)<0;r({target:"Array",proto:!0,forced:u||!a("indexOf")},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return u?s(this,t,e)||0:o(this,t,e)}})},function(t,e,n){"use strict";n(0)({target:"Array",stat:!0},{isArray:n(52)})},function(t,e,n){"use strict";var r=n(2),i=n(18);t.exports=function(t,e,n){try{return r(i(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(o){}}},function(t,e,n){"use strict";var r=n(6);t.exports=function(t){return r(t)||null===t}},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(76),a=n(23),s=n(46),u=i([].join);r({target:"Array",proto:!0,forced:o!==Object||!s("join",",")},{join:function(t){return u(a(this),void 0===t?",":t)}})},function(t,e,n){"use strict";var r=n(0),i=n(176);r({target:"Array",proto:!0,forced:i!==[].lastIndexOf},{lastIndexOf:i})},function(t,e,n){"use strict";var r=n(0),i=n(19).map;r({target:"Array",proto:!0,forced:!n(84)("map")},{map:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";var r=n(0),i=n(1),o=n(83),a=n(62),s=Array;r({target:"Array",stat:!0,forced:i((function(){function t(){}return!(s.of.call(t)instanceof t)}))},{of:function(){for(var t=0,e=arguments.length,n=new(o(this)?this:s)(e);e>t;)a(n,t,arguments[t++]);return n.length=e,n}})},function(t,e,n){"use strict";var r=n(0),i=n(102).left,o=n(46),a=n(50);r({target:"Array",proto:!0,forced:!n(69)&&a>79&&a<83||!o("reduce")},{reduce:function(t){var e=arguments.length;return i(this,t,e,e>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";var r=n(0),i=n(102).right,o=n(46),a=n(50);r({target:"Array",proto:!0,forced:!n(69)&&a>79&&a<83||!o("reduceRight")},{reduceRight:function(t){return i(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(52),a=i([].reverse),s=[1,2];r({target:"Array",proto:!0,forced:String(s)===String(s.reverse())},{reverse:function(){return o(this)&&(this.length=this.length),a(this)}})},function(t,e,n){"use strict";var r=n(0),i=n(52),o=n(83),a=n(6),s=n(51),u=n(17),c=n(23),l=n(62),h=n(7),f=n(84),d=n(32),p=f("slice"),v=h("species"),m=Array,g=Math.max;r({target:"Array",proto:!0,forced:!p},{slice:function(t,e){var n,r,h,f=c(this),p=u(f),y=s(t,p),b=s(void 0===e?p:e,p);if(i(f)&&(n=f.constructor,(o(n)&&(n===m||i(n.prototype))||a(n)&&null===(n=n[v]))&&(n=void 0),n===m||void 0===n))return d(f,y,b);for(r=new(void 0===n?m:n)(g(b-y,0)),h=0;y<b;y++,h++)y in f&&l(r,h,f[y]);return r.length=h,r}})},function(t,e,n){"use strict";var r=n(0),i=n(19).some;r({target:"Array",proto:!0,forced:!n(46)("some")},{some:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(18),a=n(14),s=n(17),u=n(126),c=n(13),l=n(1),h=n(131),f=n(46),d=n(177),p=n(178),v=n(50),m=n(132),g=[],y=i(g.sort),b=i(g.push),w=l((function(){g.sort(void 0)})),_=l((function(){g.sort(null)})),x=f("sort"),k=!l((function(){if(v)return v<70;if(!(d&&d>3)){if(p)return!0;if(m)return m<603;var t,e,n,r,i="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(r=0;r<47;r++)g.push({k:e+r,v:n})}for(g.sort((function(t,e){return e.v-t.v})),r=0;r<g.length;r++)e=g[r].k.charAt(0),i.charAt(i.length-1)!==e&&(i+=e);return"DGBEFHACIJK"!==i}}));r({target:"Array",proto:!0,forced:w||!_||!x||!k},{sort:function(t){void 0!==t&&o(t);var e=a(this);if(k)return void 0===t?y(e):y(e,t);var n,r,i=[],l=s(e);for(r=0;r<l;r++)r in e&&b(i,e[r]);for(h(i,function(t){return function(e,n){return void 0===n?-1:void 0===e?1:void 0!==t?+t(e,n)||0:c(e)>c(n)?1:-1}}(t)),n=s(i),r=0;r<n;)e[r]=i[r++];for(;r<l;)u(e,r++);return e}})},function(t,e,n){"use strict";n(70)("Array")},function(t,e,n){"use strict";var r=n(0),i=n(14),o=n(51),a=n(30),s=n(17),u=n(288),c=n(125),l=n(82),h=n(62),f=n(126),d=n(84)("splice"),p=Math.max,v=Math.min;r({target:"Array",proto:!0,forced:!d},{splice:function(t,e){var n,r,d,m,g,y,b=i(this),w=s(b),_=o(t,w),x=arguments.length;for(0===x?n=r=0:1===x?(n=0,r=w-_):(n=x-2,r=v(p(a(e),0),w-_)),c(w+n-r),d=l(b,r),m=0;m<r;m++)(g=_+m)in b&&h(d,m,b[g]);if(d.length=r,n<r){for(m=_;m<w-r;m++)y=m+n,(g=m+r)in b?b[y]=b[g]:f(b,y);for(m=w;m>w-r+n;m--)f(b,m-1)}else if(n>r)for(m=w-r;m>_;m--)y=m+n-1,(g=m+r-1)in b?b[y]=b[g]:f(b,y);for(m=0;m<n;m++)b[m+_]=arguments[m+2];return u(b,w-r+n),d}})},function(t,e,n){"use strict";var r=n(4),i=n(52),o=TypeError,a=Object.getOwnPropertyDescriptor,s=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}();t.exports=s?function(t,e){if(i(t)&&!a(t,"length").writable)throw new o("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e}},function(t,e,n){"use strict";n(53)("flat")},function(t,e,n){"use strict";n(53)("flatMap")},function(t,e,n){"use strict";var r=n(0),i=n(3),o=n(103),a=n(70),s="ArrayBuffer",u=o.ArrayBuffer;r({global:!0,constructor:!0,forced:i.ArrayBuffer!==u},{ArrayBuffer:u}),a(s)},function(t,e,n){"use strict";var r=n(134),i=Math.abs,o=2220446049250313e-31,a=1/o;t.exports=function(t,e,n,s){var u=+t,c=i(u),l=r(u);if(c<s)return l*function(t){return t+a-a}(c/s/e)*s*e;var h=(1+e/o)*c,f=h-(h-c);return f>n||f!==f?l*(1/0):l*f}},function(t,e,n){"use strict";var r=Array,i=Math.abs,o=Math.pow,a=Math.floor,s=Math.log,u=Math.LN2;t.exports={pack:function(t,e,n){var c,l,h,f=r(n),d=8*n-e-1,p=(1<<d)-1,v=p>>1,m=23===e?o(2,-24)-o(2,-77):0,g=t<0||0===t&&1/t<0?1:0,y=0;for((t=i(t))!==t||t===1/0?(l=t!==t?1:0,c=p):(c=a(s(t)/u),t*(h=o(2,-c))<1&&(c--,h*=2),(t+=c+v>=1?m/h:m*o(2,1-v))*h>=2&&(c++,h/=2),c+v>=p?(l=0,c=p):c+v>=1?(l=(t*h-1)*o(2,e),c+=v):(l=t*o(2,v-1)*o(2,e),c=0));e>=8;)f[y++]=255&l,l/=256,e-=8;for(c=c<<e|l,d+=e;d>0;)f[y++]=255&c,c/=256,d-=8;return f[--y]|=128*g,f},unpack:function(t,e){var n,r=t.length,i=8*r-e-1,a=(1<<i)-1,s=a>>1,u=i-7,c=r-1,l=t[c--],h=127&l;for(l>>=7;u>0;)h=256*h+t[c--],u-=8;for(n=h&(1<<-u)-1,h>>=-u,u+=e;u>0;)n=256*n+t[c--],u-=8;if(0===h)h=1-s;else{if(h===a)return n?NaN:l?-1/0:1/0;n+=o(2,e),h-=s}return(l?-1:1)*n*o(2,h-e)}}},function(t,e,n){"use strict";var r=n(0),i=n(10);r({target:"ArrayBuffer",stat:!0,forced:!i.NATIVE_ARRAY_BUFFER_VIEWS},{isView:i.isView})},function(t,e,n){"use strict";var r=n(0),i=n(61),o=n(1),a=n(103),s=n(5),u=n(51),c=n(31),l=n(89),h=a.ArrayBuffer,f=a.DataView,d=f.prototype,p=i(h.prototype.slice),v=i(d.getUint8),m=i(d.setUint8);r({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:o((function(){return!new h(2).slice(1,void 0).byteLength}))},{slice:function(t,e){if(p&&void 0===e)return p(s(this),t);for(var n=s(this).byteLength,r=u(t,n),i=u(void 0===e?n:e,n),o=new(l(this,h))(c(i-r)),a=new f(this),d=new f(o),g=0;r<i;)m(d,g++,v(a,r++));return o}})},function(t,e,n){"use strict";n(297)},function(t,e,n){"use strict";var r=n(0),i=n(103);r({global:!0,constructor:!0,forced:!n(133)},{DataView:i.DataView})},function(t,e,n){"use strict";var r=n(0),i=n(2),o=Date,a=i(o.prototype.getTime);r({target:"Date",stat:!0},{now:function(){return a(new o)}})},function(t,e,n){"use strict";var r=n(0),i=n(300);r({target:"Date",proto:!0,forced:Date.prototype.toISOString!==i},{toISOString:i})},function(t,e,n){"use strict";var r=n(2),i=n(1),o=n(136).start,a=RangeError,s=isFinite,u=Math.abs,c=Date.prototype,l=c.toISOString,h=r(c.getTime),f=r(c.getUTCDate),d=r(c.getUTCFullYear),p=r(c.getUTCHours),v=r(c.getUTCMilliseconds),m=r(c.getUTCMinutes),g=r(c.getUTCMonth),y=r(c.getUTCSeconds);t.exports=i((function(){return"0385-07-25T07:06:39.999Z"!==l.call(new Date(-50000000000001))}))||!i((function(){l.call(new Date(NaN))}))?function(){if(!s(h(this)))throw new a("Invalid time value");var t=this,e=d(t),n=v(t),r=e<0?"-":e>9999?"+":"";return r+o(u(e),r?6:4,0)+"-"+o(g(t)+1,2,0)+"-"+o(f(t),2,0)+"T"+o(p(t),2,0)+":"+o(m(t),2,0)+":"+o(y(t),2,0)+"."+o(n,3,0)+"Z"}:l},function(t,e,n){"use strict";var r=n(0),i=n(1),o=n(14),a=n(94);r({target:"Date",proto:!0,arity:1,forced:i((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}))},{toJSON:function(t){var e=o(this),n=a(e,"number");return"number"!=typeof n||isFinite(n)?e.toISOString():null}})},function(t,e,n){"use strict";var r=n(12),i=n(16),o=n(303),a=n(7)("toPrimitive"),s=Date.prototype;r(s,a)||i(s,a,o)},function(t,e,n){"use strict";var r=n(5),i=n(157),o=TypeError;t.exports=function(t){if(r(this),"string"===t||"default"===t)t="string";else if("number"!==t)throw new o("Incorrect hint");return i(this,t)}},function(t,e,n){"use strict";var r=n(2),i=n(16),o=Date.prototype,a="Invalid Date",s="toString",u=r(o.toString),c=r(o.getTime);String(new Date(NaN))!==a&&i(o,s,(function(){var t=c(this);return t===t?u(this):a}))},function(t,e,n){"use strict";var r=n(0),i=n(181);r({target:"Function",proto:!0,forced:Function.bind!==i},{bind:i})},function(t,e,n){"use strict";var r=n(8),i=n(6),o=n(15),a=n(36),s=n(7),u=n(117),c=s("hasInstance"),l=Function.prototype;c in l||o.f(l,c,{value:u((function(t){if(!r(this)||!i(t))return!1;var e=this.prototype;return i(e)?a(e,t):t instanceof this}),c)})},function(t,e,n){"use strict";var r=n(4),i=n(68).EXISTS,o=n(2),a=n(38),s=Function.prototype,u=o(s.toString),c=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,l=o(c.exec);r&&!i&&a(s,"name",{configurable:!0,get:function(){try{return l(c,u(this))[1]}catch(t){return""}}})},function(t,e,n){"use strict";var r=n(3);n(33)(r.JSON,"JSON",!0)},function(t,e,n){"use strict";n(310)},function(t,e,n){"use strict";n(104)("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),n(182))},function(t,e,n){"use strict";var r=n(0),i=n(183),o=Math.acosh,a=Math.log,s=Math.sqrt,u=Math.LN2;r({target:"Math",stat:!0,forced:!o||710!==Math.floor(o(Number.MAX_VALUE))||o(1/0)!==1/0},{acosh:function(t){var e=+t;return e<1?NaN:e>94906265.62425156?a(e)+u:i(e-1+s(e-1)*s(e+1))}})},function(t,e,n){"use strict";var r=n(0),i=Math.asinh,o=Math.log,a=Math.sqrt;r({target:"Math",stat:!0,forced:!(i&&1/i(0)>0)},{asinh:function t(e){var n=+e;return isFinite(n)&&0!==n?n<0?-t(-n):o(n+a(n*n+1)):n}})},function(t,e,n){"use strict";var r=n(0),i=Math.atanh,o=Math.log;r({target:"Math",stat:!0,forced:!(i&&1/i(-0)<0)},{atanh:function(t){var e=+t;return 0===e?e:o((1+e)/(1-e))/2}})},function(t,e,n){"use strict";var r=n(0),i=n(134),o=Math.abs,a=Math.pow;r({target:"Math",stat:!0},{cbrt:function(t){var e=+t;return i(e)*a(o(e),1/3)}})},function(t,e,n){"use strict";var r=n(0),i=Math.floor,o=Math.log,a=Math.LOG2E;r({target:"Math",stat:!0},{clz32:function(t){var e=t>>>0;return e?31-i(o(e+.5)*a):32}})},function(t,e,n){"use strict";var r=n(0),i=n(105),o=Math.cosh,a=Math.abs,s=Math.E;r({target:"Math",stat:!0,forced:!o||o(710)===1/0},{cosh:function(t){var e=i(a(t)-1)+1;return(e+1/(e*s*s))*(s/2)}})},function(t,e,n){"use strict";var r=n(0),i=n(105);r({target:"Math",stat:!0,forced:i!==Math.expm1},{expm1:i})},function(t,e,n){"use strict";n(0)({target:"Math",stat:!0},{fround:n(180)})},function(t,e,n){"use strict";var r=n(0),i=Math.hypot,o=Math.abs,a=Math.sqrt;r({target:"Math",stat:!0,arity:2,forced:!!i&&i(1/0,NaN)!==1/0},{hypot:function(t,e){for(var n,r,i=0,s=0,u=arguments.length,c=0;s<u;)c<(n=o(arguments[s++]))?(i=i*(r=c/n)*r+1,c=n):i+=n>0?(r=n/c)*r:n;return c===1/0?1/0:c*a(i)}})},function(t,e,n){"use strict";var r=n(0),i=n(1),o=Math.imul;r({target:"Math",stat:!0,forced:i((function(){return-5!==o(4294967295,5)||2!==o.length}))},{imul:function(t,e){var n=65535,r=+t,i=+e,o=n&r,a=n&i;return 0|o*a+((n&r>>>16)*a+o*(n&i>>>16)<<16>>>0)}})},function(t,e,n){"use strict";n(0)({target:"Math",stat:!0},{log10:n(322)})},function(t,e,n){"use strict";var r=Math.log,i=Math.LOG10E;t.exports=Math.log10||function(t){return r(t)*i}},function(t,e,n){"use strict";n(0)({target:"Math",stat:!0},{log1p:n(183)})},function(t,e,n){"use strict";var r=n(0),i=Math.log,o=Math.LN2;r({target:"Math",stat:!0},{log2:function(t){return i(t)/o}})},function(t,e,n){"use strict";n(0)({target:"Math",stat:!0},{sign:n(134)})},function(t,e,n){"use strict";var r=n(0),i=n(1),o=n(105),a=Math.abs,s=Math.exp,u=Math.E;r({target:"Math",stat:!0,forced:i((function(){return-2e-17!==Math.sinh(-2e-17)}))},{sinh:function(t){var e=+t;return a(e)<1?(o(e)-o(-e))/2:(s(e-1)-s(-e-1))*(u/2)}})},function(t,e,n){"use strict";var r=n(0),i=n(105),o=Math.exp;r({target:"Math",stat:!0},{tanh:function(t){var e=+t,n=i(e),r=i(-e);return n===1/0?1:r===1/0?-1:(n-r)/(o(e)+o(-e))}})},function(t,e,n){"use strict";n(33)(Math,"Math",!0)},function(t,e,n){"use strict";n(0)({target:"Math",stat:!0},{trunc:n(162)})},function(t,e,n){"use strict";var r=n(0),i=n(21),o=n(4),a=n(3),s=n(165),u=n(2),c=n(80),l=n(12),h=n(88),f=n(36),d=n(65),p=n(94),v=n(1),m=n(60).f,g=n(20).f,y=n(15).f,b=n(140),w=n(73).trim,_="Number",x=a.Number,k=s.Number,S=x.prototype,C=a.TypeError,M=u("".slice),E=u("".charCodeAt),T=function(t){var e=p(t,"number");return"bigint"==typeof e?e:A(e)},A=function(t){var e,n,r,i,o,a,s,u,c=p(t,"number");if(d(c))throw new C("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=w(c),43===(e=E(c,0))||45===e){if(88===(n=E(c,2))||120===n)return NaN}else if(48===e){switch(E(c,1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+c}for(a=(o=M(c,2)).length,s=0;s<a;s++)if((u=E(o,s))<48||u>i)return NaN;return parseInt(o,r)}return+c},O=c(_,!x(" 0o1")||!x("0b1")||x("+0x1")),D=function(t){return f(S,t)&&v((function(){b(t)}))},P=function(t){var e=arguments.length<1?0:x(T(t));return D(this)?h(Object(e),this,P):e};P.prototype=S,O&&!i&&(S.constructor=P),r({global:!0,constructor:!0,wrap:!0,forced:O},{Number:P});var L=function(t,e){for(var n,r=o?m(e):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),i=0;r.length>i;i++)l(e,n=r[i])&&!l(t,n)&&y(t,n,g(e,n))};i&&k&&L(s.Number,k),(O||i)&&L(s.Number,x)},function(t,e,n){"use strict";n(0)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)})},function(t,e,n){"use strict";n(0)({target:"Number",stat:!0},{isFinite:n(333)})},function(t,e,n){"use strict";var r=n(3).isFinite;t.exports=Number.isFinite||function(t){return"number"==typeof t&&r(t)}},function(t,e,n){"use strict";n(0)({target:"Number",stat:!0},{isInteger:n(141)})},function(t,e,n){"use strict";n(0)({target:"Number",stat:!0},{isNaN:function(t){return t!==t}})},function(t,e,n){"use strict";var r=n(0),i=n(141),o=Math.abs;r({target:"Number",stat:!0},{isSafeInteger:function(t){return i(t)&&o(t)<=9007199254740991}})},function(t,e,n){"use strict";n(0)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991})},function(t,e,n){"use strict";n(0)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991})},function(t,e,n){"use strict";var r=n(0),i=n(184);r({target:"Number",stat:!0,forced:Number.parseFloat!==i},{parseFloat:i})},function(t,e,n){"use strict";var r=n(0),i=n(185);r({target:"Number",stat:!0,forced:Number.parseInt!==i},{parseInt:i})},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(30),a=n(140),s=n(137),u=n(1),c=RangeError,l=String,h=Math.floor,f=i(s),d=i("".slice),p=i(1..toFixed),v=function(t,e,n){return 0===e?n:e%2===1?v(t,e-1,n*t):v(t*t,e/2,n)},m=function(t,e,n){for(var r=-1,i=n;++r<6;)i+=e*t[r],t[r]=i%1e7,i=h(i/1e7)},g=function(t,e){for(var n=6,r=0;--n>=0;)r+=t[n],t[n]=h(r/e),r=r%e*1e7},y=function(t){for(var e=6,n="";--e>=0;)if(""!==n||0===e||0!==t[e]){var r=l(t[e]);n=""===n?r:n+f("0",7-r.length)+r}return n};r({target:"Number",proto:!0,forced:u((function(){return"0.000"!==p(8e-5,3)||"1"!==p(.9,0)||"1.25"!==p(1.255,2)||"1000000000000000128"!==p(0xde0b6b3a7640080,0)}))||!u((function(){p({})}))},{toFixed:function(t){var e,n,r,i,s=a(this),u=o(t),h=[0,0,0,0,0,0],p="",b="0";if(u<0||u>20)throw new c("Incorrect fraction digits");if(s!==s)return"NaN";if(s<=-1e21||s>=1e21)return l(s);if(s<0&&(p="-",s=-s),s>1e-21)if(n=(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(s*v(2,69,1))-69)<0?s*v(2,-e,1):s/v(2,e,1),n*=4503599627370496,(e=52-e)>0){for(m(h,0,n),r=u;r>=7;)m(h,1e7,0),r-=7;for(m(h,v(10,r,1),0),r=e-1;r>=23;)g(h,1<<23),r-=23;g(h,1<<r),m(h,1,1),g(h,2),b=y(h)}else m(h,0,n),m(h,1<<-e,0),b=y(h)+f("0",u);return b=u>0?p+((i=b.length)<=u?"0."+f("0",u-i)+b:d(b,0,i-u)+"."+d(b,i-u)):p+b}})},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(1),a=n(140),s=i(1..toPrecision);r({target:"Number",proto:!0,forced:o((function(){return"1"!==s(1,void 0)}))||!o((function(){s({})}))},{toPrecision:function(t){return void 0===t?s(a(this)):s(a(this),t)}})},function(t,e,n){"use strict";var r=n(0),i=n(186);r({target:"Object",stat:!0,arity:2,forced:Object.assign!==i},{assign:i})},function(t,e,n){"use strict";n(0)({target:"Object",stat:!0,sham:!n(4)},{create:n(37)})},function(t,e,n){"use strict";var r=n(0),i=n(4),o=n(107),a=n(18),s=n(14),u=n(15);i&&r({target:"Object",proto:!0,forced:o},{__defineGetter__:function(t,e){u.f(s(this),t,{get:a(e),enumerable:!0,configurable:!0})}})},function(t,e,n){"use strict";var r=n(0),i=n(4),o=n(123).f;r({target:"Object",stat:!0,forced:Object.defineProperties!==o,sham:!i},{defineProperties:o})},function(t,e,n){"use strict";var r=n(0),i=n(4),o=n(15).f;r({target:"Object",stat:!0,forced:Object.defineProperty!==o,sham:!i},{defineProperty:o})},function(t,e,n){"use strict";var r=n(0),i=n(4),o=n(107),a=n(18),s=n(14),u=n(15);i&&r({target:"Object",proto:!0,forced:o},{__defineSetter__:function(t,e){u.f(s(this),t,{set:a(e),enumerable:!0,configurable:!0})}})},function(t,e,n){"use strict";var r=n(0),i=n(187).entries;r({target:"Object",stat:!0},{entries:function(t){return i(t)}})},function(t,e,n){"use strict";var r=n(0),i=n(71),o=n(1),a=n(6),s=n(63).onFreeze,u=Object.freeze;r({target:"Object",stat:!0,forced:o((function(){u(1)})),sham:!i},{freeze:function(t){return u&&a(t)?u(s(t)):t}})},function(t,e,n){"use strict";var r=n(0),i=n(72),o=n(62);r({target:"Object",stat:!0},{fromEntries:function(t){var e={};return i(t,(function(t,n){o(e,t,n)}),{AS_ENTRIES:!0}),e}})},function(t,e,n){"use strict";var r=n(0),i=n(1),o=n(23),a=n(20).f,s=n(4);r({target:"Object",stat:!0,forced:!s||i((function(){a(1)})),sham:!s},{getOwnPropertyDescriptor:function(t,e){return a(o(t),e)}})},function(t,e,n){"use strict";var r=n(0),i=n(4),o=n(120),a=n(23),s=n(20),u=n(62);r({target:"Object",stat:!0,sham:!i},{getOwnPropertyDescriptors:function(t){for(var e,n,r=a(t),i=s.f,c=o(r),l={},h=0;c.length>h;)void 0!==(n=i(r,e=c[h++]))&&u(l,e,n);return l}})},function(t,e,n){"use strict";var r=n(0),i=n(1),o=n(124).f;r({target:"Object",stat:!0,forced:i((function(){return!Object.getOwnPropertyNames(1)}))},{getOwnPropertyNames:o})},function(t,e,n){"use strict";var r=n(0),i=n(1),o=n(14),a=n(39),s=n(130);r({target:"Object",stat:!0,forced:i((function(){a(1)})),sham:!s},{getPrototypeOf:function(t){return a(o(t))}})},function(t,e,n){"use strict";n(0)({target:"Object",stat:!0},{is:n(188)})},function(t,e,n){"use strict";var r=n(0),i=n(138);r({target:"Object",stat:!0,forced:Object.isExtensible!==i},{isExtensible:i})},function(t,e,n){"use strict";var r=n(0),i=n(1),o=n(6),a=n(29),s=n(139),u=Object.isFrozen;r({target:"Object",stat:!0,forced:s||i((function(){u(1)}))},{isFrozen:function(t){return!o(t)||(!(!s||"ArrayBuffer"!==a(t))||!!u&&u(t))}})},function(t,e,n){"use strict";var r=n(0),i=n(1),o=n(6),a=n(29),s=n(139),u=Object.isSealed;r({target:"Object",stat:!0,forced:s||i((function(){u(1)}))},{isSealed:function(t){return!o(t)||(!(!s||"ArrayBuffer"!==a(t))||!!u&&u(t))}})},function(t,e,n){"use strict";var r=n(0),i=n(14),o=n(81);r({target:"Object",stat:!0,forced:n(1)((function(){o(1)}))},{keys:function(t){return o(i(t))}})},function(t,e,n){"use strict";var r=n(0),i=n(4),o=n(107),a=n(14),s=n(49),u=n(39),c=n(20).f;i&&r({target:"Object",proto:!0,forced:o},{__lookupGetter__:function(t){var e,n=a(this),r=s(t);do{if(e=c(n,r))return e.get}while(n=u(n))}})},function(t,e,n){"use strict";var r=n(0),i=n(4),o=n(107),a=n(14),s=n(49),u=n(39),c=n(20).f;i&&r({target:"Object",proto:!0,forced:o},{__lookupSetter__:function(t){var e,n=a(this),r=s(t);do{if(e=c(n,r))return e.set}while(n=u(n))}})},function(t,e,n){"use strict";var r=n(0),i=n(6),o=n(63).onFreeze,a=n(71),s=n(1),u=Object.preventExtensions;r({target:"Object",stat:!0,forced:s((function(){u(1)})),sham:!a},{preventExtensions:function(t){return u&&i(t)?u(o(t)):t}})},function(t,e,n){"use strict";var r=n(0),i=n(6),o=n(63).onFreeze,a=n(71),s=n(1),u=Object.seal;r({target:"Object",stat:!0,forced:s((function(){u(1)})),sham:!a},{seal:function(t){return u&&i(t)?u(o(t)):t}})},function(t,e,n){"use strict";n(0)({target:"Object",stat:!0},{setPrototypeOf:n(54)})},function(t,e,n){"use strict";var r=n(122),i=n(16),o=n(367);r||i(Object.prototype,"toString",o,{unsafe:!0})},function(t,e,n){"use strict";var r=n(122),i=n(45);t.exports=r?{}.toString:function(){return"[object "+i(this)+"]"}},function(t,e,n){"use strict";var r=n(0),i=n(187).values;r({target:"Object",stat:!0},{values:function(t){return i(t)}})},function(t,e,n){"use strict";var r=n(0),i=n(184);r({global:!0,forced:parseFloat!==i},{parseFloat:i})},function(t,e,n){"use strict";var r=n(0),i=n(185);r({global:!0,forced:parseInt!==i},{parseInt:i})},function(t,e,n){"use strict";n(372),n(377),n(378),n(379),n(380),n(381)},function(t,e,n){"use strict";var r,i,o,a=n(0),s=n(21),u=n(69),c=n(3),l=n(9),h=n(16),f=n(54),d=n(33),p=n(70),v=n(18),m=n(8),g=n(6),y=n(55),b=n(89),w=n(108).set,_=n(190),x=n(375),k=n(142),S=n(192),C=n(22),M=n(74),E=n(91),T=n(92),A="Promise",O=E.CONSTRUCTOR,D=E.REJECTION_EVENT,P=E.SUBCLASSING,L=C.getterFor(A),N=C.set,R=M&&M.prototype,I=M,z=R,B=c.TypeError,j=c.document,F=c.process,q=T.f,$=q,V=!!(j&&j.createEvent&&c.dispatchEvent),U="unhandledrejection",H=function(t){var e;return!(!g(t)||!m(e=t.then))&&e},W=function(t,e){var n,r,i,o=e.value,a=1===e.state,s=a?t.ok:t.fail,u=t.resolve,c=t.reject,h=t.domain;try{s?(a||(2===e.rejection&&G(e),e.rejection=1),!0===s?n=o:(h&&h.enter(),n=s(o),h&&(h.exit(),i=!0)),n===t.promise?c(new B("Promise-chain cycle")):(r=H(n))?l(r,n,u,c):u(n)):c(o)}catch(f){h&&!i&&h.exit(),c(f)}},Z=function(t,e){t.notified||(t.notified=!0,_((function(){for(var n,r=t.reactions;n=r.get();)W(n,t);t.notified=!1,e&&!t.rejection&&Y(t)})))},J=function(t,e,n){var r,i;V?((r=j.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),c.dispatchEvent(r)):r={promise:e,reason:n},!D&&(i=c["on"+t])?i(r):t===U&&x("Unhandled promise rejection",n)},Y=function(t){l(w,c,(function(){var e,n=t.facade,r=t.value;if(K(t)&&(e=k((function(){u?F.emit("unhandledRejection",r,n):J(U,n,r)})),t.rejection=u||K(t)?2:1,e.error))throw e.value}))},K=function(t){return 1!==t.rejection&&!t.parent},G=function(t){l(w,c,(function(){var e=t.facade;u?F.emit("rejectionHandled",e):J("rejectionhandled",e,t.value)}))},X=function(t,e,n){return function(r){t(e,r,n)}},Q=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,Z(t,!0))},tt=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw new B("Promise can't be resolved itself");var r=H(e);r?_((function(){var n={done:!1};try{l(r,e,X(tt,n,t),X(Q,n,t))}catch(i){Q(n,i,t)}})):(t.value=e,t.state=1,Z(t,!1))}catch(i){Q({done:!1},i,t)}}};if(O&&(z=(I=function(t){y(this,z),v(t),l(r,this);var e=L(this);try{t(X(tt,e),X(Q,e))}catch(n){Q(e,n)}}).prototype,(r=function(t){N(this,{type:A,done:!1,notified:!1,parent:!1,reactions:new S,rejection:!1,state:0,value:void 0})}).prototype=h(z,"then",(function(t,e){var n=L(this),r=q(b(this,I));return n.parent=!0,r.ok=!m(t)||t,r.fail=m(e)&&e,r.domain=u?F.domain:void 0,0===n.state?n.reactions.add(r):_((function(){W(r,n)})),r.promise})),i=function(){var t=new r,e=L(t);this.promise=t,this.resolve=X(tt,e),this.reject=X(Q,e)},T.f=q=function(t){return t===I||undefined===t?new i(t):$(t)},!s&&m(M)&&R!==Object.prototype)){o=R.then,P||h(R,"then",(function(t,e){var n=this;return new I((function(t,e){l(o,n,t,e)})).then(t,e)}),{unsafe:!0});try{delete R.constructor}catch(et){}f&&f(R,z)}a({global:!0,constructor:!0,wrap:!0,forced:O},{Promise:I}),d(I,A,!1,!0),p(A)},function(t,e,n){"use strict";var r=n(44);t.exports=/ipad|iphone|ipod/i.test(r)&&"undefined"!=typeof Pebble},function(t,e,n){"use strict";var r=n(44);t.exports=/web0s(?!.*chrome)/i.test(r)},function(t,e,n){"use strict";t.exports=function(t,e){try{1===arguments.length?console.error(t):console.error(t,e)}catch(n){}}},function(t,e,n){"use strict";var r=n(193),i=n(69);t.exports=!r&&!i&&"object"==typeof window&&"object"==typeof document},function(t,e,n){"use strict";var r=n(0),i=n(9),o=n(18),a=n(92),s=n(142),u=n(72);r({target:"Promise",stat:!0,forced:n(194)},{all:function(t){var e=this,n=a.f(e),r=n.resolve,c=n.reject,l=s((function(){var n=o(e.resolve),a=[],s=0,l=1;u(t,(function(t){var o=s++,u=!1;l++,i(n,e,t).then((function(t){u||(u=!0,a[o]=t,--l||r(a))}),c)})),--l||r(a)}));return l.error&&c(l.value),n.promise}})},function(t,e,n){"use strict";var r=n(0),i=n(21),o=n(91).CONSTRUCTOR,a=n(74),s=n(25),u=n(8),c=n(16),l=a&&a.prototype;if(r({target:"Promise",proto:!0,forced:o,real:!0},{catch:function(t){return this.then(void 0,t)}}),!i&&u(a)){var h=s("Promise").prototype.catch;l.catch!==h&&c(l,"catch",h,{unsafe:!0})}},function(t,e,n){"use strict";var r=n(0),i=n(9),o=n(18),a=n(92),s=n(142),u=n(72);r({target:"Promise",stat:!0,forced:n(194)},{race:function(t){var e=this,n=a.f(e),r=n.reject,c=s((function(){var a=o(e.resolve);u(t,(function(t){i(a,e,t).then(n.resolve,r)}))}));return c.error&&r(c.value),n.promise}})},function(t,e,n){"use strict";var r=n(0),i=n(92);r({target:"Promise",stat:!0,forced:n(91).CONSTRUCTOR},{reject:function(t){var e=i.f(this);return(0,e.reject)(t),e.promise}})},function(t,e,n){"use strict";var r=n(0),i=n(25),o=n(21),a=n(74),s=n(91).CONSTRUCTOR,u=n(195),c=i("Promise"),l=o&&!s;r({target:"Promise",stat:!0,forced:o||s},{resolve:function(t){return u(l&&this===c?a:this,t)}})},function(t,e,n){"use strict";var r=n(0),i=n(21),o=n(74),a=n(1),s=n(25),u=n(8),c=n(89),l=n(195),h=n(16),f=o&&o.prototype;if(r({target:"Promise",proto:!0,real:!0,forced:!!o&&a((function(){f.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var e=c(this,s("Promise")),n=u(t);return this.then(n?function(n){return l(e,t()).then((function(){return n}))}:t,n?function(n){return l(e,t()).then((function(){throw n}))}:t)}}),!i&&u(o)){var d=s("Promise").prototype.finally;f.finally!==d&&h(f,"finally",d,{unsafe:!0})}},function(t,e,n){"use strict";var r=n(0),i=n(42),o=n(18),a=n(5);r({target:"Reflect",stat:!0,forced:!n(1)((function(){Reflect.apply((function(){}))}))},{apply:function(t,e,n){return i(o(t),e,a(n))}})},function(t,e,n){"use strict";var r=n(0),i=n(25),o=n(42),a=n(181),s=n(135),u=n(5),c=n(6),l=n(37),h=n(1),f=i("Reflect","construct"),d=Object.prototype,p=[].push,v=h((function(){function t(){}return!(f((function(){}),[],t)instanceof t)})),m=!h((function(){f((function(){}))})),g=v||m;r({target:"Reflect",stat:!0,forced:g,sham:g},{construct:function(t,e){s(t),u(e);var n=arguments.length<3?t:s(arguments[2]);if(m&&!v)return f(t,e,n);if(t===n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var r=[null];return o(p,r,e),new(o(a,t,r))}var i=n.prototype,h=l(c(i)?i:d),g=o(t,h,e);return c(g)?g:h}})},function(t,e,n){"use strict";var r=n(0),i=n(4),o=n(5),a=n(49),s=n(15);r({target:"Reflect",stat:!0,forced:n(1)((function(){Reflect.defineProperty(s.f({},1,{value:1}),1,{value:2})})),sham:!i},{defineProperty:function(t,e,n){o(t);var r=a(e);o(n);try{return s.f(t,r,n),!0}catch(i){return!1}}})},function(t,e,n){"use strict";var r=n(0),i=n(5),o=n(20).f;r({target:"Reflect",stat:!0},{deleteProperty:function(t,e){var n=o(i(t),e);return!(n&&!n.configurable)&&delete t[e]}})},function(t,e,n){"use strict";var r=n(0),i=n(9),o=n(6),a=n(5),s=n(196),u=n(20),c=n(39);r({target:"Reflect",stat:!0},{get:function t(e,n){var r,l,h=arguments.length<3?e:arguments[2];return a(e)===h?e[n]:(r=u.f(e,n))?s(r)?r.value:void 0===r.get?void 0:i(r.get,h):o(l=c(e))?t(l,n,h):void 0}})},function(t,e,n){"use strict";var r=n(0),i=n(4),o=n(5),a=n(20);r({target:"Reflect",stat:!0,sham:!i},{getOwnPropertyDescriptor:function(t,e){return a.f(o(t),e)}})},function(t,e,n){"use strict";var r=n(0),i=n(5),o=n(39);r({target:"Reflect",stat:!0,sham:!n(130)},{getPrototypeOf:function(t){return o(i(t))}})},function(t,e,n){"use strict";n(0)({target:"Reflect",stat:!0},{has:function(t,e){return e in t}})},function(t,e,n){"use strict";var r=n(0),i=n(5),o=n(138);r({target:"Reflect",stat:!0},{isExtensible:function(t){return i(t),o(t)}})},function(t,e,n){"use strict";n(0)({target:"Reflect",stat:!0},{ownKeys:n(120)})},function(t,e,n){"use strict";var r=n(0),i=n(25),o=n(5);r({target:"Reflect",stat:!0,sham:!n(71)},{preventExtensions:function(t){o(t);try{var e=i("Object","preventExtensions");return e&&e(t),!0}catch(n){return!1}}})},function(t,e,n){"use strict";var r=n(0),i=n(9),o=n(5),a=n(6),s=n(196),u=n(1),c=n(15),l=n(20),h=n(39),f=n(48);r({target:"Reflect",stat:!0,forced:u((function(){var t=function(){},e=c.f(new t,"a",{configurable:!0});return!1!==Reflect.set(t.prototype,"a",1,e)}))},{set:function t(e,n,r){var u,d,p,v=arguments.length<4?e:arguments[3],m=l.f(o(e),n);if(!m){if(a(d=h(e)))return t(d,n,r,v);m=f(0)}if(s(m)){if(!1===m.writable||!a(v))return!1;if(u=l.f(v,n)){if(u.get||u.set||!1===u.writable)return!1;u.value=r,c.f(v,n,u)}else c.f(v,n,f(0,r))}else{if(void 0===(p=m.set))return!1;i(p,v,r)}return!0}})},function(t,e,n){"use strict";var r=n(0),i=n(5),o=n(175),a=n(54);a&&r({target:"Reflect",stat:!0},{setPrototypeOf:function(t,e){i(t),o(e);try{return a(t,e),!0}catch(n){return!1}}})},function(t,e,n){"use strict";var r=n(4),i=n(3),o=n(2),a=n(80),s=n(88),u=n(40),c=n(37),l=n(60).f,h=n(36),f=n(143),d=n(13),p=n(197),v=n(145),m=n(397),g=n(16),y=n(1),b=n(12),w=n(22).enforce,_=n(70),x=n(7),k=n(198),S=n(199),C=x("match"),M=i.RegExp,E=M.prototype,T=i.SyntaxError,A=o(E.exec),O=o("".charAt),D=o("".replace),P=o("".indexOf),L=o("".slice),N=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,R=/a/g,I=/a/g,z=new M(R)!==R,B=v.MISSED_STICKY,j=v.UNSUPPORTED_Y,F=r&&(!z||B||k||S||y((function(){return I[C]=!1,M(R)!==R||M(I)===I||"/a/i"!==String(M(R,"i"))})));if(a("RegExp",F)){for(var q=function(t,e){var n,r,i,o,a,l,v=h(E,this),m=f(t),g=void 0===e,y=[],_=t;if(!v&&m&&g&&t.constructor===q)return t;if((m||h(E,t))&&(t=t.source,g&&(e=p(_))),t=void 0===t?"":d(t),e=void 0===e?"":d(e),_=t,k&&"dotAll"in R&&(r=!!e&&P(e,"s")>-1)&&(e=D(e,/s/g,"")),n=e,B&&"sticky"in R&&(i=!!e&&P(e,"y")>-1)&&j&&(e=D(e,/y/g,"")),S&&(t=(o=function(t){for(var e,n=t.length,r=0,i="",o=[],a=c(null),s=!1,u=!1,l=0,h="";r<=n;r++){if("\\"===(e=O(t,r)))e+=O(t,++r);else if("]"===e)s=!1;else if(!s)switch(!0){case"["===e:s=!0;break;case"("===e:A(N,L(t,r+1))&&(r+=2,u=!0),i+=e,l++;continue;case">"===e&&u:if(""===h||b(a,h))throw new T("Invalid capture group name");a[h]=!0,o[o.length]=[h,l],u=!1,h="";continue}u?h+=e:i+=e}return[i,o]}(t))[0],y=o[1]),a=s(M(t,e),v?this:E,q),(r||i||y.length)&&(l=w(a),r&&(l.dotAll=!0,l.raw=q(function(t){for(var e,n=t.length,r=0,i="",o=!1;r<=n;r++)"\\"!==(e=O(t,r))?o||"."!==e?("["===e?o=!0:"]"===e&&(o=!1),i+=e):i+="[\\s\\S]":i+=e+O(t,++r);return i}(t),n)),i&&(l.sticky=!0),y.length&&(l.groups=y)),t!==_)try{u(a,"source",""===_?"(?:)":_)}catch(x){}return a},$=l(M),V=0;$.length>V;)m(q,M,$[V++]);E.constructor=q,q.prototype=E,g(i,"RegExp",q,{constructor:!0})}_("RegExp")},function(t,e,n){"use strict";var r=n(15).f;t.exports=function(t,e,n){n in t||r(t,n,{configurable:!0,get:function(){return e[n]},set:function(t){e[n]=t}})}},function(t,e,n){"use strict";var r=n(3),i=n(4),o=n(38),a=n(144),s=n(1),u=r.RegExp,c=u.prototype;i&&s((function(){var t=!0;try{u(".","d")}catch(s){t=!1}var e={},n="",r=t?"dgimsy":"gimsy",i=function(t,r){Object.defineProperty(e,t,{get:function(){return n+=r,!0}})},o={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var a in t&&(o.hasIndices="d"),o)i(a,o[a]);return Object.getOwnPropertyDescriptor(c,"flags").get.call(e)!==r||n!==r}))&&o(c,"flags",{configurable:!0,get:a})},function(t,e,n){"use strict";var r=n(68).PROPER,i=n(16),o=n(5),a=n(13),s=n(1),u=n(197),c="toString",l=RegExp.prototype,h=l.toString,f=s((function(){return"/a/b"!==h.call({source:"a",flags:"b"})})),d=r&&h.name!==c;(f||d)&&i(l,c,(function(){var t=o(this);return"/"+a(t.source)+"/"+a(u(t))}),{unsafe:!0})},function(t,e,n){"use strict";n(401)},function(t,e,n){"use strict";n(104)("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),n(182))},function(t,e,n){"use strict";var r=n(0),i=n(110).codeAt;r({target:"String",proto:!0},{codePointAt:function(t){return i(this,t)}})},function(t,e,n){"use strict";var r,i=n(0),o=n(61),a=n(20).f,s=n(31),u=n(13),c=n(146),l=n(24),h=n(147),f=n(21),d=o("".slice),p=Math.min,v=h("endsWith");i({target:"String",proto:!0,forced:!(!f&&!v&&!(!(r=a(String.prototype,"endsWith"))||r.writable))&&!v},{endsWith:function(t){var e=u(l(this));c(t);var n=arguments.length>1?arguments[1]:void 0,r=e.length,i=void 0===n?r:p(s(n),r),o=u(t);return d(e,i-o.length,i)===o}})},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(51),a=RangeError,s=String.fromCharCode,u=String.fromCodePoint,c=i([].join);r({target:"String",stat:!0,arity:1,forced:!!u&&1!==u.length},{fromCodePoint:function(t){for(var e,n=[],r=arguments.length,i=0;r>i;){if(e=+arguments[i++],o(e,1114111)!==e)throw new a(e+" is not a valid code point");n[i]=e<65536?s(e):s(55296+((e-=65536)>>10),e%1024+56320)}return c(n,"")}})},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(146),a=n(24),s=n(13),u=n(147),c=i("".indexOf);r({target:"String",proto:!0,forced:!u("includes")},{includes:function(t){return!!~c(s(a(this)),s(o(t)),arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";var r=n(9),i=n(111),o=n(5),a=n(35),s=n(31),u=n(13),c=n(24),l=n(58),h=n(148),f=n(112);i("match",(function(t,e,n){return[function(e){var n=c(this),i=a(e)?void 0:l(e,t);return i?r(i,e,n):new RegExp(e)[t](u(n))},function(t){var r=o(this),i=u(t),a=n(e,r,i);if(a.done)return a.value;if(!r.global)return f(r,i);var c=r.unicode;r.lastIndex=0;for(var l,d=[],p=0;null!==(l=f(r,i));){var v=u(l[0]);d[p]=v,""===v&&(r.lastIndex=h(i,s(r.lastIndex),c)),p++}return 0===p?null:d}]}))},function(t,e,n){"use strict";var r=n(0),i=n(136).end;r({target:"String",proto:!0,forced:n(202)},{padEnd:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";var r=n(0),i=n(136).start;r({target:"String",proto:!0,forced:n(202)},{padStart:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(23),a=n(14),s=n(13),u=n(17),c=i([].push),l=i([].join);r({target:"String",stat:!0},{raw:function(t){var e=o(a(t).raw),n=u(e);if(!n)return"";for(var r=arguments.length,i=[],h=0;;){if(c(i,s(e[h++])),h===n)return l(i,"");h<r&&c(i,s(arguments[h]))}}})},function(t,e,n){"use strict";n(0)({target:"String",proto:!0},{repeat:n(137)})},function(t,e,n){"use strict";var r=n(42),i=n(9),o=n(2),a=n(111),s=n(1),u=n(5),c=n(8),l=n(35),h=n(30),f=n(31),d=n(13),p=n(24),v=n(148),m=n(58),g=n(412),y=n(112),b=n(7)("replace"),w=Math.max,_=Math.min,x=o([].concat),k=o([].push),S=o("".indexOf),C=o("".slice),M="$0"==="a".replace(/./,"$0"),E=!!/./[b]&&""===/./[b]("a","$0");a("replace",(function(t,e,n){var o=E?"$":"$0";return[function(t,n){var r=p(this),o=l(t)?void 0:m(t,b);return o?i(o,t,r,n):i(e,d(r),t,n)},function(t,i){var a=u(this),s=d(t);if("string"==typeof i&&-1===S(i,o)&&-1===S(i,"$<")){var l=n(e,a,s,i);if(l.done)return l.value}var p=c(i);p||(i=d(i));var m,b=a.global;b&&(m=a.unicode,a.lastIndex=0);for(var M,E=[];null!==(M=y(a,s))&&(k(E,M),b);){""===d(M[0])&&(a.lastIndex=v(s,f(a.lastIndex),m))}for(var T,A="",O=0,D=0;D<E.length;D++){for(var P,L=d((M=E[D])[0]),N=w(_(h(M.index),s.length),0),R=[],I=1;I<M.length;I++)k(R,void 0===(T=M[I])?T:String(T));var z=M.groups;if(p){var B=x([L],R,N,s);void 0!==z&&k(B,z),P=d(r(i,void 0,B))}else P=g(L,s,N,R,z,i);N>=O&&(A+=C(s,O,N)+P,O=N+L.length)}return A+C(s,O)}]}),!!s((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!M||E)},function(t,e,n){"use strict";var r=n(2),i=n(14),o=Math.floor,a=r("".charAt),s=r("".replace),u=r("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,l=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,n,r,h,f){var d=n+t.length,p=r.length,v=l;return void 0!==h&&(h=i(h),v=c),s(f,v,(function(i,s){var c;switch(a(s,0)){case"$":return"$";case"&":return t;case"`":return u(e,0,n);case"'":return u(e,d);case"<":c=h[u(s,1,-1)];break;default:var l=+s;if(0===l)return i;if(l>p){var f=o(l/10);return 0===f?i:f<=p?void 0===r[f-1]?a(s,1):r[f-1]+a(s,1):i}c=r[l-1]}return void 0===c?"":c}))}},function(t,e,n){"use strict";var r=n(9),i=n(111),o=n(5),a=n(35),s=n(24),u=n(188),c=n(13),l=n(58),h=n(112);i("search",(function(t,e,n){return[function(e){var n=s(this),i=a(e)?void 0:l(e,t);return i?r(i,e,n):new RegExp(e)[t](c(n))},function(t){var r=o(this),i=c(t),a=n(e,r,i);if(a.done)return a.value;var s=r.lastIndex;u(s,0)||(r.lastIndex=0);var l=h(r,i);return u(r.lastIndex,s)||(r.lastIndex=s),null===l?-1:l.index}]}))},function(t,e,n){"use strict";var r=n(42),i=n(9),o=n(2),a=n(111),s=n(5),u=n(35),c=n(143),l=n(24),h=n(89),f=n(148),d=n(31),p=n(13),v=n(58),m=n(32),g=n(112),y=n(109),b=n(145),w=n(1),_=b.UNSUPPORTED_Y,x=4294967295,k=Math.min,S=[].push,C=o(/./.exec),M=o(S),E=o("".slice);a("split",(function(t,e,n){var o;return o="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var o=p(l(this)),a=void 0===n?x:n>>>0;if(0===a)return[];if(void 0===t)return[o];if(!c(t))return i(e,o,t,a);for(var s,u,h,f=[],d=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),v=0,g=new RegExp(t.source,d+"g");(s=i(y,g,o))&&!((u=g.lastIndex)>v&&(M(f,E(o,v,s.index)),s.length>1&&s.index<o.length&&r(S,f,m(s,1)),h=s[0].length,v=u,f.length>=a));)g.lastIndex===s.index&&g.lastIndex++;return v===o.length?!h&&C(g,"")||M(f,""):M(f,E(o,v)),f.length>a?m(f,0,a):f}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:i(e,this,t,n)}:e,[function(e,n){var r=l(this),a=u(e)?void 0:v(e,t);return a?i(a,e,r,n):i(o,p(r),e,n)},function(t,r){var i=s(this),a=p(t),u=n(o,i,a,r,o!==e);if(u.done)return u.value;var c=h(i,RegExp),l=i.unicode,v=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(_?"g":"y"),m=new c(_?"^(?:"+i.source+")":i,v),y=void 0===r?x:r>>>0;if(0===y)return[];if(0===a.length)return null===g(m,a)?[a]:[];for(var b=0,w=0,S=[];w<a.length;){m.lastIndex=_?0:w;var C,T=g(m,_?E(a,w):a);if(null===T||(C=k(d(m.lastIndex+(_?w:0)),a.length))===b)w=f(a,w,l);else{if(M(S,E(a,b,w)),S.length===y)return S;for(var A=1;A<=T.length-1;A++)if(M(S,T[A]),S.length===y)return S;w=b=C}}return M(S,E(a,b)),S}]}),!!w((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]})),_)},function(t,e,n){"use strict";var r,i=n(0),o=n(61),a=n(20).f,s=n(31),u=n(13),c=n(146),l=n(24),h=n(147),f=n(21),d=o("".slice),p=Math.min,v=h("startsWith");i({target:"String",proto:!0,forced:!(!f&&!v&&!(!(r=a(String.prototype,"startsWith"))||r.writable))&&!v},{startsWith:function(t){var e=u(l(this));c(t);var n=s(p(arguments.length>1?arguments[1]:void 0,e.length)),r=u(t);return d(e,n,n+r.length)===r}})},function(t,e,n){"use strict";var r=n(0),i=n(73).trim;r({target:"String",proto:!0,forced:n(149)("trim")},{trim:function(){return i(this)}})},function(t,e,n){"use strict";n(418);var r=n(0),i=n(203);r({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==i},{trimEnd:i})},function(t,e,n){"use strict";var r=n(0),i=n(203);r({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==i},{trimRight:i})},function(t,e,n){"use strict";n(420);var r=n(0),i=n(204);r({target:"String",proto:!0,name:"trimStart",forced:"".trimStart!==i},{trimStart:i})},function(t,e,n){"use strict";var r=n(0),i=n(204);r({target:"String",proto:!0,name:"trimStart",forced:"".trimLeft!==i},{trimLeft:i})},function(t,e,n){"use strict";var r=n(0),i=n(27);r({target:"String",proto:!0,forced:n(28)("anchor")},{anchor:function(t){return i(this,"a","name",t)}})},function(t,e,n){"use strict";var r=n(0),i=n(27);r({target:"String",proto:!0,forced:n(28)("big")},{big:function(){return i(this,"big","","")}})},function(t,e,n){"use strict";var r=n(0),i=n(27);r({target:"String",proto:!0,forced:n(28)("blink")},{blink:function(){return i(this,"blink","","")}})},function(t,e,n){"use strict";var r=n(0),i=n(27);r({target:"String",proto:!0,forced:n(28)("bold")},{bold:function(){return i(this,"b","","")}})},function(t,e,n){"use strict";var r=n(0),i=n(27);r({target:"String",proto:!0,forced:n(28)("fixed")},{fixed:function(){return i(this,"tt","","")}})},function(t,e,n){"use strict";var r=n(0),i=n(27);r({target:"String",proto:!0,forced:n(28)("fontcolor")},{fontcolor:function(t){return i(this,"font","color",t)}})},function(t,e,n){"use strict";var r=n(0),i=n(27);r({target:"String",proto:!0,forced:n(28)("fontsize")},{fontsize:function(t){return i(this,"font","size",t)}})},function(t,e,n){"use strict";var r=n(0),i=n(27);r({target:"String",proto:!0,forced:n(28)("italics")},{italics:function(){return i(this,"i","","")}})},function(t,e,n){"use strict";var r=n(0),i=n(27);r({target:"String",proto:!0,forced:n(28)("link")},{link:function(t){return i(this,"a","href",t)}})},function(t,e,n){"use strict";var r=n(0),i=n(27);r({target:"String",proto:!0,forced:n(28)("small")},{small:function(){return i(this,"small","","")}})},function(t,e,n){"use strict";var r=n(0),i=n(27);r({target:"String",proto:!0,forced:n(28)("strike")},{strike:function(){return i(this,"strike","","")}})},function(t,e,n){"use strict";var r=n(0),i=n(27);r({target:"String",proto:!0,forced:n(28)("sub")},{sub:function(){return i(this,"sub","","")}})},function(t,e,n){"use strict";var r=n(0),i=n(27);r({target:"String",proto:!0,forced:n(28)("sup")},{sup:function(){return i(this,"sup","","")}})},function(t,e,n){"use strict";n(47)("Float32",(function(t){return function(e,n,r){return t(this,e,n,r)}}))},function(t,e,n){"use strict";var r=n(30),i=RangeError;t.exports=function(t){var e=r(t);if(e<0)throw new i("The argument can't be less than 0");return e}},function(t,e,n){"use strict";var r=Math.round;t.exports=function(t){var e=r(t);return e<0?0:e>255?255:255&e}},function(t,e,n){"use strict";var r=n(45);t.exports=function(t){var e=r(t);return"BigInt64Array"===e||"BigUint64Array"===e}},function(t,e,n){"use strict";n(47)("Float64",(function(t){return function(e,n,r){return t(this,e,n,r)}}))},function(t,e,n){"use strict";n(47)("Int8",(function(t){return function(e,n,r){return t(this,e,n,r)}}))},function(t,e,n){"use strict";n(47)("Int16",(function(t){return function(e,n,r){return t(this,e,n,r)}}))},function(t,e,n){"use strict";n(47)("Int32",(function(t){return function(e,n,r){return t(this,e,n,r)}}))},function(t,e,n){"use strict";n(47)("Uint8",(function(t){return function(e,n,r){return t(this,e,n,r)}}))},function(t,e,n){"use strict";n(47)("Uint8",(function(t){return function(e,n,r){return t(this,e,n,r)}}),!0)},function(t,e,n){"use strict";n(47)("Uint16",(function(t){return function(e,n,r){return t(this,e,n,r)}}))},function(t,e,n){"use strict";n(47)("Uint32",(function(t){return function(e,n,r){return t(this,e,n,r)}}))},function(t,e,n){"use strict";var r=n(2),i=n(10),o=r(n(168)),a=i.aTypedArray;(0,i.exportTypedArrayMethod)("copyWithin",(function(t,e){return o(a(this),t,e,arguments.length>2?arguments[2]:void 0)}))},function(t,e,n){"use strict";var r=n(10),i=n(19).every,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("every",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},function(t,e,n){"use strict";var r=n(10),i=n(127),o=n(207),a=n(45),s=n(9),u=n(2),c=n(1),l=r.aTypedArray,h=r.exportTypedArrayMethod,f=u("".slice);h("fill",(function(t){var e=arguments.length;l(this);var n="Big"===f(a(this),0,3)?o(t):+t;return s(i,this,n,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)}),c((function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),1!==t})))},function(t,e,n){"use strict";var r=n(10),i=n(19).filter,o=n(450),a=r.aTypedArray;(0,r.exportTypedArrayMethod)("filter",(function(t){var e=i(a(this),t,arguments.length>1?arguments[1]:void 0);return o(this,e)}))},function(t,e,n){"use strict";var r=n(208),i=n(113);t.exports=function(t,e){return r(i(t),e)}},function(t,e,n){"use strict";var r=n(10),i=n(19).find,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("find",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},function(t,e,n){"use strict";var r=n(10),i=n(19).findIndex,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("findIndex",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},function(t,e,n){"use strict";var r=n(10),i=n(19).forEach,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("forEach",(function(t){i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},function(t,e,n){"use strict";var r=n(150);(0,n(10).exportTypedArrayStaticMethod)("from",n(206),r)},function(t,e,n){"use strict";var r=n(10),i=n(79).includes,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("includes",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},function(t,e,n){"use strict";var r=n(10),i=n(79).indexOf,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("indexOf",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},function(t,e,n){"use strict";var r=n(3),i=n(1),o=n(2),a=n(10),s=n(100),u=n(7)("iterator"),c=r.Uint8Array,l=o(s.values),h=o(s.keys),f=o(s.entries),d=a.aTypedArray,p=a.exportTypedArrayMethod,v=c&&c.prototype,m=!i((function(){v[u].call([1])})),g=!!v&&v.values&&v[u]===v.values&&"values"===v.values.name,y=function(){return l(d(this))};p("entries",(function(){return f(d(this))}),m),p("keys",(function(){return h(d(this))}),m),p("values",y,m||!g,{name:"values"}),p(u,y,m||!g,{name:"values"})},function(t,e,n){"use strict";var r=n(10),i=n(2),o=r.aTypedArray,a=r.exportTypedArrayMethod,s=i([].join);a("join",(function(t){return s(o(this),t)}))},function(t,e,n){"use strict";var r=n(10),i=n(42),o=n(176),a=r.aTypedArray;(0,r.exportTypedArrayMethod)("lastIndexOf",(function(t){var e=arguments.length;return i(o,a(this),e>1?[t,arguments[1]]:[t])}))},function(t,e,n){"use strict";var r=n(10),i=n(19).map,o=n(113),a=r.aTypedArray;(0,r.exportTypedArrayMethod)("map",(function(t){return i(a(this),t,arguments.length>1?arguments[1]:void 0,(function(t,e){return new(o(t))(e)}))}))},function(t,e,n){"use strict";var r=n(10),i=n(150),o=r.aTypedArrayConstructor;(0,r.exportTypedArrayStaticMethod)("of",(function(){for(var t=0,e=arguments.length,n=new(o(this))(e);e>t;)n[t]=arguments[t++];return n}),i)},function(t,e,n){"use strict";var r=n(10),i=n(102).left,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("reduce",(function(t){var e=arguments.length;return i(o(this),t,e,e>1?arguments[1]:void 0)}))},function(t,e,n){"use strict";var r=n(10),i=n(102).right,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("reduceRight",(function(t){var e=arguments.length;return i(o(this),t,e,e>1?arguments[1]:void 0)}))},function(t,e,n){"use strict";var r=n(10),i=r.aTypedArray,o=r.exportTypedArrayMethod,a=Math.floor;o("reverse",(function(){for(var t,e=this,n=i(e).length,r=a(n/2),o=0;o<r;)t=e[o],e[o++]=e[--n],e[n]=t;return e}))},function(t,e,n){"use strict";var r=n(3),i=n(9),o=n(10),a=n(17),s=n(205),u=n(14),c=n(1),l=r.RangeError,h=r.Int8Array,f=h&&h.prototype,d=f&&f.set,p=o.aTypedArray,v=o.exportTypedArrayMethod,m=!c((function(){var t=new Uint8ClampedArray(2);return i(d,t,{length:1,0:3},1),3!==t[1]})),g=m&&o.NATIVE_ARRAY_BUFFER_VIEWS&&c((function(){var t=new h(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]}));v("set",(function(t){p(this);var e=s(arguments.length>1?arguments[1]:void 0,1),n=u(t);if(m)return i(d,this,n,e);var r=this.length,o=a(n),c=0;if(o+e>r)throw new l("Wrong length");for(;c<o;)this[e+c]=n[c++]}),!m||g)},function(t,e,n){"use strict";var r=n(10),i=n(113),o=n(1),a=n(32),s=r.aTypedArray;(0,r.exportTypedArrayMethod)("slice",(function(t,e){for(var n=a(s(this),t,e),r=i(this),o=0,u=n.length,c=new r(u);u>o;)c[o]=n[o++];return c}),o((function(){new Int8Array(1).slice()})))},function(t,e,n){"use strict";var r=n(10),i=n(19).some,o=r.aTypedArray;(0,r.exportTypedArrayMethod)("some",(function(t){return i(o(this),t,arguments.length>1?arguments[1]:void 0)}))},function(t,e,n){"use strict";var r=n(3),i=n(61),o=n(1),a=n(18),s=n(131),u=n(10),c=n(177),l=n(178),h=n(50),f=n(132),d=u.aTypedArray,p=u.exportTypedArrayMethod,v=r.Uint16Array,m=v&&i(v.prototype.sort),g=!!m&&!(o((function(){m(new v(2),null)}))&&o((function(){m(new v(2),{})}))),y=!!m&&!o((function(){if(h)return h<74;if(c)return c<67;if(l)return!0;if(f)return f<602;var t,e,n=new v(516),r=Array(516);for(t=0;t<516;t++)e=t%4,n[t]=515-t,r[t]=t-2*e+3;for(m(n,(function(t,e){return(t/4|0)-(e/4|0)})),t=0;t<516;t++)if(n[t]!==r[t])return!0}));p("sort",(function(t){return void 0!==t&&a(t),y?m(this,t):s(d(this),function(t){return function(e,n){return void 0!==t?+t(e,n)||0:n!==n?-1:e!==e?1:0===e&&0===n?1/e>0&&1/n<0?1:-1:e>n}}(t))}),!y||g)},function(t,e,n){"use strict";var r=n(10),i=n(31),o=n(51),a=n(113),s=r.aTypedArray;(0,r.exportTypedArrayMethod)("subarray",(function(t,e){var n=s(this),r=n.length,u=o(t,r);return new(a(n))(n.buffer,n.byteOffset+u*n.BYTES_PER_ELEMENT,i((void 0===e?r:o(e,r))-u))}))},function(t,e,n){"use strict";var r=n(3),i=n(42),o=n(10),a=n(1),s=n(32),u=r.Int8Array,c=o.aTypedArray,l=o.exportTypedArrayMethod,h=[].toLocaleString,f=!!u&&a((function(){h.call(new u(1))}));l("toLocaleString",(function(){return i(h,f?s(c(this)):c(this),s(arguments))}),a((function(){return[1,2].toLocaleString()!==new u([1,2]).toLocaleString()}))||!a((function(){u.prototype.toLocaleString.call([1,2])})))},function(t,e,n){"use strict";var r=n(10).exportTypedArrayMethod,i=n(1),o=n(3),a=n(2),s=o.Uint8Array,u=s&&s.prototype||{},c=[].toString,l=a([].join);i((function(){c.call({})}))&&(c=function(){return l(this)});var h=u.toString!==c;r("toString",c,h)},function(t,e,n){"use strict";n(473)},function(t,e,n){"use strict";var r,i=n(71),o=n(3),a=n(2),s=n(87),u=n(63),c=n(104),l=n(209),h=n(6),f=n(22).enforce,d=n(1),p=n(160),v=Object,m=Array.isArray,g=v.isExtensible,y=v.isFrozen,b=v.isSealed,w=v.freeze,_=v.seal,x=!o.ActiveXObject&&"ActiveXObject"in o,k=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},S=c("WeakMap",k,l),C=S.prototype,M=a(C.set);if(p)if(x){r=l.getConstructor(k,"WeakMap",!0),u.enable();var E=a(C.delete),T=a(C.has),A=a(C.get);s(C,{delete:function(t){if(h(t)&&!g(t)){var e=f(this);return e.frozen||(e.frozen=new r),E(this,t)||e.frozen.delete(t)}return E(this,t)},has:function(t){if(h(t)&&!g(t)){var e=f(this);return e.frozen||(e.frozen=new r),T(this,t)||e.frozen.has(t)}return T(this,t)},get:function(t){if(h(t)&&!g(t)){var e=f(this);return e.frozen||(e.frozen=new r),T(this,t)?A(this,t):e.frozen.get(t)}return A(this,t)},set:function(t,e){if(h(t)&&!g(t)){var n=f(this);n.frozen||(n.frozen=new r),T(this,t)?M(this,t,e):n.frozen.set(t,e)}else M(this,t,e);return this}})}else i&&d((function(){var t=w([]);return M(new S,t,1),!y(t)}))&&s(C,{set:function(t,e){var n;return m(t)&&(y(t)?n=w:b(t)&&(n=_)),M(this,t,e),n&&n(t),this}})},function(t,e,n){"use strict";n(475)},function(t,e,n){"use strict";n(104)("WeakSet",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),n(209))},function(t,e,n){"use strict";var r=n(3),i=n(210),o=n(211),a=n(170),s=n(40),u=function(t){if(t&&t.forEach!==a)try{s(t,"forEach",a)}catch(e){t.forEach=a}};for(var c in i)i[c]&&u(r[c]&&r[c].prototype);u(o)},function(t,e,n){"use strict";var r=n(3),i=n(210),o=n(211),a=n(100),s=n(40),u=n(33),c=n(7)("iterator"),l=a.values,h=function(t,e){if(t){if(t[c]!==l)try{s(t,c,l)}catch(r){t[c]=l}if(u(t,e,!0),i[e])for(var n in a)if(t[n]!==a[n])try{s(t,n,a[n])}catch(r){t[n]=a[n]}}};for(var f in i)h(r[f]&&r[f].prototype,f);h(o,"DOMTokenList")},function(t,e,n){"use strict";n(479),n(480)},function(t,e,n){"use strict";var r=n(0),i=n(3),o=n(108).clear;r({global:!0,bind:!0,enumerable:!0,forced:i.clearImmediate!==o},{clearImmediate:o})},function(t,e,n){"use strict";var r=n(0),i=n(3),o=n(108).set,a=n(151),s=i.setImmediate?a(o,!1):o;r({global:!0,bind:!0,enumerable:!0,forced:i.setImmediate!==s},{setImmediate:s})},function(t,e,n){"use strict";t.exports="function"==typeof Bun&&Bun&&"string"==typeof Bun.version},function(t,e,n){"use strict";var r=n(0),i=n(190),o=n(18),a=n(90);r({global:!0,enumerable:!0,dontCallGetSet:!0},{queueMicrotask:function(t){a(arguments.length,1),i(o(t))}})},function(t,e,n){"use strict";n(484),n(485)},function(t,e,n){"use strict";var r=n(0),i=n(3),o=n(151)(i.setInterval,!0);r({global:!0,bind:!0,forced:i.setInterval!==o},{setInterval:o})},function(t,e,n){"use strict";var r=n(0),i=n(3),o=n(151)(i.setTimeout,!0);r({global:!0,bind:!0,forced:i.setTimeout!==o},{setTimeout:o})},function(t,e,n){"use strict";n(487)},function(t,e,n){"use strict";n(201);var r,i=n(0),o=n(4),a=n(212),s=n(3),u=n(41),c=n(2),l=n(16),h=n(38),f=n(55),d=n(12),p=n(186),v=n(171),m=n(32),g=n(110).codeAt,y=n(488),b=n(13),w=n(33),_=n(90),x=n(213),k=n(22),S=k.set,C=k.getterFor("URL"),M=x.URLSearchParams,E=x.getState,T=s.URL,A=s.TypeError,O=s.parseInt,D=Math.floor,P=Math.pow,L=c("".charAt),N=c(/./.exec),R=c([].join),I=c(1..toString),z=c([].pop),B=c([].push),j=c("".replace),F=c([].shift),q=c("".split),$=c("".slice),V=c("".toLowerCase),U=c([].unshift),H="Invalid scheme",W="Invalid host",Z="Invalid port",J=/[a-z]/i,Y=/[\d+-.a-z]/i,K=/\d/,G=/^0x/i,X=/^[0-7]+$/,Q=/^\d+$/,tt=/^[\da-f]+$/i,et=/[\0\t\n\r #%/:<>?@[\\\]^|]/,nt=/[\0\t\n\r #/:<>?@[\\\]^|]/,rt=/^[\u0000-\u0020]+/,it=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ot=/[\t\n\r]/g,at=function(t){var e,n,r,i;if("number"==typeof t){for(e=[],n=0;n<4;n++)U(e,t%256),t=D(t/256);return R(e,".")}if("object"==typeof t){for(e="",r=function(t){for(var e=null,n=1,r=null,i=0,o=0;o<8;o++)0!==t[o]?(i>n&&(e=r,n=i),r=null,i=0):(null===r&&(r=o),++i);return i>n&&(e=r,n=i),e}(t),n=0;n<8;n++)i&&0===t[n]||(i&&(i=!1),r===n?(e+=n?":":"::",i=!0):(e+=I(t[n],16),n<7&&(e+=":")));return"["+e+"]"}return t},st={},ut=p({},st,{" ":1,'"':1,"<":1,">":1,"`":1}),ct=p({},ut,{"#":1,"?":1,"{":1,"}":1}),lt=p({},ct,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ht=function(t,e){var n=g(t,0);return n>32&&n<127&&!d(e,t)?t:encodeURIComponent(t)},ft={ftp:21,file:null,http:80,https:443,ws:80,wss:443},dt=function(t,e){var n;return 2===t.length&&N(J,L(t,0))&&(":"===(n=L(t,1))||!e&&"|"===n)},pt=function(t){var e;return t.length>1&&dt($(t,0,2))&&(2===t.length||"/"===(e=L(t,2))||"\\"===e||"?"===e||"#"===e)},vt=function(t){return"."===t||"%2e"===V(t)},mt={},gt={},yt={},bt={},wt={},_t={},xt={},kt={},St={},Ct={},Mt={},Et={},Tt={},At={},Ot={},Dt={},Pt={},Lt={},Nt={},Rt={},It={},zt=function(t,e,n){var r,i,o,a=b(t);if(e){if(i=this.parse(a))throw new A(i);this.searchParams=null}else{if(void 0!==n&&(r=new zt(n,!0)),i=this.parse(a,null,r))throw new A(i);(o=E(new M)).bindURL(this),this.searchParams=o}};zt.prototype={type:"URL",parse:function(t,e,n){var i,o,a,s,u,c=this,l=e||mt,h=0,f="",p=!1,g=!1,y=!1;for(t=b(t),e||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,t=j(t,rt,""),t=j(t,it,"$1")),t=j(t,ot,""),i=v(t);h<=i.length;){switch(o=i[h],l){case mt:if(!o||!N(J,o)){if(e)return H;l=yt;continue}f+=V(o),l=gt;break;case gt:if(o&&(N(Y,o)||"+"===o||"-"===o||"."===o))f+=V(o);else{if(":"!==o){if(e)return H;f="",l=yt,h=0;continue}if(e&&(c.isSpecial()!==d(ft,f)||"file"===f&&(c.includesCredentials()||null!==c.port)||"file"===c.scheme&&!c.host))return;if(c.scheme=f,e)return void(c.isSpecial()&&ft[c.scheme]===c.port&&(c.port=null));f="","file"===c.scheme?l=At:c.isSpecial()&&n&&n.scheme===c.scheme?l=bt:c.isSpecial()?l=kt:"/"===i[h+1]?(l=wt,h++):(c.cannotBeABaseURL=!0,B(c.path,""),l=Nt)}break;case yt:if(!n||n.cannotBeABaseURL&&"#"!==o)return H;if(n.cannotBeABaseURL&&"#"===o){c.scheme=n.scheme,c.path=m(n.path),c.query=n.query,c.fragment="",c.cannotBeABaseURL=!0,l=It;break}l="file"===n.scheme?At:_t;continue;case bt:if("/"!==o||"/"!==i[h+1]){l=_t;continue}l=St,h++;break;case wt:if("/"===o){l=Ct;break}l=Lt;continue;case _t:if(c.scheme=n.scheme,o===r)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=m(n.path),c.query=n.query;else if("/"===o||"\\"===o&&c.isSpecial())l=xt;else if("?"===o)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=m(n.path),c.query="",l=Rt;else{if("#"!==o){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=m(n.path),c.path.length--,l=Lt;continue}c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=m(n.path),c.query=n.query,c.fragment="",l=It}break;case xt:if(!c.isSpecial()||"/"!==o&&"\\"!==o){if("/"!==o){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,l=Lt;continue}l=Ct}else l=St;break;case kt:if(l=St,"/"!==o||"/"!==L(f,h+1))continue;h++;break;case St:if("/"!==o&&"\\"!==o){l=Ct;continue}break;case Ct:if("@"===o){p&&(f="%40"+f),p=!0,a=v(f);for(var w=0;w<a.length;w++){var _=a[w];if(":"!==_||y){var x=ht(_,lt);y?c.password+=x:c.username+=x}else y=!0}f=""}else if(o===r||"/"===o||"?"===o||"#"===o||"\\"===o&&c.isSpecial()){if(p&&""===f)return"Invalid authority";h-=v(f).length+1,f="",l=Mt}else f+=o;break;case Mt:case Et:if(e&&"file"===c.scheme){l=Dt;continue}if(":"!==o||g){if(o===r||"/"===o||"?"===o||"#"===o||"\\"===o&&c.isSpecial()){if(c.isSpecial()&&""===f)return W;if(e&&""===f&&(c.includesCredentials()||null!==c.port))return;if(s=c.parseHost(f))return s;if(f="",l=Pt,e)return;continue}"["===o?g=!0:"]"===o&&(g=!1),f+=o}else{if(""===f)return W;if(s=c.parseHost(f))return s;if(f="",l=Tt,e===Et)return}break;case Tt:if(!N(K,o)){if(o===r||"/"===o||"?"===o||"#"===o||"\\"===o&&c.isSpecial()||e){if(""!==f){var k=O(f,10);if(k>65535)return Z;c.port=c.isSpecial()&&k===ft[c.scheme]?null:k,f=""}if(e)return;l=Pt;continue}return Z}f+=o;break;case At:if(c.scheme="file","/"===o||"\\"===o)l=Ot;else{if(!n||"file"!==n.scheme){l=Lt;continue}switch(o){case r:c.host=n.host,c.path=m(n.path),c.query=n.query;break;case"?":c.host=n.host,c.path=m(n.path),c.query="",l=Rt;break;case"#":c.host=n.host,c.path=m(n.path),c.query=n.query,c.fragment="",l=It;break;default:pt(R(m(i,h),""))||(c.host=n.host,c.path=m(n.path),c.shortenPath()),l=Lt;continue}}break;case Ot:if("/"===o||"\\"===o){l=Dt;break}n&&"file"===n.scheme&&!pt(R(m(i,h),""))&&(dt(n.path[0],!0)?B(c.path,n.path[0]):c.host=n.host),l=Lt;continue;case Dt:if(o===r||"/"===o||"\\"===o||"?"===o||"#"===o){if(!e&&dt(f))l=Lt;else if(""===f){if(c.host="",e)return;l=Pt}else{if(s=c.parseHost(f))return s;if("localhost"===c.host&&(c.host=""),e)return;f="",l=Pt}continue}f+=o;break;case Pt:if(c.isSpecial()){if(l=Lt,"/"!==o&&"\\"!==o)continue}else if(e||"?"!==o)if(e||"#"!==o){if(o!==r&&(l=Lt,"/"!==o))continue}else c.fragment="",l=It;else c.query="",l=Rt;break;case Lt:if(o===r||"/"===o||"\\"===o&&c.isSpecial()||!e&&("?"===o||"#"===o)){if(".."===(u=V(u=f))||"%2e."===u||".%2e"===u||"%2e%2e"===u?(c.shortenPath(),"/"===o||"\\"===o&&c.isSpecial()||B(c.path,"")):vt(f)?"/"===o||"\\"===o&&c.isSpecial()||B(c.path,""):("file"===c.scheme&&!c.path.length&&dt(f)&&(c.host&&(c.host=""),f=L(f,0)+":"),B(c.path,f)),f="","file"===c.scheme&&(o===r||"?"===o||"#"===o))for(;c.path.length>1&&""===c.path[0];)F(c.path);"?"===o?(c.query="",l=Rt):"#"===o&&(c.fragment="",l=It)}else f+=ht(o,ct);break;case Nt:"?"===o?(c.query="",l=Rt):"#"===o?(c.fragment="",l=It):o!==r&&(c.path[0]+=ht(o,st));break;case Rt:e||"#"!==o?o!==r&&("'"===o&&c.isSpecial()?c.query+="%27":c.query+="#"===o?"%23":ht(o,st)):(c.fragment="",l=It);break;case It:o!==r&&(c.fragment+=ht(o,ut))}h++}},parseHost:function(t){var e,n,r;if("["===L(t,0)){if("]"!==L(t,t.length-1))return W;if(!(e=function(t){var e,n,r,i,o,a,s,u=[0,0,0,0,0,0,0,0],c=0,l=null,h=0,f=function(){return L(t,h)};if(":"===f()){if(":"!==L(t,1))return;h+=2,l=++c}for(;f();){if(8===c)return;if(":"!==f()){for(e=n=0;n<4&&N(tt,f());)e=16*e+O(f(),16),h++,n++;if("."===f()){if(0===n)return;if(h-=n,c>6)return;for(r=0;f();){if(i=null,r>0){if(!("."===f()&&r<4))return;h++}if(!N(K,f()))return;for(;N(K,f());){if(o=O(f(),10),null===i)i=o;else{if(0===i)return;i=10*i+o}if(i>255)return;h++}u[c]=256*u[c]+i,2!==++r&&4!==r||c++}if(4!==r)return;break}if(":"===f()){if(h++,!f())return}else if(f())return;u[c++]=e}else{if(null!==l)return;h++,l=++c}}if(null!==l)for(a=c-l,c=7;0!==c&&a>0;)s=u[c],u[c--]=u[l+a-1],u[l+--a]=s;else if(8!==c)return;return u}($(t,1,-1))))return W;this.host=e}else if(this.isSpecial()){if(t=y(t),N(et,t))return W;if(null===(e=function(t){var e,n,r,i,o,a,s,u=q(t,".");if(u.length&&""===u[u.length-1]&&u.length--,(e=u.length)>4)return t;for(n=[],r=0;r<e;r++){if(""===(i=u[r]))return t;if(o=10,i.length>1&&"0"===L(i,0)&&(o=N(G,i)?16:8,i=$(i,8===o?1:2)),""===i)a=0;else{if(!N(10===o?Q:8===o?X:tt,i))return t;a=O(i,o)}B(n,a)}for(r=0;r<e;r++)if(a=n[r],r===e-1){if(a>=P(256,5-e))return null}else if(a>255)return null;for(s=z(n),r=0;r<n.length;r++)s+=n[r]*P(256,3-r);return s}(t)))return W;this.host=e}else{if(N(nt,t))return W;for(e="",n=v(t),r=0;r<n.length;r++)e+=ht(n[r],st);this.host=e}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return d(ft,this.scheme)},shortenPath:function(){var t=this.path,e=t.length;!e||"file"===this.scheme&&1===e&&dt(t[0],!0)||t.length--},serialize:function(){var t=this,e=t.scheme,n=t.username,r=t.password,i=t.host,o=t.port,a=t.path,s=t.query,u=t.fragment,c=e+":";return null!==i?(c+="//",t.includesCredentials()&&(c+=n+(r?":"+r:"")+"@"),c+=at(i),null!==o&&(c+=":"+o)):"file"===e&&(c+="//"),c+=t.cannotBeABaseURL?a[0]:a.length?"/"+R(a,"/"):"",null!==s&&(c+="?"+s),null!==u&&(c+="#"+u),c},setHref:function(t){var e=this.parse(t);if(e)throw new A(e);this.searchParams.update()},getOrigin:function(){var t=this.scheme,e=this.port;if("blob"===t)try{return new Bt(t.path[0]).origin}catch(n){return"null"}return"file"!==t&&this.isSpecial()?t+"://"+at(this.host)+(null!==e?":"+e:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(b(t)+":",mt)},getUsername:function(){return this.username},setUsername:function(t){var e=v(b(t));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var n=0;n<e.length;n++)this.username+=ht(e[n],lt)}},getPassword:function(){return this.password},setPassword:function(t){var e=v(b(t));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var n=0;n<e.length;n++)this.password+=ht(e[n],lt)}},getHost:function(){var t=this.host,e=this.port;return null===t?"":null===e?at(t):at(t)+":"+e},setHost:function(t){this.cannotBeABaseURL||this.parse(t,Mt)},getHostname:function(){var t=this.host;return null===t?"":at(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,Et)},getPort:function(){var t=this.port;return null===t?"":b(t)},setPort:function(t){this.cannotHaveUsernamePasswordPort()||(""===(t=b(t))?this.port=null:this.parse(t,Tt))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+R(t,"/"):""},setPathname:function(t){this.cannotBeABaseURL||(this.path=[],this.parse(t,Pt))},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){""===(t=b(t))?this.query=null:("?"===L(t,0)&&(t=$(t,1)),this.query="",this.parse(t,Rt)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){""!==(t=b(t))?("#"===L(t,0)&&(t=$(t,1)),this.fragment="",this.parse(t,It)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Bt=function(t){var e=f(this,jt),n=_(arguments.length,1)>1?arguments[1]:void 0,r=S(e,new zt(t,!1,n));o||(e.href=r.serialize(),e.origin=r.getOrigin(),e.protocol=r.getProtocol(),e.username=r.getUsername(),e.password=r.getPassword(),e.host=r.getHost(),e.hostname=r.getHostname(),e.port=r.getPort(),e.pathname=r.getPathname(),e.search=r.getSearch(),e.searchParams=r.getSearchParams(),e.hash=r.getHash())},jt=Bt.prototype,Ft=function(t,e){return{get:function(){return C(this)[t]()},set:e&&function(t){return C(this)[e](t)},configurable:!0,enumerable:!0}};if(o&&(h(jt,"href",Ft("serialize","setHref")),h(jt,"origin",Ft("getOrigin")),h(jt,"protocol",Ft("getProtocol","setProtocol")),h(jt,"username",Ft("getUsername","setUsername")),h(jt,"password",Ft("getPassword","setPassword")),h(jt,"host",Ft("getHost","setHost")),h(jt,"hostname",Ft("getHostname","setHostname")),h(jt,"port",Ft("getPort","setPort")),h(jt,"pathname",Ft("getPathname","setPathname")),h(jt,"search",Ft("getSearch","setSearch")),h(jt,"searchParams",Ft("getSearchParams")),h(jt,"hash",Ft("getHash","setHash"))),l(jt,"toJSON",(function(){return C(this).serialize()}),{enumerable:!0}),l(jt,"toString",(function(){return C(this).serialize()}),{enumerable:!0}),T){var qt=T.createObjectURL,$t=T.revokeObjectURL;qt&&l(Bt,"createObjectURL",u(qt,T)),$t&&l(Bt,"revokeObjectURL",u($t,T))}w(Bt,"URL"),i({global:!0,constructor:!0,forced:!a,sham:!o},{URL:Bt})},function(t,e,n){"use strict";var r=n(2),i=2147483647,o=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,s="Overflow: input needs wider integers to process",u=RangeError,c=r(a.exec),l=Math.floor,h=String.fromCharCode,f=r("".charCodeAt),d=r([].join),p=r([].push),v=r("".replace),m=r("".split),g=r("".toLowerCase),y=function(t){return t+22+75*(t<26)},b=function(t,e,n){var r=0;for(t=n?l(t/700):t>>1,t+=l(t/e);t>455;)t=l(t/35),r+=36;return l(r+36*t/(t+38))},w=function(t){var e,n,r=[],o=(t=function(t){for(var e=[],n=0,r=t.length;n<r;){var i=f(t,n++);if(i>=55296&&i<=56319&&n<r){var o=f(t,n++);56320===(64512&o)?p(e,((1023&i)<<10)+(1023&o)+65536):(p(e,i),n--)}else p(e,i)}return e}(t)).length,a=128,c=0,v=72;for(e=0;e<t.length;e++)(n=t[e])<128&&p(r,h(n));var m=r.length,g=m;for(m&&p(r,"-");g<o;){var w=i;for(e=0;e<t.length;e++)(n=t[e])>=a&&n<w&&(w=n);var _=g+1;if(w-a>l((i-c)/_))throw new u(s);for(c+=(w-a)*_,a=w,e=0;e<t.length;e++){if((n=t[e])<a&&++c>i)throw new u(s);if(n===a){for(var x=c,k=36;;){var S=k<=v?1:k>=v+26?26:k-v;if(x<S)break;var C=x-S,M=36-S;p(r,h(y(S+C%M))),x=l(C/M),k+=36}p(r,h(y(x))),v=b(c,_,g===m),c=0,g++}}c++,a++}return d(r,"")};t.exports=function(t){var e,n,r=[],i=m(v(g(t),a,"."),".");for(e=0;e<i.length;e++)n=i[e],p(r,c(o,n)?"xn--"+w(n):n);return d(r,".")}},function(t,e,n){"use strict";var r=n(0),i=n(9);r({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return i(URL.prototype.toString,this)}})},function(t,e,n){"use strict";n(213)},function(t,e,n){(function(t){var r="undefined"!==typeof t&&t||"undefined"!==typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(492),e.setImmediate="undefined"!==typeof self&&self.setImmediate||"undefined"!==typeof t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!==typeof self&&self.clearImmediate||"undefined"!==typeof t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(64))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var r,i,o,a,s,u=1,c={},l=!1,h=t.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(t);f=f&&f.setTimeout?f:t,"[object process]"==={}.toString.call(t.process)?r=function(t){e.nextTick((function(){p(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},r=function(t){o.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,r=function(t){var e=h.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):r=function(t){setTimeout(p,0,t)}:(a="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"===typeof e.data&&0===e.data.indexOf(a)&&p(+e.data.slice(a.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),r=function(e){t.postMessage(a+e,"*")}),f.setImmediate=function(t){"function"!==typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var i={callback:t,args:e};return c[u]=i,r(u),u++},f.clearImmediate=d}function d(t){delete c[t]}function p(t){if(l)setTimeout(p,0,t);else{var e=c[t];if(e){l=!0;try{!function(t){var e=t.callback,n=t.args;switch(n.length){case 0:e();break;case 1:e(n[0]);break;case 2:e(n[0],n[1]);break;case 3:e(n[0],n[1],n[2]);break;default:e.apply(void 0,n)}}(e)}finally{d(t),l=!1}}}}}("undefined"===typeof self?"undefined"===typeof t?this:t:self)}).call(this,n(64),n(493))},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"===typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"===typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var u,c=[],l=!1,h=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):h=-1,c.length&&d())}function d(){if(!l){var t=s(f);l=!0;for(var e=c.length;e;){for(u=c,c=[];++h<e;)u&&u[h].run();h=-1,e=c.length}u=null,l=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function v(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new p(t,e)),1!==c.length||l||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(t,e,n){var r,i,o;!function(n,a){"use strict";i=[],void 0===(o="function"===typeof(r=function(){function t(t){return!isNaN(parseFloat(t))&&isFinite(t)}function e(t){return t.charAt(0).toUpperCase()+t.substring(1)}function n(t){return function(){return this[t]}}var r=["isConstructor","isEval","isNative","isToplevel"],i=["columnNumber","lineNumber"],o=["fileName","functionName","source"],a=["args"],s=["evalOrigin"],u=r.concat(i,o,a,s);function c(t){if(t)for(var n=0;n<u.length;n++)void 0!==t[u[n]]&&this["set"+e(u[n])](t[u[n]])}c.prototype={getArgs:function(){return this.args},setArgs:function(t){if("[object Array]"!==Object.prototype.toString.call(t))throw new TypeError("Args must be an Array");this.args=t},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(t){if(t instanceof c)this.evalOrigin=t;else{if(!(t instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new c(t)}},toString:function(){var t=this.getFileName()||"",e=this.getLineNumber()||"",n=this.getColumnNumber()||"",r=this.getFunctionName()||"";return this.getIsEval()?t?"[eval] ("+t+":"+e+":"+n+")":"[eval]:"+e+":"+n:r?r+" ("+t+":"+e+":"+n+")":t+":"+e+":"+n}},c.fromString=function(t){var e=t.indexOf("("),n=t.lastIndexOf(")"),r=t.substring(0,e),i=t.substring(e+1,n).split(","),o=t.substring(n+1);if(0===o.indexOf("@"))var a=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(o,""),s=a[1],u=a[2],l=a[3];return new c({functionName:r,args:i||void 0,fileName:s,lineNumber:u||void 0,columnNumber:l||void 0})};for(var l=0;l<r.length;l++)c.prototype["get"+e(r[l])]=n(r[l]),c.prototype["set"+e(r[l])]=function(t){return function(e){this[t]=Boolean(e)}}(r[l]);for(var h=0;h<i.length;h++)c.prototype["get"+e(i[h])]=n(i[h]),c.prototype["set"+e(i[h])]=function(e){return function(n){if(!t(n))throw new TypeError(e+" must be a Number");this[e]=Number(n)}}(i[h]);for(var f=0;f<o.length;f++)c.prototype["get"+e(o[f])]=n(o[f]),c.prototype["set"+e(o[f])]=function(t){return function(e){this[t]=String(e)}}(o[f]);return c})?r.apply(e,i):r)||(t.exports=o)}()},function(t,e,n){var r=n(496).RBTree;function i(t,e,n){this.discrete=!1===t,this.delta=t||.01,this.K=void 0===e?25:e,this.CX=void 0===n?1.1:n,this.centroids=new r(o),this.nreset=0,this.reset()}function o(t,e){return t.mean>e.mean?1:t.mean<e.mean?-1:0}function a(t,e){return t.mean_cumn-e.mean_cumn}function s(t){this.config=t||{},this.mode=this.config.mode||"auto",i.call(this,"cont"===this.mode&&t.delta),this.digest_ratio=this.config.ratio||.9,this.digest_thresh=this.config.thresh||1e3,this.n_unique=0}i.prototype.reset=function(){this.centroids.clear(),this.n=0,this.nreset+=1,this.last_cumulate=0},i.prototype.size=function(){return this.centroids.size},i.prototype.toArray=function(t){var e=[];return t?(this._cumulate(!0),this.centroids.each((function(t){e.push(t)}))):this.centroids.each((function(t){e.push({mean:t.mean,n:t.n})})),e},i.prototype.summary=function(){return[(this.discrete?"exact ":"approximating ")+this.n+" samples using "+this.size()+" centroids","min = "+this.percentile(0),"Q1 = "+this.percentile(.25),"Q2 = "+this.percentile(.5),"Q3 = "+this.percentile(.75),"max = "+this.percentile(1)].join("\n")},i.prototype.push=function(t,e){e=e||1,t=Array.isArray(t)?t:[t];for(var n=0;n<t.length;n++)this._digest(t[n],e)},i.prototype.push_centroid=function(t){t=Array.isArray(t)?t:[t];for(var e=0;e<t.length;e++)this._digest(t[e].mean,t[e].n)},i.prototype._cumulate=function(t){if(!(this.n===this.last_cumulate||!t&&this.CX&&this.CX>this.n/this.last_cumulate)){var e=0;this.centroids.each((function(t){t.mean_cumn=e+t.n/2,e=t.cumn=e+t.n})),this.n=this.last_cumulate=e}},i.prototype.find_nearest=function(t){if(0===this.size())return null;var e=this.centroids.lowerBound({mean:t}),n=null===e.data()?e.prev():e.data();if(n.mean===t||this.discrete)return n;var r=e.prev();return r&&Math.abs(r.mean-t)<Math.abs(n.mean-t)?r:n},i.prototype._new_centroid=function(t,e,n){var r={mean:t,n:e,cumn:n};return this.centroids.insert(r),this.n+=e,r},i.prototype._addweight=function(t,e,n){e!==t.mean&&(t.mean+=n*(e-t.mean)/(t.n+n)),t.cumn+=n,t.mean_cumn+=n/2,t.n+=n,this.n+=n},i.prototype._digest=function(t,e){var n=this.centroids.min(),r=this.centroids.max(),i=this.find_nearest(t);if(i&&i.mean===t)this._addweight(i,t,e);else if(i===n)this._new_centroid(t,e,0);else if(i===r)this._new_centroid(t,e,this.n);else if(this.discrete)this._new_centroid(t,e,i.cumn);else{var o=i.mean_cumn/this.n;Math.floor(4*this.n*this.delta*o*(1-o))-i.n>=e?this._addweight(i,t,e):this._new_centroid(t,e,i.cumn)}this._cumulate(!1),!this.discrete&&this.K&&this.size()>this.K/this.delta&&this.compress()},i.prototype.bound_mean=function(t){var e=this.centroids.upperBound({mean:t}),n=e.prev();return[n,n.mean===t?n:e.next()]},i.prototype.p_rank=function(t){var e=(Array.isArray(t)?t:[t]).map(this._p_rank,this);return Array.isArray(t)?e:e[0]},i.prototype._p_rank=function(t){if(0!==this.size()){if(t<this.centroids.min().mean)return 0;if(t>this.centroids.max().mean)return 1;this._cumulate(!0);var e=this.bound_mean(t),n=e[0],r=e[1];if(this.discrete)return n.cumn/this.n;var i=n.mean_cumn;return n!==r&&(i+=(t-n.mean)*(r.mean_cumn-n.mean_cumn)/(r.mean-n.mean)),i/this.n}},i.prototype.bound_mean_cumn=function(t){this.centroids._comparator=a;var e=this.centroids.upperBound({mean_cumn:t});this.centroids._comparator=o;var n=e.prev();return[n,n&&n.mean_cumn===t?n:e.next()]},i.prototype.percentile=function(t){var e=(Array.isArray(t)?t:[t]).map(this._percentile,this);return Array.isArray(t)?e:e[0]},i.prototype._percentile=function(t){if(0!==this.size()){this._cumulate(!0);this.centroids.min(),this.centroids.max();var e=this.n*t,n=this.bound_mean_cumn(e),r=n[0],i=n[1];return i===r||null===r||null===i?(r||i).mean:this.discrete?e<=r.cumn?r.mean:i.mean:r.mean+(e-r.mean_cumn)*(i.mean-r.mean)/(i.mean_cumn-r.mean_cumn)}},i.prototype.compress=function(){if(!this.compressing){var t,e,n=this.toArray();for(this.reset(),this.compressing=!0;n.length>0;)this.push_centroid((t=n,e=void 0,e=Math.floor(Math.random()*t.length),t.splice(e,1)[0]));this._cumulate(!0),this.compressing=!1}},s.prototype=Object.create(i.prototype),s.prototype.constructor=s,s.prototype.push=function(t){i.prototype.push.call(this,t),this.check_continuous()},s.prototype._new_centroid=function(t,e,n){this.n_unique+=1,i.prototype._new_centroid.call(this,t,e,n)},s.prototype._addweight=function(t,e,n){1===t.n&&(this.n_unique-=1),i.prototype._addweight.call(this,t,e,n)},s.prototype.check_continuous=function(){return!("auto"!==this.mode||this.size()<this.digest_thresh)&&(this.n_unique/this.size()>this.digest_ratio&&(this.mode="cont",this.discrete=!1,this.delta=this.config.delta||.01,this.compress(),!0))},t.exports={TDigest:i,Digest:s}},function(t,e,n){t.exports={RBTree:n(497),BinTree:n(498)}},function(t,e,n){var r=n(214);function i(t){this.data=t,this.left=null,this.right=null,this.red=!0}function o(t){this._root=null,this._comparator=t,this.size=0}function a(t){return null!==t&&t.red}function s(t,e){var n=t.get_child(!e);return t.set_child(!e,n.get_child(e)),n.set_child(e,t),t.red=!0,n.red=!1,n}function u(t,e){return t.set_child(!e,s(t.get_child(!e),!e)),s(t,e)}i.prototype.get_child=function(t){return t?this.right:this.left},i.prototype.set_child=function(t,e){t?this.right=e:this.left=e},o.prototype=new r,o.prototype.insert=function(t){var e=!1;if(null===this._root)this._root=new i(t),e=!0,this.size++;else{var n=new i(void 0),r=0,o=0,c=null,l=n,h=null,f=this._root;for(l.right=this._root;;){if(null===f?(f=new i(t),h.set_child(r,f),e=!0,this.size++):a(f.left)&&a(f.right)&&(f.red=!0,f.left.red=!1,f.right.red=!1),a(f)&&a(h)){var d=l.right===c;f===h.get_child(o)?l.set_child(d,s(c,!o)):l.set_child(d,u(c,!o))}var p=this._comparator(f.data,t);if(0===p)break;o=r,r=p<0,null!==c&&(l=c),c=h,h=f,f=f.get_child(r)}this._root=n.right}return this._root.red=!1,e},o.prototype.remove=function(t){if(null===this._root)return!1;var e=new i(void 0),n=e;n.right=this._root;for(var r=null,o=null,c=null,l=1;null!==n.get_child(l);){var h=l;o=r,r=n,n=n.get_child(l);var f=this._comparator(t,n.data);if(l=f>0,0===f&&(c=n),!a(n)&&!a(n.get_child(l)))if(a(n.get_child(!l))){var d=s(n,l);r.set_child(h,d),r=d}else if(!a(n.get_child(!l))){var p=r.get_child(!h);if(null!==p)if(a(p.get_child(!h))||a(p.get_child(h))){var v=o.right===r;a(p.get_child(h))?o.set_child(v,u(r,h)):a(p.get_child(!h))&&o.set_child(v,s(r,h));var m=o.get_child(v);m.red=!0,n.red=!0,m.left.red=!1,m.right.red=!1}else r.red=!1,p.red=!0,n.red=!0}}return null!==c&&(c.data=n.data,r.set_child(r.right===n,n.get_child(null===n.left)),this.size--),this._root=e.right,null!==this._root&&(this._root.red=!1),null!==c},t.exports=o},function(t,e,n){var r=n(214);function i(t){this.data=t,this.left=null,this.right=null}function o(t){this._root=null,this._comparator=t,this.size=0}i.prototype.get_child=function(t){return t?this.right:this.left},i.prototype.set_child=function(t,e){t?this.right=e:this.left=e},o.prototype=new r,o.prototype.insert=function(t){if(null===this._root)return this._root=new i(t),this.size++,!0;for(var e=0,n=null,r=this._root;;){if(null===r)return r=new i(t),n.set_child(e,r),ret=!0,this.size++,!0;if(0===this._comparator(r.data,t))return!1;e=this._comparator(r.data,t)<0,n=r,r=r.get_child(e)}},o.prototype.remove=function(t){if(null===this._root)return!1;var e=new i(void 0),n=e;n.right=this._root;for(var r=null,o=null,a=1;null!==n.get_child(a);){r=n,n=n.get_child(a);var s=this._comparator(t,n.data);a=s>0,0===s&&(o=n)}return null!==o&&(o.data=n.data,r.set_child(r.right===n,n.get_child(null===n.left)),this._root=e.right,this.size--,!0)},t.exports=o},function(t,e,n){var r={"./geo_controller.js":500,"./non_geo_controller.js":501,"./reorder_controller.js":502};function i(t){var e=o(t);return n(e)}function o(t){if(!n.o(r,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return r[t]}i.keys=function(){return Object.keys(r)},i.resolve=o,t.exports=i,i.id=499},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return f}));var r=n(56),i=n(34),o=n.n(i);function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=h(t);if(e){var i=h(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return l(this,n)}}function l(t,e){return!e||"object"!==typeof e&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}n(216),delete o.a.Icon.Default.prototype._getIconUrl,o.a.Icon.Default.mergeOptions({iconRetinaUrl:n(217),iconUrl:n(218),shadowUrl:n(219)});var f=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&&u(t,e)}(l,t);var e,n,r,i=c(l);function l(){return a(this,l),i.apply(this,arguments)}return e=l,(n=[{key:"connect",value:function(){var t=this;this.marker(),this.latTarget.addEventListener("change",(function(e){return t.marker()})),this.lngTarget.addEventListener("change",(function(e){return t.marker()})),window.addEventListener("resize",(function(e){return t.map.invalidateSize()})),this.map.on("click",(function(e){t.latTarget.value=e.latlng.lat,t.lngTarget.value=e.latlng.lng,t.latTarget.dispatchEvent(new Event("change"))}))}},{key:"marker",value:function(){return this._marker&&this.map.removeLayer(this._marker),this._marker=o.a.marker(this.coords).addTo(this.map),this._marker}},{key:"lat",get:function(){var t=parseFloat(this.latTarget.value);return isNaN(t)?0:t}},{key:"lng",get:function(){var t=parseFloat(this.lngTarget.value);return isNaN(t)?0:t}},{key:"coords",get:function(){return[this.lat,this.lng]}},{key:"map",get:function(){return this._map||(this._map=o.a.map(this.mapTarget).setView(this.coords,13),o.a.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:19,attribution:'© <a href="https://openstreetmap.org/copyright">OpenStreetMap contributors</a>'}).addTo(this._map)),this._map}}])&&s(e.prototype,n),r&&s(e,r),l}(r.b);f.targets=["lat","lng","map"]},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return v}));var r=n(57),i=n.n(r),o=n(56),a=n(34),s=n.n(a);function u(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(c){return void n(c)}s.done?e(u):Promise.resolve(u).then(r,i)}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function h(t,e){return(h=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=p(t);if(e){var i=p(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return d(this,n)}}function d(t,e){return!e||"object"!==typeof e&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}n(216),delete s.a.Icon.Default.prototype._getIconUrl,s.a.Icon.Default.mergeOptions({iconRetinaUrl:n(217),iconUrl:n(218),shadowUrl:n(219)});var v=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)}(p,t);var e,n,r,o,a,d=f(p);function p(){return c(this,p),d.apply(this,arguments)}return e=p,(n=[{key:"connect",value:(o=i.a.mark((function t(){var e=this;return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.marker(),this.latTarget.addEventListener("change",(function(t){return e.marker()})),this.lngTarget.addEventListener("change",(function(t){return e.marker()})),window.addEventListener("resize",(function(t){return e.map.invalidateSize()})),this.map.on("click",(function(t){e.latTarget.value=t.latlng.lat,e.lngTarget.value=t.latlng.lng,e.latTarget.dispatchEvent(new Event("change"))}));case 5:case"end":return t.stop()}}),t,this)})),a=function(){var t=this,e=arguments;return new Promise((function(n,r){var i=o.apply(t,e);function a(t){u(i,n,r,a,s,"next",t)}function s(t){u(i,n,r,a,s,"throw",t)}a(void 0)}))},function(){return a.apply(this,arguments)})},{key:"marker",value:function(){return this._marker&&this.map.removeLayer(this._marker),this._marker=s.a.marker(this.coords).addTo(this.map),this._marker}},{key:"lat",get:function(){var t=parseFloat(this.latTarget.value);return isNaN(t)?0:t}},{key:"lng",get:function(){var t=parseFloat(this.lngTarget.value);return isNaN(t)?0:t}},{key:"coords",get:function(){return[this.lat,this.lng]}},{key:"bounds",get:function(){return[[0,0],[this.svgOverlay.viewBox.baseVal.height,this.svgOverlay.viewBox.baseVal.width]]}},{key:"map",get:function(){return this._map||(this._map=s.a.map(this.mapTarget,{minZoom:0,maxZoom:5}).setView(this.coords,0),this._layer=s.a.tileLayer("".concat(this.element.dataset.site,"public/map/{z}/{y}/{x}.png"),{minNativeZoom:0,maxNativeZoom:5,noWrap:!0}).addTo(this._map)),this._map}}])&&l(e.prototype,n),r&&l(e,r),p}(o.b);v.targets=["lat","lng","map","overlay"]},function(t,e,n){"use strict";function r(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"===typeof t)return i(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 i(t,e)}(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=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 a,s=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw a}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function u(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=l(t);if(e){var i=l(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return c(this,n)}}function c(t,e){return!e||"object"!==typeof e&&"function"!==typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function l(t){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}n.r(e),n.d(e,"default",(function(){return h}));var h=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&&s(t,e)}(l,t);var e,n,i,c=u(l);function l(){return o(this,l),c.apply(this,arguments)}return e=l,(n=[{key:"connect",value:function(){var t=this;document.addEventListener("keydown",(function(e){t.codes.includes(e.keyCode)&&(t.empty||(e.preventDefault(),t.move(38===e.keyCode?"up":"down")))}))}},{key:"selected_rows",get:function(){return this._selected_rows||(this._selected_rows={}),this._selected_rows}},{key:"codes",get:function(){return this._codes||(this._codes=[38,40]),this._codes}},{key:"empty",get:function(){return 0===Object.keys(this.selected_rows).length}},{key:"sorted_rows",get:function(){return Object.values(this.selected_rows).sort((function(t,e){return t.order-e.order}))}},{key:"reorder",value:function(){for(var t=0,e=Object.values(this.selected_rows);t<e.length;t++){var n=e[t];this.selected_rows[n.row.id].order=this.rowTargets.indexOf(n.row)}var r=this.rowTargets.length;this.rowTargets.forEach((function(t,e){t.querySelector("[data-reorder]").value=r-e}))}},{key:"move",value:function(t){if(!this.empty){var e="up"===t,n=!e,i=e?"previousElementSibling":"nextElementSibling",o=this.sorted_rows;n&&o.reverse();var a,s=r(o);try{for(s.s();!(a=s.n()).done;){var u=a.value.row,c=u[i];c&&c.tagName===u.tagName&&(e?u.parentElement.insertBefore(u,c):u.parentElement.insertBefore(c,u))}}catch(l){s.e(l)}finally{s.f()}this.reorder(),o[0].row.scrollIntoView({block:"center"})}}},{key:"counter",value:function(){this.counterTarget.innerText=Object.keys(this.selected_rows).length}},{key:"unselect",value:function(t){t.preventDefault(),t.stopPropagation();for(var e=0,n=Object.values(this.selected_rows);e<n.length;e++)n[e].row.querySelector('[data-action="reorder#select"]').click()}},{key:"top",value:function(t){if(t.preventDefault(),t.stopPropagation(),!this.empty){var e,n=this.sorted_rows,i=n[0].row.parentElement.firstElementChild,o=r(n);try{for(o.s();!(e=o.n()).done;){var a=e.value.row;a!==i&&a.parentElement.insertBefore(a,i)}}catch(s){o.e(s)}finally{o.f()}this.reorder(),n[0].row.scrollIntoView({block:"center"})}}},{key:"bottom",value:function(t){if(t.preventDefault(),t.stopPropagation(),!this.empty){var e,n=this.sorted_rows,i=r(n);try{for(i.s();!(e=i.n()).done;){var o=e.value.row;o.parentElement.appendChild(o)}}catch(a){i.e(a)}finally{i.f()}this.reorder(),n[0].row.scrollIntoView({block:"center"})}}},{key:"select",value:function(t){var e=t.target.closest("tr");t.target.checked?this.selected_rows[e.id]={row:e,order:this.rowTargets.indexOf(e)}:delete this.selected_rows[e.id],this.counter()}},{key:"up",value:function(t){t.preventDefault(),t.stopPropagation(),this.empty||this.move("up")}},{key:"down",value:function(t){t.preventDefault(),t.stopPropagation(),this.empty||this.move("down")}}])&&a(e.prototype,n),i&&a(e,i),l}(n(56).b);h.targets=["row","counter"]},function(t,e,n){},function(t,e){document.addEventListener("turbolinks:load",(function(){document.querySelectorAll("a[href^='http://'],a[href^='https://'],a[href^='//']").forEach((function(t){t.rel="noopener",t.target="_blank"}))}))},function(t,e){document.addEventListener("turbolinks:load",(function(){document.querySelectorAll("input[type=file]").forEach((function(t){t.dataset.preview&&t.addEventListener("change",(function(e){0!==t.files.length&&(document.querySelector("#"+t.dataset.preview).src=window.URL.createObjectURL(t.files[0]))}))}))}))},function(t,e){document.addEventListener("turbolinks:load",(function(){document.querySelectorAll('input[type="date"]').forEach((function(t){"date"!==t.type&&t.addEventListener("change",(function(e){t.setCustomValidity(t.validity.patternMismatch?t.dataset.patternMismatch:"")}))}))}))},function(t,e,n){"use strict";var r=n(11),i=n(515),o=n(519),a=n(520),s=n(528),u=n(542),c=n(555),l=n(221),h=n(557),f={default:n(558),zero:n(559),commonmark:n(560)},d=/^(vbscript|javascript|file|data):/,p=/^data:image\/(gif|png|jpeg|webp);/;function v(t){var e=t.trim().toLowerCase();return!d.test(e)||!!p.test(e)}var m=["http:","https:","mailto:"];function g(t){var e=l.parse(t,!0);if(e.hostname&&(!e.protocol||m.indexOf(e.protocol)>=0))try{e.hostname=h.toASCII(e.hostname)}catch(n){}return l.encode(l.format(e))}function y(t){var e=l.parse(t,!0);if(e.hostname&&(!e.protocol||m.indexOf(e.protocol)>=0))try{e.hostname=h.toUnicode(e.hostname)}catch(n){}return l.decode(l.format(e))}function b(t,e){if(!(this instanceof b))return new b(t,e);e||r.isString(t)||(e=t||{},t="default"),this.inline=new u,this.block=new s,this.core=new a,this.renderer=new o,this.linkify=new c,this.validateLink=v,this.normalizeLink=g,this.normalizeLinkText=y,this.utils=r,this.helpers=r.assign({},i),this.options={},this.configure(t),e&&this.set(e)}b.prototype.set=function(t){return r.assign(this.options,t),this},b.prototype.configure=function(t){var e,n=this;if(r.isString(t)&&!(t=f[e=t]))throw new Error('Wrong `markdown-it` preset "'+e+'", check name');if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&n.set(t.options),t.components&&Object.keys(t.components).forEach((function(e){t.components[e].rules&&n[e].ruler.enableOnly(t.components[e].rules),t.components[e].rules2&&n[e].ruler2.enableOnly(t.components[e].rules2)})),this},b.prototype.enable=function(t,e){var n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach((function(e){n=n.concat(this[e].ruler.enable(t,!0))}),this),n=n.concat(this.inline.ruler2.enable(t,!0));var r=t.filter((function(t){return n.indexOf(t)<0}));if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},b.prototype.disable=function(t,e){var n=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach((function(e){n=n.concat(this[e].ruler.disable(t,!0))}),this),n=n.concat(this.inline.ruler2.disable(t,!0));var r=t.filter((function(t){return n.indexOf(t)<0}));if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},b.prototype.use=function(t){var e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this},b.prototype.parse=function(t,e){if("string"!==typeof t)throw new Error("Input data should be a String");var n=new this.core.State(t,this,e);return this.core.process(n),n.tokens},b.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)},b.prototype.parseInline=function(t,e){var n=new this.core.State(t,this,e);return n.inlineMode=!0,this.core.process(n),n.tokens},b.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)},t.exports=b},function(t){t.exports=JSON.parse('{"Aacute":"\xc1","aacute":"\xe1","Abreve":"\u0102","abreve":"\u0103","ac":"\u223e","acd":"\u223f","acE":"\u223e\u0333","Acirc":"\xc2","acirc":"\xe2","acute":"\xb4","Acy":"\u0410","acy":"\u0430","AElig":"\xc6","aelig":"\xe6","af":"\u2061","Afr":"\ud835\udd04","afr":"\ud835\udd1e","Agrave":"\xc0","agrave":"\xe0","alefsym":"\u2135","aleph":"\u2135","Alpha":"\u0391","alpha":"\u03b1","Amacr":"\u0100","amacr":"\u0101","amalg":"\u2a3f","amp":"&","AMP":"&","andand":"\u2a55","And":"\u2a53","and":"\u2227","andd":"\u2a5c","andslope":"\u2a58","andv":"\u2a5a","ang":"\u2220","ange":"\u29a4","angle":"\u2220","angmsdaa":"\u29a8","angmsdab":"\u29a9","angmsdac":"\u29aa","angmsdad":"\u29ab","angmsdae":"\u29ac","angmsdaf":"\u29ad","angmsdag":"\u29ae","angmsdah":"\u29af","angmsd":"\u2221","angrt":"\u221f","angrtvb":"\u22be","angrtvbd":"\u299d","angsph":"\u2222","angst":"\xc5","angzarr":"\u237c","Aogon":"\u0104","aogon":"\u0105","Aopf":"\ud835\udd38","aopf":"\ud835\udd52","apacir":"\u2a6f","ap":"\u2248","apE":"\u2a70","ape":"\u224a","apid":"\u224b","apos":"\'","ApplyFunction":"\u2061","approx":"\u2248","approxeq":"\u224a","Aring":"\xc5","aring":"\xe5","Ascr":"\ud835\udc9c","ascr":"\ud835\udcb6","Assign":"\u2254","ast":"*","asymp":"\u2248","asympeq":"\u224d","Atilde":"\xc3","atilde":"\xe3","Auml":"\xc4","auml":"\xe4","awconint":"\u2233","awint":"\u2a11","backcong":"\u224c","backepsilon":"\u03f6","backprime":"\u2035","backsim":"\u223d","backsimeq":"\u22cd","Backslash":"\u2216","Barv":"\u2ae7","barvee":"\u22bd","barwed":"\u2305","Barwed":"\u2306","barwedge":"\u2305","bbrk":"\u23b5","bbrktbrk":"\u23b6","bcong":"\u224c","Bcy":"\u0411","bcy":"\u0431","bdquo":"\u201e","becaus":"\u2235","because":"\u2235","Because":"\u2235","bemptyv":"\u29b0","bepsi":"\u03f6","bernou":"\u212c","Bernoullis":"\u212c","Beta":"\u0392","beta":"\u03b2","beth":"\u2136","between":"\u226c","Bfr":"\ud835\udd05","bfr":"\ud835\udd1f","bigcap":"\u22c2","bigcirc":"\u25ef","bigcup":"\u22c3","bigodot":"\u2a00","bigoplus":"\u2a01","bigotimes":"\u2a02","bigsqcup":"\u2a06","bigstar":"\u2605","bigtriangledown":"\u25bd","bigtriangleup":"\u25b3","biguplus":"\u2a04","bigvee":"\u22c1","bigwedge":"\u22c0","bkarow":"\u290d","blacklozenge":"\u29eb","blacksquare":"\u25aa","blacktriangle":"\u25b4","blacktriangledown":"\u25be","blacktriangleleft":"\u25c2","blacktriangleright":"\u25b8","blank":"\u2423","blk12":"\u2592","blk14":"\u2591","blk34":"\u2593","block":"\u2588","bne":"=\u20e5","bnequiv":"\u2261\u20e5","bNot":"\u2aed","bnot":"\u2310","Bopf":"\ud835\udd39","bopf":"\ud835\udd53","bot":"\u22a5","bottom":"\u22a5","bowtie":"\u22c8","boxbox":"\u29c9","boxdl":"\u2510","boxdL":"\u2555","boxDl":"\u2556","boxDL":"\u2557","boxdr":"\u250c","boxdR":"\u2552","boxDr":"\u2553","boxDR":"\u2554","boxh":"\u2500","boxH":"\u2550","boxhd":"\u252c","boxHd":"\u2564","boxhD":"\u2565","boxHD":"\u2566","boxhu":"\u2534","boxHu":"\u2567","boxhU":"\u2568","boxHU":"\u2569","boxminus":"\u229f","boxplus":"\u229e","boxtimes":"\u22a0","boxul":"\u2518","boxuL":"\u255b","boxUl":"\u255c","boxUL":"\u255d","boxur":"\u2514","boxuR":"\u2558","boxUr":"\u2559","boxUR":"\u255a","boxv":"\u2502","boxV":"\u2551","boxvh":"\u253c","boxvH":"\u256a","boxVh":"\u256b","boxVH":"\u256c","boxvl":"\u2524","boxvL":"\u2561","boxVl":"\u2562","boxVL":"\u2563","boxvr":"\u251c","boxvR":"\u255e","boxVr":"\u255f","boxVR":"\u2560","bprime":"\u2035","breve":"\u02d8","Breve":"\u02d8","brvbar":"\xa6","bscr":"\ud835\udcb7","Bscr":"\u212c","bsemi":"\u204f","bsim":"\u223d","bsime":"\u22cd","bsolb":"\u29c5","bsol":"\\\\","bsolhsub":"\u27c8","bull":"\u2022","bullet":"\u2022","bump":"\u224e","bumpE":"\u2aae","bumpe":"\u224f","Bumpeq":"\u224e","bumpeq":"\u224f","Cacute":"\u0106","cacute":"\u0107","capand":"\u2a44","capbrcup":"\u2a49","capcap":"\u2a4b","cap":"\u2229","Cap":"\u22d2","capcup":"\u2a47","capdot":"\u2a40","CapitalDifferentialD":"\u2145","caps":"\u2229\ufe00","caret":"\u2041","caron":"\u02c7","Cayleys":"\u212d","ccaps":"\u2a4d","Ccaron":"\u010c","ccaron":"\u010d","Ccedil":"\xc7","ccedil":"\xe7","Ccirc":"\u0108","ccirc":"\u0109","Cconint":"\u2230","ccups":"\u2a4c","ccupssm":"\u2a50","Cdot":"\u010a","cdot":"\u010b","cedil":"\xb8","Cedilla":"\xb8","cemptyv":"\u29b2","cent":"\xa2","centerdot":"\xb7","CenterDot":"\xb7","cfr":"\ud835\udd20","Cfr":"\u212d","CHcy":"\u0427","chcy":"\u0447","check":"\u2713","checkmark":"\u2713","Chi":"\u03a7","chi":"\u03c7","circ":"\u02c6","circeq":"\u2257","circlearrowleft":"\u21ba","circlearrowright":"\u21bb","circledast":"\u229b","circledcirc":"\u229a","circleddash":"\u229d","CircleDot":"\u2299","circledR":"\xae","circledS":"\u24c8","CircleMinus":"\u2296","CirclePlus":"\u2295","CircleTimes":"\u2297","cir":"\u25cb","cirE":"\u29c3","cire":"\u2257","cirfnint":"\u2a10","cirmid":"\u2aef","cirscir":"\u29c2","ClockwiseContourIntegral":"\u2232","CloseCurlyDoubleQuote":"\u201d","CloseCurlyQuote":"\u2019","clubs":"\u2663","clubsuit":"\u2663","colon":":","Colon":"\u2237","Colone":"\u2a74","colone":"\u2254","coloneq":"\u2254","comma":",","commat":"@","comp":"\u2201","compfn":"\u2218","complement":"\u2201","complexes":"\u2102","cong":"\u2245","congdot":"\u2a6d","Congruent":"\u2261","conint":"\u222e","Conint":"\u222f","ContourIntegral":"\u222e","copf":"\ud835\udd54","Copf":"\u2102","coprod":"\u2210","Coproduct":"\u2210","copy":"\xa9","COPY":"\xa9","copysr":"\u2117","CounterClockwiseContourIntegral":"\u2233","crarr":"\u21b5","cross":"\u2717","Cross":"\u2a2f","Cscr":"\ud835\udc9e","cscr":"\ud835\udcb8","csub":"\u2acf","csube":"\u2ad1","csup":"\u2ad0","csupe":"\u2ad2","ctdot":"\u22ef","cudarrl":"\u2938","cudarrr":"\u2935","cuepr":"\u22de","cuesc":"\u22df","cularr":"\u21b6","cularrp":"\u293d","cupbrcap":"\u2a48","cupcap":"\u2a46","CupCap":"\u224d","cup":"\u222a","Cup":"\u22d3","cupcup":"\u2a4a","cupdot":"\u228d","cupor":"\u2a45","cups":"\u222a\ufe00","curarr":"\u21b7","curarrm":"\u293c","curlyeqprec":"\u22de","curlyeqsucc":"\u22df","curlyvee":"\u22ce","curlywedge":"\u22cf","curren":"\xa4","curvearrowleft":"\u21b6","curvearrowright":"\u21b7","cuvee":"\u22ce","cuwed":"\u22cf","cwconint":"\u2232","cwint":"\u2231","cylcty":"\u232d","dagger":"\u2020","Dagger":"\u2021","daleth":"\u2138","darr":"\u2193","Darr":"\u21a1","dArr":"\u21d3","dash":"\u2010","Dashv":"\u2ae4","dashv":"\u22a3","dbkarow":"\u290f","dblac":"\u02dd","Dcaron":"\u010e","dcaron":"\u010f","Dcy":"\u0414","dcy":"\u0434","ddagger":"\u2021","ddarr":"\u21ca","DD":"\u2145","dd":"\u2146","DDotrahd":"\u2911","ddotseq":"\u2a77","deg":"\xb0","Del":"\u2207","Delta":"\u0394","delta":"\u03b4","demptyv":"\u29b1","dfisht":"\u297f","Dfr":"\ud835\udd07","dfr":"\ud835\udd21","dHar":"\u2965","dharl":"\u21c3","dharr":"\u21c2","DiacriticalAcute":"\xb4","DiacriticalDot":"\u02d9","DiacriticalDoubleAcute":"\u02dd","DiacriticalGrave":"`","DiacriticalTilde":"\u02dc","diam":"\u22c4","diamond":"\u22c4","Diamond":"\u22c4","diamondsuit":"\u2666","diams":"\u2666","die":"\xa8","DifferentialD":"\u2146","digamma":"\u03dd","disin":"\u22f2","div":"\xf7","divide":"\xf7","divideontimes":"\u22c7","divonx":"\u22c7","DJcy":"\u0402","djcy":"\u0452","dlcorn":"\u231e","dlcrop":"\u230d","dollar":"$","Dopf":"\ud835\udd3b","dopf":"\ud835\udd55","Dot":"\xa8","dot":"\u02d9","DotDot":"\u20dc","doteq":"\u2250","doteqdot":"\u2251","DotEqual":"\u2250","dotminus":"\u2238","dotplus":"\u2214","dotsquare":"\u22a1","doublebarwedge":"\u2306","DoubleContourIntegral":"\u222f","DoubleDot":"\xa8","DoubleDownArrow":"\u21d3","DoubleLeftArrow":"\u21d0","DoubleLeftRightArrow":"\u21d4","DoubleLeftTee":"\u2ae4","DoubleLongLeftArrow":"\u27f8","DoubleLongLeftRightArrow":"\u27fa","DoubleLongRightArrow":"\u27f9","DoubleRightArrow":"\u21d2","DoubleRightTee":"\u22a8","DoubleUpArrow":"\u21d1","DoubleUpDownArrow":"\u21d5","DoubleVerticalBar":"\u2225","DownArrowBar":"\u2913","downarrow":"\u2193","DownArrow":"\u2193","Downarrow":"\u21d3","DownArrowUpArrow":"\u21f5","DownBreve":"\u0311","downdownarrows":"\u21ca","downharpoonleft":"\u21c3","downharpoonright":"\u21c2","DownLeftRightVector":"\u2950","DownLeftTeeVector":"\u295e","DownLeftVectorBar":"\u2956","DownLeftVector":"\u21bd","DownRightTeeVector":"\u295f","DownRightVectorBar":"\u2957","DownRightVector":"\u21c1","DownTeeArrow":"\u21a7","DownTee":"\u22a4","drbkarow":"\u2910","drcorn":"\u231f","drcrop":"\u230c","Dscr":"\ud835\udc9f","dscr":"\ud835\udcb9","DScy":"\u0405","dscy":"\u0455","dsol":"\u29f6","Dstrok":"\u0110","dstrok":"\u0111","dtdot":"\u22f1","dtri":"\u25bf","dtrif":"\u25be","duarr":"\u21f5","duhar":"\u296f","dwangle":"\u29a6","DZcy":"\u040f","dzcy":"\u045f","dzigrarr":"\u27ff","Eacute":"\xc9","eacute":"\xe9","easter":"\u2a6e","Ecaron":"\u011a","ecaron":"\u011b","Ecirc":"\xca","ecirc":"\xea","ecir":"\u2256","ecolon":"\u2255","Ecy":"\u042d","ecy":"\u044d","eDDot":"\u2a77","Edot":"\u0116","edot":"\u0117","eDot":"\u2251","ee":"\u2147","efDot":"\u2252","Efr":"\ud835\udd08","efr":"\ud835\udd22","eg":"\u2a9a","Egrave":"\xc8","egrave":"\xe8","egs":"\u2a96","egsdot":"\u2a98","el":"\u2a99","Element":"\u2208","elinters":"\u23e7","ell":"\u2113","els":"\u2a95","elsdot":"\u2a97","Emacr":"\u0112","emacr":"\u0113","empty":"\u2205","emptyset":"\u2205","EmptySmallSquare":"\u25fb","emptyv":"\u2205","EmptyVerySmallSquare":"\u25ab","emsp13":"\u2004","emsp14":"\u2005","emsp":"\u2003","ENG":"\u014a","eng":"\u014b","ensp":"\u2002","Eogon":"\u0118","eogon":"\u0119","Eopf":"\ud835\udd3c","eopf":"\ud835\udd56","epar":"\u22d5","eparsl":"\u29e3","eplus":"\u2a71","epsi":"\u03b5","Epsilon":"\u0395","epsilon":"\u03b5","epsiv":"\u03f5","eqcirc":"\u2256","eqcolon":"\u2255","eqsim":"\u2242","eqslantgtr":"\u2a96","eqslantless":"\u2a95","Equal":"\u2a75","equals":"=","EqualTilde":"\u2242","equest":"\u225f","Equilibrium":"\u21cc","equiv":"\u2261","equivDD":"\u2a78","eqvparsl":"\u29e5","erarr":"\u2971","erDot":"\u2253","escr":"\u212f","Escr":"\u2130","esdot":"\u2250","Esim":"\u2a73","esim":"\u2242","Eta":"\u0397","eta":"\u03b7","ETH":"\xd0","eth":"\xf0","Euml":"\xcb","euml":"\xeb","euro":"\u20ac","excl":"!","exist":"\u2203","Exists":"\u2203","expectation":"\u2130","exponentiale":"\u2147","ExponentialE":"\u2147","fallingdotseq":"\u2252","Fcy":"\u0424","fcy":"\u0444","female":"\u2640","ffilig":"\ufb03","fflig":"\ufb00","ffllig":"\ufb04","Ffr":"\ud835\udd09","ffr":"\ud835\udd23","filig":"\ufb01","FilledSmallSquare":"\u25fc","FilledVerySmallSquare":"\u25aa","fjlig":"fj","flat":"\u266d","fllig":"\ufb02","fltns":"\u25b1","fnof":"\u0192","Fopf":"\ud835\udd3d","fopf":"\ud835\udd57","forall":"\u2200","ForAll":"\u2200","fork":"\u22d4","forkv":"\u2ad9","Fouriertrf":"\u2131","fpartint":"\u2a0d","frac12":"\xbd","frac13":"\u2153","frac14":"\xbc","frac15":"\u2155","frac16":"\u2159","frac18":"\u215b","frac23":"\u2154","frac25":"\u2156","frac34":"\xbe","frac35":"\u2157","frac38":"\u215c","frac45":"\u2158","frac56":"\u215a","frac58":"\u215d","frac78":"\u215e","frasl":"\u2044","frown":"\u2322","fscr":"\ud835\udcbb","Fscr":"\u2131","gacute":"\u01f5","Gamma":"\u0393","gamma":"\u03b3","Gammad":"\u03dc","gammad":"\u03dd","gap":"\u2a86","Gbreve":"\u011e","gbreve":"\u011f","Gcedil":"\u0122","Gcirc":"\u011c","gcirc":"\u011d","Gcy":"\u0413","gcy":"\u0433","Gdot":"\u0120","gdot":"\u0121","ge":"\u2265","gE":"\u2267","gEl":"\u2a8c","gel":"\u22db","geq":"\u2265","geqq":"\u2267","geqslant":"\u2a7e","gescc":"\u2aa9","ges":"\u2a7e","gesdot":"\u2a80","gesdoto":"\u2a82","gesdotol":"\u2a84","gesl":"\u22db\ufe00","gesles":"\u2a94","Gfr":"\ud835\udd0a","gfr":"\ud835\udd24","gg":"\u226b","Gg":"\u22d9","ggg":"\u22d9","gimel":"\u2137","GJcy":"\u0403","gjcy":"\u0453","gla":"\u2aa5","gl":"\u2277","glE":"\u2a92","glj":"\u2aa4","gnap":"\u2a8a","gnapprox":"\u2a8a","gne":"\u2a88","gnE":"\u2269","gneq":"\u2a88","gneqq":"\u2269","gnsim":"\u22e7","Gopf":"\ud835\udd3e","gopf":"\ud835\udd58","grave":"`","GreaterEqual":"\u2265","GreaterEqualLess":"\u22db","GreaterFullEqual":"\u2267","GreaterGreater":"\u2aa2","GreaterLess":"\u2277","GreaterSlantEqual":"\u2a7e","GreaterTilde":"\u2273","Gscr":"\ud835\udca2","gscr":"\u210a","gsim":"\u2273","gsime":"\u2a8e","gsiml":"\u2a90","gtcc":"\u2aa7","gtcir":"\u2a7a","gt":">","GT":">","Gt":"\u226b","gtdot":"\u22d7","gtlPar":"\u2995","gtquest":"\u2a7c","gtrapprox":"\u2a86","gtrarr":"\u2978","gtrdot":"\u22d7","gtreqless":"\u22db","gtreqqless":"\u2a8c","gtrless":"\u2277","gtrsim":"\u2273","gvertneqq":"\u2269\ufe00","gvnE":"\u2269\ufe00","Hacek":"\u02c7","hairsp":"\u200a","half":"\xbd","hamilt":"\u210b","HARDcy":"\u042a","hardcy":"\u044a","harrcir":"\u2948","harr":"\u2194","hArr":"\u21d4","harrw":"\u21ad","Hat":"^","hbar":"\u210f","Hcirc":"\u0124","hcirc":"\u0125","hearts":"\u2665","heartsuit":"\u2665","hellip":"\u2026","hercon":"\u22b9","hfr":"\ud835\udd25","Hfr":"\u210c","HilbertSpace":"\u210b","hksearow":"\u2925","hkswarow":"\u2926","hoarr":"\u21ff","homtht":"\u223b","hookleftarrow":"\u21a9","hookrightarrow":"\u21aa","hopf":"\ud835\udd59","Hopf":"\u210d","horbar":"\u2015","HorizontalLine":"\u2500","hscr":"\ud835\udcbd","Hscr":"\u210b","hslash":"\u210f","Hstrok":"\u0126","hstrok":"\u0127","HumpDownHump":"\u224e","HumpEqual":"\u224f","hybull":"\u2043","hyphen":"\u2010","Iacute":"\xcd","iacute":"\xed","ic":"\u2063","Icirc":"\xce","icirc":"\xee","Icy":"\u0418","icy":"\u0438","Idot":"\u0130","IEcy":"\u0415","iecy":"\u0435","iexcl":"\xa1","iff":"\u21d4","ifr":"\ud835\udd26","Ifr":"\u2111","Igrave":"\xcc","igrave":"\xec","ii":"\u2148","iiiint":"\u2a0c","iiint":"\u222d","iinfin":"\u29dc","iiota":"\u2129","IJlig":"\u0132","ijlig":"\u0133","Imacr":"\u012a","imacr":"\u012b","image":"\u2111","ImaginaryI":"\u2148","imagline":"\u2110","imagpart":"\u2111","imath":"\u0131","Im":"\u2111","imof":"\u22b7","imped":"\u01b5","Implies":"\u21d2","incare":"\u2105","in":"\u2208","infin":"\u221e","infintie":"\u29dd","inodot":"\u0131","intcal":"\u22ba","int":"\u222b","Int":"\u222c","integers":"\u2124","Integral":"\u222b","intercal":"\u22ba","Intersection":"\u22c2","intlarhk":"\u2a17","intprod":"\u2a3c","InvisibleComma":"\u2063","InvisibleTimes":"\u2062","IOcy":"\u0401","iocy":"\u0451","Iogon":"\u012e","iogon":"\u012f","Iopf":"\ud835\udd40","iopf":"\ud835\udd5a","Iota":"\u0399","iota":"\u03b9","iprod":"\u2a3c","iquest":"\xbf","iscr":"\ud835\udcbe","Iscr":"\u2110","isin":"\u2208","isindot":"\u22f5","isinE":"\u22f9","isins":"\u22f4","isinsv":"\u22f3","isinv":"\u2208","it":"\u2062","Itilde":"\u0128","itilde":"\u0129","Iukcy":"\u0406","iukcy":"\u0456","Iuml":"\xcf","iuml":"\xef","Jcirc":"\u0134","jcirc":"\u0135","Jcy":"\u0419","jcy":"\u0439","Jfr":"\ud835\udd0d","jfr":"\ud835\udd27","jmath":"\u0237","Jopf":"\ud835\udd41","jopf":"\ud835\udd5b","Jscr":"\ud835\udca5","jscr":"\ud835\udcbf","Jsercy":"\u0408","jsercy":"\u0458","Jukcy":"\u0404","jukcy":"\u0454","Kappa":"\u039a","kappa":"\u03ba","kappav":"\u03f0","Kcedil":"\u0136","kcedil":"\u0137","Kcy":"\u041a","kcy":"\u043a","Kfr":"\ud835\udd0e","kfr":"\ud835\udd28","kgreen":"\u0138","KHcy":"\u0425","khcy":"\u0445","KJcy":"\u040c","kjcy":"\u045c","Kopf":"\ud835\udd42","kopf":"\ud835\udd5c","Kscr":"\ud835\udca6","kscr":"\ud835\udcc0","lAarr":"\u21da","Lacute":"\u0139","lacute":"\u013a","laemptyv":"\u29b4","lagran":"\u2112","Lambda":"\u039b","lambda":"\u03bb","lang":"\u27e8","Lang":"\u27ea","langd":"\u2991","langle":"\u27e8","lap":"\u2a85","Laplacetrf":"\u2112","laquo":"\xab","larrb":"\u21e4","larrbfs":"\u291f","larr":"\u2190","Larr":"\u219e","lArr":"\u21d0","larrfs":"\u291d","larrhk":"\u21a9","larrlp":"\u21ab","larrpl":"\u2939","larrsim":"\u2973","larrtl":"\u21a2","latail":"\u2919","lAtail":"\u291b","lat":"\u2aab","late":"\u2aad","lates":"\u2aad\ufe00","lbarr":"\u290c","lBarr":"\u290e","lbbrk":"\u2772","lbrace":"{","lbrack":"[","lbrke":"\u298b","lbrksld":"\u298f","lbrkslu":"\u298d","Lcaron":"\u013d","lcaron":"\u013e","Lcedil":"\u013b","lcedil":"\u013c","lceil":"\u2308","lcub":"{","Lcy":"\u041b","lcy":"\u043b","ldca":"\u2936","ldquo":"\u201c","ldquor":"\u201e","ldrdhar":"\u2967","ldrushar":"\u294b","ldsh":"\u21b2","le":"\u2264","lE":"\u2266","LeftAngleBracket":"\u27e8","LeftArrowBar":"\u21e4","leftarrow":"\u2190","LeftArrow":"\u2190","Leftarrow":"\u21d0","LeftArrowRightArrow":"\u21c6","leftarrowtail":"\u21a2","LeftCeiling":"\u2308","LeftDoubleBracket":"\u27e6","LeftDownTeeVector":"\u2961","LeftDownVectorBar":"\u2959","LeftDownVector":"\u21c3","LeftFloor":"\u230a","leftharpoondown":"\u21bd","leftharpoonup":"\u21bc","leftleftarrows":"\u21c7","leftrightarrow":"\u2194","LeftRightArrow":"\u2194","Leftrightarrow":"\u21d4","leftrightarrows":"\u21c6","leftrightharpoons":"\u21cb","leftrightsquigarrow":"\u21ad","LeftRightVector":"\u294e","LeftTeeArrow":"\u21a4","LeftTee":"\u22a3","LeftTeeVector":"\u295a","leftthreetimes":"\u22cb","LeftTriangleBar":"\u29cf","LeftTriangle":"\u22b2","LeftTriangleEqual":"\u22b4","LeftUpDownVector":"\u2951","LeftUpTeeVector":"\u2960","LeftUpVectorBar":"\u2958","LeftUpVector":"\u21bf","LeftVectorBar":"\u2952","LeftVector":"\u21bc","lEg":"\u2a8b","leg":"\u22da","leq":"\u2264","leqq":"\u2266","leqslant":"\u2a7d","lescc":"\u2aa8","les":"\u2a7d","lesdot":"\u2a7f","lesdoto":"\u2a81","lesdotor":"\u2a83","lesg":"\u22da\ufe00","lesges":"\u2a93","lessapprox":"\u2a85","lessdot":"\u22d6","lesseqgtr":"\u22da","lesseqqgtr":"\u2a8b","LessEqualGreater":"\u22da","LessFullEqual":"\u2266","LessGreater":"\u2276","lessgtr":"\u2276","LessLess":"\u2aa1","lesssim":"\u2272","LessSlantEqual":"\u2a7d","LessTilde":"\u2272","lfisht":"\u297c","lfloor":"\u230a","Lfr":"\ud835\udd0f","lfr":"\ud835\udd29","lg":"\u2276","lgE":"\u2a91","lHar":"\u2962","lhard":"\u21bd","lharu":"\u21bc","lharul":"\u296a","lhblk":"\u2584","LJcy":"\u0409","ljcy":"\u0459","llarr":"\u21c7","ll":"\u226a","Ll":"\u22d8","llcorner":"\u231e","Lleftarrow":"\u21da","llhard":"\u296b","lltri":"\u25fa","Lmidot":"\u013f","lmidot":"\u0140","lmoustache":"\u23b0","lmoust":"\u23b0","lnap":"\u2a89","lnapprox":"\u2a89","lne":"\u2a87","lnE":"\u2268","lneq":"\u2a87","lneqq":"\u2268","lnsim":"\u22e6","loang":"\u27ec","loarr":"\u21fd","lobrk":"\u27e6","longleftarrow":"\u27f5","LongLeftArrow":"\u27f5","Longleftarrow":"\u27f8","longleftrightarrow":"\u27f7","LongLeftRightArrow":"\u27f7","Longleftrightarrow":"\u27fa","longmapsto":"\u27fc","longrightarrow":"\u27f6","LongRightArrow":"\u27f6","Longrightarrow":"\u27f9","looparrowleft":"\u21ab","looparrowright":"\u21ac","lopar":"\u2985","Lopf":"\ud835\udd43","lopf":"\ud835\udd5d","loplus":"\u2a2d","lotimes":"\u2a34","lowast":"\u2217","lowbar":"_","LowerLeftArrow":"\u2199","LowerRightArrow":"\u2198","loz":"\u25ca","lozenge":"\u25ca","lozf":"\u29eb","lpar":"(","lparlt":"\u2993","lrarr":"\u21c6","lrcorner":"\u231f","lrhar":"\u21cb","lrhard":"\u296d","lrm":"\u200e","lrtri":"\u22bf","lsaquo":"\u2039","lscr":"\ud835\udcc1","Lscr":"\u2112","lsh":"\u21b0","Lsh":"\u21b0","lsim":"\u2272","lsime":"\u2a8d","lsimg":"\u2a8f","lsqb":"[","lsquo":"\u2018","lsquor":"\u201a","Lstrok":"\u0141","lstrok":"\u0142","ltcc":"\u2aa6","ltcir":"\u2a79","lt":"<","LT":"<","Lt":"\u226a","ltdot":"\u22d6","lthree":"\u22cb","ltimes":"\u22c9","ltlarr":"\u2976","ltquest":"\u2a7b","ltri":"\u25c3","ltrie":"\u22b4","ltrif":"\u25c2","ltrPar":"\u2996","lurdshar":"\u294a","luruhar":"\u2966","lvertneqq":"\u2268\ufe00","lvnE":"\u2268\ufe00","macr":"\xaf","male":"\u2642","malt":"\u2720","maltese":"\u2720","Map":"\u2905","map":"\u21a6","mapsto":"\u21a6","mapstodown":"\u21a7","mapstoleft":"\u21a4","mapstoup":"\u21a5","marker":"\u25ae","mcomma":"\u2a29","Mcy":"\u041c","mcy":"\u043c","mdash":"\u2014","mDDot":"\u223a","measuredangle":"\u2221","MediumSpace":"\u205f","Mellintrf":"\u2133","Mfr":"\ud835\udd10","mfr":"\ud835\udd2a","mho":"\u2127","micro":"\xb5","midast":"*","midcir":"\u2af0","mid":"\u2223","middot":"\xb7","minusb":"\u229f","minus":"\u2212","minusd":"\u2238","minusdu":"\u2a2a","MinusPlus":"\u2213","mlcp":"\u2adb","mldr":"\u2026","mnplus":"\u2213","models":"\u22a7","Mopf":"\ud835\udd44","mopf":"\ud835\udd5e","mp":"\u2213","mscr":"\ud835\udcc2","Mscr":"\u2133","mstpos":"\u223e","Mu":"\u039c","mu":"\u03bc","multimap":"\u22b8","mumap":"\u22b8","nabla":"\u2207","Nacute":"\u0143","nacute":"\u0144","nang":"\u2220\u20d2","nap":"\u2249","napE":"\u2a70\u0338","napid":"\u224b\u0338","napos":"\u0149","napprox":"\u2249","natural":"\u266e","naturals":"\u2115","natur":"\u266e","nbsp":"\xa0","nbump":"\u224e\u0338","nbumpe":"\u224f\u0338","ncap":"\u2a43","Ncaron":"\u0147","ncaron":"\u0148","Ncedil":"\u0145","ncedil":"\u0146","ncong":"\u2247","ncongdot":"\u2a6d\u0338","ncup":"\u2a42","Ncy":"\u041d","ncy":"\u043d","ndash":"\u2013","nearhk":"\u2924","nearr":"\u2197","neArr":"\u21d7","nearrow":"\u2197","ne":"\u2260","nedot":"\u2250\u0338","NegativeMediumSpace":"\u200b","NegativeThickSpace":"\u200b","NegativeThinSpace":"\u200b","NegativeVeryThinSpace":"\u200b","nequiv":"\u2262","nesear":"\u2928","nesim":"\u2242\u0338","NestedGreaterGreater":"\u226b","NestedLessLess":"\u226a","NewLine":"\\n","nexist":"\u2204","nexists":"\u2204","Nfr":"\ud835\udd11","nfr":"\ud835\udd2b","ngE":"\u2267\u0338","nge":"\u2271","ngeq":"\u2271","ngeqq":"\u2267\u0338","ngeqslant":"\u2a7e\u0338","nges":"\u2a7e\u0338","nGg":"\u22d9\u0338","ngsim":"\u2275","nGt":"\u226b\u20d2","ngt":"\u226f","ngtr":"\u226f","nGtv":"\u226b\u0338","nharr":"\u21ae","nhArr":"\u21ce","nhpar":"\u2af2","ni":"\u220b","nis":"\u22fc","nisd":"\u22fa","niv":"\u220b","NJcy":"\u040a","njcy":"\u045a","nlarr":"\u219a","nlArr":"\u21cd","nldr":"\u2025","nlE":"\u2266\u0338","nle":"\u2270","nleftarrow":"\u219a","nLeftarrow":"\u21cd","nleftrightarrow":"\u21ae","nLeftrightarrow":"\u21ce","nleq":"\u2270","nleqq":"\u2266\u0338","nleqslant":"\u2a7d\u0338","nles":"\u2a7d\u0338","nless":"\u226e","nLl":"\u22d8\u0338","nlsim":"\u2274","nLt":"\u226a\u20d2","nlt":"\u226e","nltri":"\u22ea","nltrie":"\u22ec","nLtv":"\u226a\u0338","nmid":"\u2224","NoBreak":"\u2060","NonBreakingSpace":"\xa0","nopf":"\ud835\udd5f","Nopf":"\u2115","Not":"\u2aec","not":"\xac","NotCongruent":"\u2262","NotCupCap":"\u226d","NotDoubleVerticalBar":"\u2226","NotElement":"\u2209","NotEqual":"\u2260","NotEqualTilde":"\u2242\u0338","NotExists":"\u2204","NotGreater":"\u226f","NotGreaterEqual":"\u2271","NotGreaterFullEqual":"\u2267\u0338","NotGreaterGreater":"\u226b\u0338","NotGreaterLess":"\u2279","NotGreaterSlantEqual":"\u2a7e\u0338","NotGreaterTilde":"\u2275","NotHumpDownHump":"\u224e\u0338","NotHumpEqual":"\u224f\u0338","notin":"\u2209","notindot":"\u22f5\u0338","notinE":"\u22f9\u0338","notinva":"\u2209","notinvb":"\u22f7","notinvc":"\u22f6","NotLeftTriangleBar":"\u29cf\u0338","NotLeftTriangle":"\u22ea","NotLeftTriangleEqual":"\u22ec","NotLess":"\u226e","NotLessEqual":"\u2270","NotLessGreater":"\u2278","NotLessLess":"\u226a\u0338","NotLessSlantEqual":"\u2a7d\u0338","NotLessTilde":"\u2274","NotNestedGreaterGreater":"\u2aa2\u0338","NotNestedLessLess":"\u2aa1\u0338","notni":"\u220c","notniva":"\u220c","notnivb":"\u22fe","notnivc":"\u22fd","NotPrecedes":"\u2280","NotPrecedesEqual":"\u2aaf\u0338","NotPrecedesSlantEqual":"\u22e0","NotReverseElement":"\u220c","NotRightTriangleBar":"\u29d0\u0338","NotRightTriangle":"\u22eb","NotRightTriangleEqual":"\u22ed","NotSquareSubset":"\u228f\u0338","NotSquareSubsetEqual":"\u22e2","NotSquareSuperset":"\u2290\u0338","NotSquareSupersetEqual":"\u22e3","NotSubset":"\u2282\u20d2","NotSubsetEqual":"\u2288","NotSucceeds":"\u2281","NotSucceedsEqual":"\u2ab0\u0338","NotSucceedsSlantEqual":"\u22e1","NotSucceedsTilde":"\u227f\u0338","NotSuperset":"\u2283\u20d2","NotSupersetEqual":"\u2289","NotTilde":"\u2241","NotTildeEqual":"\u2244","NotTildeFullEqual":"\u2247","NotTildeTilde":"\u2249","NotVerticalBar":"\u2224","nparallel":"\u2226","npar":"\u2226","nparsl":"\u2afd\u20e5","npart":"\u2202\u0338","npolint":"\u2a14","npr":"\u2280","nprcue":"\u22e0","nprec":"\u2280","npreceq":"\u2aaf\u0338","npre":"\u2aaf\u0338","nrarrc":"\u2933\u0338","nrarr":"\u219b","nrArr":"\u21cf","nrarrw":"\u219d\u0338","nrightarrow":"\u219b","nRightarrow":"\u21cf","nrtri":"\u22eb","nrtrie":"\u22ed","nsc":"\u2281","nsccue":"\u22e1","nsce":"\u2ab0\u0338","Nscr":"\ud835\udca9","nscr":"\ud835\udcc3","nshortmid":"\u2224","nshortparallel":"\u2226","nsim":"\u2241","nsime":"\u2244","nsimeq":"\u2244","nsmid":"\u2224","nspar":"\u2226","nsqsube":"\u22e2","nsqsupe":"\u22e3","nsub":"\u2284","nsubE":"\u2ac5\u0338","nsube":"\u2288","nsubset":"\u2282\u20d2","nsubseteq":"\u2288","nsubseteqq":"\u2ac5\u0338","nsucc":"\u2281","nsucceq":"\u2ab0\u0338","nsup":"\u2285","nsupE":"\u2ac6\u0338","nsupe":"\u2289","nsupset":"\u2283\u20d2","nsupseteq":"\u2289","nsupseteqq":"\u2ac6\u0338","ntgl":"\u2279","Ntilde":"\xd1","ntilde":"\xf1","ntlg":"\u2278","ntriangleleft":"\u22ea","ntrianglelefteq":"\u22ec","ntriangleright":"\u22eb","ntrianglerighteq":"\u22ed","Nu":"\u039d","nu":"\u03bd","num":"#","numero":"\u2116","numsp":"\u2007","nvap":"\u224d\u20d2","nvdash":"\u22ac","nvDash":"\u22ad","nVdash":"\u22ae","nVDash":"\u22af","nvge":"\u2265\u20d2","nvgt":">\u20d2","nvHarr":"\u2904","nvinfin":"\u29de","nvlArr":"\u2902","nvle":"\u2264\u20d2","nvlt":"<\u20d2","nvltrie":"\u22b4\u20d2","nvrArr":"\u2903","nvrtrie":"\u22b5\u20d2","nvsim":"\u223c\u20d2","nwarhk":"\u2923","nwarr":"\u2196","nwArr":"\u21d6","nwarrow":"\u2196","nwnear":"\u2927","Oacute":"\xd3","oacute":"\xf3","oast":"\u229b","Ocirc":"\xd4","ocirc":"\xf4","ocir":"\u229a","Ocy":"\u041e","ocy":"\u043e","odash":"\u229d","Odblac":"\u0150","odblac":"\u0151","odiv":"\u2a38","odot":"\u2299","odsold":"\u29bc","OElig":"\u0152","oelig":"\u0153","ofcir":"\u29bf","Ofr":"\ud835\udd12","ofr":"\ud835\udd2c","ogon":"\u02db","Ograve":"\xd2","ograve":"\xf2","ogt":"\u29c1","ohbar":"\u29b5","ohm":"\u03a9","oint":"\u222e","olarr":"\u21ba","olcir":"\u29be","olcross":"\u29bb","oline":"\u203e","olt":"\u29c0","Omacr":"\u014c","omacr":"\u014d","Omega":"\u03a9","omega":"\u03c9","Omicron":"\u039f","omicron":"\u03bf","omid":"\u29b6","ominus":"\u2296","Oopf":"\ud835\udd46","oopf":"\ud835\udd60","opar":"\u29b7","OpenCurlyDoubleQuote":"\u201c","OpenCurlyQuote":"\u2018","operp":"\u29b9","oplus":"\u2295","orarr":"\u21bb","Or":"\u2a54","or":"\u2228","ord":"\u2a5d","order":"\u2134","orderof":"\u2134","ordf":"\xaa","ordm":"\xba","origof":"\u22b6","oror":"\u2a56","orslope":"\u2a57","orv":"\u2a5b","oS":"\u24c8","Oscr":"\ud835\udcaa","oscr":"\u2134","Oslash":"\xd8","oslash":"\xf8","osol":"\u2298","Otilde":"\xd5","otilde":"\xf5","otimesas":"\u2a36","Otimes":"\u2a37","otimes":"\u2297","Ouml":"\xd6","ouml":"\xf6","ovbar":"\u233d","OverBar":"\u203e","OverBrace":"\u23de","OverBracket":"\u23b4","OverParenthesis":"\u23dc","para":"\xb6","parallel":"\u2225","par":"\u2225","parsim":"\u2af3","parsl":"\u2afd","part":"\u2202","PartialD":"\u2202","Pcy":"\u041f","pcy":"\u043f","percnt":"%","period":".","permil":"\u2030","perp":"\u22a5","pertenk":"\u2031","Pfr":"\ud835\udd13","pfr":"\ud835\udd2d","Phi":"\u03a6","phi":"\u03c6","phiv":"\u03d5","phmmat":"\u2133","phone":"\u260e","Pi":"\u03a0","pi":"\u03c0","pitchfork":"\u22d4","piv":"\u03d6","planck":"\u210f","planckh":"\u210e","plankv":"\u210f","plusacir":"\u2a23","plusb":"\u229e","pluscir":"\u2a22","plus":"+","plusdo":"\u2214","plusdu":"\u2a25","pluse":"\u2a72","PlusMinus":"\xb1","plusmn":"\xb1","plussim":"\u2a26","plustwo":"\u2a27","pm":"\xb1","Poincareplane":"\u210c","pointint":"\u2a15","popf":"\ud835\udd61","Popf":"\u2119","pound":"\xa3","prap":"\u2ab7","Pr":"\u2abb","pr":"\u227a","prcue":"\u227c","precapprox":"\u2ab7","prec":"\u227a","preccurlyeq":"\u227c","Precedes":"\u227a","PrecedesEqual":"\u2aaf","PrecedesSlantEqual":"\u227c","PrecedesTilde":"\u227e","preceq":"\u2aaf","precnapprox":"\u2ab9","precneqq":"\u2ab5","precnsim":"\u22e8","pre":"\u2aaf","prE":"\u2ab3","precsim":"\u227e","prime":"\u2032","Prime":"\u2033","primes":"\u2119","prnap":"\u2ab9","prnE":"\u2ab5","prnsim":"\u22e8","prod":"\u220f","Product":"\u220f","profalar":"\u232e","profline":"\u2312","profsurf":"\u2313","prop":"\u221d","Proportional":"\u221d","Proportion":"\u2237","propto":"\u221d","prsim":"\u227e","prurel":"\u22b0","Pscr":"\ud835\udcab","pscr":"\ud835\udcc5","Psi":"\u03a8","psi":"\u03c8","puncsp":"\u2008","Qfr":"\ud835\udd14","qfr":"\ud835\udd2e","qint":"\u2a0c","qopf":"\ud835\udd62","Qopf":"\u211a","qprime":"\u2057","Qscr":"\ud835\udcac","qscr":"\ud835\udcc6","quaternions":"\u210d","quatint":"\u2a16","quest":"?","questeq":"\u225f","quot":"\\"","QUOT":"\\"","rAarr":"\u21db","race":"\u223d\u0331","Racute":"\u0154","racute":"\u0155","radic":"\u221a","raemptyv":"\u29b3","rang":"\u27e9","Rang":"\u27eb","rangd":"\u2992","range":"\u29a5","rangle":"\u27e9","raquo":"\xbb","rarrap":"\u2975","rarrb":"\u21e5","rarrbfs":"\u2920","rarrc":"\u2933","rarr":"\u2192","Rarr":"\u21a0","rArr":"\u21d2","rarrfs":"\u291e","rarrhk":"\u21aa","rarrlp":"\u21ac","rarrpl":"\u2945","rarrsim":"\u2974","Rarrtl":"\u2916","rarrtl":"\u21a3","rarrw":"\u219d","ratail":"\u291a","rAtail":"\u291c","ratio":"\u2236","rationals":"\u211a","rbarr":"\u290d","rBarr":"\u290f","RBarr":"\u2910","rbbrk":"\u2773","rbrace":"}","rbrack":"]","rbrke":"\u298c","rbrksld":"\u298e","rbrkslu":"\u2990","Rcaron":"\u0158","rcaron":"\u0159","Rcedil":"\u0156","rcedil":"\u0157","rceil":"\u2309","rcub":"}","Rcy":"\u0420","rcy":"\u0440","rdca":"\u2937","rdldhar":"\u2969","rdquo":"\u201d","rdquor":"\u201d","rdsh":"\u21b3","real":"\u211c","realine":"\u211b","realpart":"\u211c","reals":"\u211d","Re":"\u211c","rect":"\u25ad","reg":"\xae","REG":"\xae","ReverseElement":"\u220b","ReverseEquilibrium":"\u21cb","ReverseUpEquilibrium":"\u296f","rfisht":"\u297d","rfloor":"\u230b","rfr":"\ud835\udd2f","Rfr":"\u211c","rHar":"\u2964","rhard":"\u21c1","rharu":"\u21c0","rharul":"\u296c","Rho":"\u03a1","rho":"\u03c1","rhov":"\u03f1","RightAngleBracket":"\u27e9","RightArrowBar":"\u21e5","rightarrow":"\u2192","RightArrow":"\u2192","Rightarrow":"\u21d2","RightArrowLeftArrow":"\u21c4","rightarrowtail":"\u21a3","RightCeiling":"\u2309","RightDoubleBracket":"\u27e7","RightDownTeeVector":"\u295d","RightDownVectorBar":"\u2955","RightDownVector":"\u21c2","RightFloor":"\u230b","rightharpoondown":"\u21c1","rightharpoonup":"\u21c0","rightleftarrows":"\u21c4","rightleftharpoons":"\u21cc","rightrightarrows":"\u21c9","rightsquigarrow":"\u219d","RightTeeArrow":"\u21a6","RightTee":"\u22a2","RightTeeVector":"\u295b","rightthreetimes":"\u22cc","RightTriangleBar":"\u29d0","RightTriangle":"\u22b3","RightTriangleEqual":"\u22b5","RightUpDownVector":"\u294f","RightUpTeeVector":"\u295c","RightUpVectorBar":"\u2954","RightUpVector":"\u21be","RightVectorBar":"\u2953","RightVector":"\u21c0","ring":"\u02da","risingdotseq":"\u2253","rlarr":"\u21c4","rlhar":"\u21cc","rlm":"\u200f","rmoustache":"\u23b1","rmoust":"\u23b1","rnmid":"\u2aee","roang":"\u27ed","roarr":"\u21fe","robrk":"\u27e7","ropar":"\u2986","ropf":"\ud835\udd63","Ropf":"\u211d","roplus":"\u2a2e","rotimes":"\u2a35","RoundImplies":"\u2970","rpar":")","rpargt":"\u2994","rppolint":"\u2a12","rrarr":"\u21c9","Rrightarrow":"\u21db","rsaquo":"\u203a","rscr":"\ud835\udcc7","Rscr":"\u211b","rsh":"\u21b1","Rsh":"\u21b1","rsqb":"]","rsquo":"\u2019","rsquor":"\u2019","rthree":"\u22cc","rtimes":"\u22ca","rtri":"\u25b9","rtrie":"\u22b5","rtrif":"\u25b8","rtriltri":"\u29ce","RuleDelayed":"\u29f4","ruluhar":"\u2968","rx":"\u211e","Sacute":"\u015a","sacute":"\u015b","sbquo":"\u201a","scap":"\u2ab8","Scaron":"\u0160","scaron":"\u0161","Sc":"\u2abc","sc":"\u227b","sccue":"\u227d","sce":"\u2ab0","scE":"\u2ab4","Scedil":"\u015e","scedil":"\u015f","Scirc":"\u015c","scirc":"\u015d","scnap":"\u2aba","scnE":"\u2ab6","scnsim":"\u22e9","scpolint":"\u2a13","scsim":"\u227f","Scy":"\u0421","scy":"\u0441","sdotb":"\u22a1","sdot":"\u22c5","sdote":"\u2a66","searhk":"\u2925","searr":"\u2198","seArr":"\u21d8","searrow":"\u2198","sect":"\xa7","semi":";","seswar":"\u2929","setminus":"\u2216","setmn":"\u2216","sext":"\u2736","Sfr":"\ud835\udd16","sfr":"\ud835\udd30","sfrown":"\u2322","sharp":"\u266f","SHCHcy":"\u0429","shchcy":"\u0449","SHcy":"\u0428","shcy":"\u0448","ShortDownArrow":"\u2193","ShortLeftArrow":"\u2190","shortmid":"\u2223","shortparallel":"\u2225","ShortRightArrow":"\u2192","ShortUpArrow":"\u2191","shy":"\xad","Sigma":"\u03a3","sigma":"\u03c3","sigmaf":"\u03c2","sigmav":"\u03c2","sim":"\u223c","simdot":"\u2a6a","sime":"\u2243","simeq":"\u2243","simg":"\u2a9e","simgE":"\u2aa0","siml":"\u2a9d","simlE":"\u2a9f","simne":"\u2246","simplus":"\u2a24","simrarr":"\u2972","slarr":"\u2190","SmallCircle":"\u2218","smallsetminus":"\u2216","smashp":"\u2a33","smeparsl":"\u29e4","smid":"\u2223","smile":"\u2323","smt":"\u2aaa","smte":"\u2aac","smtes":"\u2aac\ufe00","SOFTcy":"\u042c","softcy":"\u044c","solbar":"\u233f","solb":"\u29c4","sol":"/","Sopf":"\ud835\udd4a","sopf":"\ud835\udd64","spades":"\u2660","spadesuit":"\u2660","spar":"\u2225","sqcap":"\u2293","sqcaps":"\u2293\ufe00","sqcup":"\u2294","sqcups":"\u2294\ufe00","Sqrt":"\u221a","sqsub":"\u228f","sqsube":"\u2291","sqsubset":"\u228f","sqsubseteq":"\u2291","sqsup":"\u2290","sqsupe":"\u2292","sqsupset":"\u2290","sqsupseteq":"\u2292","square":"\u25a1","Square":"\u25a1","SquareIntersection":"\u2293","SquareSubset":"\u228f","SquareSubsetEqual":"\u2291","SquareSuperset":"\u2290","SquareSupersetEqual":"\u2292","SquareUnion":"\u2294","squarf":"\u25aa","squ":"\u25a1","squf":"\u25aa","srarr":"\u2192","Sscr":"\ud835\udcae","sscr":"\ud835\udcc8","ssetmn":"\u2216","ssmile":"\u2323","sstarf":"\u22c6","Star":"\u22c6","star":"\u2606","starf":"\u2605","straightepsilon":"\u03f5","straightphi":"\u03d5","strns":"\xaf","sub":"\u2282","Sub":"\u22d0","subdot":"\u2abd","subE":"\u2ac5","sube":"\u2286","subedot":"\u2ac3","submult":"\u2ac1","subnE":"\u2acb","subne":"\u228a","subplus":"\u2abf","subrarr":"\u2979","subset":"\u2282","Subset":"\u22d0","subseteq":"\u2286","subseteqq":"\u2ac5","SubsetEqual":"\u2286","subsetneq":"\u228a","subsetneqq":"\u2acb","subsim":"\u2ac7","subsub":"\u2ad5","subsup":"\u2ad3","succapprox":"\u2ab8","succ":"\u227b","succcurlyeq":"\u227d","Succeeds":"\u227b","SucceedsEqual":"\u2ab0","SucceedsSlantEqual":"\u227d","SucceedsTilde":"\u227f","succeq":"\u2ab0","succnapprox":"\u2aba","succneqq":"\u2ab6","succnsim":"\u22e9","succsim":"\u227f","SuchThat":"\u220b","sum":"\u2211","Sum":"\u2211","sung":"\u266a","sup1":"\xb9","sup2":"\xb2","sup3":"\xb3","sup":"\u2283","Sup":"\u22d1","supdot":"\u2abe","supdsub":"\u2ad8","supE":"\u2ac6","supe":"\u2287","supedot":"\u2ac4","Superset":"\u2283","SupersetEqual":"\u2287","suphsol":"\u27c9","suphsub":"\u2ad7","suplarr":"\u297b","supmult":"\u2ac2","supnE":"\u2acc","supne":"\u228b","supplus":"\u2ac0","supset":"\u2283","Supset":"\u22d1","supseteq":"\u2287","supseteqq":"\u2ac6","supsetneq":"\u228b","supsetneqq":"\u2acc","supsim":"\u2ac8","supsub":"\u2ad4","supsup":"\u2ad6","swarhk":"\u2926","swarr":"\u2199","swArr":"\u21d9","swarrow":"\u2199","swnwar":"\u292a","szlig":"\xdf","Tab":"\\t","target":"\u2316","Tau":"\u03a4","tau":"\u03c4","tbrk":"\u23b4","Tcaron":"\u0164","tcaron":"\u0165","Tcedil":"\u0162","tcedil":"\u0163","Tcy":"\u0422","tcy":"\u0442","tdot":"\u20db","telrec":"\u2315","Tfr":"\ud835\udd17","tfr":"\ud835\udd31","there4":"\u2234","therefore":"\u2234","Therefore":"\u2234","Theta":"\u0398","theta":"\u03b8","thetasym":"\u03d1","thetav":"\u03d1","thickapprox":"\u2248","thicksim":"\u223c","ThickSpace":"\u205f\u200a","ThinSpace":"\u2009","thinsp":"\u2009","thkap":"\u2248","thksim":"\u223c","THORN":"\xde","thorn":"\xfe","tilde":"\u02dc","Tilde":"\u223c","TildeEqual":"\u2243","TildeFullEqual":"\u2245","TildeTilde":"\u2248","timesbar":"\u2a31","timesb":"\u22a0","times":"\xd7","timesd":"\u2a30","tint":"\u222d","toea":"\u2928","topbot":"\u2336","topcir":"\u2af1","top":"\u22a4","Topf":"\ud835\udd4b","topf":"\ud835\udd65","topfork":"\u2ada","tosa":"\u2929","tprime":"\u2034","trade":"\u2122","TRADE":"\u2122","triangle":"\u25b5","triangledown":"\u25bf","triangleleft":"\u25c3","trianglelefteq":"\u22b4","triangleq":"\u225c","triangleright":"\u25b9","trianglerighteq":"\u22b5","tridot":"\u25ec","trie":"\u225c","triminus":"\u2a3a","TripleDot":"\u20db","triplus":"\u2a39","trisb":"\u29cd","tritime":"\u2a3b","trpezium":"\u23e2","Tscr":"\ud835\udcaf","tscr":"\ud835\udcc9","TScy":"\u0426","tscy":"\u0446","TSHcy":"\u040b","tshcy":"\u045b","Tstrok":"\u0166","tstrok":"\u0167","twixt":"\u226c","twoheadleftarrow":"\u219e","twoheadrightarrow":"\u21a0","Uacute":"\xda","uacute":"\xfa","uarr":"\u2191","Uarr":"\u219f","uArr":"\u21d1","Uarrocir":"\u2949","Ubrcy":"\u040e","ubrcy":"\u045e","Ubreve":"\u016c","ubreve":"\u016d","Ucirc":"\xdb","ucirc":"\xfb","Ucy":"\u0423","ucy":"\u0443","udarr":"\u21c5","Udblac":"\u0170","udblac":"\u0171","udhar":"\u296e","ufisht":"\u297e","Ufr":"\ud835\udd18","ufr":"\ud835\udd32","Ugrave":"\xd9","ugrave":"\xf9","uHar":"\u2963","uharl":"\u21bf","uharr":"\u21be","uhblk":"\u2580","ulcorn":"\u231c","ulcorner":"\u231c","ulcrop":"\u230f","ultri":"\u25f8","Umacr":"\u016a","umacr":"\u016b","uml":"\xa8","UnderBar":"_","UnderBrace":"\u23df","UnderBracket":"\u23b5","UnderParenthesis":"\u23dd","Union":"\u22c3","UnionPlus":"\u228e","Uogon":"\u0172","uogon":"\u0173","Uopf":"\ud835\udd4c","uopf":"\ud835\udd66","UpArrowBar":"\u2912","uparrow":"\u2191","UpArrow":"\u2191","Uparrow":"\u21d1","UpArrowDownArrow":"\u21c5","updownarrow":"\u2195","UpDownArrow":"\u2195","Updownarrow":"\u21d5","UpEquilibrium":"\u296e","upharpoonleft":"\u21bf","upharpoonright":"\u21be","uplus":"\u228e","UpperLeftArrow":"\u2196","UpperRightArrow":"\u2197","upsi":"\u03c5","Upsi":"\u03d2","upsih":"\u03d2","Upsilon":"\u03a5","upsilon":"\u03c5","UpTeeArrow":"\u21a5","UpTee":"\u22a5","upuparrows":"\u21c8","urcorn":"\u231d","urcorner":"\u231d","urcrop":"\u230e","Uring":"\u016e","uring":"\u016f","urtri":"\u25f9","Uscr":"\ud835\udcb0","uscr":"\ud835\udcca","utdot":"\u22f0","Utilde":"\u0168","utilde":"\u0169","utri":"\u25b5","utrif":"\u25b4","uuarr":"\u21c8","Uuml":"\xdc","uuml":"\xfc","uwangle":"\u29a7","vangrt":"\u299c","varepsilon":"\u03f5","varkappa":"\u03f0","varnothing":"\u2205","varphi":"\u03d5","varpi":"\u03d6","varpropto":"\u221d","varr":"\u2195","vArr":"\u21d5","varrho":"\u03f1","varsigma":"\u03c2","varsubsetneq":"\u228a\ufe00","varsubsetneqq":"\u2acb\ufe00","varsupsetneq":"\u228b\ufe00","varsupsetneqq":"\u2acc\ufe00","vartheta":"\u03d1","vartriangleleft":"\u22b2","vartriangleright":"\u22b3","vBar":"\u2ae8","Vbar":"\u2aeb","vBarv":"\u2ae9","Vcy":"\u0412","vcy":"\u0432","vdash":"\u22a2","vDash":"\u22a8","Vdash":"\u22a9","VDash":"\u22ab","Vdashl":"\u2ae6","veebar":"\u22bb","vee":"\u2228","Vee":"\u22c1","veeeq":"\u225a","vellip":"\u22ee","verbar":"|","Verbar":"\u2016","vert":"|","Vert":"\u2016","VerticalBar":"\u2223","VerticalLine":"|","VerticalSeparator":"\u2758","VerticalTilde":"\u2240","VeryThinSpace":"\u200a","Vfr":"\ud835\udd19","vfr":"\ud835\udd33","vltri":"\u22b2","vnsub":"\u2282\u20d2","vnsup":"\u2283\u20d2","Vopf":"\ud835\udd4d","vopf":"\ud835\udd67","vprop":"\u221d","vrtri":"\u22b3","Vscr":"\ud835\udcb1","vscr":"\ud835\udccb","vsubnE":"\u2acb\ufe00","vsubne":"\u228a\ufe00","vsupnE":"\u2acc\ufe00","vsupne":"\u228b\ufe00","Vvdash":"\u22aa","vzigzag":"\u299a","Wcirc":"\u0174","wcirc":"\u0175","wedbar":"\u2a5f","wedge":"\u2227","Wedge":"\u22c0","wedgeq":"\u2259","weierp":"\u2118","Wfr":"\ud835\udd1a","wfr":"\ud835\udd34","Wopf":"\ud835\udd4e","wopf":"\ud835\udd68","wp":"\u2118","wr":"\u2240","wreath":"\u2240","Wscr":"\ud835\udcb2","wscr":"\ud835\udccc","xcap":"\u22c2","xcirc":"\u25ef","xcup":"\u22c3","xdtri":"\u25bd","Xfr":"\ud835\udd1b","xfr":"\ud835\udd35","xharr":"\u27f7","xhArr":"\u27fa","Xi":"\u039e","xi":"\u03be","xlarr":"\u27f5","xlArr":"\u27f8","xmap":"\u27fc","xnis":"\u22fb","xodot":"\u2a00","Xopf":"\ud835\udd4f","xopf":"\ud835\udd69","xoplus":"\u2a01","xotime":"\u2a02","xrarr":"\u27f6","xrArr":"\u27f9","Xscr":"\ud835\udcb3","xscr":"\ud835\udccd","xsqcup":"\u2a06","xuplus":"\u2a04","xutri":"\u25b3","xvee":"\u22c1","xwedge":"\u22c0","Yacute":"\xdd","yacute":"\xfd","YAcy":"\u042f","yacy":"\u044f","Ycirc":"\u0176","ycirc":"\u0177","Ycy":"\u042b","ycy":"\u044b","yen":"\xa5","Yfr":"\ud835\udd1c","yfr":"\ud835\udd36","YIcy":"\u0407","yicy":"\u0457","Yopf":"\ud835\udd50","yopf":"\ud835\udd6a","Yscr":"\ud835\udcb4","yscr":"\ud835\udcce","YUcy":"\u042e","yucy":"\u044e","yuml":"\xff","Yuml":"\u0178","Zacute":"\u0179","zacute":"\u017a","Zcaron":"\u017d","zcaron":"\u017e","Zcy":"\u0417","zcy":"\u0437","Zdot":"\u017b","zdot":"\u017c","zeetrf":"\u2128","ZeroWidthSpace":"\u200b","Zeta":"\u0396","zeta":"\u03b6","zfr":"\ud835\udd37","Zfr":"\u2128","ZHcy":"\u0416","zhcy":"\u0436","zigrarr":"\u21dd","zopf":"\ud835\udd6b","Zopf":"\u2124","Zscr":"\ud835\udcb5","zscr":"\ud835\udccf","zwj":"\u200d","zwnj":"\u200c"}')},function(t,e,n){"use strict";var r={};function i(t,e,n){var o,a,s,u,c,l="";for("string"!==typeof e&&(n=e,e=i.defaultChars),"undefined"===typeof n&&(n=!0),c=function(t){var e,n,i=r[t];if(i)return i;for(i=r[t]=[],e=0;e<128;e++)n=String.fromCharCode(e),/^[0-9a-z]$/i.test(n)?i.push(n):i.push("%"+("0"+e.toString(16).toUpperCase()).slice(-2));for(e=0;e<t.length;e++)i[t.charCodeAt(e)]=t[e];return i}(e),o=0,a=t.length;o<a;o++)if(s=t.charCodeAt(o),n&&37===s&&o+2<a&&/^[0-9a-f]{2}$/i.test(t.slice(o+1,o+3)))l+=t.slice(o,o+3),o+=2;else if(s<128)l+=c[s];else if(s>=55296&&s<=57343){if(s>=55296&&s<=56319&&o+1<a&&(u=t.charCodeAt(o+1))>=56320&&u<=57343){l+=encodeURIComponent(t[o]+t[o+1]),o++;continue}l+="%EF%BF%BD"}else l+=encodeURIComponent(t[o]);return l}i.defaultChars=";/?:@&=+$,-_.!~*'()#",i.componentChars="-_.!~*'()",t.exports=i},function(t,e,n){"use strict";var r={};function i(t,e){var n;return"string"!==typeof e&&(e=i.defaultChars),n=function(t){var e,n,i=r[t];if(i)return i;for(i=r[t]=[],e=0;e<128;e++)n=String.fromCharCode(e),i.push(n);for(e=0;e<t.length;e++)i[n=t.charCodeAt(e)]="%"+("0"+n.toString(16).toUpperCase()).slice(-2);return i}(e),t.replace(/(%[a-f0-9]{2})+/gi,(function(t){var e,r,i,o,a,s,u,c="";for(e=0,r=t.length;e<r;e+=3)(i=parseInt(t.slice(e+1,e+3),16))<128?c+=n[i]:192===(224&i)&&e+3<r&&128===(192&(o=parseInt(t.slice(e+4,e+6),16)))?(c+=(u=i<<6&1984|63&o)<128?"\ufffd\ufffd":String.fromCharCode(u),e+=3):224===(240&i)&&e+6<r&&(o=parseInt(t.slice(e+4,e+6),16),a=parseInt(t.slice(e+7,e+9),16),128===(192&o)&&128===(192&a))?(c+=(u=i<<12&61440|o<<6&4032|63&a)<2048||u>=55296&&u<=57343?"\ufffd\ufffd\ufffd":String.fromCharCode(u),e+=6):240===(248&i)&&e+9<r&&(o=parseInt(t.slice(e+4,e+6),16),a=parseInt(t.slice(e+7,e+9),16),s=parseInt(t.slice(e+10,e+12),16),128===(192&o)&&128===(192&a)&&128===(192&s))?((u=i<<18&1835008|o<<12&258048|a<<6&4032|63&s)<65536||u>1114111?c+="\ufffd\ufffd\ufffd\ufffd":(u-=65536,c+=String.fromCharCode(55296+(u>>10),56320+(1023&u))),e+=9):c+="\ufffd";return c}))}i.defaultChars=";/?:@&=+$,#",i.componentChars="",t.exports=i},function(t,e,n){"use strict";t.exports=function(t){var e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&-1!==t.hostname.indexOf(":")?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||""}},function(t,e,n){"use strict";function r(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var i=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,s=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(s),c=["%","/","?",";","#"].concat(u),l=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,d={javascript:!0,"javascript:":!0},p={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};r.prototype.parse=function(t,e){var n,r,o,s,u,v=t;if(v=v.trim(),!e&&1===t.split("#").length){var m=a.exec(v);if(m)return this.pathname=m[1],m[2]&&(this.search=m[2]),this}var g=i.exec(v);if(g&&(o=(g=g[0]).toLowerCase(),this.protocol=g,v=v.substr(g.length)),(e||g||v.match(/^\/\/[^@\/]+@[^@\/]+/))&&(!(u="//"===v.substr(0,2))||g&&d[g]||(v=v.substr(2),this.slashes=!0)),!d[g]&&(u||g&&!p[g])){var y,b,w=-1;for(n=0;n<l.length;n++)-1!==(s=v.indexOf(l[n]))&&(-1===w||s<w)&&(w=s);for(-1!==(b=-1===w?v.lastIndexOf("@"):v.lastIndexOf("@",w))&&(y=v.slice(0,b),v=v.slice(b+1),this.auth=y),w=-1,n=0;n<c.length;n++)-1!==(s=v.indexOf(c[n]))&&(-1===w||s<w)&&(w=s);-1===w&&(w=v.length),":"===v[w-1]&&w--;var _=v.slice(0,w);v=v.slice(w),this.parseHost(_),this.hostname=this.hostname||"";var x="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!x){var k=this.hostname.split(/\./);for(n=0,r=k.length;n<r;n++){var S=k[n];if(S&&!S.match(h)){for(var C="",M=0,E=S.length;M<E;M++)S.charCodeAt(M)>127?C+="x":C+=S[M];if(!C.match(h)){var T=k.slice(0,n),A=k.slice(n+1),O=S.match(f);O&&(T.push(O[1]),A.unshift(O[2])),A.length&&(v=A.join(".")+v),this.hostname=T.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),x&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var D=v.indexOf("#");-1!==D&&(this.hash=v.substr(D),v=v.slice(0,D));var P=v.indexOf("?");return-1!==P&&(this.search=v.substr(P),v=v.slice(0,P)),v&&(this.pathname=v),p[o]&&this.hostname&&!this.pathname&&(this.pathname=""),this},r.prototype.parseHost=function(t){var e=o.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)},t.exports=function(t,e){if(t&&t instanceof r)return t;var n=new r;return n.parse(t,e),n}},function(t,e,n){"use strict";e.Any=n(222),e.Cc=n(223),e.Cf=n(514),e.P=n(152),e.Z=n(224)},function(t,e){t.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/},function(t,e,n){"use strict";e.parseLinkLabel=n(516),e.parseLinkDestination=n(517),e.parseLinkTitle=n(518)},function(t,e,n){"use strict";t.exports=function(t,e,n){var r,i,o,a,s=-1,u=t.posMax,c=t.pos;for(t.pos=e+1,r=1;t.pos<u;){if(93===(o=t.src.charCodeAt(t.pos))&&0===--r){i=!0;break}if(a=t.pos,t.md.inline.skipToken(t),91===o)if(a===t.pos-1)r++;else if(n)return t.pos=c,-1}return i&&(s=t.pos),t.pos=c,s}},function(t,e,n){"use strict";var r=n(11).unescapeAll;t.exports=function(t,e,n){var i,o,a=e,s={ok:!1,pos:0,lines:0,str:""};if(60===t.charCodeAt(e)){for(e++;e<n;){if(10===(i=t.charCodeAt(e)))return s;if(62===i)return s.pos=e+1,s.str=r(t.slice(a+1,e)),s.ok=!0,s;92===i&&e+1<n?e+=2:e++}return s}for(o=0;e<n&&32!==(i=t.charCodeAt(e))&&!(i<32||127===i);)if(92===i&&e+1<n)e+=2;else{if(40===i&&o++,41===i){if(0===o)break;o--}e++}return a===e||0!==o||(s.str=r(t.slice(a,e)),s.lines=0,s.pos=e,s.ok=!0),s}},function(t,e,n){"use strict";var r=n(11).unescapeAll;t.exports=function(t,e,n){var i,o,a=0,s=e,u={ok:!1,pos:0,lines:0,str:""};if(e>=n)return u;if(34!==(o=t.charCodeAt(e))&&39!==o&&40!==o)return u;for(e++,40===o&&(o=41);e<n;){if((i=t.charCodeAt(e))===o)return u.pos=e+1,u.lines=a,u.str=r(t.slice(s+1,e)),u.ok=!0,u;10===i?a++:92===i&&e+1<n&&(e++,10===t.charCodeAt(e)&&a++),e++}return u}},function(t,e,n){"use strict";var r=n(11).assign,i=n(11).unescapeAll,o=n(11).escapeHtml,a={};function s(){this.rules=r({},a)}a.code_inline=function(t,e,n,r,i){var a=t[e];return"<code"+i.renderAttrs(a)+">"+o(t[e].content)+"</code>"},a.code_block=function(t,e,n,r,i){var a=t[e];return"<pre"+i.renderAttrs(a)+"><code>"+o(t[e].content)+"</code></pre>\n"},a.fence=function(t,e,n,r,a){var s,u,c,l,h=t[e],f=h.info?i(h.info).trim():"",d="";return f&&(d=f.split(/\s+/g)[0]),0===(s=n.highlight&&n.highlight(h.content,d)||o(h.content)).indexOf("<pre")?s+"\n":f?(u=h.attrIndex("class"),c=h.attrs?h.attrs.slice():[],u<0?c.push(["class",n.langPrefix+d]):c[u][1]+=" "+n.langPrefix+d,l={attrs:c},"<pre><code"+a.renderAttrs(l)+">"+s+"</code></pre>\n"):"<pre><code"+a.renderAttrs(h)+">"+s+"</code></pre>\n"},a.image=function(t,e,n,r,i){var o=t[e];return o.attrs[o.attrIndex("alt")][1]=i.renderInlineAsText(o.children,n,r),i.renderToken(t,e,n)},a.hardbreak=function(t,e,n){return n.xhtmlOut?"<br />\n":"<br>\n"},a.softbreak=function(t,e,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},a.text=function(t,e){return o(t[e].content)},a.html_block=function(t,e){return t[e].content},a.html_inline=function(t,e){return t[e].content},s.prototype.renderAttrs=function(t){var e,n,r;if(!t.attrs)return"";for(r="",e=0,n=t.attrs.length;e<n;e++)r+=" "+o(t.attrs[e][0])+'="'+o(t.attrs[e][1])+'"';return r},s.prototype.renderToken=function(t,e,n){var r,i="",o=!1,a=t[e];return a.hidden?"":(a.block&&-1!==a.nesting&&e&&t[e-1].hidden&&(i+="\n"),i+=(-1===a.nesting?"</":"<")+a.tag,i+=this.renderAttrs(a),0===a.nesting&&n.xhtmlOut&&(i+=" /"),a.block&&(o=!0,1===a.nesting&&e+1<t.length&&("inline"===(r=t[e+1]).type||r.hidden||-1===r.nesting&&r.tag===a.tag)&&(o=!1)),i+=o?">\n":">")},s.prototype.renderInline=function(t,e,n){for(var r,i="",o=this.rules,a=0,s=t.length;a<s;a++)"undefined"!==typeof o[r=t[a].type]?i+=o[r](t,a,e,n,this):i+=this.renderToken(t,a,e);return i},s.prototype.renderInlineAsText=function(t,e,n){for(var r="",i=0,o=t.length;i<o;i++)"text"===t[i].type?r+=t[i].content:"image"===t[i].type&&(r+=this.renderInlineAsText(t[i].children,e,n));return r},s.prototype.render=function(t,e,n){var r,i,o,a="",s=this.rules;for(r=0,i=t.length;r<i;r++)"inline"===(o=t[r].type)?a+=this.renderInline(t[r].children,e,n):"undefined"!==typeof s[o]?a+=s[t[r].type](t,r,e,n,this):a+=this.renderToken(t,r,e,n);return a},t.exports=s},function(t,e,n){"use strict";var r=n(153),i=[["normalize",n(521)],["block",n(522)],["inline",n(523)],["linkify",n(524)],["replacements",n(525)],["smartquotes",n(526)]];function o(){this.ruler=new r;for(var t=0;t<i.length;t++)this.ruler.push(i[t][0],i[t][1])}o.prototype.process=function(t){var e,n,r;for(e=0,n=(r=this.ruler.getRules("")).length;e<n;e++)r[e](t)},o.prototype.State=n(527),t.exports=o},function(t,e,n){"use strict";var r=/\r\n?|\n/g,i=/\0/g;t.exports=function(t){var e;e=(e=t.src.replace(r,"\n")).replace(i,"\ufffd"),t.src=e}},function(t,e,n){"use strict";t.exports=function(t){var e;t.inlineMode?((e=new t.Token("inline","",0)).content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}},function(t,e,n){"use strict";t.exports=function(t){var e,n,r,i=t.tokens;for(n=0,r=i.length;n<r;n++)"inline"===(e=i[n]).type&&t.md.inline.parse(e.content,t.md,t.env,e.children)}},function(t,e,n){"use strict";var r=n(11).arrayReplaceAt;function i(t){return/^<\/a\s*>/i.test(t)}t.exports=function(t){var e,n,o,a,s,u,c,l,h,f,d,p,v,m,g,y,b,w,_=t.tokens;if(t.md.options.linkify)for(n=0,o=_.length;n<o;n++)if("inline"===_[n].type&&t.md.linkify.pretest(_[n].content))for(v=0,e=(a=_[n].children).length-1;e>=0;e--)if("link_close"!==(u=a[e]).type){if("html_inline"===u.type&&(w=u.content,/^<a[>\s]/i.test(w)&&v>0&&v--,i(u.content)&&v++),!(v>0)&&"text"===u.type&&t.md.linkify.test(u.content)){for(h=u.content,b=t.md.linkify.match(h),c=[],p=u.level,d=0,l=0;l<b.length;l++)m=b[l].url,g=t.md.normalizeLink(m),t.md.validateLink(g)&&(y=b[l].text,y=b[l].schema?"mailto:"!==b[l].schema||/^mailto:/i.test(y)?t.md.normalizeLinkText(y):t.md.normalizeLinkText("mailto:"+y).replace(/^mailto:/,""):t.md.normalizeLinkText("http://"+y).replace(/^http:\/\//,""),(f=b[l].index)>d&&((s=new t.Token("text","",0)).content=h.slice(d,f),s.level=p,c.push(s)),(s=new t.Token("link_open","a",1)).attrs=[["href",g]],s.level=p++,s.markup="linkify",s.info="auto",c.push(s),(s=new t.Token("text","",0)).content=y,s.level=p,c.push(s),(s=new t.Token("link_close","a",-1)).level=--p,s.markup="linkify",s.info="auto",c.push(s),d=b[l].lastIndex);d<h.length&&((s=new t.Token("text","",0)).content=h.slice(d),s.level=p,c.push(s)),_[n].children=a=r(a,e,c)}}else for(e--;a[e].level!==u.level&&"link_open"!==a[e].type;)e--}},function(t,e,n){"use strict";var r=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,i=/\((c|tm|r|p)\)/i,o=/\((c|tm|r|p)\)/gi,a={c:"\xa9",r:"\xae",p:"\xa7",tm:"\u2122"};function s(t,e){return a[e.toLowerCase()]}function u(t){var e,n,r=0;for(e=t.length-1;e>=0;e--)"text"!==(n=t[e]).type||r||(n.content=n.content.replace(o,s)),"link_open"===n.type&&"auto"===n.info&&r--,"link_close"===n.type&&"auto"===n.info&&r++}function c(t){var e,n,i=0;for(e=t.length-1;e>=0;e--)"text"!==(n=t[e]).type||i||r.test(n.content)&&(n.content=n.content.replace(/\+-/g,"\xb1").replace(/\.{2,}/g,"\u2026").replace(/([?!])\u2026/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1\u2014$2").replace(/(^|\s)--(\s|$)/gm,"$1\u2013$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1\u2013$2")),"link_open"===n.type&&"auto"===n.info&&i--,"link_close"===n.type&&"auto"===n.info&&i++}t.exports=function(t){var e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)"inline"===t.tokens[e].type&&(i.test(t.tokens[e].content)&&u(t.tokens[e].children),r.test(t.tokens[e].content)&&c(t.tokens[e].children))}},function(t,e,n){"use strict";var r=n(11).isWhiteSpace,i=n(11).isPunctChar,o=n(11).isMdAsciiPunct,a=/['"]/,s=/['"]/g;function u(t,e,n){return t.substr(0,e)+n+t.substr(e+1)}function c(t,e){var n,a,c,l,h,f,d,p,v,m,g,y,b,w,_,x,k,S,C,M,E;for(C=[],n=0;n<t.length;n++){for(a=t[n],d=t[n].level,k=C.length-1;k>=0&&!(C[k].level<=d);k--);if(C.length=k+1,"text"===a.type){h=0,f=(c=a.content).length;t:for(;h<f&&(s.lastIndex=h,l=s.exec(c));){if(_=x=!0,h=l.index+1,S="'"===l[0],v=32,l.index-1>=0)v=c.charCodeAt(l.index-1);else for(k=n-1;k>=0&&("softbreak"!==t[k].type&&"hardbreak"!==t[k].type);k--)if("text"===t[k].type){v=t[k].content.charCodeAt(t[k].content.length-1);break}if(m=32,h<f)m=c.charCodeAt(h);else for(k=n+1;k<t.length&&("softbreak"!==t[k].type&&"hardbreak"!==t[k].type);k++)if("text"===t[k].type){m=t[k].content.charCodeAt(0);break}if(g=o(v)||i(String.fromCharCode(v)),y=o(m)||i(String.fromCharCode(m)),b=r(v),(w=r(m))?_=!1:y&&(b||g||(_=!1)),b?x=!1:g&&(w||y||(x=!1)),34===m&&'"'===l[0]&&v>=48&&v<=57&&(x=_=!1),_&&x&&(_=!1,x=y),_||x){if(x)for(k=C.length-1;k>=0&&(p=C[k],!(C[k].level<d));k--)if(p.single===S&&C[k].level===d){p=C[k],S?(M=e.md.options.quotes[2],E=e.md.options.quotes[3]):(M=e.md.options.quotes[0],E=e.md.options.quotes[1]),a.content=u(a.content,l.index,E),t[p.token].content=u(t[p.token].content,p.pos,M),h+=E.length-1,p.token===n&&(h+=M.length-1),f=(c=a.content).length,C.length=k;continue t}_?C.push({token:n,pos:l.index,single:S,level:d}):x&&S&&(a.content=u(a.content,l.index,"\u2019"))}else S&&(a.content=u(a.content,l.index,"\u2019"))}}}}t.exports=function(t){var e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)"inline"===t.tokens[e].type&&a.test(t.tokens[e].content)&&c(t.tokens[e].children,t)}},function(t,e,n){"use strict";var r=n(154);function i(t,e,n){this.src=t,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=e}i.prototype.Token=r,t.exports=i},function(t,e,n){"use strict";var r=n(153),i=[["table",n(529),["paragraph","reference"]],["code",n(530)],["fence",n(531),["paragraph","reference","blockquote","list"]],["blockquote",n(532),["paragraph","reference","blockquote","list"]],["hr",n(533),["paragraph","reference","blockquote","list"]],["list",n(534),["paragraph","reference","blockquote"]],["reference",n(535)],["heading",n(536),["paragraph","reference","blockquote"]],["lheading",n(537)],["html_block",n(538),["paragraph","reference","blockquote"]],["paragraph",n(540)]];function o(){this.ruler=new r;for(var t=0;t<i.length;t++)this.ruler.push(i[t][0],i[t][1],{alt:(i[t][2]||[]).slice()})}o.prototype.tokenize=function(t,e,n){for(var r,i=this.ruler.getRules(""),o=i.length,a=e,s=!1,u=t.md.options.maxNesting;a<n&&(t.line=a=t.skipEmptyLines(a),!(a>=n))&&!(t.sCount[a]<t.blkIndent);){if(t.level>=u){t.line=n;break}for(r=0;r<o&&!i[r](t,a,n,!1);r++);t.tight=!s,t.isEmpty(t.line-1)&&(s=!0),(a=t.line)<n&&t.isEmpty(a)&&(s=!0,a++,t.line=a)}},o.prototype.parse=function(t,e,n,r){var i;t&&(i=new this.State(t,e,n,r),this.tokenize(i,i.line,i.lineMax))},o.prototype.State=n(541),t.exports=o},function(t,e,n){"use strict";var r=n(11).isSpace;function i(t,e){var n=t.bMarks[e]+t.blkIndent,r=t.eMarks[e];return t.src.substr(n,r-n)}function o(t){var e,n=[],r=0,i=t.length,o=0,a=0,s=!1,u=0;for(e=t.charCodeAt(r);r<i;)96===e?s?(s=!1,u=r):o%2===0&&(s=!0,u=r):124!==e||o%2!==0||s||(n.push(t.substring(a,r)),a=r+1),92===e?o++:o=0,++r===i&&s&&(s=!1,r=u+1),e=t.charCodeAt(r);return n.push(t.substring(a)),n}t.exports=function(t,e,n,a){var s,u,c,l,h,f,d,p,v,m,g,y;if(e+2>n)return!1;if(h=e+1,t.sCount[h]<t.blkIndent)return!1;if(t.sCount[h]-t.blkIndent>=4)return!1;if((c=t.bMarks[h]+t.tShift[h])>=t.eMarks[h])return!1;if(124!==(s=t.src.charCodeAt(c++))&&45!==s&&58!==s)return!1;for(;c<t.eMarks[h];){if(124!==(s=t.src.charCodeAt(c))&&45!==s&&58!==s&&!r(s))return!1;c++}for(f=(u=i(t,e+1)).split("|"),v=[],l=0;l<f.length;l++){if(!(m=f[l].trim())){if(0===l||l===f.length-1)continue;return!1}if(!/^:?-+:?$/.test(m))return!1;58===m.charCodeAt(m.length-1)?v.push(58===m.charCodeAt(0)?"center":"right"):58===m.charCodeAt(0)?v.push("left"):v.push("")}if(-1===(u=i(t,e).trim()).indexOf("|"))return!1;if(t.sCount[e]-t.blkIndent>=4)return!1;if((d=(f=o(u.replace(/^\||\|$/g,""))).length)>v.length)return!1;if(a)return!0;for((p=t.push("table_open","table",1)).map=g=[e,0],(p=t.push("thead_open","thead",1)).map=[e,e+1],(p=t.push("tr_open","tr",1)).map=[e,e+1],l=0;l<f.length;l++)(p=t.push("th_open","th",1)).map=[e,e+1],v[l]&&(p.attrs=[["style","text-align:"+v[l]]]),(p=t.push("inline","",0)).content=f[l].trim(),p.map=[e,e+1],p.children=[],p=t.push("th_close","th",-1);for(p=t.push("tr_close","tr",-1),p=t.push("thead_close","thead",-1),(p=t.push("tbody_open","tbody",1)).map=y=[e+2,0],h=e+2;h<n&&!(t.sCount[h]<t.blkIndent)&&-1!==(u=i(t,h).trim()).indexOf("|")&&!(t.sCount[h]-t.blkIndent>=4);h++){for(f=o(u.replace(/^\||\|$/g,"")),p=t.push("tr_open","tr",1),l=0;l<d;l++)p=t.push("td_open","td",1),v[l]&&(p.attrs=[["style","text-align:"+v[l]]]),(p=t.push("inline","",0)).content=f[l]?f[l].trim():"",p.children=[],p=t.push("td_close","td",-1);p=t.push("tr_close","tr",-1)}return p=t.push("tbody_close","tbody",-1),p=t.push("table_close","table",-1),g[1]=y[1]=h,t.line=h,!0}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r,i,o;if(t.sCount[e]-t.blkIndent<4)return!1;for(i=r=e+1;r<n;)if(t.isEmpty(r))r++;else{if(!(t.sCount[r]-t.blkIndent>=4))break;i=++r}return t.line=i,(o=t.push("code_block","code",0)).content=t.getLines(e,i,4+t.blkIndent,!0),o.map=[e,t.line],!0}},function(t,e,n){"use strict";t.exports=function(t,e,n,r){var i,o,a,s,u,c,l,h=!1,f=t.bMarks[e]+t.tShift[e],d=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(f+3>d)return!1;if(126!==(i=t.src.charCodeAt(f))&&96!==i)return!1;if(u=f,(o=(f=t.skipChars(f,i))-u)<3)return!1;if(l=t.src.slice(u,f),a=t.src.slice(f,d),96===i&&a.indexOf(String.fromCharCode(i))>=0)return!1;if(r)return!0;for(s=e;!(++s>=n)&&!((f=u=t.bMarks[s]+t.tShift[s])<(d=t.eMarks[s])&&t.sCount[s]<t.blkIndent);)if(t.src.charCodeAt(f)===i&&!(t.sCount[s]-t.blkIndent>=4)&&!((f=t.skipChars(f,i))-u<o)&&!((f=t.skipSpaces(f))<d)){h=!0;break}return o=t.sCount[e],t.line=s+(h?1:0),(c=t.push("fence","code",0)).info=a,c.content=t.getLines(e+1,s,o,!0),c.markup=l,c.map=[e,t.line],!0}},function(t,e,n){"use strict";var r=n(11).isSpace;t.exports=function(t,e,n,i){var o,a,s,u,c,l,h,f,d,p,v,m,g,y,b,w,_,x,k,S,C=t.lineMax,M=t.bMarks[e]+t.tShift[e],E=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(62!==t.src.charCodeAt(M++))return!1;if(i)return!0;for(u=d=t.sCount[e]+M-(t.bMarks[e]+t.tShift[e]),32===t.src.charCodeAt(M)?(M++,u++,d++,o=!1,w=!0):9===t.src.charCodeAt(M)?(w=!0,(t.bsCount[e]+d)%4===3?(M++,u++,d++,o=!1):o=!0):w=!1,p=[t.bMarks[e]],t.bMarks[e]=M;M<E&&(a=t.src.charCodeAt(M),r(a));)9===a?d+=4-(d+t.bsCount[e]+(o?1:0))%4:d++,M++;for(v=[t.bsCount[e]],t.bsCount[e]=t.sCount[e]+1+(w?1:0),l=M>=E,y=[t.sCount[e]],t.sCount[e]=d-u,b=[t.tShift[e]],t.tShift[e]=M-t.bMarks[e],x=t.md.block.ruler.getRules("blockquote"),g=t.parentType,t.parentType="blockquote",S=!1,f=e+1;f<n&&(t.sCount[f]<t.blkIndent&&(S=!0),!((M=t.bMarks[f]+t.tShift[f])>=(E=t.eMarks[f])));f++)if(62!==t.src.charCodeAt(M++)||S){if(l)break;for(_=!1,s=0,c=x.length;s<c;s++)if(x[s](t,f,n,!0)){_=!0;break}if(_){t.lineMax=f,0!==t.blkIndent&&(p.push(t.bMarks[f]),v.push(t.bsCount[f]),b.push(t.tShift[f]),y.push(t.sCount[f]),t.sCount[f]-=t.blkIndent);break}p.push(t.bMarks[f]),v.push(t.bsCount[f]),b.push(t.tShift[f]),y.push(t.sCount[f]),t.sCount[f]=-1}else{for(u=d=t.sCount[f]+M-(t.bMarks[f]+t.tShift[f]),32===t.src.charCodeAt(M)?(M++,u++,d++,o=!1,w=!0):9===t.src.charCodeAt(M)?(w=!0,(t.bsCount[f]+d)%4===3?(M++,u++,d++,o=!1):o=!0):w=!1,p.push(t.bMarks[f]),t.bMarks[f]=M;M<E&&(a=t.src.charCodeAt(M),r(a));)9===a?d+=4-(d+t.bsCount[f]+(o?1:0))%4:d++,M++;l=M>=E,v.push(t.bsCount[f]),t.bsCount[f]=t.sCount[f]+1+(w?1:0),y.push(t.sCount[f]),t.sCount[f]=d-u,b.push(t.tShift[f]),t.tShift[f]=M-t.bMarks[f]}for(m=t.blkIndent,t.blkIndent=0,(k=t.push("blockquote_open","blockquote",1)).markup=">",k.map=h=[e,0],t.md.block.tokenize(t,e,f),(k=t.push("blockquote_close","blockquote",-1)).markup=">",t.lineMax=C,t.parentType=g,h[1]=t.line,s=0;s<b.length;s++)t.bMarks[s+e]=p[s],t.tShift[s+e]=b[s],t.sCount[s+e]=y[s],t.bsCount[s+e]=v[s];return t.blkIndent=m,!0}},function(t,e,n){"use strict";var r=n(11).isSpace;t.exports=function(t,e,n,i){var o,a,s,u,c=t.bMarks[e]+t.tShift[e],l=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(42!==(o=t.src.charCodeAt(c++))&&45!==o&&95!==o)return!1;for(a=1;c<l;){if((s=t.src.charCodeAt(c++))!==o&&!r(s))return!1;s===o&&a++}return!(a<3)&&(i||(t.line=e+1,(u=t.push("hr","hr",0)).map=[e,t.line],u.markup=Array(a+1).join(String.fromCharCode(o))),!0)}},function(t,e,n){"use strict";var r=n(11).isSpace;function i(t,e){var n,i,o,a;return i=t.bMarks[e]+t.tShift[e],o=t.eMarks[e],42!==(n=t.src.charCodeAt(i++))&&45!==n&&43!==n||i<o&&(a=t.src.charCodeAt(i),!r(a))?-1:i}function o(t,e){var n,i=t.bMarks[e]+t.tShift[e],o=i,a=t.eMarks[e];if(o+1>=a)return-1;if((n=t.src.charCodeAt(o++))<48||n>57)return-1;for(;;){if(o>=a)return-1;if(!((n=t.src.charCodeAt(o++))>=48&&n<=57)){if(41===n||46===n)break;return-1}if(o-i>=10)return-1}return o<a&&(n=t.src.charCodeAt(o),!r(n))?-1:o}t.exports=function(t,e,n,r){var a,s,u,c,l,h,f,d,p,v,m,g,y,b,w,_,x,k,S,C,M,E,T,A,O,D,P,L,N=!1,R=!0;if(t.sCount[e]-t.blkIndent>=4)return!1;if(t.listIndent>=0&&t.sCount[e]-t.listIndent>=4&&t.sCount[e]<t.blkIndent)return!1;if(r&&"paragraph"===t.parentType&&t.tShift[e]>=t.blkIndent&&(N=!0),(T=o(t,e))>=0){if(f=!0,O=t.bMarks[e]+t.tShift[e],y=Number(t.src.substr(O,T-O-1)),N&&1!==y)return!1}else{if(!((T=i(t,e))>=0))return!1;f=!1}if(N&&t.skipSpaces(T)>=t.eMarks[e])return!1;if(g=t.src.charCodeAt(T-1),r)return!0;for(m=t.tokens.length,f?(L=t.push("ordered_list_open","ol",1),1!==y&&(L.attrs=[["start",y]])):L=t.push("bullet_list_open","ul",1),L.map=v=[e,0],L.markup=String.fromCharCode(g),w=e,A=!1,P=t.md.block.ruler.getRules("list"),k=t.parentType,t.parentType="list";w<n;){for(E=T,b=t.eMarks[w],h=_=t.sCount[w]+T-(t.bMarks[e]+t.tShift[e]);E<b;){if(9===(a=t.src.charCodeAt(E)))_+=4-(_+t.bsCount[w])%4;else{if(32!==a)break;_++}E++}if((l=(s=E)>=b?1:_-h)>4&&(l=1),c=h+l,(L=t.push("list_item_open","li",1)).markup=String.fromCharCode(g),L.map=d=[e,0],M=t.tight,C=t.tShift[e],S=t.sCount[e],x=t.listIndent,t.listIndent=t.blkIndent,t.blkIndent=c,t.tight=!0,t.tShift[e]=s-t.bMarks[e],t.sCount[e]=_,s>=b&&t.isEmpty(e+1)?t.line=Math.min(t.line+2,n):t.md.block.tokenize(t,e,n,!0),t.tight&&!A||(R=!1),A=t.line-e>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=x,t.tShift[e]=C,t.sCount[e]=S,t.tight=M,(L=t.push("list_item_close","li",-1)).markup=String.fromCharCode(g),w=e=t.line,d[1]=w,s=t.bMarks[e],w>=n)break;if(t.sCount[w]<t.blkIndent)break;if(t.sCount[e]-t.blkIndent>=4)break;for(D=!1,u=0,p=P.length;u<p;u++)if(P[u](t,w,n,!0)){D=!0;break}if(D)break;if(f){if((T=o(t,w))<0)break}else if((T=i(t,w))<0)break;if(g!==t.src.charCodeAt(T-1))break}return(L=f?t.push("ordered_list_close","ol",-1):t.push("bullet_list_close","ul",-1)).markup=String.fromCharCode(g),v[1]=w,t.line=w,t.parentType=k,R&&function(t,e){var n,r,i=t.level+2;for(n=e+2,r=t.tokens.length-2;n<r;n++)t.tokens[n].level===i&&"paragraph_open"===t.tokens[n].type&&(t.tokens[n+2].hidden=!0,t.tokens[n].hidden=!0,n+=2)}(t,m),!0}},function(t,e,n){"use strict";var r=n(11).normalizeReference,i=n(11).isSpace;t.exports=function(t,e,n,o){var a,s,u,c,l,h,f,d,p,v,m,g,y,b,w,_,x=0,k=t.bMarks[e]+t.tShift[e],S=t.eMarks[e],C=e+1;if(t.sCount[e]-t.blkIndent>=4)return!1;if(91!==t.src.charCodeAt(k))return!1;for(;++k<S;)if(93===t.src.charCodeAt(k)&&92!==t.src.charCodeAt(k-1)){if(k+1===S)return!1;if(58!==t.src.charCodeAt(k+1))return!1;break}for(c=t.lineMax,w=t.md.block.ruler.getRules("reference"),v=t.parentType,t.parentType="reference";C<c&&!t.isEmpty(C);C++)if(!(t.sCount[C]-t.blkIndent>3)&&!(t.sCount[C]<0)){for(b=!1,h=0,f=w.length;h<f;h++)if(w[h](t,C,c,!0)){b=!0;break}if(b)break}for(S=(y=t.getLines(e,C,t.blkIndent,!1).trim()).length,k=1;k<S;k++){if(91===(a=y.charCodeAt(k)))return!1;if(93===a){p=k;break}(10===a||92===a&&++k<S&&10===y.charCodeAt(k))&&x++}if(p<0||58!==y.charCodeAt(p+1))return!1;for(k=p+2;k<S;k++)if(10===(a=y.charCodeAt(k)))x++;else if(!i(a))break;if(!(m=t.md.helpers.parseLinkDestination(y,k,S)).ok)return!1;if(l=t.md.normalizeLink(m.str),!t.md.validateLink(l))return!1;for(s=k=m.pos,u=x+=m.lines,g=k;k<S;k++)if(10===(a=y.charCodeAt(k)))x++;else if(!i(a))break;for(m=t.md.helpers.parseLinkTitle(y,k,S),k<S&&g!==k&&m.ok?(_=m.str,k=m.pos,x+=m.lines):(_="",k=s,x=u);k<S&&(a=y.charCodeAt(k),i(a));)k++;if(k<S&&10!==y.charCodeAt(k)&&_)for(_="",k=s,x=u;k<S&&(a=y.charCodeAt(k),i(a));)k++;return!(k<S&&10!==y.charCodeAt(k))&&(!!(d=r(y.slice(1,p)))&&(o||("undefined"===typeof t.env.references&&(t.env.references={}),"undefined"===typeof t.env.references[d]&&(t.env.references[d]={title:_,href:l}),t.parentType=v,t.line=e+x+1),!0))}},function(t,e,n){"use strict";var r=n(11).isSpace;t.exports=function(t,e,n,i){var o,a,s,u,c=t.bMarks[e]+t.tShift[e],l=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(35!==(o=t.src.charCodeAt(c))||c>=l)return!1;for(a=1,o=t.src.charCodeAt(++c);35===o&&c<l&&a<=6;)a++,o=t.src.charCodeAt(++c);return!(a>6||c<l&&!r(o))&&(i||(l=t.skipSpacesBack(l,c),(s=t.skipCharsBack(l,35,c))>c&&r(t.src.charCodeAt(s-1))&&(l=s),t.line=e+1,(u=t.push("heading_open","h"+String(a),1)).markup="########".slice(0,a),u.map=[e,t.line],(u=t.push("inline","",0)).content=t.src.slice(c,l).trim(),u.map=[e,t.line],u.children=[],(u=t.push("heading_close","h"+String(a),-1)).markup="########".slice(0,a)),!0)}},function(t,e,n){"use strict";t.exports=function(t,e,n){var r,i,o,a,s,u,c,l,h,f,d=e+1,p=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;for(f=t.parentType,t.parentType="paragraph";d<n&&!t.isEmpty(d);d++)if(!(t.sCount[d]-t.blkIndent>3)){if(t.sCount[d]>=t.blkIndent&&(u=t.bMarks[d]+t.tShift[d])<(c=t.eMarks[d])&&(45===(h=t.src.charCodeAt(u))||61===h)&&(u=t.skipChars(u,h),(u=t.skipSpaces(u))>=c)){l=61===h?1:2;break}if(!(t.sCount[d]<0)){for(i=!1,o=0,a=p.length;o<a;o++)if(p[o](t,d,n,!0)){i=!0;break}if(i)break}}return!!l&&(r=t.getLines(e,d,t.blkIndent,!1).trim(),t.line=d+1,(s=t.push("heading_open","h"+String(l),1)).markup=String.fromCharCode(h),s.map=[e,t.line],(s=t.push("inline","",0)).content=r,s.map=[e,t.line-1],s.children=[],(s=t.push("heading_close","h"+String(l),-1)).markup=String.fromCharCode(h),t.parentType=f,!0)}},function(t,e,n){"use strict";var r=n(539),i=n(225).HTML_OPEN_CLOSE_TAG_RE,o=[[/^<(script|pre|style)(?=(\s|>|$))/i,/<\/(script|pre|style)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+r.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(i.source+"\\s*$"),/^$/,!1]];t.exports=function(t,e,n,r){var i,a,s,u,c=t.bMarks[e]+t.tShift[e],l=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4)return!1;if(!t.md.options.html)return!1;if(60!==t.src.charCodeAt(c))return!1;for(u=t.src.slice(c,l),i=0;i<o.length&&!o[i][0].test(u);i++);if(i===o.length)return!1;if(r)return o[i][2];if(a=e+1,!o[i][1].test(u))for(;a<n&&!(t.sCount[a]<t.blkIndent);a++)if(c=t.bMarks[a]+t.tShift[a],l=t.eMarks[a],u=t.src.slice(c,l),o[i][1].test(u)){0!==u.length&&a++;break}return t.line=a,(s=t.push("html_block","",0)).map=[e,a],s.content=t.getLines(e,a,t.blkIndent,!0),!0}},function(t,e,n){"use strict";t.exports=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","meta","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]},function(t,e,n){"use strict";t.exports=function(t,e){var n,r,i,o,a,s,u=e+1,c=t.md.block.ruler.getRules("paragraph"),l=t.lineMax;for(s=t.parentType,t.parentType="paragraph";u<l&&!t.isEmpty(u);u++)if(!(t.sCount[u]-t.blkIndent>3)&&!(t.sCount[u]<0)){for(r=!1,i=0,o=c.length;i<o;i++)if(c[i](t,u,l,!0)){r=!0;break}if(r)break}return n=t.getLines(e,u,t.blkIndent,!1).trim(),t.line=u,(a=t.push("paragraph_open","p",1)).map=[e,t.line],(a=t.push("inline","",0)).content=n,a.map=[e,t.line],a.children=[],a=t.push("paragraph_close","p",-1),t.parentType=s,!0}},function(t,e,n){"use strict";var r=n(154),i=n(11).isSpace;function o(t,e,n,r){var o,a,s,u,c,l,h,f;for(this.src=t,this.md=e,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0,this.result="",f=!1,s=u=l=h=0,c=(a=this.src).length;u<c;u++){if(o=a.charCodeAt(u),!f){if(i(o)){l++,9===o?h+=4-h%4:h++;continue}f=!0}10!==o&&u!==c-1||(10!==o&&u++,this.bMarks.push(s),this.eMarks.push(u),this.tShift.push(l),this.sCount.push(h),this.bsCount.push(0),f=!1,l=0,h=0,s=u+1)}this.bMarks.push(a.length),this.eMarks.push(a.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}o.prototype.push=function(t,e,n){var i=new r(t,e,n);return i.block=!0,n<0&&this.level--,i.level=this.level,n>0&&this.level++,this.tokens.push(i),i},o.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},o.prototype.skipEmptyLines=function(t){for(var e=this.lineMax;t<e&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t},o.prototype.skipSpaces=function(t){for(var e,n=this.src.length;t<n&&(e=this.src.charCodeAt(t),i(e));t++);return t},o.prototype.skipSpacesBack=function(t,e){if(t<=e)return t;for(;t>e;)if(!i(this.src.charCodeAt(--t)))return t+1;return t},o.prototype.skipChars=function(t,e){for(var n=this.src.length;t<n&&this.src.charCodeAt(t)===e;t++);return t},o.prototype.skipCharsBack=function(t,e,n){if(t<=n)return t;for(;t>n;)if(e!==this.src.charCodeAt(--t))return t+1;return t},o.prototype.getLines=function(t,e,n,r){var o,a,s,u,c,l,h,f=t;if(t>=e)return"";for(l=new Array(e-t),o=0;f<e;f++,o++){for(a=0,h=u=this.bMarks[f],c=f+1<e||r?this.eMarks[f]+1:this.eMarks[f];u<c&&a<n;){if(s=this.src.charCodeAt(u),i(s))9===s?a+=4-(a+this.bsCount[f])%4:a++;else{if(!(u-h<this.tShift[f]))break;a++}u++}l[o]=a>n?new Array(a-n+1).join(" ")+this.src.slice(u,c):this.src.slice(u,c)}return l.join("")},o.prototype.Token=r,t.exports=o},function(t,e,n){"use strict";var r=n(153),i=[["text",n(543)],["newline",n(544)],["escape",n(545)],["backticks",n(546)],["strikethrough",n(226).tokenize],["emphasis",n(227).tokenize],["link",n(547)],["image",n(548)],["autolink",n(549)],["html_inline",n(550)],["entity",n(551)]],o=[["balance_pairs",n(552)],["strikethrough",n(226).postProcess],["emphasis",n(227).postProcess],["text_collapse",n(553)]];function a(){var t;for(this.ruler=new r,t=0;t<i.length;t++)this.ruler.push(i[t][0],i[t][1]);for(this.ruler2=new r,t=0;t<o.length;t++)this.ruler2.push(o[t][0],o[t][1])}a.prototype.skipToken=function(t){var e,n,r=t.pos,i=this.ruler.getRules(""),o=i.length,a=t.md.options.maxNesting,s=t.cache;if("undefined"===typeof s[r]){if(t.level<a)for(n=0;n<o&&(t.level++,e=i[n](t,!0),t.level--,!e);n++);else t.pos=t.posMax;e||t.pos++,s[r]=t.pos}else t.pos=s[r]},a.prototype.tokenize=function(t){for(var e,n,r=this.ruler.getRules(""),i=r.length,o=t.posMax,a=t.md.options.maxNesting;t.pos<o;){if(t.level<a)for(n=0;n<i&&!(e=r[n](t,!1));n++);if(e){if(t.pos>=o)break}else t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()},a.prototype.parse=function(t,e,n,r){var i,o,a,s=new this.State(t,e,n,r);for(this.tokenize(s),a=(o=this.ruler2.getRules("")).length,i=0;i<a;i++)o[i](s)},a.prototype.State=n(554),t.exports=a},function(t,e,n){"use strict";function r(t){switch(t){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}t.exports=function(t,e){for(var n=t.pos;n<t.posMax&&!r(t.src.charCodeAt(n));)n++;return n!==t.pos&&(e||(t.pending+=t.src.slice(t.pos,n)),t.pos=n,!0)}},function(t,e,n){"use strict";var r=n(11).isSpace;t.exports=function(t,e){var n,i,o=t.pos;if(10!==t.src.charCodeAt(o))return!1;for(n=t.pending.length-1,i=t.posMax,e||(n>=0&&32===t.pending.charCodeAt(n)?n>=1&&32===t.pending.charCodeAt(n-1)?(t.pending=t.pending.replace(/ +$/,""),t.push("hardbreak","br",0)):(t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0)):t.push("softbreak","br",0)),o++;o<i&&r(t.src.charCodeAt(o));)o++;return t.pos=o,!0}},function(t,e,n){"use strict";for(var r=n(11).isSpace,i=[],o=0;o<256;o++)i.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach((function(t){i[t.charCodeAt(0)]=1})),t.exports=function(t,e){var n,o=t.pos,a=t.posMax;if(92!==t.src.charCodeAt(o))return!1;if(++o<a){if((n=t.src.charCodeAt(o))<256&&0!==i[n])return e||(t.pending+=t.src[o]),t.pos+=2,!0;if(10===n){for(e||t.push("hardbreak","br",0),o++;o<a&&(n=t.src.charCodeAt(o),r(n));)o++;return t.pos=o,!0}}return e||(t.pending+="\\"),t.pos++,!0}},function(t,e,n){"use strict";t.exports=function(t,e){var n,r,i,o,a,s,u=t.pos;if(96!==t.src.charCodeAt(u))return!1;for(n=u,u++,r=t.posMax;u<r&&96===t.src.charCodeAt(u);)u++;for(i=t.src.slice(n,u),o=a=u;-1!==(o=t.src.indexOf("`",a));){for(a=o+1;a<r&&96===t.src.charCodeAt(a);)a++;if(a-o===i.length)return e||((s=t.push("code_inline","code",0)).markup=i,s.content=t.src.slice(u,o).replace(/\n/g," ").replace(/^ (.+) $/,"$1")),t.pos=a,!0}return e||(t.pending+=i),t.pos+=i.length,!0}},function(t,e,n){"use strict";var r=n(11).normalizeReference,i=n(11).isSpace;t.exports=function(t,e){var n,o,a,s,u,c,l,h,f,d="",p=t.pos,v=t.posMax,m=t.pos,g=!0;if(91!==t.src.charCodeAt(t.pos))return!1;if(u=t.pos+1,(s=t.md.helpers.parseLinkLabel(t,t.pos,!0))<0)return!1;if((c=s+1)<v&&40===t.src.charCodeAt(c)){for(g=!1,c++;c<v&&(o=t.src.charCodeAt(c),i(o)||10===o);c++);if(c>=v)return!1;for(m=c,(l=t.md.helpers.parseLinkDestination(t.src,c,t.posMax)).ok&&(d=t.md.normalizeLink(l.str),t.md.validateLink(d)?c=l.pos:d=""),m=c;c<v&&(o=t.src.charCodeAt(c),i(o)||10===o);c++);if(l=t.md.helpers.parseLinkTitle(t.src,c,t.posMax),c<v&&m!==c&&l.ok)for(f=l.str,c=l.pos;c<v&&(o=t.src.charCodeAt(c),i(o)||10===o);c++);else f="";(c>=v||41!==t.src.charCodeAt(c))&&(g=!0),c++}if(g){if("undefined"===typeof t.env.references)return!1;if(c<v&&91===t.src.charCodeAt(c)?(m=c+1,(c=t.md.helpers.parseLinkLabel(t,c))>=0?a=t.src.slice(m,c++):c=s+1):c=s+1,a||(a=t.src.slice(u,s)),!(h=t.env.references[r(a)]))return t.pos=p,!1;d=h.href,f=h.title}return e||(t.pos=u,t.posMax=s,t.push("link_open","a",1).attrs=n=[["href",d]],f&&n.push(["title",f]),t.md.inline.tokenize(t),t.push("link_close","a",-1)),t.pos=c,t.posMax=v,!0}},function(t,e,n){"use strict";var r=n(11).normalizeReference,i=n(11).isSpace;t.exports=function(t,e){var n,o,a,s,u,c,l,h,f,d,p,v,m,g="",y=t.pos,b=t.posMax;if(33!==t.src.charCodeAt(t.pos))return!1;if(91!==t.src.charCodeAt(t.pos+1))return!1;if(c=t.pos+2,(u=t.md.helpers.parseLinkLabel(t,t.pos+1,!1))<0)return!1;if((l=u+1)<b&&40===t.src.charCodeAt(l)){for(l++;l<b&&(o=t.src.charCodeAt(l),i(o)||10===o);l++);if(l>=b)return!1;for(m=l,(f=t.md.helpers.parseLinkDestination(t.src,l,t.posMax)).ok&&(g=t.md.normalizeLink(f.str),t.md.validateLink(g)?l=f.pos:g=""),m=l;l<b&&(o=t.src.charCodeAt(l),i(o)||10===o);l++);if(f=t.md.helpers.parseLinkTitle(t.src,l,t.posMax),l<b&&m!==l&&f.ok)for(d=f.str,l=f.pos;l<b&&(o=t.src.charCodeAt(l),i(o)||10===o);l++);else d="";if(l>=b||41!==t.src.charCodeAt(l))return t.pos=y,!1;l++}else{if("undefined"===typeof t.env.references)return!1;if(l<b&&91===t.src.charCodeAt(l)?(m=l+1,(l=t.md.helpers.parseLinkLabel(t,l))>=0?s=t.src.slice(m,l++):l=u+1):l=u+1,s||(s=t.src.slice(c,u)),!(h=t.env.references[r(s)]))return t.pos=y,!1;g=h.href,d=h.title}return e||(a=t.src.slice(c,u),t.md.inline.parse(a,t.md,t.env,v=[]),(p=t.push("image","img",0)).attrs=n=[["src",g],["alt",""]],p.children=v,p.content=a,d&&n.push(["title",d])),t.pos=l,t.posMax=b,!0}},function(t,e,n){"use strict";var r=/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/,i=/^<([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)>/;t.exports=function(t,e){var n,o,a,s,u,c,l=t.pos;return 60===t.src.charCodeAt(l)&&(!((n=t.src.slice(l)).indexOf(">")<0)&&(i.test(n)?(s=(o=n.match(i))[0].slice(1,-1),u=t.md.normalizeLink(s),!!t.md.validateLink(u)&&(e||((c=t.push("link_open","a",1)).attrs=[["href",u]],c.markup="autolink",c.info="auto",(c=t.push("text","",0)).content=t.md.normalizeLinkText(s),(c=t.push("link_close","a",-1)).markup="autolink",c.info="auto"),t.pos+=o[0].length,!0)):!!r.test(n)&&(s=(a=n.match(r))[0].slice(1,-1),u=t.md.normalizeLink("mailto:"+s),!!t.md.validateLink(u)&&(e||((c=t.push("link_open","a",1)).attrs=[["href",u]],c.markup="autolink",c.info="auto",(c=t.push("text","",0)).content=t.md.normalizeLinkText(s),(c=t.push("link_close","a",-1)).markup="autolink",c.info="auto"),t.pos+=a[0].length,!0))))}},function(t,e,n){"use strict";var r=n(225).HTML_TAG_RE;t.exports=function(t,e){var n,i,o,a=t.pos;return!!t.md.options.html&&(o=t.posMax,!(60!==t.src.charCodeAt(a)||a+2>=o)&&(!(33!==(n=t.src.charCodeAt(a+1))&&63!==n&&47!==n&&!function(t){var e=32|t;return e>=97&&e<=122}(n))&&(!!(i=t.src.slice(a).match(r))&&(e||(t.push("html_inline","",0).content=t.src.slice(a,a+i[0].length)),t.pos+=i[0].length,!0))))}},function(t,e,n){"use strict";var r=n(220),i=n(11).has,o=n(11).isValidEntityCode,a=n(11).fromCodePoint,s=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,u=/^&([a-z][a-z0-9]{1,31});/i;t.exports=function(t,e){var n,c,l=t.pos,h=t.posMax;if(38!==t.src.charCodeAt(l))return!1;if(l+1<h)if(35===t.src.charCodeAt(l+1)){if(c=t.src.slice(l).match(s))return e||(n="x"===c[1][0].toLowerCase()?parseInt(c[1].slice(1),16):parseInt(c[1],10),t.pending+=o(n)?a(n):a(65533)),t.pos+=c[0].length,!0}else if((c=t.src.slice(l).match(u))&&i(r,c[1]))return e||(t.pending+=r[c[1]]),t.pos+=c[0].length,!0;return e||(t.pending+="&"),t.pos++,!0}},function(t,e,n){"use strict";function r(t,e){var n,r,i,o,a,s,u,c,l={},h=e.length;for(n=0;n<h;n++)if((i=e[n]).length=i.length||0,i.close){for(l.hasOwnProperty(i.marker)||(l[i.marker]=[-1,-1,-1]),a=l[i.marker][i.length%3],s=-1,r=n-i.jump-1;r>a;r-=o.jump+1)if((o=e[r]).marker===i.marker&&(-1===s&&(s=r),o.open&&o.end<0&&o.level===i.level&&(u=!1,(o.close||i.open)&&(o.length+i.length)%3===0&&(o.length%3===0&&i.length%3===0||(u=!0)),!u))){c=r>0&&!e[r-1].open?e[r-1].jump+1:0,i.jump=n-r+c,i.open=!1,o.end=n,o.jump=c,o.close=!1,s=-1;break}-1!==s&&(l[i.marker][(i.length||0)%3]=s)}}t.exports=function(t){var e,n=t.tokens_meta,i=t.tokens_meta.length;for(r(0,t.delimiters),e=0;e<i;e++)n[e]&&n[e].delimiters&&r(0,n[e].delimiters)}},function(t,e,n){"use strict";t.exports=function(t){var e,n,r=0,i=t.tokens,o=t.tokens.length;for(e=n=0;e<o;e++)i[e].nesting<0&&r--,i[e].level=r,i[e].nesting>0&&r++,"text"===i[e].type&&e+1<o&&"text"===i[e+1].type?i[e+1].content=i[e].content+i[e+1].content:(e!==n&&(i[n]=i[e]),n++);e!==n&&(i.length=n)}},function(t,e,n){"use strict";var r=n(154),i=n(11).isWhiteSpace,o=n(11).isPunctChar,a=n(11).isMdAsciiPunct;function s(t,e,n,r){this.src=t,this.env=n,this.md=e,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[]}s.prototype.pushPending=function(){var t=new r("text","",0);return t.content=this.pending,t.level=this.pendingLevel,this.tokens.push(t),this.pending="",t},s.prototype.push=function(t,e,n){this.pending&&this.pushPending();var i=new r(t,e,n),o=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(o),i},s.prototype.scanDelims=function(t,e){var n,r,s,u,c,l,h,f,d,p=t,v=!0,m=!0,g=this.posMax,y=this.src.charCodeAt(t);for(n=t>0?this.src.charCodeAt(t-1):32;p<g&&this.src.charCodeAt(p)===y;)p++;return s=p-t,r=p<g?this.src.charCodeAt(p):32,h=a(n)||o(String.fromCharCode(n)),d=a(r)||o(String.fromCharCode(r)),l=i(n),(f=i(r))?v=!1:d&&(l||h||(v=!1)),l?m=!1:h&&(f||d||(m=!1)),e?(u=v,c=m):(u=v&&(!m||h),c=m&&(!v||d)),{can_open:u,can_close:c,length:s}},s.prototype.Token=r,t.exports=s},function(t,e,n){"use strict";function r(t){var e=Array.prototype.slice.call(arguments,1);return e.forEach((function(e){e&&Object.keys(e).forEach((function(n){t[n]=e[n]}))})),t}function i(t){return Object.prototype.toString.call(t)}function o(t){return"[object Function]"===i(t)}function a(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var s={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};var u={"http:":{validate:function(t,e,n){var r=t.slice(e);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,n){var r=t.slice(e);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?e>=3&&":"===t[e-3]||e>=3&&"/"===t[e-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,n){var r=t.slice(e);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},c="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function l(t){var e=t.re=n(556)(t.__opts__),r=t.__tlds__.slice();function s(t){return t.replace("%TLDS%",e.src_tlds)}t.onCompile(),t.__tlds_replaced__||r.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),r.push(e.src_xn),e.src_tlds=r.join("|"),e.email_fuzzy=RegExp(s(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(s(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(s(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(s(e.tpl_host_fuzzy_test),"i");var u=[];function c(t,e){throw new Error('(LinkifyIt) Invalid schema "'+t+'": '+e)}t.__compiled__={},Object.keys(t.__schemas__).forEach((function(e){var n=t.__schemas__[e];if(null!==n){var r={validate:null,link:null};if(t.__compiled__[e]=r,"[object Object]"===i(n))return!function(t){return"[object RegExp]"===i(t)}(n.validate)?o(n.validate)?r.validate=n.validate:c(e,n):r.validate=function(t){return function(e,n){var r=e.slice(n);return t.test(r)?r.match(t)[0].length:0}}(n.validate),void(o(n.normalize)?r.normalize=n.normalize:n.normalize?c(e,n):r.normalize=function(t,e){e.normalize(t)});!function(t){return"[object String]"===i(t)}(n)?c(e,n):u.push(e)}})),u.forEach((function(e){t.__compiled__[t.__schemas__[e]]&&(t.__compiled__[e].validate=t.__compiled__[t.__schemas__[e]].validate,t.__compiled__[e].normalize=t.__compiled__[t.__schemas__[e]].normalize)})),t.__compiled__[""]={validate:null,normalize:function(t,e){e.normalize(t)}};var l=Object.keys(t.__compiled__).filter((function(e){return e.length>0&&t.__compiled__[e]})).map(a).join("|");t.re.schema_test=RegExp("(^|(?!_)(?:[><\uff5c]|"+e.src_ZPCc+"))("+l+")","i"),t.re.schema_search=RegExp("(^|(?!_)(?:[><\uff5c]|"+e.src_ZPCc+"))("+l+")","ig"),t.re.pretest=RegExp("("+t.re.schema_test.source+")|("+t.re.host_fuzzy_test.source+")|@","i"),function(t){t.__index__=-1,t.__text_cache__=""}(t)}function h(t,e){var n=t.__index__,r=t.__last_index__,i=t.__text_cache__.slice(n,r);this.schema=t.__schema__.toLowerCase(),this.index=n+e,this.lastIndex=r+e,this.raw=i,this.text=i,this.url=i}function f(t,e){var n=new h(t,e);return t.__compiled__[n.schema].normalize(n,t),n}function d(t,e){if(!(this instanceof d))return new d(t,e);var n;e||(n=t,Object.keys(n||{}).reduce((function(t,e){return t||s.hasOwnProperty(e)}),!1)&&(e=t,t={})),this.__opts__=r({},s,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=r({},u,t),this.__compiled__={},this.__tlds__=c,this.__tlds_replaced__=!1,this.re={},l(this)}d.prototype.add=function(t,e){return this.__schemas__[t]=e,l(this),this},d.prototype.set=function(t){return this.__opts__=r(this.__opts__,t),this},d.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;var e,n,r,i,o,a,s,u;if(this.re.schema_test.test(t))for((s=this.re.schema_search).lastIndex=0;null!==(e=s.exec(t));)if(i=this.testSchemaAt(t,e[2],s.lastIndex)){this.__schema__=e[2],this.__index__=e.index+e[1].length,this.__last_index__=e.index+e[0].length+i;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(u=t.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||u<this.__index__)&&null!==(n=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))&&(o=n.index+n[1].length,(this.__index__<0||o<this.__index__)&&(this.__schema__="",this.__index__=o,this.__last_index__=n.index+n[0].length)),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&null!==(r=t.match(this.re.email_fuzzy))&&(o=r.index+r[1].length,a=r.index+r[0].length,(this.__index__<0||o<this.__index__||o===this.__index__&&a>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=a)),this.__index__>=0},d.prototype.pretest=function(t){return this.re.pretest.test(t)},d.prototype.testSchemaAt=function(t,e,n){return this.__compiled__[e.toLowerCase()]?this.__compiled__[e.toLowerCase()].validate(t,n,this):0},d.prototype.match=function(t){var e=0,n=[];this.__index__>=0&&this.__text_cache__===t&&(n.push(f(this,e)),e=this.__last_index__);for(var r=e?t.slice(e):t;this.test(r);)n.push(f(this,e)),r=r.slice(this.__last_index__),e+=this.__last_index__;return n.length?n:null},d.prototype.tlds=function(t,e){return t=Array.isArray(t)?t:[t],e?(this.__tlds__=this.__tlds__.concat(t).sort().filter((function(t,e,n){return t!==n[e-1]})).reverse(),l(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,l(this),this)},d.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),"mailto:"!==t.schema||/^mailto:/i.test(t.url)||(t.url="mailto:"+t.url)},d.prototype.onCompile=function(){},t.exports=d},function(t,e,n){"use strict";t.exports=function(t){var e={};e.src_Any=n(222).source,e.src_Cc=n(223).source,e.src_Z=n(224).source,e.src_P=n(152).source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");return e.src_pseudo_letter="(?:(?![><\uff5c]|"+e.src_ZPCc+")"+e.src_Any+")",e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|[><\uff5c]|"+e.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|"+"[><\uff5c]|[()[\\]{}.,\"'?!\\-]).|\\[(?:(?!"+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-]).|\\.{2,4}[a-zA-Z0-9%/]|\\.(?!"+e.src_ZCc+"|[.]).|"+(t&&t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+e.src_ZCc+").|\\!(?!"+e.src_ZCc+"|[!]).|\\?(?!"+e.src_ZCc+"|[?]).)+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy='(^|[><\uff5c]|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|"+e.src_ZPCc+"))((?![$+<=>^`|\uff5c])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|"+e.src_ZPCc+"))((?![$+<=>^`|\uff5c])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}},function(t,e,n){(function(t,r){var i;function o(t){return(o="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(a){var s="object"==o(e)&&e&&!e.nodeType&&e,u="object"==o(t)&&t&&!t.nodeType&&t,c="object"==("undefined"===typeof r?"undefined":o(r))&&r;c.global!==c&&c.window!==c&&c.self!==c||(a=c);var l,h,f=2147483647,d=36,p=/^xn--/,v=/[^\x20-\x7E]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,g={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=Math.floor,b=String.fromCharCode;function w(t){throw new RangeError(g[t])}function _(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}function x(t,e){var n=t.split("@"),r="";return n.length>1&&(r=n[0]+"@",t=n[1]),r+_((t=t.replace(m,".")).split("."),e).join(".")}function k(t){for(var e,n,r=[],i=0,o=t.length;i<o;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<o?56320==(64512&(n=t.charCodeAt(i++)))?r.push(((1023&e)<<10)+(1023&n)+65536):(r.push(e),i--):r.push(e);return r}function S(t){return _(t,(function(t){var e="";return t>65535&&(e+=b((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=b(t)})).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function M(t,e,n){var r=0;for(t=n?y(t/700):t>>1,t+=y(t/e);t>455;r+=d)t=y(t/35);return y(r+36*t/(t+38))}function E(t){var e,n,r,i,o,a,s,u,c,l,h,p=[],v=t.length,m=0,g=128,b=72;for((n=t.lastIndexOf("-"))<0&&(n=0),r=0;r<n;++r)t.charCodeAt(r)>=128&&w("not-basic"),p.push(t.charCodeAt(r));for(i=n>0?n+1:0;i<v;){for(o=m,a=1,s=d;i>=v&&w("invalid-input"),((u=(h=t.charCodeAt(i++))-48<10?h-22:h-65<26?h-65:h-97<26?h-97:d)>=d||u>y((f-m)/a))&&w("overflow"),m+=u*a,!(u<(c=s<=b?1:s>=b+26?26:s-b));s+=d)a>y(f/(l=d-c))&&w("overflow"),a*=l;b=M(m-o,e=p.length+1,0==o),y(m/e)>f-g&&w("overflow"),g+=y(m/e),m%=e,p.splice(m++,0,g)}return S(p)}function T(t){var e,n,r,i,o,a,s,u,c,l,h,p,v,m,g,_=[];for(p=(t=k(t)).length,e=128,n=0,o=72,a=0;a<p;++a)(h=t[a])<128&&_.push(b(h));for(r=i=_.length,i&&_.push("-");r<p;){for(s=f,a=0;a<p;++a)(h=t[a])>=e&&h<s&&(s=h);for(s-e>y((f-n)/(v=r+1))&&w("overflow"),n+=(s-e)*v,e=s,a=0;a<p;++a)if((h=t[a])<e&&++n>f&&w("overflow"),h==e){for(u=n,c=d;!(u<(l=c<=o?1:c>=o+26?26:c-o));c+=d)g=u-l,m=d-l,_.push(b(C(l+g%m,0))),u=y(g/m);_.push(b(C(u,0))),o=M(n,v,r==i),n=0,++r}++n,++e}return _.join("")}if(l={version:"1.4.1",ucs2:{decode:k,encode:S},decode:E,encode:T,toASCII:function(t){return x(t,(function(t){return v.test(t)?"xn--"+T(t):t}))},toUnicode:function(t){return x(t,(function(t){return p.test(t)?E(t.slice(4).toLowerCase()):t}))}},"object"==o(n(228))&&n(228))void 0===(i=function(){return l}.call(e,n,e,t))||(t.exports=i);else if(s&&u)if(t.exports==s)u.exports=l;else for(h in l)l.hasOwnProperty(h)&&(s[h]=l[h]);else a.punycode=l}(this)}).call(this,n(155)(t),n(64))},function(t,e,n){"use strict";t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201c\u201d\u2018\u2019",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}}},function(t,e,n){"use strict";t.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201c\u201d\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","text_collapse"]}}}},function(t,e,n){"use strict";t.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201c\u201d\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","text_collapse"]}}}},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e){var n={720:"-12:00",660:"-11:00",600:"-10:00",570:"-09:30",540:"-09:00",480:"-08:00",420:"-07:00",360:"-06:00",300:"-05:00",240:"-04:00",210:"-03:30",180:"-03:00",120:"-02:00",60:"-01:00",0:"00:00","-60":"+01:00","-120":"+02:00","-180":"+03:00","-210":"+03:30","-240":"+04:00","-270":"+04:30","-300":"+05:00","-330":"+05:30","-345":"+05:45","-360":"+06:00","-390":"+06:30","-420":"+07:00","-480":"+08:00","-525":"+08:45","-540":"+09:00","-570":"+09:30","-600":"+10:00","-630":"+10:30","-660":"+11:00","-720":"+12:00","-765":"+12:45","-780":"+13:00","-840":"+14:00"}[(new Date).getTimezoneOffset().toString()];document.addEventListener("turbolinks:load",(function(){document.querySelectorAll(".new .event .zone select").forEach((function(t){return t.value=n}))}))},function(t,e){document.addEventListener("turbolinks:load",(function(){document.querySelectorAll('a[href^="#"]').forEach((function(t){return t.dataset.turbolinks=!1}))}))},function(t,e){document.addEventListener("turbolinks:load",(function(){document.querySelectorAll("form").forEach((function(t){t.addEventListener("submit",(function(e){var n=t.querySelectorAll(".invalid-help"),r=t.querySelectorAll(".sending-help");n.forEach((function(t){return t.classList.add("d-none")})),r.forEach((function(t){return t.classList.add("d-none")})),t.querySelectorAll('[aria-invalid="true"]').forEach((function(t){t.setAttribute("aria-invalid",!1),t.setAttribute("aria-describedby",t.parentElement.querySelector(".feedback").id)})),!1===t.checkValidity()?(e.preventDefault(),e.stopPropagation(),n.forEach((function(t){return t.classList.remove("d-none")})),t.querySelectorAll(":invalid").forEach((function(t){t.setAttribute("aria-invalid",!0),t.setAttribute("aria-describedby",t.parentElement.querySelector(".invalid-feedback").id)}))):r.forEach((function(t){return t.classList.remove("d-none")})),t.classList.add("was-validated")}))}))}))},function(t,e,n){"use strict";(function(t){var r=n(569),i=n(570),o=n(571);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,n){if(!u.TYPED_ARRAY_SUPPORT&&!(this instanceof u))return new u(t,e,n);if("number"===typeof t){if("string"===typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return c(this,t,e,n)}function c(t,e,n,r){if("number"===typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!==typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=f(t,e);return t}(t,e,n,r):"string"===typeof e?function(t,e,n){"string"===typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|p(e,n),i=(t=s(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(u.isBuffer(e)){var n=0|d(e.length);return 0===(t=s(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!==typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!==typeof e.length||(r=e.length)!==r?s(t,0):f(t,e);if("Buffer"===e.type&&o(e.data))return f(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function l(t){if("number"!==typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(l(e),t=s(t,e<0?0:0|d(e)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function f(t,e){var n=e.length<0?0:0|d(e.length);t=s(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function d(t){if(t>=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(u.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 q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return $(t).length;default:if(r)return q(t).length;e=(""+e).toLowerCase(),r=!0}}function v(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 O(this,e,n);case"utf8":case"utf-8":return M(this,e,n);case"ascii":return T(this,e,n);case"latin1":case"binary":return A(this,e,n);case"base64":return C(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function m(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function g(t,e,n,r,i){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=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"===typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:y(t,e,n,r,i);if("number"===typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):y(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,r,i){var o,a=1,s=t.length,u=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,u/=2,n/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var l=-1;for(o=n;o<s;o++)if(c(t,o)===c(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===u)return l*a}else-1!==l&&(o-=o-l),l=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){for(var h=!0,f=0;f<u;f++)if(c(t,o+f)!==c(e,f)){h=!1;break}if(h)return o}return-1}function b(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[n+a]=s}return a}function w(t,e,n,r){return V(q(e,t.length-n),t,n,r)}function _(t,e,n,r){return V(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function x(t,e,n,r){return _(t,e,n,r)}function k(t,e,n,r){return V($(e),t,n,r)}function S(t,e,n,r){return V(function(t,e){for(var n,r,i,o=[],a=0;a<t.length&&!((e-=2)<0);++a)r=(n=t.charCodeAt(a))>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function C(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function M(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,a,s,u,c=t[i],l=null,h=c>239?4:c>223?3:c>191?2:1;if(i+h<=n)switch(h){case 1:c<128&&(l=c);break;case 2:128===(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=t[i+1],a=t[i+2],128===(192&o)&&128===(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128===(192&o)&&128===(192&a)&&128===(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=h}return function(t){var e=t.length;if(e<=E)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=E));return n}(r)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"===typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(e){return!1}}(),e.kMaxLength=a(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,n){return c(null,t,e,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,n){return function(t,e,n,r){return l(e),e<=0?s(t,e):void 0!==n?"string"===typeof r?s(t,e).fill(n,r):s(t,e).fill(n):s(t,e)}(null,t,e,n)},u.allocUnsafe=function(t){return h(null,t)},u.allocUnsafeSlow=function(t){return h(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=u.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var a=t[n];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?M(this,0,t):v.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,n,r,i){if(!u.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===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),s=Math.min(o,a),c=this.slice(r,i),l=t.slice(e,n),h=0;h<s;++h)if(c[h]!==l[h]){o=c[h],a=l[h];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},u.prototype.indexOf=function(t,e,n){return g(this,t,e,n,!0)},u.prototype.lastIndexOf=function(t,e,n){return g(this,t,e,n,!1)},u.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"===typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return w(this,t,e,n);case"ascii":return _(this,t,e,n);case"latin1":case"binary":return x(this,t,e,n);case"base64":return k(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.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 i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function A(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function O(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=F(t[o]);return i}function D(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function P(t,e,n){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,n,r,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function N(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function R(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function I(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function z(t,e,n,r,o){return o||I(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function B(t,e,n,r,o){return o||I(t,0,n,8),i.write(t,e,n,r,52,8),n+8}u.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),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=u.prototype;else{var i=e-t;n=new u(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},u.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},u.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},u.prototype.readUInt8=function(t,e){return e||P(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||P(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||P(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||P(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||P(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||P(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||P(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||P(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||P(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||P(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||L(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},u.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||L(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):R(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);L(this,t,e,n,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o<n&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);L(this,t,e,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):R(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return z(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return z(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return B(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return B(this,t,e,!1,n)},u.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<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=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<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},u.prototype.fill=function(t,e,n,r){if("string"===typeof t){if("string"===typeof e?(r=e,e=0,n=this.length):"string"===typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!==typeof r)throw new TypeError("encoding must be a string");if("string"===typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"===typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"===typeof t)for(o=e;o<n;++o)this[o]=t;else{var a=u.isBuffer(t)?t:q(new u(t,r).toString()),s=a.length;for(o=0;o<n-e;++o)this[o+e]=a[o%s]}return this};var j=/[^+\/0-9A-Za-z-_]/g;function F(t){return t<16?"0"+t.toString(16):t.toString(16)}function q(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],a=0;a<r;++a){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.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;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function $(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(j,"")).length<2)return"";for(;t.length%4!==0;)t+="=";return t}(t))}function V(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(64))},function(t,e,n){"use strict";e.byteLength=function(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=c(t),a=r[0],s=r[1],u=new o(function(t,e,n){return 3*(e+n)/4-n}(0,a,s)),l=0,h=s>0?a-4:a;for(n=0;n<h;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],u[l++]=e>>16&255,u[l++]=e>>8&255,u[l++]=255&e;2===s&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,u[l++]=255&e);1===s&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e);return u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],a=16383,s=0,u=n-i;s<u;s+=a)o.push(l(t,s,s+a>u?u:s+a));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!==typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)r[s]=a[s],i[a.charCodeAt(s)]=s;function c(t){var e=t.length;if(e%4>0)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 l(t,e,n){for(var i,o,a=[],s=e;s<n;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,c=u>>1,l=-7,h=n?i-1:0,f=n?-1:1,d=t[e+h];for(h+=f,o=d&(1<<-l)-1,d>>=-l,l+=s;l>0;o=256*o+t[e+h],h+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+t[e+h],h+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),o-=c}return(d?-1:1)*a*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,h=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,v=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=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[n+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[n+d]=255&a,d+=p,a/=256,c-=8);t[n+d-p]|=128*v}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){},function(t,e,n){"use strict";n.r(e);n(238),n(246),n(247),n(248),n(249),n(250),n(251),n(252),n(253),n(254),n(255),n(256),n(257),n(258),n(259),n(260),n(261),n(262),n(263),n(264),n(265),n(266),n(267),n(268),n(269),n(271),n(272),n(273),n(100),n(276),n(277),n(278),n(279),n(280),n(281),n(282),n(283),n(284),n(285),n(286),n(287),n(289),n(290),n(291),n(294),n(295),n(296),n(298),n(299),n(301),n(302),n(304),n(305),n(306),n(307),n(308),n(309),n(311),n(312),n(313),n(314),n(315),n(316),n(317),n(318),n(319),n(320),n(321),n(323),n(324),n(325),n(326),n(327),n(328),n(329),n(330),n(331),n(332),n(334),n(335),n(336),n(337),n(338),n(339),n(340),n(341),n(342),n(343),n(344),n(345),n(346),n(347),n(348),n(349),n(350),n(351),n(352),n(353),n(354),n(355),n(356),n(357),n(358),n(359),n(360),n(361),n(362),n(363),n(364),n(365),n(366),n(368),n(369),n(370),n(371),n(382),n(383),n(384),n(385),n(386),n(387),n(388),n(389),n(390),n(391),n(392),n(393),n(394),n(395),n(396),n(200),n(398),n(399),n(400),n(402),n(403),n(404),n(405),n(201),n(406),n(407),n(408),n(409),n(410),n(411),n(413),n(414),n(415),n(416),n(417),n(419),n(421),n(422),n(423),n(424),n(425),n(426),n(427),n(428),n(429),n(430),n(431),n(432),n(433),n(434),n(438),n(439),n(440),n(441),n(442),n(443),n(444),n(445),n(446),n(447),n(448),n(449),n(451),n(452),n(453),n(454),n(455),n(456),n(457),n(458),n(459),n(460),n(461),n(462),n(463),n(464),n(465),n(466),n(467),n(468),n(469),n(470),n(471),n(472),n(474),n(476),n(477),n(478),n(482),n(483),n(486),n(489),n(490);var r=n(43);function i(t){return(i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){return t>>e||1}var a=function(){function t(t){this.maxStringLength=1024,this.maxObjectLength=128,this.maxArrayLength=128,this.maxDepth=8,this.keys=[],this.keysBlocklist=[],this.seen=[];var e=t.level||0;this.keysBlocklist=t.keysBlocklist||[],this.maxStringLength=o(this.maxStringLength,e),this.maxObjectLength=o(this.maxObjectLength,e),this.maxArrayLength=o(this.maxArrayLength,e),this.maxDepth=o(this.maxDepth,e)}return t.prototype.truncate=function(t,e,n){if(void 0===e&&(e=""),void 0===n&&(n=0),null===t||void 0===t)return t;switch(i(t)){case"boolean":case"number":case"function":return t;case"string":return this.truncateString(t);case"object":break;default:return this.truncateString(String(t))}if(t instanceof String)return this.truncateString(t.toString());if(t instanceof Boolean||t instanceof Number||t instanceof Date||t instanceof RegExp)return t;if(t instanceof Error)return this.truncateString(t.toString());if(this.seen.indexOf(t)>=0)return"[Circular "+this.getPath(t)+"]";var r=function(t){return Object.prototype.toString.apply(t).slice("[object ".length,-1)}(t);if(++n>this.maxDepth)return"[Truncated "+r+"]";switch(this.keys.push(e),this.seen.push(t),r){case"Array":return this.truncateArray(t,n);case"Object":return this.truncateObject(t,n);default:var o=this.maxDepth;this.maxDepth=0;var a=this.truncateObject(t,n);return a.__type=r,this.maxDepth=o,a}},t.prototype.getPath=function(t){for(var e=this.seen.indexOf(t),n=[this.keys[e]],r=e;r>=0;r--){var i=this.seen[r];i&&u(i,n[0])===t&&(t=i,n.unshift(this.keys[r]))}return"~"+n.join(".")},t.prototype.truncateString=function(t){return t.length>this.maxStringLength?t.slice(0,this.maxStringLength)+"...":t},t.prototype.truncateArray=function(t,e){void 0===e&&(e=0);for(var n=0,r=[],i=0;i<t.length;i++){var o=t[i];if(r.push(this.truncate(o,i.toString(),e)),++n>=this.maxArrayLength)break}return r},t.prototype.truncateObject=function(t,e){void 0===e&&(e=0);var n=0,r={};for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))if(c(i,this.keysBlocklist))r[i]="[Filtered]";else{var o=u(t,i);if(void 0!==o&&"function"!==typeof o&&(r[i]=this.truncate(o,i,e),++n>=this.maxObjectLength))break}return r},t}();function s(t,e){return void 0===e&&(e={}),new a(e).truncate(t)}function u(t,e){try{return t[e]}catch(n){return}}function c(t,e){for(var n=0,r=e;n<r.length;n++){var i=r[n];if(i===t)return!0;if(i instanceof RegExp&&t.match(i))return!0}return!1}var l=function(){function t(t,e,n){this._dur=0,this._level=0,this._metric=t,this.name=e,this.startTime=n||new Date}return t.prototype.end=function(t){this.endTime=t||new Date,this._dur+=this.endTime.getTime()-this.startTime.getTime(),this._metric._incGroup(this.name,this._dur),this._metric=null},t.prototype._pause=function(){if(!this._paused()){var t=new Date;this._dur+=t.getTime()-this.startTime.getTime(),this.startTime=null}},t.prototype._resume=function(){this._paused()&&(this.startTime=new Date)},t.prototype._paused=function(){return null==this.startTime},t}(),h=function(){function t(){this._spans={},this._groups={},this.startTime=new Date}return t.prototype.end=function(t){this.endTime||(this.endTime=t||new Date)},t.prototype.isRecording=function(){return!0},t.prototype.startSpan=function(t,e){var n=this._spans[t];n?n._level++:(n=new l(this,t,e),this._spans[t]=n)},t.prototype.endSpan=function(t,e){var n=this._spans[t];n?n._level>0?n._level--:(n.end(e),delete this._spans[n.name]):console.error("airbrake: span=%s does not exist",t)},t.prototype._incGroup=function(t,e){this._groups[t]=(this._groups[t]||0)+e},t.prototype._duration=function(){return this.endTime||(this.endTime=new Date),this.endTime.getTime()-this.startTime.getTime()},t}(),f=function(){function t(){}return t.prototype.isRecording=function(){return!1},t.prototype.startSpan=function(t,e){},t.prototype.endSpan=function(t,e){},t.prototype._incGroup=function(t,e){},t}(),d=function(){return(d=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},p=function(){function t(){this._noopMetric=new f,this._context={},this._historyMaxLen=20,this._history=[]}return t.prototype.clone=function(){var e=new t;return e._context=d({},this._context),e._history=this._history.slice(),e},t.prototype.setContext=function(t){this._context=d(d({},this._context),t)},t.prototype.context=function(){var t=d({},this._context);return this._history.length>0&&(t.history=this._history.slice()),t},t.prototype.pushHistory=function(t){this._isDupState(t)?this._lastRecord.num?this._lastRecord.num++:this._lastRecord.num=2:(t.date||(t.date=new Date),this._history.push(t),this._lastRecord=t,this._history.length>this._historyMaxLen&&(this._history=this._history.slice(-this._historyMaxLen)))},t.prototype._isDupState=function(t){if(!this._lastRecord)return!1;for(var e in t)if(t.hasOwnProperty(e)&&"date"!==e&&t[e]!==this._lastRecord[e])return!1;return!0},t.prototype.routeMetric=function(){return this._routeMetric||this._noopMetric},t.prototype.setRouteMetric=function(t){this._routeMetric=t},t.prototype.queueMetric=function(){return this._queueMetric||this._noopMetric},t.prototype.setQueueMetric=function(t){this._queueMetric=t},t}(),v=n(231),m=n.n(v);function g(t){return(g="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)}var y="object"===("undefined"===typeof console?"undefined":g(console))&&console.warn;function b(t){try{return m.a.parse(t)}catch(e){y&&t.stack&&console.warn("ErrorStackParser:",e.toString(),t.stack)}return t.fileName?[t]:[]}function w(t){var e=[];if(t.noStack)e.push({function:t.functionName||"",file:t.fileName||"",line:t.lineNumber||0,column:t.columnNumber||0});else{var n=b(t);if(0===n.length)try{throw new Error("fake")}catch(a){(n=b(a)).shift(),n.shift()}for(var r=0,i=n;r<i.length;r++){var o=i[r];e.push({function:o.functionName||"",file:o.fileName||"",line:o.lineNumber||0,column:o.columnNumber||0})}}return{type:t.name?t.name:"",message:t.message?String(t.message):String(t),backtrace:e}}var _=new RegExp(["^","\\[(\\$.+)\\]","\\s","([\\s\\S]+)","$"].join(""));function x(t){var e=t.errors[0];if(""!==e.type&&"Error"!==e.type)return t;var n=e.message.match(_);return null!==n&&(e.type=n[1],e.message=n[2]),t}var k=["Script error","Script error.","InvalidAccessError"];function S(t){var e=t.errors[0];if(""===e.type&&-1!==k.indexOf(e.message))return null;if(e.backtrace&&e.backtrace.length>0&&"<anonymous>"===e.backtrace[0].file)return null;return t}var C=new RegExp(["^","Uncaught\\s","(.+?)",":\\s","(.+)","$"].join(""));function M(t){var e=t.errors[0];if(""!==e.type&&"Error"!==e.type)return t;var n=e.message.match(C);return null!==n&&(e.type=n[1],e.message=n[2]),t}var E=n(232),T=n.n(E),A={unauthorized:new Error("airbrake: unauthorized: project id or key are wrong"),ipRateLimited:new Error("airbrake: IP is rate limited")},O=0;function D(t){if(Date.now()/1e3<O)return r.a.reject(A.ipRateLimited);var e={method:t.method,body:t.body};return T()(t.url,e).then((function(t){if(401===t.status)throw A.unauthorized;if(429===t.status){var e=t.headers.get("X-RateLimit-Delay");if(!e)throw A.ipRateLimited;var n=parseInt(e,10);throw n>0&&(O=Date.now()/1e3+n),A.ipRateLimited}if(204===t.status)return{json:null};if(404===t.status)throw new Error("404 Not Found");return t.status>=200&&t.status<300?t.json().then((function(t){return{json:t}})):t.status>=400&&t.status<500?t.json().then((function(t){throw new Error(t.message)})):t.text().then((function(e){throw new Error("airbrake: fetch: unexpected response: code="+t.status+" body='"+e+"'")}))}))}function P(t){return function(e){return function(t,e){if(Date.now()/1e3<L)return r.a.reject(A.ipRateLimited);return new r.a((function(n,r){e({url:t.url,method:t.method,body:t.body,headers:{"content-type":"application/json"},timeout:t.timeout},(function(t,e,i){if(t)r(t);else{if(!e.statusCode)return t=new Error("airbrake: request: response statusCode is "+e.statusCode),void r(t);if(401!==e.statusCode)if(429!==e.statusCode)if(204!==e.statusCode)if(e.statusCode>=200&&e.statusCode<300){var o=void 0;try{o=JSON.parse(i)}catch(c){return void r(c)}n(o)}else{if(e.statusCode>=400&&e.statusCode<500){o=void 0;try{o=JSON.parse(i)}catch(c){return void r(c)}return t=new Error(o.message),void r(t)}i=i.trim(),t=new Error("airbrake: node: unexpected response: code="+e.statusCode+" body='"+i+"'"),r(t)}else n({json:null});else{r(A.ipRateLimited);var a=e.headers["x-ratelimit-delay"];if(!a)return;var s=void 0;if("string"===typeof a)s=a;else{if(!(a instanceof Array))return;s=a[0]}var u=parseInt(s,10);u>0&&(L=Date.now()/1e3+u)}else r(A.unauthorized)}}))}))}(e,t)}}var L=0;function N(t){return t.request?P(t.request):D}var R,I,z=(R=function(t,e){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}R(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),B=!1;try{I=n(495),B=!0}catch(M_){}var j=function(){function t(){this.count=0,this.sum=0,this.sumsq=0,this._td=new I.Digest}return t.prototype.add=function(t){0===t&&(t=1e-5),this.count+=1,this.sum+=t,this.sumsq+=t*t,this._td&&this._td.push(t)},t.prototype.toJSON=function(){return{count:this.count,sum:this.sum,sumsq:this.sumsq,tdigestCentroids:q(this._td)}},t}(),F=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.groups={},e}return z(e,t),e.prototype.addGroups=function(t,e){for(var n in this.add(t),e)e.hasOwnProperty(n)&&this.addGroup(n,e[n])},e.prototype.addGroup=function(t,e){var n=this.groups[t];n||(n=new j,this.groups[t]=n),n.add(e)},e.prototype.toJSON=function(){return{count:this.count,sum:this.sum,sumsq:this.sumsq,tdigestCentroids:q(this._td),groups:this.groups}},e}(j);function q(t){var e=[],n=[];return t.centroids.each((function(t){e.push(t.mean),n.push(t.n)})),{mean:e,count:n}}var $=function(){return($=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},V=function(){function t(t){void 0===t&&(t=""),this.method="",this.route="",this.query="",this.func="",this.file="",this.line=0,this.startTime=new Date,this.query=t}return t.prototype._duration=function(){return this.endTime||(this.endTime=new Date),this.endTime.getTime()-this.startTime.getTime()},t}(),U=function(){function t(t){this._m={},this._opt=t,this._url=t.host+"/api/v5/projects/"+t.projectId+"/queries-stats?key="+t.projectKey,this._requester=N(t)}return t.prototype.start=function(t){return void 0===t&&(t=""),new V(t)},t.prototype.notify=function(t){var e=this;if(B){var n=t._duration(),r=new Date(6e4*Math.floor(t.startTime.getTime()/6e4)),i={method:t.method,route:t.route,query:t.query,func:t.func,file:t.file,line:t.line,time:r},o=JSON.stringify(i),a=this._m[o];a||(a=new j,this._m[o]=a),a.add(n),this._timer||(this._timer=setTimeout((function(){e._flush()}),15e3))}},t.prototype._flush=function(){var t=[];for(var e in this._m)if(this._m.hasOwnProperty(e)){var n=JSON.parse(e),r=$($({},n),this._m[e].toJSON());t.push(r)}this._m={},this._timer=null;var i=JSON.stringify({environment:this._opt.environment,queries:t}),o={method:"POST",url:this._url,body:i};this._requester(o).then((function(t){})).catch((function(t){console.error&&console.error("can not report queries stats",t)}))},t}(),H=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),W=function(){return(W=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},Z=function(t){function e(e){var n=t.call(this)||this;return n.queue=e,n.startTime=new Date,n}return H(e,t),e}(h),J=function(){function t(t){this._m={},this._opt=t,this._url=t.host+"/api/v5/projects/"+t.projectId+"/queues-stats?key="+t.projectKey,this._requester=N(t)}return t.prototype.notify=function(t){var e=this;if(B){var n=t._duration();0===n&&(n=1e-5);var r=new Date(6e4*Math.floor(t.startTime.getTime()/6e4)),i={queue:t.queue,time:r},o=JSON.stringify(i),a=this._m[o];a||(a=new F,this._m[o]=a),a.addGroups(n,t._groups),this._timer||(this._timer=setTimeout((function(){e._flush()}),15e3))}},t.prototype._flush=function(){var t=[];for(var e in this._m)if(this._m.hasOwnProperty(e)){var n=JSON.parse(e),r=W(W({},n),this._m[e].toJSON());t.push(r)}this._m={},this._timer=null;var i=JSON.stringify({environment:this._opt.environment,queues:t}),o={method:"POST",url:this._url,body:i};this._requester(o).then((function(t){})).catch((function(t){console.error&&console.error("can not report queues breakdowns",t)}))},t}(),Y=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),K=function(){return(K=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},G=function(t){function e(e,n,r,i){void 0===e&&(e=""),void 0===n&&(n=""),void 0===r&&(r=0),void 0===i&&(i="");var o=t.call(this)||this;return o.method=e,o.route=n,o.statusCode=r,o.contentType=i,o.startTime=new Date,o}return Y(e,t),e}(h),X=function(){function t(t){this._m={},this._opt=t,this._url=t.host+"/api/v5/projects/"+t.projectId+"/routes-stats?key="+t.projectKey,this._requester=N(t)}return t.prototype.notify=function(t){var e=this;if(B){var n=t._duration(),r=new Date(6e4*Math.floor(t.startTime.getTime()/6e4)),i={method:t.method,route:t.route,statusCode:t.statusCode,time:r},o=JSON.stringify(i),a=this._m[o];a||(a=new j,this._m[o]=a),a.add(n),this._timer||(this._timer=setTimeout((function(){e._flush()}),15e3))}},t.prototype._flush=function(){var t=[];for(var e in this._m)if(this._m.hasOwnProperty(e)){var n=JSON.parse(e),r=K(K({},n),this._m[e].toJSON());t.push(r)}this._m={},this._timer=null;var i=JSON.stringify({environment:this._opt.environment,routes:t}),o={method:"POST",url:this._url,body:i};this._requester(o).then((function(t){})).catch((function(t){console.error&&console.error("can not report routes stats",t)}))},t}(),Q=function(){function t(t){this._m={},this._opt=t,this._url=t.host+"/api/v5/projects/"+t.projectId+"/routes-breakdowns?key="+t.projectKey,this._requester=N(t)}return t.prototype.notify=function(t){var e=this;if(B&&!(t.statusCode<200||t.statusCode>=300&&t.statusCode<400||404===t.statusCode||0===Object.keys(t._groups).length)){var n=t._duration();0===n&&(n=1e-5);var r=new Date(6e4*Math.floor(t.startTime.getTime()/6e4)),i={method:t.method,route:t.route,responseType:this._responseType(t),time:r},o=JSON.stringify(i),a=this._m[o];a||(a=new F,this._m[o]=a),a.addGroups(n,t._groups),this._timer||(this._timer=setTimeout((function(){e._flush()}),15e3))}},t.prototype._flush=function(){var t=[];for(var e in this._m)if(this._m.hasOwnProperty(e)){var n=JSON.parse(e),r=K(K({},n),this._m[e].toJSON());t.push(r)}this._m={},this._timer=null;var i=JSON.stringify({environment:this._opt.environment,routes:t}),o={method:"POST",url:this._url,body:i};this._requester(o).then((function(t){})).catch((function(t){console.error&&console.error("can not report routes breakdowns",t)}))},t.prototype._responseType=function(t){return t.statusCode>=500?"5xx":t.statusCode>=400?"4xx":t.contentType?t.contentType.split(";")[0].split("/")[-1]:""},t}();function tt(t){return(tt="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)}var et=function(){return(et=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},nt=function(){function t(t){var e,n,r=this;if(this._filters=[],this._performanceFilters=[],this._scope=new p,this._onClose=[],!t.projectId||!t.projectKey)throw new Error("airbrake: projectId and projectKey are required");this._opt=t,this._opt.host=this._opt.host||"https://api.airbrake.io",this._opt.timeout=this._opt.timeout||1e4,this._opt.keysBlocklist=this._opt.keysBlocklist||this._opt.keysBlacklist||[/password/,/secret/],this._url=this._opt.host+"/api/v3/projects/"+this._opt.projectId+"/notices?key="+this._opt.projectKey,this._processor=this._opt.processor||w,this._requester=N(this._opt),this.addFilter(S),this.addFilter((function(t){var r=JSON.stringify(t.errors);return r===e?null:(n&&clearTimeout(n),e=r,n=setTimeout((function(){e=""}),1e3),t)})),this.addFilter(M),this.addFilter(x),this.addFilter((function(t){return t.context.notifier={name:"airbrake-js/browser",version:"1.4.2",url:"https://github.com/airbrake/airbrake-js/tree/master/packages/browser"},r._opt.environment&&(t.context.environment=r._opt.environment),t})),this.routes=new rt(this),this.queues=new it(this),this.queries=new U(this._opt)}return t.prototype.close=function(){for(var t=0,e=this._onClose;t<e.length;t++){(0,e[t])()}},t.prototype.scope=function(){return this._scope},t.prototype.setActiveScope=function(t){this._scope=t},t.prototype.addFilter=function(t){this._filters.push(t)},t.prototype.addPerformanceFilter=function(t){this._performanceFilters.push(t)},t.prototype.notify=function(t){var e={errors:[],context:et(et({severity:"error"},this.scope().context()),t.context),params:t.params||{},environment:t.environment||{},session:t.session||{}};if("object"===tt(t)&&void 0!==t.error||(t={error:t}),!t.error)return e.error=new Error("airbrake: got err="+JSON.stringify(t.error)+", wanted an Error"),r.a.resolve(e);var n=this._processor(t.error);e.errors.push(n);for(var i=0,o=this._filters;i<o.length;i++){var a=(0,o[i])(e);if(null===a)return e.error=new Error("airbrake: error is filtered"),r.a.resolve(e);e=a}return e.context||(e.context={}),e.context.language="JavaScript",this._sendNotice(e)},t.prototype._sendNotice=function(t){var e=function(t,e){var n=void 0===e?{}:e,r=n.maxLength,i=void 0===r?64e3:r,o=n.keysBlocklist,u=void 0===o?[]:o;if(t.errors)for(var c=0;c<t.errors.length;c++){var l=new a({keysBlocklist:u});t.errors[c]=l.truncate(t.errors[c])}for(var h="",f=["context","params","environment","session"],d=0;d<8;d++){for(var p={level:d,keysBlocklist:u},v=0,m=f;v<m.length;v++)(_=t[w=m[v]])&&(t[w]=s(_,p));if((h=JSON.stringify(t)).length<i)return h}var g={json:h.slice(0,Math.floor(i/2))+"..."};f.push("errors");for(var y=0,b=f;y<b.length;y++){var w,_;(_=t[w=b[y]])&&(h=JSON.stringify(_),g[w]=h.length)}var x=new Error("airbrake: notice exceeds max length and can't be truncated");throw x.params=g,x}(t,{keysBlocklist:this._opt.keysBlocklist});if(this._opt.reporter){if("function"===typeof this._opt.reporter)return this._opt.reporter(t);console.warn("airbrake: options.reporter must be a function")}var n={method:"POST",url:this._url,body:e};return this._requester(n).then((function(e){return t.id=e.json.id,t.url=e.json.url,t})).catch((function(e){return t.error=e,t}))},t.prototype.wrap=function(t,e){if(void 0===e&&(e=[]),t._airbrake)return t;var n=this,r=function(){var e=Array.prototype.slice.call(arguments),r=n._wrapArguments(e);try{return t.apply(this,r)}catch(M_){throw n.notify({error:M_,params:{arguments:e}}),this._ignoreNextWindowError(),M_}};for(var i in t)t.hasOwnProperty(i)&&(r[i]=t[i]);for(var o=0,a=e;o<a.length;o++){i=a[o];t.hasOwnProperty(i)&&(r[i]=t[i])}return r._airbrake=!0,r.inner=t,r},t.prototype._wrapArguments=function(t){for(var e=0;e<t.length;e++){var n=t[e];"function"===typeof n&&(t[e]=this.wrap(n))}return t},t.prototype._ignoreNextWindowError=function(){},t.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=this.wrap(t);return r.apply(this,Array.prototype.slice.call(arguments,1))},t}(),rt=function(){function t(t){this._notifier=t,this._routes=new X(t._opt),this._breakdowns=new Q(t._opt)}return t.prototype.start=function(t,e,n,r){void 0===t&&(t=""),void 0===e&&(e=""),void 0===n&&(n=0),void 0===r&&(r="");var i=new G(t,e,n,r),o=this._notifier.scope().clone();return o.setContext({httpMethod:t,route:e}),o.setRouteMetric(i),this._notifier.setActiveScope(o),i},t.prototype.notify=function(t){t.end();for(var e=0,n=this._notifier._performanceFilters;e<n.length;e++){if(null===(0,n[e])(t))return}this._routes.notify(t),this._breakdowns.notify(t)},t}(),it=function(){function t(t){this._notifier=t,this._queues=new J(t._opt)}return t.prototype.start=function(t){var e=new Z(t),n=this._notifier.scope().clone();return n.setContext({queue:t}),n.setQueueMetric(e),this._notifier.setActiveScope(n),e},t.prototype.notify=function(t){t.end(),this._queues.notify(t)},t}();function ot(t){return window.navigator&&window.navigator.userAgent&&(t.context.userAgent=window.navigator.userAgent),window.location&&(t.context.url=String(window.location),t.context.rootDirectory=window.location.protocol+"//"+window.location.host),t}var at=["debug","log","info","warn","error"];function st(t){return(st="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)}var ut=["type","name","src"];function ct(t){var e=function(t){return function(e){var n=ht(e,"target");if(n){var r={type:e.type};try{r.target=function(t){var e=10,n=[],r=t;for(;r;){var i=lt(r);if(""!==i&&(n.push(i),n.length>e))break;r=r.parentNode}if(0===n.length)return String(t);return n.reverse().join(" > ")}(n)}catch(M_){r.target="<"+String(M_)+">"}t.scope().pushHistory(r)}}}(t);window.addEventListener&&(window.addEventListener("load",e),window.addEventListener("error",(function(t){ht(t,"error")||e(t)}),!0)),"object"===("undefined"===typeof document?"undefined":st(document))&&document.addEventListener&&(document.addEventListener("DOMContentLoaded",e),document.addEventListener("click",e),document.addEventListener("keypress",e))}function lt(t){if(!t)return"";var e=[];if(t.tagName&&e.push(t.tagName.toLowerCase()),t.id&&(e.push("#"),e.push(t.id)),t.classList&&Array.from)e.push("."),e.push(Array.from(t.classList).join("."));else if(t.className){var n=function(t){if(t.split)return t.split(" ").join(".");if(t.baseVal&&t.baseVal.split)return t.baseVal.split(" ").join(".");return console.error("unsupported HTMLElement.className type",st(t)),""}(t.className);""!==n&&(e.push("."),e.push(n))}if(t.getAttribute)for(var r=0,i=ut;r<i.length;r++){var o=i[r],a=t.getAttribute(o);a&&e.push("["+o+'="'+a+'"]')}return e.join("")}function ht(t,e){try{return t[e]}catch(n){return null}}var ft="";function dt(){return document.location&&document.location.pathname}function pt(t,e){var n=e.indexOf("://");n>=0?(n=(e=e.slice(n+3)).indexOf("/"),e=n>=0?e.slice(n):"/"):"/"!==e.charAt(0)&&(e="/"+e),t.scope().pushHistory({type:"location",from:ft,to:e}),ft=e}function vt(t){return(vt="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)}var mt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),gt=function(){return(gt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},yt=function(t){function e(e){var n=t.call(this,e)||this;return n.offline=!1,n.todo=[],n._ignoreWindowError=0,n._ignoreNextXHR=0,"undefined"===typeof window||(n.addFilter(ot),window.addEventListener&&(n.onOnline=n.onOnline.bind(n),window.addEventListener("online",n.onOnline),n.onOffline=n.onOffline.bind(n),window.addEventListener("offline",n.onOffline),n.onUnhandledrejection=n.onUnhandledrejection.bind(n),window.addEventListener("unhandledrejection",n.onUnhandledrejection),n._onClose.push((function(){window.removeEventListener("online",n.onOnline),window.removeEventListener("offline",n.onOffline),window.removeEventListener("unhandledrejection",n.onUnhandledrejection)}))),n._opt.ignoreWindowError&&(e.instrumentation.onerror=!1),n._instrument(e.instrumentation)),n}return mt(e,t),e.prototype._instrument=function(t){var e,n,r;if(void 0===t&&(t={}),void 0===t.console&&(t.console=!((e=this._opt.environment)&&e.startsWith&&e.startsWith("dev"))),bt(t.onerror)){var i=this,o=window.onerror;window.onerror=function(){o&&o.apply(this,arguments),i.onerror.apply(i,arguments)}}ct(this),bt(t.fetch)&&"function"===typeof fetch&&(n=this,r=window.fetch,window.fetch=function(t,e){var i={type:"xhr",date:new Date};return i.method=e&&e.method?e.method:"GET","string"===typeof t?i.url=t:(i.method=t.method,i.url=t.url),n._ignoreNextXHR++,setTimeout((function(){return n._ignoreNextXHR--})),r.apply(this,arguments).then((function(t){return i.statusCode=t.status,i.duration=(new Date).getTime()-i.date.getTime(),n.scope().pushHistory(i),t})).catch((function(t){throw i.error=t,i.duration=(new Date).getTime()-i.date.getTime(),n.scope().pushHistory(i),t}))}),bt(t.history)&&"object"===("undefined"===typeof history?"undefined":vt(history))&&function(t){ft=dt();var e=window.onpopstate;window.onpopstate=function(n){var r=dt();if(r&&pt(t,r),e)return e.apply(this,arguments)};var n=history.pushState;history.pushState=function(e,r,i){i&&pt(t,i.toString()),n.apply(this,arguments)}}(this),bt(t.console)&&"object"===("undefined"===typeof console?"undefined":vt(console))&&function(t){for(var e=function(e){if(!(e in console))return"continue";var n=console[e],r=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];n.apply(console,r),t.scope().pushHistory({type:"log",severity:e,arguments:r})};r.inner=n,console[e]=r},n=0,r=at;n<r.length;n++)e(r[n])}(this),bt(t.xhr)&&"undefined"!==typeof XMLHttpRequest&&function(t){function e(e){var n=e.__state;n.statusCode=e.status,n.duration=(new Date).getTime()-n.date.getTime(),t.scope().pushHistory(n)}var n=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(e,r,i,o,a){0===t._ignoreNextXHR&&(this.__state={type:"xhr",method:e,url:r}),n.apply(this,arguments)};var r=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(t){var n=this.onreadystatechange;return this.onreadystatechange=function(t){if(4===this.readyState&&this.__state&&e(this),n)return n.apply(this,arguments)},this.__state&&(this.__state.date=new Date),r.apply(this,arguments)}}(this)},e.prototype.notify=function(e){var n=this;return this.offline?new r.a((function(t,r){for(n.todo.push({err:e,resolve:t,reject:r});n.todo.length>100;){var i=n.todo.shift();if(void 0===i)break;i.resolve({error:new Error("airbrake: offline queue is too large")})}})):t.prototype.notify.call(this,e)},e.prototype.onOnline=function(){this.offline=!1;for(var t=function(t){e.notify(t.err).then((function(e){t.resolve(e)}))},e=this,n=0,r=this.todo;n<r.length;n++){t(r[n])}this.todo=[]},e.prototype.onOffline=function(){this.offline=!0},e.prototype.onUnhandledrejection=function(t){var e=t.reason||t.detail&&t.detail.reason;if(e){var n=e.message||String(e);n.indexOf&&0===n.indexOf("airbrake: ")||("object"===vt(e)&&void 0!==e.error?this.notify(gt(gt({},e),{context:{unhandledRejection:!0}})):this.notify({error:e,context:{unhandledRejection:!0}}))}},e.prototype.onerror=function(t,e,n,r,i){this._ignoreWindowError>0||(i?this.notify({error:i,context:{windowError:!0}}):e&&n&&this.notify({error:{message:t,fileName:e,lineNumber:n,columnNumber:r,noStack:!0},context:{windowError:!0}}))},e.prototype._ignoreNextWindowError=function(){var t=this;this._ignoreWindowError++,setTimeout((function(){return t._ignoreWindowError--}))},e}(nt);function bt(t){return void 0===t||!0===t}n(215);var wt,_t=n(56).a.start(),xt=n(499);function kt(t){var e=t.editorEl.querySelector('[data-target="storage-key"]');if(!e)throw new Error("No encuentro la llave para guardar los art\xedculos");return e.value}function St(t){window.localStorage.removeItem(t)}_t.load((wt=xt).keys().map((function(t){return function(t,e){var n=function(t){var e=(t.match(/^(?:\.\/)?(.+)(?:[_-]controller\..+?)$/)||[])[1];if(e)return e.replace(/_/g,"-").replace(/\//g,"--")}(e);if(n)return function(t,e){var n=t.default;if("function"==typeof n)return{identifier:e,controllerConstructor:n}}(t(e),n)}(wt,t)})).filter((function(t){return t})));var Ct=["paragraph","h1","h2","h3","h4","h5","h6","unordered_list","ordered_list","blockquote"],Mt=["bold","italic","deleted","underline","sub","super","mark","link","small"];function Et(t,e,n){for(;t.firstChild;)e.insertBefore(t.firstChild,n)}function Tt(t){var e=window.getSelection();return e&&t.contentEl.contains(e.anchorNode)&&t.contentEl.contains(e.focusNode)&&e.anchorNode!=t.contentEl&&e.focusNode!=t.contentEl?e:null}function At(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;try{return t.getRangeAt(e)}catch(n){return null}}function Ot(t,e){for(var n=0,r=Object.values(t.toolbar.auxiliary);n<r.length;n++){delete r[n].parentEl.dataset.editorAuxiliaryActive}e&&(e.dataset.editorAuxiliaryActive="active")}function Dt(t){var e=t.contentEl.querySelector("[data-editor-selected]");e&&delete e.dataset.editorSelected}function Pt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Lt,Nt={selector:"a",allowedChildren:[].concat((Lt=Mt.filter((function(t){return"link"!==t})),function(t){if(Array.isArray(t))return Pt(t)}(Lt)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(Lt)||function(t,e){if(t){if("string"===typeof t)return Pt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pt(t,e):void 0}}(Lt)||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.")}()),["text"]),handleEmpty:"remove",create:function(){return document.createElement("a")},onClick:function(t,e){if(!(e instanceof HTMLAnchorElement))throw new Error("oh no");!function(t,e){Dt(t),e.dataset.editorSelected="",t.toolbar.auxiliary.link.urlEl.value=e.href,Ot(t,t.toolbar.auxiliary.link.parentEl)}(t,e)}};function Rt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var It=function(t){return("0"+parseInt(t).toString(16)).slice(-2)};function zt(t){var e=t.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);if(!e)throw new Error("no pude parsear el rgb()");return"#"+It(e[1])+It(e[2])+It(e[3])}var Bt={selector:"mark",allowedChildren:[].concat(function(t){return function(t){if(Array.isArray(t))return Rt(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"===typeof t)return Rt(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 Rt(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.")}()}(Mt.filter((function(t){return"mark"!==t}))),["text"]),handleEmpty:"remove",create:function(){return document.createElement("mark")},onClick:function(t,e){if(!(e instanceof HTMLElement))throw new Error("oh no");!function(t,e){Dt(t),e.dataset.editorSelected="",t.toolbar.auxiliary.mark.colorEl.value=e.style.backgroundColor?zt(e.style.backgroundColor):"#f206f9",t.toolbar.auxiliary.mark.textColorEl.value=e.style.color?zt(e.style.color):"#000000",Ot(t,t.toolbar.auxiliary.mark.parentEl)}(t,e)}};function jt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=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(M_){i=!0,o=M_}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||qt(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 Ft(t){return function(t){if(Array.isArray(t))return $t(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||qt(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 qt(t,e){if(t){if("string"===typeof t)return $t(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$t(t,e):void 0}}function $t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Vt(t,e){return{selector:e,allowedChildren:[].concat(Ft(Mt.filter((function(e){return e!==t}))),["text"]),handleEmpty:"remove",create:function(){return document.createElement(e)}}}var Ut={bold:Vt("bold","strong"),italic:Vt("italic","em"),deleted:Vt("deleted","del"),underline:Vt("underline","u"),sub:Vt("sub","sub"),super:Vt("super","sup"),mark:Bt,link:Nt,small:Vt("small","small")};function Ht(t,e,n){for(var r=[],i=0,o=Ft(t.children);i<o.length;i++){var a=o[i];a.matches(n)&&e.containsNode(a)&&r.push(a),r=[].concat(Ft(r),Ft(Ht(a,e,n)))}return r}function Wt(t){for(var e=function(){var e=r[n],o=(i=jt(e,2))[0],a=i[1],s=t.toolbarEl.querySelector('[data-editor-button="mark-'.concat(o,'"]'));if(!s)return"continue";s.addEventListener("click",(function(e){e.preventDefault();var n=Tt(t);if(n){var r=At(n);if(r){for(var i=r.commonAncestorContainer;!(i instanceof Element);){if(!i.parentElement)return;i=i.parentElement}var o=Ht(i,n,a.selector);if(console.debug("marks encontradas:",o),o.length>0){var s=o[0];if(!s.parentElement)throw new Error(":/");Et(s,s.parentElement,s),s.parentElement.removeChild(s)}else{if(r.commonAncestorContainer===t.contentEl)return console.error("No puedo marcar cosas a trav\xe9s de distintos bloques!");var u=a.create(t);a.onClick&&a.onClick(t,u),u.appendChild(r.extractContents()),r.insertNode(u),r.selectNode(u)}return!1}}}))},n=0,r=Object.entries(Ut);n<r.length;n++){var i;e()}}function Zt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=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(M_){i=!0,o=M_}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||Xt(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 Jt(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 Yt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Jt(Object(n),!0).forEach((function(e){Kt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Jt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Kt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Gt(t){return function(t){if(Array.isArray(t))return Qt(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||Xt(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 Xt(t,e){if(t){if("string"===typeof t)return Qt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qt(t,e):void 0}}function Qt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function te(t){return{selector:t,allowedChildren:[].concat(Gt(Mt),["text"]),handleEmpty:"do-nothing",create:function(){return document.createElement(t)}}}var ee=te("li"),ne=te("p"),re={paragraph:ne,h1:te("h1"),h2:te("h2"),h3:te("h3"),h4:te("h4"),h5:te("h5"),h6:te("h6"),unordered_list:Yt(Yt({},te("ul")),{},{allowedChildren:["li"],handleEmpty:ee}),ordered_list:Yt(Yt({},te("ol")),{},{allowedChildren:["li"],handleEmpty:ee}),blockquote:Yt(Yt({},te("blockquote")),{},{allowedChildren:Ct,handleEmpty:ne})};function ie(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=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(M_){i=!0,o=M_}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||ae(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 oe(t){return function(t){if(Array.isArray(t))return se(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||ae(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 ae(t,e){if(t){if("string"===typeof t)return se(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?se(t,e):void 0}}function se(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ue(t,e){return{selector:t,allowedChildren:[].concat(oe(Ct),["multimedia"]),handleEmpty:"remove",create:e}}var ce={left:ue("div[data-align=left]",(function(){var t=document.createElement("div");return t.dataset.align="left",t.style.textAlign="left",t})),center:ue("div[data-align=center]",(function(){var t=document.createElement("div");return t.dataset.align="center",t.style.textAlign="center",t})),right:ue("div[data-align=right]",(function(){var t=document.createElement("div");return t.dataset.align="right",t.style.textAlign="right",t}))};var le=n(114);function he(t,e){switch(t.tagName){case"VIDEO":case"AUDIO":t.setAttribute("aria-label",e);break;case"IMG":t.alt=e;break;case"IFRAME":t.title=e;break;default:throw new Error("no pude setear el alt")}}function fe(t,e){Dt(t),e.dataset.editorSelected="";var n=e.querySelector("[data-multimedia-inner]");if(!n)throw new Error("No hay multimedia v\xe1lida");"P"===n.tagName?(t.toolbar.auxiliary.multimedia.altEl.value="",t.toolbar.auxiliary.multimedia.altEl.disabled=!0):(t.toolbar.auxiliary.multimedia.altEl.value=function(t){switch(t.tagName){case"VIDEO":case"AUDIO":return t.getAttribute("aria-label");case"IMG":return t.alt;case"IFRAME":return t.title;default:throw new Error("no pude conseguir el alt")}}(n)||"",t.toolbar.auxiliary.multimedia.altEl.disabled=!1),Ot(t,t.toolbar.auxiliary.multimedia.parentEl)}var de={selector:"figure[data-multimedia]",allowedChildren:"ignore-children",handleEmpty:"remove",create:function(){var t=document.createElement("figure");t.dataset.multimedia="",t.contentEditable="false";var e=document.createElement("p");e.dataset.multimediaInner="",e.append("\xa1Clickeame para subir un archivo!"),t.appendChild(e);var n=document.createElement("figcaption");return n.contentEditable="true",n.append("Escrib\xed ac\xe1 la descripci\xf3n del archivo."),t.appendChild(n),t},onClick:function(t,e){if(!(e instanceof HTMLElement))throw new Error("oh no");fe(t,e)}};function pe(t){t.toolbar.auxiliary.multimedia.uploadEl.addEventListener("click",(function(e){var n=t.toolbar.auxiliary.multimedia.fileEl.files;if(n&&n.length){var r=n[0],i=t.contentEl.querySelector("figure[data-editor-selected]");if(!i)throw new Error("No pude encontrar el elemento para setear el archivo");i.dataset.editorLoading="",function(t){return new Promise((function(e,n){new le.DirectUpload(t,origin+"/rails/active_storage/direct_uploads").create((function(t,r){if(t)n(t);else{var i="".concat(origin,"/rails/active_storage/blobs/").concat(r.signed_id,"/").concat(r.filename);e(i)}}))}))}(r).then((function(e){var n=i.querySelector("[data-multimedia-inner]");if(!n)throw new Error("No hay multimedia a reemplazar");var o=function(t,e){if(e.match(/^image\/.+$/)){var n=document.createElement("img");return n.dataset.multimediaInner="",n.src=t,n}if(e.match(/^video\/.+$/)){var r=document.createElement("video");return r.controls=!0,r.dataset.multimediaInner="",r.src=t,r}if(e.match(/^audio\/.+$/)){var i=document.createElement("audio");return i.controls=!0,i.dataset.multimediaInner="",i.src=t,i}if(e.match(/^application\/pdf$/)){var o=document.createElement("iframe");return o.dataset.multimediaInner="",o.src=t,o}throw new Error("Tipo de archivo no reconocido")}(e,r.type);he(o,t.toolbar.auxiliary.multimedia.altEl.value),i.replaceChild(o,n),fe(t,i),delete i.dataset.editorError})).catch((function(t){console.error(t),i.dataset.editorError=""})).finally((function(){delete i.dataset.editorLoading}))}else console.info("no hay archivos para subir")})),t.toolbar.auxiliary.multimedia.removeEl.addEventListener("click",(function(e){var n,r=t.contentEl.querySelector("figure[data-editor-selected]");if(!r)throw new Error("No pude encontrar el elemento para borrar");null===(n=r.parentElement)||void 0===n||n.removeChild(r),Ot(t,null)})),t.toolbar.auxiliary.multimedia.altEl.addEventListener("input",(function(e){var n=t.contentEl.querySelector("figure[data-editor-selected]");if(!n)throw new Error("No pude encontrar el multimedia para setear el alt");var r=n.querySelector("[data-multimedia-inner]");if(!r)throw new Error("No hay multimedia a para setear el alt");he(r,t.toolbar.auxiliary.multimedia.altEl.value)})),t.toolbar.auxiliary.multimedia.altEl.addEventListener("keydown",(function(t){13==t.keyCode&&t.preventDefault()}))}function ve(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=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(M_){i=!0,o=M_}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||ge(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 me(t){return function(t){if(Array.isArray(t))return ye(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||ge(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 ge(t,e){if(t){if("string"===typeof t)return ye(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ye(t,e):void 0}}function ye(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function be(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 we(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?be(Object(n),!0).forEach((function(e){_e(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):be(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function _e(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var xe=we(we(we(we({},Ut),re),{},{li:ee},ce),{},{contentEl:{selector:".editor-content",allowedChildren:[].concat(me(Ct),me(["left","center","right"]),["multimedia"]),handleEmpty:re.paragraph,create:function(){throw new Error("se intent\xf3 crear contentEl")}},br:{selector:"br",allowedChildren:[],handleEmpty:"do-nothing",create:function(){throw new Error("se intent\xf3 crear br")}},multimedia:de});function ke(t){for(var e=0,n=Object.entries(xe);e<n.length;e++){var r=ve(n[e],2),i=r[0],o=r[1];if(t.matches(o.selector))return{typeName:i,type:o}}return null}function Se(t){var e=Tt(t.editor);if(!e)throw new Error("No se donde insertar esto");if(!At(e))throw new Error("No se donde insertar esto");var n=[];if(!e.anchorNode)throw new Error("No se donde insertar esto");if(e.anchorNode instanceof Element)n=[e.anchorNode];else{if(!e.anchorNode.parentElement)throw new Error("No se donde insertar esto");n=[e.anchorNode.parentElement]}for(;;){var r=n[0];if(!t.editor.contentEl.contains(r)&&r!=t.editor.contentEl)throw new Error("No se donde insertar esto");var i=ke(r);if(i&&i.type.allowedChildren instanceof Array&&i.type.allowedChildren.includes(t.type))break;if(!r.parentElement)throw new Error("No se donde insertar esto");n=[r.parentElement].concat(me(n))}return n}function Ce(t,e){if("ignore-children"===e.allowedChildren)throw new Error("se llam\xf3 a getValidChildren con un type que no lo permite!");return me(t.childNodes).filter((function(t){var n;if(t.nodeType===Node.TEXT_NODE)return e.allowedChildren.includes("text")&&(null===(n=t.textContent)||void 0===n?void 0:n.length);if(!(t instanceof Element))return!1;var r=ke(t);return!!r&&e.allowedChildren.includes(r.typeName)}))}function Me(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=Te(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Ee(t){return function(t){if(Array.isArray(t))return Ae(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||Te(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 Te(t,e){if(t){if("string"===typeof t)return Ae(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ae(t,e):void 0}}function Ae(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Oe(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.contentEl;if("SCRIPT"!==e.tagName&&"STYLE"!==e.tagName){if("I"===e.tagName){var n,r=document.createElement("em");Et(e,r,null),null===(n=e.parentElement)||void 0===n||n.replaceChild(r,e),e=r}if("B"===e.tagName){var i,o=document.createElement("strong");Et(e,o,null),null===(i=e.parentElement)||void 0===i||i.replaceChild(o,e),e=o}if(e instanceof HTMLImageElement){e.dataset.multimediaInner="";var a=xe.multimedia.create(t),s=e.parentElement;if(!s)throw new Error("No encontr\xe9 lx objetivo");for(;;){var u=ke(s);if(!u)throw new Error("lx objetivo tiene tipo");if(u.type.allowedChildren.includes("multimedia"))break;if(!s.parentElement)throw new Error("No encontr\xe9 lx objetivo");s=s.parentElement}var c=Ee(s.childNodes).find((function(t){return t.contains(e)}));if(!c)throw new Error("no encontr\xe9 lx pariente");s.insertBefore(a,c);var l=a.querySelector("[data-multimedia-inner]");if(!l)throw new Error("Raro.");a.replaceChild(e,l),e=a}var h=ke(e);if(h){h.typeName;var f=h.type;if("ignore-children"!==f.allowedChildren){var d=Tt(t),p=d&&At(d);if(0==Ce(e,f).length&&"string"!==typeof f.handleEmpty){var v=f.handleEmpty.create(t);Et(e,v,null),e.appendChild(v),null!==p&&void 0!==p&&p.intersectsNode(e)&&(null===d||void 0===d||d.collapse(v))}var m,g=Me(e.childNodes);try{for(g.s();!(m=g.n()).done;){var y=m.value;y instanceof Element&&Oe(t,y)}}catch(M_){g.e(M_)}finally{g.f()}}}}else{var b;null===(b=e.parentElement)||void 0===b||b.removeChild(e)}}function De(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.contentEl,n=ke(e);if(n){var r=n.type;if("ignore-children"!==r.allowedChildren){var i,o=Me(e.childNodes);try{for(o.s();!(i=o.n()).done;){var a=i.value;if(a.nodeType!==Node.TEXT_NODE||r.allowedChildren.includes("text")){if(a instanceof Element){var s=ke(a);if("br"!==(null===s||void 0===s?void 0:s.typeName)){if(!s||!r.allowedChildren.includes(s.typeName))return Et(a,e,a),void e.removeChild(a);De(t,a)}}}else e.removeChild(a)}}catch(M_){o.e(M_)}finally{o.f()}var u,c=Ce(e,r).length,l=Tt(t);l&&At(l);if("remove"===r.handleEmpty&&0==c)return void(null===(u=e.parentNode)||void 0===u||u.removeChild(e))}}else{var h;null===(h=e.parentElement)||void 0===h||h.removeChild(e)}}function Pe(t){try{Oe(t),De(t),function(t){0!==t.contentEl.innerText.trim().length&&window.localStorage.setItem(kt(t),t.contentEl.innerHTML)}(t),t.htmlEl.value=t.contentEl.innerHTML}catch(e){console.error("Hubo un problema corriendo la rutina",t,e)}}function Le(t,e){var n=t.querySelector(e);if(!n)throw new Error("No pude encontrar un componente `".concat(e,"`"));return n}function Ne(t){document.execCommand("defaultParagraphSeparator",!1,"p");var e={editorEl:t,toolbarEl:Le(t,".editor-toolbar"),toolbar:{auxiliary:{mark:{parentEl:Le(t,"[data-editor-auxiliary=mark]"),colorEl:Le(t,"[data-editor-auxiliary=mark] [name=mark-color]"),textColorEl:Le(t,"[data-editor-auxiliary=mark] [name=mark-text-color]")},multimedia:{parentEl:Le(t,"[data-editor-auxiliary=multimedia]"),fileEl:Le(t,"[data-editor-auxiliary=multimedia] [name=multimedia-file]"),uploadEl:Le(t,"[data-editor-auxiliary=multimedia] [name=multimedia-file-upload]"),altEl:Le(t,"[data-editor-auxiliary=multimedia] [name=multimedia-alt]"),removeEl:Le(t,"[data-editor-auxiliary=multimedia] [name=multimedia-remove]")},link:{parentEl:Le(t,"[data-editor-auxiliary=link]"),urlEl:Le(t,"[data-editor-auxiliary=link] [name=link-url]")}}},contentEl:Le(t,".editor-content"),wordAlertEl:Le(t,".editor-aviso-word"),htmlEl:Le(t,"textarea")};console.debug("iniciando editor",e),function(t){var e=window.localStorage.getItem(kt(t));e&&0!==e.trim().length&&(t.contentEl.innerHTML=e)}(e),e.contentEl.addEventListener("paste",(function(){e.wordAlertEl.style.display="block"})),new MutationObserver((function(){return Pe(e)})).observe(e.contentEl,{childList:!0,attributes:!0,subtree:!0,characterData:!0}),document.addEventListener("selectionchange",(function(){return Pe(e)})),e.contentEl.addEventListener("click",(function(t){var n=t.target,r=ke(n);return r&&r.type.onClick?(r.type.onClick(e,n),!1):(Ot(e,null),Dt(e),!0)}),!0);var n=e.contentEl.querySelector("[data-editor-selected]");n&&delete n.dataset.editorSelected,Wt(e),function(t){for(var e=function(){var e=r[n],o=(i=Zt(e,2))[0],a=i[1],s=t.toolbarEl.querySelector('[data-editor-button="block-'.concat(o,'"]'));if(!s)return"continue";s.addEventListener("click",(function(e){var n;e.preventDefault();var r=Se({editor:t,type:o});if(-1!==Ct.indexOf(ke(r[1]).typeName)){var i=r[1].matches(a.selector)?re.paragraph:a,s=i.create(t);return i.onClick&&i.onClick(t,s),Et(r[1],s,null),r[0].replaceChild(s,r[1]),null===(n=window.getSelection())||void 0===n||n.collapse(s),!1}}))},n=0,r=Object.entries(re);n<r.length;n++){var i;e()}}(e),function(t){for(var e=function(){var e=r[n],o=(i=ie(e,2))[0],a=i[1],s=t.toolbarEl.querySelector('[data-editor-button="parentBlock-'.concat(o,'"]'));if(!s)return"continue";s.addEventListener("click",(function(e){var n;e.preventDefault();var r=Se({editor:t,type:o}),i=a.create(t);return r[0]==t.contentEl?(t.contentEl.insertBefore(i,r[1]),i.appendChild(r[1])):(Et(r[0],i,null),t.contentEl.replaceChild(i,r[0])),null===(n=window.getSelection())||void 0===n||n.collapse(i),!1}))},n=0,r=Object.entries(ce);n<r.length;n++){var i;e()}}(e),function(t){var e=t.toolbarEl.querySelector('[data-editor-button="multimedia"]');if(!e)throw new Error("No encontre el bot\xf3n de multimedia");e.addEventListener("click",(function(e){e.preventDefault();var n=Se({editor:t,type:"multimedia"}),r=de.create(t);return n[0].insertBefore(r,n[1].nextElementSibling),fe(t,r),!1}))}(e),function(t){t.toolbar.auxiliary.link.urlEl.addEventListener("input",(function(e){var n=t.toolbar.auxiliary.link.urlEl.value,r=t.contentEl.querySelector("a[data-editor-selected]");if(!r)throw new Error("No pude encontrar el link para setear el enlace");r.href=n})),t.toolbar.auxiliary.link.urlEl.addEventListener("keydown",(function(t){13==t.keyCode&&t.preventDefault()}))}(e),pe(e),function(t){t.toolbar.auxiliary.mark.colorEl.addEventListener("input",(function(e){var n=t.toolbar.auxiliary.mark.colorEl.value,r=t.contentEl.querySelector("mark[data-editor-selected]");if(!r)throw new Error("No pude encontrar el mark para setear el color");r.style.backgroundColor=n})),t.toolbar.auxiliary.mark.textColorEl.addEventListener("input",(function(e){var n=t.toolbar.auxiliary.mark.textColorEl.value,r=t.contentEl.querySelector("mark[data-editor-selected]");if(!r)throw new Error("No pude encontrar el mark para setear el color del text");r.style.color=n})),t.toolbar.auxiliary.mark.colorEl.addEventListener("keydown",(function(t){13==t.keyCode&&t.preventDefault()}))}(e),Pe(e)}document.addEventListener("turbolinks:load",(function(){var t=document.querySelector(".js-flash");if(t){var e=JSON.parse(t.dataset.keys||"[]");switch(t.dataset.target){case"editor":switch(t.dataset.action){case"forget-content":e.forEach(St)}}}var n,r=Me(document.querySelectorAll(".editor[data-editor]"));try{for(r.s();!(n=r.n()).done;){var i=n.value;try{Ne(i)}catch(o){console.error("no se pudo iniciar el editor, error completo",o)}}}catch(M_){r.e(M_)}finally{r.f()}}));var Re;n(503),n(504),n(505),n(506);function Ie(t,e){return(Ie=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ze(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Fe(t);if(e){var i=Fe(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Be(this,n)}}function Be(t,e){return!e||"object"!==He(e)&&"function"!==typeof e?je(t):e}function je(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Fe(t){return(Fe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function qe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ve(t){return function(t){if(Array.isArray(t))return Ue(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"===typeof t)return Ue(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 Ue(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 Ue(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function He(t){return(He="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function We(){}function Ze(t){return t()}function Je(){return Object.create(null)}function Ye(t){t.forEach(Ze)}function Ke(t){return"function"==typeof t}function Ge(t,e){return t!=t?e==e:t!==e||t&&"object"==He(t)||"function"==typeof t}function Xe(t,e){t.appendChild(e)}function Qe(t,e,n){t.insertBefore(e,n||null)}function tn(t){t.parentNode.removeChild(t)}function en(t){return document.createElement(t)}function nn(t){return document.createTextNode(t)}function rn(){return nn(" ")}function on(t,e,n,r){return t.addEventListener(e,n,r),function(){return t.removeEventListener(e,n,r)}}function an(t,e,n){null==n?t.removeAttribute(e):t.setAttribute(e,n)}function sn(t,e){e=""+e,t.data!==e&&(t.data=e)}function un(t){Re=t}var cn=[],ln=[],hn=[],fn=[],dn=Promise.resolve(),pn=!1;function vn(t){hn.push(t)}function mn(){var t=new Set;do{for(;cn.length;){var e=cn.shift();un(e),gn(e.$$)}for(;ln.length;)ln.pop()();for(var n=0;n<hn.length;n+=1){var r=hn[n];t.has(r)||(r(),t.add(r))}hn.length=0}while(cn.length);for(;fn.length;)fn.pop()();pn=!1}function gn(t){t.fragment&&(t.update(t.dirty),Ye(t.before_update),t.fragment.p(t.dirty,t.ctx),t.dirty=null,t.after_update.forEach(vn))}var yn=new Set;function bn(t,e,n,r,i,o){var a=Re;un(t);var s,u,c=e.props||{},l=t.$$={fragment:null,ctx:null,props:o,update:We,not_equal:i,bound:Je(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(a?a.$$.context:[]),callbacks:Je(),dirty:null},h=!1;l.ctx=n?n(t,c,(function(e,n){l.ctx&&i(l.ctx[e],l.ctx[e]=n)&&(l.bound[e]&&l.bound[e](n),h&&function(t,e){t.$$.dirty||(cn.push(t),pn||(pn=!0,dn.then(mn)),t.$$.dirty=Je()),t.$$.dirty[e]=!0}(t,e))})):c,l.update(),h=!0,Ye(l.before_update),l.fragment=r(l.ctx),e.target&&(e.hydrate?l.fragment.l((u=e.target,Array.from(u.childNodes))):l.fragment.c(),e.intro&&(s=t.$$.fragment)&&s.i&&(yn.delete(s),s.i(undefined)),function(t,e,n){var r=t.$$,i=r.fragment,o=r.on_mount,a=r.on_destroy,s=r.after_update;i.m(e,n),vn((function(){var e=o.map(Ze).filter(Ke);a?a.push.apply(a,Ve(e)):Ye(e),t.$$.on_mount=[]})),s.forEach(vn)}(t,e.target,e.anchor),mn()),un(a)}function wn(t,e,n){var r=Object.create(t);return r.value=e[n],r}function _n(t){var e,n,r,i,o,a,s,u=t.value+"";return{c:function(){e=en("label"),n=en("input"),i=rn(),o=nn(u),a=rn(),an(n,"type","checkbox"),n.checked="checked",an(n,"aria-describedby",t.described),n.value=r=t.value,an(n,"name",t.name),s=on(n,"change",t.removeValue)},m:function(t,r){Qe(t,e,r),Xe(e,n),Xe(e,i),Xe(e,o),Xe(e,a)},p:function(t,e){t.described&&an(n,"aria-describedby",e.described),t.group&&r!==(r=e.value)&&(n.value=r),t.name&&an(n,"name",e.name),t.group&&u!==(u=e.value+"")&&sn(o,u)},d:function(t){t&&tn(e),s()}}}function xn(t){for(var e,n,r,i,o,a,s,u,c,l,h=t.group,f=[],d=0;d<h.length;d+=1)f[d]=_n(wn(t,h,d));return{c:function(){e=en("div"),n=en("input"),r=rn(),i=en("input"),o=rn(),a=en("fieldset"),s=en("legend"),u=nn(t.legend),c=rn();for(var h=0;h<f.length;h+=1)f[h].c();an(n,"type","text"),an(n,"aria-describedby",t.described),an(n,"list",t.list),an(i,"type","button"),i.value=t.button,an(e,"class","input-tag"),l=[on(n,"input",t.input0_input_handler),on(n,"keypress",t.addValue),on(i,"click",t.addValue)]},m:function(l,h){Qe(l,e,h),Xe(e,n),n.value=t.added_value,Xe(e,r),Xe(e,i),Xe(e,o),Xe(e,a),Xe(a,s),Xe(s,u),Xe(a,c);for(var d=0;d<f.length;d+=1)f[d].m(a,null)},p:function(t,e){if(t.added_value&&n.value!==e.added_value&&(n.value=e.added_value),t.described&&an(n,"aria-describedby",e.described),t.list&&an(n,"list",e.list),t.button&&(i.value=e.button),t.legend&&sn(u,e.legend),t.group||t.described||t.name){h=e.group;for(var r=0;r<h.length;r+=1){var o=wn(e,h,r);f[r]?f[r].p(t,o):(f[r]=_n(o),f[r].c(),f[r].m(a,null))}for(;r<f.length;r+=1)f[r].d(1);f.length=h.length}},i:We,o:We,d:function(t){t&&tn(e),function(t,e){for(var n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(f,t),Ye(l)}}}function kn(t,e,n){var r=e.values,i=void 0===r?"[]":r,o=e.button,a=void 0===o?"Agregar":o,s=e.legend,u=void 0===s?"":s,c=e.described,l=void 0===c?"":c,h=e.name,f=e.list,d=e.remove,p=void 0===d||d,v=JSON.parse(i),m="";return t.$set=function(t){"values"in t&&n("values",i=t.values),"button"in t&&n("button",a=t.button),"legend"in t&&n("legend",u=t.legend),"described"in t&&n("described",l=t.described),"name"in t&&n("name",h=t.name),"list"in t&&n("list",f=t.list),"remove"in t&&n("remove",p=t.remove)},{values:i,button:a,legend:u,described:l,name:h,list:f,remove:p,group:v,added_value:m,addValue:function(t){null!=t.keyCode&&13!=t.keyCode||(t.preventDefault(),t.stopPropagation(),0!=m.length&&(v.includes(m)||(n("group",v=[].concat(Ve(v),[m.trim()])),n("added_value",m=""))))},removeValue:function(t){[!1,"false"].includes(p)||(t.target.checked="checked",n("group",v=v.filter((function(e){return e!==t.target.value}))))},input0_input_handler:function(){m=this.value,n("added_value",m)}}}var Sn,Cn=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&&Ie(t,e)}(n,t);var e=ze(n);function n(t){var r;return qe(this,n),bn(je(r=e.call(this)),t,kn,xn,Ge,["values","button","legend","described","name","list","remove"]),r}return n}(function(){function t(){qe(this,t)}var e,n,r;return e=t,(n=[{key:"$destroy",value:function(){var t;(t=this).$$.fragment&&(Ye(t.$$.on_destroy),t.$$.fragment.d(1),t.$$.on_destroy=t.$$.fragment=null,t.$$.ctx={}),this.$destroy=We}},{key:"$on",value:function(t,e){var n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}}},{key:"$set",value:function(){}}])&&$e(e.prototype,n),r&&$e(e,r),t}());function Mn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function En(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Tn(t,e){return(Tn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function An(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Pn(t);if(e){var i=Pn(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return On(this,n)}}function On(t,e){return!e||"object"!==zn(e)&&"function"!==typeof e?Dn(t):e}function Dn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Pn(t){return(Pn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Ln(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=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(M_){i=!0,o=M_}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||Rn(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 Nn(t){return function(t){if(Array.isArray(t))return In(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||Rn(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 Rn(t,e){if(t){if("string"===typeof t)return In(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?In(t,e):void 0}}function In(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function zn(t){return(zn="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Bn(){}function jn(t){return t()}function Fn(){return Object.create(null)}function qn(t){t.forEach(jn)}function $n(t){return"function"==typeof t}function Vn(t,e){return t!=t?e==e:t!==e||t&&"object"==zn(t)||"function"==typeof t}function Un(t,e){t.appendChild(e)}function Hn(t,e,n){t.insertBefore(e,n||null)}function Wn(t){t.parentNode.removeChild(t)}function Zn(t){return document.createElement(t)}function Jn(t){return document.createTextNode(t)}function Yn(){return Jn(" ")}function Kn(t,e,n,r){return t.addEventListener(e,n,r),function(){return t.removeEventListener(e,n,r)}}function Gn(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Xn(t,e){e=""+e,t.data!==e&&(t.data=e)}function Qn(t,e){(null!=e||t.value)&&(t.value=e)}function tr(t){Sn=t}var er=[],nr=[],rr=[],ir=[],or=Promise.resolve(),ar=!1;function sr(t){rr.push(t)}var ur=new Set;function cr(){do{for(;er.length;){var t=er.shift();tr(t),lr(t.$$)}for(;nr.length;)nr.pop()();for(var e=0;e<rr.length;e+=1){var n=rr[e];ur.has(n)||(ur.add(n),n())}rr.length=0}while(er.length);for(;ir.length;)ir.pop()();ar=!1,ur.clear()}function lr(t){if(null!==t.fragment){t.update(),qn(t.before_update);var e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(sr)}}var hr=new Set;function fr(t,e){-1===t.$$.dirty[0]&&(er.push(t),ar||(ar=!0,or.then(cr)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function dr(t,e,n){var r=t.slice();return r[15]=e[n],r}function pr(t){var e,n,r,i,o,a,s,u=t[6][t[15]]+"";return{c:function(){e=Zn("label"),n=Zn("input"),i=Yn(),o=Jn(u),a=Yn(),Gn(n,"type","checkbox"),n.checked="checked",Gn(n,"aria-describedby",t[2]),n.value=r=t[15],Gn(n,"name",t[3])},m:function(r,u){Hn(r,e,u),Un(e,n),Un(e,i),Un(e,o),Un(e,a),s=Kn(n,"change",t[9])},p:function(t,e){4&e&&Gn(n,"aria-describedby",t[2]),32&e&&r!==(r=t[15])&&(n.value=r),8&e&&Gn(n,"name",t[3]),96&e&&u!==(u=t[6][t[15]]+"")&&Xn(o,u)},d:function(t){t&&Wn(e),s()}}}function vr(t){for(var e,n,r,i,o,a,s,u,c,l,h=t[5],f=[],d=0;d<h.length;d+=1)f[d]=pr(dr(t,h,d));return{c:function(){e=Zn("div"),n=Zn("input"),r=Yn(),i=Zn("input"),o=Yn(),a=Zn("fieldset"),s=Zn("legend"),u=Jn(t[1]),c=Yn();for(var l=0;l<f.length;l+=1)f[l].c();Gn(n,"type","text"),Gn(n,"aria-describedby",t[2]),Gn(n,"list",t[4]),Gn(i,"type","button"),i.value=t[0],Gn(e,"class","input-map")},m:function(h,d){Hn(h,e,d),Un(e,n),Qn(n,t[7]),Un(e,r),Un(e,i),Un(e,o),Un(e,a),Un(a,s),Un(s,u),Un(a,c);for(var p=0;p<f.length;p+=1)f[p].m(a,null);l=[Kn(n,"keypress",t[8]),Kn(n,"input",t[14]),Kn(i,"click",t[8])]},p:function(t,e){var r=Ln(e,1)[0];if(4&r&&Gn(n,"aria-describedby",t[2]),16&r&&Gn(n,"list",t[4]),128&r&&n.value!==t[7]&&Qn(n,t[7]),1&r&&(i.value=t[0]),2&r&&Xn(u,t[1]),620&r){var o;for(h=t[5],o=0;o<h.length;o+=1){var s=dr(t,h,o);f[o]?f[o].p(s,r):(f[o]=pr(s),f[o].c(),f[o].m(a,null))}for(;o<f.length;o+=1)f[o].d(1);f.length=h.length}},i:Bn,o:Bn,d:function(t){t&&Wn(e),function(t,e){for(var n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(f,t),qn(l)}}}function mr(t,e,n){var r=e.values,i=void 0===r?"[]":r,o=e.defaultValues,a=void 0===o?"{}":o,s=e.button,u=void 0===s?"Agregar":s,c=e.legend,l=void 0===c?"":c,h=e.described,f=void 0===h?"":h,d=e.name,p=e.list,v=e.remove,m=void 0===v||v,g=JSON.parse(a),y=JSON.parse(i),b={},w="";return y.forEach((function(t){return n(6,b[t]=Object.keys(g).find((function(e){return g[e]==t})),b)})),t.$set=function(t){"values"in t&&n(10,i=t.values),"defaultValues"in t&&n(11,a=t.defaultValues),"button"in t&&n(0,u=t.button),"legend"in t&&n(1,l=t.legend),"described"in t&&n(2,f=t.described),"name"in t&&n(3,d=t.name),"list"in t&&n(4,p=t.list),"remove"in t&&n(12,m=t.remove)},[u,l,f,d,p,y,b,w,function(t){null!=t.keyCode&&13!=t.keyCode||(t.preventDefault(),t.stopPropagation(),0!=w.length&&g[w]&&(b[g[w]]||(y.push(g[w]),n(6,b[g[w]]=w,b),n(7,w=""))))},function(t){[!1,"false"].includes(m)||(t.target.checked="checked",n(5,y=y.filter((function(e){return e!==t.target.value}))),delete b[t.target.value])},i,a,m,g,function(){w=this.value,n(7,w)}]}var gr=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&&Tn(t,e)}(n,t);var e=An(n);function n(t){var r;return En(this,n),function(t,e,n,r,i,o){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:[-1],s=Sn;tr(t);var u,c,l,h=e.props||{},f=t.$$={fragment:null,ctx:null,props:o,update:Bn,not_equal:i,bound:Fn(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(s?s.$$.context:[]),callbacks:Fn(),dirty:a},d=!1;f.ctx=n?n(t,h,(function(e,n){var r=!(arguments.length<=2)&&arguments.length-2?arguments.length<=2?void 0:arguments[2]:n;return f.ctx&&i(f.ctx[e],f.ctx[e]=r)&&(f.bound[e]&&f.bound[e](r),d&&fr(t,e)),n})):[],f.update(),d=!0,qn(f.before_update),f.fragment=!!r&&r(f.ctx),e.target&&(e.hydrate?f.fragment&&f.fragment.l((l=e.target,Array.from(l.childNodes))):f.fragment&&f.fragment.c(),e.intro&&(u=t.$$.fragment)&&u.i&&(hr.delete(u),u.i(c)),function(t,e,n){var r=t.$$,i=r.fragment,o=r.on_mount,a=r.on_destroy,s=r.after_update;i&&i.m(e,n),sr((function(){var e=o.map(jn).filter($n);a?a.push.apply(a,Nn(e)):qn(e),t.$$.on_mount=[]})),s.forEach(sr)}(t,e.target,e.anchor),cr()),tr(s)}(Dn(r=e.call(this)),t,mr,vr,Vn,{values:10,defaultValues:11,button:0,legend:1,described:2,name:3,list:4,remove:12}),r}return n}(function(){function t(){En(this,t)}var e,n,r;return e=t,(n=[{key:"$destroy",value:function(){var t;null!==(t=this.$$).fragment&&(qn(t.on_destroy),t.fragment&&t.fragment.d(1),t.on_destroy=t.fragment=null,t.ctx=[]),this.$destroy=Bn}},{key:"$on",value:function(t,e){var n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),function(){var t=n.indexOf(e);-1!==t&&n.splice(t,1)}}},{key:"$set",value:function(){}}])&&Mn(e.prototype,n),r&&Mn(e,r),t}());function yr(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 br(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?yr(Object(n),!0).forEach((function(e){wr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):yr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function wr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _r(t){this.content=t}document.addEventListener("turbolinks:load",(function(){document.querySelectorAll(".taggable").forEach((function(t){t.innerHTML="",new Cn({target:t,props:br({},t.dataset)})})),document.querySelectorAll(".mapable").forEach((function(t){t.innerHTML="",new gr({target:t,props:br({},t.dataset)})}))})),_r.prototype={constructor:_r,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return-1==e?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return-1==i?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new _r(o)},remove:function(t){var e=this.find(t);if(-1==e)return this;var n=this.content.slice();return n.splice(e,2),new _r(n)},addToStart:function(t,e){return new _r([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new _r(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(-1==o?i.length:o,0,e,n),new _r(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=_r.from(t)).size?new _r(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=_r.from(t)).size?new _r(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=_r.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},get size(){return this.content.length>>1}},_r.from=function(t){if(t instanceof _r)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new _r(e)};var xr=_r;function kr(t){return(kr="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sr(t,e,n){for(var r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;var i=t.child(r),o=e.child(r);if(i!=o){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(var a=0;i.text[a]==o.text[a];a++)n++;return n}if(i.content.size||o.content.size){var s=Sr(i.content,o.content,n+1);if(null!=s)return s}n+=i.nodeSize}else n+=i.nodeSize}}function Cr(t,e,n,r){for(var i=t.childCount,o=e.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};var a=t.child(--i),s=e.child(--o),u=a.nodeSize;if(a!=s){if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){for(var c=0,l=Math.min(a.text.length,s.text.length);c<l&&a.text[a.text.length-c-1]==s.text[s.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(a.content.size||s.content.size){var h=Cr(a.content,s.content,n-1,r-1);if(h)return h}n-=u,r-=u}else n-=u,r-=u}}var Mr=function(t,e){if(this.content=t,this.size=e||0,null==e)for(var n=0;n<t.length;n++)this.size+=t[n].nodeSize},Er={firstChild:{configurable:!0},lastChild:{configurable:!0},childCount:{configurable:!0}};Mr.prototype.nodesBetween=function(t,e,n,r,i){void 0===r&&(r=0);for(var o=0,a=0;a<e;o++){var s=this.content[o],u=a+s.nodeSize;if(u>t&&!1!==n(s,r+a,i,o)&&s.content.size){var c=a+1;s.nodesBetween(Math.max(0,t-c),Math.min(s.content.size,e-c),n,r+c)}a=u}},Mr.prototype.descendants=function(t){this.nodesBetween(0,this.size,t)},Mr.prototype.textBetween=function(t,e,n,r){var i="",o=!0;return this.nodesBetween(t,e,(function(a,s){a.isText?(i+=a.text.slice(Math.max(t,s)-s,e-s),o=!n):a.isLeaf&&r?(i+=r,o=!n):!o&&a.isBlock&&(i+=n,o=!0)}),0),i},Mr.prototype.append=function(t){if(!t.size)return this;if(!this.size)return t;var e=this.lastChild,n=t.firstChild,r=this.content.slice(),i=0;for(e.isText&&e.sameMarkup(n)&&(r[r.length-1]=e.withText(e.text+n.text),i=1);i<t.content.length;i++)r.push(t.content[i]);return new Mr(r,this.size+t.size)},Mr.prototype.cut=function(t,e){if(null==e&&(e=this.size),0==t&&e==this.size)return this;var n=[],r=0;if(e>t)for(var i=0,o=0;o<e;i++){var a=this.content[i],s=o+a.nodeSize;s>t&&((o<t||s>e)&&(a=a.isText?a.cut(Math.max(0,t-o),Math.min(a.text.length,e-o)):a.cut(Math.max(0,t-o-1),Math.min(a.content.size,e-o-1))),n.push(a),r+=a.nodeSize),o=s}return new Mr(n,r)},Mr.prototype.cutByIndex=function(t,e){return t==e?Mr.empty:0==t&&e==this.content.length?this:new Mr(this.content.slice(t,e))},Mr.prototype.replaceChild=function(t,e){var n=this.content[t];if(n==e)return this;var r=this.content.slice(),i=this.size+e.nodeSize-n.nodeSize;return r[t]=e,new Mr(r,i)},Mr.prototype.addToStart=function(t){return new Mr([t].concat(this.content),this.size+t.nodeSize)},Mr.prototype.addToEnd=function(t){return new Mr(this.content.concat(t),this.size+t.nodeSize)},Mr.prototype.eq=function(t){if(this.content.length!=t.content.length)return!1;for(var e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0},Er.firstChild.get=function(){return this.content.length?this.content[0]:null},Er.lastChild.get=function(){return this.content.length?this.content[this.content.length-1]:null},Er.childCount.get=function(){return this.content.length},Mr.prototype.child=function(t){var e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e},Mr.prototype.maybeChild=function(t){return this.content[t]},Mr.prototype.forEach=function(t){for(var e=0,n=0;e<this.content.length;e++){var r=this.content[e];t(r,n,e),n+=r.nodeSize}},Mr.prototype.findDiffStart=function(t,e){return void 0===e&&(e=0),Sr(this,t,e)},Mr.prototype.findDiffEnd=function(t,e,n){return void 0===e&&(e=this.size),void 0===n&&(n=t.size),Cr(this,t,e,n)},Mr.prototype.findIndex=function(t,e){if(void 0===e&&(e=-1),0==t)return Ar(0,t);if(t==this.size)return Ar(this.content.length,t);if(t>this.size||t<0)throw new RangeError("Position "+t+" outside of fragment ("+this+")");for(var n=0,r=0;;n++){var i=r+this.child(n).nodeSize;if(i>=t)return i==t||e>0?Ar(n+1,i):Ar(n,r);r=i}},Mr.prototype.toString=function(){return"<"+this.toStringInner()+">"},Mr.prototype.toStringInner=function(){return this.content.join(", ")},Mr.prototype.toJSON=function(){return this.content.length?this.content.map((function(t){return t.toJSON()})):null},Mr.fromJSON=function(t,e){if(!e)return Mr.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new Mr(e.map(t.nodeFromJSON))},Mr.fromArray=function(t){if(!t.length)return Mr.empty;for(var e,n=0,r=0;r<t.length;r++){var i=t[r];n+=i.nodeSize,r&&i.isText&&t[r-1].sameMarkup(i)?(e||(e=t.slice(0,r)),e[e.length-1]=i.withText(e[e.length-1].text+i.text)):e&&e.push(i)}return new Mr(e||t,n)},Mr.from=function(t){if(!t)return Mr.empty;if(t instanceof Mr)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new Mr([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))},Object.defineProperties(Mr.prototype,Er);var Tr={index:0,offset:0};function Ar(t,e){return Tr.index=t,Tr.offset=e,Tr}function Or(t,e){if(t===e)return!0;if(!t||"object"!=kr(t)||!e||"object"!=kr(e))return!1;var n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(var r=0;r<t.length;r++)if(!Or(t[r],e[r]))return!1}else{for(var i in t)if(!(i in e)||!Or(t[i],e[i]))return!1;for(var o in e)if(!(o in t))return!1}return!0}Mr.empty=new Mr([],0);var Dr=function(t,e){this.type=t,this.attrs=e};function Pr(t){var e=Error.call(this,t);return e.__proto__=Pr.prototype,e}Dr.prototype.addToSet=function(t){for(var e,n=!1,r=0;r<t.length;r++){var i=t[r];if(this.eq(i))return t;if(this.type.excludes(i.type))e||(e=t.slice(0,r));else{if(i.type.excludes(this.type))return t;!n&&i.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),n=!0),e&&e.push(i)}}return e||(e=t.slice()),n||e.push(this),e},Dr.prototype.removeFromSet=function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t},Dr.prototype.isInSet=function(t){for(var e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1},Dr.prototype.eq=function(t){return this==t||this.type==t.type&&Or(this.attrs,t.attrs)},Dr.prototype.toJSON=function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return t},Dr.fromJSON=function(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");var n=t.marks[e.type];if(!n)throw new RangeError("There is no mark type "+e.type+" in this schema");return n.create(e.attrs)},Dr.sameSet=function(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].eq(e[n]))return!1;return!0},Dr.setFrom=function(t){if(!t||0==t.length)return Dr.none;if(t instanceof Dr)return[t];var e=t.slice();return e.sort((function(t,e){return t.type.rank-e.type.rank})),e},Dr.none=[],Pr.prototype=Object.create(Error.prototype),Pr.prototype.constructor=Pr,Pr.prototype.name="ReplaceError";var Lr=function(t,e,n){this.content=t,this.openStart=e,this.openEnd=n},Nr={size:{configurable:!0}};function Rr(t,e,n){var r=t.findIndex(e),i=r.index,o=r.offset,a=t.maybeChild(i),s=t.findIndex(n),u=s.index,c=s.offset;if(o==e||a.isText){if(c!=n&&!t.child(u).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(i!=u)throw new RangeError("Removing non-flat range");return t.replaceChild(i,a.copy(Rr(a.content,e-o-1,n-o-1)))}function Ir(t,e,n,r){var i=t.findIndex(e),o=i.index,a=i.offset,s=t.maybeChild(o);if(a==e||s.isText)return r&&!r.canReplace(o,o,n)?null:t.cut(0,e).append(n).append(t.cut(e));var u=Ir(s.content,e-a-1,n);return u&&t.replaceChild(o,s.copy(u))}function zr(t,e,n){if(n.openStart>t.depth)throw new Pr("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Pr("Inconsistent open depths");return Br(t,e,n,0)}function Br(t,e,n,r){var i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){var a=Br(t,e,n,r+1);return o.copy(o.content.replaceChild(i,a))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=r||e.depth!=r){var s=function(t,e){for(var n=e.depth-t.openStart,r=e.node(n).copy(t.content),i=n-1;i>=0;i--)r=e.node(i).copy(Mr.from(r));return{start:r.resolveNoCache(t.openStart+n),end:r.resolveNoCache(r.content.size-t.openEnd-n)}}(n,t);return Vr(o,Ur(t,s.start,s.end,e,r))}var u=t.parent,c=u.content;return Vr(u,c.cut(0,t.parentOffset).append(n.content).append(c.cut(e.parentOffset)))}return Vr(o,Hr(t,e,r))}function jr(t,e){if(!e.type.compatibleContent(t.type))throw new Pr("Cannot join "+e.type.name+" onto "+t.type.name)}function Fr(t,e,n){var r=t.node(n);return jr(r,e.node(n)),r}function qr(t,e){var n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function $r(t,e,n,r){var i=(e||t).node(n),o=0,a=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(qr(t.nodeAfter,r),o++));for(var s=o;s<a;s++)qr(i.child(s),r);e&&e.depth==n&&e.textOffset&&qr(e.nodeBefore,r)}function Vr(t,e){if(!t.type.validContent(e))throw new Pr("Invalid content for node "+t.type.name);return t.copy(e)}function Ur(t,e,n,r,i){var o=t.depth>i&&Fr(t,e,i+1),a=r.depth>i&&Fr(n,r,i+1),s=[];return $r(null,t,i,s),o&&a&&e.index(i)==n.index(i)?(jr(o,a),qr(Vr(o,Ur(t,e,n,r,i+1)),s)):(o&&qr(Vr(o,Hr(t,e,i+1)),s),$r(e,n,i,s),a&&qr(Vr(a,Hr(n,r,i+1)),s)),$r(r,null,i,s),new Mr(s)}function Hr(t,e,n){var r=[];($r(null,t,n,r),t.depth>n)&&qr(Vr(Fr(t,e,n+1),Hr(t,e,n+1)),r);return $r(e,null,n,r),new Mr(r)}Nr.size.get=function(){return this.content.size-this.openStart-this.openEnd},Lr.prototype.insertAt=function(t,e){var n=Ir(this.content,t+this.openStart,e,null);return n&&new Lr(n,this.openStart,this.openEnd)},Lr.prototype.removeBetween=function(t,e){return new Lr(Rr(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)},Lr.prototype.eq=function(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd},Lr.prototype.toString=function(){return this.content+"("+this.openStart+","+this.openEnd+")"},Lr.prototype.toJSON=function(){if(!this.content.size)return null;var t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t},Lr.fromJSON=function(t,e){if(!e)return Lr.empty;var n=e.openStart||0,r=e.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new Lr(Mr.fromJSON(t,e.content),n,r)},Lr.maxOpen=function(t,e){void 0===e&&(e=!0);for(var n=0,r=0,i=t.firstChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.firstChild)n++;for(var o=t.lastChild;o&&!o.isLeaf&&(e||!o.type.spec.isolating);o=o.lastChild)r++;return new Lr(t,n,r)},Object.defineProperties(Lr.prototype,Nr),Lr.empty=new Lr(Mr.empty,0,0);var Wr=function(t,e,n){this.pos=t,this.path=e,this.depth=e.length/3-1,this.parentOffset=n},Zr={parent:{configurable:!0},doc:{configurable:!0},textOffset:{configurable:!0},nodeAfter:{configurable:!0},nodeBefore:{configurable:!0}};Wr.prototype.resolveDepth=function(t){return null==t?this.depth:t<0?this.depth+t:t},Zr.parent.get=function(){return this.node(this.depth)},Zr.doc.get=function(){return this.node(0)},Wr.prototype.node=function(t){return this.path[3*this.resolveDepth(t)]},Wr.prototype.index=function(t){return this.path[3*this.resolveDepth(t)+1]},Wr.prototype.indexAfter=function(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)},Wr.prototype.start=function(t){return 0==(t=this.resolveDepth(t))?0:this.path[3*t-1]+1},Wr.prototype.end=function(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size},Wr.prototype.before=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]},Wr.prototype.after=function(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[3*t-1]+this.path[3*t].nodeSize},Zr.textOffset.get=function(){return this.pos-this.path[this.path.length-1]},Zr.nodeAfter.get=function(){var t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=t.child(e);return n?t.child(e).cut(n):r},Zr.nodeBefore.get=function(){var t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):0==t?null:this.parent.child(t-1)},Wr.prototype.posAtIndex=function(t,e){e=this.resolveDepth(e);for(var n=this.path[3*e],r=0==e?0:this.path[3*e-1]+1,i=0;i<t;i++)r+=n.child(i).nodeSize;return r},Wr.prototype.marks=function(){var t=this.parent,e=this.index();if(0==t.content.size)return Dr.none;if(this.textOffset)return t.child(e).marks;var n=t.maybeChild(e-1),r=t.maybeChild(e);if(!n){var i=n;n=r,r=i}for(var o=n.marks,a=0;a<o.length;a++)!1!==o[a].type.spec.inclusive||r&&o[a].isInSet(r.marks)||(o=o[a--].removeFromSet(o));return o},Wr.prototype.marksAcross=function(t){var e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;for(var n=e.marks,r=t.parent.maybeChild(t.index()),i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n},Wr.prototype.sharedDepth=function(t){for(var e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0},Wr.prototype.blockRange=function(t,e){if(void 0===t&&(t=this),t.pos<this.pos)return t.blockRange(this);for(var n=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);n>=0;n--)if(t.pos<=this.end(n)&&(!e||e(this.node(n))))return new Gr(this,t,n)},Wr.prototype.sameParent=function(t){return this.pos-this.parentOffset==t.pos-t.parentOffset},Wr.prototype.max=function(t){return t.pos>this.pos?t:this},Wr.prototype.min=function(t){return t.pos<this.pos?t:this},Wr.prototype.toString=function(){for(var t="",e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset},Wr.resolve=function(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");for(var n=[],r=0,i=e,o=t;;){var a=o.content.findIndex(i),s=a.index,u=a.offset,c=i-u;if(n.push(o,s,r+u),!c)break;if((o=o.child(s)).isText)break;i=c-1,r+=u+1}return new Wr(e,n,i)},Wr.resolveCached=function(t,e){for(var n=0;n<Jr.length;n++){var r=Jr[n];if(r.pos==e&&r.doc==t)return r}var i=Jr[Yr]=Wr.resolve(t,e);return Yr=(Yr+1)%Kr,i},Object.defineProperties(Wr.prototype,Zr);var Jr=[],Yr=0,Kr=12,Gr=function(t,e,n){this.$from=t,this.$to=e,this.depth=n},Xr={start:{configurable:!0},end:{configurable:!0},parent:{configurable:!0},startIndex:{configurable:!0},endIndex:{configurable:!0}};Xr.start.get=function(){return this.$from.before(this.depth+1)},Xr.end.get=function(){return this.$to.after(this.depth+1)},Xr.parent.get=function(){return this.$from.node(this.depth)},Xr.startIndex.get=function(){return this.$from.index(this.depth)},Xr.endIndex.get=function(){return this.$to.indexAfter(this.depth)},Object.defineProperties(Gr.prototype,Xr);var Qr=Object.create(null),ti=function(t,e,n,r){this.type=t,this.attrs=e,this.content=n||Mr.empty,this.marks=r||Dr.none},ei={nodeSize:{configurable:!0},childCount:{configurable:!0},textContent:{configurable:!0},firstChild:{configurable:!0},lastChild:{configurable:!0},isBlock:{configurable:!0},isTextblock:{configurable:!0},inlineContent:{configurable:!0},isInline:{configurable:!0},isText:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};ei.nodeSize.get=function(){return this.isLeaf?1:2+this.content.size},ei.childCount.get=function(){return this.content.childCount},ti.prototype.child=function(t){return this.content.child(t)},ti.prototype.maybeChild=function(t){return this.content.maybeChild(t)},ti.prototype.forEach=function(t){this.content.forEach(t)},ti.prototype.nodesBetween=function(t,e,n,r){void 0===r&&(r=0),this.content.nodesBetween(t,e,n,r,this)},ti.prototype.descendants=function(t){this.nodesBetween(0,this.content.size,t)},ei.textContent.get=function(){return this.textBetween(0,this.content.size,"")},ti.prototype.textBetween=function(t,e,n,r){return this.content.textBetween(t,e,n,r)},ei.firstChild.get=function(){return this.content.firstChild},ei.lastChild.get=function(){return this.content.lastChild},ti.prototype.eq=function(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)},ti.prototype.sameMarkup=function(t){return this.hasMarkup(t.type,t.attrs,t.marks)},ti.prototype.hasMarkup=function(t,e,n){return this.type==t&&Or(this.attrs,e||t.defaultAttrs||Qr)&&Dr.sameSet(this.marks,n||Dr.none)},ti.prototype.copy=function(t){return void 0===t&&(t=null),t==this.content?this:new this.constructor(this.type,this.attrs,t,this.marks)},ti.prototype.mark=function(t){return t==this.marks?this:new this.constructor(this.type,this.attrs,this.content,t)},ti.prototype.cut=function(t,e){return 0==t&&e==this.content.size?this:this.copy(this.content.cut(t,e))},ti.prototype.slice=function(t,e,n){if(void 0===e&&(e=this.content.size),void 0===n&&(n=!1),t==e)return Lr.empty;var r=this.resolve(t),i=this.resolve(e),o=n?0:r.sharedDepth(e),a=r.start(o),s=r.node(o).content.cut(r.pos-a,i.pos-a);return new Lr(s,r.depth-o,i.depth-o)},ti.prototype.replace=function(t,e,n){return zr(this.resolve(t),this.resolve(e),n)},ti.prototype.nodeAt=function(t){for(var e=this;;){var n=e.content.findIndex(t),r=n.index,i=n.offset;if(!(e=e.maybeChild(r)))return null;if(i==t||e.isText)return e;t-=i+1}},ti.prototype.childAfter=function(t){var e=this.content.findIndex(t),n=e.index,r=e.offset;return{node:this.content.maybeChild(n),index:n,offset:r}},ti.prototype.childBefore=function(t){if(0==t)return{node:null,index:0,offset:0};var e=this.content.findIndex(t),n=e.index,r=e.offset;if(r<t)return{node:this.content.child(n),index:n,offset:r};var i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}},ti.prototype.resolve=function(t){return Wr.resolveCached(this,t)},ti.prototype.resolveNoCache=function(t){return Wr.resolve(this,t)},ti.prototype.rangeHasMark=function(t,e,n){var r=!1;return e>t&&this.nodesBetween(t,e,(function(t){return n.isInSet(t.marks)&&(r=!0),!r})),r},ei.isBlock.get=function(){return this.type.isBlock},ei.isTextblock.get=function(){return this.type.isTextblock},ei.inlineContent.get=function(){return this.type.inlineContent},ei.isInline.get=function(){return this.type.isInline},ei.isText.get=function(){return this.type.isText},ei.isLeaf.get=function(){return this.type.isLeaf},ei.isAtom.get=function(){return this.type.isAtom},ti.prototype.toString=function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),ri(this.marks,t)},ti.prototype.contentMatchAt=function(t){var e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e},ti.prototype.canReplace=function(t,e,n,r,i){void 0===n&&(n=Mr.empty),void 0===r&&(r=0),void 0===i&&(i=n.childCount);var o=this.contentMatchAt(t).matchFragment(n,r,i),a=o&&o.matchFragment(this.content,e);if(!a||!a.validEnd)return!1;for(var s=r;s<i;s++)if(!this.type.allowsMarks(n.child(s).marks))return!1;return!0},ti.prototype.canReplaceWith=function(t,e,n,r){if(r&&!this.type.allowsMarks(r))return!1;var i=this.contentMatchAt(t).matchType(n),o=i&&i.matchFragment(this.content,e);return!!o&&o.validEnd},ti.prototype.canAppend=function(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)},ti.prototype.check=function(){if(!this.type.validContent(this.content))throw new RangeError("Invalid content for node "+this.type.name+": "+this.content.toString().slice(0,50));this.content.forEach((function(t){return t.check()}))},ti.prototype.toJSON=function(){var t={type:this.type.name};for(var e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map((function(t){return t.toJSON()}))),t},ti.fromJSON=function(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");var n=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,n)}var r=Mr.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,r,n)},Object.defineProperties(ti.prototype,ei);var ni=function(t){function e(e,n,r,i){if(t.call(this,e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={textContent:{configurable:!0},nodeSize:{configurable:!0}};return e.prototype.toString=function(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ri(this.marks,JSON.stringify(this.text))},n.textContent.get=function(){return this.text},e.prototype.textBetween=function(t,e){return this.text.slice(t,e)},n.nodeSize.get=function(){return this.text.length},e.prototype.mark=function(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)},e.prototype.withText=function(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)},e.prototype.cut=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.text.length),0==t&&e==this.text.length?this:this.withText(this.text.slice(t,e))},e.prototype.eq=function(t){return this.sameMarkup(t)&&this.text==t.text},e.prototype.toJSON=function(){var e=t.prototype.toJSON.call(this);return e.text=this.text,e},Object.defineProperties(e.prototype,n),e}(ti);function ri(t,e){for(var n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}var ii=function(t){this.validEnd=t,this.next=[],this.wrapCache=[]},oi={inlineContent:{configurable:!0},defaultType:{configurable:!0},edgeCount:{configurable:!0}};ii.parse=function(t,e){var n=new ai(t,e);if(null==n.next)return ii.empty;var r=ui(n);n.next&&n.err("Unexpected trailing text");var i=function(t){var e=Object.create(null);return n(pi(t,0));function n(r){var i=[];r.forEach((function(e){t[e].forEach((function(e){var n=e.term,r=e.to;if(n){var o=i.indexOf(n),a=o>-1&&i[o+1];pi(t,r).forEach((function(t){a||i.push(n,a=[]),-1==a.indexOf(t)&&a.push(t)}))}}))}));for(var o=e[r.join(",")]=new ii(r.indexOf(t.length-1)>-1),a=0;a<i.length;a+=2){var s=i[a+1].sort(di);o.next.push(i[a],e[s.join(",")]||n(s))}return o}}(function(t){var e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(t,n,r){var i={term:r,to:n};return e[t].push(i),i}function i(t,e){t.forEach((function(t){return t.to=e}))}function o(t,e){if("choice"==t.type)return t.exprs.reduce((function(t,n){return t.concat(o(n,e))}),[]);if("seq"==t.type)for(var a=0;;a++){var s=o(t.exprs[a],e);if(a==t.exprs.length-1)return s;i(s,e=n())}else{if("star"==t.type){var u=n();return r(e,u),i(o(t.expr,u),u),[r(u)]}if("plus"==t.type){var c=n();return i(o(t.expr,e),c),i(o(t.expr,c),c),[r(c)]}if("opt"==t.type)return[r(e)].concat(o(t.expr,e));if("range"==t.type){for(var l=e,h=0;h<t.min;h++){var f=n();i(o(t.expr,l),f),l=f}if(-1==t.max)i(o(t.expr,l),l);else for(var d=t.min;d<t.max;d++){var p=n();r(l,p),i(o(t.expr,l),p),l=p}return[r(l)]}if("name"==t.type)return[r(e,null,t.value)]}}}(r));return function(t,e){for(var n=0,r=[t];n<r.length;n++){for(var i=r[n],o=!i.validEnd,a=[],s=0;s<i.next.length;s+=2){var u=i.next[s],c=i.next[s+1];a.push(u.name),!o||u.isText||u.hasRequiredAttrs()||(o=!1),-1==r.indexOf(c)&&r.push(c)}o&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,n),i},ii.prototype.matchType=function(t){for(var e=0;e<this.next.length;e+=2)if(this.next[e]==t)return this.next[e+1];return null},ii.prototype.matchFragment=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=t.childCount);for(var r=this,i=e;r&&i<n;i++)r=r.matchType(t.child(i).type);return r},oi.inlineContent.get=function(){var t=this.next[0];return!!t&&t.isInline},oi.defaultType.get=function(){for(var t=0;t<this.next.length;t+=2){var e=this.next[t];if(!e.isText&&!e.hasRequiredAttrs())return e}},ii.prototype.compatible=function(t){for(var e=0;e<this.next.length;e+=2)for(var n=0;n<t.next.length;n+=2)if(this.next[e]==t.next[n])return!0;return!1},ii.prototype.fillBefore=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=0);var r=[this];return function i(o,a){var s=o.matchFragment(t,n);if(s&&(!e||s.validEnd))return Mr.from(a.map((function(t){return t.createAndFill()})));for(var u=0;u<o.next.length;u+=2){var c=o.next[u],l=o.next[u+1];if(!c.isText&&!c.hasRequiredAttrs()&&-1==r.indexOf(l)){r.push(l);var h=i(l,a.concat(c));if(h)return h}}}(this,[])},ii.prototype.findWrapping=function(t){for(var e=0;e<this.wrapCache.length;e+=2)if(this.wrapCache[e]==t)return this.wrapCache[e+1];var n=this.computeWrapping(t);return this.wrapCache.push(t,n),n},ii.prototype.computeWrapping=function(t){for(var e=Object.create(null),n=[{match:this,type:null,via:null}];n.length;){var r=n.shift(),i=r.match;if(i.matchType(t)){for(var o=[],a=r;a.type;a=a.via)o.push(a.type);return o.reverse()}for(var s=0;s<i.next.length;s+=2){var u=i.next[s];u.isLeaf||u.hasRequiredAttrs()||u.name in e||r.type&&!i.next[s+1].validEnd||(n.push({match:u.contentMatch,type:u,via:r}),e[u.name]=!0)}}},oi.edgeCount.get=function(){return this.next.length>>1},ii.prototype.edge=function(t){var e=t<<1;if(e>=this.next.length)throw new RangeError("There's no "+t+"th edge in this content match");return{type:this.next[e],next:this.next[e+1]}},ii.prototype.toString=function(){var t=[];return function e(n){t.push(n);for(var r=1;r<n.next.length;r+=2)-1==t.indexOf(n.next[r])&&e(n.next[r])}(this),t.map((function(e,n){for(var r=n+(e.validEnd?"*":" ")+" ",i=0;i<e.next.length;i+=2)r+=(i?", ":"")+e.next[i].name+"->"+t.indexOf(e.next[i+1]);return r})).join("\n")},Object.defineProperties(ii.prototype,oi),ii.empty=new ii(!0);var ai=function(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()},si={next:{configurable:!0}};function ui(t){var e=[];do{e.push(ci(t))}while(t.eat("|"));return 1==e.length?e[0]:{type:"choice",exprs:e}}function ci(t){var e=[];do{e.push(li(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e[0]:{type:"seq",exprs:e}}function li(t){for(var e=function(t){if(t.eat("(")){var e=ui(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\W/.test(t.next)){var n=function(t,e){var n=t.nodeTypes,r=n[e];if(r)return[r];var i=[];for(var o in n){var a=n[o];a.groups.indexOf(e)>-1&&i.push(a)}0==i.length&&t.err("No node type or group '"+e+"' found");return i}(t,t.next).map((function(e){return null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}}));return t.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}t.err("Unexpected token '"+t.next+"'")}(t);;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=fi(t,e)}return e}function hi(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");var e=Number(t.next);return t.pos++,e}function fi(t,e){var n=hi(t),r=n;return t.eat(",")&&(r="}"!=t.next?hi(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function di(t,e){return e-t}function pi(t,e){var n=[];return function e(r){var i=t[r];if(1==i.length&&!i[0].term)return e(i[0].to);n.push(r);for(var o=0;o<i.length;o++){var a=i[o],s=a.term,u=a.to;s||-1!=n.indexOf(u)||e(u)}}(e),n.sort(di)}function vi(t){var e=Object.create(null);for(var n in t){var r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function mi(t,e){var n=Object.create(null);for(var r in t){var i=e&&e[r];if(void 0===i){var o=t[r];if(!o.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=o.default}n[r]=i}return n}function gi(t){var e=Object.create(null);if(t)for(var n in t)e[n]=new wi(t[n]);return e}si.next.get=function(){return this.tokens[this.pos]},ai.prototype.eat=function(t){return this.next==t&&(this.pos++||!0)},ai.prototype.err=function(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")},Object.defineProperties(ai.prototype,si);var yi=function(t,e,n){this.name=t,this.schema=e,this.spec=n,this.groups=n.group?n.group.split(" "):[],this.attrs=gi(n.attrs),this.defaultAttrs=vi(this.attrs),this.contentMatch=null,this.markSet=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==t),this.isText="text"==t},bi={isInline:{configurable:!0},isTextblock:{configurable:!0},isLeaf:{configurable:!0},isAtom:{configurable:!0}};bi.isInline.get=function(){return!this.isBlock},bi.isTextblock.get=function(){return this.isBlock&&this.inlineContent},bi.isLeaf.get=function(){return this.contentMatch==ii.empty},bi.isAtom.get=function(){return this.isLeaf||this.spec.atom},yi.prototype.hasRequiredAttrs=function(){for(var t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1},yi.prototype.compatibleContent=function(t){return this==t||this.contentMatch.compatible(t.contentMatch)},yi.prototype.computeAttrs=function(t){return!t&&this.defaultAttrs?this.defaultAttrs:mi(this.attrs,t)},yi.prototype.create=function(t,e,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new ti(this,this.computeAttrs(t),Mr.from(e),Dr.setFrom(n))},yi.prototype.createChecked=function(t,e,n){if(e=Mr.from(e),!this.validContent(e))throw new RangeError("Invalid content for node "+this.name);return new ti(this,this.computeAttrs(t),e,Dr.setFrom(n))},yi.prototype.createAndFill=function(t,e,n){if(t=this.computeAttrs(t),(e=Mr.from(e)).size){var r=this.contentMatch.fillBefore(e);if(!r)return null;e=r.append(e)}var i=this.contentMatch.matchFragment(e).fillBefore(Mr.empty,!0);return i?new ti(this,t,e.append(i),Dr.setFrom(n)):null},yi.prototype.validContent=function(t){var e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(var n=0;n<t.childCount;n++)if(!this.allowsMarks(t.child(n).marks))return!1;return!0},yi.prototype.allowsMarkType=function(t){return null==this.markSet||this.markSet.indexOf(t)>-1},yi.prototype.allowsMarks=function(t){if(null==this.markSet)return!0;for(var e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0},yi.prototype.allowedMarks=function(t){if(null==this.markSet)return t;for(var e,n=0;n<t.length;n++)this.allowsMarkType(t[n].type)?e&&e.push(t[n]):e||(e=t.slice(0,n));return e?e.length?e:Dr.empty:t},yi.compile=function(t,e){var n=Object.create(null);t.forEach((function(t,r){return n[t]=new yi(t,e,r)}));var r=e.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(var i in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n},Object.defineProperties(yi.prototype,bi);var wi=function(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default},_i={isRequired:{configurable:!0}};_i.isRequired.get=function(){return!this.hasDefault},Object.defineProperties(wi.prototype,_i);var xi=function(t,e,n,r){this.name=t,this.schema=n,this.spec=r,this.attrs=gi(r.attrs),this.rank=e,this.excluded=null;var i=vi(this.attrs);this.instance=i&&new Dr(this,i)};xi.prototype.create=function(t){return!t&&this.instance?this.instance:new Dr(this,mi(this.attrs,t))},xi.compile=function(t,e){var n=Object.create(null),r=0;return t.forEach((function(t,i){return n[t]=new xi(t,r++,e,i)})),n},xi.prototype.removeFromSet=function(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t},xi.prototype.isInSet=function(t){for(var e=0;e<t.length;e++)if(t[e].type==this)return t[e]},xi.prototype.excludes=function(t){return this.excluded.indexOf(t)>-1};var ki=function(t){for(var e in this.spec={},t)this.spec[e]=t[e];this.spec.nodes=xr.from(t.nodes),this.spec.marks=xr.from(t.marks),this.nodes=yi.compile(this.spec.nodes,this),this.marks=xi.compile(this.spec.marks,this);var n=Object.create(null);for(var r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");var i=this.nodes[r],o=i.spec.content||"",a=i.spec.marks;i.contentMatch=n[o]||(n[o]=ii.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet="_"==a?null:a?Si(this,a.split(" ")):""!=a&&i.inlineContent?null:[]}for(var s in this.marks){var u=this.marks[s],c=u.spec.excludes;u.excluded=null==c?[u]:""==c?[]:Si(this,c.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached=Object.create(null),this.cached.wrappings=Object.create(null)};function Si(t,e){for(var n=[],r=0;r<e.length;r++){var i=e[r],o=t.marks[i],a=o;if(o)n.push(o);else for(var s in t.marks){var u=t.marks[s];("_"==i||u.spec.group&&u.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=u)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}ki.prototype.node=function(t,e,n,r){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof yi))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,n,r)},ki.prototype.text=function(t,e){var n=this.nodes.text;return new ni(n,n.defaultAttrs,t,Dr.setFrom(e))},ki.prototype.mark=function(t,e){return"string"==typeof t&&(t=this.marks[t]),t.create(e)},ki.prototype.nodeFromJSON=function(t){return ti.fromJSON(this,t)},ki.prototype.markFromJSON=function(t){return Dr.fromJSON(this,t)},ki.prototype.nodeType=function(t){var e=this.nodes[t];if(!e)throw new RangeError("Unknown node type: "+t);return e};var Ci=function(t,e){var n=this;this.schema=t,this.rules=e,this.tags=[],this.styles=[],e.forEach((function(t){t.tag?n.tags.push(t):t.style&&n.styles.push(t)})),this.normalizeLists=!this.tags.some((function(e){if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;var n=t.nodes[e.node];return n.contentMatch.matchType(n)}))};Ci.prototype.parse=function(t,e){void 0===e&&(e={});var n=new Di(this,e,!1);return n.addAll(t,null,e.from,e.to),n.finish()},Ci.prototype.parseSlice=function(t,e){void 0===e&&(e={});var n=new Di(this,e,!0);return n.addAll(t,null,e.from,e.to),Lr.maxOpen(n.finish())},Ci.prototype.matchTag=function(t,e,n){for(var r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){var i=this.tags[r];if(Li(t,i.tag)&&(void 0===i.namespace||t.namespaceURI==i.namespace)&&(!i.context||e.matchesContext(i.context))){if(i.getAttrs){var o=i.getAttrs(t);if(!1===o)continue;i.attrs=o}return i}}},Ci.prototype.matchStyle=function(t,e,n,r){for(var i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){var o=this.styles[i];if(!(0!=o.style.indexOf(t)||o.context&&!n.matchesContext(o.context)||o.style.length>t.length&&(61!=o.style.charCodeAt(t.length)||o.style.slice(t.length+1)!=e))){if(o.getAttrs){var a=o.getAttrs(e);if(!1===a)continue;o.attrs=a}return o}}},Ci.schemaRules=function(t){var e=[];function n(t){for(var n=null==t.priority?50:t.priority,r=0;r<e.length;r++){var i=e[r];if((null==i.priority?50:i.priority)<n)break}e.splice(r,0,t)}var r=function(e){var r=t.marks[e].spec.parseDOM;r&&r.forEach((function(t){n(t=Ni(t)),t.mark=e}))};for(var i in t.marks)r(i);var o;for(var a in t.nodes)o=void 0,(o=t.nodes[a].spec.parseDOM)&&o.forEach((function(t){n(t=Ni(t)),t.node=a}));return e},Ci.fromSchema=function(t){return t.cached.domParser||(t.cached.domParser=new Ci(t,Ci.schemaRules(t)))};var Mi={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Ei={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ti={ol:!0,ul:!0};function Ai(t){return(t?1:0)|("full"===t?2:0)}var Oi=function(t,e,n,r,i,o,a){this.type=t,this.attrs=e,this.solid=i,this.match=o||(4&a?null:t.contentMatch),this.options=a,this.content=[],this.marks=n,this.activeMarks=Dr.none,this.pendingMarks=r,this.stashMarks=[]};Oi.prototype.findWrapping=function(t){if(!this.match){if(!this.type)return[];var e=this.type.contentMatch.fillBefore(Mr.from(t));if(!e){var n,r=this.type.contentMatch;return(n=r.findWrapping(t.type))?(this.match=r,n):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)},Oi.prototype.finish=function(t){if(!(1&this.options)){var e,n=this.content[this.content.length-1];n&&n.isText&&(e=/[ \t\r\n\u000c]+$/.exec(n.text))&&(n.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length)))}var r=Mr.from(this.content);return!t&&this.match&&(r=r.append(this.match.fillBefore(Mr.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r},Oi.prototype.popFromStashMark=function(t){for(var e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks[e]))return this.stashMarks.splice(e,1)[0]},Oi.prototype.applyPending=function(t){for(var e=0,n=this.pendingMarks;e<n.length;e++){var r=n[e];(this.type?this.type.allowsMarkType(r.type):Ri(r.type,t))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}};var Di=function(t,e,n){this.parser=t,this.options=e,this.isOpen=n;var r,i=e.topNode,o=Ai(e.preserveWhitespace)|(n?4:0);r=i?new Oi(i.type,i.attrs,Dr.none,Dr.none,!0,e.topMatch||i.type.contentMatch,o):new Oi(n?null:t.schema.topNodeType,null,Dr.none,Dr.none,!0,null,o),this.nodes=[r],this.open=0,this.find=e.findPositions,this.needsBlock=!1},Pi={top:{configurable:!0},currentPos:{configurable:!0}};function Li(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Ni(t){var e={};for(var n in t)e[n]=t[n];return e}function Ri(t,e){var n=e.schema.nodes,r=function(r){var i=n[r];if(i.allowsMarkType(t)){var o=[];return function t(n){o.push(n);for(var r=0;r<n.edgeCount;r++){var i=n.edge(r),a=i.type,s=i.next;if(a==e)return!0;if(o.indexOf(s)<0&&t(s))return!0}}(i.contentMatch)?{v:!0}:void 0}};for(var i in n){var o=r(i);if(o)return o.v}}Pi.top.get=function(){return this.nodes[this.open]},Di.prototype.addDOM=function(t){if(3==t.nodeType)this.addTextNode(t);else if(1==t.nodeType){var e=t.getAttribute("style"),n=e?this.readStyles(function(t){var e,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;e=n.exec(t);)r.push(e[1],e[2].trim());return r}(e)):null,r=this.top;if(null!=n)for(var i=0;i<n.length;i++)this.addPendingMark(n[i]);if(this.addElement(t),null!=n)for(var o=0;o<n.length;o++)this.removePendingMark(n[o],r)}},Di.prototype.addTextNode=function(t){var e=t.nodeValue,n=this.top;if((n.type?n.type.inlineContent:n.content.length&&n.content[0].isInline)||/[^ \t\r\n\u000c]/.test(e)){if(1&n.options)2&n.options||(e=e.replace(/\r?\n|\r/g," "));else if(e=e.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(e)&&this.open==this.nodes.length-1){var r=n.content[n.content.length-1],i=t.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(e=e.slice(1))}e&&this.insertNode(this.parser.schema.text(e)),this.findInText(t)}else this.findInside(t)},Di.prototype.addElement=function(t,e){var n,r=t.nodeName.toLowerCase();Ti.hasOwnProperty(r)&&this.parser.normalizeLists&&function(t){for(var e=t.firstChild,n=null;e;e=e.nextSibling){var r=1==e.nodeType?e.nodeName.toLowerCase():null;r&&Ti.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):"li"==r?n=e:r&&(n=null)}}(t);var i=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(n=this.parser.matchTag(t,this,e));if(i?i.ignore:Ei.hasOwnProperty(r))this.findInside(t);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(t=i.skip);var o,a=this.top,s=this.needsBlock;if(Mi.hasOwnProperty(r))o=!0,a.type||(this.needsBlock=!0);else if(!t.firstChild)return void this.leafFallback(t);this.addAll(t),o&&this.sync(a),this.needsBlock=s}else this.addElementByRule(t,i,!1===i.consuming?n:null)},Di.prototype.leafFallback=function(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\n"))},Di.prototype.readStyles=function(t){var e=Dr.none;t:for(var n=0;n<t.length;n+=2)for(var r=null;;){var i=this.parser.matchStyle(t[n],t[n+1],this,r);if(!i)continue t;if(i.ignore)return null;if(e=this.parser.schema.marks[i.mark].create(i.attrs).addToSet(e),!1!==i.consuming)break;r=i}return e},Di.prototype.addElementByRule=function(t,e,n){var r,i,o,a=this;e.node?(i=this.parser.schema.nodes[e.node]).isLeaf?this.insertNode(i.create(e.attrs))||this.leafFallback(t):r=this.enter(i,e.attrs,e.preserveWhitespace):(o=this.parser.schema.marks[e.mark].create(e.attrs),this.addPendingMark(o));var s=this.top;if(i&&i.isLeaf)this.findInside(t);else if(n)this.addElement(t,n);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((function(t){return a.insertNode(t)}));else{var u=e.contentElement;"string"==typeof u?u=t.querySelector(u):"function"==typeof u&&(u=u(t)),u||(u=t),this.findAround(t,u,!0),this.addAll(u,r)}r&&(this.sync(s),this.open--),o&&this.removePendingMark(o,s)},Di.prototype.addAll=function(t,e,n,r){for(var i=n||0,o=n?t.childNodes[n]:t.firstChild,a=null==r?null:t.childNodes[r];o!=a;o=o.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(o),e&&Mi.hasOwnProperty(o.nodeName.toLowerCase())&&this.sync(e);this.findAtPoint(t,i)},Di.prototype.findPlace=function(t){for(var e,n,r=this.open;r>=0;r--){var i=this.nodes[r],o=i.findWrapping(t);if(o&&(!e||e.length>o.length)&&(e=o,n=i,!o.length))break;if(i.solid)break}if(!e)return!1;this.sync(n);for(var a=0;a<e.length;a++)this.enterInner(e[a],null,!1);return!0},Di.prototype.insertNode=function(t){if(t.isInline&&this.needsBlock&&!this.top.type){var e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(t)){this.closeExtra();var n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));for(var r=n.activeMarks,i=0;i<t.marks.length;i++)n.type&&!n.type.allowsMarkType(t.marks[i].type)||(r=t.marks[i].addToSet(r));return n.content.push(t.mark(r)),!0}return!1},Di.prototype.enter=function(t,e,n){var r=this.findPlace(t.create(e));return r&&this.enterInner(t,e,!0,n),r},Di.prototype.enterInner=function(t,e,n,r){this.closeExtra();var i=this.top;i.applyPending(t),i.match=i.match&&i.match.matchType(t,e);var o=null==r?-5&i.options:Ai(r);4&i.options&&0==i.content.length&&(o|=4),this.nodes.push(new Oi(t,e,i.activeMarks,i.pendingMarks,n,null,o)),this.open++},Di.prototype.closeExtra=function(t){var e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}},Di.prototype.finish=function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)},Di.prototype.sync=function(t){for(var e=this.open;e>=0;e--)if(this.nodes[e]==t)return void(this.open=e)},Pi.currentPos.get=function(){this.closeExtra();for(var t=0,e=this.open;e>=0;e--){for(var n=this.nodes[e].content,r=n.length-1;r>=0;r--)t+=n[r].nodeSize;e&&t++}return t},Di.prototype.findAtPoint=function(t,e){if(this.find)for(var n=0;n<this.find.length;n++)this.find[n].node==t&&this.find[n].offset==e&&(this.find[n].pos=this.currentPos)},Di.prototype.findInside=function(t){if(this.find)for(var e=0;e<this.find.length;e++)null==this.find[e].pos&&1==t.nodeType&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)},Di.prototype.findAround=function(t,e,n){if(t!=e&&this.find)for(var r=0;r<this.find.length;r++){if(null==this.find[r].pos&&1==t.nodeType&&t.contains(this.find[r].node))e.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}},Di.prototype.findInText=function(t){if(this.find)for(var e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))},Di.prototype.matchesContext=function(t){var e=this;if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);var n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1);return function t(a,s){for(;a>=0;a--){var u=n[a];if(""==u){if(a==n.length-1||0==a)continue;for(;s>=o;s--)if(t(a-1,s))return!0;return!1}var c=s>0||0==s&&i?e.nodes[s].type:r&&s>=o?r.node(s-o).type:null;if(!c||c.name!=u&&-1==c.groups.indexOf(u))return!1;s--}return!0}(n.length-1,this.open)},Di.prototype.textblockFromContext=function(){var t=this.options.context;if(t)for(var e=t.depth;e>=0;e--){var n=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var i=this.parser.schema.nodes[r];if(i.isTextblock&&i.defaultAttrs)return i}},Di.prototype.addPendingMark=function(t){var e=function(t,e){for(var n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}(t,this.top.pendingMarks);e&&this.top.stashMarks.push(e),this.top.pendingMarks=t.addToSet(this.top.pendingMarks)},Di.prototype.removePendingMark=function(t,e){for(var n=this.open;n>=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(t)>-1)r.pendingMarks=t.removeFromSet(r.pendingMarks);else{r.activeMarks=t.removeFromSet(r.activeMarks);var i=r.popFromStashMark(t);i&&r.type&&r.type.allowsMarkType(i.type)&&(r.activeMarks=i.addToSet(r.activeMarks))}if(r==e)break}},Object.defineProperties(Di.prototype,Pi);var Ii=function(t,e){this.nodes=t||{},this.marks=e||{}};function zi(t){var e={};for(var n in t){var r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function Bi(t){return t.document||window.document}Ii.prototype.serializeFragment=function(t,e,n){var r=this;void 0===e&&(e={}),n||(n=Bi(e).createDocumentFragment());var i=n,o=null;return t.forEach((function(t){if(o||t.marks.length){o||(o=[]);for(var n=0,a=0;n<o.length&&a<t.marks.length;){var s=t.marks[a];if(r.marks[s.type.name]){if(!s.eq(o[n])||!1===s.type.spec.spanning)break;n+=2,a++}else a++}for(;n<o.length;)i=o.pop(),o.pop();for(;a<t.marks.length;){var u=t.marks[a++],c=r.serializeMark(u,t.isInline,e);c&&(o.push(u,i),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(r.serializeNode(t,e))})),n},Ii.prototype.serializeNode=function(t,e){void 0===e&&(e={});var n=Ii.renderSpec(Bi(e),this.nodes[t.type.name](t)),r=n.dom,i=n.contentDOM;if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");e.onContent?e.onContent(t,i,e):this.serializeFragment(t.content,e,i)}return r},Ii.prototype.serializeNodeAndMarks=function(t,e){void 0===e&&(e={});for(var n=this.serializeNode(t,e),r=t.marks.length-1;r>=0;r--){var i=this.serializeMark(t.marks[r],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n},Ii.prototype.serializeMark=function(t,e,n){void 0===n&&(n={});var r=this.marks[t.type.name];return r&&Ii.renderSpec(Bi(n),r(t,e))},Ii.renderSpec=function(t,e,n){if(void 0===n&&(n=null),"string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;var r=e[0],i=r.indexOf(" ");i>0&&(n=r.slice(0,i),r=r.slice(i+1));var o=null,a=n?t.createElementNS(n,r):t.createElement(r),s=e[1],u=1;if(s&&"object"==kr(s)&&null==s.nodeType&&!Array.isArray(s))for(var c in u=2,s)if(null!=s[c]){var l=c.indexOf(" ");l>0?a.setAttributeNS(c.slice(0,l),c.slice(l+1),s[c]):a.setAttribute(c,s[c])}for(var h=u;h<e.length;h++){var f=e[h];if(0===f){if(h<e.length-1||h>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}var d=Ii.renderSpec(t,f,n),p=d.dom,v=d.contentDOM;if(a.appendChild(p),v){if(o)throw new RangeError("Multiple content holes");o=v}}return{dom:a,contentDOM:o}},Ii.fromSchema=function(t){return t.cached.domSerializer||(t.cached.domSerializer=new Ii(this.nodesFromSchema(t),this.marksFromSchema(t)))},Ii.nodesFromSchema=function(t){var e=zi(t.nodes);return e.text||(e.text=function(t){return t.text}),e},Ii.marksFromSchema=function(t){return zi(t.marks)};var ji=Math.pow(2,16);function Fi(t){return 65535&t}var qi=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=null),this.pos=t,this.deleted=e,this.recover=n},$i=function(t,e){void 0===e&&(e=!1),this.ranges=t,this.inverted=e};$i.prototype.recover=function(t){var e=0,n=Fi(t);if(!this.inverted)for(var r=0;r<n;r++)e+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+e+function(t){return(t-(65535&t))/ji}(t)},$i.prototype.mapResult=function(t,e){return void 0===e&&(e=1),this._map(t,e,!1)},$i.prototype.map=function(t,e){return void 0===e&&(e=1),this._map(t,e,!0)},$i.prototype._map=function(t,e,n){for(var r=0,i=this.inverted?2:1,o=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var s=this.ranges[a]-(this.inverted?r:0);if(s>t)break;var u=this.ranges[a+i],c=this.ranges[a+o],l=s+u;if(t<=l){var h=s+r+((u?t==s?-1:t==l?1:e:e)<0?0:c);if(n)return h;var f=t==(e<0?s:l)?null:a/3+(t-s)*ji;return new qi(h,e<0?t!=s:t!=l,f)}r+=c-u}return n?t+r:new qi(t+r)},$i.prototype.touches=function(t,e){for(var n=0,r=Fi(e),i=this.inverted?2:1,o=this.inverted?1:2,a=0;a<this.ranges.length;a+=3){var s=this.ranges[a]-(this.inverted?n:0);if(s>t)break;var u=this.ranges[a+i];if(t<=s+u&&a==3*r)return!0;n+=this.ranges[a+o]-u}return!1},$i.prototype.forEach=function(t){for(var e=this.inverted?2:1,n=this.inverted?1:2,r=0,i=0;r<this.ranges.length;r+=3){var o=this.ranges[r],a=o-(this.inverted?i:0),s=o+(this.inverted?0:i),u=this.ranges[r+e],c=this.ranges[r+n];t(a,a+u,s,s+c),i+=c-u}},$i.prototype.invert=function(){return new $i(this.ranges,!this.inverted)},$i.prototype.toString=function(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)},$i.offset=function(t){return 0==t?$i.empty:new $i(t<0?[0,-t,0]:[0,0,t])},$i.empty=new $i([]);var Vi=function(t,e,n,r){this.maps=t||[],this.from=n||0,this.to=null==r?this.maps.length:r,this.mirror=e};function Ui(t){var e=Error.call(this,t);return e.__proto__=Ui.prototype,e}Vi.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.maps.length),new Vi(this.maps,this.mirror,t,e)},Vi.prototype.copy=function(){return new Vi(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)},Vi.prototype.appendMap=function(t,e){this.to=this.maps.push(t),null!=e&&this.setMirror(this.maps.length-1,e)},Vi.prototype.appendMapping=function(t){for(var e=0,n=this.maps.length;e<t.maps.length;e++){var r=t.getMirror(e);this.appendMap(t.maps[e],null!=r&&r<e?n+r:null)}},Vi.prototype.getMirror=function(t){if(this.mirror)for(var e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]},Vi.prototype.setMirror=function(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)},Vi.prototype.appendMappingInverted=function(t){for(var e=t.maps.length-1,n=this.maps.length+t.maps.length;e>=0;e--){var r=t.getMirror(e);this.appendMap(t.maps[e].invert(),null!=r&&r>e?n-r-1:null)}},Vi.prototype.invert=function(){var t=new Vi;return t.appendMappingInverted(this),t},Vi.prototype.map=function(t,e){if(void 0===e&&(e=1),this.mirror)return this._map(t,e,!0);for(var n=this.from;n<this.to;n++)t=this.maps[n].map(t,e);return t},Vi.prototype.mapResult=function(t,e){return void 0===e&&(e=1),this._map(t,e,!1)},Vi.prototype._map=function(t,e,n){for(var r=!1,i=this.from;i<this.to;i++){var o=this.maps[i].mapResult(t,e);if(null!=o.recover){var a=this.getMirror(i);if(null!=a&&a>i&&a<this.to){i=a,t=this.maps[a].recover(o.recover);continue}}o.deleted&&(r=!0),t=o.pos}return n?t:new qi(t,r)},Ui.prototype=Object.create(Error.prototype),Ui.prototype.constructor=Ui,Ui.prototype.name="TransformError";var Hi=function(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Vi},Wi={before:{configurable:!0},docChanged:{configurable:!0}};function Zi(){throw new Error("Override me")}Wi.before.get=function(){return this.docs.length?this.docs[0]:this.doc},Hi.prototype.step=function(t){var e=this.maybeStep(t);if(e.failed)throw new Ui(e.failed);return this},Hi.prototype.maybeStep=function(t){var e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e},Wi.docChanged.get=function(){return this.steps.length>0},Hi.prototype.addStep=function(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e},Object.defineProperties(Hi.prototype,Wi);var Ji=Object.create(null),Yi=function(){};Yi.prototype.apply=function(t){return Zi()},Yi.prototype.getMap=function(){return $i.empty},Yi.prototype.invert=function(t){return Zi()},Yi.prototype.map=function(t){return Zi()},Yi.prototype.merge=function(t){return null},Yi.prototype.toJSON=function(){return Zi()},Yi.fromJSON=function(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");var n=Ji[e.stepType];if(!n)throw new RangeError("No step type "+e.stepType+" defined");return n.fromJSON(t,e)},Yi.jsonID=function(t,e){if(t in Ji)throw new RangeError("Duplicate use of step JSON ID "+t);return Ji[t]=e,e.prototype.jsonID=t,e};var Ki=function(t,e){this.doc=t,this.failed=e};Ki.ok=function(t){return new Ki(t,null)},Ki.fail=function(t){return new Ki(null,t)},Ki.fromReplace=function(t,e,n,r){try{return Ki.ok(t.replace(e,n,r))}catch(i){if(i instanceof Pr)return Ki.fail(i.message);throw i}};var Gi=function(t){function e(e,n,r,i){t.call(this),this.from=e,this.to=n,this.slice=r,this.structure=!!i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){return this.structure&&Qi(t,this.from,this.to)?Ki.fail("Structure replace would overwrite content"):Ki.fromReplace(t,this.from,this.to,this.slice)},e.prototype.getMap=function(){return new $i([this.from,this.to-this.from,this.slice.size])},e.prototype.invert=function(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice)},e.prototype.merge=function(t){if(!(t instanceof e)||t.structure!=this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;var n=this.slice.size+t.slice.size==0?Lr.empty:new Lr(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}var r=this.slice.size+t.slice.size==0?Lr.empty:new Lr(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),r,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new e(n.from,n.to,Lr.fromJSON(t,n.slice),!!n.structure)},e}(Yi);Yi.jsonID("replace",Gi);var Xi=function(t){function e(e,n,r,i,o,a,s){t.call(this),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=!!s}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){if(this.structure&&(Qi(t,this.from,this.gapFrom)||Qi(t,this.gapTo,this.to)))return Ki.fail("Structure gap-replace would overwrite content");var e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return Ki.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,e.content);return n?Ki.fromReplace(t,this.from,this.to,n):Ki.fail("Content does not fit in gap")},e.prototype.getMap=function(){return new $i([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])},e.prototype.invert=function(t){var n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return n.deleted&&r.deleted||i<n.pos||o>r.pos?null:new e(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)},e.prototype.toJSON=function(){var t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(n.from,n.to,n.gapFrom,n.gapTo,Lr.fromJSON(t,n.slice),n.insert,!!n.structure)},e}(Yi);function Qi(t,e,n){for(var r=t.resolve(e),i=n-e,o=r.depth;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0)for(var a=r.node(o).maybeChild(r.indexAfter(o));i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}return!1}function to(t,e,n){return(0==e||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function eo(t){for(var e=t.parent.content.cutByIndex(t.startIndex,t.endIndex),n=t.depth;;--n){var r=t.$from.node(n),i=t.$from.index(n),o=t.$to.indexAfter(n);if(n<t.depth&&r.canReplace(i,o,e))return n;if(0==n||r.type.spec.isolating||!to(r,i,o))break}}function no(t,e,n,r){void 0===r&&(r=t);var i=function(t,e){var n=t.parent,r=t.startIndex,i=t.endIndex,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;var a=o.length?o[0]:e;return n.canReplaceWith(r,i,a)?o:null}(t,e),o=i&&function(t,e){var n=t.parent,r=t.startIndex,i=t.endIndex,o=n.child(r),a=e.contentMatch.findWrapping(o.type);if(!a)return null;for(var s=(a.length?a[a.length-1]:e).contentMatch,u=r;s&&u<i;u++)s=s.matchType(n.child(u).type);if(!s||!s.validEnd)return null;return a}(r,e);return o?i.map(ro).concat({type:e,attrs:n}).concat(o.map(ro)):null}function ro(t){return{type:t,attrs:null}}function io(t,e,n,r){void 0===n&&(n=1);var i=t.resolve(e),o=i.depth-n,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(var s=i.depth-1,u=n-2;s>o;s--,u--){var c=i.node(s),l=i.index(s);if(c.type.spec.isolating)return!1;var h=c.content.cutByIndex(l,c.childCount),f=r&&r[u]||c;if(f!=c&&(h=h.replaceChild(0,f.type.create(f.attrs))),!c.canReplace(l+1,c.childCount)||!f.type.validContent(h))return!1}var d=i.indexAfter(o),p=r&&r[0];return i.node(o).canReplaceWith(d,d,p?p.type:i.node(o+1).type)}function oo(t,e){var n=t.resolve(e),r=n.index();return ao(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function ao(t,e){return t&&e&&!t.isLeaf&&t.canAppend(e)}function so(t,e,n){void 0===n&&(n=-1);for(var r=t.resolve(e),i=r.depth;;i--){var o=void 0,a=void 0,s=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):n>0?(o=r.node(i+1),s++,a=r.node(i).maybeChild(s)):(o=r.node(i).maybeChild(s-1),a=r.node(i+1)),o&&!o.isTextblock&&ao(o,a)&&r.node(i).canReplace(s,s+1))return e;if(0==i)break;e=n<0?r.before(i):r.after(i)}}function uo(t,e,n){var r=t.resolve(e);if(!n.content.size)return e;for(var i=n.content,o=0;o<n.openStart;o++)i=i.firstChild.content;for(var a=1;a<=(0==n.openStart&&n.size?2:1);a++)for(var s=r.depth;s>=0;s--){var u=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,c=r.index(s)+(u>0?1:0);if(1==a?r.node(s).canReplace(c,c,i):r.node(s).contentMatchAt(c).findWrapping(i.firstChild.type))return 0==u?r.pos:u<0?r.before(s+1):r.after(s+1)}return null}function co(t,e,n){for(var r=[],i=0;i<t.childCount;i++){var o=t.child(i);o.content.size&&(o=o.copy(co(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return Mr.fromArray(r)}Yi.jsonID("replaceAround",Xi),Hi.prototype.lift=function(t,e){for(var n=t.$from,r=t.$to,i=t.depth,o=n.before(i+1),a=r.after(i+1),s=o,u=a,c=Mr.empty,l=0,h=i,f=!1;h>e;h--)f||n.index(h)>0?(f=!0,c=Mr.from(n.node(h).copy(c)),l++):s--;for(var d=Mr.empty,p=0,v=i,m=!1;v>e;v--)m||r.after(v+1)<r.end(v)?(m=!0,d=Mr.from(r.node(v).copy(d)),p++):u++;return this.step(new Xi(s,u,o,a,new Lr(c.append(d),l,p),c.size-l,!0))},Hi.prototype.wrap=function(t,e){for(var n=Mr.empty,r=e.length-1;r>=0;r--)n=Mr.from(e[r].type.create(e[r].attrs,n));var i=t.start,o=t.end;return this.step(new Xi(i,o,i,o,new Lr(n,0,0),e.length,!0))},Hi.prototype.setBlockType=function(t,e,n,r){var i=this;if(void 0===e&&(e=t),!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");var o=this.steps.length;return this.doc.nodesBetween(t,e,(function(t,e){if(t.isTextblock&&!t.hasMarkup(n,r)&&function(t,e,n){var r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(i.doc,i.mapping.slice(o).map(e),n)){i.clearIncompatible(i.mapping.slice(o).map(e,1),n);var a=i.mapping.slice(o),s=a.map(e,1),u=a.map(e+t.nodeSize,1);return i.step(new Xi(s,u,s+1,u-1,new Lr(Mr.from(n.create(r,null,t.marks)),0,0),1,!0)),!1}})),this},Hi.prototype.setNodeMarkup=function(t,e,n,r){var i=this.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");e||(e=i.type);var o=e.create(n,null,r||i.marks);if(i.isLeaf)return this.replaceWith(t,t+i.nodeSize,o);if(!e.validContent(i.content))throw new RangeError("Invalid content for node type "+e.name);return this.step(new Xi(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new Lr(Mr.from(o),0,0),1,!0))},Hi.prototype.split=function(t,e,n){void 0===e&&(e=1);for(var r=this.doc.resolve(t),i=Mr.empty,o=Mr.empty,a=r.depth,s=r.depth-e,u=e-1;a>s;a--,u--){i=Mr.from(r.node(a).copy(i));var c=n&&n[u];o=Mr.from(c?c.type.create(c.attrs,o):r.node(a).copy(o))}return this.step(new Gi(t,t,new Lr(i.append(o),e,e),!0))},Hi.prototype.join=function(t,e){void 0===e&&(e=1);var n=new Gi(t-e,t+e,Lr.empty,!0);return this.step(n)};var lo=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new Lr(co(n.content,(function(t,n){return t.isAtom&&n.type.allowsMarkType(e.mark.type)?t.mark(e.mark.addToSet(t.marks)):t}),i),n.openStart,n.openEnd);return Ki.fromReplace(t,this.from,this.to,o)},e.prototype.invert=function(){return new ho(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(Yi);Yi.jsonID("addMark",lo);var ho=function(t){function e(e,n,r){t.call(this),this.from=e,this.to=n,this.mark=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.apply=function(t){var e=this,n=t.slice(this.from,this.to),r=new Lr(co(n.content,(function(t){return t.mark(e.mark.removeFromSet(t.marks))})),n.openStart,n.openEnd);return Ki.fromReplace(t,this.from,this.to,r)},e.prototype.invert=function(){return new lo(this.from,this.to,this.mark)},e.prototype.map=function(t){var n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)},e.prototype.merge=function(t){if(t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from)return new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark)},e.prototype.toJSON=function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}},e.fromJSON=function(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))},e}(Yi);function fo(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}Yi.jsonID("removeMark",ho),Hi.prototype.addMark=function(t,e,n){var r=this,i=[],o=[],a=null,s=null;return this.doc.nodesBetween(t,e,(function(r,u,c){if(r.isInline){var l=r.marks;if(!n.isInSet(l)&&c.type.allowsMarkType(n.type)){for(var h=Math.max(u,t),f=Math.min(u+r.nodeSize,e),d=n.addToSet(l),p=0;p<l.length;p++)l[p].isInSet(d)||(a&&a.to==h&&a.mark.eq(l[p])?a.to=f:i.push(a=new ho(h,f,l[p])));s&&s.to==h?s.to=f:o.push(s=new lo(h,f,n))}}})),i.forEach((function(t){return r.step(t)})),o.forEach((function(t){return r.step(t)})),this},Hi.prototype.removeMark=function(t,e,n){var r=this;void 0===n&&(n=null);var i=[],o=0;return this.doc.nodesBetween(t,e,(function(r,a){if(r.isInline){o++;var s=null;if(n instanceof xi)for(var u,c=r.marks;u=n.isInSet(c);)(s||(s=[])).push(u),c=u.removeFromSet(c);else n?n.isInSet(r.marks)&&(s=[n]):s=r.marks;if(s&&s.length)for(var l=Math.min(a+r.nodeSize,e),h=0;h<s.length;h++){for(var f=s[h],d=void 0,p=0;p<i.length;p++){var v=i[p];v.step==o-1&&f.eq(i[p].style)&&(d=v)}d?(d.to=l,d.step=o):i.push({style:f,from:Math.max(a,t),to:l,step:o})}}})),i.forEach((function(t){return r.step(new ho(t.from,t.to,t.style))})),this},Hi.prototype.clearIncompatible=function(t,e,n){void 0===n&&(n=e.contentMatch);for(var r=this.doc.nodeAt(t),i=[],o=t+1,a=0;a<r.childCount;a++){var s=r.child(a),u=o+s.nodeSize,c=n.matchType(s.type,s.attrs);if(c){n=c;for(var l=0;l<s.marks.length;l++)e.allowsMarkType(s.marks[l].type)||this.step(new ho(o,u,s.marks[l]))}else i.push(new Gi(o,u,Lr.empty));o=u}if(!n.validEnd){var h=n.fillBefore(Mr.empty,!0);this.replace(o,o,new Lr(h,0,0))}for(var f=i.length-1;f>=0;f--)this.step(i[f]);return this},Hi.prototype.replace=function(t,e,n){void 0===e&&(e=t),void 0===n&&(n=Lr.empty);var r=function(t,e,n,r){if(void 0===n&&(n=e),void 0===r&&(r=Lr.empty),e==n&&!r.size)return null;var i=t.resolve(e),o=t.resolve(n);return fo(i,o,r)?new Gi(e,n,r):new po(i,o,r).fit()}(this.doc,t,e,n);return r&&this.step(r),this},Hi.prototype.replaceWith=function(t,e,n){return this.replace(t,e,new Lr(Mr.from(n),0,0))},Hi.prototype.delete=function(t,e){return this.replace(t,e,Lr.empty)},Hi.prototype.insert=function(t,e){return this.replaceWith(t,t,e)};var po=function(t,e,n){this.$to=e,this.$from=t,this.unplaced=n,this.frontier=[];for(var r=0;r<=t.depth;r++){var i=t.node(r);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(r))})}this.placed=Mr.empty;for(var o=t.depth;o>0;o--)this.placed=Mr.from(t.node(o).copy(this.placed))},vo={depth:{configurable:!0}};function mo(t,e,n){return 0==e?t.cutByIndex(n):t.replaceChild(0,t.firstChild.copy(mo(t.firstChild.content,e-1,n)))}function go(t,e,n){return 0==e?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(go(t.lastChild.content,e-1,n)))}function yo(t,e){for(var n=0;n<e;n++)t=t.firstChild.content;return t}function bo(t,e,n){if(e<=0)return t;var r=t.content;return e>1&&(r=r.replaceChild(0,bo(r.firstChild,e-1,1==r.childCount?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(Mr.empty,!0)))),t.copy(r)}function wo(t,e,n,r,i){var o=t.node(e),a=i?t.indexAfter(e):t.index(e);if(a==o.childCount&&!n.compatibleContent(o.type))return null;var s=r.fillBefore(o.content,!0,a);return s&&!function(t,e,n){for(var r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}(n,o.content,a)?s:null}function _o(t,e,n,r,i){if(e<n){var o=t.firstChild;t=t.replaceChild(0,o.copy(_o(o.content,e+1,n,r,o)))}if(e>r){var a=i.contentMatchAt(0),s=a.fillBefore(t).append(t);t=s.append(a.matchFragment(s).fillBefore(Mr.empty,!0))}return t}function xo(t,e){for(var n=[],r=Math.min(t.depth,e.depth);r>=0;r--){var i=t.start(r);if(i<t.pos-(t.depth-r)||e.end(r)>e.pos+(e.depth-r)||t.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;i==e.start(r)&&n.push(r)}return n}function ko(t){return(ko="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)}vo.depth.get=function(){return this.frontier.length-1},po.prototype.fit=function(){for(;this.unplaced.size;){var t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}var e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;for(var o=this.placed,a=r.depth,s=i.depth;a&&s&&1==o.childCount;)o=o.firstChild.content,a--,s--;var u=new Lr(o,a,s);return e>-1?new Xi(r.pos,e,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new Gi(r.pos,i.pos,u):void 0},po.prototype.findFittable=function(){for(var t=1;t<=2;t++)for(var e=this.unplaced.openStart;e>=0;e--)for(var n=void 0,r=(e?(n=yo(this.unplaced.content,e-1).firstChild).content:this.unplaced.content).firstChild,i=this.depth;i>=0;i--){var o=this.frontier[i],a=o.type,s=o.match,u=void 0,c=void 0;if(1==t&&(r?s.matchType(r.type)||(c=s.fillBefore(Mr.from(r),!1)):a.compatibleContent(n.type)))return{sliceDepth:e,frontierDepth:i,parent:n,inject:c};if(2==t&&r&&(u=s.findWrapping(r.type)))return{sliceDepth:e,frontierDepth:i,parent:n,wrap:u};if(n&&s.matchType(n.type))break}},po.prototype.openMore=function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,i=yo(e,n);return!(!i.childCount||i.firstChild.isLeaf)&&(this.unplaced=new Lr(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)},po.prototype.dropNode=function(){var t=this.unplaced,e=t.content,n=t.openStart,r=t.openEnd,i=yo(e,n);if(i.childCount<=1&&n>0){var o=e.size-n<=n+i.size;this.unplaced=new Lr(mo(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new Lr(mo(e,n,1),n,r)},po.prototype.placeNodes=function(t){for(var e=t.sliceDepth,n=t.frontierDepth,r=t.parent,i=t.inject,o=t.wrap;this.depth>n;)this.closeFrontierNode();if(o)for(var a=0;a<o.length;a++)this.openFrontierNode(o[a]);var s=this.unplaced,u=r?r.content:s.content,c=s.openStart-e,l=0,h=[],f=this.frontier[n],d=f.match,p=f.type;if(i){for(var v=0;v<i.childCount;v++)h.push(i.child(v));d=d.matchFragment(i)}for(var m=u.size+e-(s.content.size-s.openEnd);l<u.childCount;){var g=u.child(l),y=d.matchType(g.type);if(!y)break;(++l>1||0==c||g.content.size)&&(d=y,h.push(bo(g.mark(p.allowedMarks(g.marks)),1==l?c:0,l==u.childCount?m:-1)))}var b=l==u.childCount;b||(m=-1),this.placed=go(this.placed,n,Mr.from(h)),this.frontier[n].match=d,b&&m<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var w=0,_=u;w<m;w++){var x=_.lastChild;this.frontier.push({type:x.type,match:x.contentMatchAt(x.childCount)}),_=x.content}this.unplaced=b?0==e?Lr.empty:new Lr(mo(s.content,e-1,1),e-1,m<0?s.openEnd:e-1):new Lr(mo(s.content,e,l),s.openStart,s.openEnd)},po.prototype.mustMoveInline=function(){if(!this.$to.parent.isTextblock||this.$to.end()==this.$to.pos)return-1;var t,e=this.frontier[this.depth];if(!e.type.isTextblock||!wo(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;for(var n=this.$to.depth,r=this.$to.after(n);n>1&&r==this.$to.end(--n);)++r;return r},po.prototype.findCloseLevel=function(t){t:for(var e=Math.min(this.depth,t.depth);e>=0;e--){var n=this.frontier[e],r=n.match,i=n.type,o=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),a=wo(t,e,i,r,o);if(a){for(var s=e-1;s>=0;s--){var u=this.frontier[s],c=u.match,l=wo(t,s,u.type,c,!0);if(!l||l.childCount)continue t}return{depth:e,fit:a,move:o?t.doc.resolve(t.after(e+1)):t}}}},po.prototype.close=function(t){var e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=go(this.placed,e.depth,e.fit)),t=e.move;for(var n=e.depth+1;n<=t.depth;n++){var r=t.node(n),i=r.type.contentMatch.fillBefore(r.content,!0,t.index(n));this.openFrontierNode(r.type,r.attrs,i)}return t},po.prototype.openFrontierNode=function(t,e,n){var r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=go(this.placed,this.depth,Mr.from(t.create(e,n))),this.frontier.push({type:t,match:t.contentMatch})},po.prototype.closeFrontierNode=function(){var t=this.frontier.pop().match.fillBefore(Mr.empty,!0);t.childCount&&(this.placed=go(this.placed,this.frontier.length,t))},Object.defineProperties(po.prototype,vo),Hi.prototype.replaceRange=function(t,e,n){if(!n.size)return this.deleteRange(t,e);var r=this.doc.resolve(t),i=this.doc.resolve(e);if(fo(r,i,n))return this.step(new Gi(t,e,n));var o=xo(r,this.doc.resolve(e));0==o[o.length-1]&&o.pop();var a=-(r.depth+1);o.unshift(a);for(var s=r.depth,u=r.pos-1;s>0;s--,u--){var c=r.node(s).type.spec;if(c.defining||c.isolating)break;o.indexOf(s)>-1?a=s:r.before(s)==u&&o.splice(1,0,-s)}for(var l=o.indexOf(a),h=[],f=n.openStart,d=n.content,p=0;;p++){var v=d.firstChild;if(h.push(v),p==n.openStart)break;d=v.content}f>0&&h[f-1].type.spec.defining&&r.node(l).type!=h[f-1].type?f-=1:f>=2&&h[f-1].isTextblock&&h[f-2].type.spec.defining&&r.node(l).type!=h[f-2].type&&(f-=2);for(var m=n.openStart;m>=0;m--){var g=(m+f+1)%(n.openStart+1),y=h[g];if(y)for(var b=0;b<o.length;b++){var w=o[(b+l)%o.length],_=!0;w<0&&(_=!1,w=-w);var x=r.node(w-1),k=r.index(w-1);if(x.canReplaceWith(k,k,y.type,y.marks))return this.replace(r.before(w),_?i.after(w):e,new Lr(_o(n.content,0,n.openStart,g),g,n.openEnd))}}for(var S=this.steps.length,C=o.length-1;C>=0&&(this.replace(t,e,n),!(this.steps.length>S));C--){var M=o[C];C<0||(t=r.before(M),e=i.after(M))}return this},Hi.prototype.replaceRangeWith=function(t,e,n){if(!n.isInline&&t==e&&this.doc.resolve(t).parent.content.size){var r=function(t,e,n){var r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(0==r.parentOffset)for(var i=r.depth-1;i>=0;i--){var o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(var a=r.depth-1;a>=0;a--){var s=r.indexAfter(a);if(r.node(a).canReplaceWith(s,s,n))return r.after(a+1);if(s<r.node(a).childCount)return null}}(this.doc,t,n.type);null!=r&&(t=e=r)}return this.replaceRange(t,e,new Lr(Mr.from(n),0,0))},Hi.prototype.deleteRange=function(t,e){for(var n=this.doc.resolve(t),r=this.doc.resolve(e),i=xo(n,r),o=0;o<i.length;o++){var a=i[o],s=o==i.length-1;if(s&&0==a||n.node(a).type.contentMatch.validEnd)return this.delete(n.start(a),r.end(a));if(a>0&&(s||n.node(a-1).canReplace(n.index(a-1),r.indexAfter(a-1))))return this.delete(n.before(a),r.after(a))}for(var u=1;u<=n.depth&&u<=r.depth;u++)if(t-n.start(u)==n.depth-u&&e>n.end(u)&&r.end(u)-e!=r.depth-u)return this.delete(n.before(u),e);return this.delete(t,e)};var So=Object.create(null),Co=function(t,e,n){this.ranges=n||[new Eo(t.min(e),t.max(e))],this.$anchor=t,this.$head=e},Mo={anchor:{configurable:!0},head:{configurable:!0},from:{configurable:!0},to:{configurable:!0},$from:{configurable:!0},$to:{configurable:!0},empty:{configurable:!0}};Mo.anchor.get=function(){return this.$anchor.pos},Mo.head.get=function(){return this.$head.pos},Mo.from.get=function(){return this.$from.pos},Mo.to.get=function(){return this.$to.pos},Mo.$from.get=function(){return this.ranges[0].$from},Mo.$to.get=function(){return this.ranges[0].$to},Mo.empty.get=function(){for(var t=this.ranges,e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0},Co.prototype.content=function(){return this.$from.node(0).slice(this.from,this.to,!0)},Co.prototype.replace=function(t,e){void 0===e&&(e=Lr.empty);for(var n=e.content.lastChild,r=null,i=0;i<e.openEnd;i++)r=n,n=n.lastChild;for(var o=t.steps.length,a=this.ranges,s=0;s<a.length;s++){var u=a[s],c=u.$from,l=u.$to,h=t.mapping.slice(o);t.replaceRange(h.map(c.pos),h.map(l.pos),s?Lr.empty:e),0==s&&Ro(t,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}},Co.prototype.replaceWith=function(t,e){for(var n=t.steps.length,r=this.ranges,i=0;i<r.length;i++){var o=r[i],a=o.$from,s=o.$to,u=t.mapping.slice(n),c=u.map(a.pos),l=u.map(s.pos);i?t.deleteRange(c,l):(t.replaceRangeWith(c,l,e),Ro(t,n,e.isInline?-1:1))}},Co.findFrom=function(t,e,n){var r=t.parent.inlineContent?new To(t):No(t.node(0),t.parent,t.pos,t.index(),e,n);if(r)return r;for(var i=t.depth-1;i>=0;i--){var o=e<0?No(t.node(0),t.node(i),t.before(i+1),t.index(i),e,n):No(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,e,n);if(o)return o}},Co.near=function(t,e){return void 0===e&&(e=1),this.findFrom(t,e)||this.findFrom(t,-e)||new Po(t.node(0))},Co.atStart=function(t){return No(t,t,0,0,1)||new Po(t)},Co.atEnd=function(t){return No(t,t,t.content.size,t.childCount,-1)||new Po(t)},Co.fromJSON=function(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=So[e.type];if(!n)throw new RangeError("No selection type "+e.type+" defined");return n.fromJSON(t,e)},Co.jsonID=function(t,e){if(t in So)throw new RangeError("Duplicate use of selection JSON ID "+t);return So[t]=e,e.prototype.jsonID=t,e},Co.prototype.getBookmark=function(){return To.between(this.$anchor,this.$head).getBookmark()},Object.defineProperties(Co.prototype,Mo),Co.prototype.visible=!0;var Eo=function(t,e){this.$from=t,this.$to=e},To=function(t){function e(e,n){void 0===n&&(n=e),t.call(this,e,n)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={$cursor:{configurable:!0}};return n.$cursor.get=function(){return this.$anchor.pos==this.$head.pos?this.$head:null},e.prototype.map=function(n,r){var i=n.resolve(r.map(this.head));if(!i.parent.inlineContent)return t.near(i);var o=n.resolve(r.map(this.anchor));return new e(o.parent.inlineContent?o:i,i)},e.prototype.replace=function(e,n){if(void 0===n&&(n=Lr.empty),t.prototype.replace.call(this,e,n),n==Lr.empty){var r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}},e.prototype.eq=function(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head},e.prototype.getBookmark=function(){return new Ao(this.anchor,this.head)},e.prototype.toJSON=function(){return{type:"text",anchor:this.anchor,head:this.head}},e.fromJSON=function(t,n){if("number"!=typeof n.anchor||"number"!=typeof n.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new e(t.resolve(n.anchor),t.resolve(n.head))},e.create=function(t,e,n){void 0===n&&(n=e);var r=t.resolve(e);return new this(r,n==e?r:t.resolve(n))},e.between=function(n,r,i){var o=n.pos-r.pos;if(i&&!o||(i=o>=0?1:-1),!r.parent.inlineContent){var a=t.findFrom(r,i,!0)||t.findFrom(r,-i,!0);if(!a)return t.near(r,i);r=a.$head}return n.parent.inlineContent||(0==o||(n=(t.findFrom(n,-i,!0)||t.findFrom(n,i,!0)).$anchor).pos<r.pos!=o<0)&&(n=r),new e(n,r)},Object.defineProperties(e.prototype,n),e}(Co);Co.jsonID("text",To);var Ao=function(t,e){this.anchor=t,this.head=e};Ao.prototype.map=function(t){return new Ao(t.map(this.anchor),t.map(this.head))},Ao.prototype.resolve=function(t){return To.between(t.resolve(this.anchor),t.resolve(this.head))};var Oo=function(t){function e(e){var n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);t.call(this,e,r),this.node=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.map=function(n,r){var i=r.mapResult(this.anchor),o=i.deleted,a=i.pos,s=n.resolve(a);return o?t.near(s):new e(s)},e.prototype.content=function(){return new Lr(Mr.from(this.node),0,0)},e.prototype.eq=function(t){return t instanceof e&&t.anchor==this.anchor},e.prototype.toJSON=function(){return{type:"node",anchor:this.anchor}},e.prototype.getBookmark=function(){return new Do(this.anchor)},e.fromJSON=function(t,n){if("number"!=typeof n.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new e(t.resolve(n.anchor))},e.create=function(t,e){return new this(t.resolve(e))},e.isSelectable=function(t){return!t.isText&&!1!==t.type.spec.selectable},e}(Co);Oo.prototype.visible=!1,Co.jsonID("node",Oo);var Do=function(t){this.anchor=t};Do.prototype.map=function(t){var e=t.mapResult(this.anchor),n=e.deleted,r=e.pos;return n?new Ao(r,r):new Do(r)},Do.prototype.resolve=function(t){var e=t.resolve(this.anchor),n=e.nodeAfter;return n&&Oo.isSelectable(n)?new Oo(e):Co.near(e)};var Po=function(t){function e(e){t.call(this,e.resolve(0),e.resolve(e.content.size))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.replace=function(e,n){if(void 0===n&&(n=Lr.empty),n==Lr.empty){e.delete(0,e.doc.content.size);var r=t.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else t.prototype.replace.call(this,e,n)},e.prototype.toJSON=function(){return{type:"all"}},e.fromJSON=function(t){return new e(t)},e.prototype.map=function(t){return new e(t)},e.prototype.eq=function(t){return t instanceof e},e.prototype.getBookmark=function(){return Lo},e}(Co);Co.jsonID("all",Po);var Lo={map:function(){return this},resolve:function(t){return new Po(t)}};function No(t,e,n,r,i,o){if(e.inlineContent)return To.create(t,n);for(var a=r-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){var s=e.child(a);if(s.isAtom){if(!o&&Oo.isSelectable(s))return Oo.create(t,n-(i<0?s.nodeSize:0))}else{var u=No(t,s,n+i,i<0?s.childCount:0,i,o);if(u)return u}n+=s.nodeSize*i}}function Ro(t,e,n){var r=t.steps.length-1;if(!(r<e)){var i,o=t.steps[r];if(o instanceof Gi||o instanceof Xi)t.mapping.maps[r].forEach((function(t,e,n,r){null==i&&(i=r)})),t.setSelection(Co.near(t.doc.resolve(i),n))}}var Io=function(t){function e(e){t.call(this,e.doc),this.time=Date.now(),this.curSelection=e.selection,this.curSelectionFor=0,this.storedMarks=e.storedMarks,this.updated=0,this.meta=Object.create(null)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={selection:{configurable:!0},selectionSet:{configurable:!0},storedMarksSet:{configurable:!0},isGeneric:{configurable:!0},scrolledIntoView:{configurable:!0}};return n.selection.get=function(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection},e.prototype.setSelection=function(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=-3&(1|this.updated),this.storedMarks=null,this},n.selectionSet.get=function(){return(1&this.updated)>0},e.prototype.setStoredMarks=function(t){return this.storedMarks=t,this.updated|=2,this},e.prototype.ensureMarks=function(t){return Dr.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this},e.prototype.addStoredMark=function(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))},e.prototype.removeStoredMark=function(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))},n.storedMarksSet.get=function(){return(2&this.updated)>0},e.prototype.addStep=function(e,n){t.prototype.addStep.call(this,e,n),this.updated=-3&this.updated,this.storedMarks=null},e.prototype.setTime=function(t){return this.time=t,this},e.prototype.replaceSelection=function(t){return this.selection.replace(this,t),this},e.prototype.replaceSelectionWith=function(t,e){var n=this.selection;return!1!==e&&(t=t.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Dr.none))),n.replaceWith(this,t),this},e.prototype.deleteSelection=function(){return this.selection.replace(this),this},e.prototype.insertText=function(t,e,n){void 0===n&&(n=e);var r=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();if(!t)return this.deleteRange(e,n);var i=this.storedMarks;if(!i){var o=this.doc.resolve(e);i=n==e?o.marks():o.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(e,n,r.text(t,i)),this.selection.empty||this.setSelection(Co.near(this.selection.$to)),this},e.prototype.setMeta=function(t,e){return this.meta["string"==typeof t?t:t.key]=e,this},e.prototype.getMeta=function(t){return this.meta["string"==typeof t?t:t.key]},n.isGeneric.get=function(){for(var t in this.meta)return!1;return!0},e.prototype.scrollIntoView=function(){return this.updated|=4,this},n.scrolledIntoView.get=function(){return(4&this.updated)>0},Object.defineProperties(e.prototype,n),e}(Hi);function zo(t,e){return e&&t?t.bind(e):t}var Bo=function(t,e,n){this.name=t,this.init=zo(e.init,n),this.apply=zo(e.apply,n)},jo=[new Bo("doc",{init:function(t){return t.doc||t.schema.topNodeType.createAndFill()},apply:function(t){return t.doc}}),new Bo("selection",{init:function(t,e){return t.selection||Co.atStart(e.doc)},apply:function(t){return t.selection}}),new Bo("storedMarks",{init:function(t){return t.storedMarks||null},apply:function(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Bo("scrollToSelection",{init:function(){return 0},apply:function(t,e){return t.scrolledIntoView?e+1:e}})],Fo=function(t,e){var n=this;this.schema=t,this.fields=jo.concat(),this.plugins=[],this.pluginsByKey=Object.create(null),e&&e.forEach((function(t){if(n.pluginsByKey[t.key])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");n.plugins.push(t),n.pluginsByKey[t.key]=t,t.spec.state&&n.fields.push(new Bo(t.key,t.spec.state,t))}))},qo=function(t){this.config=t},$o={schema:{configurable:!0},plugins:{configurable:!0},tr:{configurable:!0}};$o.schema.get=function(){return this.config.schema},$o.plugins.get=function(){return this.config.plugins},qo.prototype.apply=function(t){return this.applyTransaction(t).state},qo.prototype.filterTransaction=function(t,e){void 0===e&&(e=-1);for(var n=0;n<this.config.plugins.length;n++)if(n!=e){var r=this.config.plugins[n];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,t,this))return!1}return!0},qo.prototype.applyTransaction=function(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};for(var e=[t],n=this.applyInner(t),r=null;;){for(var i=!1,o=0;o<this.config.plugins.length;o++){var a=this.config.plugins[o];if(a.spec.appendTransaction){var s=r?r[o].n:0,u=r?r[o].state:this,c=s<e.length&&a.spec.appendTransaction.call(a,s?e.slice(s):e,u,n);if(c&&n.filterTransaction(c,o)){if(c.setMeta("appendedTransaction",t),!r){r=[];for(var l=0;l<this.config.plugins.length;l++)r.push(l<o?{state:n,n:e.length}:{state:this,n:0})}e.push(c),n=n.applyInner(c),i=!0}r&&(r[o]={state:n,n:e.length})}}if(!i)return{state:n,transactions:e}}},qo.prototype.applyInner=function(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");for(var e=new qo(this.config),n=this.config.fields,r=0;r<n.length;r++){var i=n[r];e[i.name]=i.apply(t,this[i.name],this,e)}for(var o=0;o<Vo.length;o++)Vo[o](this,t,e);return e},$o.tr.get=function(){return new Io(this)},qo.create=function(t){for(var e=new Fo(t.doc?t.doc.type.schema:t.schema,t.plugins),n=new qo(e),r=0;r<e.fields.length;r++)n[e.fields[r].name]=e.fields[r].init(t,n);return n},qo.prototype.reconfigure=function(t){for(var e=new Fo(this.schema,t.plugins),n=e.fields,r=new qo(e),i=0;i<n.length;i++){var o=n[i].name;r[o]=this.hasOwnProperty(o)?this[o]:n[i].init(t,r)}return r},qo.prototype.toJSON=function(t){var e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map((function(t){return t.toJSON()}))),t&&"object"==ko(t))for(var n in t){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");var r=t[n],i=r.spec.state;i&&i.toJSON&&(e[n]=i.toJSON.call(r,this[r.key]))}return e},qo.fromJSON=function(t,e,n){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");var r=new Fo(t.schema,t.plugins),i=new qo(r);return r.fields.forEach((function(r){if("doc"==r.name)i.doc=ti.fromJSON(t.schema,e.doc);else if("selection"==r.name)i.selection=Co.fromJSON(i.doc,e.selection);else if("storedMarks"==r.name)e.storedMarks&&(i.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(n)for(var o in n){var a=n[o],s=a.spec.state;if(a.key==r.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(e,o))return void(i[r.name]=s.fromJSON.call(a,t,e[o],i))}i[r.name]=r.init(t,i)}})),i},qo.addApplyListener=function(t){Vo.push(t)},qo.removeApplyListener=function(t){var e=Vo.indexOf(t);e>-1&&Vo.splice(e,1)},Object.defineProperties(qo.prototype,$o);var Vo=[];function Uo(t,e,n){for(var r in t){var i=t[r];i instanceof Function?i=i.bind(e):"handleDOMEvents"==r&&(i=Uo(i,e,{})),n[r]=i}return n}var Ho=function(t){this.props={},t.props&&Uo(t.props,this,this.props),this.spec=t,this.key=t.key?t.key.key:Zo("plugin")};Ho.prototype.getState=function(t){return t[this.key]};var Wo=Object.create(null);function Zo(t){return t in Wo?t+"$"+ ++Wo[t]:(Wo[t]=0,t+"$")}var Jo=function(t){void 0===t&&(t="key"),this.key=Zo(t)};Jo.prototype.get=function(t){return t.config.pluginsByKey[this.key]},Jo.prototype.getState=function(t){return t[this.key]};var Yo={};if("undefined"!=typeof navigator&&"undefined"!=typeof document){var Ko=/Edge\/(\d+)/.exec(navigator.userAgent),Go=/MSIE \d/.test(navigator.userAgent),Xo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);Yo.mac=/Mac/.test(navigator.platform);var Qo=Yo.ie=!!(Go||Xo||Ko);Yo.ie_version=Go?document.documentMode||6:Xo?+Xo[1]:Ko?+Ko[1]:null,Yo.gecko=!Qo&&/gecko\/(\d+)/i.test(navigator.userAgent),Yo.gecko_version=Yo.gecko&&+(/Firefox\/(\d+)/.exec(navigator.userAgent)||[0,0])[1];var ta=!Qo&&/Chrome\/(\d+)/.exec(navigator.userAgent);Yo.chrome=!!ta,Yo.chrome_version=ta&&+ta[1],Yo.safari=!Qo&&/Apple Computer/.test(navigator.vendor),Yo.ios=Yo.safari&&(/Mobile\/\w+/.test(navigator.userAgent)||navigator.maxTouchPoints>2),Yo.android=/Android \d/.test(navigator.userAgent),Yo.webkit="webkitFontSmoothing"in document.documentElement.style,Yo.webkit_version=Yo.webkit&&+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]}var ea=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},na=function(t){var e=t.parentNode;return e&&11==e.nodeType?e.host:e},ra=null,ia=function(t,e,n){var r=ra||(ra=document.createRange());return r.setEnd(t,null==n?t.nodeValue.length:n),r.setStart(t,e||0),r},oa=function(t,e,n,r){return n&&(sa(t,e,n,r,-1)||sa(t,e,n,r,1))},aa=/^(img|br|input|textarea|hr)$/i;function sa(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:ua(t))){var o=t.parentNode;if(1!=o.nodeType||ca(t)||aa.test(t.nodeName)||"false"==t.contentEditable)return!1;e=ea(t)+(i<0?0:1),t=o}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes[e+(i<0?-1:0)]).contentEditable)return!1;e=i<0?ua(t):0}}}function ua(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function ca(t){for(var e,n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}var la=function(t){var e=t.isCollapsed;return e&&Yo.chrome&&t.rangeCount&&!t.getRangeAt(0).collapsed&&(e=!1),e};function ha(t,e){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function fa(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function da(t,e){return"number"==typeof t?t:t[e]}function pa(t){var e=t.getBoundingClientRect();return{left:e.left,right:e.left+t.clientWidth,top:e.top,bottom:e.top+t.clientHeight}}function va(t,e,n){for(var r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument,a=n||t.dom;a;a=na(a))if(1==a.nodeType){var s=a==o.body||1!=a.nodeType,u=s?fa(o):pa(a),c=0,l=0;if(e.top<u.top+da(r,"top")?l=-(u.top-e.top+da(i,"top")):e.bottom>u.bottom-da(r,"bottom")&&(l=e.bottom-u.bottom+da(i,"bottom")),e.left<u.left+da(r,"left")?c=-(u.left-e.left+da(i,"left")):e.right>u.right-da(r,"right")&&(c=e.right-u.right+da(i,"right")),c||l)if(s)o.defaultView.scrollBy(c,l);else{var h=a.scrollLeft,f=a.scrollTop;l&&(a.scrollTop+=l),c&&(a.scrollLeft+=c);var d=a.scrollLeft-h,p=a.scrollTop-f;e={left:e.left-d,top:e.top-p,right:e.right-d,bottom:e.bottom-p}}if(s)break}}function ma(t){for(var e=[],n=t.ownerDocument;t&&(e.push({dom:t,top:t.scrollTop,left:t.scrollLeft}),t!=n);t=na(t));return e}function ga(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=r.dom,o=r.top,a=r.left;i.scrollTop!=o+e&&(i.scrollTop=o+e),i.scrollLeft!=a&&(i.scrollLeft=a)}}var ya=null;function ba(t,e){for(var n,r,i=2e8,o=0,a=e.top,s=e.top,u=t.firstChild,c=0;u;u=u.nextSibling,c++){var l=void 0;if(1==u.nodeType)l=u.getClientRects();else{if(3!=u.nodeType)continue;l=ia(u).getClientRects()}for(var h=0;h<l.length;h++){var f=l[h];if(f.top<=a&&f.bottom>=s){a=Math.max(f.bottom,a),s=Math.min(f.top,s);var d=f.left>e.left?f.left-e.left:f.right<e.left?e.left-f.right:0;if(d<i){n=u,i=d,r=d&&3==n.nodeType?{left:f.right<e.left?f.right:f.left,top:e.top}:e,1==u.nodeType&&d&&(o=c+(e.left>=(f.left+f.right)/2?1:0));continue}}!n&&(e.left>=f.right&&e.top>=f.top||e.left>=f.left&&e.top>=f.bottom)&&(o=c+1)}}return n&&3==n.nodeType?function(t,e){for(var n=t.nodeValue.length,r=document.createRange(),i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);var o=ka(r,1);if(o.top!=o.bottom&&wa(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}(n,r):!n||i&&1==n.nodeType?{node:t,offset:o}:ba(n,r)}function wa(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function _a(t,e,n){var r=t.childNodes.length;if(r&&n.top<n.bottom)for(var i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){var a=t.childNodes[o];if(1==a.nodeType)for(var s=a.getClientRects(),u=0;u<s.length;u++){var c=s[u];if(wa(e,c))return _a(a,e,c)}if((o=(o+1)%r)==i)break}return t}function xa(t,e){var n,r,i,o,a=t.root;if(a.caretPositionFromPoint)try{var s=a.caretPositionFromPoint(e.left,e.top);s&&(i=(n=s).offsetNode,o=n.offset)}catch(v){}if(!i&&a.caretRangeFromPoint){var u=a.caretRangeFromPoint(e.left,e.top);u&&(i=(r=u).startContainer,o=r.startOffset)}var c,l=a.elementFromPoint(e.left,e.top+1);if(!l||!t.dom.contains(1!=l.nodeType?l.parentNode:l)){var h=t.dom.getBoundingClientRect();if(!wa(e,h))return null;if(!(l=_a(t.dom,e,h)))return null}if(Yo.safari&&l.draggable&&(i=o=null),l=function(t,e){var n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}(l,e),i){if(Yo.gecko&&1==i.nodeType&&(o=Math.min(o,i.childNodes.length))<i.childNodes.length){var f,d=i.childNodes[o];"IMG"==d.nodeName&&(f=d.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&o++}i==t.dom&&o==i.childNodes.length-1&&1==i.lastChild.nodeType&&e.top>i.lastChild.getBoundingClientRect().bottom?c=t.state.doc.content.size:0!=o&&1==i.nodeType&&"BR"==i.childNodes[o-1].nodeName||(c=function(t,e,n,r){for(var i=-1,o=e;o!=t.dom;){var a=t.docView.nearestDesc(o,!0);if(!a)return null;if(a.node.isBlock&&a.parent){var s=a.dom.getBoundingClientRect();if(s.left>r.left||s.top>r.top)i=a.posBefore;else{if(!(s.right<r.left||s.bottom<r.top))break;i=a.posAfter}}o=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n)}(t,i,o,e))}null==c&&(c=function(t,e,n){var r=ba(e,n),i=r.node,o=r.offset,a=-1;if(1==i.nodeType&&!i.firstChild){var s=i.getBoundingClientRect();a=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(i,o,a)}(t,l,e));var p=t.docView.nearestDesc(l,!0);return{pos:c,inside:p?p.posAtStart-p.border:-1}}function ka(t,e){var n=t.getClientRects();return n.length?n[e<0?0:n.length-1]:t.getBoundingClientRect()}var Sa=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Ca(t,e,n){var r=t.docView.domFromPos(e,n<0?-1:1),i=r.node,o=r.offset,a=Yo.webkit||Yo.gecko;if(3==i.nodeType){if(!a||!Sa.test(i.nodeValue)&&(n<0?o:o!=i.nodeValue.length)){var s=o,u=o,c=n<0?1:-1;return n<0&&!o?(u++,c=-1):n>=0&&o==i.nodeValue.length?(s--,c=1):n<0?s--:u++,Ma(ka(ia(i,s,u),c),c<0)}var l=ka(ia(i,o,o),n);if(Yo.gecko&&o&&/\s/.test(i.nodeValue[o-1])&&o<i.nodeValue.length){var h=ka(ia(i,o-1,o-1),-1);if(h.top==l.top){var f=ka(ia(i,o,o+1),-1);if(f.top!=l.top)return Ma(f,f.left<h.left)}}return l}if(!t.state.doc.resolve(e).parent.inlineContent){if(o&&(n<0||o==ua(i))){var d=i.childNodes[o-1];if(1==d.nodeType)return Ea(d.getBoundingClientRect(),!1)}if(o<ua(i)){var p=i.childNodes[o];if(1==p.nodeType)return Ea(p.getBoundingClientRect(),!0)}return Ea(i.getBoundingClientRect(),n>=0)}if(o&&(n<0||o==ua(i))){var v=i.childNodes[o-1],m=3==v.nodeType?ia(v,ua(v)-(a?0:1)):1!=v.nodeType||"BR"==v.nodeName&&v.nextSibling?null:v;if(m)return Ma(ka(m,1),!1)}if(o<ua(i)){var g=i.childNodes[o],y=3==g.nodeType?ia(g,0,a?0:1):1==g.nodeType?g:null;if(y)return Ma(ka(y,-1),!0)}return Ma(ka(3==i.nodeType?ia(i):i,-n),n>=0)}function Ma(t,e){if(0==t.width)return t;var n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Ea(t,e){if(0==t.height)return t;var n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Ta(t,e,n){var r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}var Aa=/[\u0590-\u08ac]/;var Oa=null,Da=null,Pa=!1;function La(t,e,n){return Oa==e&&Da==n?Pa:(Oa=e,Da=n,Pa="up"==n||"down"==n?function(t,e,n){var r=e.selection,i="up"==n?r.$from:r.$to;return Ta(t,e,(function(){for(var e=t.docView.domFromPos(i.pos,"up"==n?-1:1).node;;){var r=t.docView.nearestDesc(e,!0);if(!r)break;if(r.node.isBlock){e=r.dom;break}e=r.dom.parentNode}for(var o=Ca(t,i.pos,1),a=e.firstChild;a;a=a.nextSibling){var s=void 0;if(1==a.nodeType)s=a.getClientRects();else{if(3!=a.nodeType)continue;s=ia(a,0,a.nodeValue.length).getClientRects()}for(var u=0;u<s.length;u++){var c=s[u];if(c.bottom>c.top&&("up"==n?c.bottom<o.top+1:c.top>o.bottom-1))return!1}}return!0}))}(t,e,n):function(t,e,n){var r=e.selection.$head;if(!r.parent.isTextblock)return!1;var i=r.parentOffset,o=!i,a=i==r.parent.content.size,s=getSelection();return Aa.test(r.parent.textContent)&&s.modify?Ta(t,e,(function(){var e=s.getRangeAt(0),i=s.focusNode,o=s.focusOffset,a=s.caretBidiLevel;s.modify("move",n,"character");var u=!(r.depth?t.docView.domAfterPos(r.before()):t.dom).contains(1==s.focusNode.nodeType?s.focusNode:s.focusNode.parentNode)||i==s.focusNode&&o==s.focusOffset;return s.removeAllRanges(),s.addRange(e),null!=a&&(s.caretBidiLevel=a),u})):"left"==n||"backward"==n?o:a}(t,e,n))}var Na=function(t,e,n,r){this.parent=t,this.children=e,this.dom=n,n.pmViewDesc=this,this.contentDOM=r,this.dirty=0},Ra={beforePosition:{configurable:!0},size:{configurable:!0},border:{configurable:!0},posBefore:{configurable:!0},posAtStart:{configurable:!0},posAfter:{configurable:!0},posAtEnd:{configurable:!0},contentLost:{configurable:!0},domAtom:{configurable:!0}};Na.prototype.matchesWidget=function(){return!1},Na.prototype.matchesMark=function(){return!1},Na.prototype.matchesNode=function(){return!1},Na.prototype.matchesHack=function(){return!1},Ra.beforePosition.get=function(){return!1},Na.prototype.parseRule=function(){return null},Na.prototype.stopEvent=function(){return!1},Ra.size.get=function(){for(var t=0,e=0;e<this.children.length;e++)t+=this.children[e].size;return t},Ra.border.get=function(){return 0},Na.prototype.destroy=function(){this.parent=null,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=null);for(var t=0;t<this.children.length;t++)this.children[t].destroy()},Na.prototype.posBeforeChild=function(t){for(var e=0,n=this.posAtStart;e<this.children.length;e++){var r=this.children[e];if(r==t)return n;n+=r.size}},Ra.posBefore.get=function(){return this.parent.posBeforeChild(this)},Ra.posAtStart.get=function(){return this.parent?this.parent.posBeforeChild(this)+this.border:0},Ra.posAfter.get=function(){return this.posBefore+this.size},Ra.posAtEnd.get=function(){return this.posAtStart+this.size-2*this.border},Na.prototype.localPosFromDOM=function(t,e,n){if(this.contentDOM&&this.contentDOM.contains(1==t.nodeType?t:t.parentNode)){if(n<0){var r,i;if(t==this.contentDOM)r=t.childNodes[e-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;r=t.previousSibling}for(;r&&(!(i=r.pmViewDesc)||i.parent!=this);)r=r.previousSibling;return r?this.posBeforeChild(i)+i.size:this.posAtStart}var o,a;if(t==this.contentDOM)o=t.childNodes[e];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;o=t.nextSibling}for(;o&&(!(a=o.pmViewDesc)||a.parent!=this);)o=o.nextSibling;return o?this.posBeforeChild(a):this.posAtEnd}var s;if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(var u=t;;u=u.parentNode){if(u==this.dom){s=!1;break}if(u.parentNode.firstChild!=u)break}if(null==s&&e==t.childNodes.length)for(var c=t;;c=c.parentNode){if(c==this.dom){s=!0;break}if(c.parentNode.lastChild!=c)break}}return(null==s?n>0:s)?this.posAtEnd:this.posAtStart},Na.prototype.nearestDesc=function(t,e){for(var n=!0,r=t;r;r=r.parentNode){var i=this.getDesc(r);if(i&&(!e||i.node)){if(!n||!i.nodeDOM||(1==i.nodeDOM.nodeType?i.nodeDOM.contains(1==t.nodeType?t:t.parentNode):i.nodeDOM==t))return i;n=!1}}},Na.prototype.getDesc=function(t){for(var e=t.pmViewDesc,n=e;n;n=n.parent)if(n==this)return e},Na.prototype.posFromDOM=function(t,e,n){for(var r=t;r;r=r.parentNode){var i=this.getDesc(r);if(i)return i.localPosFromDOM(t,e,n)}return-1},Na.prototype.descAt=function(t){for(var e=0,n=0;e<this.children.length;e++){var r=this.children[e],i=n+r.size;if(n==t&&i!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(t<i)return r.descAt(t-n-r.border);n=i}},Na.prototype.domFromPos=function(t,e){if(!this.contentDOM)return{node:this.dom,offset:0};for(var n=0,r=0,i=!0;;r++,i=!1){for(;r<this.children.length&&(this.children[r].beforePosition||this.children[r].dom.parentNode!=this.contentDOM);)n+=this.children[r++].size;var o=r==this.children.length?null:this.children[r];if(n==t&&(0==e||!o||!o.size||o.border||e<0&&i)||o&&o.domAtom&&t<n+o.size)return{node:this.contentDOM,offset:o?ea(o.dom):this.contentDOM.childNodes.length};if(!o)throw new Error("Invalid position "+t);var a=n+o.size;if(!o.domAtom&&(e<0&&!o.border?a>=t:a>t))return o.domFromPos(t-n-o.border,e);n=a}},Na.prototype.parseRange=function(t,e,n){if(void 0===n&&(n=0),0==this.children.length)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,i=-1,o=n,a=0;;a++){var s=this.children[a],u=o+s.size;if(-1==r&&t<=u){var c=o+s.border;if(t>=c&&e<=u-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(t,e,c);t=o;for(var l=a;l>0;l--){var h=this.children[l-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){r=ea(h.dom)+1;break}t-=h.size}-1==r&&(r=0)}if(r>-1&&(u>e||a==this.children.length-1)){e=u;for(var f=a+1;f<this.children.length;f++){var d=this.children[f];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){i=ea(d.dom);break}e+=d.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=u}return{node:this.contentDOM,from:t,to:e,fromOffset:r,toOffset:i}},Na.prototype.emptyChildAt=function(t){if(this.border||!this.contentDOM||!this.children.length)return!1;var e=this.children[t<0?0:this.children.length-1];return 0==e.size||e.emptyChildAt(t)},Na.prototype.domAfterPos=function(t){var e=this.domFromPos(t,0),n=e.node,r=e.offset;if(1!=n.nodeType||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]},Na.prototype.setSelection=function(t,e,n,r){for(var i=Math.min(t,e),o=Math.max(t,e),a=0,s=0;a<this.children.length;a++){var u=this.children[a],c=s+u.size;if(i>s&&o<c)return u.setSelection(t-s-u.border,e-s-u.border,n,r);s=c}var l=this.domFromPos(t,t?-1:1),h=e==t?l:this.domFromPos(e,e?-1:1),f=n.getSelection(),d=!1;if((Yo.gecko||Yo.safari)&&t==e){var p=l.node,v=l.offset;if(3==p.nodeType)(d=v&&"\n"==p.nodeValue[v-1])&&v==p.nodeValue.length&&p.nextSibling&&"BR"==p.nextSibling.nodeName&&(l=h={node:p.parentNode,offset:ea(p)+1});else{var m=p.childNodes[v-1];d=m&&("BR"==m.nodeName||"false"==m.contentEditable)}}if(r||d&&Yo.safari||!oa(l.node,l.offset,f.anchorNode,f.anchorOffset)||!oa(h.node,h.offset,f.focusNode,f.focusOffset)){var g=!1;if((f.extend||t==e)&&!d){f.collapse(l.node,l.offset);try{t!=e&&f.extend(h.node,h.offset),g=!0}catch(M_){if(!(M_ instanceof DOMException))throw M_}}if(!g){if(t>e){var y=l;l=h,h=y}var b=document.createRange();b.setEnd(h.node,h.offset),b.setStart(l.node,l.offset),f.removeAllRanges(),f.addRange(b)}}},Na.prototype.ignoreMutation=function(t){return!this.contentDOM&&"selection"!=t.type},Ra.contentLost.get=function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)},Na.prototype.markDirty=function(t,e){for(var n=0,r=0;r<this.children.length;r++){var i=this.children[r],o=n+i.size;if(n==o?t<=o&&e>=n:t<o&&e>n){var a=n+i.border,s=o-i.border;if(t>=a&&e<=s)return this.dirty=t==n||e==o?2:1,void(t!=a||e!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(t-a,e-a):i.dirty=3);i.dirty=3}n=o}this.dirty=2},Na.prototype.markParentsDirty=function(){for(var t=1,e=this.parent;e;e=e.parent,t++){var n=1==t?2:1;e.dirty<n&&(e.dirty=n)}},Ra.domAtom.get=function(){return!1},Object.defineProperties(Na.prototype,Ra);var Ia=[],za=function(t){function e(e,n,r,i){var o,a=n.type.toDOM;if("function"==typeof a&&(a=a(r,(function(){return o?o.parent?o.parent.posBeforeChild(o):void 0:i}))),!n.type.spec.raw){if(1!=a.nodeType){var s=document.createElement("span");s.appendChild(a),a=s}a.contentEditable=!1,a.classList.add("ProseMirror-widget")}t.call(this,e,Ia,a,null),this.widget=n,o=this}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={beforePosition:{configurable:!0},domAtom:{configurable:!0}};return n.beforePosition.get=function(){return this.widget.type.side<0},e.prototype.matchesWidget=function(t){return 0==this.dirty&&t.type.eq(this.widget.type)},e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.stopEvent=function(t){var e=this.widget.spec.stopEvent;return!!e&&e(t)},e.prototype.ignoreMutation=function(t){return"selection"!=t.type||this.widget.spec.ignoreSelection},n.domAtom.get=function(){return!0},Object.defineProperties(e.prototype,n),e}(Na),Ba=function(t){function e(e,n,r,i){t.call(this,e,Ia,n,null),this.textDOM=r,this.text=i}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={size:{configurable:!0}};return n.size.get=function(){return this.text.length},e.prototype.localPosFromDOM=function(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e},e.prototype.domFromPos=function(t){return{node:this.textDOM,offset:t}},e.prototype.ignoreMutation=function(t){return"characterData"===t.type&&t.target.nodeValue==t.oldValue},Object.defineProperties(e.prototype,n),e}(Na),ja=function(t){function e(e,n,r,i){t.call(this,e,[],r,i),this.mark=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.create=function(t,n,r,i){var o=i.nodeViews[n.type.name],a=o&&o(n,i,r);return a&&a.dom||(a=Ii.renderSpec(document,n.type.spec.toDOM(n,r))),new e(t,n,a.dom,a.contentDOM||a.dom)},e.prototype.parseRule=function(){return{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}},e.prototype.matchesMark=function(t){return 3!=this.dirty&&this.mark.eq(t)},e.prototype.markDirty=function(e,n){if(t.prototype.markDirty.call(this,e,n),0!=this.dirty){for(var r=this.parent;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}},e.prototype.slice=function(t,n,r){var i=e.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;n<a&&(o=ns(o,n,a,r)),t>0&&(o=ns(o,0,t,r));for(var s=0;s<o.length;s++)o[s].parent=i;return i.children=o,i},e}(Na),Fa=function(t){function e(e,n,r,i,o,a,s,u,c){t.call(this,e,n.isLeaf?Ia:[],o,a),this.nodeDOM=s,this.node=n,this.outerDeco=r,this.innerDeco=i,a&&this.updateChildren(u,c)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={size:{configurable:!0},border:{configurable:!0},domAtom:{configurable:!0}};return e.create=function(t,n,r,i,o,a){var s,u,c=o.nodeViews[n.type.name],l=c&&c(n,o,(function(){return u?u.parent?u.parent.posBeforeChild(u):void 0:a}),r),h=l&&l.dom,f=l&&l.contentDOM;if(n.isText)if(h){if(3!=h.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else h=document.createTextNode(n.text);else h||(h=(s=Ii.renderSpec(document,n.type.spec.toDOM(n))).dom,f=s.contentDOM);f||n.isText||"BR"==h.nodeName||(h.hasAttribute("contenteditable")||(h.contentEditable=!1),n.type.spec.draggable&&(h.draggable=!0));var d=h;return h=Ga(h,r,n),l?u=new Ua(t,n,r,i,h,f,d,l,o,a+1):n.isText?new $a(t,n,r,i,h,d,o):new e(t,n,r,i,h,f,d,o,a+1)},e.prototype.parseRule=function(){var t=this;if(this.node.type.spec.reparseInView)return null;var e={node:this.node.type.name,attrs:this.node.attrs};return this.node.type.spec.code&&(e.preserveWhitespace="full"),this.contentDOM&&!this.contentLost?e.contentElement=this.contentDOM:e.getContent=function(){return t.contentDOM?Mr.empty:t.node.content},e},e.prototype.matchesNode=function(t,e,n){return 0==this.dirty&&t.eq(this.node)&&Xa(e,this.outerDeco)&&n.eq(this.innerDeco)},n.size.get=function(){return this.node.nodeSize},n.border.get=function(){return this.node.isLeaf?0:1},e.prototype.updateChildren=function(t,e){var n=this,r=this.node.inlineContent,i=e,o=r&&t.composing&&this.localCompositionNode(t,e),a=new ts(this,o&&o.node);!function(t,e,n,r){var i=e.locals(t),o=0;if(0==i.length){for(var a=0;a<t.childCount;a++){var s=t.child(a);r(s,i,e.forChild(o,s),a),o+=s.nodeSize}return}for(var u=0,c=[],l=null,h=0;;){if(u<i.length&&i[u].to==o){for(var f=i[u++],d=void 0;u<i.length&&i[u].to==o;)(d||(d=[f])).push(i[u++]);if(d){d.sort(es);for(var p=0;p<d.length;p++)n(d[p],h,!!l)}else n(f,h,!!l)}var v=void 0,m=void 0;if(l)m=-1,v=l,l=null;else{if(!(h<t.childCount))break;m=h,v=t.child(h++)}for(var g=0;g<c.length;g++)c[g].to<=o&&c.splice(g--,1);for(;u<i.length&&i[u].from<=o&&i[u].to>o;)c.push(i[u++]);var y=o+v.nodeSize;if(v.isText){var b=y;u<i.length&&i[u].from<b&&(b=i[u].from);for(var w=0;w<c.length;w++)c[w].to<b&&(b=c[w].to);b<y&&(l=v.cut(b-o),v=v.cut(0,b-o),y=b,m=-1)}r(v,c.length?v.isInline&&!v.isLeaf?c.filter((function(t){return!t.inline})):c.slice():Ia,e.forChild(o,v),m),o=y}}(this.node,this.innerDeco,(function(e,o,s){e.spec.marks?a.syncToMarks(e.spec.marks,r,t):e.type.side>=0&&!s&&a.syncToMarks(o==n.node.childCount?Dr.none:n.node.child(o).marks,r,t),a.placeWidget(e,t,i)}),(function(e,n,o,s){a.syncToMarks(e.marks,r,t),a.findNodeMatch(e,n,o,s)||a.updateNextNode(e,n,o,t,s)||a.addNode(e,n,o,t,i),i+=e.nodeSize})),a.syncToMarks(Ia,r,t),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(o&&this.protectLocalComposition(t,o),Ha(this.contentDOM,this.children,t),Yo.ios&&function(t){if("UL"==t.nodeName||"OL"==t.nodeName){var e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}(this.dom))},e.prototype.localCompositionNode=function(t,e){var n=t.state.selection,r=n.from,i=n.to;if(!(!(t.state.selection instanceof To)||r<e||i>e+this.node.content.size)){var o=t.root.getSelection(),a=function(t,e){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&e>0){if(t.childNodes.length>e&&3==t.childNodes[e].nodeType)return t.childNodes[e];e=ua(t=t.childNodes[e-1])}else{if(!(1==t.nodeType&&e<t.childNodes.length))return null;t=t.childNodes[e],e=0}}}(o.focusNode,o.focusOffset);if(a&&this.dom.contains(a.parentNode)){var s=a.nodeValue,u=function(t,e,n,r){for(var i=0,o=0;i<t.childCount&&o<=r;){var a=t.child(i++),s=o;if(o+=a.nodeSize,a.isText){for(var u=a.text;i<t.childCount;){var c=t.child(i++);if(o+=c.nodeSize,!c.isText)break;u+=c.text}if(o>=n){var l=u.lastIndexOf(e,r-s);if(l>=0&&l+e.length+s>=n)return s+l}}}return-1}(this.node.content,s,r-e,i-e);return u<0?null:{node:a,pos:u,text:s}}}},e.prototype.protectLocalComposition=function(t,e){var n=e.node,r=e.pos,i=e.text;if(!this.getDesc(n)){for(var o=n;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=null)}var a=new Ba(this,o,n,i);t.compositionNodes.push(a),this.children=ns(this.children,r,r+i.length,t,a)}},e.prototype.update=function(t,e,n,r){return!(3==this.dirty||!t.sameMarkup(this.node))&&(this.updateInner(t,e,n,r),!0)},e.prototype.updateInner=function(t,e,n,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0},e.prototype.updateOuterDeco=function(t){if(!Xa(t,this.outerDeco)){var e=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Ya(this.dom,this.nodeDOM,Ja(this.outerDeco,this.node,e),Ja(t,this.node,e)),this.dom!=n&&(n.pmViewDesc=null,this.dom.pmViewDesc=this),this.outerDeco=t}},e.prototype.selectNode=function(){this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)},e.prototype.deselectNode=function(){this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")},n.domAtom.get=function(){return this.node.isAtom},Object.defineProperties(e.prototype,n),e}(Na);function qa(t,e,n,r,i){return Ga(r,e,t),new Fa(null,t,e,n,r,r,r,i,0)}var $a=function(t){function e(e,n,r,i,o,a,s){t.call(this,e,n,r,i,o,null,a,s)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={domAtom:{configurable:!0}};return e.prototype.parseRule=function(){for(var t=this.nodeDOM.parentNode;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}},e.prototype.update=function(t,e,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node))&&(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=0,!0)},e.prototype.inParent=function(){for(var t=this.parent.contentDOM,e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1},e.prototype.domFromPos=function(t){return{node:this.nodeDOM,offset:t}},e.prototype.localPosFromDOM=function(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):t.prototype.localPosFromDOM.call(this,e,n,r)},e.prototype.ignoreMutation=function(t){return"characterData"!=t.type&&"selection"!=t.type},e.prototype.slice=function(t,n,r){var i=this.node.cut(t,n),o=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)},n.domAtom.get=function(){return!1},Object.defineProperties(e.prototype,n),e}(Fa),Va=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={domAtom:{configurable:!0}};return e.prototype.parseRule=function(){return{ignore:!0}},e.prototype.matchesHack=function(){return 0==this.dirty},n.domAtom.get=function(){return!0},Object.defineProperties(e.prototype,n),e}(Na),Ua=function(t){function e(e,n,r,i,o,a,s,u,c,l){t.call(this,e,n,r,i,o,a,s,c,l),this.spec=u}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.update=function(e,n,r,i){if(3==this.dirty)return!1;if(this.spec.update){var o=this.spec.update(e,n);return o&&this.updateInner(e,n,r,i),o}return!(!this.contentDOM&&!e.isLeaf)&&t.prototype.update.call(this,e,n,r,i)},e.prototype.selectNode=function(){this.spec.selectNode?this.spec.selectNode():t.prototype.selectNode.call(this)},e.prototype.deselectNode=function(){this.spec.deselectNode?this.spec.deselectNode():t.prototype.deselectNode.call(this)},e.prototype.setSelection=function(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r):t.prototype.setSelection.call(this,e,n,r,i)},e.prototype.destroy=function(){this.spec.destroy&&this.spec.destroy(),t.prototype.destroy.call(this)},e.prototype.stopEvent=function(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)},e.prototype.ignoreMutation=function(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):t.prototype.ignoreMutation.call(this,e)},e}(Fa);function Ha(t,e,n){for(var r=t.firstChild,i=!1,o=0;o<e.length;o++){var a=e[o],s=a.dom;if(s.parentNode==t){for(;s!=r;)r=Qa(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(s,r);if(a instanceof ja){var u=r?r.previousSibling:t.lastChild;Ha(a.contentDOM,a.children,n),r=u?u.nextSibling:t.firstChild}}for(;r;)r=Qa(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}function Wa(t){t&&(this.nodeName=t)}Wa.prototype=Object.create(null);var Za=[new Wa];function Ja(t,e,n){if(0==t.length)return Za;for(var r=n?Za[0]:new Wa,i=[r],o=0;o<t.length;o++){var a=t[o].type.attrs;if(a)for(var s in a.nodeName&&i.push(r=new Wa(a.nodeName)),a){var u=a[s];null!=u&&(n&&1==i.length&&i.push(r=new Wa(e.isInline?"span":"div")),"class"==s?r.class=(r.class?r.class+" ":"")+u:"style"==s?r.style=(r.style?r.style+";":"")+u:"nodeName"!=s&&(r[s]=u))}}return i}function Ya(t,e,n,r){if(n==Za&&r==Za)return e;for(var i=e,o=0;o<r.length;o++){var a=r[o],s=n[o];if(o){var u=void 0;s&&s.nodeName==a.nodeName&&i!=t&&(u=i.parentNode)&&u.tagName.toLowerCase()==a.nodeName||((u=document.createElement(a.nodeName)).pmIsDeco=!0,u.appendChild(i),s=Za[0]),i=u}Ka(i,s||Za[0],a)}return i}function Ka(t,e,n){for(var r in e)"class"==r||"style"==r||"nodeName"==r||r in n||t.removeAttribute(r);for(var i in n)"class"!=i&&"style"!=i&&"nodeName"!=i&&n[i]!=e[i]&&t.setAttribute(i,n[i]);if(e.class!=n.class){for(var o=e.class?e.class.split(" "):Ia,a=n.class?n.class.split(" "):Ia,s=0;s<o.length;s++)-1==a.indexOf(o[s])&&t.classList.remove(o[s]);for(var u=0;u<a.length;u++)-1==o.indexOf(a[u])&&t.classList.add(a[u])}if(e.style!=n.style){if(e.style)for(var c,l=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;c=l.exec(e.style);)t.style.removeProperty(c[1]);n.style&&(t.style.cssText+=n.style)}}function Ga(t,e,n){return Ya(t,t,Za,Ja(e,n,1!=t.nodeType))}function Xa(t,e){if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function Qa(t){var e=t.nextSibling;return t.parentNode.removeChild(t),e}var ts=function(t,e){this.top=t,this.lock=e,this.index=0,this.stack=[],this.changed=!1;var n=function(t,e){for(var n=[],r=t.childCount,i=e.length-1;r>0&&i>=0;i--){var o=e[i],a=o.node;if(a){if(a!=t.child(r-1))break;n.push(o),--r}}return{nodes:n.reverse(),offset:r}}(t.node.content,t.children);this.preMatched=n.nodes,this.preMatchOffset=n.offset};function es(t,e){return t.type.side-e.type.side}function ns(t,e,n,r,i){for(var o=[],a=0,s=0;a<t.length;a++){var u=t[a],c=s,l=s+=u.size;c>=n||l<=e?o.push(u):(c<e&&o.push(u.slice(0,e-c,r)),i&&(o.push(i),i=null),l>n&&o.push(u.slice(n-c,u.size,r)))}return o}function rs(t,e){var n=t.root.getSelection(),r=t.state.doc;if(!n.focusNode)return null;var i=t.docView.nearestDesc(n.focusNode),o=i&&0==i.size,a=t.docView.posFromDOM(n.focusNode,n.focusOffset);if(a<0)return null;var s,u,c=r.resolve(a);if(la(n)){for(s=c;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&Oo.isSelectable(i.node)&&i.parent&&(!i.node.isInline||!function(t,e,n){for(var r=0==e,i=e==ua(t);r||i;){if(t==n)return!0;var o=ea(t);if(!(t=t.parentNode))return!1;r=r&&0==o,i=i&&o==ua(t)}}(n.focusNode,n.focusOffset,i.dom))){var l=i.posBefore;u=new Oo(a==l?c:r.resolve(l))}}else{var h=t.docView.posFromDOM(n.anchorNode,n.anchorOffset);if(h<0)return null;s=r.resolve(h)}u||(u=fs(t,s,c,"pointer"==e||t.state.selection.head<c.pos&&!o?1:-1));return u}function is(t,e){var n=t.state.selection;if(ls(t,n),t.editable?t.hasFocus():ds(t)&&document.activeElement&&document.activeElement.contains(t.dom)){if(t.domObserver.disconnectSelection(),t.cursorWrapper)!function(t){var e=t.root.getSelection(),n=document.createRange(),r=t.cursorWrapper.dom,i="IMG"==r.nodeName;i?n.setEnd(r.parentNode,ea(r)+1):n.setEnd(r,0);n.collapse(!1),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&Yo.ie&&Yo.ie_version<=11&&(r.disabled=!0,r.disabled=!1)}(t);else{var r,i,o=n.anchor,a=n.head;!as||n instanceof To||(n.$from.parent.inlineContent||(r=ss(t,n.from)),n.empty||n.$from.parent.inlineContent||(i=ss(t,n.to))),t.docView.setSelection(o,a,t.root,e),as&&(r&&cs(r),i&&cs(i)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(t){var e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.hideSelectionGuard);var n=t.root.getSelection(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.hideSelectionGuard=function(){n.anchorNode==r&&n.anchorOffset==i||(e.removeEventListener("selectionchange",t.hideSelectionGuard),t.dom.classList.remove("ProseMirror-hideselection"))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}ts.prototype.getPreMatch=function(t){return t>=this.preMatchOffset?this.preMatched[t-this.preMatchOffset]:null},ts.prototype.destroyBetween=function(t,e){if(t!=e){for(var n=t;n<e;n++)this.top.children[n].destroy();this.top.children.splice(t,e-t),this.changed=!0}},ts.prototype.destroyRest=function(){this.destroyBetween(this.index,this.top.children.length)},ts.prototype.syncToMarks=function(t,e,n){for(var r=0,i=this.stack.length>>1,o=Math.min(i,t.length);r<o&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(t[r])&&!1!==t[r].type.spec.spanning;)r++;for(;r<i;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<t.length;){this.stack.push(this.top,this.index+1);for(var a=-1,s=this.index;s<Math.min(this.index+3,this.top.children.length);s++)if(this.top.children[s].matchesMark(t[i])){a=s;break}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{var u=ja.create(this.top,t[i],e,n);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,i++}},ts.prototype.findNodeMatch=function(t,e,n,r){var i=-1,o=r<0?void 0:this.getPreMatch(r),a=this.top.children;if(o&&o.matchesNode(t,e,n))i=a.indexOf(o);else for(var s=this.index,u=Math.min(a.length,s+5);s<u;s++){var c=a[s];if(c.matchesNode(t,e,n)&&this.preMatched.indexOf(c)<0){i=s;break}}return!(i<0)&&(this.destroyBetween(this.index,i),this.index++,!0)},ts.prototype.updateNextNode=function(t,e,n,r,i){for(var o=this.index;o<this.top.children.length;o++){var a=this.top.children[o];if(a instanceof Fa){var s=this.preMatched.indexOf(a);if(s>-1&&s+this.preMatchOffset!=i)return!1;var u=a.dom;if(!(this.lock&&(u==this.lock||1==u.nodeType&&u.contains(this.lock.parentNode))&&!(t.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==t.text&&3!=a.dirty&&Xa(e,a.outerDeco)))&&a.update(t,e,n,r))return this.destroyBetween(this.index,o),a.dom!=u&&(this.changed=!0),this.index++,!0;break}}return!1},ts.prototype.addNode=function(t,e,n,r,i){this.top.children.splice(this.index++,0,Fa.create(this.top,t,e,n,r,i)),this.changed=!0},ts.prototype.placeWidget=function(t,e,n){var r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(t)||t!=r.widget&&r.widget.type.toDOM.parentNode){var i=new za(this.top,t,e,n);this.top.children.splice(this.index++,0,i),this.changed=!0}else this.index++},ts.prototype.addTextblockHacks=function(){for(var t=this.top.children[this.index-1];t instanceof ja;)t=t.children[t.children.length-1];if(!t||!(t instanceof $a)||/\n$/.test(t.node.text))if(this.index<this.top.children.length&&this.top.children[this.index].matchesHack())this.index++;else{var e=document.createElement("br");this.top.children.splice(this.index++,0,new Va(this.top,Ia,e,null)),this.changed=!0}};var as=Yo.safari||Yo.chrome&&Yo.chrome_version<63;function ss(t,e){var n=t.docView.domFromPos(e,0),r=n.node,i=n.offset,o=i<r.childNodes.length?r.childNodes[i]:null,a=i?r.childNodes[i-1]:null;if(Yo.safari&&o&&"false"==o.contentEditable)return us(o);if((!o||"false"==o.contentEditable)&&(!a||"false"==a.contentEditable)){if(o)return us(o);if(a)return us(a)}}function us(t){return t.contentEditable="true",Yo.safari&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function cs(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function ls(t,e){if(e instanceof Oo){var n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(hs(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else hs(t)}function hs(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=null)}function fs(t,e,n,r){return t.someProp("createSelectionBetween",(function(r){return r(t,e,n)}))||To.between(e,n,r)}function ds(t){var e=t.root.getSelection();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(n){return!1}}function ps(t,e){var n=t.selection,r=n.$anchor,i=n.$head,o=e>0?r.max(i):r.min(i),a=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return a&&Co.findFrom(a,e)}function vs(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function ms(t,e,n){var r=t.state.selection;if(!(r instanceof To)){if(r instanceof Oo&&r.node.isInline)return vs(t,new To(e>0?r.$to:r.$from));var i=ps(t.state,e);return!!i&&vs(t,i)}if(!r.empty||n.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){var o=ps(t.state,e);return!!(o&&o instanceof Oo)&&vs(t,o)}if(!(Yo.mac&&n.indexOf("m")>-1)){var a,s=r.$head,u=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!u||u.isText)return!1;var c=e<0?s.pos-u.nodeSize:s.pos;return!!(u.isAtom||(a=t.docView.descAt(c))&&!a.contentDOM)&&(Oo.isSelectable(u)?vs(t,new Oo(e<0?t.state.doc.resolve(s.pos-u.nodeSize):s)):!!Yo.webkit&&vs(t,new To(t.state.doc.resolve(e<0?c:c+u.nodeSize))))}}function gs(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function ys(t){var e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function bs(t){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n){var i,o,a=!1;for(Yo.gecko&&1==n.nodeType&&r<gs(n)&&ys(n.childNodes[r])&&(a=!0);;)if(r>0){if(1!=n.nodeType)break;var s=n.childNodes[r-1];if(ys(s))i=n,o=--r;else{if(3!=s.nodeType)break;r=(n=s).nodeValue.length}}else{if(_s(n))break;for(var u=n.previousSibling;u&&ys(u);)i=n.parentNode,o=ea(u),u=u.previousSibling;if(u)r=gs(n=u);else{if((n=n.parentNode)==t.dom)break;r=0}}a?xs(t,e,n,r):i&&xs(t,e,i,o)}}function ws(t){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n){for(var i,o,a=gs(n);;)if(r<a){if(1!=n.nodeType)break;if(!ys(n.childNodes[r]))break;i=n,o=++r}else{if(_s(n))break;for(var s=n.nextSibling;s&&ys(s);)i=s.parentNode,o=ea(s)+1,s=s.nextSibling;if(s)r=0,a=gs(n=s);else{if((n=n.parentNode)==t.dom)break;r=a=0}}i&&xs(t,e,i,o)}}function _s(t){var e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function xs(t,e,n,r){if(la(e)){var i=document.createRange();i.setEnd(n,r),i.setStart(n,r),e.removeAllRanges(),e.addRange(i)}else e.extend&&e.extend(n,r);t.domObserver.setCurSelection();var o=t.state;setTimeout((function(){t.state==o&&is(t)}),50)}function ks(t,e,n){var r=t.state.selection;if(r instanceof To&&!r.empty||n.indexOf("s")>-1)return!1;if(Yo.mac&&n.indexOf("m")>-1)return!1;var i=r.$from,o=r.$to;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){var a=ps(t.state,e);if(a&&a instanceof Oo)return vs(t,a)}if(!i.parent.inlineContent){var s=e<0?i:o,u=r instanceof Po?Co.near(s,e):Co.findFrom(s,e);return!!u&&vs(t,u)}return!1}function Ss(t,e){if(!(t.state.selection instanceof To))return!0;var n=t.state.selection,r=n.$head,i=n.$anchor,o=n.empty;if(!r.sameParent(i))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;var a=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(a&&!a.isText){var s=t.state.tr;return e<0?s.delete(r.pos-a.nodeSize,r.pos):s.delete(r.pos,r.pos+a.nodeSize),t.dispatch(s),!0}return!1}function Cs(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Ms(t,e){var n=e.keyCode,r=function(t){var e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);return 8==n||Yo.mac&&72==n&&"c"==r?Ss(t,-1)||bs(t):46==n||Yo.mac&&68==n&&"c"==r?Ss(t,1)||ws(t):13==n||27==n||(37==n?ms(t,-1,r)||bs(t):39==n?ms(t,1,r)||ws(t):38==n?ks(t,-1,r)||bs(t):40==n?function(t){if(Yo.safari&&!(t.state.selection.$head.parentOffset>0)){var e=t.root.getSelection(),n=e.focusNode,r=e.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var i=n.firstChild;Cs(t,i,!0),setTimeout((function(){return Cs(t,i,!1)}),20)}}}(t)||ks(t,1,r)||ws(t):r==(Yo.mac?"m":"c")&&(66==n||73==n||89==n||90==n))}function Es(t){var e=t.pmViewDesc;if(e)return e.parseRule();if("BR"==t.nodeName&&t.parentNode){if(Yo.safari&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){var n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(t.parentNode.lastChild==t||Yo.safari&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if("IMG"==t.nodeName&&t.getAttribute("mark-placeholder"))return{ignore:!0}}function Ts(t,e,n,r,i){if(e<0){var o=t.lastSelectionTime>Date.now()-50?t.lastSelectionOrigin:null,a=rs(t,o);if(a&&!t.state.selection.eq(a)){var s=t.state.tr.setSelection(a);"pointer"==o?s.setMeta("pointer",!0):"key"==o&&s.scrollIntoView(),t.dispatch(s)}}else{var u=t.state.doc.resolve(e),c=u.sharedDepth(n);e=u.before(c+1),n=t.state.doc.resolve(n).after(c+1);var l=t.state.selection,h=function(t,e,n){var r=t.docView.parseRange(e,n),i=r.node,o=r.fromOffset,a=r.toOffset,s=r.from,u=r.to,c=t.root.getSelection(),l=null,h=c.anchorNode;if(h&&t.dom.contains(1==h.nodeType?h:h.parentNode)&&(l=[{node:h,offset:c.anchorOffset}],la(c)||l.push({node:c.focusNode,offset:c.focusOffset})),Yo.chrome&&8===t.lastKeyCode)for(var f=a;f>o;f--){var d=i.childNodes[f-1],p=d.pmViewDesc;if("BR"==d.nodeType&&!p){a=f;break}if(!p||p.size)break}var v=t.state.doc,m=t.someProp("domParser")||Ci.fromSchema(t.state.schema),g=v.resolve(s),y=null,b=m.parse(i,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:o,to:a,preserveWhitespace:!g.parent.type.spec.code||"full",editableContent:!0,findPositions:l,ruleFromNode:Es,context:g});if(l&&null!=l[0].pos){var w=l[0].pos,_=l[1]&&l[1].pos;null==_&&(_=w),y={anchor:w+s,head:_+s}}return{doc:b,sel:y,from:s,to:u}}(t,e,n);if(Yo.chrome&&t.cursorWrapper&&h.sel&&h.sel.anchor==t.cursorWrapper.deco.from){var f=t.cursorWrapper.deco.type.toDOM.nextSibling,d=f&&f.nodeValue?f.nodeValue.length:1;h.sel={anchor:h.sel.anchor+d,head:h.sel.anchor+d}}var p,v,m=t.state.doc,g=m.slice(h.from,h.to);8===t.lastKeyCode&&Date.now()-100<t.lastKeyCodeTime?(p=t.state.selection.to,v="end"):(p=t.state.selection.from,v="start"),t.lastKeyCode=null;var y=function(t,e,n,r,i){var o=t.findDiffStart(e,n);if(null==o)return null;var a=t.findDiffEnd(e,n+t.size,n+e.size),s=a.a,u=a.b;if("end"==i){r-=s+Math.max(0,o-Math.min(s,u))-o}if(s<o&&t.size<e.size){u=(o-=r<=o&&r>=s?o-r:0)+(u-s),s=o}else if(u<o){s=(o-=r<=o&&r>=u?o-r:0)+(s-u),u=o}return{start:o,endA:s,endB:u}}(g.content,h.doc.content,h.from,p,v);if(!y){if(!(r&&l instanceof To&&!l.empty&&l.$head.sameParent(l.$anchor))||t.composing||h.sel&&h.sel.anchor!=h.sel.head){if(Yo.ios&&t.lastIOSEnter>Date.now()-225&&i.some((function(t){return"DIV"==t.nodeName||"P"==t.nodeName}))&&t.someProp("handleKeyDown",(function(e){return e(t,ha(13,"Enter"))})))return void(t.lastIOSEnter=0);if(h.sel){var b=As(t,t.state.doc,h.sel);b&&!b.eq(t.state.selection)&&t.dispatch(t.state.tr.setSelection(b))}return}y={start:l.from,endA:l.to,endB:l.to}}t.domChangeCount++,t.state.selection.from<t.state.selection.to&&y.start==y.endB&&t.state.selection instanceof To&&(y.start>t.state.selection.from&&y.start<=t.state.selection.from+2?y.start=t.state.selection.from:y.endA<t.state.selection.to&&y.endA>=t.state.selection.to-2&&(y.endB+=t.state.selection.to-y.endA,y.endA=t.state.selection.to)),Yo.ie&&Yo.ie_version<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>h.from&&" \xa0"==h.doc.textBetween(y.start-h.from-1,y.start-h.from+1)&&(y.start--,y.endA--,y.endB--);var w,_=h.doc.resolveNoCache(y.start-h.from),x=h.doc.resolveNoCache(y.endB-h.from),k=_.sameParent(x)&&_.parent.inlineContent;if((Yo.ios&&t.lastIOSEnter>Date.now()-225&&(!k||i.some((function(t){return"DIV"==t.nodeName||"P"==t.nodeName})))||!k&&_.pos<h.doc.content.size&&(w=Co.findFrom(h.doc.resolve(_.pos+1),1,!0))&&w.head==x.pos)&&t.someProp("handleKeyDown",(function(e){return e(t,ha(13,"Enter"))})))t.lastIOSEnter=0;else if(t.state.selection.anchor>y.start&&function(t,e,n,r,i){if(!r.parent.isTextblock||n-e<=i.pos-r.pos||Os(r,!0,!1)<i.pos)return!1;var o=t.resolve(e);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;var a=t.resolve(Os(o,!0,!0));if(!a.parent.isTextblock||a.pos>n||Os(a,!0,!1)<n)return!1;return r.parent.content.cut(r.parentOffset).eq(a.parent.content)}(m,y.start,y.endA,_,x)&&t.someProp("handleKeyDown",(function(e){return e(t,ha(8,"Backspace"))})))Yo.android&&Yo.chrome&&t.domObserver.suppressSelectionUpdates();else{Yo.android&&!k&&_.start()!=x.start()&&0==x.parentOffset&&_.depth==x.depth&&h.sel&&h.sel.anchor==h.sel.head&&h.sel.head==y.endA&&(y.endB-=2,x=h.doc.resolveNoCache(y.endB-h.from),setTimeout((function(){t.someProp("handleKeyDown",(function(e){return e(t,ha(13,"Enter"))}))}),20));var S,C,M,E,T=y.start,A=y.endA;if(k)if(_.pos==x.pos)Yo.ie&&Yo.ie_version<=11&&0==_.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout((function(){return is(t)}),20)),S=t.state.tr.delete(T,A),C=m.resolve(y.start).marksAcross(m.resolve(y.endA));else if(y.endA==y.endB&&(E=m.resolve(y.start))&&(M=function(t,e){for(var n,r,i,o=t.firstChild.marks,a=e.firstChild.marks,s=o,u=a,c=0;c<a.length;c++)s=a[c].removeFromSet(s);for(var l=0;l<o.length;l++)u=o[l].removeFromSet(u);if(1==s.length&&0==u.length)r=s[0],n="add",i=function(t){return t.mark(r.addToSet(t.marks))};else{if(0!=s.length||1!=u.length)return null;r=u[0],n="remove",i=function(t){return t.mark(r.removeFromSet(t.marks))}}for(var h=[],f=0;f<e.childCount;f++)h.push(i(e.child(f)));if(Mr.from(h).eq(t))return{mark:r,type:n}}(_.parent.content.cut(_.parentOffset,x.parentOffset),E.parent.content.cut(E.parentOffset,y.endA-E.start()))))S=t.state.tr,"add"==M.type?S.addMark(T,A,M.mark):S.removeMark(T,A,M.mark);else if(_.parent.child(_.index()).isText&&_.index()==x.index()-(x.textOffset?0:1)){var O=_.parent.textBetween(_.parentOffset,x.parentOffset);if(t.someProp("handleTextInput",(function(e){return e(t,T,A,O)})))return;S=t.state.tr.insertText(O,T,A)}if(S||(S=t.state.tr.replace(T,A,h.doc.slice(y.start-h.from,y.endB-h.from))),h.sel){var D=As(t,S.doc,h.sel);D&&!(Yo.chrome&&Yo.android&&t.composing&&D.empty&&(D.head==T||D.head==S.mapping.map(A)-1)||Yo.ie&&D.empty&&D.head==T)&&S.setSelection(D)}C&&S.ensureMarks(C),t.dispatch(S.scrollIntoView())}}}function As(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:fs(t,e.resolve(n.anchor),e.resolve(n.head))}function Os(t,e,n){for(var r=t.depth,i=e?t.end():t.pos;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n)for(var o=t.node(r).maybeChild(t.indexAfter(r));o&&!o.isLeaf;)o=o.firstChild,i++;return i}function Ds(t,e){for(var n=[],r=e.content,i=e.openStart,o=e.openEnd;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;var a=r.firstChild;n.push(a.type.name,a.attrs!=a.type.defaultAttrs?a.attrs:null),r=a.content}var s=t.someProp("clipboardSerializer")||Ii.fromSchema(t.state.schema),u=js(),c=u.createElement("div");c.appendChild(s.serializeFragment(r,{document:u}));for(var l,h=c.firstChild;h&&1==h.nodeType&&(l=zs[h.nodeName.toLowerCase()]);){for(var f=l.length-1;f>=0;f--){for(var d=u.createElement(l[f]);c.firstChild;)d.appendChild(c.firstChild);c.appendChild(d)}h=c.firstChild}return h&&1==h.nodeType&&h.setAttribute("data-pm-slice",i+" "+o+" "+JSON.stringify(n)),{dom:c,text:t.someProp("clipboardTextSerializer",(function(t){return t(e)}))||e.content.textBetween(0,e.content.size,"\n\n")}}function Ps(t,e,n,r,i){var o,a,s=i.parent.type.spec.code;if(!n&&!e)return null;var u=e&&(r||s||!n);if(u){if(t.someProp("transformPastedText",(function(t){e=t(e,s||r)})),s)return new Lr(Mr.from(t.state.schema.text(e)),0,0);var c=t.someProp("clipboardTextParser",(function(t){return t(e,i,r)}));c?a=c:(o=document.createElement("div"),e.trim().split(/(?:\r\n?|\n)+/).forEach((function(t){o.appendChild(document.createElement("p")).textContent=t})))}else t.someProp("transformPastedHTML",(function(t){n=t(n)})),o=function(t){var e=/(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));var n,r=js().createElement("div"),i=/(?:<meta [^>]*>)*<([a-z][^>\s]+)/i.exec(t),o=0;(n=i&&zs[i[1].toLowerCase()])&&(t=n.map((function(t){return"<"+t+">"})).join("")+t+n.map((function(t){return"</"+t+">"})).reverse().join(""),o=n.length);r.innerHTML=t;for(var a=0;a<o;a++)r=r.firstChild;return r}(n);var l=o&&o.querySelector("[data-pm-slice]"),h=l&&/^(\d+) (\d+) (.*)/.exec(l.getAttribute("data-pm-slice"));if(!a){var f=t.someProp("clipboardParser")||t.someProp("domParser")||Ci.fromSchema(t.state.schema);a=f.parseSlice(o,{preserveWhitespace:!(!u&&!h),context:i})}return a=h?function(t,e){if(!t.size)return t;var n,r=t.content.firstChild.type.schema;try{n=JSON.parse(e)}catch(c){return t}for(var i=t.content,o=t.openStart,a=t.openEnd,s=n.length-2;s>=0;s-=2){var u=r.nodes[n[s]];if(!u||u.hasRequiredAttrs())break;i=Mr.from(u.create(n[s+1],i)),o++,a++}return new Lr(i,o,a)}(function(t,e,n){e<t.openStart&&(t=new Lr(Is(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd));n<t.openEnd&&(t=new Lr(Is(t.content,1,n,t.openEnd,0,0),t.openStart,n));return t}(a,+h[1],+h[2]),h[3]):Lr.maxOpen(function(t,e){if(t.childCount<2)return t;for(var n=function(n){var r=e.node(n).contentMatchAt(e.index(n)),i=void 0,o=[];if(t.forEach((function(t){if(o){var e,n=r.findWrapping(t.type);if(!n)return o=null;if(e=o.length&&i.length&&Ns(n,i,t,o[o.length-1],0))o[o.length-1]=e;else{o.length&&(o[o.length-1]=Rs(o[o.length-1],i.length));var a=Ls(t,n);o.push(a),r=r.matchType(a.type,a.attrs),i=n}}})),o)return{v:Mr.from(o)}},r=e.depth;r>=0;r--){var i=n(r);if(i)return i.v}return t}(a.content,i),!1),t.someProp("transformPasted",(function(t){a=t(a)})),a}function Ls(t,e,n){void 0===n&&(n=0);for(var r=e.length-1;r>=n;r--)t=e[r].create(null,Mr.from(t));return t}function Ns(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){var o=Ns(t,e,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(Mr.from(Ls(n,t,i+1))))}}function Rs(t,e){if(0==e)return t;var n=t.content.replaceChild(t.childCount-1,Rs(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(Mr.empty,!0);return t.copy(n.append(r))}function Is(t,e,n,r,i,o){var a=e<0?t.firstChild:t.lastChild,s=a.content;return i<r-1&&(s=Is(s,e,n,r,i+1,o)),i>=n&&(s=e<0?a.contentMatchAt(0).fillBefore(s,t.childCount>1||o<=i).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(Mr.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(s))}var zs={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},Bs=null;function js(){return Bs||(Bs=document.implementation.createHTMLDocument("title"))}var Fs={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},qs=Yo.ie&&Yo.ie_version<=11,$s=function(){this.anchorNode=this.anchorOffset=this.focusNode=this.focusOffset=null};$s.prototype.set=function(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset},$s.prototype.eq=function(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset};var Vs=function(t,e){var n=this;this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=window.MutationObserver&&new window.MutationObserver((function(t){for(var e=0;e<t.length;e++)n.queue.push(t[e]);Yo.ie&&Yo.ie_version<=11&&t.some((function(t){return"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length}))?n.flushSoon():n.flush()})),this.currentSelection=new $s,qs&&(this.onCharData=function(t){n.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.suppressingSelectionUpdates=!1};Vs.prototype.flushSoon=function(){var t=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){t.flushingSoon=-1,t.flush()}),20))},Vs.prototype.forceFlush=function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())},Vs.prototype.start=function(){this.observer&&this.observer.observe(this.view.dom,Fs),qs&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()},Vs.prototype.stop=function(){var t=this;if(this.observer){var e=this.observer.takeRecords();if(e.length){for(var n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout((function(){return t.flush()}),20)}this.observer.disconnect()}qs&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()},Vs.prototype.connectSelection=function(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)},Vs.prototype.disconnectSelection=function(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)},Vs.prototype.suppressSelectionUpdates=function(){var t=this;this.suppressingSelectionUpdates=!0,setTimeout((function(){return t.suppressingSelectionUpdates=!1}),50)},Vs.prototype.onSelectionChange=function(){if((!(t=this.view).editable||t.root.activeElement==t.dom)&&ds(t)){var t;if(this.suppressingSelectionUpdates)return is(this.view);if(Yo.ie&&Yo.ie_version<=11&&!this.view.state.selection.empty){var e=this.view.root.getSelection();if(e.focusNode&&oa(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}},Vs.prototype.setCurSelection=function(){this.currentSelection.set(this.view.root.getSelection())},Vs.prototype.ignoreSelectionChange=function(t){if(0==t.rangeCount)return!0;var e=t.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(e);return n&&n.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0},Vs.prototype.flush=function(){if(this.view.docView&&!(this.flushingSoon>-1)){var t=this.observer?this.observer.takeRecords():[];this.queue.length&&(t=this.queue.concat(t),this.queue.length=0);var e=this.view.root.getSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(e)&&ds(this.view)&&!this.ignoreSelectionChange(e),r=-1,i=-1,o=!1,a=[];if(this.view.editable)for(var s=0;s<t.length;s++){var u=this.registerMutation(t[s],a);u&&(r=r<0?u.from:Math.min(u.from,r),i=i<0?u.to:Math.max(u.to,i),u.typeOver&&(o=!0))}if(Yo.gecko&&a.length>1){var c=a.filter((function(t){return"BR"==t.nodeName}));if(2==c.length){var l=c[0],h=c[1];l.parentNode&&l.parentNode.parentNode==h.parentNode?h.remove():l.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,i),function(t){if(Us)return;Us=!0,"normal"==getComputedStyle(t.dom).whiteSpace&&console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.")}(this.view)),this.handleDOMChange(r,i,o,a),this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(e)||is(this.view),this.currentSelection.set(e))}},Vs.prototype.registerMutation=function(t,e){if(e.indexOf(t.target)>-1)return null;var n=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(n==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(t))return null;if("childList"==t.type){var r=t.previousSibling,i=t.nextSibling;if(Yo.ie&&Yo.ie_version<=11&&t.addedNodes.length)for(var o=0;o<t.addedNodes.length;o++){var a=t.addedNodes[o],s=a.previousSibling,u=a.nextSibling;(!s||Array.prototype.indexOf.call(t.addedNodes,s)<0)&&(r=s),(!u||Array.prototype.indexOf.call(t.addedNodes,u)<0)&&(i=u)}for(var c=r&&r.parentNode==t.target?ea(r)+1:0,l=n.localPosFromDOM(t.target,c,-1),h=i&&i.parentNode==t.target?ea(i):t.target.childNodes.length,f=0;f<t.addedNodes.length;f++)e.push(t.addedNodes[f]);return{from:l,to:n.localPosFromDOM(t.target,h,1)}}return"attributes"==t.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}};var Us=!1;var Hs={},Ws={};function Zs(t,e){t.lastSelectionOrigin=e,t.lastSelectionTime=Date.now()}function Js(t){t.someProp("handleDOMEvents",(function(e){for(var n in e)t.eventHandlers[n]||t.dom.addEventListener(n,t.eventHandlers[n]=function(e){return Ys(t,e)})}))}function Ys(t,e){return t.someProp("handleDOMEvents",(function(n){var r=n[e.type];return!!r&&(r(t,e)||e.defaultPrevented)}))}function Ks(t){return{left:t.clientX,top:t.clientY}}function Gs(t,e,n,r,i){if(-1==r)return!1;for(var o=t.state.doc.resolve(r),a=function(r){if(t.someProp(e,(function(e){return r>o.depth?e(t,n,o.nodeAfter,o.before(r),i,!0):e(t,n,o.node(r),o.before(r),i,!1)})))return{v:!0}},s=o.depth+1;s>0;s--){var u=a(s);if(u)return u.v}return!1}function Xs(t,e,n){t.focused||t.focus();var r=t.state.tr.setSelection(e);"pointer"==n&&r.setMeta("pointer",!0),t.dispatch(r)}function Qs(t,e,n,r,i){return Gs(t,"handleClickOn",e,n,r)||t.someProp("handleClick",(function(n){return n(t,e,r)}))||(i?function(t,e){if(-1==e)return!1;var n,r,i=t.state.selection;i instanceof Oo&&(n=i.node);for(var o=t.state.doc.resolve(e),a=o.depth+1;a>0;a--){var s=a>o.depth?o.nodeAfter:o.node(a);if(Oo.isSelectable(s)){r=n&&i.$from.depth>0&&a>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(a);break}}return null!=r&&(Xs(t,Oo.create(t.state.doc,r),"pointer"),!0)}(t,n):function(t,e){if(-1==e)return!1;var n=t.state.doc.resolve(e),r=n.nodeAfter;return!!(r&&r.isAtom&&Oo.isSelectable(r))&&(Xs(t,new Oo(n),"pointer"),!0)}(t,n))}function tu(t,e,n,r){return Gs(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",(function(n){return n(t,e,r)}))}function eu(t,e,n,r){return Gs(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",(function(n){return n(t,e,r)}))||function(t,e){var n=t.state.doc;if(-1==e)return!!n.inlineContent&&(Xs(t,To.create(n,0,n.content.size),"pointer"),!0);for(var r=n.resolve(e),i=r.depth+1;i>0;i--){var o=i>r.depth?r.nodeAfter:r.node(i),a=r.before(i);if(o.inlineContent)Xs(t,To.create(n,a+1,a+1+o.content.size),"pointer");else{if(!Oo.isSelectable(o))continue;Xs(t,Oo.create(n,a),"pointer")}return!0}}(t,n)}function nu(t){return cu(t)}Ws.keydown=function(t,e){if(t.shiftKey=16==e.keyCode||e.shiftKey,!ou(t,e))if(t.domObserver.forceFlush(),t.lastKeyCode=e.keyCode,t.lastKeyCodeTime=Date.now(),!Yo.ios||13!=e.keyCode||e.ctrlKey||e.altKey||e.metaKey)t.someProp("handleKeyDown",(function(n){return n(t,e)}))||Ms(t,e)?e.preventDefault():Zs(t,"key");else{var n=Date.now();t.lastIOSEnter=n,t.lastIOSEnterFallbackTimeout=setTimeout((function(){t.lastIOSEnter==n&&(t.someProp("handleKeyDown",(function(e){return e(t,ha(13,"Enter"))})),t.lastIOSEnter=0)}),200)}},Ws.keyup=function(t,e){16==e.keyCode&&(t.shiftKey=!1)},Ws.keypress=function(t,e){if(!(ou(t,e)||!e.charCode||e.ctrlKey&&!e.altKey||Yo.mac&&e.metaKey))if(t.someProp("handleKeyPress",(function(n){return n(t,e)})))e.preventDefault();else{var n=t.state.selection;if(!(n instanceof To)||!n.$from.sameParent(n.$to)){var r=String.fromCharCode(e.charCode);t.someProp("handleTextInput",(function(e){return e(t,n.$from.pos,n.$to.pos,r)}))||t.dispatch(t.state.tr.insertText(r).scrollIntoView()),e.preventDefault()}}};var ru=Yo.mac?"metaKey":"ctrlKey";Hs.mousedown=function(t,e){t.shiftKey=e.shiftKey;var n=nu(t),r=Date.now(),i="singleClick";r-t.lastClick.time<500&&function(t,e){var n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}(e,t.lastClick)&&!e[ru]&&("singleClick"==t.lastClick.type?i="doubleClick":"doubleClick"==t.lastClick.type&&(i="tripleClick")),t.lastClick={time:r,x:e.clientX,y:e.clientY,type:i};var o=t.posAtCoords(Ks(e));o&&("singleClick"==i?t.mouseDown=new iu(t,o,e,n):("doubleClick"==i?tu:eu)(t,o.pos,o.inside,e)?e.preventDefault():Zs(t,"pointer"))};var iu=function(t,e,n,r){var i,o,a=this;if(this.view=t,this.startDoc=t.state.doc,this.pos=e,this.event=n,this.flushed=r,this.selectNode=n[ru],this.allowDefault=n.shiftKey,e.inside>-1)i=t.state.doc.nodeAt(e.inside),o=e.inside;else{var s=t.state.doc.resolve(e.pos);i=s.parent,o=s.depth?s.before():0}this.mightDrag=null;var u=r?null:n.target,c=u?t.docView.nearestDesc(u,!0):null;this.target=c?c.dom:null,(i.type.spec.draggable&&!1!==i.type.spec.selectable||t.state.selection instanceof Oo&&o==t.state.selection.from)&&(this.mightDrag={node:i,pos:o,addAttr:this.target&&!this.target.draggable,setUneditable:this.target&&Yo.gecko&&!this.target.hasAttribute("contentEditable")}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((function(){return a.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Zs(t,"pointer")};function ou(t,e){return!!t.composing||!!(Yo.safari&&Math.abs(e.timeStamp-t.compositionEndedAt)<500)&&(t.compositionEndedAt=-2e8,!0)}iu.prototype.done=function(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.view.mouseDown=null},iu.prototype.up=function(t){if(this.done(),this.view.dom.contains(3==t.target.nodeType?t.target.parentNode:t.target)){var e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(Ks(t))),this.allowDefault||!e?Zs(this.view,"pointer"):Qs(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():this.flushed||Yo.safari&&this.mightDrag&&!this.mightDrag.node.isAtom||Yo.chrome&&!(this.view.state.selection instanceof To)&&(e.pos==this.view.state.selection.from||e.pos==this.view.state.selection.to)?(Xs(this.view,Co.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):Zs(this.view,"pointer")}},iu.prototype.move=function(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0),Zs(this.view,"pointer")},Hs.touchdown=function(t){nu(t),Zs(t,"pointer")},Hs.contextmenu=function(t){return nu(t)};var au=Yo.android?5e3:-1;function su(t,e){clearTimeout(t.composingTimeout),e>-1&&(t.composingTimeout=setTimeout((function(){return cu(t)}),e))}function uu(t){for(t.composing=!1;t.compositionNodes.length>0;)t.compositionNodes.pop().markParentsDirty()}function cu(t,e){if(t.domObserver.forceFlush(),uu(t),e||t.docView.dirty){var n=rs(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}Ws.compositionstart=Ws.compositionupdate=function(t){if(!t.composing){t.domObserver.flush();var e=t.state,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(t){return!1===t.type.spec.inclusive}))))t.markCursor=t.state.storedMarks||n.marks(),cu(t,!0),t.markCursor=null;else if(cu(t),Yo.gecko&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=t.root.getSelection(),i=r.focusNode,o=r.focusOffset;i&&1==i.nodeType&&0!=o;){var a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(3==a.nodeType){r.collapse(a,a.nodeValue.length);break}i=a,o=-1}t.composing=!0}su(t,au)},Ws.compositionend=function(t,e){t.composing&&(t.composing=!1,t.compositionEndedAt=e.timeStamp,su(t,20))};var lu=Yo.ie&&Yo.ie_version<15||Yo.ios&&Yo.webkit_version<604;function hu(t,e,n,r){var i=Ps(t,e,n,t.shiftKey,t.state.selection.$from);if(t.someProp("handlePaste",(function(e){return e(t,r,i||Lr.empty)})))return!0;if(!i)return!1;var o=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(i),a=o?t.state.tr.replaceSelectionWith(o,t.shiftKey):t.state.tr.replaceSelection(i);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Hs.copy=Ws.cut=function(t,e){var n=t.state.selection,r="cut"==e.type;if(!n.empty){var i=lu?null:e.clipboardData,o=Ds(t,n.content()),a=o.dom,s=o.text;i?(e.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",s)):function(t,e){if(t.dom.parentNode){var n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),t.focus()}),50)}}(t,a),r&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},Ws.paste=function(t,e){var n=lu?null:e.clipboardData;n&&hu(t,n.getData("text/plain"),n.getData("text/html"),e)?e.preventDefault():function(t,e){if(t.dom.parentNode){var n=t.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((function(){t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?hu(t,r.value,null,e):hu(t,r.textContent,r.innerHTML,e)}),50)}}(t,e)};var fu=function(t,e){this.slice=t,this.move=e},du=Yo.mac?"altKey":"ctrlKey";for(var pu in Hs.dragstart=function(t,e){var n=t.mouseDown;if(n&&n.done(),e.dataTransfer){var r=t.state.selection,i=r.empty?null:t.posAtCoords(Ks(e));if(i&&i.pos>=r.from&&i.pos<=(r instanceof Oo?r.to-1:r.to));else if(n&&n.mightDrag)t.dispatch(t.state.tr.setSelection(Oo.create(t.state.doc,n.mightDrag.pos)));else if(e.target&&1==e.target.nodeType){var o=t.docView.nearestDesc(e.target,!0);if(!o||!o.node.type.spec.draggable||o==t.docView)return;t.dispatch(t.state.tr.setSelection(Oo.create(t.state.doc,o.posBefore)))}var a=t.state.selection.content(),s=Ds(t,a),u=s.dom,c=s.text;e.dataTransfer.clearData(),e.dataTransfer.setData(lu?"Text":"text/html",u.innerHTML),lu||e.dataTransfer.setData("text/plain",c),t.dragging=new fu(a,!e[du])}},Hs.dragend=function(t){var e=t.dragging;window.setTimeout((function(){t.dragging==e&&(t.dragging=null)}),50)},Ws.dragover=Ws.dragenter=function(t,e){return e.preventDefault()},Ws.drop=function(t,e){var n=t.dragging;if(t.dragging=null,e.dataTransfer){var r=t.posAtCoords(Ks(e));if(r){var i=t.state.doc.resolve(r.pos);if(i){var o=n&&n.slice||Ps(t,e.dataTransfer.getData(lu?"Text":"text/plain"),lu?null:e.dataTransfer.getData("text/html"),!1,i),a=n&&!e[du];if(t.someProp("handleDrop",(function(n){return n(t,e,o||Lr.empty,a)})))e.preventDefault();else if(o){e.preventDefault();var s=o?uo(t.state.doc,i.pos,o):i.pos;null==s&&(s=i.pos);var u=t.state.tr;a&&u.deleteSelection();var c=u.mapping.map(s),l=0==o.openStart&&0==o.openEnd&&1==o.content.childCount,h=u.doc;if(l?u.replaceRangeWith(c,c,o.content.firstChild):u.replaceRange(c,c,o),!u.doc.eq(h)){var f=u.doc.resolve(c);if(l&&Oo.isSelectable(o.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(o.content.firstChild))u.setSelection(new Oo(f));else{var d=u.mapping.map(s);u.mapping.maps[u.mapping.maps.length-1].forEach((function(t,e,n,r){return d=r})),u.setSelection(fs(t,f,u.doc.resolve(d)))}t.focus(),t.dispatch(u.setMeta("uiEvent","drop"))}}}}}},Hs.focus=function(t){t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((function(){t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.root.getSelection())&&is(t)}),20))},Hs.blur=function(t){t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),t.domObserver.currentSelection.set({}),t.focused=!1)},Hs.beforeinput=function(t,e){if(Yo.chrome&&Yo.android&&"deleteContentBackward"==e.inputType){var n=t.domChangeCount;setTimeout((function(){if(t.domChangeCount==n&&(t.dom.blur(),t.focus(),!t.someProp("handleKeyDown",(function(e){return e(t,ha(8,"Backspace"))})))){var e=t.state.selection.$cursor;e&&e.pos>0&&t.dispatch(t.state.tr.delete(e.pos-1,e.pos).scrollIntoView())}}),50)}},Ws)Hs[pu]=Ws[pu];function vu(t,e){if(t==e)return!0;for(var n in t)if(t[n]!==e[n])return!1;for(var r in e)if(!(r in t))return!1;return!0}var mu=function(t,e){this.spec=e||xu,this.side=this.spec.side||0,this.toDOM=t};mu.prototype.map=function(t,e,n,r){var i=t.mapResult(e.from+r,this.side<0?-1:1),o=i.pos;return i.deleted?null:new bu(o-n,o-n,this)},mu.prototype.valid=function(){return!0},mu.prototype.eq=function(t){return this==t||t instanceof mu&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&vu(this.spec,t.spec))};var gu=function(t,e){this.spec=e||xu,this.attrs=t};gu.prototype.map=function(t,e,n,r){var i=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-n,o=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new bu(i,o,this)},gu.prototype.valid=function(t,e){return e.from<e.to},gu.prototype.eq=function(t){return this==t||t instanceof gu&&vu(this.attrs,t.attrs)&&vu(this.spec,t.spec)},gu.is=function(t){return t.type instanceof gu};var yu=function(t,e){this.spec=e||xu,this.attrs=t};yu.prototype.map=function(t,e,n,r){var i=t.mapResult(e.from+r,1);if(i.deleted)return null;var o=t.mapResult(e.to+r,-1);return o.deleted||o.pos<=i.pos?null:new bu(i.pos-n,o.pos-n,this)},yu.prototype.valid=function(t,e){var n=t.content.findIndex(e.from),r=n.index,i=n.offset;return i==e.from&&i+t.child(r).nodeSize==e.to},yu.prototype.eq=function(t){return this==t||t instanceof yu&&vu(this.attrs,t.attrs)&&vu(this.spec,t.spec)};var bu=function(t,e,n){this.from=t,this.to=e,this.type=n},wu={spec:{configurable:!0},inline:{configurable:!0}};bu.prototype.copy=function(t,e){return new bu(t,e,this.type)},bu.prototype.eq=function(t,e){return void 0===e&&(e=0),this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to},bu.prototype.map=function(t,e,n){return this.type.map(t,this,e,n)},bu.widget=function(t,e,n){return new bu(t,t,new mu(e,n))},bu.inline=function(t,e,n,r){return new bu(t,e,new gu(n,r))},bu.node=function(t,e,n,r){return new bu(t,e,new yu(n,r))},wu.spec.get=function(){return this.type.spec},wu.inline.get=function(){return this.type instanceof gu},Object.defineProperties(bu.prototype,wu);var _u=[],xu={},ku=function(t,e){this.local=t&&t.length?t:_u,this.children=e&&e.length?e:_u};ku.create=function(t,e){return e.length?Au(e,t,0,xu):Su},ku.prototype.find=function(t,e,n){var r=[];return this.findInner(null==t?0:t,null==e?1e9:e,r,0,n),r},ku.prototype.findInner=function(t,e,n,r,i){for(var o=0;o<this.local.length;o++){var a=this.local[o];a.from<=e&&a.to>=t&&(!i||i(a.spec))&&n.push(a.copy(a.from+r,a.to+r))}for(var s=0;s<this.children.length;s+=3)if(this.children[s]<e&&this.children[s+1]>t){var u=this.children[s]+1;this.children[s+2].findInner(t-u,e-u,n,r+u,i)}},ku.prototype.map=function(t,e,n){return this==Su||0==t.maps.length?this:this.mapInner(t,e,0,0,n||xu)},ku.prototype.mapInner=function(t,e,n,r,i){for(var o,a=0;a<this.local.length;a++){var s=this.local[a].map(t,n,r);s&&s.type.valid(e,s)?(o||(o=[])).push(s):i.onRemove&&i.onRemove(this.local[a].spec)}return this.children.length?function(t,e,n,r,i,o,a){for(var s=t.slice(),u=function(t,e,n,r){for(var a=0;a<s.length;a+=3){var u=s[a+1],c=void 0;-1==u||t>u+o||(e>=s[a]+o?s[a+1]=-1:n>=i&&(c=r-n-(e-t))&&(s[a]+=c,s[a+1]+=c))}},c=0;c<n.maps.length;c++)n.maps[c].forEach(u);for(var l=!1,h=0;h<s.length;h+=3)if(-1==s[h+1]){var f=n.map(t[h]+o),d=f-i;if(d<0||d>=r.content.size){l=!0;continue}var p=n.map(t[h+1]+o,-1)-i,v=r.content.findIndex(d),m=v.index,g=v.offset,y=r.maybeChild(m);if(y&&g==d&&g+y.nodeSize==p){var b=s[h+2].mapInner(n,y,f+1,t[h]+o+1,a);b!=Su?(s[h]=d,s[h+1]=p,s[h+2]=b):(s[h+1]=-2,l=!0)}else l=!0}if(l){var w=Au(function(t,e,n,r,i,o,a){function s(t,e){for(var o=0;o<t.local.length;o++){var u=t.local[o].map(r,i,e);u?n.push(u):a.onRemove&&a.onRemove(t.local[o].spec)}for(var c=0;c<t.children.length;c+=3)s(t.children[c+2],t.children[c]+e+1)}for(var u=0;u<t.length;u+=3)-1==t[u+1]&&s(t[u+2],e[u]+o+1);return n}(s,t,e||[],n,i,o,a),r,0,a);e=w.local;for(var _=0;_<s.length;_+=3)s[_+1]<0&&(s.splice(_,3),_-=3);for(var x=0,k=0;x<w.children.length;x+=3){for(var S=w.children[x];k<s.length&&s[k]<S;)k+=3;s.splice(k,0,w.children[x],w.children[x+1],w.children[x+2])}}return new ku(e&&e.sort(Ou),s)}(this.children,o,t,e,n,r,i):o?new ku(o.sort(Ou)):Su},ku.prototype.add=function(t,e){return e.length?this==Su?ku.create(t,e):this.addInner(t,e,0):this},ku.prototype.addInner=function(t,e,n){var r,i=this,o=0;t.forEach((function(t,a){var s,u=a+n;if(s=Eu(e,t,u)){for(r||(r=i.children.slice());o<r.length&&r[o]<a;)o+=3;r[o]==a?r[o+2]=r[o+2].addInner(t,s,u+1):r.splice(o,0,a,a+t.nodeSize,Au(s,t,u+1,xu)),o+=3}}));for(var a=Mu(o?Tu(e):e,-n),s=0;s<a.length;s++)a[s].type.valid(t,a[s])||a.splice(s--,1);return new ku(a.length?this.local.concat(a).sort(Ou):this.local,r||this.children)},ku.prototype.remove=function(t){return 0==t.length||this==Su?this:this.removeInner(t,0)},ku.prototype.removeInner=function(t,e){for(var n=this.children,r=this.local,i=0;i<n.length;i+=3){for(var o=void 0,a=n[i]+e,s=n[i+1]+e,u=0,c=void 0;u<t.length;u++)(c=t[u])&&c.from>a&&c.to<s&&(t[u]=null,(o||(o=[])).push(c));if(o){n==this.children&&(n=this.children.slice());var l=n[i+2].removeInner(o,a+1);l!=Su?n[i+2]=l:(n.splice(i,3),i-=3)}}if(r.length)for(var h=0,f=void 0;h<t.length;h++)if(f=t[h])for(var d=0;d<r.length;d++)r[d].eq(f,e)&&(r==this.local&&(r=this.local.slice()),r.splice(d--,1));return n==this.children&&r==this.local?this:r.length||n.length?new ku(r,n):Su},ku.prototype.forChild=function(t,e){if(this==Su)return this;if(e.isLeaf)return ku.empty;for(var n,r,i=0;i<this.children.length;i+=3)if(this.children[i]>=t){this.children[i]==t&&(n=this.children[i+2]);break}for(var o=t+1,a=o+e.content.size,s=0;s<this.local.length;s++){var u=this.local[s];if(u.from<a&&u.to>o&&u.type instanceof gu){var c=Math.max(o,u.from)-o,l=Math.min(a,u.to)-o;c<l&&(r||(r=[])).push(u.copy(c,l))}}if(r){var h=new ku(r.sort(Ou));return n?new Cu([h,n]):h}return n||Su},ku.prototype.eq=function(t){if(this==t)return!0;if(!(t instanceof ku)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(var e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(var n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0},ku.prototype.locals=function(t){return Du(this.localsInner(t))},ku.prototype.localsInner=function(t){if(this==Su)return _u;if(t.inlineContent||!this.local.some(gu.is))return this.local;for(var e=[],n=0;n<this.local.length;n++)this.local[n].type instanceof gu||e.push(this.local[n]);return e};var Su=new ku;ku.empty=Su,ku.removeOverlap=Du;var Cu=function(t){this.members=t};function Mu(t,e){if(!e||!t.length)return t;for(var n=[],r=0;r<t.length;r++){var i=t[r];n.push(new bu(i.from+e,i.to+e,i.type))}return n}function Eu(t,e,n){if(e.isLeaf)return null;for(var r=n+e.nodeSize,i=null,o=0,a=void 0;o<t.length;o++)(a=t[o])&&a.from>n&&a.to<r&&((i||(i=[])).push(a),t[o]=null);return i}function Tu(t){for(var e=[],n=0;n<t.length;n++)null!=t[n]&&e.push(t[n]);return e}function Au(t,e,n,r){var i=[],o=!1;e.forEach((function(e,a){var s=Eu(t,e,a+n);if(s){o=!0;var u=Au(s,e,n+a+1,r);u!=Su&&i.push(a,a+e.nodeSize,u)}}));for(var a=Mu(o?Tu(t):t,-n).sort(Ou),s=0;s<a.length;s++)a[s].type.valid(e,a[s])||(r.onRemove&&r.onRemove(a[s].spec),a.splice(s--,1));return a.length||i.length?new ku(a,i):Su}function Ou(t,e){return t.from-e.from||t.to-e.to}function Du(t){for(var e=t,n=0;n<e.length-1;n++){var r=e[n];if(r.from!=r.to)for(var i=n+1;i<e.length;i++){var o=e[i];if(o.from!=r.from){o.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,o.from),Pu(e,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,r.to),Pu(e,i+1,o.copy(r.to,o.to)))}}return e}function Pu(t,e,n){for(;e<t.length&&Ou(n,t[e])>0;)e++;t.splice(e,0,n)}function Lu(t){var e=[];return t.someProp("decorations",(function(n){var r=n(t.state);r&&r!=Su&&e.push(r)})),t.cursorWrapper&&e.push(ku.create(t.state.doc,[t.cursorWrapper.deco])),Cu.from(e)}Cu.prototype.forChild=function(t,e){if(e.isLeaf)return ku.empty;for(var n=[],r=0;r<this.members.length;r++){var i=this.members[r].forChild(t,e);i!=Su&&(i instanceof Cu?n=n.concat(i.members):n.push(i))}return Cu.from(n)},Cu.prototype.eq=function(t){if(!(t instanceof Cu)||t.members.length!=this.members.length)return!1;for(var e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0},Cu.prototype.locals=function(t){for(var e,n=!0,r=0;r<this.members.length;r++){var i=this.members[r].localsInner(t);if(i.length)if(e){n&&(e=e.slice(),n=!1);for(var o=0;o<i.length;o++)e.push(i[o])}else e=i}return e?Du(n?e:e.sort(Ou)):_u},Cu.from=function(t){switch(t.length){case 0:return Su;case 1:return t[0];default:return new Cu(t)}};var Nu=function(t,e){this._props=e,this.state=e.state,this.dispatch=this.dispatch.bind(this),this._root=null,this.focused=!1,this.trackWrites=null,this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):t.apply?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Bu(this),this.markCursor=null,this.cursorWrapper=null,zu(this),this.nodeViews=ju(this),this.docView=qa(this.state.doc,Iu(this),Lu(this),this.dom,this),this.lastSelectedViewDesc=null,this.dragging=null,function(t){t.shiftKey=!1,t.mouseDown=null,t.lastKeyCode=null,t.lastKeyCodeTime=0,t.lastClick={time:0,x:0,y:0,type:""},t.lastSelectionOrigin=null,t.lastSelectionTime=0,t.lastIOSEnter=0,t.lastIOSEnterFallbackTimeout=null,t.composing=!1,t.composingTimeout=null,t.compositionNodes=[],t.compositionEndedAt=-2e8,t.domObserver=new Vs(t,(function(e,n,r,i){return Ts(t,e,n,r,i)})),t.domObserver.start(),t.domChangeCount=0,t.eventHandlers=Object.create(null);var e=function(e){var n=Hs[e];t.dom.addEventListener(e,t.eventHandlers[e]=function(e){!function(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(var n=e.target;n!=t.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}(t,e)||Ys(t,e)||!t.editable&&e.type in Ws||n(t,e)})};for(var n in Hs)e(n);Yo.safari&&t.dom.addEventListener("input",(function(){return null})),Js(t)}(this),this.pluginViews=[],this.updatePluginViews()},Ru={props:{configurable:!0},root:{configurable:!0}};function Iu(t){var e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",(function(n){if("function"==typeof n&&(n=n(t.state)),n)for(var r in n)"class"==r?e.class+=" "+n[r]:e[r]||"contenteditable"==r||"nodeName"==r||(e[r]=String(n[r]))})),[bu.node(0,t.state.doc.content.size,e)]}function zu(t){if(t.markCursor){var e=document.createElement("img");e.setAttribute("mark-placeholder","true"),t.cursorWrapper={dom:e,deco:bu.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Bu(t){return!t.someProp("editable",(function(e){return!1===e(t.state)}))}function ju(t){var e={};return t.someProp("nodeViews",(function(t){for(var n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])})),e}Ru.props.get=function(){if(this._props.state!=this.state){var t=this._props;for(var e in this._props={},t)this._props[e]=t[e];this._props.state=this.state}return this._props},Nu.prototype.update=function(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Js(this),this._props=t,this.updateStateInner(t.state,!0)},Nu.prototype.setProps=function(t){var e={};for(var n in this._props)e[n]=this._props[n];for(var r in e.state=this.state,t)e[r]=t[r];this.update(e)},Nu.prototype.updateState=function(t){this.updateStateInner(t,this.state.plugins!=t.plugins)},Nu.prototype.updateStateInner=function(t,e){var n=this,r=this.state,i=!1,o=!1;if(t.storedMarks&&this.composing&&(uu(this),o=!0),this.state=t,e){var a=ju(this);(function(t,e){var n=0,r=0;for(var i in t){if(t[i]!=e[i])return!0;n++}for(var o in e)r++;return n!=r})(a,this.nodeViews)&&(this.nodeViews=a,i=!0),Js(this)}this.editable=Bu(this),zu(this);var s=Lu(this),u=Iu(this),c=e?"reset":t.scrollToSelection>r.scrollToSelection?"to selection":"preserve",l=i||!this.docView.matchesNode(t.doc,u,s);!l&&t.selection.eq(r.selection)||(o=!0);var h,f,d,p,v,m,g,y,b,w,_,x="preserve"==c&&o&&null==this.dom.style.overflowAnchor&&function(t){for(var e,n,r=t.dom.getBoundingClientRect(),i=Math.max(0,r.top),o=(r.left+r.right)/2,a=i+1;a<Math.min(innerHeight,r.bottom);a+=5){var s=t.root.elementFromPoint(o,a);if(s!=t.dom&&t.dom.contains(s)){var u=s.getBoundingClientRect();if(u.top>=i-20){e=s,n=u.top;break}}}return{refDOM:e,refTop:n,stack:ma(t.dom)}}(this);if(o){this.domObserver.stop();var k=l&&(Yo.ie||Yo.chrome)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&(p=r.selection,v=t.selection,m=Math.min(p.$anchor.sharedDepth(p.head),v.$anchor.sharedDepth(v.head)),p.$anchor.start(m)!=v.$anchor.start(m));if(l){var S=Yo.chrome?this.trackWrites=this.root.getSelection().focusNode:null;!i&&this.docView.update(t.doc,u,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=qa(t.doc,u,s,this.dom,this)),S&&!this.trackWrites&&(k=!0)}k||!(this.mouseDown&&this.domObserver.currentSelection.eq(this.root.getSelection())&&(h=this,f=h.docView.domFromPos(h.state.selection.anchor,0),d=h.root.getSelection(),oa(f.node,f.offset,d.anchorNode,d.anchorOffset)))?is(this,k):(ls(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(r),"reset"==c)this.dom.scrollTop=0;else if("to selection"==c){var C=this.root.getSelection().focusNode;this.someProp("handleScrollToSelection",(function(t){return t(n)}))||(t.selection instanceof Oo?va(this,this.docView.domAfterPos(t.selection.from).getBoundingClientRect(),C):va(this,this.coordsAtPos(t.selection.head,1),C))}else x&&(y=(g=x).refDOM,b=g.refTop,w=g.stack,_=y?y.getBoundingClientRect().top:0,ga(w,0==_?0:_-b))},Nu.prototype.destroyPluginViews=function(){for(var t;t=this.pluginViews.pop();)t.destroy&&t.destroy()},Nu.prototype.updatePluginViews=function(t){if(t&&t.plugins==this.state.plugins)for(var e=0;e<this.pluginViews.length;e++){var n=this.pluginViews[e];n.update&&n.update(this,t)}else{this.destroyPluginViews();for(var r=0;r<this.state.plugins.length;r++){var i=this.state.plugins[r];i.spec.view&&this.pluginViews.push(i.spec.view(this))}}},Nu.prototype.someProp=function(t,e){var n,r=this._props&&this._props[t];if(null!=r&&(n=e?e(r):r))return n;var i=this.state.plugins;if(i)for(var o=0;o<i.length;o++){var a=i[o].props[t];if(null!=a&&(n=e?e(a):a))return n}},Nu.prototype.hasFocus=function(){return this.root.activeElement==this.dom},Nu.prototype.focus=function(){this.domObserver.stop(),this.editable&&function(t){if(t.setActive)return t.setActive();if(ya)return t.focus(ya);var e=ma(t);t.focus(null==ya?{get preventScroll(){return ya={preventScroll:!0},!0}}:void 0),ya||(ya=!1,ga(e,0))}(this.dom),is(this),this.domObserver.start()},Ru.root.get=function(){var t=this._root;if(null==t)for(var e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=function(){return document.getSelection()}),this._root=e;return t||document},Nu.prototype.posAtCoords=function(t){return xa(this,t)},Nu.prototype.coordsAtPos=function(t,e){return void 0===e&&(e=1),Ca(this,t,e)},Nu.prototype.domAtPos=function(t,e){return void 0===e&&(e=0),this.docView.domFromPos(t,e)},Nu.prototype.nodeDOM=function(t){var e=this.docView.descAt(t);return e?e.nodeDOM:null},Nu.prototype.posAtDOM=function(t,e,n){void 0===n&&(n=-1);var r=this.docView.posFromDOM(t,e,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r},Nu.prototype.endOfTextblock=function(t,e){return La(this,e||this.state,t)},Nu.prototype.destroy=function(){this.docView&&(!function(t){for(var e in t.domObserver.stop(),t.eventHandlers)t.dom.removeEventListener(e,t.eventHandlers[e]);clearTimeout(t.composingTimeout),clearTimeout(t.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Lu(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)},Nu.prototype.dispatchEvent=function(t){return function(t,e){Ys(t,e)||!Hs[e.type]||!t.editable&&e.type in Ws||Hs[e.type](t,e)}(this,t)},Nu.prototype.dispatch=function(t){var e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))},Object.defineProperties(Nu.prototype,Ru);var Fu=n(233),qu=n.n(Fu),$u=new ki({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:function(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM:function(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:function(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM:function(t){return["h"+t.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:function(t){return{params:t.getAttribute("data-params")||""}}}],toDOM:function(t){return["pre",t.attrs.params?{"data-params":t.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs:function(t){return{order:t.hasAttribute("start")?+t.getAttribute("start"):1,tight:t.hasAttribute("data-tight")}}}],toDOM:function(t){return["ol",{start:1==t.attrs.order?null:t.attrs.order,"data-tight":t.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:function(t){return{tight:t.hasAttribute("data-tight")}}}],toDOM:function(t){return["ul",{"data-tight":t.attrs.tight?"true":null},0]}},list_item:{content:"paragraph block*",defining:!0,parseDOM:[{tag:"li"}],toDOM:function(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs:function(t){return{src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")}}}],toDOM:function(t){return["img",t.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:function(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:function(t){return"italic"==t&&null}}],toDOM:function(){return["em"]}},strong:{parseDOM:[{tag:"b"},{tag:"strong"},{style:"font-weight",getAttrs:function(t){return/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}}],toDOM:function(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:function(t){return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM:function(t){return["a",t.attrs]}},code:{parseDOM:[{tag:"code"}],toDOM:function(){return["code"]}}}});var Vu=function(t,e){this.schema=t,this.stack=[{type:t.topNodeType,content:[]}],this.marks=Dr.none,this.tokenHandlers=e};function Uu(t,e,n,r){return t.getAttrs?t.getAttrs(e,n,r):t.attrs instanceof Function?t.attrs(e):t.attrs}function Hu(t,e){return t.noCloseToken||"code_inline"==e||"code_block"==e||"fence"==e}function Wu(t){return"\n"==t[t.length-1]?t.slice(0,t.length-1):t}function Zu(){}Vu.prototype.top=function(){return this.stack[this.stack.length-1]},Vu.prototype.push=function(t){this.stack.length&&this.top().content.push(t)},Vu.prototype.addText=function(t){if(t){var e,n=this.top().content,r=n[n.length-1],i=this.schema.text(t,this.marks);r&&(e=function(t,e){if(t.isText&&e.isText&&Dr.sameSet(t.marks,e.marks))return t.withText(t.text+e.text)}(r,i))?n[n.length-1]=e:n.push(i)}},Vu.prototype.openMark=function(t){this.marks=t.addToSet(this.marks)},Vu.prototype.closeMark=function(t){this.marks=t.removeFromSet(this.marks)},Vu.prototype.parseTokens=function(t){for(var e=0;e<t.length;e++){var n=t[e],r=this.tokenHandlers[n.type];if(!r)throw new Error("Token type `"+n.type+"` not supported by Markdown parser");r(this,n,t,e)}},Vu.prototype.addNode=function(t,e,n){var r=t.createAndFill(e,n,this.marks);return r?(this.push(r),r):null},Vu.prototype.openNode=function(t,e){this.stack.push({type:t,attrs:e,content:[]})},Vu.prototype.closeNode=function(){this.marks.length&&(this.marks=Dr.none);var t=this.stack.pop();return this.addNode(t.type,t.attrs,t.content)};var Ju=function(t,e,n){this.tokens=n,this.schema=t,this.tokenizer=e,this.tokenHandlers=function(t,e){var n=Object.create(null),r=function(r){var i=e[r];if(i.block){var o=t.nodeType(i.block);Hu(i,r)?n[r]=function(t,e,n,r){t.openNode(o,Uu(i,e,n,r)),t.addText(Wu(e.content)),t.closeNode()}:(n[r+"_open"]=function(t,e,n,r){return t.openNode(o,Uu(i,e,n,r))},n[r+"_close"]=function(t){return t.closeNode()})}else if(i.node){var a=t.nodeType(i.node);n[r]=function(t,e,n,r){return t.addNode(a,Uu(i,e,n,r))}}else if(i.mark){var s=t.marks[i.mark];Hu(i,r)?n[r]=function(t,e,n,r){t.openMark(s.create(Uu(i,e,n,r))),t.addText(Wu(e.content)),t.closeMark(s)}:(n[r+"_open"]=function(t,e,n,r){return t.openMark(s.create(Uu(i,e,n,r)))},n[r+"_close"]=function(t){return t.closeMark(s)})}else{if(!i.ignore)throw new RangeError("Unrecognized parsing spec "+JSON.stringify(i));Hu(i,r)?n[r]=Zu:(n[r+"_open"]=Zu,n[r+"_close"]=Zu)}};for(var i in e)r(i);return n.text=function(t,e){return t.addText(e.content)},n.inline=function(t,e){return t.parseTokens(e.children)},n.softbreak=n.softbreak||function(t){return t.addText("\n")},n}(t,n)};function Yu(t,e){for(;++e<t.length;)if("list_item_open"!=t[e].type)return t[e].hidden;return!1}Ju.prototype.parse=function(t){var e,n=new Vu(this.schema,this.tokenHandlers);n.parseTokens(this.tokenizer.parse(t,{}));do{e=n.closeNode()}while(n.stack.length);return e};var Ku=new Ju($u,qu()("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:function(t,e,n){return{tight:Yu(e,n)}}},ordered_list:{block:"ordered_list",getAttrs:function(t,e,n){return{order:+t.attrGet("start")||1,tight:Yu(e,n)}}},heading:{block:"heading",getAttrs:function(t){return{level:+t.tag.slice(1)}}},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:function(t){return{params:t.info||""}},noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:function(t){return{src:t.attrGet("src"),title:t.attrGet("title")||null,alt:t.children[0]&&t.children[0].content||null}}},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:function(t){return{href:t.attrGet("href"),title:t.attrGet("title")||null}}},code_inline:{mark:"code",noCloseToken:!0}}),Gu=function(t,e){this.nodes=t,this.marks=e};Gu.prototype.serialize=function(t,e){var n=new ec(this.nodes,this.marks,e);return n.renderContent(t),n.out};var Xu=new Gu({blockquote:function(t,e){t.wrapBlock("> ",null,e,(function(){return t.renderContent(e)}))},code_block:function(t,e){t.write("```"+(e.attrs.params||"")+"\n"),t.text(e.textContent,!1),t.ensureNewLine(),t.write("```"),t.closeBlock(e)},heading:function(t,e){t.write(t.repeat("#",e.attrs.level)+" "),t.renderInline(e),t.closeBlock(e)},horizontal_rule:function(t,e){t.write(e.attrs.markup||"---"),t.closeBlock(e)},bullet_list:function(t,e){t.renderList(e," ",(function(){return(e.attrs.bullet||"*")+" "}))},ordered_list:function(t,e){var n=e.attrs.order||1,r=String(n+e.childCount-1).length,i=t.repeat(" ",r+2);t.renderList(e,i,(function(e){var i=String(n+e);return t.repeat(" ",r-i.length)+i+". "}))},list_item:function(t,e){t.renderContent(e)},paragraph:function(t,e){t.renderInline(e),t.closeBlock(e)},image:function(t,e){t.write("!["+t.esc(e.attrs.alt||"")+"]("+t.esc(e.attrs.src)+(e.attrs.title?" "+t.quote(e.attrs.title):"")+")")},hard_break:function(t,e,n,r){for(var i=r+1;i<n.childCount;i++)if(n.child(i).type!=e.type)return void t.write("\\\n")},text:function(t,e){t.text(e.text)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open:function(t,e,n,r){return tc(e,n,r,1)?"<":"["},close:function(t,e,n,r){return tc(e,n,r,-1)?">":"]("+t.esc(e.attrs.href)+(e.attrs.title?" "+t.quote(e.attrs.title):"")+")"}},code:{open:function(t,e,n,r){return Qu(n.child(r),-1)},close:function(t,e,n,r){return Qu(n.child(r-1),1)},escape:!1}});function Qu(t,e){var n,r=/`+/g,i=0;if(t.isText)for(;n=r.exec(t.text);)i=Math.max(i,n[0].length);for(var o=i>0&&e>0?" `":"`",a=0;a<i;a++)o+="`";return i>0&&e<0&&(o+=" "),o}function tc(t,e,n,r){if(t.attrs.title||!/^\w+:/.test(t.attrs.href))return!1;var i=e.child(n+(r<0?-1:0));if(!i.isText||i.text!=t.attrs.href||i.marks[i.marks.length-1]!=t)return!1;if(n==(r<0?1:e.childCount-1))return!0;var o=e.child(n+(r<0?-2:1));return!t.isInSet(o.marks)}var ec=function(t,e,n){this.nodes=t,this.marks=e,this.delim=this.out="",this.closed=!1,this.inTightList=!1,this.options=n||{},"undefined"==typeof this.options.tightLists&&(this.options.tightLists=!1)};ec.prototype.flushClose=function(t){if(this.closed){if(this.atBlank()||(this.out+="\n"),null==t&&(t=2),t>1){var e=this.delim,n=/\s+$/.exec(e);n&&(e=e.slice(0,e.length-n[0].length));for(var r=1;r<t;r++)this.out+=e+"\n"}this.closed=!1}},ec.prototype.wrapBlock=function(t,e,n,r){var i=this.delim;this.write(e||t),this.delim+=t,r(),this.delim=i,this.closeBlock(n)},ec.prototype.atBlank=function(){return/(^|\n)$/.test(this.out)},ec.prototype.ensureNewLine=function(){this.atBlank()||(this.out+="\n")},ec.prototype.write=function(t){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),t&&(this.out+=t)},ec.prototype.closeBlock=function(t){this.closed=t},ec.prototype.text=function(t,e){for(var n=t.split("\n"),r=0;r<n.length;r++){var i=this.atBlank()||this.closed;this.write(),this.out+=!1!==e?this.esc(n[r],i):n[r],r!=n.length-1&&(this.out+="\n")}},ec.prototype.render=function(t,e,n){if("number"==typeof e)throw new Error("!");if(!this.nodes[t.type.name])throw new Error("Token type `"+t.type.name+"` not supported by Markdown renderer");this.nodes[t.type.name](this,t,e,n)},ec.prototype.renderContent=function(t){var e=this;t.forEach((function(n,r,i){return e.render(n,t,i)}))},ec.prototype.renderInline=function(t){var e=this,n=[],r="",i=function(i,o,a){var s=i?i.marks:[];i&&"hard_break"===i.type.name&&(s=s.filter((function(e){if(a+1==t.childCount)return!1;var n=t.child(a+1);return e.isInSet(n.marks)&&(!n.isText||/\S/.test(n.text))})));var u=r;if(r="",i&&i.isText&&s.some((function(t){var n=e.marks[t.type.name];return n&&n.expelEnclosingWhitespace}))){var c=/^(\s*)(.*?)(\s*)$/m.exec(i.text),l=(c[0],c[1]),h=c[2],f=c[3];u+=l,r=f,(l||f)&&((i=h?i.withText(h):null)||(s=n))}var d=s.length&&s[s.length-1],p=d&&!1===e.marks[d.type.name].escape,v=s.length-(p?1:0);t:for(var m=0;m<v;m++){var g=s[m];if(!e.marks[g.type.name].mixable)break;for(var y=0;y<n.length;y++){var b=n[y];if(!e.marks[b.type.name].mixable)break;if(g.eq(b)){m>y?s=s.slice(0,y).concat(g).concat(s.slice(y,m)).concat(s.slice(m+1,v)):y>m&&(s=s.slice(0,m).concat(s.slice(m+1,y)).concat(g).concat(s.slice(y,v)));continue t}}}for(var w=0;w<Math.min(n.length,v)&&s[w].eq(n[w]);)++w;for(;w<n.length;)e.text(e.markString(n.pop(),!1,t,a),!1);if(u&&e.text(u),i){for(;n.length<v;){var _=s[n.length];n.push(_),e.text(e.markString(_,!0,t,a),!1)}p&&i.isText?e.text(e.markString(d,!0,t,a)+i.text+e.markString(d,!1,t,a+1),!1):e.render(i,t,a)}};t.forEach(i),i(null,0,t.childCount)},ec.prototype.renderList=function(t,e,n){var r=this;this.closed&&this.closed.type==t.type?this.flushClose(3):this.inTightList&&this.flushClose(1);var i="undefined"!=typeof t.attrs.tight?t.attrs.tight:this.options.tightLists,o=this.inTightList;this.inTightList=i,t.forEach((function(o,a,s){s&&i&&r.flushClose(1),r.wrapBlock(e,n(s),t,(function(){return r.render(o,t,s)}))})),this.inTightList=o},ec.prototype.esc=function(t,e){return t=t.replace(/[`*\\~\[\]]/g,"\\$&"),e&&(t=t.replace(/^[:#\-*+]/,"\\$&").replace(/^(\s*\d+)\./,"$1\\.")),t},ec.prototype.quote=function(t){var e=-1==t.indexOf('"')?'""':-1==t.indexOf("'")?"''":"()";return e[0]+t+e[1]},ec.prototype.repeat=function(t,e){for(var n="",r=0;r<e;r++)n+=t;return n},ec.prototype.markString=function(t,e,n,r){var i=this.marks[t.type.name],o=e?i.open:i.close;return"string"==typeof o?o:o(this,t,n,r)},ec.prototype.getEnclosingWhitespace=function(t){return{leading:(t.match(/^(\s+)/)||[])[0],trailing:(t.match(/(\s+)$/)||[])[0]}};for(var nc={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},rc={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},ic="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),oc="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),ac="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),sc="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),uc="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),cc=ic&&(sc||+ic[1]<57)||ac&&sc,lc=0;lc<10;lc++)nc[48+lc]=nc[96+lc]=String(lc);for(lc=1;lc<=24;lc++)nc[lc+111]="F"+lc;for(lc=65;lc<=90;lc++)nc[lc]=String.fromCharCode(lc+32),rc[lc]=String.fromCharCode(lc);for(var hc in nc)rc.hasOwnProperty(hc)||(rc[hc]=nc[hc]);var fc="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);function dc(t){var e,n,r,i,o=t.split(/-(?!$)/),a=o[o.length-1];"Space"==a&&(a=" ");for(var s=0;s<o.length-1;s++){var u=o[s];if(/^(cmd|meta|m)$/i.test(u))i=!0;else if(/^a(lt)?$/i.test(u))e=!0;else if(/^(c|ctrl|control)$/i.test(u))n=!0;else if(/^s(hift)?$/i.test(u))r=!0;else{if(!/^mod$/i.test(u))throw new Error("Unrecognized modifier name: "+u);fc?i=!0:n=!0}}return e&&(a="Alt-"+a),n&&(a="Ctrl-"+a),i&&(a="Meta-"+a),r&&(a="Shift-"+a),a}function pc(t,e,n){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),!1!==n&&e.shiftKey&&(t="Shift-"+t),t}function vc(t){return new Ho({props:{handleKeyDown:mc(t)}})}function mc(t){var e=function(t){var e=Object.create(null);for(var n in t)e[dc(n)]=t[n];return e}(t);return function(t,n){var r,i=function(t){var e=!(cc&&(t.ctrlKey||t.altKey||t.metaKey)||(oc||uc)&&t.shiftKey&&t.key&&1==t.key.length)&&t.key||(t.shiftKey?rc:nc)[t.keyCode]||t.key||"Unidentified";return"Esc"==e&&(e="Escape"),"Del"==e&&(e="Delete"),"Left"==e&&(e="ArrowLeft"),"Up"==e&&(e="ArrowUp"),"Right"==e&&(e="ArrowRight"),"Down"==e&&(e="ArrowDown"),e}(n),o=1==i.length&&" "!=i,a=e[pc(i,n,!o)];if(a&&a(t.state,t.dispatch,t))return!0;if(o&&(n.shiftKey||n.altKey||n.metaKey||i.charCodeAt(0)>127)&&(r=nc[n.keyCode])&&r!=i){var s=e[pc(r,n,!0)];if(s&&s(t.state,t.dispatch,t))return!0}else if(o&&n.shiftKey){var u=e[pc(i,n,!0)];if(u&&u(t.state,t.dispatch,t))return!0}return!1}}var gc=200,yc=function(){};yc.prototype.append=function(t){return t.length?(t=yc.from(t),!this.length&&t||t.length<gc&&this.leafAppend(t)||this.length<gc&&t.leafPrepend(this)||this.appendInner(t)):this},yc.prototype.prepend=function(t){return t.length?yc.from(t).append(this):this},yc.prototype.appendInner=function(t){return new wc(this,t)},yc.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?yc.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},yc.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},yc.prototype.forEach=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},yc.prototype.map=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(e,n){return r.push(t(e,n))}),e,n),r},yc.from=function(t){return t instanceof yc?t:t&&t.length?new bc(t):yc.empty};var bc=function(t){function e(e){t.call(this),this.values=e}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,n){return 0==t&&n==this.length?this:new e(this.values.slice(t,n))},e.prototype.getInner=function(t){return this.values[t]},e.prototype.forEachInner=function(t,e,n,r){for(var i=e;i<n;i++)if(!1===t(this.values[i],r+i))return!1},e.prototype.forEachInvertedInner=function(t,e,n,r){for(var i=e-1;i>=n;i--)if(!1===t(this.values[i],r+i))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=gc)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=gc)return new e(t.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(yc);yc.empty=new bc([]);var wc=function(t){function e(e,n){t.call(this),this.left=e,this.right=n,this.length=e.length+n.length,this.depth=Math.max(e.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,e,n,r){var i=this.left.length;return!(e<i&&!1===this.left.forEachInner(t,e,Math.min(n,i),r))&&(!(n>i&&!1===this.right.forEachInner(t,Math.max(e-i,0),Math.min(this.length,n)-i,r+i))&&void 0)},e.prototype.forEachInvertedInner=function(t,e,n,r){var i=this.left.length;return!(e>i&&!1===this.right.forEachInvertedInner(t,e-i,Math.max(n,i)-i,r+i))&&(!(n<i&&!1===this.left.forEachInvertedInner(t,Math.min(e,i),n,r))&&void 0)},e.prototype.sliceInner=function(t,e){if(0==t&&e==this.length)return this;var n=this.left.length;return e<=n?this.left.slice(t,e):t>=n?this.right.slice(t-n,e-n):this.left.slice(t,n).append(this.right.slice(0,e-n))},e.prototype.leafAppend=function(t){var n=this.right.leafAppend(t);if(n)return new e(this.left,n)},e.prototype.leafPrepend=function(t){var n=this.left.leafPrepend(t);if(n)return new e(n,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(yc),_c=yc,xc=function(t,e){this.items=t,this.eventCount=e};xc.prototype.popEvent=function(t,e){var n=this;if(0==this.eventCount)return null;for(var r,i,o=this.items.length;;o--){if(this.items.get(o-1).selection){--o;break}}e&&(r=this.remapping(o,this.items.length),i=r.maps.length);var a,s,u=t.tr,c=[],l=[];return this.items.forEach((function(t,e){if(!t.step)return r||(r=n.remapping(o,e+1),i=r.maps.length),i--,void l.push(t);if(r){l.push(new kc(t.map));var h,f=t.step.map(r.slice(i));f&&u.maybeStep(f).doc&&(h=u.mapping.maps[u.mapping.maps.length-1],c.push(new kc(h,null,null,c.length+l.length))),i--,h&&r.appendMap(h,i)}else u.maybeStep(t.step);return t.selection?(a=r?t.selection.map(r.slice(i)):t.selection,s=new xc(n.items.slice(0,o).append(l.reverse().concat(c)),n.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:u,selection:a}},xc.prototype.addTransform=function(t,e,n,r){for(var i=[],o=this.eventCount,a=this.items,s=!r&&a.length?a.get(a.length-1):null,u=0;u<t.steps.length;u++){var c,l=t.steps[u].invert(t.docs[u]),h=new kc(t.mapping.maps[u],l,e);(c=s&&s.merge(h))&&(h=c,u?i.pop():a=a.slice(0,a.length-1)),i.push(h),e&&(o++,e=null),r||(s=h)}var f,d,p,v=o-n.depth;return v>Cc&&(d=v,(f=a).forEach((function(t,e){if(t.selection&&0==d--)return p=e,!1})),a=f.slice(p),o-=v),new xc(a.append(i),o)},xc.prototype.remapping=function(t,e){var n=new Vi;return this.items.forEach((function(e,r){var i=null!=e.mirrorOffset&&r-e.mirrorOffset>=t?n.maps.length-e.mirrorOffset:null;n.appendMap(e.map,i)}),t,e),n},xc.prototype.addMaps=function(t){return 0==this.eventCount?this:new xc(this.items.append(t.map((function(t){return new kc(t)}))),this.eventCount)},xc.prototype.rebased=function(t,e){if(!this.eventCount)return this;var n=[],r=Math.max(0,this.items.length-e),i=t.mapping,o=t.steps.length,a=this.eventCount;this.items.forEach((function(t){t.selection&&a--}),r);var s=e;this.items.forEach((function(e){var r=i.getMirror(--s);if(null!=r){o=Math.min(o,r);var u=i.maps[r];if(e.step){var c=t.steps[r].invert(t.docs[r]),l=e.selection&&e.selection.map(i.slice(s+1,r));l&&a++,n.push(new kc(u,c,l))}else n.push(new kc(u))}}),r);for(var u=[],c=e;c<o;c++)u.push(new kc(i.maps[c]));var l=this.items.slice(0,r).append(u).append(n),h=new xc(l,a);return h.emptyItemCount()>500&&(h=h.compress(this.items.length-n.length)),h},xc.prototype.emptyItemCount=function(){var t=0;return this.items.forEach((function(e){e.step||t++})),t},xc.prototype.compress=function(t){void 0===t&&(t=this.items.length);var e=this.remapping(0,t),n=e.maps.length,r=[],i=0;return this.items.forEach((function(o,a){if(a>=t)r.push(o),o.selection&&i++;else if(o.step){var s=o.step.map(e.slice(n)),u=s&&s.getMap();if(n--,u&&e.appendMap(u,n),s){var c=o.selection&&o.selection.map(e.slice(n));c&&i++;var l,h=new kc(u.invert(),s,c),f=r.length-1;(l=r.length&&r[f].merge(h))?r[f]=l:r.push(h)}}else o.map&&n--}),this.items.length,0),new xc(_c.from(r.reverse()),i)},xc.empty=new xc(_c.empty,0);var kc=function(t,e,n,r){this.map=t,this.step=e,this.selection=n,this.mirrorOffset=r};kc.prototype.merge=function(t){if(this.step&&t.step&&!t.selection){var e=t.step.merge(this.step);if(e)return new kc(e.getMap().invert(),e,this.selection)}};var Sc=function(t,e,n,r){this.done=t,this.undone=e,this.prevRanges=n,this.prevTime=r},Cc=20;function Mc(t){var e=[];return t.forEach((function(t,n,r,i){return e.push(r,i)})),e}function Ec(t,e){if(!t)return null;for(var n=[],r=0;r<t.length;r+=2){var i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}function Tc(t,e,n,r){var i=Dc(e),o=Pc.get(e).spec.config,a=(r?t.undone:t.done).popEvent(e,i);if(a){var s=a.selection.resolve(a.transform.doc),u=(r?t.done:t.undone).addTransform(a.transform,e.selection.getBookmark(),o,i),c=new Sc(r?u:a.remaining,r?a.remaining:u,null,0);n(a.transform.setSelection(s).setMeta(Pc,{redo:r,historyState:c}).scrollIntoView())}}var Ac=!1,Oc=null;function Dc(t){var e=t.plugins;if(Oc!=e){Ac=!1,Oc=e;for(var n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Ac=!0;break}}return Ac}var Pc=new Jo("history"),Lc=new Jo("closeHistory");function Nc(t){return t={depth:t&&t.depth||100,newGroupDelay:t&&t.newGroupDelay||500},new Ho({key:Pc,state:{init:function(){return new Sc(xc.empty,xc.empty,null,0)},apply:function(e,n,r){return function(t,e,n,r){var i,o=n.getMeta(Pc);if(o)return o.historyState;n.getMeta(Lc)&&(t=new Sc(t.done,t.undone,null,0));var a=n.getMeta("appendedTransaction");if(0==n.steps.length)return t;if(a&&a.getMeta(Pc))return a.getMeta(Pc).redo?new Sc(t.done.addTransform(n,null,r,Dc(e)),t.undone,Mc(n.mapping.maps[n.steps.length-1]),t.prevTime):new Sc(t.done,t.undone.addTransform(n,null,r,Dc(e)),null,t.prevTime);if(!1===n.getMeta("addToHistory")||a&&!1===a.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new Sc(t.done.rebased(n,i),t.undone.rebased(n,i),Ec(t.prevRanges,n.mapping),t.prevTime):new Sc(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Ec(t.prevRanges,n.mapping),t.prevTime);var s=0==t.prevTime||!a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;var n=!1;return t.mapping.maps[0].forEach((function(t,r){for(var i=0;i<e.length;i+=2)t<=e[i+1]&&r>=e[i]&&(n=!0)})),n}(n,t.prevRanges)),u=a?Ec(t.prevRanges,n.mapping):Mc(n.mapping.maps[n.steps.length-1]);return new Sc(t.done.addTransform(n,s?e.selection.getBookmark():null,r,Dc(e)),xc.empty,u,n.time)}(n,r,e,t)}},config:t})}function Rc(t,e){var n=Pc.getState(t);return!(!n||0==n.done.eventCount)&&(e&&Tc(n,t,e,!1),!0)}function Ic(t,e){var n=Pc.getState(t);return!(!n||0==n.undone.eventCount)&&(e&&Tc(n,t,e,!0),!0)}function zc(t,e){return!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0)}function Bc(t,e){for(;t;t="start"==e?t.firstChild:t.lastChild)if(t.isTextblock)return!0;return!1}function jc(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function Fc(t){if(!t.parent.type.spec.isolating)for(var e=t.depth-1;e>=0;e--){var n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}function qc(t,e){var n,r=t.selection,i=r instanceof Oo;if(i){if(r.node.isTextblock||!oo(t.doc,r.from))return!1;n=r.from}else if(null==(n=so(t.doc,r.from,-1)))return!1;if(e){var o=t.tr.join(n);i&&o.setSelection(Oo.create(o.doc,n-t.doc.resolve(n).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0}function $c(t,e){var n,r=t.selection;if(r instanceof Oo){if(r.node.isTextblock||!oo(t.doc,r.to))return!1;n=r.to}else if(null==(n=so(t.doc,r.to,1)))return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0}function Vc(t,e){var n=t.selection,r=n.$from,i=n.$to,o=r.blockRange(i),a=o&&eo(o);return null!=a&&(e&&e(t.tr.lift(o,a).scrollIntoView()),!0)}function Uc(t){for(var e=0;e<t.edgeCount;e++){var n=t.edge(e).type;if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Hc(t,e){var n=t.selection,r=n.$head,i=n.$anchor;if(!r.parent.type.spec.code||!r.sameParent(i))return!1;var o=r.node(-1),a=r.indexAfter(-1),s=Uc(o.contentMatchAt(a));if(!o.canReplaceWith(a,a,s))return!1;if(e){var u=r.after(),c=t.tr.replaceWith(u,u,s.createAndFill());c.setSelection(Co.near(c.doc.resolve(u),1)),e(c.scrollIntoView())}return!0}function Wc(t,e){var n=t.selection,r=n.$from,i=n.$to;if(t.selection instanceof Oo&&t.selection.node.isBlock)return!(!r.parentOffset||!io(t.doc,r.pos))&&(e&&e(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(e){var o=i.parentOffset==i.parent.content.size,a=t.tr;(t.selection instanceof To||t.selection instanceof Po)&&a.deleteSelection();var s=0==r.depth?null:Uc(r.node(-1).contentMatchAt(r.indexAfter(-1))),u=o&&s?[{type:s}]:null,c=io(a.doc,a.mapping.map(r.pos),1,u);u||c||!io(a.doc,a.mapping.map(r.pos),1,s&&[{type:s}])||(u=[{type:s}],c=!0),c&&(a.split(a.mapping.map(r.pos),1,u),o||r.parentOffset||r.parent.type==s||!r.node(-1).canReplace(r.index(-1),r.indexAfter(-1),Mr.from([s.create(),r.parent]))||a.setNodeMarkup(a.mapping.map(r.before()),s)),e(a.scrollIntoView())}return!0}function Zc(t,e){var n,r=t.selection,i=r.$from,o=r.to,a=i.sharedDepth(o);return 0!=a&&(n=i.before(a),e&&e(t.tr.setSelection(Oo.create(t.doc,n))),!0)}function Jc(t,e,n){var r,i,o=e.nodeBefore,a=e.nodeAfter;if(o.type.spec.isolating||a.type.spec.isolating)return!1;if(function(t,e,n){var r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!!(r&&i&&r.type.compatibleContent(i.type))&&(!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!(!e.parent.canReplace(o,o+1)||!i.isTextblock&&!oo(t.doc,e.pos))&&(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0))}(t,e,n))return!0;var s=e.parent.canReplace(e.index(),e.index()+1);if(s&&(r=(i=o.contentMatchAt(o.childCount)).findWrapping(a.type))&&i.matchType(r[0]||a.type).validEnd){if(n){for(var u=e.pos+a.nodeSize,c=Mr.empty,l=r.length-1;l>=0;l--)c=Mr.from(r[l].create(null,c));c=Mr.from(o.copy(c));var h=t.tr.step(new Xi(e.pos-1,u,e.pos,u,new Lr(c,1,0),r.length,!0)),f=u+2*r.length;oo(h.doc,f)&&h.join(f),n(h.scrollIntoView())}return!0}var d=Co.findFrom(e,1),p=d&&d.$from.blockRange(d.$to),v=p&&eo(p);if(null!=v&&v>=e.depth)return n&&n(t.tr.lift(p,v).scrollIntoView()),!0;if(s&&a.isTextblock&&Bc(o,"end")){for(var m=o,g=[];g.push(m),!m.isTextblock;)m=m.lastChild;if(m.canReplace(m.childCount,m.childCount,a.content)){if(n){for(var y=Mr.empty,b=g.length-1;b>=0;b--)y=Mr.from(g[b].copy(y));n(t.tr.step(new Xi(e.pos-g.length,e.pos+a.nodeSize,e.pos+1,e.pos+a.nodeSize-1,new Lr(y,g.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Yc(t,e){return function(n,r){var i=n.selection,o=i.$from,a=i.$to,s=o.blockRange(a),u=s&&no(s,t,e);return!!u&&(r&&r(n.tr.wrap(s,u).scrollIntoView()),!0)}}function Kc(t,e){return function(n,r){var i=n.selection,o=i.from,a=i.to,s=!1;return n.doc.nodesBetween(o,a,(function(r,i){if(s)return!1;if(r.isTextblock&&!r.hasMarkup(t,e))if(r.type==t)s=!0;else{var o=n.doc.resolve(i),a=o.index();s=o.parent.canReplaceWith(a,a+1,t)}})),!!s&&(r&&r(n.tr.setBlockType(o,a,t,e).scrollIntoView()),!0)}}function Gc(t,e){return function(n,r){var i=n.selection,o=i.empty,a=i.$cursor,s=i.ranges;if(o&&!a||!function(t,e,n){for(var r=function(r){var i=e[r],o=i.$from,a=i.$to,s=0==o.depth&&t.type.allowsMarkType(n);if(t.nodesBetween(o.pos,a.pos,(function(t){if(s)return!1;s=t.inlineContent&&t.type.allowsMarkType(n)})),s)return{v:!0}},i=0;i<e.length;i++){var o=r(i);if(o)return o.v}return!1}(n.doc,s,t))return!1;if(r)if(a)t.isInSet(n.storedMarks||a.marks())?r(n.tr.removeStoredMark(t)):r(n.tr.addStoredMark(t.create(e)));else{for(var u=!1,c=n.tr,l=0;!u&&l<s.length;l++){var h=s[l],f=h.$from,d=h.$to;u=n.doc.rangeHasMark(f.pos,d.pos,t)}for(var p=0;p<s.length;p++){var v=s[p],m=v.$from,g=v.$to;if(u)c.removeMark(m.pos,g.pos,t);else{var y=m.pos,b=g.pos,w=m.nodeAfter,_=g.nodeBefore,x=w&&w.isText?/^\s*/.exec(w.text)[0].length:0,k=_&&_.isText?/\s*$/.exec(_.text)[0].length:0;y+x<b&&(y+=x,b-=k),c.addMark(y,b,t.create(e))}}r(c.scrollIntoView())}return!0}}function Xc(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return function(e,n,r){for(var i=0;i<t.length;i++)if(t[i](e,n,r))return!0;return!1}}var Qc=Xc(zc,(function(t,e,n){var r=t.selection.$cursor;if(!r||(n?!n.endOfTextblock("backward",t):r.parentOffset>0))return!1;var i=jc(r);if(!i){var o=r.blockRange(),a=o&&eo(o);return null!=a&&(e&&e(t.tr.lift(o,a).scrollIntoView()),!0)}var s=i.nodeBefore;if(!s.type.spec.isolating&&Jc(t,i,e))return!0;if(0==r.parent.content.size&&(Bc(s,"end")||Oo.isSelectable(s))){if(e){var u=t.tr.deleteRange(r.before(),r.after());u.setSelection(Bc(s,"end")?Co.findFrom(u.doc.resolve(u.mapping.map(i.pos,-1)),-1):Oo.create(u.doc,i.pos-s.nodeSize)),e(u.scrollIntoView())}return!0}return!(!s.isAtom||i.depth!=r.depth-1)&&(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0)}),(function(t,e,n){var r=t.selection,i=r.$head,o=i;if(!r.empty)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):i.parentOffset>0)return!1;o=jc(i)}var a=o&&o.nodeBefore;return!(!a||!Oo.isSelectable(a))&&(e&&e(t.tr.setSelection(Oo.create(t.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)})),tl=Xc(zc,(function(t,e,n){var r=t.selection.$cursor;if(!r||(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size))return!1;var i=Fc(r);if(!i)return!1;var o=i.nodeAfter;if(Jc(t,i,e))return!0;if(0==r.parent.content.size&&(Bc(o,"start")||Oo.isSelectable(o))){if(e){var a=t.tr.deleteRange(r.before(),r.after());a.setSelection(Bc(o,"start")?Co.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):Oo.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}return!(!o.isAtom||i.depth!=r.depth-1)&&(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0)}),(function(t,e,n){var r=t.selection,i=r.$head,o=i;if(!r.empty)return!1;if(i.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):i.parentOffset<i.parent.content.size)return!1;o=Fc(i)}var a=o&&o.nodeAfter;return!(!a||!Oo.isSelectable(a))&&(e&&e(t.tr.setSelection(Oo.create(t.doc,o.pos)).scrollIntoView()),!0)})),el={Enter:Xc((function(t,e){var n=t.selection,r=n.$head,i=n.$anchor;return!(!r.parent.type.spec.code||!r.sameParent(i))&&(e&&e(t.tr.insertText("\n").scrollIntoView()),!0)}),(function(t,e){var n=t.selection,r=n.$from,i=n.$to;if(!(n instanceof Oo)||r.parent.inlineContent)return!1;var o=Uc(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){var a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=t.tr.insert(a,o.createAndFill());s.setSelection(To.create(s.doc,a+1)),e(s.scrollIntoView())}return!0}),(function(t,e){var n=t.selection.$cursor;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){var r=n.before();if(io(t.doc,r))return e&&e(t.tr.split(r).scrollIntoView()),!0}var i=n.blockRange(),o=i&&eo(i);return null!=o&&(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)}),Wc),"Mod-Enter":Hc,Backspace:Qc,"Mod-Backspace":Qc,Delete:tl,"Mod-Delete":tl,"Mod-a":function(t,e){return e&&e(t.tr.setSelection(new Po(t.doc))),!0}},nl={"Ctrl-h":el.Backspace,"Alt-Backspace":el["Mod-Backspace"],"Ctrl-d":el.Delete,"Ctrl-Alt-Backspace":el["Mod-Delete"],"Alt-Delete":el["Mod-Delete"],"Alt-d":el["Mod-Delete"]};for(var rl in el)nl[rl]=el[rl];var il=("undefined"!=typeof navigator?/Mac/.test(navigator.platform):"undefined"!=typeof os&&"darwin"==os.platform())?nl:el;function ol(t){return void 0===t&&(t={}),new Ho({view:function(e){return new al(e,t)}})}var al=function(t,e){var n=this;this.editorView=t,this.width=e.width||1,this.color=e.color||"black",this.class=e.class,this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(e){var r=function(t){return n[e](t)};return t.dom.addEventListener(e,r),{name:e,handler:r}}))};al.prototype.destroy=function(){var t=this;this.handlers.forEach((function(e){var n=e.name,r=e.handler;return t.editorView.dom.removeEventListener(n,r)}))},al.prototype.update=function(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&this.updateOverlay()},al.prototype.setCursor=function(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())},al.prototype.updateOverlay=function(){var t,e=this.editorView.state.doc.resolve(this.cursorPos);if(!e.parent.inlineContent){var n=e.nodeBefore,r=e.nodeAfter;if(n||r){var i=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),o=n?i.bottom:i.top;n&&r&&(o=(o+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),t={left:i.left,right:i.right,top:o-this.width/2,bottom:o+this.width/2}}}if(!t){var a=this.editorView.coordsAtPos(this.cursorPos);t={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}var s,u,c=this.editorView.dom.offsetParent;if(this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!c||c==document.body&&"static"==getComputedStyle(c).position)s=-pageXOffset,u=-pageYOffset;else{var l=c.getBoundingClientRect();s=l.left-c.scrollLeft,u=l.top-c.scrollTop}this.element.style.left=t.left-s+"px",this.element.style.top=t.top-u+"px",this.element.style.width=t.right-t.left+"px",this.element.style.height=t.bottom-t.top+"px"},al.prototype.scheduleRemoval=function(t){var e=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return e.setCursor(null)}),t)},al.prototype.dragover=function(t){if(this.editorView.editable){var e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY});if(e){var n=e.pos;this.editorView.dragging&&this.editorView.dragging.slice&&null==(n=uo(this.editorView.state.doc,n,this.editorView.dragging.slice))&&(n=e.pos),this.setCursor(n),this.scheduleRemoval(5e3)}}},al.prototype.dragend=function(){this.scheduleRemoval(20)},al.prototype.drop=function(){this.scheduleRemoval(20)},al.prototype.dragleave=function(t){t.target!=this.editorView.dom&&this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)};var sl=function(t){function e(e){t.call(this,e,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.map=function(n,r){var i=n.resolve(r.map(this.head));return e.valid(i)?new e(i):t.near(i)},e.prototype.content=function(){return Lr.empty},e.prototype.eq=function(t){return t instanceof e&&t.head==this.head},e.prototype.toJSON=function(){return{type:"gapcursor",pos:this.head}},e.fromJSON=function(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new e(t.resolve(n.pos))},e.prototype.getBookmark=function(){return new ul(this.anchor)},e.valid=function(t){var e=t.parent;if(e.isTextblock||!function(t){for(var e=t.depth;e>=0;e--){var n=t.index(e);if(0!=n)for(var r=t.node(e).child(n-1);;r=r.lastChild){if(0==r.childCount&&!r.inlineContent||r.isAtom||r.type.spec.isolating)return!0;if(r.inlineContent)return!1}}return!0}(t)||!function(t){for(var e=t.depth;e>=0;e--){var n=t.indexAfter(e),r=t.node(e);if(n!=r.childCount)for(var i=r.child(n);;i=i.firstChild){if(0==i.childCount&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}(t))return!1;var n=e.type.spec.allowGapCursor;if(null!=n)return n;var r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock},e.findFrom=function(t,n,r){t:for(;;){if(!r&&e.valid(t))return t;for(var i=t.pos,o=null,a=t.depth;;a--){var s=t.node(a);if(n>0?t.indexAfter(a)<s.childCount:t.index(a)>0){o=s.child(n>0?t.indexAfter(a):t.index(a)-1);break}if(0==a)return null;i+=n;var u=t.doc.resolve(i);if(e.valid(u))return u}for(;;){var c=n>0?o.firstChild:o.lastChild;if(!c){if(o.isAtom&&!o.isText&&!Oo.isSelectable(o)){t=t.doc.resolve(i+o.nodeSize*n),r=!1;continue t}break}o=c,i+=n;var l=t.doc.resolve(i);if(e.valid(l))return l}return null}},e}(Co);sl.prototype.visible=!1,Co.jsonID("gapcursor",sl);var ul=function(t){this.pos=t};ul.prototype.map=function(t){return new ul(t.map(this.pos))},ul.prototype.resolve=function(t){var e=t.resolve(this.pos);return sl.valid(e)?new sl(e):Co.near(e)};var cl=mc({ArrowLeft:ll("horiz",-1),ArrowRight:ll("horiz",1),ArrowUp:ll("vert",-1),ArrowDown:ll("vert",1)});function ll(t,e){var n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,r,i){var o=t.selection,a=e>0?o.$to:o.$from,s=o.empty;if(o instanceof To){if(!i.endOfTextblock(n)||0==a.depth)return!1;s=!1,a=t.doc.resolve(e>0?a.after():a.before())}var u=sl.findFrom(a,e,s);return!!u&&(r&&r(t.tr.setSelection(new sl(u))),!0)}}function hl(t,e,n){if(!t.editable)return!1;var r=t.state.doc.resolve(e);if(!sl.valid(r))return!1;var i=t.posAtCoords({left:n.clientX,top:n.clientY}).inside;return!(i>-1&&Oo.isSelectable(t.state.doc.nodeAt(i)))&&(t.dispatch(t.state.tr.setSelection(new sl(r))),!0)}function fl(t){if(!(t.selection instanceof sl))return null;var e=document.createElement("div");return e.className="ProseMirror-gapcursor",ku.create(t.doc,[bu.widget(t.selection.head,e,{key:"gapcursor"})])}function dl(t){return(dl="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function pl(){var t=arguments[0];"string"==typeof t&&(t=document.createElement(t));var e=1,n=arguments[1];if(n&&"object"==dl(n)&&null==n.nodeType&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];"string"==typeof i?t.setAttribute(r,i):null!=i&&(t[r]=i)}e++}for(;e<arguments.length;e++)vl(t,arguments[e]);return t}function vl(t,e){if("string"==typeof e)t.appendChild(document.createTextNode(e));else if(null==e);else if(null!=e.nodeType)t.appendChild(e);else{if(!Array.isArray(e))throw new RangeError("Unsupported child node: "+e);for(var n=0;n<e.length;n++)vl(t,e[n])}}var ml="http://www.w3.org/2000/svg",gl="ProseMirror-icon";function yl(t){var e=document.createElement("div");if(e.className=gl,t.path){var n="pm-icon-"+function(t){for(var e=0,n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n)|0;return e}(t.path).toString(16);document.getElementById(n)||function(t,e){var n=document.getElementById(gl+"-collection");n||((n=document.createElementNS(ml,"svg")).id=gl+"-collection",n.style.display="none",document.body.insertBefore(n,document.body.firstChild));var r=document.createElementNS(ml,"symbol");r.id=t,r.setAttribute("viewBox","0 0 "+e.width+" "+e.height),r.appendChild(document.createElementNS(ml,"path")).setAttribute("d",e.path),n.appendChild(r)}(n,t);var r=e.appendChild(document.createElementNS(ml,"svg"));r.style.width=t.width/t.height+"em",r.appendChild(document.createElementNS(ml,"use")).setAttributeNS("http://www.w3.org/1999/xlink","href",/([^#]*)/.exec(document.location)[1]+"#"+n)}else t.dom?e.appendChild(t.dom.cloneNode(!0)):(e.appendChild(document.createElement("span")).textContent=t.text||"",t.css&&(e.firstChild.style.cssText=t.css));return e}var bl="ProseMirror-menu",wl=function(t){this.spec=t};function _l(t,e){return t._props.translate?t._props.translate(e):e}wl.prototype.render=function(t){var e=this.spec,n=e.render?e.render(t):e.icon?yl(e.icon):e.label?pl("div",null,_l(t,e.label)):null;if(!n)throw new RangeError("MenuItem without icon or label property");if(e.title){var r="function"===typeof e.title?e.title(t.state):e.title;n.setAttribute("title",_l(t,r))}return e.class&&n.classList.add(e.class),e.css&&(n.style.cssText+=e.css),n.addEventListener("mousedown",(function(r){r.preventDefault(),n.classList.contains(bl+"-disabled")||e.run(t.state,t.dispatch,t,r)})),{dom:n,update:function(t){if(e.select){var r=e.select(t);if(n.style.display=r?"":"none",!r)return!1}var i=!0;if(e.enable&&(i=e.enable(t)||!1,Il(n,bl+"-disabled",!i)),e.active){var o=i&&e.active(t)||!1;Il(n,bl+"-active",o)}return!0}}};var xl={time:0,node:null};function kl(t){xl.time=Date.now(),xl.node=t.target}function Sl(t){return Date.now()-100<xl.time&&xl.node&&t.contains(xl.node)}var Cl=function(t,e){this.options=e||{},this.content=Array.isArray(t)?t:[t]};function Ml(t,e){for(var n=[],r=[],i=0;i<t.length;i++){var o=t[i].render(e),a=o.dom,s=o.update;n.push(pl("div",{class:bl+"-dropdown-item"},a)),r.push(s)}return{dom:n,update:El(r,n)}}function El(t,e){return function(n){for(var r=!1,i=0;i<t.length;i++){var o=t[i](n);e[i].style.display=o?"":"none",o&&(r=!0)}return r}}Cl.prototype.render=function(t){var e=this,n=Ml(this.content,t),r=pl("div",{class:bl+"-dropdown "+(this.options.class||""),style:this.options.css},_l(t,this.options.label));this.options.title&&r.setAttribute("title",_l(t,this.options.title));var i=pl("div",{class:bl+"-dropdown-wrap"},r),o=null,a=null,s=function(){o&&o.close()&&(o=null,window.removeEventListener("mousedown",a))};return r.addEventListener("mousedown",(function(t){t.preventDefault(),kl(t),o?s():(o=e.expand(i,n.dom),window.addEventListener("mousedown",a=function(){Sl(i)||s()}))})),{dom:i,update:function(t){var e=n.update(t);return i.style.display=e?"":"none",e}}},Cl.prototype.expand=function(t,e){var n=pl("div",{class:bl+"-dropdown-menu "+(this.options.class||"")},e),r=!1;return t.appendChild(n),{close:function(){if(!r)return r=!0,t.removeChild(n),!0},node:n}};var Tl=function(t,e){this.options=e||{},this.content=Array.isArray(t)?t:[t]};Tl.prototype.render=function(t){var e=Ml(this.content,t),n=pl("div",{class:bl+"-submenu-label"},_l(t,this.options.label)),r=pl("div",{class:bl+"-submenu-wrap"},n,pl("div",{class:bl+"-submenu"},e.dom)),i=null;return n.addEventListener("mousedown",(function(t){t.preventDefault(),kl(t),Il(r,bl+"-submenu-wrap-active"),i||window.addEventListener("mousedown",i=function(){Sl(r)||(r.classList.remove(bl+"-submenu-wrap-active"),window.removeEventListener("mousedown",i),i=null)})})),{dom:r,update:function(t){var n=e.update(t);return r.style.display=n?"":"none",n}}};var Al={join:{width:800,height:900,path:"M0 75h800v125h-800z M0 825h800v-125h-800z M250 400h100v-100h100v100h100v100h-100v100h-100v-100h-100z"},lift:{width:1024,height:1024,path:"M219 310v329q0 7-5 12t-12 5q-8 0-13-5l-164-164q-5-5-5-13t5-13l164-164q5-5 13-5 7 0 12 5t5 12zM1024 749v109q0 7-5 12t-12 5h-987q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h987q7 0 12 5t5 12zM1024 530v109q0 7-5 12t-12 5h-621q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h621q7 0 12 5t5 12zM1024 310v109q0 7-5 12t-12 5h-621q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h621q7 0 12 5t5 12zM1024 91v109q0 7-5 12t-12 5h-987q-7 0-12-5t-5-12v-109q0-7 5-12t12-5h987q7 0 12 5t5 12z"},selectParentNode:{text:"\u2b1a",css:"font-weight: bold"},undo:{width:1024,height:1024,path:"M761 1024c113-206 132-520-313-509v253l-384-384 384-384v248c534-13 594 472 313 775z"},redo:{width:1024,height:1024,path:"M576 248v-248l384 384-384 384v-253c-446-10-427 303-313 509-280-303-221-789 313-775z"},strong:{width:805,height:1024,path:"M317 869q42 18 80 18 214 0 214-191 0-65-23-102-15-25-35-42t-38-26-46-14-48-6-54-1q-41 0-57 5 0 30-0 90t-0 90q0 4-0 38t-0 55 2 47 6 38zM309 442q24 4 62 4 46 0 81-7t62-25 42-51 14-81q0-40-16-70t-45-46-61-24-70-8q-28 0-74 7 0 28 2 86t2 86q0 15-0 45t-0 45q0 26 0 39zM0 950l1-53q8-2 48-9t60-15q4-6 7-15t4-19 3-18 1-21 0-19v-37q0-561-12-585-2-4-12-8t-25-6-28-4-27-2-17-1l-2-47q56-1 194-6t213-5q13 0 39 0t38 0q40 0 78 7t73 24 61 40 42 59 16 78q0 29-9 54t-22 41-36 32-41 25-48 22q88 20 146 76t58 141q0 57-20 102t-53 74-78 48-93 27-100 8q-25 0-75-1t-75-1q-60 0-175 6t-132 6z"},em:{width:585,height:1024,path:"M0 949l9-48q3-1 46-12t63-21q16-20 23-57 0-4 35-165t65-310 29-169v-14q-13-7-31-10t-39-4-33-3l10-58q18 1 68 3t85 4 68 1q27 0 56-1t69-4 56-3q-2 22-10 50-17 5-58 16t-62 19q-4 10-8 24t-5 22-4 26-3 24q-15 84-50 239t-44 203q-1 5-7 33t-11 51-9 47-3 32l0 10q9 2 105 17-1 25-9 56-6 0-18 0t-18 0q-16 0-49-5t-49-5q-78-1-117-1-29 0-81 5t-69 6z"},code:{width:896,height:1024,path:"M608 192l-96 96 224 224-224 224 96 96 288-320-288-320zM288 192l-288 320 288 320 96-96-224-224 224-224-96-96z"},link:{width:951,height:1024,path:"M832 694q0-22-16-38l-118-118q-16-16-38-16-24 0-41 18 1 1 10 10t12 12 8 10 7 14 2 15q0 22-16 38t-38 16q-8 0-15-2t-14-7-10-8-12-12-10-10q-18 17-18 41 0 22 16 38l117 118q15 15 38 15 22 0 38-14l84-83q16-16 16-38zM430 292q0-22-16-38l-117-118q-16-16-38-16-22 0-38 15l-84 83q-16 16-16 38 0 22 16 38l118 118q15 15 38 15 24 0 41-17-1-1-10-10t-12-12-8-10-7-14-2-15q0-22 16-38t38-16q8 0 15 2t14 7 10 8 12 12 10 10q18-17 18-41zM941 694q0 68-48 116l-84 83q-47 47-116 47-69 0-116-48l-117-118q-47-47-47-116 0-70 50-119l-50-50q-49 50-118 50-68 0-116-48l-118-118q-48-48-48-116t48-116l84-83q47-47 116-47 69 0 116 48l117 118q47 47 47 116 0 70-50 119l50 50q49-50 118-50 68 0 116 48l118 118q48 48 48 116z"},bulletList:{width:768,height:896,path:"M0 512h128v-128h-128v128zM0 256h128v-128h-128v128zM0 768h128v-128h-128v128zM256 512h512v-128h-512v128zM256 256h512v-128h-512v128zM256 768h512v-128h-512v128z"},orderedList:{width:768,height:896,path:"M320 512h448v-128h-448v128zM320 768h448v-128h-448v128zM320 128v128h448v-128h-448zM79 384h78v-256h-36l-85 23v50l43-2v185zM189 590c0-36-12-78-96-78-33 0-64 6-83 16l1 66c21-10 42-15 67-15s32 11 32 28c0 26-30 58-110 112v50h192v-67l-91 2c49-30 87-66 87-113l1-1z"},blockquote:{width:640,height:896,path:"M0 448v256h256v-256h-128c0 0 0-128 128-128v-128c0 0-256 0-256 256zM640 320v-128c0 0-256 0-256 256v256h256v-256h-128c0 0 0-128 128-128z"}},Ol=new wl({title:"Join with above block",run:qc,select:function(t){return qc(t)},icon:Al.join}),Dl=new wl({title:"Lift out of enclosing block",run:Vc,select:function(t){return Vc(t)},icon:Al.lift}),Pl=new wl({title:"Select parent node",run:Zc,select:function(t){return Zc(t)},icon:Al.selectParentNode}),Ll=new wl({title:"Undo last change",run:Rc,enable:function(t){return Rc(t)},icon:Al.undo}),Nl=new wl({title:"Redo last undone change",run:Ic,enable:function(t){return Ic(t)},icon:Al.redo});function Rl(t,e){var n=Kc(t,e.attrs),r={run:n,enable:function(t){return n(t)},active:function(n){var r=n.selection,i=r.$from,o=r.to,a=r.node;return a?a.hasMarkup(t,e.attrs):o<=i.end()&&i.parent.hasMarkup(t,e.attrs)}};for(var i in e)r[i]=e[i];return new wl(r)}function Il(t,e,n){n?t.classList.add(e):t.classList.remove(e)}var zl="ProseMirror-menubar";var Bl=function(t,e){var n=this;this.editorView=t,this.options=e,this.wrapper=pl("div",{class:zl+"-wrapper"}),this.menu=this.wrapper.appendChild(pl("div",{class:zl})),this.menu.className=zl,this.spacer=null,t.dom.parentNode.replaceChild(this.wrapper,t.dom),this.wrapper.appendChild(t.dom),this.maxHeight=0,this.widthForMaxHeight=0,this.floating=!1;var r=function(t,e){for(var n=document.createDocumentFragment(),r=[],i=[],o=0;o<e.length;o++){for(var a=e[o],s=[],u=[],c=0;c<a.length;c++){var l=a[c].render(t),h=l.dom,f=l.update,d=pl("span",{class:bl+"item"},h);n.appendChild(d),u.push(d),s.push(f)}s.length&&(r.push(El(s,u)),o<e.length-1&&i.push(n.appendChild(pl("span",{class:bl+"separator"}))))}return{dom:n,update:function(t){for(var e=!1,n=!1,o=0;o<r.length;o++){var a=r[o](t);o&&(i[o-1].style.display=n&&a?"":"none"),n=a,a&&(e=!0)}return e}}}(this.editorView,this.options.content),i=r.dom,o=r.update;if(this.contentUpdate=o,this.menu.appendChild(i),this.update(),e.floating&&!function(){if("undefined"==typeof navigator)return!1;var t=navigator.userAgent;return!/Edge\/\d/.test(t)&&/AppleWebKit/.test(t)&&/Mobile\/\w+/.test(t)}()){this.updateFloat();var a=function(t){for(var e=[window],n=t.parentNode;n;n=n.parentNode)e.push(n);return e}(this.wrapper);this.scrollFunc=function(t){var e=n.editorView.root;(e.body||e).contains(n.wrapper)?n.updateFloat(t.target.getBoundingClientRect&&t.target):a.forEach((function(t){return t.removeEventListener("scroll",n.scrollFunc)}))},a.forEach((function(t){return t.addEventListener("scroll",n.scrollFunc)}))}};Bl.prototype.update=function(){this.contentUpdate(this.editorView.state),this.floating?this.updateScrollCursor():(this.menu.offsetWidth!=this.widthForMaxHeight&&(this.widthForMaxHeight=this.menu.offsetWidth,this.maxHeight=0),this.menu.offsetHeight>this.maxHeight&&(this.maxHeight=this.menu.offsetHeight,this.menu.style.minHeight=this.maxHeight+"px"))},Bl.prototype.updateScrollCursor=function(){var t=this.editorView.root.getSelection();if(t.focusNode){var e=t.getRangeAt(0).getClientRects(),n=e[function(t){if(t.anchorNode==t.focusNode)return t.anchorOffset>t.focusOffset;return t.anchorNode.compareDocumentPosition(t.focusNode)==Node.DOCUMENT_POSITION_FOLLOWING}(t)?0:e.length-1];if(n){var r=this.menu.getBoundingClientRect();if(n.top<r.bottom&&n.bottom>r.top){var i=function(t){for(var e=t.parentNode;e;e=e.parentNode)if(e.scrollHeight>e.clientHeight)return e}(this.wrapper);i&&(i.scrollTop-=r.bottom-n.top)}}}},Bl.prototype.updateFloat=function(t){var e=this.wrapper,n=e.getBoundingClientRect(),r=t?Math.max(0,t.getBoundingClientRect().top):0;if(this.floating)if(n.top>=r||n.bottom<this.menu.offsetHeight+10)this.floating=!1,this.menu.style.position=this.menu.style.left=this.menu.style.top=this.menu.style.width="",this.menu.style.display="",this.spacer.parentNode.removeChild(this.spacer),this.spacer=null;else{var i=(e.offsetWidth-e.clientWidth)/2;this.menu.style.left=n.left+i+"px",this.menu.style.display=n.top>window.innerHeight?"none":"",t&&(this.menu.style.top=r+"px")}else if(n.top<r&&n.bottom>=this.menu.offsetHeight+10){this.floating=!0;var o=this.menu.getBoundingClientRect();this.menu.style.left=o.left+"px",this.menu.style.width=o.width+"px",t&&(this.menu.style.top=r+"px"),this.menu.style.position="fixed",this.spacer=pl("div",{class:zl+"-spacer",style:"height: "+o.height+"px"}),e.insertBefore(this.spacer,this.menu)}},Bl.prototype.destroy=function(){this.wrapper.parentNode&&this.wrapper.parentNode.replaceChild(this.editorView.dom,this.wrapper)};function jl(t,e){return function(n,r){var i=n.selection,o=i.$from,a=i.$to,s=o.blockRange(a),u=!1,c=s;if(!s)return!1;if(s.depth>=2&&o.node(s.depth-1).type.compatibleContent(t)&&0==s.startIndex){if(0==o.index(s.depth-1))return!1;var l=n.doc.resolve(s.start-2);c=new Gr(l,l,s.depth),s.endIndex<s.parent.childCount&&(s=new Gr(o,n.doc.resolve(a.end(s.depth)),s.depth)),u=!0}var h=no(c,t,e,s);return!!h&&(r&&r(function(t,e,n,r,i){for(var o=Mr.empty,a=n.length-1;a>=0;a--)o=Mr.from(n[a].type.create(n[a].attrs,o));t.step(new Xi(e.start-(r?2:0),e.end,e.start,e.end,new Lr(o,0,0),n.length,!0));for(var s=0,u=0;u<n.length;u++)n[u].type==i&&(s=u+1);for(var c=n.length-s,l=e.start+n.length-(r?2:0),h=e.parent,f=e.startIndex,d=e.endIndex,p=!0;f<d;f++,p=!1)!p&&io(t.doc,l,c)&&(t.split(l,c),l+=2*c),l+=h.child(f).nodeSize;return t}(n.tr,s,h,u,t).scrollIntoView()),!0)}}function Fl(t){return function(e,n){var r=e.selection,i=r.$from,o=r.$to,a=i.blockRange(o,(function(e){return e.childCount&&e.firstChild.type==t}));return!!a&&(!n||(i.node(a.depth-1).type==t?function(t,e,n,r){var i=t.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new Xi(o-1,a,o,a,new Lr(Mr.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Gr(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));return e(i.lift(r,eo(r)).scrollIntoView()),!0}(e,n,t,a):function(t,e,n){for(var r=t.tr,i=n.parent,o=n.end,a=n.endIndex-1,s=n.startIndex;a>s;a--)o-=i.child(a).nodeSize,r.delete(o-1,o+1);var u=r.doc.resolve(n.start),c=u.nodeAfter,l=0==n.startIndex,h=n.endIndex==i.childCount,f=u.node(-1),d=u.index(-1);if(!f.canReplace(d+(l?0:1),d+1,c.content.append(h?Mr.empty:Mr.from(i))))return!1;var p=u.pos,v=p+c.nodeSize;return r.step(new Xi(p-(l?1:0),v+(h?1:0),p+1,v-1,new Lr((l?Mr.empty:Mr.from(i.copy(Mr.empty))).append(h?Mr.empty:Mr.from(i.copy(Mr.empty))),l?0:1,h?0:1),l?0:1)),e(r.scrollIntoView()),!0}(e,n,a)))}}var ql=function(t,e){var n;this.match=t,this.handler="string"==typeof e?(n=e,function(t,e,r,i){var o=n;if(e[1]){var a=e[0].lastIndexOf(e[1]);o+=e[0].slice(a+e[1].length);var s=(r+=a)-i;s>0&&(o=e[0].slice(a-s,a)+o,r=i)}return t.tr.insertText(o,r,i)}):e};function $l(t,e,n,r,i,o){if(t.composing)return!1;var a=t.state,s=a.doc.resolve(e);if(s.parent.type.spec.code)return!1;for(var u=s.parent.textBetween(Math.max(0,s.parentOffset-500),s.parentOffset,null,"\ufffc")+r,c=0;c<i.length;c++){var l=i[c].match.exec(u),h=l&&i[c].handler(a,l,e-(l[0].length-r.length),n);if(h)return t.dispatch(h.setMeta(o,{transform:h,from:e,to:n,text:r})),!0}return!1}function Vl(t,e){for(var n=t.plugins,r=0;r<n.length;r++){var i=n[r],o=void 0;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){for(var a=t.tr,s=o.transform,u=s.steps.length-1;u>=0;u--)a.step(s.steps[u].invert(s.docs[u]));if(o.text){var c=a.doc.resolve(o.from).marks();a.replaceWith(o.from,o.to,t.schema.text(o.text,c))}else a.delete(o.from,o.to);e(a)}return!0}}return!1}var Ul=new ql(/--$/,"\u2014"),Hl=new ql(/\.\.\.$/,"\u2026"),Wl=[new ql(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"\u201c"),new ql(/"$/,"\u201d"),new ql(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"\u2018"),new ql(/'$/,"\u2019")];function Zl(t,e,n,r){return new ql(t,(function(t,i,o,a){var s=n instanceof Function?n(i):n,u=t.tr.delete(o,a),c=u.doc.resolve(o).blockRange(),l=c&&no(c,e,s);if(!l)return null;u.wrap(c,l);var h=u.doc.resolve(o-1).nodeBefore;return h&&h.type==e&&oo(u.doc,o-1)&&(!r||r(i,h))&&u.join(o-1),u}))}function Jl(t,e,n){return new ql(t,(function(t,r,i,o){var a=t.doc.resolve(i),s=n instanceof Function?n(r):n;return a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),e)?t.tr.delete(i,o).setBlockType(i,i,e,s):null}))}var Yl="ProseMirror-prompt";function Kl(t){var e=document.body.appendChild(document.createElement("div"));e.className=Yl;var n=function(t){e.contains(t.target)||r()};setTimeout((function(){return window.addEventListener("mousedown",n)}),50);var r=function(){window.removeEventListener("mousedown",n),e.parentNode&&e.parentNode.removeChild(e)},i=[];for(var o in t.fields)i.push(t.fields[o].render());var a=document.createElement("button");a.type="submit",a.className=Yl+"-submit",a.textContent="OK";var s=document.createElement("button");s.type="button",s.className=Yl+"-cancel",s.textContent="Cancel",s.addEventListener("click",r);var u=e.appendChild(document.createElement("form"));t.title&&(u.appendChild(document.createElement("h5")).textContent=t.title),i.forEach((function(t){u.appendChild(document.createElement("div")).appendChild(t)}));var c=u.appendChild(document.createElement("div"));c.className=Yl+"-buttons",c.appendChild(a),c.appendChild(document.createTextNode(" ")),c.appendChild(s);var l=e.getBoundingClientRect();e.style.top=(window.innerHeight-l.height)/2+"px",e.style.left=(window.innerWidth-l.width)/2+"px";var h=function(){var e=function(t,e){var n=Object.create(null),r=0;for(var i in t){var o=t[i],a=e[r++],s=o.read(a),u=o.validate(s);if(u)return Gl(a,u),null;n[i]=o.clean(s)}return n}(t.fields,i);e&&(r(),t.callback(e))};u.addEventListener("submit",(function(t){t.preventDefault(),h()})),u.addEventListener("keydown",(function(t){27==t.keyCode?(t.preventDefault(),r()):13!=t.keyCode||t.ctrlKey||t.metaKey||t.shiftKey?9==t.keyCode&&window.setTimeout((function(){e.contains(document.activeElement)||r()}),500):(t.preventDefault(),h())}));var f=u.elements[0];f&&f.focus()}function Gl(t,e){var n=t.parentNode,r=n.appendChild(document.createElement("div"));r.style.left=t.offsetLeft+t.offsetWidth+2+"px",r.style.top=t.offsetTop-5+"px",r.className="ProseMirror-invalid",r.textContent=e,setTimeout((function(){return n.removeChild(r)}),1500)}var Xl=function(t){this.options=t};Xl.prototype.read=function(t){return t.value},Xl.prototype.validateType=function(t){},Xl.prototype.validate=function(t){return!t&&this.options.required?"Required field":this.validateType(t)||this.options.validate&&this.options.validate(t)},Xl.prototype.clean=function(t){return this.options.clean?this.options.clean(t):t};var Ql=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.render=function(){var t=document.createElement("input");return t.type="text",t.placeholder=this.options.label,t.value=this.options.value||"",t.autocomplete="off",t},e}(Xl);function th(t,e){for(var n=t.selection.$from,r=n.depth;r>=0;r--){var i=n.index(r);if(n.node(r).canReplaceWith(i,i,e))return!0}return!1}function eh(t,e){var n={label:e.title,run:t};for(var r in e)n[r]=e[r];return e.enable&&!0!==e.enable||e.select||(n[e.enable?"enable":"select"]=function(e){return t(e)}),new wl(n)}function nh(t,e){var n=t.selection,r=n.from,i=n.$from,o=n.to;return n.empty?e.isInSet(t.storedMarks||i.marks()):t.doc.rangeHasMark(r,o,e)}function rh(t,e){var n={active:function(e){return nh(e,t)},enable:!0};for(var r in e)n[r]=e[r];return eh(Gc(t),n)}function ih(t,e){return eh(jl(t,e.attrs),e)}function oh(t){var e,n,r,i={};if((e=t.marks.strong)&&(i.toggleStrong=rh(e,{title:"Toggle strong style",icon:Al.strong})),(e=t.marks.em)&&(i.toggleEm=rh(e,{title:"Toggle emphasis",icon:Al.em})),(e=t.marks.code)&&(i.toggleCode=rh(e,{title:"Toggle code font",icon:Al.code})),(e=t.marks.link)&&(i.toggleLink=(n=e,new wl({title:"Add or remove link",icon:Al.link,active:function(t){return nh(t,n)},enable:function(t){return!t.selection.empty},run:function(t,e,r){if(nh(t,n))return Gc(n)(t,e),!0;Kl({title:"Create a link",fields:{href:new Ql({label:"Link target",required:!0}),title:new Ql({label:"Title"})},callback:function(t){Gc(n,t)(r.state,r.dispatch),r.focus()}})}}))),(e=t.nodes.image)&&(i.insertImage=(r=e,new wl({title:"Insert image",label:"Image",enable:function(t){return th(t,r)},run:function(t,e,n){var i=t.selection,o=i.from,a=i.to,s=null;t.selection instanceof Oo&&t.selection.node.type==r&&(s=t.selection.node.attrs),Kl({title:"Insert image",fields:{src:new Ql({label:"Location",required:!0,value:s&&s.src}),title:new Ql({label:"Title",value:s&&s.title}),alt:new Ql({label:"Description",value:s?s.alt:t.doc.textBetween(o,a," ")})},callback:function(t){n.dispatch(n.state.tr.replaceSelectionWith(r.createAndFill(t))),n.focus()}})}}))),(e=t.nodes.bullet_list)&&(i.wrapBulletList=ih(e,{title:"Wrap in bullet list",icon:Al.bulletList})),(e=t.nodes.ordered_list)&&(i.wrapOrderedList=ih(e,{title:"Wrap in ordered list",icon:Al.orderedList})),(e=t.nodes.blockquote)&&(i.wrapBlockQuote=function(t,e){var n={run:function(n,r){return Yc(t,e.attrs)(n,r)},select:function(n){return Yc(t,e.attrs instanceof Function?null:e.attrs)(n)}};for(var r in e)n[r]=e[r];return new wl(n)}(e,{title:"Wrap in block quote",icon:Al.blockquote})),(e=t.nodes.paragraph)&&(i.makeParagraph=Rl(e,{title:"Change to paragraph",label:"Plain"})),(e=t.nodes.code_block)&&(i.makeCodeBlock=Rl(e,{title:"Change to code block",label:"Code"})),e=t.nodes.heading)for(var o=1;o<=10;o++)i["makeHead"+o]=Rl(e,{title:"Change to heading "+o,label:"Level "+o,attrs:{level:o}});if(e=t.nodes.horizontal_rule){var a=e;i.insertHorizontalRule=new wl({title:"Insert horizontal rule",label:"Horizontal rule",enable:function(t){return th(t,a)},run:function(t,e){e(t.tr.replaceSelectionWith(a.create()))}})}var s=function(t){return t.filter((function(t){return t}))};return i.insertMenu=new Cl(s([i.insertImage,i.insertHorizontalRule]),{label:"Insert"}),i.typeMenu=new Cl(s([i.makeParagraph,i.makeCodeBlock,i.makeHead1&&new Tl(s([i.makeHead1,i.makeHead2,i.makeHead3,i.makeHead4,i.makeHead5,i.makeHead6]),{label:"Heading"})]),{label:"Type..."}),i.inlineMenu=[s([i.toggleStrong,i.toggleEm,i.toggleCode,i.toggleLink])],i.blockMenu=[s([i.wrapBulletList,i.wrapOrderedList,i.wrapBlockQuote,Ol,Dl,Pl])],i.fullMenu=i.inlineMenu.concat([[i.insertMenu,i.typeMenu]],[[Ll,Nl]],i.blockMenu),i}var ah="undefined"!=typeof navigator&&/Mac/.test(navigator.platform);function sh(t,e){var n,r,i={};function o(t,n){if(e){var r=e[t];if(!1===r)return;r&&(t=r)}i[t]=n}if(o("Mod-z",Rc),o("Shift-Mod-z",Ic),o("Backspace",Vl),ah||o("Mod-y",Ic),o("Alt-ArrowUp",qc),o("Alt-ArrowDown",$c),o("Mod-BracketLeft",Vc),o("Escape",Zc),(n=t.marks.strong)&&(o("Mod-b",Gc(n)),o("Mod-B",Gc(n))),(n=t.marks.em)&&(o("Mod-i",Gc(n)),o("Mod-I",Gc(n))),(n=t.marks.code)&&o("Mod-`",Gc(n)),(n=t.nodes.bullet_list)&&o("Shift-Ctrl-8",jl(n)),(n=t.nodes.ordered_list)&&o("Shift-Ctrl-9",jl(n)),(n=t.nodes.blockquote)&&o("Ctrl->",Yc(n)),n=t.nodes.hard_break){var a=n,s=Xc(Hc,(function(t,e){return e(t.tr.replaceSelectionWith(a.create()).scrollIntoView()),!0}));o("Mod-Enter",s),o("Shift-Enter",s),ah&&o("Ctrl-Enter",s)}if((n=t.nodes.list_item)&&(o("Enter",(r=n,function(t,e){var n=t.selection,i=n.$from,o=n.$to,a=n.node;if(a&&a.isBlock||i.depth<2||!i.sameParent(o))return!1;var s=i.node(-1);if(s.type!=r)return!1;if(0==i.parent.content.size&&i.node(-1).childCount==i.indexAfter(-1)){if(2==i.depth||i.node(-3).type!=r||i.index(-2)!=i.node(-2).childCount-1)return!1;if(e){for(var u=Mr.empty,c=i.index(-1)>0,l=i.depth-(c?1:2);l>=i.depth-3;l--)u=Mr.from(i.node(l).copy(u));u=u.append(Mr.from(r.createAndFill()));var h=t.tr.replace(i.before(c?null:-1),i.after(-3),new Lr(u,c?3:2,2));h.setSelection(t.selection.constructor.near(h.doc.resolve(i.pos+(c?3:2)))),e(h.scrollIntoView())}return!0}var f=o.pos==i.end()?s.contentMatchAt(0).defaultType:null,d=t.tr.delete(i.pos,o.pos),p=f&&[null,{type:f}];return!!io(d.doc,i.pos,2,p)&&(e&&e(d.split(i.pos,2,p).scrollIntoView()),!0)})),o("Mod-[",Fl(n)),o("Mod-]",function(t){return function(e,n){var r=e.selection,i=r.$from,o=r.$to,a=i.blockRange(o,(function(e){return e.childCount&&e.firstChild.type==t}));if(!a)return!1;var s=a.startIndex;if(0==s)return!1;var u=a.parent,c=u.child(s-1);if(c.type!=t)return!1;if(n){var l=c.lastChild&&c.lastChild.type==u.type,h=Mr.from(l?t.create():null),f=new Lr(Mr.from(t.create(null,Mr.from(u.type.create(null,h)))),l?3:1,0),d=a.start,p=a.end;n(e.tr.step(new Xi(d-(l?3:1),p,d,p,f,1,!0)).scrollIntoView())}return!0}}(n))),(n=t.nodes.paragraph)&&o("Shift-Ctrl-0",Kc(n)),(n=t.nodes.code_block)&&o("Shift-Ctrl-\\",Kc(n)),n=t.nodes.heading)for(var u=1;u<=6;u++)o("Shift-Ctrl-"+u,Kc(n,{level:u}));if(n=t.nodes.horizontal_rule){var c=n;o("Mod-_",(function(t,e){return e(t.tr.replaceSelectionWith(c.create()).scrollIntoView()),!0}))}return i}function uh(t){var e,n=Wl.concat(Hl,Ul);return(e=t.nodes.blockquote)&&n.push(Zl(/^\s*>\s$/,e)),(e=t.nodes.ordered_list)&&n.push(function(t){return Zl(/^(\d+)\.\s$/,t,(function(t){return{order:+t[1]}}),(function(t,e){return e.childCount+e.attrs.order==+t[1]}))}(e)),(e=t.nodes.bullet_list)&&n.push(function(t){return Zl(/^\s*([-+*])\s$/,t)}(e)),(e=t.nodes.code_block)&&n.push(function(t){return Jl(/^```$/,t)}(e)),(e=t.nodes.heading)&&n.push(function(t,e){return Jl(new RegExp("^(#{1,"+e+"})\\s$"),t,(function(t){return{level:t[1].length}}))}(e,6)),function(t){var e=t.rules,n=new Ho({state:{init:function(){return null},apply:function(t,e){return t.getMeta(this)||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:function(t,r,i,o){return $l(t,r,i,o,e,n)},handleDOMEvents:{compositionend:function(t){setTimeout((function(){var r=t.state.selection.$cursor;r&&$l(t,r.pos,r.pos,"",e,n)}))}}},isInputRules:!0});return n}({rules:n})}function ch(t){var e=[uh(t.schema),vc(sh(t.schema,t.mapKeys)),vc(il),ol(),new Ho({props:{decorations:fl,createSelectionBetween:function(t,e,n){if(e.pos==n.pos&&sl.valid(n))return new sl(n)},handleClick:hl,handleKeyDown:cl}})];return!1!==t.menuBar&&e.push(function(t){return new Ho({view:function(e){return new Bl(e,t)}})}({floating:!1!==t.floatingMenu,content:t.menuContent||oh(t.schema).fullMenu})),!1!==t.history&&e.push(Nc()),e.concat(new Ho({props:{attributes:{class:"ProseMirror-example-setup-style"}}}))}n(561),n(562),n(563),n(564);document.addEventListener("turbolinks:load",(function(){document.querySelectorAll(".markdown-content").forEach((function(t){var e=t.querySelector(".content"),n=t.querySelector(".markdown-editor"),r=new Nu(n,{state:qo.create({doc:Ku.parse(e.value),plugins:ch({schema:$u})})});e.form.addEventListener("submit",(function(t){return e.value=Xu.serialize(r.state.doc)})),setInterval((function(){return e.value=Xu.serialize(r.state.doc)}),1e4),e.style.display="none"}))}));n(565),n(566),n(567);var lh=n(234);n(572);document.addEventListener("turbolinks:load",(function(){document.querySelectorAll(".new-editor").forEach((function(t){new lh.a({target:t,props:{textareaEl:t.querySelector("textarea")}})}))}));var hh=n(235),fh=n.n(hh),dh=n(236),ph=n.n(dh),vh=n(237),mh=n.n(vh);function gh(t){return function(t){if(Array.isArray(t))return Ch(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||Sh(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 yh(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function bh(t){return(bh="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function wh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _h(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function xh(t,e,n){return e&&_h(t.prototype,e),n&&_h(t,n),t}function kh(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=Sh(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Sh(t,e){if(t){if("string"===typeof t)return Ch(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ch(t,e):void 0}}function Ch(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var Mh="undefined"===typeof window?function(t){return t()}:window.requestAnimationFrame;function Eh(t,e,n){var r=n||function(t){return Array.prototype.slice.call(t)},i=!1,o=[];return function(){for(var n=arguments.length,a=new Array(n),s=0;s<n;s++)a[s]=arguments[s];o=r(a),i||(i=!0,Mh.call(window,(function(){i=!1,t.apply(e,o)})))}}var Th=function(t){return"start"===t?"left":"end"===t?"right":"center"},Ah=function(t,e,n){return"start"===t?e:"end"===t?n:(e+n)/2};function Oh(){}var Dh,Ph=(Dh=0,function(){return Dh++});function Lh(t){return null===t||"undefined"===typeof t}function Nh(t){if(Array.isArray&&Array.isArray(t))return!0;var e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function Rh(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}var Ih=function(t){return("number"===typeof t||t instanceof Number)&&isFinite(+t)};function zh(t,e){return Ih(t)?t:e}function Bh(t,e){return"undefined"===typeof t?e:t}var jh=function(t,e){return"string"===typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t};function Fh(t,e,n){if(t&&"function"===typeof t.call)return t.apply(n,e)}function qh(t,e,n,r){var i,o,a;if(Nh(t))if(o=t.length,r)for(i=o-1;i>=0;i--)e.call(n,t[i],i);else for(i=0;i<o;i++)e.call(n,t[i],i);else if(Rh(t))for(o=(a=Object.keys(t)).length,i=0;i<o;i++)e.call(n,t[a[i]],a[i])}function $h(t,e){var n,r,i,o;if(!t||!e||t.length!==e.length)return!1;for(n=0,r=t.length;n<r;++n)if(i=t[n],o=e[n],i.datasetIndex!==o.datasetIndex||i.index!==o.index)return!1;return!0}function Vh(t){if(Nh(t))return t.map(Vh);if(Rh(t)){for(var e=Object.create(null),n=Object.keys(t),r=n.length,i=0;i<r;++i)e[n[i]]=Vh(t[n[i]]);return e}return t}function Uh(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function Hh(t,e,n,r){if(Uh(t)){var i=e[t],o=n[t];Rh(i)&&Rh(o)?Wh(i,o,r):e[t]=Vh(o)}}function Wh(t,e,n){var r=Nh(e)?e:[e],i=r.length;if(!Rh(t))return t;for(var o=(n=n||{}).merger||Hh,a=0;a<i;++a)if(Rh(e=r[a]))for(var s=Object.keys(e),u=0,c=s.length;u<c;++u)o(s[u],t,e,n);return t}function Zh(t,e){return Wh(t,e,{merger:Jh})}function Jh(t,e,n){if(Uh(t)){var r=e[t],i=n[t];Rh(r)&&Rh(i)?Zh(r,i):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=Vh(i))}}function Yh(t,e){var n=t.indexOf(".",e);return-1===n?t.length:n}function Kh(t,e){if(""===e)return t;for(var n=0,r=Yh(e,n);t&&r>n;)t=t[e.substr(n,r-n)],r=Yh(e,n=r+1);return t}function Gh(t){return t.charAt(0).toUpperCase()+t.slice(1)}var Xh=function(t){return"undefined"!==typeof t},Qh=function(t){return"function"===typeof t},tf=Math.PI,ef=2*tf,nf=ef+tf,rf=Number.POSITIVE_INFINITY,of=tf/180,af=tf/2,sf=tf/4,uf=2*tf/3,cf=Math.log10,lf=Math.sign;function hf(t){var e=Math.round(t);t=df(t,e,t/1e3)?e:t;var n=Math.pow(10,Math.floor(cf(t))),r=t/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function ff(t){return!isNaN(parseFloat(t))&&isFinite(t)}function df(t,e,n){return Math.abs(t-e)<n}function pf(t,e,n){var r,i,o;for(r=0,i=t.length;r<i;r++)o=t[r][n],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function vf(t){return t*(tf/180)}function mf(t){return t*(180/tf)}function gf(t){if(Ih(t)){for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n}}function yf(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function bf(t,e){return(t-e+nf)%ef-tf}function wf(t){return(t%ef+ef)%ef}function _f(t,e,n,r){var i=wf(t),o=wf(e),a=wf(n),s=wf(o-i),u=wf(a-i),c=wf(i-o),l=wf(i-a);return i===o||i===a||r&&o===a||s>u&&c<l}function xf(t,e,n){return Math.max(e,Math.min(n,t))}var kf=function(t){return 0===t||1===t},Sf=function(t,e,n){return-Math.pow(2,10*(t-=1))*Math.sin((t-e)*ef/n)},Cf=function(t,e,n){return Math.pow(2,-10*t)*Math.sin((t-e)*ef/n)+1},Mf={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return(t-=1)*t*t+1},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-((t-=1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return(t-=1)*t*t*t*t+1},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return 1-Math.cos(t*af)},easeOutSine:function(t){return Math.sin(t*af)},easeInOutSine:function(t){return-.5*(Math.cos(tf*t)-1)},easeInExpo:function(t){return 0===t?0:Math.pow(2,10*(t-1))},easeOutExpo:function(t){return 1===t?1:1-Math.pow(2,-10*t)},easeInOutExpo:function(t){return kf(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1)))},easeInCirc:function(t){return t>=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){return kf(t)?t:Sf(t,.075,.3)},easeOutElastic:function(t){return kf(t)?t:Cf(t,.075,.3)},easeInOutElastic:function(t){var e=.1125;return kf(t)?t:t<.5?.5*Sf(2*t,e,.45):.5+.5*Cf(2*t-1,e,.45)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-Mf.easeOutBounce(1-t)},easeOutBounce:function(t){var e=7.5625,n=2.75;return t<1/n?e*t*t:t<2/n?e*(t-=1.5/n)*t+.75:t<2.5/n?e*(t-=2.25/n)*t+.9375:e*(t-=2.625/n)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*Mf.easeInBounce(2*t):.5*Mf.easeOutBounce(2*t-1)+.5}},Ef={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Tf="0123456789ABCDEF",Af=function(t){return Tf[15&t]},Of=function(t){return Tf[(240&t)>>4]+Tf[15&t]},Df=function(t){return(240&t)>>4===(15&t)};function Pf(t){var e=function(t){return Df(t.r)&&Df(t.g)&&Df(t.b)&&Df(t.a)}(t)?Af:Of;return t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t}function Lf(t){return t+.5|0}var Nf=function(t,e,n){return Math.max(Math.min(t,n),e)};function Rf(t){return Nf(Lf(2.55*t),0,255)}function If(t){return Nf(Lf(255*t),0,255)}function zf(t){return Nf(Lf(t/2.55)/100,0,1)}function Bf(t){return Nf(Lf(100*t),0,100)}var jf=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;var Ff=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function qf(t,e,n){var r=e*Math.min(n,1-n),i=function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+t/30)%12;return n-r*Math.max(Math.min(i-3,9-i,1),-1)};return[i(0),i(8),i(4)]}function $f(t,e,n){var r=function(r){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(r+t/60)%6;return n-n*e*Math.max(Math.min(i,4-i,1),0)};return[r(5),r(3),r(1)]}function Vf(t,e,n){var r,i=qf(t,1,.5);for(e+n>1&&(e*=r=1/(e+n),n*=r),r=0;r<3;r++)i[r]*=1-e-n,i[r]+=e;return i}function Uf(t){var e,n,r,i=t.r/255,o=t.g/255,a=t.b/255,s=Math.max(i,o,a),u=Math.min(i,o,a),c=(s+u)/2;return s!==u&&(r=s-u,n=c>.5?r/(2-s-u):r/(s+u),e=60*(e=s===i?(o-a)/r+(o<a?6:0):s===o?(a-i)/r+2:(i-o)/r+4)+.5),[0|e,n||0,c]}function Hf(t,e,n,r){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,r)).map(If)}function Wf(t,e,n){return Hf(qf,t,e,n)}function Zf(t){return(t%360+360)%360}function Jf(t){var e,n=Ff.exec(t),r=255;if(n){n[5]!==e&&(r=n[6]?Rf(+n[5]):If(+n[5]));var i=Zf(+n[2]),o=+n[3]/100,a=+n[4]/100;return{r:(e="hwb"===n[1]?function(t,e,n){return Hf(Vf,t,e,n)}(i,o,a):"hsv"===n[1]?function(t,e,n){return Hf($f,t,e,n)}(i,o,a):Wf(i,o,a))[0],g:e[1],b:e[2],a:r}}}var Yf,Kf={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Gf={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Xf(t){Yf||((Yf=function(){var t,e,n,r,i,o={},a=Object.keys(Gf),s=Object.keys(Kf);for(t=0;t<a.length;t++){for(r=i=a[t],e=0;e<s.length;e++)n=s[e],i=i.replace(n,Kf[n]);n=parseInt(Gf[r],16),o[i]=[n>>16&255,n>>8&255,255&n]}return o}()).transparent=[0,0,0,0]);var e=Yf[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}function Qf(t,e,n){if(t){var r=Uf(t);r[e]=Math.max(0,Math.min(r[e]+r[e]*n,0===e?360:1)),r=Wf(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function td(t,e){return t?Object.assign(e||{},t):t}function ed(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=If(t[3]))):(e=td(t,{r:0,g:0,b:0,a:1})).a=If(e.a),e}function nd(t){return"r"===t.charAt(0)?function(t){var e,n,r,i=jf.exec(t),o=255;if(i){if(i[7]!==e){var a=+i[7];o=255&(i[8]?Rf(a):255*a)}return e=+i[1],n=+i[3],r=+i[5],{r:e=255&(i[2]?Rf(e):e),g:n=255&(i[4]?Rf(n):n),b:r=255&(i[6]?Rf(r):r),a:o}}}(t):Jf(t)}var rd=function(){function t(e){if(wh(this,t),e instanceof t)return e;var n,r=bh(e);"object"===r?n=ed(e):"string"===r&&(n=function(t){var e,n=t.length;return"#"===t[0]&&(4===n||5===n?e={r:255&17*Ef[t[1]],g:255&17*Ef[t[2]],b:255&17*Ef[t[3]],a:5===n?17*Ef[t[4]]:255}:7!==n&&9!==n||(e={r:Ef[t[1]]<<4|Ef[t[2]],g:Ef[t[3]]<<4|Ef[t[4]],b:Ef[t[5]]<<4|Ef[t[6]],a:9===n?Ef[t[7]]<<4|Ef[t[8]]:255})),e}(e)||Xf(e)||nd(e)),this._rgb=n,this._valid=!!n}return xh(t,[{key:"valid",get:function(){return this._valid}},{key:"rgb",get:function(){var t=td(this._rgb);return t&&(t.a=zf(t.a)),t},set:function(t){this._rgb=ed(t)}},{key:"rgbString",value:function(){return this._valid?(t=this._rgb)&&(t.a<255?"rgba(".concat(t.r,", ").concat(t.g,", ").concat(t.b,", ").concat(zf(t.a),")"):"rgb(".concat(t.r,", ").concat(t.g,", ").concat(t.b,")")):this._rgb;var t}},{key:"hexString",value:function(){return this._valid?Pf(this._rgb):this._rgb}},{key:"hslString",value:function(){return this._valid?function(t){if(t){var e=Uf(t),n=e[0],r=Bf(e[1]),i=Bf(e[2]);return t.a<255?"hsla(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(zf(t.a),")"):"hsl(".concat(n,", ").concat(r,"%, ").concat(i,"%)")}}(this._rgb):this._rgb}},{key:"mix",value:function(t,e){var n=this;if(t){var r,i=n.rgb,o=t.rgb,a=e===r?.5:e,s=2*a-1,u=i.a-o.a,c=((s*u===-1?s:(s+u)/(1+s*u))+1)/2;r=1-c,i.r=255&c*i.r+r*o.r+.5,i.g=255&c*i.g+r*o.g+.5,i.b=255&c*i.b+r*o.b+.5,i.a=a*i.a+(1-a)*o.a,n.rgb=i}return n}},{key:"clone",value:function(){return new t(this.rgb)}},{key:"alpha",value:function(t){return this._rgb.a=If(t),this}},{key:"clearer",value:function(t){return this._rgb.a*=1-t,this}},{key:"greyscale",value:function(){var t=this._rgb,e=Lf(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}},{key:"opaquer",value:function(t){return this._rgb.a*=1+t,this}},{key:"negate",value:function(){var t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}},{key:"lighten",value:function(t){return Qf(this._rgb,2,t),this}},{key:"darken",value:function(t){return Qf(this._rgb,2,-t),this}},{key:"saturate",value:function(t){return Qf(this._rgb,1,t),this}},{key:"desaturate",value:function(t){return Qf(this._rgb,1,-t),this}},{key:"rotate",value:function(t){return function(t,e){var n=Uf(t);n[0]=Zf(n[0]+e),n=Wf(n),t.r=n[0],t.g=n[1],t.b=n[2]}(this._rgb,t),this}}]),t}();function id(t){return new rd(t)}var od=function(t){return t instanceof CanvasGradient||t instanceof CanvasPattern};function ad(t){return od(t)?t:id(t)}function sd(t){return od(t)?t:id(t).saturate(.5).darken(.1).hexString()}var ud=Object.create(null),cd=Object.create(null);function ld(t,e){if(!e)return t;for(var n=e.split("."),r=0,i=n.length;r<i;++r){var o=n[r];t=t[o]||(t[o]=Object.create(null))}return t}function hd(t,e,n){return"string"===typeof e?Wh(ld(t,e),n):Wh(ld(t,""),e)}var fd=new(function(){function t(e){wh(this,t),this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=function(t){return t.chart.platform.getDevicePixelRatio()},this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=function(t,e){return sd(e.backgroundColor)},this.hoverBorderColor=function(t,e){return sd(e.borderColor)},this.hoverColor=function(t,e){return sd(e.color)},this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.describe(e)}return xh(t,[{key:"set",value:function(t,e){return hd(this,t,e)}},{key:"get",value:function(t){return ld(this,t)}},{key:"describe",value:function(t,e){return hd(cd,t,e)}},{key:"override",value:function(t,e){return hd(ud,t,e)}},{key:"route",value:function(t,e,n,r){var i,o=ld(this,t),a=ld(this,n),s="_"+e;Object.defineProperties(o,(yh(i={},s,{value:o[e],writable:!0}),yh(i,e,{enumerable:!0,get:function(){var t=this[s],e=a[r];return Rh(t)?Object.assign({},e,t):Bh(t,e)},set:function(t){this[s]=t}}),i))}}]),t}())({_scriptable:function(t){return!t.startsWith("on")},_indexable:function(t){return"events"!==t},hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function dd(t,e,n,r,i){var o=e[i];return o||(o=e[i]=t.measureText(i).width,n.push(i)),o>r&&(r=o),r}function pd(t,e,n,r){var i=(r=r||{}).data=r.data||{},o=r.garbageCollect=r.garbageCollect||[];r.font!==e&&(i=r.data={},o=r.garbageCollect=[],r.font=e),t.save(),t.font=e;var a,s,u,c,l,h=0,f=n.length;for(a=0;a<f;a++)if(void 0!==(c=n[a])&&null!==c&&!0!==Nh(c))h=dd(t,i,o,h,c);else if(Nh(c))for(s=0,u=c.length;s<u;s++)void 0===(l=c[s])||null===l||Nh(l)||(h=dd(t,i,o,h,l));t.restore();var d=o.length/2;if(d>n.length){for(a=0;a<d;a++)delete i[o[a]];o.splice(0,d)}return h}function vd(t,e,n){var r=t.currentDevicePixelRatio,i=0!==n?Math.max(n/2,.5):0;return Math.round((e-i)*r)/r+i}function md(t,e){(e=e||t.getContext("2d")).save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function gd(t,e,n,r){var i,o,a,s,u,c=e.pointStyle,l=e.rotation,h=e.radius,f=(l||0)*of;if(c&&"object"===bh(c)&&("[object HTMLImageElement]"===(i=c.toString())||"[object HTMLCanvasElement]"===i))return t.save(),t.translate(n,r),t.rotate(f),t.drawImage(c,-c.width/2,-c.height/2,c.width,c.height),void t.restore();if(!(isNaN(h)||h<=0)){switch(t.beginPath(),c){default:t.arc(n,r,h,0,ef),t.closePath();break;case"triangle":t.moveTo(n+Math.sin(f)*h,r-Math.cos(f)*h),f+=uf,t.lineTo(n+Math.sin(f)*h,r-Math.cos(f)*h),f+=uf,t.lineTo(n+Math.sin(f)*h,r-Math.cos(f)*h),t.closePath();break;case"rectRounded":s=h-(u=.516*h),o=Math.cos(f+sf)*s,a=Math.sin(f+sf)*s,t.arc(n-o,r-a,u,f-tf,f-af),t.arc(n+a,r-o,u,f-af,f),t.arc(n+o,r+a,u,f,f+af),t.arc(n-a,r+o,u,f+af,f+tf),t.closePath();break;case"rect":if(!l){s=Math.SQRT1_2*h,t.rect(n-s,r-s,2*s,2*s);break}f+=sf;case"rectRot":o=Math.cos(f)*h,a=Math.sin(f)*h,t.moveTo(n-o,r-a),t.lineTo(n+a,r-o),t.lineTo(n+o,r+a),t.lineTo(n-a,r+o),t.closePath();break;case"crossRot":f+=sf;case"cross":o=Math.cos(f)*h,a=Math.sin(f)*h,t.moveTo(n-o,r-a),t.lineTo(n+o,r+a),t.moveTo(n+a,r-o),t.lineTo(n-a,r+o);break;case"star":o=Math.cos(f)*h,a=Math.sin(f)*h,t.moveTo(n-o,r-a),t.lineTo(n+o,r+a),t.moveTo(n+a,r-o),t.lineTo(n-a,r+o),f+=sf,o=Math.cos(f)*h,a=Math.sin(f)*h,t.moveTo(n-o,r-a),t.lineTo(n+o,r+a),t.moveTo(n+a,r-o),t.lineTo(n-a,r+o);break;case"line":o=Math.cos(f)*h,a=Math.sin(f)*h,t.moveTo(n-o,r-a),t.lineTo(n+o,r+a);break;case"dash":t.moveTo(n,r),t.lineTo(n+Math.cos(f)*h,r+Math.sin(f)*h)}t.fill(),e.borderWidth>0&&t.stroke()}}function yd(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function bd(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function wd(t){t.restore()}function _d(t,e,n,r,i){if(!e)return t.lineTo(n.x,n.y);if("middle"===i){var o=(e.x+n.x)/2;t.lineTo(o,e.y),t.lineTo(o,n.y)}else"after"===i!==!!r?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}function xd(t,e,n,r){if(!e)return t.lineTo(n.x,n.y);t.bezierCurveTo(r?e.cp1x:e.cp2x,r?e.cp1y:e.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function kd(t,e,n,r,i){var o,a,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},u=Nh(e)?e:[e],c=s.strokeWidth>0&&""!==s.strokeColor;for(t.save(),t.font=i.string,Sd(t,s),o=0;o<u.length;++o)a=u[o],c&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),Lh(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(a,n,r,s.maxWidth)),t.fillText(a,n,r,s.maxWidth),Cd(t,n,r,a,s),r+=i.lineHeight;t.restore()}function Sd(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),Lh(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function Cd(t,e,n,r,i){if(i.strikethrough||i.underline){var o=t.measureText(r),a=e-o.actualBoundingBoxLeft,s=e+o.actualBoundingBoxRight,u=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,l=i.strikethrough?(u+c)/2:c;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=i.decorationWidth||2,t.moveTo(a,l),t.lineTo(s,l),t.stroke()}}function Md(t,e){var n=e.x,r=e.y,i=e.w,o=e.h,a=e.radius;t.arc(n+a.topLeft,r+a.topLeft,a.topLeft,-af,tf,!0),t.lineTo(n,r+o-a.bottomLeft),t.arc(n+a.bottomLeft,r+o-a.bottomLeft,a.bottomLeft,tf,af,!0),t.lineTo(n+i-a.bottomRight,r+o),t.arc(n+i-a.bottomRight,r+o-a.bottomRight,a.bottomRight,af,0,!0),t.lineTo(n+i,r+a.topRight),t.arc(n+i-a.topRight,r+a.topRight,a.topRight,0,-af,!0),t.lineTo(n+a.topLeft,r)}var Ed=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Td=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function Ad(t,e){var n=(""+t).match(Ed);if(!n||"normal"===n[1])return 1.2*e;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100}return e*t}function Od(t,e){var n,r={},i=Rh(e),o=i?Object.keys(e):e,a=Rh(t)?i?function(n){return Bh(t[n],t[e[n]])}:function(e){return t[e]}:function(){return t},s=kh(o);try{for(s.s();!(n=s.n()).done;){var u=n.value;r[u]=+a(u)||0}}catch(M_){s.e(M_)}finally{s.f()}return r}function Dd(t){return Od(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Pd(t){return Od(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Ld(t){var e=Dd(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Nd(t,e){t=t||{},e=e||fd.font;var n=Bh(t.size,e.size);"string"===typeof n&&(n=parseInt(n,10));var r=Bh(t.style,e.style);r&&!(""+r).match(Td)&&(console.warn('Invalid font style specified: "'+r+'"'),r="");var i={family:Bh(t.family,e.family),lineHeight:Ad(Bh(t.lineHeight,e.lineHeight),n),size:n,style:r,weight:Bh(t.weight,e.weight),string:""};return i.string=function(t){return!t||Lh(t.size)||Lh(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}(i),i}function Rd(t,e,n,r){var i,o,a,s=!0;for(i=0,o=t.length;i<o;++i)if(void 0!==(a=t[i])&&(void 0!==e&&"function"===typeof a&&(a=a(e),s=!1),void 0!==n&&Nh(a)&&(a=a[n%a.length],s=!1),void 0!==a))return r&&!s&&(r.cacheable=!1),a}function Id(t,e,n){n=n||function(n){return t[n]<e};for(var r,i=t.length-1,o=0;i-o>1;)n(r=o+i>>1)?o=r:i=r;return{lo:o,hi:i}}var zd=function(t,e,n){return Id(t,n,(function(r){return t[r][e]<n}))},Bd=function(t,e,n){return Id(t,n,(function(r){return t[r][e]>=n}))};var jd=["push","pop","shift","splice","unshift"];function Fd(t,e){var n=t._chartjs;if(n){var r=n.listeners,i=r.indexOf(e);-1!==i&&r.splice(i,1),r.length>0||(jd.forEach((function(e){delete t[e]})),delete t._chartjs)}}function qd(t){var e,n,r=new Set;for(e=0,n=t.length;e<n;++e)r.add(t[e]);return r.size===n?t:Array.from(r)}function $d(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[""],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){return t[0]};Xh(i)||(i=tp("_fallback",t));var a=(yh(e={},Symbol.toStringTag,"Object"),yh(e,"_cacheable",!0),yh(e,"_scopes",t),yh(e,"_rootScopes",r),yh(e,"_fallback",i),yh(e,"_getTarget",o),yh(e,"override",(function(e){return $d([e].concat(gh(t)),n,r,i)})),e);return new Proxy(a,{deleteProperty:function(e,n){return delete e[n],delete e._keys,delete t[0][n],!0},get:function(e,r){return Zd(e,r,(function(){return Qd(r,n,t,e)}))},getOwnPropertyDescriptor:function(t,e){return Reflect.getOwnPropertyDescriptor(t._scopes[0],e)},getPrototypeOf:function(){return Reflect.getPrototypeOf(t[0])},has:function(t,e){return ep(t).includes(e)},ownKeys:function(t){return ep(t)},set:function(t,e,n){return(t._storage||(t._storage=o()))[e]=n,delete t[e],delete t._keys,!0}})}function Vd(t,e,n,r){var i={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:Ud(t,r),setContext:function(e){return Vd(t,e,n,r)},override:function(i){return Vd(t.override(i),e,n,r)}};return new Proxy(i,{deleteProperty:function(e,n){return delete e[n],delete t[n],!0},get:function(t,e,n){return Zd(t,e,(function(){return function(t,e,n){var r=t._proxy,i=t._context,o=t._subProxy,a=t._descriptors,s=r[e];Qh(s)&&a.isScriptable(e)&&(s=function(t,e,n,r){var i=n._proxy,o=n._context,a=n._subProxy,s=n._stack;if(s.has(t))throw new Error("Recursion detected: "+Array.from(s).join("->")+"->"+t);s.add(t),e=e(o,a||r),s.delete(t),Rh(e)&&(e=Gd(i._scopes,i,t,e));return e}(e,s,t,n));Nh(s)&&s.length&&(s=function(t,e,n,r){var i=n._proxy,o=n._context,a=n._subProxy,s=n._descriptors;if(Xh(o.index)&&r(t))e=e[o.index%e.length];else if(Rh(e[0])){var u=e,c=i._scopes.filter((function(t){return t!==u}));e=[];var l,h=kh(u);try{for(h.s();!(l=h.n()).done;){var f=Gd(c,i,t,l.value);e.push(Vd(f,o,a&&a[t],s))}}catch(M_){h.e(M_)}finally{h.f()}}return e}(e,s,t,a.isIndexable));Wd(e,s)&&(s=Vd(s,i,o&&o[e],a));return s}(t,e,n)}))},getOwnPropertyDescriptor:function(e,n){return e._descriptors.allKeys?Reflect.has(t,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,n)},getPrototypeOf:function(){return Reflect.getPrototypeOf(t)},has:function(e,n){return Reflect.has(t,n)},ownKeys:function(){return Reflect.ownKeys(t)},set:function(e,n,r){return t[n]=r,delete e[n],!0}})}function Ud(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{scriptable:!0,indexable:!0},n=t._scriptable,r=void 0===n?e.scriptable:n,i=t._indexable,o=void 0===i?e.indexable:i,a=t._allKeys,s=void 0===a?e.allKeys:a;return{allKeys:s,scriptable:r,indexable:o,isScriptable:Qh(r)?r:function(){return r},isIndexable:Qh(o)?o:function(){return o}}}var Hd=function(t,e){return t?t+Gh(e):e},Wd=function(t,e){return Rh(e)&&"adapters"!==t};function Zd(t,e,n){var r=t[e];return Xh(r)||(r=n(),Xh(r)&&(t[e]=r)),r}function Jd(t,e,n){return Qh(t)?t(e,n):t}var Yd=function(t,e){return!0===t?e:"string"===typeof t?Kh(e,t):void 0};function Kd(t,e,n,r){var i,o=kh(e);try{for(o.s();!(i=o.n()).done;){var a=i.value,s=Yd(n,a);if(s){t.add(s);var u=Jd(s._fallback,n,s);if(Xh(u)&&u!==n&&u!==r)return u}else if(!1===s&&Xh(r)&&n!==r)return null}}catch(M_){o.e(M_)}finally{o.f()}return!1}function Gd(t,e,n,r){var i=e._rootScopes,o=Jd(e._fallback,n,r),a=[].concat(gh(t),gh(i)),s=new Set;s.add(r);var u=Xd(s,a,n,o||n);return null!==u&&((!Xh(o)||o===n||null!==(u=Xd(s,a,o,u)))&&$d(Array.from(s),[""],i,o,(function(){return function(t,e,n){var r=t._getTarget();e in r||(r[e]={});var i=r[e];if(Nh(i)&&Rh(n))return n;return i}(e,n,r)})))}function Xd(t,e,n,r){for(;n;)n=Kd(t,e,n,r);return n}function Qd(t,e,n,r){var i,o,a=kh(e);try{for(a.s();!(o=a.n()).done;){var s=o.value;if(i=tp(Hd(s,t),n),Xh(i))return Wd(t,i)?Gd(n,r,t,i):i}}catch(M_){a.e(M_)}finally{a.f()}}function tp(t,e){var n,r=kh(e);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i){var o=i[t];if(Xh(o))return o}}}catch(M_){r.e(M_)}finally{r.f()}}function ep(t){var e=t._keys;return e||(e=t._keys=function(t){var e,n=new Set,r=kh(t);try{for(r.s();!(e=r.n()).done;){var i,o=e.value,a=kh(Object.keys(o).filter((function(t){return!t.startsWith("_")})));try{for(a.s();!(i=a.n()).done;){var s=i.value;n.add(s)}}catch(M_){a.e(M_)}finally{a.f()}}}catch(M_){r.e(M_)}finally{r.f()}return Array.from(n)}(t._scopes)),e}var np=Number.EPSILON||1e-14,rp=function(t,e){return e<t.length&&!t[e].skip&&t[e]},ip=function(t){return"x"===t?"y":"x"};function op(t,e,n){for(var r,i,o,a,s,u=t.length,c=rp(t,0),l=0;l<u-1;++l)s=c,c=rp(t,l+1),s&&c&&(df(e[l],0,np)?n[l]=n[l+1]=0:(r=n[l]/e[l],i=n[l+1]/e[l],(a=Math.pow(r,2)+Math.pow(i,2))<=9||(o=3/Math.sqrt(a),n[l]=r*o*e[l],n[l+1]=i*o*e[l])))}function ap(t,e){for(var n,r,i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"x",a=ip(o),s=t.length,u=rp(t,0),c=0;c<s;++c)if(r=i,i=u,u=rp(t,c+1),i){var l=i[o],h=i[a];r&&(n=(l-r[o])/3,i["cp1".concat(o)]=l-n,i["cp1".concat(a)]=h-n*e[c]),u&&(n=(u[o]-l)/3,i["cp2".concat(o)]=l+n,i["cp2".concat(a)]=h+n*e[c])}}function sp(t,e,n){return Math.max(Math.min(t,n),e)}function up(t,e,n,r,i){var o,a,s,u,c,l,h,f,d,p,v,m,g,y,b,w,_;if(e.spanGaps&&(t=t.filter((function(t){return!t.skip}))),"monotone"===e.cubicInterpolationMode)!function(t){var e,n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"x",o=ip(i),a=t.length,s=Array(a).fill(0),u=Array(a),c=rp(t,0);for(e=0;e<a;++e)if(n=r,r=c,c=rp(t,e+1),r){if(c){var l=c[i]-r[i];s[e]=0!==l?(c[o]-r[o])/l:0}u[e]=n?c?lf(s[e-1])!==lf(s[e])?0:(s[e-1]+s[e])/2:s[e-1]:s[e]}op(t,s,u),ap(t,u,i)}(t,i);else{var x=r?t[t.length-1]:t[0];for(o=0,a=t.length;o<a;++o)s=t[o],c=x,l=s,h=t[Math.min(o+1,a-(r?0:1))%a],f=e.tension,d=void 0,p=void 0,v=void 0,m=void 0,g=void 0,y=void 0,b=void 0,w=void 0,_=void 0,d=c.skip?l:c,p=l,v=h.skip?l:h,m=yf(p,d),g=yf(v,p),y=m/(m+g),b=g/(m+g),w=f*(y=isNaN(y)?0:y),_=f*(b=isNaN(b)?0:b),u={previous:{x:p.x-w*(v.x-d.x),y:p.y-w*(v.y-d.y)},next:{x:p.x+_*(v.x-d.x),y:p.y+_*(v.y-d.y)}},s.cp1x=u.previous.x,s.cp1y=u.previous.y,s.cp2x=u.next.x,s.cp2y=u.next.y,x=s}e.capBezierPoints&&function(t,e){var n,r,i,o,a,s=yd(t[0],e);for(n=0,r=t.length;n<r;++n)a=o,o=s,s=n<r-1&&yd(t[n+1],e),o&&(i=t[n],a&&(i.cp1x=sp(i.cp1x,e.left,e.right),i.cp1y=sp(i.cp1y,e.top,e.bottom)),s&&(i.cp2x=sp(i.cp2x,e.left,e.right),i.cp2y=sp(i.cp2y,e.top,e.bottom)))}(t,n)}function cp(){return"undefined"!==typeof window&&"undefined"!==typeof document}function lp(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function hp(t,e,n){var r;return"string"===typeof t?(r=parseInt(t,10),-1!==t.indexOf("%")&&(r=r/100*e.parentNode[n])):r=t,r}var fp=function(t){return window.getComputedStyle(t,null)};var dp=["top","right","bottom","left"];function pp(t,e,n){var r={};n=n?"-"+n:"";for(var i=0;i<4;i++){var o=dp[i];r[o]=parseFloat(t[e+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}function vp(t,e){var n=e.canvas,r=e.currentDevicePixelRatio,i=fp(n),o="border-box"===i.boxSizing,a=pp(i,"padding"),s=pp(i,"border","width"),u=function(t,e){var n,r,i=t.native||t,o=i.touches,a=o&&o.length?o[0]:i,s=a.offsetX,u=a.offsetY,c=!1;if(function(t,e,n){return(t>0||e>0)&&(!n||!n.shadowRoot)}(s,u,i.target))n=s,r=u;else{var l=e.getBoundingClientRect();n=a.clientX-l.left,r=a.clientY-l.top,c=!0}return{x:n,y:r,box:c}}(t,n),c=u.x,l=u.y,h=u.box,f=a.left+(h&&s.left),d=a.top+(h&&s.top),p=e.width,v=e.height;return o&&(p-=a.width+s.width,v-=a.height+s.height),{x:Math.round((c-f)/p*n.width/r),y:Math.round((l-d)/v*n.height/r)}}var mp=function(t){return Math.round(10*t)/10};function gp(t,e,n,r){var i=fp(t),o=pp(i,"margin"),a=hp(i.maxWidth,t,"clientWidth")||rf,s=hp(i.maxHeight,t,"clientHeight")||rf,u=function(t,e,n){var r,i;if(void 0===e||void 0===n){var o=lp(t);if(o){var a=o.getBoundingClientRect(),s=fp(o),u=pp(s,"border","width"),c=pp(s,"padding");e=a.width-c.width-u.width,n=a.height-c.height-u.height,r=hp(s.maxWidth,o,"clientWidth"),i=hp(s.maxHeight,o,"clientHeight")}else e=t.clientWidth,n=t.clientHeight}return{width:e,height:n,maxWidth:r||rf,maxHeight:i||rf}}(t,e,n),c=u.width,l=u.height;if("content-box"===i.boxSizing){var h=pp(i,"border","width"),f=pp(i,"padding");c-=f.width+h.width,l-=f.height+h.height}return c=Math.max(0,c-o.width),l=Math.max(0,r?Math.floor(c/r):l-o.height),c=mp(Math.min(c,a,u.maxWidth)),l=mp(Math.min(l,s,u.maxHeight)),c&&!l&&(l=mp(c/2)),{width:c,height:l}}function yp(t,e,n){var r=e||1,i=Math.floor(t.height*r),o=Math.floor(t.width*r);t.height=i/r,t.width=o/r;var a=t.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height="".concat(t.height,"px"),a.style.width="".concat(t.width,"px")),(t.currentDevicePixelRatio!==r||a.height!==i||a.width!==o)&&(t.currentDevicePixelRatio=r,a.height=i,a.width=o,t.ctx.setTransform(r,0,0,r,0,0),!0)}var bp=function(){var t=!1;try{var e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(n){}return t}();function wp(t,e){var n=function(t,e){return fp(t).getPropertyValue(e)}(t,e),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function _p(t,e,n,r){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function xp(t,e,n,r){return{x:t.x+n*(e.x-t.x),y:"middle"===r?n<.5?t.y:e.y:"after"===r?n<1?t.y:e.y:n>0?e.y:t.y}}function kp(t,e,n,r){var i={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=_p(t,i,n),s=_p(i,o,n),u=_p(o,e,n),c=_p(a,s,n),l=_p(s,u,n);return _p(c,l,n)}var Sp=new Map;function Cp(t,e,n){return function(t,e){e=e||{};var n=t+JSON.stringify(e),r=Sp.get(n);return r||(r=new Intl.NumberFormat(t,e),Sp.set(n,r)),r}(e,n).format(t)}function Mp(t,e,n){return t?function(t,e){return{x:function(n){return t+t+e-n},setWidth:function(t){e=t},textAlign:function(t){return"center"===t?t:"right"===t?"left":"right"},xPlus:function(t,e){return t-e},leftForLtr:function(t,e){return t-e}}}(e,n):{x:function(t){return t},setWidth:function(t){},textAlign:function(t){return t},xPlus:function(t,e){return t+e},leftForLtr:function(t,e){return t}}}function Ep(t,e){var n,r;"ltr"!==e&&"rtl"!==e||(r=[(n=t.canvas.style).getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=r)}function Tp(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Ap(t){return"angle"===t?{between:_f,compare:bf,normalize:wf}:{between:function(t,e,n){return t>=Math.min(e,n)&&t<=Math.max(n,e)},compare:function(t,e){return t-e},normalize:function(t){return t}}}function Op(t){var e=t.start,n=t.end,r=t.count;return{start:e%r,end:n%r,loop:t.loop&&(n-e+1)%r===0,style:t.style}}function Dp(t,e,n){if(!n)return[t];for(var r,i,o,a=n.property,s=n.start,u=n.end,c=e.length,l=Ap(a),h=l.compare,f=l.between,d=l.normalize,p=function(t,e,n){var r,i,o=n.property,a=n.start,s=n.end,u=Ap(o),c=u.between,l=u.normalize,h=e.length,f=t.start,d=t.end,p=t.loop;if(p){for(f+=h,d+=h,r=0,i=h;r<i&&c(l(e[f%h][o]),a,s);++r)f--,d--;f%=h,d%=h}return d<f&&(d+=h),{start:f,end:d,loop:p,style:t.style}}(t,e,n),v=p.start,m=p.end,g=p.loop,y=p.style,b=[],w=!1,_=null,x=function(){return w||f(s,o,r)&&0!==h(s,o)},k=function(){return!w||0===h(u,r)||f(u,o,r)},S=v,C=v;S<=m;++S)(i=e[S%c]).skip||(r=d(i[a]))!==o&&(w=f(r,s,u),null===_&&x()&&(_=0===h(r,s)?S:C),null!==_&&k()&&(b.push(Op({start:_,end:S,loop:g,count:c,style:y})),_=null),C=S,o=r);return null!==_&&b.push(Op({start:_,end:m,loop:g,count:c,style:y})),b}function Pp(t,e){for(var n=[],r=t.segments,i=0;i<r.length;i++){var o=Dp(r[i],t.points,e);o.length&&n.push.apply(n,gh(o))}return n}function Lp(t,e,n,r){return r&&r.setContext&&n?function(t,e,n,r){var i,o=Np(t.options),a=n.length,s=[],u=e[0].start,c=u,l=kh(e);try{for(l.s();!(i=l.n()).done;){var h=i.value,f=o,d=n[u%a],p=void 0;for(c=u+1;c<=h.end;c++){var v=n[c%a];Rp(p=Np(r.setContext({type:"segment",p0:d,p1:v,p0DataIndex:(c-1)%a,p1DataIndex:c%a,datasetIndex:t._datasetIndex})),f)&&(s.push({start:u,end:c-1,loop:h.loop,style:f}),f=p,u=c-1),d=v,f=p}u<c-1&&(s.push({start:u,end:c-1,loop:h.loop,style:p}),u=c-1)}}catch(M_){l.e(M_)}finally{l.f()}return s}(t,e,n,r):e}function Np(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Rp(t,e){return e&&JSON.stringify(t)!==JSON.stringify(e)}function Ip(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 zp(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Ip(Object(n),!0).forEach((function(e){Wp(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ip(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Bp(t,e,n){return(Bp="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Up(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(n):i.value}})(t,e,n||t)}function jp(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&&Fp(t,e)}function Fp(t,e){return(Fp=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function qp(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Up(t);if(e){var i=Up(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return $p(this,n)}}function $p(t,e){return!e||"object"!==Jp(e)&&"function"!==typeof e?Vp(t):e}function Vp(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Up(t){return(Up=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Hp(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=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(M_){i=!0,o=M_}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||Kp(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 Wp(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Zp(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=Kp(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Jp(t){return(Jp="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yp(t){return function(t){if(Array.isArray(t))return Gp(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||Kp(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 Kp(t,e){if(t){if("string"===typeof t)return Gp(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gp(t,e):void 0}}function Gp(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Xp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qp(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function tv(t,e,n){return e&&Qp(t.prototype,e),n&&Qp(t,n),t}var ev=new(function(){function t(){Xp(this,t),this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}return tv(t,[{key:"_notify",value:function(t,e,n,r){var i=e.listeners[r],o=e.duration;i.forEach((function(r){return r({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(n-e.start,o)})}))}},{key:"_refresh",value:function(){var t=this;t._request||(t._running=!0,t._request=Mh.call(window,(function(){t._update(),t._request=null,t._running&&t._refresh()})))}},{key:"_update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now(),e=this,n=0;e._charts.forEach((function(r,i){if(r.running&&r.items.length){for(var o,a=r.items,s=a.length-1,u=!1;s>=0;--s)(o=a[s])._active?(o._total>r.duration&&(r.duration=o._total),o.tick(t),u=!0):(a[s]=a[a.length-1],a.pop());u&&(i.draw(),e._notify(i,r,t,"progress")),a.length||(r.running=!1,e._notify(i,r,t,"complete"),r.initial=!1),n+=a.length}})),e._lastDate=t,0===n&&(e._running=!1)}},{key:"_getAnims",value:function(t){var e=this._charts,n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}},{key:"listen",value:function(t,e,n){this._getAnims(t).listeners[e].push(n)}},{key:"add",value:function(t,e){var n;e&&e.length&&(n=this._getAnims(t).items).push.apply(n,Yp(e))}},{key:"has",value:function(t){return this._getAnims(t).items.length>0}},{key:"start",value:function(t){var e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((function(t,e){return Math.max(t,e._duration)}),0),this._refresh())}},{key:"running",value:function(t){if(!this._running)return!1;var e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}},{key:"stop",value:function(t){var e=this._charts.get(t);if(e&&e.items.length){for(var n=e.items,r=n.length-1;r>=0;--r)n[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}}},{key:"remove",value:function(t){return this._charts.delete(t)}}]),t}()),nv="transparent",rv={boolean:function(t,e,n){return n>.5?e:t},color:function(t,e,n){var r=ad(t||nv),i=r.valid&&ad(e||nv);return i&&i.valid?i.mix(r,n).hexString():e},number:function(t,e,n){return t+(e-t)*n}},iv=function(){function t(e,n,r,i){Xp(this,t);var o=n[r];i=Rd([e.to,i,o,e.from]);var a=Rd([e.from,o,i]);this._active=!0,this._fn=e.fn||rv[e.type||Jp(a)],this._easing=Mf[e.easing]||Mf.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=r,this._from=a,this._to=i,this._promises=void 0}return tv(t,[{key:"active",value:function(){return this._active}},{key:"update",value:function(t,e,n){var r=this;if(r._active){r._notify(!1);var i=r._target[r._prop],o=n-r._start,a=r._duration-o;r._start=n,r._duration=Math.floor(Math.max(a,t.duration)),r._total+=o,r._loop=!!t.loop,r._to=Rd([t.to,e,i,t.from]),r._from=Rd([t.from,i,e])}}},{key:"cancel",value:function(){var t=this;t._active&&(t.tick(Date.now()),t._active=!1,t._notify(!1))}},{key:"tick",value:function(t){var e,n=this,r=t-n._start,i=n._duration,o=n._prop,a=n._from,s=n._loop,u=n._to;if(n._active=a!==u&&(s||r<i),!n._active)return n._target[o]=u,void n._notify(!0);r<0?n._target[o]=a:(e=r/i%2,e=s&&e>1?2-e:e,e=n._easing(Math.min(1,Math.max(0,e))),n._target[o]=n._fn(a,u,e))}},{key:"wait",value:function(){var t=this._promises||(this._promises=[]);return new Promise((function(e,n){t.push({res:e,rej:n})}))}},{key:"_notify",value:function(t){for(var e=t?"res":"rej",n=this._promises||[],r=0;r<n.length;r++)n[r][e]()}}]),t}();fd.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});var ov=Object.keys(fd.animation);fd.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:function(t){return"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}}),fd.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),fd.describe("animations",{_fallback:"animation"}),fd.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:function(t){return 0|t}}}}});var av=function(){function t(e,n){Xp(this,t),this._chart=e,this._properties=new Map,this.configure(n)}return tv(t,[{key:"configure",value:function(t){if(Rh(t)){var e=this._properties;Object.getOwnPropertyNames(t).forEach((function(n){var r=t[n];if(Rh(r)){var i,o={},a=Zp(ov);try{for(a.s();!(i=a.n()).done;){var s=i.value;o[s]=r[s]}}catch(M_){a.e(M_)}finally{a.f()}(Nh(r.properties)&&r.properties||[n]).forEach((function(t){t!==n&&e.has(t)||e.set(t,o)}))}}))}}},{key:"_animateOptions",value:function(t,e){var n=e.options,r=function(t,e){if(!e)return;var n=t.options;if(!n)return void(t.options=e);n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}}));return n}(t,n);if(!r)return[];var i=this._createAnimations(r,n);return n.$shared&&function(t,e){for(var n=[],r=Object.keys(e),i=0;i<r.length;i++){var o=t[r[i]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}(t.options.$animations,n).then((function(){t.options=n}),(function(){})),i}},{key:"_createAnimations",value:function(t,e){var n,r=this._properties,i=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),s=Date.now();for(n=a.length-1;n>=0;--n){var u=a[n];if("$"!==u.charAt(0))if("options"!==u){var c=e[u],l=o[u],h=r.get(u);if(l){if(h&&l.active()){l.update(h,c,s);continue}l.cancel()}h&&h.duration?(o[u]=l=new iv(h,t,u,c),i.push(l)):t[u]=c}else i.push.apply(i,Yp(this._animateOptions(t,e)))}return i}},{key:"update",value:function(t,e){if(0!==this._properties.size){var n=this._createAnimations(t,e);return n.length?(ev.add(this._chart,n),!0):void 0}Object.assign(t,e)}}]),t}();function sv(t,e){var n=t&&t.options||{},r=n.reverse,i=void 0===n.min?e:0,o=void 0===n.max?e:0;return{start:r?o:i,end:r?i:o}}function uv(t,e){var n,r,i=[],o=t._getSortedDatasetMetas(e);for(n=0,r=o.length;n<r;++n)i.push(o[n].index);return i}function cv(t,e,n,r){var i,o,a,s,u=t.keys,c="single"===r.mode;if(null!==e){for(i=0,o=u.length;i<o;++i){if((a=+u[i])===n){if(r.all)continue;break}s=t.values[a],Ih(s)&&(c||0===e||lf(e)===lf(s))&&(e+=s)}return e}}function lv(t,e){var n=t&&t.options.stacked;return n||void 0===n&&void 0!==e.stack}function hv(t,e,n){var r=t[e]||(t[e]={});return r[n]||(r[n]={})}function fv(t,e,n){var r,i=Zp(e.getMatchingVisibleMetas("bar").reverse());try{for(i.s();!(r=i.n()).done;){var o=r.value,a=t[o.index];if(n&&a>0||!n&&a<0)return o.index}}catch(M_){i.e(M_)}finally{i.f()}return null}function dv(t,e){for(var n,r=t.chart,i=t._cachedMeta,o=r._stacks||(r._stacks={}),a=i.iScale,s=i.vScale,u=i.index,c=a.axis,l=s.axis,h=function(t,e,n){return"".concat(t.id,".").concat(e.id,".").concat(n.stack||n.type)}(a,s,i),f=e.length,d=0;d<f;++d){var p=e[d],v=p[c],m=p[l];(n=(p._stacks||(p._stacks={}))[l]=hv(o,h,v))[u]=m,n._top=fv(n,s,!0),n._bottom=fv(n,s,!1)}}function pv(t,e){var n=t.scales;return Object.keys(n).filter((function(t){return n[t].axis===e})).shift()}function vv(t,e){var n=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){var i,o=Zp(e=e||t._parsed);try{for(o.s();!(i=o.n()).done;){var a=i.value._stacks;if(!a||void 0===a[r]||void 0===a[r][n])return;delete a[r][n]}}catch(M_){o.e(M_)}finally{o.f()}}}var mv=function(t){return"reset"===t||"none"===t},gv=function(t,e){return e?t:Object.assign({},t)},yv=function(){function t(e,n){Xp(this,t),this.chart=e,this._ctx=e.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}return tv(t,[{key:"initialize",value:function(){var t=this,e=t._cachedMeta;t.configure(),t.linkScales(),e._stacked=lv(e.vScale,e),t.addElements()}},{key:"updateIndex",value:function(t){this.index!==t&&vv(this._cachedMeta),this.index=t}},{key:"linkScales",value:function(){var t=this,e=t.chart,n=t._cachedMeta,r=t.getDataset(),i=function(t,e,n,r){return"x"===t?e:"r"===t?r:n},o=n.xAxisID=Bh(r.xAxisID,pv(e,"x")),a=n.yAxisID=Bh(r.yAxisID,pv(e,"y")),s=n.rAxisID=Bh(r.rAxisID,pv(e,"r")),u=n.indexAxis,c=n.iAxisID=i(u,o,a,s),l=n.vAxisID=i(u,a,o,s);n.xScale=t.getScaleForId(o),n.yScale=t.getScaleForId(a),n.rScale=t.getScaleForId(s),n.iScale=t.getScaleForId(c),n.vScale=t.getScaleForId(l)}},{key:"getDataset",value:function(){return this.chart.data.datasets[this.index]}},{key:"getMeta",value:function(){return this.chart.getDatasetMeta(this.index)}},{key:"getScaleForId",value:function(t){return this.chart.scales[t]}},{key:"_getOtherScale",value:function(t){var e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}},{key:"reset",value:function(){this._update("reset")}},{key:"_destroy",value:function(){var t=this._cachedMeta;this._data&&Fd(this._data,this),t._stacked&&vv(t)}},{key:"_dataCheck",value:function(){var t,e,n=this,r=n.getDataset(),i=r.data||(r.data=[]),o=n._data;if(Rh(i))n._data=function(t){var e,n,r,i=Object.keys(t),o=new Array(i.length);for(e=0,n=i.length;e<n;++e)r=i[e],o[e]={x:r,y:t[r]};return o}(i);else if(o!==i){if(o){Fd(o,n);var a=n._cachedMeta;vv(a),a._parsed=[]}i&&Object.isExtensible(i)&&(e=n,(t=i)._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),jd.forEach((function(e){var n="_onData"+Gh(e),r=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){for(var e=arguments.length,i=new Array(e),o=0;o<e;o++)i[o]=arguments[o];var a=r.apply(this,i);return t._chartjs.listeners.forEach((function(t){"function"===typeof t[n]&&t[n].apply(t,i)})),a}})})))),n._syncList=[],n._data=i}}},{key:"addElements",value:function(){var t=this,e=t._cachedMeta;t._dataCheck(),t.datasetElementType&&(e.dataset=new t.datasetElementType)}},{key:"buildOrUpdateElements",value:function(t){var e=this,n=e._cachedMeta,r=e.getDataset(),i=!1;e._dataCheck();var o=n._stacked;n._stacked=lv(n.vScale,n),n.stack!==r.stack&&(i=!0,vv(n),n.stack=r.stack),e._resyncElements(t),(i||o!==n._stacked)&&dv(e,n._parsed)}},{key:"configure",value:function(){var t=this,e=t.chart.config,n=e.datasetScopeKeys(t._type),r=e.getOptionScopes(t.getDataset(),n,!0);t.options=e.createResolver(r,t.getContext()),t._parsing=t.options.parsing}},{key:"parse",value:function(t,e){var n,r,i,o=this,a=o._cachedMeta,s=o._data,u=a.iScale,c=a._stacked,l=u.axis,h=0===t&&e===s.length||a._sorted,f=t>0&&a._parsed[t-1];if(!1===o._parsing)a._parsed=s,a._sorted=!0,i=s;else{i=Nh(s[t])?o.parseArrayData(a,s,t,e):Rh(s[t])?o.parseObjectData(a,s,t,e):o.parsePrimitiveData(a,s,t,e);for(n=0;n<e;++n)a._parsed[n+t]=r=i[n],h&&((null===r[l]||f&&r[l]<f[l])&&(h=!1),f=r);a._sorted=h}c&&dv(o,i)}},{key:"parsePrimitiveData",value:function(t,e,n,r){var i,o,a,s=t.iScale,u=t.vScale,c=s.axis,l=u.axis,h=s.getLabels(),f=s===u,d=new Array(r);for(i=0,o=r;i<o;++i){var p;a=i+n,d[i]=(Wp(p={},c,f||s.parse(h[a],a)),Wp(p,l,u.parse(e[a],a)),p)}return d}},{key:"parseArrayData",value:function(t,e,n,r){var i,o,a,s,u=t.xScale,c=t.yScale,l=new Array(r);for(i=0,o=r;i<o;++i)s=e[a=i+n],l[i]={x:u.parse(s[0],a),y:c.parse(s[1],a)};return l}},{key:"parseObjectData",value:function(t,e,n,r){var i,o,a,s,u=t.xScale,c=t.yScale,l=this._parsing,h=l.xAxisKey,f=void 0===h?"x":h,d=l.yAxisKey,p=void 0===d?"y":d,v=new Array(r);for(i=0,o=r;i<o;++i)s=e[a=i+n],v[i]={x:u.parse(Kh(s,f),a),y:c.parse(Kh(s,p),a)};return v}},{key:"getParsed",value:function(t){return this._cachedMeta._parsed[t]}},{key:"getDataElement",value:function(t){return this._cachedMeta.data[t]}},{key:"applyStack",value:function(t,e,n){var r=this.chart,i=this._cachedMeta,o=e[t.axis];return cv({keys:uv(r,!0),values:e._stacks[t.axis]},o,i.index,{mode:n})}},{key:"updateRangeFromParsed",value:function(t,e,n,r){var i=n[e.axis],o=null===i?NaN:i,a=r&&n._stacks[e.axis];r&&a&&(r.values=a,t.min=Math.min(t.min,o),t.max=Math.max(t.max,o),o=cv(r,i,this._cachedMeta.index,{all:!0})),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}},{key:"getMinMax",value:function(t,e){var n,r,i,o,a=this,s=a._cachedMeta,u=s._parsed,c=s._sorted&&t===s.iScale,l=u.length,h=a._getOtherScale(t),f=e&&s._stacked&&{keys:uv(a.chart,!0),values:null},d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},p=function(t){var e=t.getUserBounds(),n=e.min,r=e.max,i=e.minDefined,o=e.maxDefined;return{min:i?n:Number.NEGATIVE_INFINITY,max:o?r:Number.POSITIVE_INFINITY}}(h),v=p.min,m=p.max;function g(){return i=u[n],r=i[t.axis],o=i[h.axis],!Ih(r)||v>o||m<o}for(n=0;n<l&&(g()||(a.updateRangeFromParsed(d,t,i,f),!c));++n);if(c)for(n=l-1;n>=0;--n)if(!g()){a.updateRangeFromParsed(d,t,i,f);break}return d}},{key:"getAllParsedValues",value:function(t){var e,n,r,i=this._cachedMeta._parsed,o=[];for(e=0,n=i.length;e<n;++e)r=i[e][t.axis],Ih(r)&&o.push(r);return o}},{key:"getMaxOverflow",value:function(){return!1}},{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta,n=e.iScale,r=e.vScale,i=this.getParsed(t);return{label:n?""+n.getLabelForValue(i[n.axis]):"",value:r?""+r.getLabelForValue(i[r.axis]):""}}},{key:"_update",value:function(t){var e,n,r,i,o,a=this,s=a._cachedMeta;a.configure(),a._cachedDataOpts={},a.update(t||"default"),s._clip=(Rh(e=Bh(a.options.clip,function(t,e,n){if(!1===n)return!1;var r=sv(t,n),i=sv(e,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}(s.xScale,s.yScale,a.getMaxOverflow())))?(n=e.top,r=e.right,i=e.bottom,o=e.left):n=r=i=o=e,{top:n,right:r,bottom:i,left:o,disabled:!1===e})}},{key:"update",value:function(t){}},{key:"draw",value:function(){var t,e=this,n=e._ctx,r=e.chart,i=e._cachedMeta,o=i.data||[],a=r.chartArea,s=[],u=e._drawStart||0,c=e._drawCount||o.length-u;for(i.dataset&&i.dataset.draw(n,a,u,c),t=u;t<u+c;++t){var l=o[t];l.hidden||(l.active?s.push(l):l.draw(n,a))}for(t=0;t<s.length;++t)s[t].draw(n,a)}},{key:"getStyle",value:function(t,e){var n=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}},{key:"getContext",value:function(t,e,n){var r,i=this,o=i.getDataset();if(t>=0&&t<i._cachedMeta.data.length){var a=i._cachedMeta.data[t];(r=a.$context||(a.$context=function(t,e,n){return Object.assign(Object.create(t),{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}(i.getContext(),t,a))).parsed=i.getParsed(t),r.raw=o.data[t],r.index=r.dataIndex=t}else(r=i.$context||(i.$context=function(t,e){return Object.assign(Object.create(t),{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}(i.chart.getContext(),i.index))).dataset=o,r.index=r.datasetIndex=i.index;return r.active=!!e,r.mode=n,r}},{key:"resolveDatasetElementOptions",value:function(t){return this._resolveElementOptions(this.datasetElementType.id,t)}},{key:"resolveDataElementOptions",value:function(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}},{key:"_resolveElementOptions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",n=arguments.length>2?arguments[2]:void 0,r=this,i="active"===e,o=r._cachedDataOpts,a=t+"-"+e,s=o[a],u=r.enableOptionSharing&&Xh(n);if(s)return gv(s,u);var c=r.chart.config,l=c.datasetElementScopeKeys(r._type,t),h=i?["".concat(t,"Hover"),"hover",t,""]:[t,""],f=c.getOptionScopes(r.getDataset(),l),d=Object.keys(fd.elements[t]),p=function(){return r.getContext(n,i)},v=c.resolveNamedOptions(f,d,p,h);return v.$shared&&(v.$shared=u,o[a]=Object.freeze(gv(v,u))),v}},{key:"_resolveAnimations",value:function(t,e,n){var r,i=this,o=i.chart,a=i._cachedDataOpts,s="animation-".concat(e),u=a[s];if(u)return u;if(!1!==o.options.animation){var c=i.chart.config,l=c.datasetAnimationScopeKeys(i._type,e),h=c.getOptionScopes(i.getDataset(),l);r=c.createResolver(h,i.getContext(t,n,e))}var f=new av(o,r&&r.animations);return r&&r._cacheable&&(a[s]=Object.freeze(f)),f}},{key:"getSharedOptions",value:function(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}},{key:"includeOptions",value:function(t,e){return!e||mv(t)||this.chart._animationsDisabled}},{key:"updateElement",value:function(t,e,n,r){mv(r)?Object.assign(t,n):this._resolveAnimations(e,r).update(t,n)}},{key:"updateSharedOptions",value:function(t,e,n){t&&!mv(e)&&this._resolveAnimations(void 0,e).update(t,n)}},{key:"_setStyle",value:function(t,e,n,r){t.active=r;var i=this.getStyle(e,r);this._resolveAnimations(e,n,r).update(t,{options:!r&&this.getSharedOptions(i)||i})}},{key:"removeHoverStyle",value:function(t,e,n){this._setStyle(t,n,"active",!1)}},{key:"setHoverStyle",value:function(t,e,n){this._setStyle(t,n,"active",!0)}},{key:"_removeDatasetHoverStyle",value:function(){var t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}},{key:"_setDatasetHoverStyle",value:function(){var t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}},{key:"_resyncElements",value:function(t){var e,n=this,r=n._data,i=n._cachedMeta.data,o=Zp(n._syncList);try{for(o.s();!(e=o.n()).done;){var a=Hp(e.value,3),s=a[0],u=a[1],c=a[2];n[s](u,c)}}catch(M_){o.e(M_)}finally{o.f()}n._syncList=[];var l=i.length,h=r.length,f=Math.min(h,l);f&&n.parse(0,f),h>l?n._insertElements(l,h-l,t):h<l&&n._removeElements(h,l-h)}},{key:"_insertElements",value:function(t,e){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=this,o=i._cachedMeta,a=o.data,s=t+e,u=function(t){for(t.length+=e,n=t.length-1;n>=s;n--)t[n]=t[n-e]};for(u(a),n=t;n<s;++n)a[n]=new i.dataElementType;i._parsing&&u(o._parsed),i.parse(t,e),r&&i.updateElements(a,t,e,"reset")}},{key:"updateElements",value:function(t,e,n,r){}},{key:"_removeElements",value:function(t,e){var n=this._cachedMeta;if(this._parsing){var r=n._parsed.splice(t,e);n._stacked&&vv(n,r)}n.data.splice(t,e)}},{key:"_sync",value:function(t){if(this._parsing)this._syncList.push(t);else{var e=Hp(t,3),n=e[0],r=e[1],i=e[2];this[n](r,i)}}},{key:"_onDataPush",value:function(){var t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}},{key:"_onDataPop",value:function(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}},{key:"_onDataShift",value:function(){this._sync(["_removeElements",0,1])}},{key:"_onDataSplice",value:function(t,e){this._sync(["_removeElements",t,e]),this._sync(["_insertElements",t,arguments.length-2])}},{key:"_onDataUnshift",value:function(){this._sync(["_insertElements",0,arguments.length])}}]),t}();function bv(t){var e,n,r,i,o=function(t){if(!t._cache.$bar){for(var e=t.getMatchingVisibleMetas("bar"),n=[],r=0,i=e.length;r<i;r++)n=n.concat(e[r].controller.getAllParsedValues(t));t._cache.$bar=qd(n.sort((function(t,e){return t-e})))}return t._cache.$bar}(t),a=t._length,s=function(){32767!==r&&-32768!==r&&(Xh(i)&&(a=Math.min(a,Math.abs(r-i)||a)),i=r)};for(e=0,n=o.length;e<n;++e)r=t.getPixelForValue(o[e]),s();for(i=void 0,e=0,n=t.ticks.length;e<n;++e)r=t.getPixelForTick(e),s();return a}function wv(t,e,n,r){return Nh(t)?function(t,e,n,r){var i=n.parse(t[0],r),o=n.parse(t[1],r),a=Math.min(i,o),s=Math.max(i,o),u=a,c=s;Math.abs(a)>Math.abs(s)&&(u=s,c=a),e[n.axis]=c,e._custom={barStart:u,barEnd:c,start:i,end:o,min:a,max:s}}(t,e,n,r):e[n.axis]=n.parse(t,r),e}function _v(t,e,n,r){var i,o,a,s,u=t.iScale,c=t.vScale,l=u.getLabels(),h=u===c,f=[];for(i=n,o=n+r;i<o;++i)s=e[i],(a={})[u.axis]=h||u.parse(l[i],i),f.push(wv(s,a,c,i));return f}function xv(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function kv(t,e,n,r){var i=e.borderSkipped,o={};if(i){var a=function(t){var e,n,r,i,o;return t.horizontal?(e=t.base>t.x,n="left",r="right"):(e=t.base<t.y,n="bottom",r="top"),e?(i="end",o="start"):(i="start",o="end"),{start:n,end:r,reverse:e,top:i,bottom:o}}(t),s=a.start,u=a.end,c=a.reverse,l=a.top,h=a.bottom;"middle"===i&&n&&(t.enableBorderRadius=!0,(n._top||0)===r?i=l:(n._bottom||0)===r?i=h:(o[Sv(h,s,u,c)]=!0,i=l)),o[Sv(i,s,u,c)]=!0,t.borderSkipped=o}else t.borderSkipped=o}function Sv(t,e,n,r){var i,o,a;return r?(a=n,t=Cv(t=(i=t)===(o=e)?a:i===a?o:i,n,e)):t=Cv(t,e,n),t}function Cv(t,e,n){return"start"===t?e:"end"===t?n:t}yv.defaults={},yv.prototype.datasetElementType=null,yv.prototype.dataElementType=null;var Mv=function(t){jp(n,t);var e=qp(n);function n(){return Xp(this,n),e.apply(this,arguments)}return tv(n,[{key:"parsePrimitiveData",value:function(t,e,n,r){return _v(t,e,n,r)}},{key:"parseArrayData",value:function(t,e,n,r){return _v(t,e,n,r)}},{key:"parseObjectData",value:function(t,e,n,r){var i,o,a,s,u=t.iScale,c=t.vScale,l=this._parsing,h=l.xAxisKey,f=void 0===h?"x":h,d=l.yAxisKey,p=void 0===d?"y":d,v="x"===u.axis?f:p,m="x"===c.axis?f:p,g=[];for(i=n,o=n+r;i<o;++i)s=e[i],(a={})[u.axis]=u.parse(Kh(s,v),i),g.push(wv(Kh(s,m),a,c,i));return g}},{key:"updateRangeFromParsed",value:function(t,e,r,i){Bp(Up(n.prototype),"updateRangeFromParsed",this).call(this,t,e,r,i);var o=r._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}},{key:"getMaxOverflow",value:function(){return 0}},{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta,n=e.iScale,r=e.vScale,i=this.getParsed(t),o=i._custom,a=xv(o)?"["+o.start+", "+o.end+"]":""+r.getLabelForValue(i[r.axis]);return{label:""+n.getLabelForValue(i[n.axis]),value:a}}},{key:"initialize",value:function(){var t=this;t.enableOptionSharing=!0,Bp(Up(n.prototype),"initialize",this).call(this),t._cachedMeta.stack=t.getDataset().stack}},{key:"update",value:function(t){var e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}},{key:"updateElements",value:function(t,e,n,r){var i=this,o="reset"===r,a=i.index,s=i._cachedMeta.vScale,u=s.getBasePixel(),c=s.isHorizontal(),l=i._getRuler(),h=i.resolveDataElementOptions(e,r),f=i.getSharedOptions(h),d=i.includeOptions(r,f);i.updateSharedOptions(f,r,h);for(var p=e;p<e+n;p++){var v=i.getParsed(p),m=o||Lh(v[s.axis])?{base:u,head:u}:i._calculateBarValuePixels(p),g=i._calculateBarIndexPixels(p,l),y=(v._stacks||{})[s.axis],b={horizontal:c,base:m.base,enableBorderRadius:!y||xv(v._custom)||a===y._top||a===y._bottom,x:c?m.head:g.center,y:c?g.center:m.head,height:c?g.size:Math.abs(m.size),width:c?Math.abs(m.size):g.size};d&&(b.options=f||i.resolveDataElementOptions(p,t[p].active?"active":r)),kv(b,b.options||t[p].options,y,a),i.updateElement(t[p],p,b,r)}}},{key:"_getStacks",value:function(t,e){var n,r,i=this._cachedMeta.iScale,o=i.getMatchingVisibleMetas(this._type),a=i.options.stacked,s=o.length,u=[];for(n=0;n<s;++n)if((r=o[n]).controller.options.grouped){if("undefined"!==typeof e){var c=r.controller.getParsed(e)[r.controller._cachedMeta.vScale.axis];if(Lh(c)||isNaN(c))continue}if((!1===a||-1===u.indexOf(r.stack)||void 0===a&&void 0===r.stack)&&u.push(r.stack),r.index===t)break}return u.length||u.push(void 0),u}},{key:"_getStackCount",value:function(t){return this._getStacks(void 0,t).length}},{key:"_getStackIndex",value:function(t,e,n){var r=this._getStacks(t,n),i=void 0!==e?r.indexOf(e):-1;return-1===i?r.length-1:i}},{key:"_getRuler",value:function(){var t,e,n=this,r=n.options,i=n._cachedMeta,o=i.iScale,a=[];for(t=0,e=i.data.length;t<e;++t)a.push(o.getPixelForValue(n.getParsed(t)[o.axis],t));var s=r.barThickness;return{min:s||bv(o),pixels:a,start:o._startPixel,end:o._endPixel,stackCount:n._getStackCount(),scale:o,grouped:r.grouped,ratio:s?1:r.categoryPercentage*r.barPercentage}}},{key:"_calculateBarValuePixels",value:function(t){var e,n,r=this,i=r._cachedMeta,o=i.vScale,a=i._stacked,s=r.options,u=s.base,c=s.minBarLength,l=u||0,h=r.getParsed(t),f=h._custom,d=xv(f),p=h[o.axis],v=0,m=a?r.applyStack(o,h,a):p;m!==p&&(v=m-p,m=p),d&&(p=f.barStart,m=f.barEnd-f.barStart,0!==p&&lf(p)!==lf(f.barEnd)&&(v=0),v+=p);var g=Lh(u)||d?v:u,y=o.getPixelForValue(g);if(n=(e=r.chart.getDataVisibility(t)?o.getPixelForValue(v+m):y)-y,Math.abs(n)<c&&(n=function(t,e,n){return 0!==t?lf(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}(n,o,l)*c,p===l&&(y-=n/2),e=y+n),y===o.getPixelForValue(l)){var b=lf(n)*o.getLineWidthForValue(l)/2;y+=b,n-=b}return{size:n,base:y,head:e,center:e+n/2}}},{key:"_calculateBarIndexPixels",value:function(t,e){var n,r,i=this,o=e.scale,a=i.options,s=a.skipNull,u=Bh(a.maxBarThickness,1/0);if(e.grouped){var c=s?i._getStackCount(t):e.stackCount,l="flex"===a.barThickness?function(t,e,n,r){var i=e.pixels,o=i[t],a=t>0?i[t-1]:null,s=t<i.length-1?i[t+1]:null,u=n.categoryPercentage;null===a&&(a=o-(null===s?e.end-e.start:s-o)),null===s&&(s=o+o-a);var c=o-(o-Math.min(a,s))/2*u;return{chunk:Math.abs(s-a)/2*u/r,ratio:n.barPercentage,start:c}}(t,e,a,c):function(t,e,n,r){var i,o,a=n.barThickness;return Lh(a)?(i=e.min*n.categoryPercentage,o=n.barPercentage):(i=a*r,o=1),{chunk:i/r,ratio:o,start:e.pixels[t]-i/2}}(t,e,a,c),h=i._getStackIndex(i.index,i._cachedMeta.stack,s?t:void 0);n=l.start+l.chunk*h+l.chunk/2,r=Math.min(u,l.chunk*l.ratio)}else n=o.getPixelForValue(i.getParsed(t)[o.axis],t),r=Math.min(u,e.min*e.ratio);return{base:n-r/2,head:n+r/2,center:n,size:r}}},{key:"draw",value:function(){for(var t=this,e=t._cachedMeta,n=e.vScale,r=e.data,i=r.length,o=0;o<i;++o)null!==t.getParsed(o)[n.axis]&&r[o].draw(t._ctx)}}]),n}(yv);Mv.id="bar",Mv.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},Mv.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};var Ev=function(t){jp(n,t);var e=qp(n);function n(){return Xp(this,n),e.apply(this,arguments)}return tv(n,[{key:"initialize",value:function(){this.enableOptionSharing=!0,Bp(Up(n.prototype),"initialize",this).call(this)}},{key:"parseObjectData",value:function(t,e,n,r){var i,o,a,s=t.xScale,u=t.yScale,c=this._parsing,l=c.xAxisKey,h=void 0===l?"x":l,f=c.yAxisKey,d=void 0===f?"y":f,p=[];for(i=n,o=n+r;i<o;++i)a=e[i],p.push({x:s.parse(Kh(a,h),i),y:u.parse(Kh(a,d),i),_custom:a&&a.r&&+a.r});return p}},{key:"getMaxOverflow",value:function(){for(var t=this._cachedMeta,e=t.data,n=t._parsed,r=0,i=e.length-1;i>=0;--i)r=Math.max(r,e[i].size()/2,n[i]._custom);return r>0&&r}},{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta,n=e.xScale,r=e.yScale,i=this.getParsed(t),o=n.getLabelForValue(i.x),a=r.getLabelForValue(i.y),s=i._custom;return{label:e.label,value:"("+o+", "+a+(s?", "+s:"")+")"}}},{key:"update",value:function(t){var e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}},{key:"updateElements",value:function(t,e,n,r){for(var i=this,o="reset"===r,a=i._cachedMeta,s=a.iScale,u=a.vScale,c=i.resolveDataElementOptions(e,r),l=i.getSharedOptions(c),h=i.includeOptions(r,l),f=s.axis,d=u.axis,p=e;p<e+n;p++){var v=t[p],m=!o&&i.getParsed(p),g={},y=g[f]=o?s.getPixelForDecimal(.5):s.getPixelForValue(m[f]),b=g[d]=o?u.getBasePixel():u.getPixelForValue(m[d]);g.skip=isNaN(y)||isNaN(b),h&&(g.options=i.resolveDataElementOptions(p,v.active?"active":r),o&&(g.options.radius=0)),i.updateElement(v,p,g,r)}i.updateSharedOptions(l,r,c)}},{key:"resolveDataElementOptions",value:function(t,e){var r=this.getParsed(t),i=Bp(Up(n.prototype),"resolveDataElementOptions",this).call(this,t,e);i.$shared&&(i=Object.assign({},i,{$shared:!1}));var o=i.radius;return"active"!==e&&(i.radius=0),i.radius+=Bh(r&&r._custom,o),i}}]),n}(yv);Ev.id="bubble",Ev.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},Ev.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title:function(){return""}}}}};var Tv=function(t){jp(n,t);var e=qp(n);function n(t,r){var i;return Xp(this,n),(i=e.call(this,t,r)).enableOptionSharing=!0,i.innerRadius=void 0,i.outerRadius=void 0,i.offsetX=void 0,i.offsetY=void 0,i}return tv(n,[{key:"linkScales",value:function(){}},{key:"parse",value:function(t,e){var n,r,i=this.getDataset().data,o=this._cachedMeta;for(n=t,r=t+e;n<r;++n)o._parsed[n]=+i[n]}},{key:"_getRotation",value:function(){return vf(this.options.rotation-90)}},{key:"_getCircumference",value:function(){return vf(this.options.circumference)}},{key:"_getRotationExtents",value:function(){for(var t=ef,e=-ef,n=this,r=0;r<n.chart.data.datasets.length;++r)if(n.chart.isDatasetVisible(r)){var i=n.chart.getDatasetMeta(r).controller,o=i._getRotation(),a=i._getCircumference();t=Math.min(t,o),e=Math.max(e,o+a)}return{rotation:t,circumference:e-t}}},{key:"update",value:function(t){var e,n,r=this,i=r.chart.chartArea,o=r._cachedMeta,a=o.data,s=r.getMaxBorderWidth()+r.getMaxOffset(a)+r.options.spacing,u=Math.max((Math.min(i.width,i.height)-s)/2,0),c=Math.min((e=r.options.cutout,n=u,"string"===typeof e&&e.endsWith("%")?parseFloat(e)/100:e/n),1),l=r._getRingWeight(r.index),h=r._getRotationExtents(),f=h.circumference,d=function(t,e,n){var r=1,i=1,o=0,a=0;if(e<ef){var s=t,u=s+e,c=Math.cos(s),l=Math.sin(s),h=Math.cos(u),f=Math.sin(u),d=function(t,e,r){return _f(t,s,u,!0)?1:Math.max(e,e*n,r,r*n)},p=function(t,e,r){return _f(t,s,u,!0)?-1:Math.min(e,e*n,r,r*n)},v=d(0,c,h),m=d(af,l,f),g=p(tf,c,h),y=p(tf+af,l,f);r=(v-g)/2,i=(m-y)/2,o=-(v+g)/2,a=-(m+y)/2}return{ratioX:r,ratioY:i,offsetX:o,offsetY:a}}(h.rotation,f,c),p=d.ratioX,v=d.ratioY,m=d.offsetX,g=d.offsetY,y=(i.width-s)/p,b=(i.height-s)/v,w=Math.max(Math.min(y,b)/2,0),_=jh(r.options.radius,w),x=(_-Math.max(_*c,0))/r._getVisibleDatasetWeightTotal();r.offsetX=m*_,r.offsetY=g*_,o.total=r.calculateTotal(),r.outerRadius=_-x*r._getRingWeightOffset(r.index),r.innerRadius=Math.max(r.outerRadius-x*l,0),r.updateElements(a,0,a.length,t)}},{key:"_circumference",value:function(t,e){var n=this,r=n.options,i=n._cachedMeta,o=n._getCircumference();return e&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||null===i._parsed[t]||i.data[t].hidden?0:n.calculateCircumference(i._parsed[t]*o/ef)}},{key:"updateElements",value:function(t,e,n,r){var i,o=this,a="reset"===r,s=o.chart,u=s.chartArea,c=s.options.animation,l=(u.left+u.right)/2,h=(u.top+u.bottom)/2,f=a&&c.animateScale,d=f?0:o.innerRadius,p=f?0:o.outerRadius,v=o.resolveDataElementOptions(e,r),m=o.getSharedOptions(v),g=o.includeOptions(r,m),y=o._getRotation();for(i=0;i<e;++i)y+=o._circumference(i,a);for(i=e;i<e+n;++i){var b=o._circumference(i,a),w=t[i],_={x:l+o.offsetX,y:h+o.offsetY,startAngle:y,endAngle:y+b,circumference:b,outerRadius:p,innerRadius:d};g&&(_.options=m||o.resolveDataElementOptions(i,w.active?"active":r)),y+=b,o.updateElement(w,i,_,r)}o.updateSharedOptions(m,r,v)}},{key:"calculateTotal",value:function(){var t,e=this._cachedMeta,n=e.data,r=0;for(t=0;t<n.length;t++){var i=e._parsed[t];null===i||isNaN(i)||!this.chart.getDataVisibility(t)||n[t].hidden||(r+=Math.abs(i))}return r}},{key:"calculateCircumference",value:function(t){var e=this._cachedMeta.total;return e>0&&!isNaN(t)?ef*(Math.abs(t)/e):0}},{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=Cp(e._parsed[t],n.options.locale);return{label:r[t]||"",value:i}}},{key:"getMaxBorderWidth",value:function(t){var e,n,r,i,o,a=0,s=this.chart;if(!t)for(e=0,n=s.data.datasets.length;e<n;++e)if(s.isDatasetVisible(e)){t=(r=s.getDatasetMeta(e)).data,(i=r.controller)!==this&&i.configure();break}if(!t)return 0;for(e=0,n=t.length;e<n;++e)"inner"!==(o=i.resolveDataElementOptions(e)).borderAlign&&(a=Math.max(a,o.borderWidth||0,o.hoverBorderWidth||0));return a}},{key:"getMaxOffset",value:function(t){for(var e=0,n=0,r=t.length;n<r;++n){var i=this.resolveDataElementOptions(n);e=Math.max(e,i.offset||0,i.hoverOffset||0)}return e}},{key:"_getRingWeightOffset",value:function(t){for(var e=0,n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(e+=this._getRingWeight(n));return e}},{key:"_getRingWeight",value:function(t){return Math.max(Bh(this.chart.data.datasets[t].weight,1),0)}},{key:"_getVisibleDatasetWeightTotal",value:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}]),n}(yv);Tv.id="doughnut",Tv.defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"},Tv.descriptors={_scriptable:function(t){return"spacing"!==t},_indexable:function(t){return"spacing"!==t}},Tv.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels:function(t){var e=t.data;if(e.labels.length&&e.datasets.length){var n=t.legend.options.labels.pointStyle;return e.labels.map((function(e,r){var i=t.getDatasetMeta(0).controller.getStyle(r);return{text:e,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,lineWidth:i.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(r),index:r}}))}return[]}},onClick:function(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}},tooltip:{callbacks:{title:function(){return""},label:function(t){var e=t.label,n=": "+t.formattedValue;return Nh(e)?(e=e.slice())[0]+=n:e+=n,e}}}}};var Av=function(t){jp(n,t);var e=qp(n);function n(){return Xp(this,n),e.apply(this,arguments)}return tv(n,[{key:"initialize",value:function(){this.enableOptionSharing=!0,Bp(Up(n.prototype),"initialize",this).call(this)}},{key:"update",value:function(t){var e=this,n=e._cachedMeta,r=n.dataset,i=n.data,o=void 0===i?[]:i,a=n._dataset,s=e.chart._animationsDisabled,u=function(t,e,n){var r=e.length,i=0,o=r;if(t._sorted){var a=t.iScale,s=t._parsed,u=a.axis,c=a.getUserBounds(),l=c.min,h=c.max,f=c.minDefined,d=c.maxDefined;f&&(i=xf(Math.min(zd(s,a.axis,l).lo,n?r:zd(e,u,a.getPixelForValue(l)).lo),0,r-1)),o=d?xf(Math.max(zd(s,a.axis,h).hi+1,n?0:zd(e,u,a.getPixelForValue(h)).hi+1),i,r)-i:r-i}return{start:i,count:o}}(n,o,s),c=u.start,l=u.count;e._drawStart=c,e._drawCount=l,function(t){var e=t.xScale,n=t.yScale,r=t._scaleRanges,i={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!r)return t._scaleRanges=i,!0;var o=r.xmin!==e.min||r.xmax!==e.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),o}(n)&&(c=0,l=o.length),r._datasetIndex=e.index,r._decimated=!!a._decimated,r.points=o;var h=e.resolveDatasetElementOptions(t);e.options.showLine||(h.borderWidth=0),h.segment=e.options.segment,e.updateElement(r,void 0,{animated:!s,options:h},t),e.updateElements(o,c,l,t)}},{key:"updateElements",value:function(t,e,n,r){for(var i=this,o="reset"===r,a=i._cachedMeta,s=a.iScale,u=a.vScale,c=a._stacked,l=i.resolveDataElementOptions(e,r),h=i.getSharedOptions(l),f=i.includeOptions(r,h),d=s.axis,p=u.axis,v=i.options.spanGaps,m=ff(v)?v:Number.POSITIVE_INFINITY,g=i.chart._animationsDisabled||o||"none"===r,y=e>0&&i.getParsed(e-1),b=e;b<e+n;++b){var w=t[b],_=i.getParsed(b),x=g?w:{},k=Lh(_[p]),S=x[d]=s.getPixelForValue(_[d],b),C=x[p]=o||k?u.getBasePixel():u.getPixelForValue(c?i.applyStack(u,_,c):_[p],b);x.skip=isNaN(S)||isNaN(C)||k,x.stop=b>0&&_[d]-y[d]>m,x.parsed=_,f&&(x.options=h||i.resolveDataElementOptions(b,w.active?"active":r)),g||i.updateElement(w,b,x,r),y=_}i.updateSharedOptions(h,r,l)}},{key:"getMaxOverflow",value:function(){var t=this,e=t._cachedMeta,n=e.dataset,r=n.options&&n.options.borderWidth||0,i=e.data||[];if(!i.length)return r;var o=i[0].size(t.resolveDataElementOptions(0)),a=i[i.length-1].size(t.resolveDataElementOptions(i.length-1));return Math.max(r,o,a)/2}},{key:"draw",value:function(){var t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),Bp(Up(n.prototype),"draw",this).call(this)}}]),n}(yv);Av.id="line",Av.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},Av.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};var Ov=function(t){jp(n,t);var e=qp(n);function n(t,r){var i;return Xp(this,n),(i=e.call(this,t,r)).innerRadius=void 0,i.outerRadius=void 0,i}return tv(n,[{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=Cp(e._parsed[t].r,n.options.locale);return{label:r[t]||"",value:i}}},{key:"update",value:function(t){var e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}},{key:"_updateRadius",value:function(){var t=this,e=t.chart,n=e.chartArea,r=e.options,i=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(i/2,0),a=(o-Math.max(r.cutoutPercentage?o/100*r.cutoutPercentage:1,0))/e.getVisibleDatasetCount();t.outerRadius=o-a*t.index,t.innerRadius=t.outerRadius-a}},{key:"updateElements",value:function(t,e,n,r){var i,o=this,a="reset"===r,s=o.chart,u=o.getDataset(),c=s.options.animation,l=o._cachedMeta.rScale,h=l.xCenter,f=l.yCenter,d=l.getIndexAngle(0)-.5*tf,p=d,v=360/o.countVisibleElements();for(i=0;i<e;++i)p+=o._computeAngle(i,r,v);for(i=e;i<e+n;i++){var m=t[i],g=p,y=p+o._computeAngle(i,r,v),b=s.getDataVisibility(i)?l.getDistanceFromCenterForValue(u.data[i]):0;p=y,a&&(c.animateScale&&(b=0),c.animateRotate&&(g=y=d));var w={x:h,y:f,innerRadius:0,outerRadius:b,startAngle:g,endAngle:y,options:o.resolveDataElementOptions(i,m.active?"active":r)};o.updateElement(m,i,w,r)}}},{key:"countVisibleElements",value:function(){var t=this,e=this.getDataset(),n=this._cachedMeta,r=0;return n.data.forEach((function(n,i){!isNaN(e.data[i])&&t.chart.getDataVisibility(i)&&r++})),r}},{key:"_computeAngle",value:function(t,e,n){return this.chart.getDataVisibility(t)?vf(this.resolveDataElementOptions(t,e).angle||n):0}}]),n}(yv);Ov.id="polarArea",Ov.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},Ov.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels:function(t){var e=t.data;if(e.labels.length&&e.datasets.length){var n=t.legend.options.labels.pointStyle;return e.labels.map((function(e,r){var i=t.getDatasetMeta(0).controller.getStyle(r);return{text:e,fillStyle:i.backgroundColor,strokeStyle:i.borderColor,lineWidth:i.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(r),index:r}}))}return[]}},onClick:function(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}},tooltip:{callbacks:{title:function(){return""},label:function(t){return t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};var Dv=function(t){jp(n,t);var e=qp(n);function n(){return Xp(this,n),e.apply(this,arguments)}return n}(Tv);Dv.id="pie",Dv.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};var Pv=function(t){jp(n,t);var e=qp(n);function n(){return Xp(this,n),e.apply(this,arguments)}return tv(n,[{key:"getLabelAndValue",value:function(t){var e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}},{key:"update",value:function(t){var e=this,n=e._cachedMeta,r=n.dataset,i=n.data||[],o=n.iScale.getLabels();if(r.points=i,"resize"!==t){var a=e.resolveDatasetElementOptions(t);e.options.showLine||(a.borderWidth=0);var s={_loop:!0,_fullLoop:o.length===i.length,options:a};e.updateElement(r,void 0,s,t)}e.updateElements(i,0,i.length,t)}},{key:"updateElements",value:function(t,e,n,r){for(var i=this,o=i.getDataset(),a=i._cachedMeta.rScale,s="reset"===r,u=e;u<e+n;u++){var c=t[u],l=i.resolveDataElementOptions(u,c.active?"active":r),h=a.getPointPositionForValue(u,o.data[u]),f=s?a.xCenter:h.x,d=s?a.yCenter:h.y,p={x:f,y:d,angle:h.angle,skip:isNaN(f)||isNaN(d),options:l};i.updateElement(c,u,p,r)}}}]),n}(yv);Pv.id="radar",Pv.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},Pv.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};var Lv=function(t){jp(n,t);var e=qp(n);function n(){return Xp(this,n),e.apply(this,arguments)}return n}(Av);Lv.id="scatter",Lv.defaults={showLine:!1,fill:!1},Lv.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title:function(){return""},label:function(t){return"("+t.label+", "+t.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var Nv=Object.freeze({__proto__:null,BarController:Mv,BubbleController:Ev,DoughnutController:Tv,LineController:Av,PolarAreaController:Ov,PieController:Dv,RadarController:Pv,ScatterController:Lv});function Rv(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var Iv=function(){function t(e){Xp(this,t),this.options=e||{}}return tv(t,[{key:"formats",value:function(){return Rv()}},{key:"parse",value:function(t,e){return Rv()}},{key:"format",value:function(t,e){return Rv()}},{key:"add",value:function(t,e,n){return Rv()}},{key:"diff",value:function(t,e,n){return Rv()}},{key:"startOf",value:function(t,e,n){return Rv()}},{key:"endOf",value:function(t,e){return Rv()}}]),t}();Iv.override=function(t){Object.assign(Iv.prototype,t)};var zv={_date:Iv};function Bv(t,e){return"native"in t?{x:t.x,y:t.y}:vp(t,e)}function jv(t,e,n,r){var i=t.controller,o=t.data,a=t._sorted,s=i._cachedMeta.iScale;if(s&&e===s.axis&&a&&o.length){var u=s._reversePixels?Bd:zd;if(!r)return u(o,e,n);if(i._sharedOptions){var c=o[0],l="function"===typeof c.getRange&&c.getRange(e);if(l){var h=u(o,e,n-l),f=u(o,e,n+l);return{lo:h.lo,hi:f.hi}}}}return{lo:0,hi:o.length-1}}function Fv(t,e,n,r,i){for(var o=t.getSortedVisibleDatasetMetas(),a=n[e],s=0,u=o.length;s<u;++s)for(var c=o[s],l=c.index,h=c.data,f=jv(o[s],e,a,i),d=f.lo,p=f.hi,v=d;v<=p;++v){var m=h[v];m.skip||r(m,l,v)}}function qv(t,e,n,r){var i=[];if(!yd(e,t.chartArea,t._minPadding))return i;return Fv(t,n,e,(function(t,n,o){t.inRange(e.x,e.y,r)&&i.push({element:t,datasetIndex:n,index:o})}),!0),i}function $v(t,e,n,r,i){var o=function(t){var e=-1!==t.indexOf("x"),n=-1!==t.indexOf("y");return function(t,r){var i=e?Math.abs(t.x-r.x):0,o=n?Math.abs(t.y-r.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(o,2))}}(n),a=Number.POSITIVE_INFINITY,s=[];if(!yd(e,t.chartArea,t._minPadding))return s;return Fv(t,n,e,(function(n,u,c){if(!r||n.inRange(e.x,e.y,i)){var l=n.getCenterPoint(i);if(yd(l,t.chartArea,t._minPadding)||n.inRange(e.x,e.y,i)){var h=o(e,l);h<a?(s=[{element:n,datasetIndex:u,index:c}],a=h):h===a&&s.push({element:n,datasetIndex:u,index:c})}}})),s}function Vv(t,e,n,r){var i=Bv(e,t),o=[],a=n.axis,s="x"===a?"inXRange":"inYRange",u=!1;return function(t,e){for(var n,r,i,o=t.getSortedVisibleDatasetMetas(),a=0,s=o.length;a<s;++a){var u=o[a];n=u.index;for(var c=0,l=(r=u.data).length;c<l;++c)(i=r[c]).skip||e(i,n,c)}}(t,(function(t,e,n){t[s](i[a],r)&&o.push({element:t,datasetIndex:e,index:n}),t.inRange(i.x,i.y,r)&&(u=!0)})),n.intersect&&!u?[]:o}var Uv={modes:{index:function(t,e,n,r){var i=Bv(e,t),o=n.axis||"x",a=n.intersect?qv(t,i,o,r):$v(t,i,o,!1,r),s=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach((function(t){var e=a[0].index,n=t.data[e];n&&!n.skip&&s.push({element:n,datasetIndex:t.index,index:e})})),s):[]},dataset:function(t,e,n,r){var i=Bv(e,t),o=n.axis||"xy",a=n.intersect?qv(t,i,o,r):$v(t,i,o,!1,r);if(a.length>0){var s=a[0].datasetIndex,u=t.getDatasetMeta(s).data;a=[];for(var c=0;c<u.length;++c)a.push({element:u[c],datasetIndex:s,index:c})}return a},point:function(t,e,n,r){return qv(t,Bv(e,t),n.axis||"xy",r)},nearest:function(t,e,n,r){return $v(t,Bv(e,t),n.axis||"xy",n.intersect,r)},x:function(t,e,n,r){return n.axis="x",Vv(t,e,n,r)},y:function(t,e,n,r){return n.axis="y",Vv(t,e,n,r)}}},Hv=["left","top","right","bottom"];function Wv(t,e){return t.filter((function(t){return t.pos===e}))}function Zv(t,e){return t.filter((function(t){return-1===Hv.indexOf(t.pos)&&t.box.axis===e}))}function Jv(t,e){return t.sort((function(t,n){var r=e?n:t,i=e?t:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight}))}function Yv(t,e){var n,r,i,o=function(t){var e,n={},r=Zp(t);try{for(r.s();!(e=r.n()).done;){var i=e.value,o=i.stack,a=i.pos,s=i.stackWeight;if(o&&Hv.includes(a)){var u=n[o]||(n[o]={count:0,placed:0,weight:0,size:0});u.count++,u.weight+=s}}}catch(M_){r.e(M_)}finally{r.f()}return n}(t),a=e.vBoxMaxWidth,s=e.hBoxMaxHeight;for(n=0,r=t.length;n<r;++n){var u=(i=t[n]).box.fullSize,c=o[i.stack],l=c&&i.stackWeight/c.weight;i.horizontal?(i.width=l?l*a:u&&e.availableWidth,i.height=s):(i.width=a,i.height=l?l*s:u&&e.availableHeight)}return o}function Kv(t,e,n,r){return Math.max(t[n],e[n])+Math.max(t[r],e[r])}function Gv(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Xv(t,e,n,r){var i=n.pos,o=n.box,a=t.maxPadding;if(!Rh(i)){n.size&&(t[i]-=n.size);var s=r[n.stack]||{size:0,count:1};s.size=Math.max(s.size,n.horizontal?o.height:o.width),n.size=s.size/s.count,t[i]+=n.size}o.getPadding&&Gv(a,o.getPadding());var u=Math.max(0,e.outerWidth-Kv(a,t,"left","right")),c=Math.max(0,e.outerHeight-Kv(a,t,"top","bottom")),l=u!==t.w,h=c!==t.h;return t.w=u,t.h=c,n.horizontal?{same:l,other:h}:{same:h,other:l}}function Qv(t,e){var n=e.maxPadding;function r(t){var r={left:0,top:0,right:0,bottom:0};return t.forEach((function(t){r[t]=Math.max(e[t],n[t])})),r}return r(t?["left","right"]:["top","bottom"])}function tm(t,e,n,r){var i,o,a,s,u,c,l=[];for(i=0,o=t.length,u=0;i<o;++i){(s=(a=t[i]).box).update(a.width||e.w,a.height||e.h,Qv(a.horizontal,e));var h=Xv(e,n,a,r),f=h.same,d=h.other;u|=f&&l.length,c=c||d,s.fullSize||l.push(a)}return u&&tm(l,e,n,r)||c}function em(t,e,n,r,i){t.top=n,t.left=e,t.right=e+r,t.bottom=n+i,t.width=r,t.height=i}function nm(t,e,n,r){var i,o=n.padding,a=e.x,s=e.y,u=Zp(t);try{for(u.s();!(i=u.n()).done;){var c=i.value,l=c.box,h=r[c.stack]||{count:1,placed:0,weight:1},f=c.stackWeight/h.weight||1;if(c.horizontal){var d=e.w*f,p=h.size||l.height;Xh(h.start)&&(s=h.start),l.fullSize?em(l,o.left,s,n.outerWidth-o.right-o.left,p):em(l,e.left+h.placed,s,d,p),h.start=s,h.placed+=d,s=l.bottom}else{var v=e.h*f,m=h.size||l.width;Xh(h.start)&&(a=h.start),l.fullSize?em(l,a,o.top,m,n.outerHeight-o.bottom-o.top):em(l,a,e.top+h.placed,m,v),h.start=a,h.placed+=v,a=l.right}}}catch(M_){u.e(M_)}finally{u.f()}e.x=a,e.y=s}fd.set("layout",{padding:{top:0,right:0,bottom:0,left:0}});var rm=function(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw:function(t){e.draw(t)}}]},t.boxes.push(e)},im=function(t,e){var n=t.boxes?t.boxes.indexOf(e):-1;-1!==n&&t.boxes.splice(n,1)},om=function(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},am=function(t,e,n,r){if(t){var i=Ld(t.options.layout.padding),o=Math.max(e-i.width,0),a=Math.max(n-i.height,0),s=function(t){var e=function(t){var e,n,r,i,o,a,s=[];for(e=0,n=(t||[]).length;e<n;++e){var u=r=t[e];i=u.position;var c=u.options;o=c.stack;var l=c.stackWeight;a=void 0===l?1:l,s.push({index:e,box:r,pos:i,horizontal:r.isHorizontal(),weight:r.weight,stack:o&&i+o,stackWeight:a})}return s}(t),n=Jv(e.filter((function(t){return t.box.fullSize})),!0),r=Jv(Wv(e,"left"),!0),i=Jv(Wv(e,"right")),o=Jv(Wv(e,"top"),!0),a=Jv(Wv(e,"bottom")),s=Zv(e,"x"),u=Zv(e,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(u).concat(a).concat(s),chartArea:Wv(e,"chartArea"),vertical:r.concat(i).concat(u),horizontal:o.concat(a).concat(s)}}(t.boxes),u=s.vertical,c=s.horizontal;qh(t.boxes,(function(t){"function"===typeof t.beforeLayout&&t.beforeLayout()}));var l=u.reduce((function(t,e){return e.box.options&&!1===e.box.options.display?t:t+1}),0)||1,h=Object.freeze({outerWidth:e,outerHeight:n,padding:i,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/l,hBoxMaxHeight:a/2}),f=Object.assign({},i);Gv(f,Ld(r));var d=Object.assign({maxPadding:f,w:o,h:a,x:i.left,y:i.top},i),p=Yv(u.concat(c),h);tm(s.fullSize,d,h,p),tm(u,d,h,p),tm(c,d,h,p)&&tm(u,d,h,p),function(t){var e=t.maxPadding;function n(n){var r=Math.max(e[n]-t[n],0);return t[n]+=r,r}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}(d),nm(s.leftAndTop,d,h,p),d.x+=d.w,d.y+=d.h,nm(s.rightAndBottom,d,h,p),t.chartArea={left:d.left,top:d.top,right:d.left+d.w,bottom:d.top+d.h,height:d.h,width:d.w},qh(s.chartArea,(function(e){var n=e.box;Object.assign(n,t.chartArea),n.update(d.w,d.h)}))}},sm=function(){function t(){Xp(this,t)}return tv(t,[{key:"acquireContext",value:function(t,e){}},{key:"releaseContext",value:function(t){return!1}},{key:"addEventListener",value:function(t,e,n){}},{key:"removeEventListener",value:function(t,e,n){}},{key:"getDevicePixelRatio",value:function(){return 1}},{key:"getMaximumSize",value:function(t,e,n,r){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):n)}}},{key:"isAttached",value:function(t){return!0}}]),t}(),um=function(t){jp(n,t);var e=qp(n);function n(){return Xp(this,n),e.apply(this,arguments)}return tv(n,[{key:"acquireContext",value:function(t){return t&&t.getContext&&t.getContext("2d")||null}}]),n}(sm),cm={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},lm=function(t){return null===t||""===t};var hm=!!bp&&{passive:!0};function fm(t,e,n){t.canvas.removeEventListener(e,n,hm)}function dm(t,e,n){var r=t.canvas,i=r&&lp(r)||r,o=new MutationObserver((function(t){var e=lp(i);t.forEach((function(t){for(var r=0;r<t.addedNodes.length;r++){var o=t.addedNodes[r];o!==i&&o!==e||n(t.target)}}))}));return o.observe(document,{childList:!0,subtree:!0}),o}function pm(t,e,n){var r=t.canvas,i=r&&lp(r);if(i){var o=new MutationObserver((function(t){t.forEach((function(t){for(var e=0;e<t.removedNodes.length;e++)if(t.removedNodes[e]===r){n();break}}))}));return o.observe(i,{childList:!0}),o}}var vm=new Map,mm=0;function gm(){var t=window.devicePixelRatio;t!==mm&&(mm=t,vm.forEach((function(e,n){n.currentDevicePixelRatio!==t&&e()})))}function ym(t,e,n){var r=t.canvas,i=r&&lp(r);if(i){var o=Eh((function(t,e){var r=i.clientWidth;n(t,e),r<i.clientWidth&&n()}),window),a=new ResizeObserver((function(t){var e=t[0],n=e.contentRect.width,r=e.contentRect.height;0===n&&0===r||o(n,r)}));return a.observe(i),function(t,e){vm.size||window.addEventListener("resize",gm),vm.set(t,e)}(t,o),a}}function bm(t,e,n){n&&n.disconnect(),"resize"===e&&function(t){vm.delete(t),vm.size||window.removeEventListener("resize",gm)}(t)}function wm(t,e,n){var r=t.canvas,i=Eh((function(e){null!==t.ctx&&n(function(t,e){var n=cm[t.type]||t.type,r=vp(t,e),i=r.x,o=r.y;return{type:n,chart:e,native:t,x:void 0!==i?i:null,y:void 0!==o?o:null}}(e,t))}),t,(function(t){var e=t[0];return[e,e.offsetX,e.offsetY]}));return function(t,e,n){t.addEventListener(e,n,hm)}(r,e,i),i}var _m=function(t){jp(n,t);var e=qp(n);function n(){return Xp(this,n),e.apply(this,arguments)}return tv(n,[{key:"acquireContext",value:function(t,e){var n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(function(t,e){var n=t.style,r=t.getAttribute("height"),i=t.getAttribute("width");if(t.$chartjs={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",lm(i)){var o=wp(t,"width");void 0!==o&&(t.width=o)}if(lm(r))if(""===t.style.height)t.height=t.width/(e||2);else{var a=wp(t,"height");void 0!==a&&(t.height=a)}}(t,e),n):null}},{key:"releaseContext",value:function(t){var e=t.canvas;if(!e.$chartjs)return!1;var n=e.$chartjs.initial;["height","width"].forEach((function(t){var r=n[t];Lh(r)?e.removeAttribute(t):e.setAttribute(t,r)}));var r=n.style||{};return Object.keys(r).forEach((function(t){e.style[t]=r[t]})),e.width=e.width,delete e.$chartjs,!0}},{key:"addEventListener",value:function(t,e,n){this.removeEventListener(t,e);var r=t.$proxies||(t.$proxies={}),i={attach:dm,detach:pm,resize:ym}[e]||wm;r[e]=i(t,e,n)}},{key:"removeEventListener",value:function(t,e){var n=t.$proxies||(t.$proxies={}),r=n[e];r&&(({attach:bm,detach:bm,resize:bm}[e]||fm)(t,e,r),n[e]=void 0)}},{key:"getDevicePixelRatio",value:function(){return window.devicePixelRatio}},{key:"getMaximumSize",value:function(t,e,n,r){return gp(t,e,n,r)}},{key:"isAttached",value:function(t){var e=lp(t);return!(!e||!e.isConnected)}}]),n}(sm);var xm=function(){function t(){Xp(this,t),this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}return tv(t,[{key:"tooltipPosition",value:function(t){var e=this.getProps(["x","y"],t);return{x:e.x,y:e.y}}},{key:"hasValue",value:function(){return ff(this.x)&&ff(this.y)}},{key:"getProps",value:function(t,e){var n=this,r=this.$animations;if(!e||!r)return n;var i={};return t.forEach((function(t){i[t]=r[t]&&r[t].active()?r[t]._to:n[t]})),i}}]),t}();xm.defaults={},xm.defaultRoutes=void 0;var km={values:function(t){return Nh(t)?t:""+t},numeric:function(t,e,n){if(0===t)return"0";var r,i=this.chart.options.locale,o=t;if(n.length>1){var a=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(a<1e-4||a>1e15)&&(r="scientific"),o=function(t,e){var n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t));return n}(t,n)}var s=cf(Math.abs(o)),u=Math.max(Math.min(-1*Math.floor(s),20),0),c={notation:r,minimumFractionDigits:u,maximumFractionDigits:u};return Object.assign(c,this.options.ticks.format),Cp(t,i,c)},logarithmic:function(t,e,n){if(0===t)return"0";var r=t/Math.pow(10,Math.floor(cf(t)));return 1===r||2===r||5===r?km.numeric.call(this,t,e,n):""}};var Sm={formatters:km};function Cm(t,e){var n=t.options.ticks,r=n.maxTicksLimit||function(t){var e=t.options.offset,n=t._tickSize(),r=t._length/n+(e?0:1),i=t._maxLength/n;return Math.floor(Math.min(r,i))}(t),i=n.major.enabled?function(t){var e,n,r=[];for(e=0,n=t.length;e<n;e++)t[e].major&&r.push(e);return r}(e):[],o=i.length,a=i[0],s=i[o-1],u=[];if(o>r)return function(t,e,n,r){var i,o=0,a=n[0];for(r=Math.ceil(r),i=0;i<t.length;i++)i===a&&(e.push(t[i]),a=n[++o*r])}(e,u,i,o/r),u;var c=function(t,e,n){var r=function(t){var e,n,r=t.length;if(r<2)return!1;for(n=t[0],e=1;e<r;++e)if(t[e]-t[e-1]!==n)return!1;return n}(t),i=e.length/n;if(!r)return Math.max(i,1);for(var o=function(t){var e,n=[],r=Math.sqrt(t);for(e=1;e<r;e++)t%e===0&&(n.push(e),n.push(t/e));return r===(0|r)&&n.push(r),n.sort((function(t,e){return t-e})).pop(),n}(r),a=0,s=o.length-1;a<s;a++){var u=o[a];if(u>i)return u}return Math.max(i,1)}(i,e,r);if(o>0){var l,h,f=o>1?Math.round((s-a)/(o-1)):null;for(Mm(e,u,c,Lh(f)?0:a-f,a),l=0,h=o-1;l<h;l++)Mm(e,u,c,i[l],i[l+1]);return Mm(e,u,c,s,Lh(f)?e.length:s+f),u}return Mm(e,u,c),u}function Mm(t,e,n,r,i){var o,a,s,u=Bh(r,0),c=Math.min(Bh(i,t.length),t.length),l=0;for(n=Math.ceil(n),i&&(n=(o=i-r)/Math.floor(o/n)),s=u;s<0;)l++,s=Math.round(u+l*n);for(a=Math.max(u,0);a<c;a++)a===s&&(e.push(t[a]),l++,s=Math.round(u+l*n))}fd.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:function(t,e){return e.lineWidth},tickColor:function(t,e){return e.color},offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Sm.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),fd.route("scale.ticks","color","","color"),fd.route("scale.grid","color","","borderColor"),fd.route("scale.grid","borderColor","","borderColor"),fd.route("scale.title","color","","color"),fd.describe("scale",{_fallback:!1,_scriptable:function(t){return!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t},_indexable:function(t){return"borderDash"!==t&&"tickBorderDash"!==t}}),fd.describe("scales",{_fallback:"scale"}),fd.describe("scale.ticks",{_scriptable:function(t){return"backdropPadding"!==t&&"callback"!==t},_indexable:function(t){return"backdropPadding"!==t}});var Em=function(t,e,n){return"top"===e||"left"===e?t[e]+n:t[e]-n};function Tm(t,e){for(var n=[],r=t.length/e,i=t.length,o=0;o<i;o+=r)n.push(t[Math.floor(o)]);return n}function Am(t,e,n){var r,i=t.ticks.length,o=Math.min(e,i-1),a=t._startPixel,s=t._endPixel,u=1e-6,c=t.getPixelForTick(o);if(!(n&&(r=1===i?Math.max(c-a,s-c):0===e?(t.getPixelForTick(1)-c)/2:(c-t.getPixelForTick(o-1))/2,(c+=o<e?r:-r)<a-u||c>s+u)))return c}function Om(t){return t.drawTicks?t.tickLength:0}function Dm(t,e){if(!t.display)return 0;var n=Nd(t.font,e),r=Ld(t.padding);return(Nh(t.text)?t.text.length:1)*n.lineHeight+r.height}function Pm(t,e,n){var r=Th(t);return(n&&"right"!==e||!n&&"right"===e)&&(r=function(t){return"left"===t?"right":"right"===t?"left":t}(r)),r}var Lm=function(t){jp(n,t);var e=qp(n);function n(t){var r;return Xp(this,n),(r=e.call(this)).id=t.id,r.type=t.type,r.options=void 0,r.ctx=t.ctx,r.chart=t.chart,r.top=void 0,r.bottom=void 0,r.left=void 0,r.right=void 0,r.width=void 0,r.height=void 0,r._margins={left:0,right:0,top:0,bottom:0},r.maxWidth=void 0,r.maxHeight=void 0,r.paddingTop=void 0,r.paddingBottom=void 0,r.paddingLeft=void 0,r.paddingRight=void 0,r.axis=void 0,r.labelRotation=void 0,r.min=void 0,r.max=void 0,r._range=void 0,r.ticks=[],r._gridLineItems=null,r._labelItems=null,r._labelSizes=null,r._length=0,r._maxLength=0,r._longestTextCache={},r._startPixel=void 0,r._endPixel=void 0,r._reversePixels=!1,r._userMax=void 0,r._userMin=void 0,r._suggestedMax=void 0,r._suggestedMin=void 0,r._ticksLength=0,r._borderValue=0,r._cache={},r._dataLimitsCached=!1,r.$context=void 0,r}return tv(n,[{key:"init",value:function(t){var e=this;e.options=t.setContext(e.getContext()),e.axis=t.axis,e._userMin=e.parse(t.min),e._userMax=e.parse(t.max),e._suggestedMin=e.parse(t.suggestedMin),e._suggestedMax=e.parse(t.suggestedMax)}},{key:"parse",value:function(t,e){return t}},{key:"getUserBounds",value:function(){var t=this._userMin,e=this._userMax,n=this._suggestedMin,r=this._suggestedMax;return t=zh(t,Number.POSITIVE_INFINITY),e=zh(e,Number.NEGATIVE_INFINITY),n=zh(n,Number.POSITIVE_INFINITY),r=zh(r,Number.NEGATIVE_INFINITY),{min:zh(t,n),max:zh(e,r),minDefined:Ih(t),maxDefined:Ih(e)}}},{key:"getMinMax",value:function(t){var e,n=this,r=n.getUserBounds(),i=r.min,o=r.max,a=r.minDefined,s=r.maxDefined;if(a&&s)return{min:i,max:o};for(var u=n.getMatchingVisibleMetas(),c=0,l=u.length;c<l;++c)e=u[c].controller.getMinMax(n,t),a||(i=Math.min(i,e.min)),s||(o=Math.max(o,e.max));return{min:zh(i,zh(o,i)),max:zh(o,zh(i,o))}}},{key:"getPadding",value:function(){var t=this;return{left:t.paddingLeft||0,top:t.paddingTop||0,right:t.paddingRight||0,bottom:t.paddingBottom||0}}},{key:"getTicks",value:function(){return this.ticks}},{key:"getLabels",value:function(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}},{key:"beforeLayout",value:function(){this._cache={},this._dataLimitsCached=!1}},{key:"beforeUpdate",value:function(){Fh(this.options.beforeUpdate,[this])}},{key:"update",value:function(t,e,n){var r,i,o,a,s=this,u=s.options.ticks,c=u.sampleSize;s.beforeUpdate(),s.maxWidth=t,s.maxHeight=e,s._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),s.ticks=null,s._labelSizes=null,s._gridLineItems=null,s._labelItems=null,s.beforeSetDimensions(),s.setDimensions(),s.afterSetDimensions(),s._maxLength=s.isHorizontal()?s.width+n.left+n.right:s.height+n.top+n.bottom,s._dataLimitsCached||(s.beforeDataLimits(),s.determineDataLimits(),s.afterDataLimits(),s._range=(r=s,i=s.options.grace,o=r.min,a=r.max,{min:o-Math.abs(jh(i,o)),max:a+jh(i,a)}),s._dataLimitsCached=!0),s.beforeBuildTicks(),s.ticks=s.buildTicks()||[],s.afterBuildTicks();var l=c<s.ticks.length;s._convertTicksToLabels(l?Tm(s.ticks,c):s.ticks),s.configure(),s.beforeCalculateLabelRotation(),s.calculateLabelRotation(),s.afterCalculateLabelRotation(),u.display&&(u.autoSkip||"auto"===u.source)&&(s.ticks=Cm(s,s.ticks),s._labelSizes=null),l&&s._convertTicksToLabels(s.ticks),s.beforeFit(),s.fit(),s.afterFit(),s.afterUpdate()}},{key:"configure",value:function(){var t,e,n=this,r=n.options.reverse;n.isHorizontal()?(t=n.left,e=n.right):(t=n.top,e=n.bottom,r=!r),n._startPixel=t,n._endPixel=e,n._reversePixels=r,n._length=e-t,n._alignToPixels=n.options.alignToPixels}},{key:"afterUpdate",value:function(){Fh(this.options.afterUpdate,[this])}},{key:"beforeSetDimensions",value:function(){Fh(this.options.beforeSetDimensions,[this])}},{key:"setDimensions",value:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0}},{key:"afterSetDimensions",value:function(){Fh(this.options.afterSetDimensions,[this])}},{key:"_callHooks",value:function(t){var e=this;e.chart.notifyPlugins(t,e.getContext()),Fh(e.options[t],[e])}},{key:"beforeDataLimits",value:function(){this._callHooks("beforeDataLimits")}},{key:"determineDataLimits",value:function(){}},{key:"afterDataLimits",value:function(){this._callHooks("afterDataLimits")}},{key:"beforeBuildTicks",value:function(){this._callHooks("beforeBuildTicks")}},{key:"buildTicks",value:function(){return[]}},{key:"afterBuildTicks",value:function(){this._callHooks("afterBuildTicks")}},{key:"beforeTickToLabelConversion",value:function(){Fh(this.options.beforeTickToLabelConversion,[this])}},{key:"generateTickLabels",value:function(t){var e,n,r,i=this.options.ticks;for(e=0,n=t.length;e<n;e++)(r=t[e]).label=Fh(i.callback,[r.value,e,t],this)}},{key:"afterTickToLabelConversion",value:function(){Fh(this.options.afterTickToLabelConversion,[this])}},{key:"beforeCalculateLabelRotation",value:function(){Fh(this.options.beforeCalculateLabelRotation,[this])}},{key:"calculateLabelRotation",value:function(){var t,e,n,r=this,i=r.options,o=i.ticks,a=r.ticks.length,s=o.minRotation||0,u=o.maxRotation,c=s;if(!r._isVisible()||!o.display||s>=u||a<=1||!r.isHorizontal())r.labelRotation=s;else{var l=r._getLabelSizes(),h=l.widest.width,f=l.highest.height,d=xf(r.chart.width-h,0,r.maxWidth);h+6>(t=i.offset?r.maxWidth/a:d/(a-1))&&(t=d/(a-(i.offset?.5:1)),e=r.maxHeight-Om(i.grid)-o.padding-Dm(i.title,r.chart.options.font),n=Math.sqrt(h*h+f*f),c=mf(Math.min(Math.asin(xf((l.highest.height+6)/t,-1,1)),Math.asin(xf(e/n,-1,1))-Math.asin(xf(f/n,-1,1)))),c=Math.max(s,Math.min(u,c))),r.labelRotation=c}}},{key:"afterCalculateLabelRotation",value:function(){Fh(this.options.afterCalculateLabelRotation,[this])}},{key:"beforeFit",value:function(){Fh(this.options.beforeFit,[this])}},{key:"fit",value:function(){var t=this,e={width:0,height:0},n=t.chart,r=t.options,i=r.ticks,o=r.title,a=r.grid,s=t._isVisible(),u=t.isHorizontal();if(s){var c=Dm(o,n.options.font);if(u?(e.width=t.maxWidth,e.height=Om(a)+c):(e.height=t.maxHeight,e.width=Om(a)+c),i.display&&t.ticks.length){var l=t._getLabelSizes(),h=l.first,f=l.last,d=l.widest,p=l.highest,v=2*i.padding,m=vf(t.labelRotation),g=Math.cos(m),y=Math.sin(m);if(u){var b=i.mirror?0:y*d.width+g*p.height;e.height=Math.min(t.maxHeight,e.height+b+v)}else{var w=i.mirror?0:g*d.width+y*p.height;e.width=Math.min(t.maxWidth,e.width+w+v)}t._calculatePadding(h,f,y,g)}}t._handleMargins(),u?(t.width=t._length=n.width-t._margins.left-t._margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=n.height-t._margins.top-t._margins.bottom)}},{key:"_calculatePadding",value:function(t,e,n,r){var i=this,o=i.options,a=o.ticks,s=a.align,u=a.padding,c=o.position,l=0!==i.labelRotation,h="top"!==c&&"x"===i.axis;if(i.isHorizontal()){var f=i.getPixelForTick(0)-i.left,d=i.right-i.getPixelForTick(i.ticks.length-1),p=0,v=0;l?h?(p=r*t.width,v=n*e.height):(p=n*t.height,v=r*e.width):"start"===s?v=e.width:"end"===s?p=t.width:(p=t.width/2,v=e.width/2),i.paddingLeft=Math.max((p-f+u)*i.width/(i.width-f),0),i.paddingRight=Math.max((v-d+u)*i.width/(i.width-d),0)}else{var m=e.height/2,g=t.height/2;"start"===s?(m=0,g=t.height):"end"===s&&(m=e.height,g=0),i.paddingTop=m+u,i.paddingBottom=g+u}}},{key:"_handleMargins",value:function(){var t=this;t._margins&&(t._margins.left=Math.max(t.paddingLeft,t._margins.left),t._margins.top=Math.max(t.paddingTop,t._margins.top),t._margins.right=Math.max(t.paddingRight,t._margins.right),t._margins.bottom=Math.max(t.paddingBottom,t._margins.bottom))}},{key:"afterFit",value:function(){Fh(this.options.afterFit,[this])}},{key:"isHorizontal",value:function(){var t=this.options,e=t.axis,n=t.position;return"top"===n||"bottom"===n||"x"===e}},{key:"isFullSize",value:function(){return this.options.fullSize}},{key:"_convertTicksToLabels",value:function(t){var e,n,r=this;for(r.beforeTickToLabelConversion(),r.generateTickLabels(t),e=0,n=t.length;e<n;e++)Lh(t[e].label)&&(t.splice(e,1),n--,e--);r.afterTickToLabelConversion()}},{key:"_getLabelSizes",value:function(){var t=this,e=t._labelSizes;if(!e){var n=t.options.ticks.sampleSize,r=t.ticks;n<r.length&&(r=Tm(r,n)),t._labelSizes=e=t._computeLabelSizes(r,r.length)}return e}},{key:"_computeLabelSizes",value:function(t,e){var n,r,i,o,a,s,u,c,l,h,f,d=this.ctx,p=this._longestTextCache,v=[],m=[],g=0,y=0;for(n=0;n<e;++n){if(o=t[n].label,a=this._resolveTickFontOptions(n),d.font=s=a.string,u=p[s]=p[s]||{data:{},gc:[]},c=a.lineHeight,l=h=0,Lh(o)||Nh(o)){if(Nh(o))for(r=0,i=o.length;r<i;++r)Lh(f=o[r])||Nh(f)||(l=dd(d,u.data,u.gc,l,f),h+=c)}else l=dd(d,u.data,u.gc,l,o),h=c;v.push(l),m.push(h),g=Math.max(l,g),y=Math.max(h,y)}!function(t,e){qh(t,(function(t){var n,r=t.gc,i=r.length/2;if(i>e){for(n=0;n<i;++n)delete t.data[r[n]];r.splice(0,i)}}))}(p,e);var b=v.indexOf(g),w=m.indexOf(y),_=function(t){return{width:v[t]||0,height:m[t]||0}};return{first:_(0),last:_(e-1),widest:_(b),highest:_(w),widths:v,heights:m}}},{key:"getLabelForValue",value:function(t){return t}},{key:"getPixelForValue",value:function(t,e){return NaN}},{key:"getValueForPixel",value:function(t){}},{key:"getPixelForTick",value:function(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}},{key:"getPixelForDecimal",value:function(t){var e=this;e._reversePixels&&(t=1-t);var n=e._startPixel+t*e._length;return xf(e._alignToPixels?vd(e.chart,n,0):n,-32768,32767)}},{key:"getDecimalForPixel",value:function(t){var e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}},{key:"getBasePixel",value:function(){return this.getPixelForValue(this.getBaseValue())}},{key:"getBaseValue",value:function(){var t=this.min,e=this.max;return t<0&&e<0?e:t>0&&e>0?t:0}},{key:"getContext",value:function(t){var e,n,r=this,i=r.ticks||[];if(t>=0&&t<i.length){var o=i[t];return o.$context||(o.$context=function(t,e,n){return Object.assign(Object.create(t),{tick:n,index:e,type:"tick"})}(r.getContext(),t,o))}return r.$context||(r.$context=(e=r.chart.getContext(),n=r,Object.assign(Object.create(e),{scale:n,type:"scale"})))}},{key:"_tickSize",value:function(){var t=this,e=t.options.ticks,n=vf(t.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),o=t._getLabelSizes(),a=e.autoSkipPadding||0,s=o?o.widest.width+a:0,u=o?o.highest.height+a:0;return t.isHorizontal()?u*r>s*i?s/r:u/i:u*i<s*r?u/r:s/i}},{key:"_isVisible",value:function(){var t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}},{key:"_computeGridLineItems",value:function(t){var e,n,r,i,o,a,s,u,c,l,h,f,d=this,p=d.axis,v=d.chart,m=d.options,g=m.grid,y=m.position,b=g.offset,w=d.isHorizontal(),_=d.ticks.length+(b?1:0),x=Om(g),k=[],S=g.setContext(d.getContext()),C=S.drawBorder?S.borderWidth:0,M=C/2,E=function(t){return vd(v,t,C)};if("top"===y)e=E(d.bottom),a=d.bottom-x,u=e-M,l=E(t.top)+M,f=t.bottom;else if("bottom"===y)e=E(d.top),l=t.top,f=E(t.bottom)-M,a=e+M,u=d.top+x;else if("left"===y)e=E(d.right),o=d.right-x,s=e-M,c=E(t.left)+M,h=t.right;else if("right"===y)e=E(d.left),c=t.left,h=E(t.right)-M,o=e+M,s=d.left+x;else if("x"===p){if("center"===y)e=E((t.top+t.bottom)/2+.5);else if(Rh(y)){var T=Object.keys(y)[0],A=y[T];e=E(d.chart.scales[T].getPixelForValue(A))}l=t.top,f=t.bottom,u=(a=e+M)+x}else if("y"===p){if("center"===y)e=E((t.left+t.right)/2);else if(Rh(y)){var O=Object.keys(y)[0],D=y[O];e=E(d.chart.scales[O].getPixelForValue(D))}s=(o=e-M)-x,c=t.left,h=t.right}var P=Bh(m.ticks.maxTicksLimit,_),L=Math.max(1,Math.ceil(_/P));for(n=0;n<_;n+=L){var N=g.setContext(d.getContext(n)),R=N.lineWidth,I=N.color,z=g.borderDash||[],B=N.borderDashOffset,j=N.tickWidth,F=N.tickColor,q=N.tickBorderDash||[],$=N.tickBorderDashOffset;void 0!==(r=Am(d,n,b))&&(i=vd(v,r,R),w?o=s=c=h=i:a=u=l=f=i,k.push({tx1:o,ty1:a,tx2:s,ty2:u,x1:c,y1:l,x2:h,y2:f,width:R,color:I,borderDash:z,borderDashOffset:B,tickWidth:j,tickColor:F,tickBorderDash:q,tickBorderDashOffset:$}))}return d._ticksLength=_,d._borderValue=e,k}},{key:"_computeLabelItems",value:function(t){var e,n,r,i,o,a,s,u,c,l,h,f=this,d=f.axis,p=f.options,v=p.position,m=p.ticks,g=f.isHorizontal(),y=f.ticks,b=m.align,w=m.crossAlign,_=m.padding,x=m.mirror,k=Om(p.grid),S=k+_,C=x?-_:S,M=-vf(f.labelRotation),E=[],T="middle";if("top"===v)o=f.bottom-C,a=f._getXAxisLabelAlignment();else if("bottom"===v)o=f.top+C,a=f._getXAxisLabelAlignment();else if("left"===v){var A=f._getYAxisLabelAlignment(k);a=A.textAlign,i=A.x}else if("right"===v){var O=f._getYAxisLabelAlignment(k);a=O.textAlign,i=O.x}else if("x"===d){if("center"===v)o=(t.top+t.bottom)/2+S;else if(Rh(v)){var D=Object.keys(v)[0],P=v[D];o=f.chart.scales[D].getPixelForValue(P)+S}a=f._getXAxisLabelAlignment()}else if("y"===d){if("center"===v)i=(t.left+t.right)/2-S;else if(Rh(v)){var L=Object.keys(v)[0],N=v[L];i=f.chart.scales[L].getPixelForValue(N)}a=f._getYAxisLabelAlignment(k).textAlign}"y"===d&&("start"===b?T="top":"end"===b&&(T="bottom"));var R=f._getLabelSizes();for(e=0,n=y.length;e<n;++e){r=y[e].label;var I=m.setContext(f.getContext(e));s=f.getPixelForTick(e)+m.labelOffset,c=(u=f._resolveTickFontOptions(e)).lineHeight;var z=(l=Nh(r)?r.length:1)/2,B=I.color,j=I.textStrokeColor,F=I.textStrokeWidth;g?(i=s,h="top"===v?"near"===w||0!==M?-l*c+c/2:"center"===w?-R.highest.height/2-z*c+c:-R.highest.height+c/2:"near"===w||0!==M?c/2:"center"===w?R.highest.height/2-z*c:R.highest.height-l*c,x&&(h*=-1)):(o=s,h=(1-l)*c/2);var q=void 0;if(I.showLabelBackdrop){var $=Ld(I.backdropPadding),V=R.heights[e],U=R.widths[e],H=o+h-$.top,W=i-$.left;switch(T){case"middle":H-=V/2;break;case"bottom":H-=V}switch(a){case"center":W-=U/2;break;case"right":W-=U}q={left:W,top:H,width:U+$.width,height:V+$.height,color:I.backdropColor}}E.push({rotation:M,label:r,font:u,color:B,strokeColor:j,strokeWidth:F,textOffset:h,textAlign:a,textBaseline:T,translation:[i,o],backdrop:q})}return E}},{key:"_getXAxisLabelAlignment",value:function(){var t=this.options,e=t.position,n=t.ticks;if(-vf(this.labelRotation))return"top"===e?"left":"right";var r="center";return"start"===n.align?r="left":"end"===n.align&&(r="right"),r}},{key:"_getYAxisLabelAlignment",value:function(t){var e,n,r=this,i=r.options,o=i.position,a=i.ticks,s=a.crossAlign,u=a.mirror,c=a.padding,l=t+c,h=r._getLabelSizes().widest.width;return"left"===o?u?(n=r.right+c,"near"===s?e="left":"center"===s?(e="center",n+=h/2):(e="right",n+=h)):(n=r.right-l,"near"===s?e="right":"center"===s?(e="center",n-=h/2):(e="left",n=r.left)):"right"===o?u?(n=r.left+c,"near"===s?e="right":"center"===s?(e="center",n-=h/2):(e="left",n-=h)):(n=r.left+l,"near"===s?e="left":"center"===s?(e="center",n+=h/2):(e="right",n=r.right)):e="right",{textAlign:e,x:n}}},{key:"_computeLabelArea",value:function(){var t=this;if(!t.options.ticks.mirror){var e=t.chart,n=t.options.position;return"left"===n||"right"===n?{top:0,left:t.left,bottom:e.height,right:t.right}:"top"===n||"bottom"===n?{top:t.top,left:0,bottom:t.bottom,right:e.width}:void 0}}},{key:"drawBackground",value:function(){var t=this.ctx,e=this.options.backgroundColor,n=this.left,r=this.top,i=this.width,o=this.height;e&&(t.save(),t.fillStyle=e,t.fillRect(n,r,i,o),t.restore())}},{key:"getLineWidthForValue",value:function(t){var e=this,n=e.options.grid;if(!e._isVisible()||!n.display)return 0;var r=e.ticks.findIndex((function(e){return e.value===t}));return r>=0?n.setContext(e.getContext(r)).lineWidth:0}},{key:"drawGrid",value:function(t){var e,n,r=this,i=r.options.grid,o=r.ctx,a=r._gridLineItems||(r._gridLineItems=r._computeGridLineItems(t)),s=function(t,e,n){n.width&&n.color&&(o.save(),o.lineWidth=n.width,o.strokeStyle=n.color,o.setLineDash(n.borderDash||[]),o.lineDashOffset=n.borderDashOffset,o.beginPath(),o.moveTo(t.x,t.y),o.lineTo(e.x,e.y),o.stroke(),o.restore())};if(i.display)for(e=0,n=a.length;e<n;++e){var u=a[e];i.drawOnChartArea&&s({x:u.x1,y:u.y1},{x:u.x2,y:u.y2},u),i.drawTicks&&s({x:u.tx1,y:u.ty1},{x:u.tx2,y:u.ty2},{color:u.tickColor,width:u.tickWidth,borderDash:u.tickBorderDash,borderDashOffset:u.tickBorderDashOffset})}}},{key:"drawBorder",value:function(){var t=this,e=t.chart,n=t.ctx,r=t.options.grid,i=r.setContext(t.getContext()),o=r.drawBorder?i.borderWidth:0;if(o){var a,s,u,c,l=r.setContext(t.getContext(0)).lineWidth,h=t._borderValue;t.isHorizontal()?(a=vd(e,t.left,o)-o/2,s=vd(e,t.right,l)+l/2,u=c=h):(u=vd(e,t.top,o)-o/2,c=vd(e,t.bottom,l)+l/2,a=s=h),n.save(),n.lineWidth=i.borderWidth,n.strokeStyle=i.borderColor,n.beginPath(),n.moveTo(a,u),n.lineTo(s,c),n.stroke(),n.restore()}}},{key:"drawLabels",value:function(t){var e=this;if(e.options.ticks.display){var n=e.ctx,r=e._computeLabelArea();r&&bd(n,r);var i,o,a=e._labelItems||(e._labelItems=e._computeLabelItems(t));for(i=0,o=a.length;i<o;++i){var s=a[i],u=s.font,c=s.label;s.backdrop&&(n.fillStyle=s.backdrop.color,n.fillRect(s.backdrop.left,s.backdrop.top,s.backdrop.width,s.backdrop.height)),kd(n,c,0,s.textOffset,u,s)}r&&wd(n)}}},{key:"drawTitle",value:function(){var t=this.ctx,e=this.options,n=e.position,r=e.title,i=e.reverse;if(r.display){var o=Nd(r.font),a=Ld(r.padding),s=r.align,u=o.lineHeight/2;"bottom"===n||"center"===n||Rh(n)?(u+=a.bottom,Nh(r.text)&&(u+=o.lineHeight*(r.text.length-1))):u+=a.top;var c=function(t,e,n,r){var i,o,a,s=t.top,u=t.left,c=t.bottom,l=t.right,h=t.chart,f=h.chartArea,d=h.scales,p=0,v=c-s,m=l-u;if(t.isHorizontal()){if(o=Ah(r,u,l),Rh(n)){var g=Object.keys(n)[0],y=n[g];a=d[g].getPixelForValue(y)+v-e}else a="center"===n?(f.bottom+f.top)/2+v-e:Em(t,n,e);i=l-u}else{if(Rh(n)){var b=Object.keys(n)[0],w=n[b];o=d[b].getPixelForValue(w)-m+e}else o="center"===n?(f.left+f.right)/2-m+e:Em(t,n,e);a=Ah(r,c,s),p="left"===n?-af:af}return{titleX:o,titleY:a,maxWidth:i,rotation:p}}(this,u,n,s),l=c.titleX,h=c.titleY,f=c.maxWidth,d=c.rotation;kd(t,r.text,0,0,o,{color:r.color,maxWidth:f,rotation:d,textAlign:Pm(s,n,i),textBaseline:"middle",translation:[l,h]})}}},{key:"draw",value:function(t){var e=this;e._isVisible()&&(e.drawBackground(),e.drawGrid(t),e.drawBorder(),e.drawTitle(),e.drawLabels(t))}},{key:"_layers",value:function(){var t=this,e=t.options,r=e.ticks&&e.ticks.z||0,i=Bh(e.grid&&e.grid.z,-1);return t._isVisible()&&t.draw===n.prototype.draw?[{z:i,draw:function(e){t.drawBackground(),t.drawGrid(e),t.drawTitle()}},{z:i+1,draw:function(){t.drawBorder()}},{z:r,draw:function(e){t.drawLabels(e)}}]:[{z:r,draw:function(e){t.draw(e)}}]}},{key:"getMatchingVisibleMetas",value:function(t){var e,n,r=this,i=r.chart.getSortedVisibleDatasetMetas(),o=r.axis+"AxisID",a=[];for(e=0,n=i.length;e<n;++e){var s=i[e];s[o]!==r.id||t&&s.type!==t||a.push(s)}return a}},{key:"_resolveTickFontOptions",value:function(t){return Nd(this.options.ticks.setContext(this.getContext(t)).font)}},{key:"_maxDigits",value:function(){var t=this,e=t._resolveTickFontOptions(0).lineHeight;return(t.isHorizontal()?t.width:t.height)/e}}]),n}(xm),Nm=function(){function t(e,n,r){Xp(this,t),this.type=e,this.scope=n,this.override=r,this.items=Object.create(null)}return tv(t,[{key:"isForType",value:function(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}},{key:"register",value:function(t){var e,n=this,r=Object.getPrototypeOf(t);(function(t){return"id"in t&&"defaults"in t})(r)&&(e=n.register(r));var i=n.items,o=t.id,a=n.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in i||(i[o]=t,function(t,e,n){var r=Wh(Object.create(null),[n?fd.get(n):{},fd.get(e),t.defaults]);fd.set(e,r),t.defaultRoutes&&function(t,e){Object.keys(e).forEach((function(n){var r=n.split("."),i=r.pop(),o=[t].concat(r).join("."),a=e[n].split("."),s=a.pop(),u=a.join(".");fd.route(o,i,u,s)}))}(e,t.defaultRoutes);t.descriptors&&fd.describe(e,t.descriptors)}(t,a,e),n.override&&fd.override(t.id,t.overrides)),a}},{key:"get",value:function(t){return this.items[t]}},{key:"unregister",value:function(t){var e=this.items,n=t.id,r=this.scope;n in e&&delete e[n],r&&n in fd[r]&&(delete fd[r][n],this.override&&delete ud[n])}}]),t}();var Rm=new(function(){function t(){Xp(this,t),this.controllers=new Nm(yv,"datasets",!0),this.elements=new Nm(xm,"elements"),this.plugins=new Nm(Object,"plugins"),this.scales=new Nm(Lm,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}return tv(t,[{key:"add",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this._each("register",e)}},{key:"remove",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this._each("unregister",e)}},{key:"addControllers",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this._each("register",e,this.controllers)}},{key:"addElements",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this._each("register",e,this.elements)}},{key:"addPlugins",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this._each("register",e,this.plugins)}},{key:"addScales",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this._each("register",e,this.scales)}},{key:"getController",value:function(t){return this._get(t,this.controllers,"controller")}},{key:"getElement",value:function(t){return this._get(t,this.elements,"element")}},{key:"getPlugin",value:function(t){return this._get(t,this.plugins,"plugin")}},{key:"getScale",value:function(t){return this._get(t,this.scales,"scale")}},{key:"removeControllers",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this._each("unregister",e,this.controllers)}},{key:"removeElements",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this._each("unregister",e,this.elements)}},{key:"removePlugins",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this._each("unregister",e,this.plugins)}},{key:"removeScales",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this._each("unregister",e,this.scales)}},{key:"_each",value:function(t,e,n){var r=this;Yp(e).forEach((function(e){var i=n||r._getRegistryForType(e);n||i.isForType(e)||i===r.plugins&&e.id?r._exec(t,i,e):qh(e,(function(e){var i=n||r._getRegistryForType(e);r._exec(t,i,e)}))}))}},{key:"_exec",value:function(t,e,n){var r=Gh(t);Fh(n["before"+r],[],n),e[t](n),Fh(n["after"+r],[],n)}},{key:"_getRegistryForType",value:function(t){for(var e=0;e<this._typedRegistries.length;e++){var n=this._typedRegistries[e];if(n.isForType(t))return n}return this.plugins}},{key:"_get",value:function(t,e,n){var r=e.get(t);if(void 0===r)throw new Error('"'+t+'" is not a registered '+n+".");return r}}]),t}()),Im=function(){function t(){Xp(this,t),this._init=[]}return tv(t,[{key:"notify",value:function(t,e,n,r){var i=this;"beforeInit"===e&&(i._init=i._createDescriptors(t,!0),i._notify(i._init,t,"install"));var o=r?i._descriptors(t).filter(r):i._descriptors(t),a=i._notify(o,t,e,n);return"destroy"===e&&(i._notify(o,t,"stop"),i._notify(i._init,t,"uninstall")),a}},{key:"_notify",value:function(t,e,n,r){r=r||{};var i,o=Zp(t);try{for(o.s();!(i=o.n()).done;){var a=i.value,s=a.plugin;if(!1===Fh(s[n],[e,r,a.options],s)&&r.cancelable)return!1}}catch(M_){o.e(M_)}finally{o.f()}return!0}},{key:"invalidate",value:function(){Lh(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}},{key:"_descriptors",value:function(t){if(this._cache)return this._cache;var e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}},{key:"_createDescriptors",value:function(t,e){var n=t&&t.config,r=Bh(n.options&&n.options.plugins,{}),i=function(t){for(var e=[],n=Object.keys(Rm.plugins.items),r=0;r<n.length;r++)e.push(Rm.getPlugin(n[r]));for(var i=t.plugins||[],o=0;o<i.length;o++){var a=i[o];-1===e.indexOf(a)&&e.push(a)}return e}(n);return!1!==r||e?function(t,e,n,r){for(var i=[],o=t.getContext(),a=0;a<e.length;a++){var s=e[a],u=zm(n[s.id],r);null!==u&&i.push({plugin:s,options:Bm(t.config,s,u,o)})}return i}(t,i,r,e):[]}},{key:"_notifyStateChanges",value:function(t){var e=this._oldCache||[],n=this._cache,r=function(t,e){return t.filter((function(t){return!e.some((function(e){return t.plugin.id===e.plugin.id}))}))};this._notify(r(e,n),t,"stop"),this._notify(r(n,e),t,"start")}}]),t}();function zm(t,e){return e||!1!==t?!0===t?{}:t:null}function Bm(t,e,n,r){var i=t.pluginScopeKeys(e),o=t.getOptionScopes(n,i);return t.createResolver(o,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function jm(t,e){var n=fd.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function Fm(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(n=e.position)||"bottom"===n?"x":"left"===n||"right"===n?"y":void 0)||t.charAt(0).toLowerCase();var n}function qm(t){var e=t.options||(t.options={});e.plugins=Bh(e.plugins,{}),e.scales=function(t,e){var n=ud[t.type]||{scales:{}},r=e.scales||{},i=jm(t.type,e),o=Object.create(null),a=Object.create(null);return Object.keys(r).forEach((function(t){var e=r[t],s=Fm(t,e),u=function(t,e){return t===e?"_index_":"_value_"}(s,i),c=n.scales||{};o[s]=o[s]||t,a[t]=Zh(Object.create(null),[{axis:s},e,c[s],c[u]])})),t.data.datasets.forEach((function(n){var i=n.type||t.type,s=n.indexAxis||jm(i,e),u=(ud[i]||{}).scales||{};Object.keys(u).forEach((function(t){var e=function(t,e){var n=t;return"_index_"===t?n=e:"_value_"===t&&(n="x"===e?"y":"x"),n}(t,s),i=n[e+"AxisID"]||o[e]||e;a[i]=a[i]||Object.create(null),Zh(a[i],[{axis:e},r[i],u[t]])}))})),Object.keys(a).forEach((function(t){var e=a[t];Zh(e,[fd.scales[e.type],fd.scale])})),a}(t,e)}function $m(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}var Vm=new Map,Um=new Set;function Hm(t,e){var n=Vm.get(t);return n||(n=e(),Vm.set(t,n),Um.add(n)),n}var Wm=function(t,e,n){var r=Kh(e,n);void 0!==r&&t.add(r)},Zm=function(){function t(e){Xp(this,t),this._config=function(t){return(t=t||{}).data=$m(t.data),qm(t),t}(e),this._scopeCache=new Map,this._resolverCache=new Map}return tv(t,[{key:"platform",get:function(){return this._config.platform}},{key:"type",get:function(){return this._config.type},set:function(t){this._config.type=t}},{key:"data",get:function(){return this._config.data},set:function(t){this._config.data=$m(t)}},{key:"options",get:function(){return this._config.options},set:function(t){this._config.options=t}},{key:"plugins",get:function(){return this._config.plugins}},{key:"update",value:function(){var t=this._config;this.clearCache(),qm(t)}},{key:"clearCache",value:function(){this._scopeCache.clear(),this._resolverCache.clear()}},{key:"datasetScopeKeys",value:function(t){return Hm(t,(function(){return[["datasets.".concat(t),""]]}))}},{key:"datasetAnimationScopeKeys",value:function(t,e){return Hm("".concat(t,".transition.").concat(e),(function(){return[["datasets.".concat(t,".transitions.").concat(e),"transitions.".concat(e)],["datasets.".concat(t),""]]}))}},{key:"datasetElementScopeKeys",value:function(t,e){return Hm("".concat(t,"-").concat(e),(function(){return[["datasets.".concat(t,".elements.").concat(e),"datasets.".concat(t),"elements.".concat(e),""]]}))}},{key:"pluginScopeKeys",value:function(t){var e=t.id,n=this.type;return Hm("".concat(n,"-plugin-").concat(e),(function(){return[["plugins.".concat(e)].concat(Yp(t.additionalOptionScopes||[]))]}))}},{key:"_cachedScopes",value:function(t,e){var n=this._scopeCache,r=n.get(t);return r&&!e||(r=new Map,n.set(t,r)),r}},{key:"getOptionScopes",value:function(t,e,n){var r=this.options,i=this.type,o=this._cachedScopes(t,n),a=o.get(e);if(a)return a;var s=new Set;e.forEach((function(e){t&&(s.add(t),e.forEach((function(e){return Wm(s,t,e)}))),e.forEach((function(t){return Wm(s,r,t)})),e.forEach((function(t){return Wm(s,ud[i]||{},t)})),e.forEach((function(t){return Wm(s,fd,t)})),e.forEach((function(t){return Wm(s,cd,t)}))}));var u=Array.from(s);return 0===u.length&&u.push(Object.create(null)),Um.has(e)&&o.set(e,u),u}},{key:"chartOptionScopes",value:function(){var t=this.options,e=this.type;return[t,ud[e]||{},fd.datasets[e]||{},{type:e},fd,cd]}},{key:"resolveNamedOptions",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[""],i={$shared:!0},o=Jm(this._resolverCache,t,r),a=o.resolver,s=o.subPrefixes,u=a;if(Ym(a,e)){i.$shared=!1,n=Qh(n)?n():n;var c=this.createResolver(t,n,s);u=Vd(a,n,c)}var l,h=Zp(e);try{for(h.s();!(l=h.n()).done;){var f=l.value;i[f]=u[f]}}catch(M_){h.e(M_)}finally{h.f()}return i}},{key:"createResolver",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[""],r=arguments.length>3?arguments[3]:void 0,i=Jm(this._resolverCache,t,n),o=i.resolver;return Rh(e)?Vd(o,e,void 0,r):o}}]),t}();function Jm(t,e,n){var r=t.get(e);r||(r=new Map,t.set(e,r));var i=n.join(),o=r.get(i);o||(o={resolver:$d(e,n),subPrefixes:n.filter((function(t){return!t.toLowerCase().includes("hover")}))},r.set(i,o));return o}function Ym(t,e){var n,r=Ud(t),i=r.isScriptable,o=r.isIndexable,a=Zp(e);try{for(a.s();!(n=a.n()).done;){var s=n.value;if(i(s)&&Qh(t[s])||o(s)&&Nh(t[s]))return!0}}catch(M_){a.e(M_)}finally{a.f()}return!1}var Km=["top","bottom","left","right","chartArea"];function Gm(t,e){return"top"===t||"bottom"===t||-1===Km.indexOf(t)&&"x"===e}function Xm(t,e){return function(n,r){return n[t]===r[t]?n[e]-r[e]:n[t]-r[t]}}function Qm(t){var e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),Fh(n&&n.onComplete,[t],e)}function tg(t){var e=t.chart,n=e.options.animation;Fh(n&&n.onProgress,[t],e)}function eg(t){return cp()&&"string"===typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}var ng={},rg=function(t){var e=eg(t);return Object.values(ng).filter((function(t){return t.canvas===e})).pop()},ig=function(){function t(e,n){var r=this;Xp(this,t);var i=this,o=this.config=new Zm(n),a=eg(e),s=rg(a);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas can be reused.");var u=o.createResolver(o.chartOptionScopes(),i.getContext());this.platform=new(o.platform||function(t){return!cp()||"undefined"!==typeof OffscreenCanvas&&t instanceof OffscreenCanvas?um:_m}(a));var c,l,h,f=i.platform.acquireContext(a,u.aspectRatio),d=f&&f.canvas,p=d&&d.height,v=d&&d.width;this.id=Ph(),this.ctx=f,this.canvas=d,this.width=v,this.height=p,this._options=u,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Im,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=(c=function(){return r.update("resize")},l=u.resizeDelay||0,function(){return l?(clearTimeout(h),h=setTimeout(c,l)):c(),l}),ng[i.id]=i,f&&d?(ev.listen(i,"complete",Qm),ev.listen(i,"progress",tg),i._initialize(),i.attached&&i.update()):console.error("Failed to create chart: can't acquire context from the given item")}return tv(t,[{key:"aspectRatio",get:function(){var t=this.options,e=t.aspectRatio,n=t.maintainAspectRatio,r=this.width,i=this.height,o=this._aspectRatio;return Lh(e)?n&&o?o:i?r/i:null:e}},{key:"data",get:function(){return this.config.data},set:function(t){this.config.data=t}},{key:"options",get:function(){return this._options},set:function(t){this.config.options=t}},{key:"_initialize",value:function(){var t=this;return t.notifyPlugins("beforeInit"),t.options.responsive?t.resize():yp(t,t.options.devicePixelRatio),t.bindEvents(),t.notifyPlugins("afterInit"),t}},{key:"clear",value:function(){return md(this.canvas,this.ctx),this}},{key:"stop",value:function(){return ev.stop(this),this}},{key:"resize",value:function(t,e){ev.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}},{key:"_resize",value:function(t,e){var n=this,r=n.options,i=n.canvas,o=r.maintainAspectRatio&&n.aspectRatio,a=n.platform.getMaximumSize(i,t,e,o),s=r.devicePixelRatio||n.platform.getDevicePixelRatio();n.width=a.width,n.height=a.height,n._aspectRatio=n.aspectRatio,yp(n,s,!0)&&(n.notifyPlugins("resize",{size:a}),Fh(r.onResize,[n,a],n),n.attached&&n._doResize()&&n.render())}},{key:"ensureScalesHaveIDs",value:function(){qh(this.options.scales||{},(function(t,e){t.id=e}))}},{key:"buildOrUpdateScales",value:function(){var t=this,e=t.options,n=e.scales,r=t.scales,i=Object.keys(r).reduce((function(t,e){return t[e]=!1,t}),{}),o=[];n&&(o=o.concat(Object.keys(n).map((function(t){var e=n[t],r=Fm(t,e),i="r"===r,o="x"===r;return{options:e,dposition:i?"chartArea":o?"bottom":"left",dtype:i?"radialLinear":o?"category":"linear"}})))),qh(o,(function(n){var o=n.options,a=o.id,s=Fm(a,o),u=Bh(o.type,n.dtype);void 0!==o.position&&Gm(o.position,s)===Gm(n.dposition)||(o.position=n.dposition),i[a]=!0;var c=null;a in r&&r[a].type===u?c=r[a]:(c=new(Rm.getScale(u))({id:a,type:u,ctx:t.ctx,chart:t}),r[c.id]=c);c.init(o,e)})),qh(i,(function(t,e){t||delete r[e]})),qh(r,(function(e){om(t,e,e.options),rm(t,e)}))}},{key:"_updateMetasets",value:function(){var t=this,e=t._metasets,n=t.data.datasets.length,r=e.length;if(e.sort((function(t,e){return t.index-e.index})),r>n){for(var i=n;i<r;++i)t._destroyDatasetMeta(i);e.splice(n,r-n)}t._sortedMetasets=e.slice(0).sort(Xm("order","index"))}},{key:"_removeUnreferencedMetasets",value:function(){var t=this,e=t._metasets,n=t.data.datasets;e.length>n.length&&delete t._stacks,e.forEach((function(e,r){0===n.filter((function(t){return t===e._dataset})).length&&t._destroyDatasetMeta(r)}))}},{key:"buildOrUpdateControllers",value:function(){var t,e,n=this,r=[],i=n.data.datasets;for(n._removeUnreferencedMetasets(),t=0,e=i.length;t<e;t++){var o=i[t],a=n.getDatasetMeta(t),s=o.type||n.config.type;if(a.type&&a.type!==s&&(n._destroyDatasetMeta(t),a=n.getDatasetMeta(t)),a.type=s,a.indexAxis=o.indexAxis||jm(s,n.options),a.order=o.order||0,a.index=t,a.label=""+o.label,a.visible=n.isDatasetVisible(t),a.controller)a.controller.updateIndex(t),a.controller.linkScales();else{var u=Rm.getController(s),c=fd.datasets[s],l=c.datasetElementType,h=c.dataElementType;Object.assign(u.prototype,{dataElementType:Rm.getElement(h),datasetElementType:l&&Rm.getElement(l)}),a.controller=new u(n,t),r.push(a.controller)}}return n._updateMetasets(),r}},{key:"_resetElements",value:function(){var t=this;qh(t.data.datasets,(function(e,n){t.getDatasetMeta(n).controller.reset()}),t)}},{key:"reset",value:function(){this._resetElements(),this.notifyPlugins("reset")}},{key:"update",value:function(t){var e=this,n=e.config;n.update(),e._options=n.createResolver(n.chartOptionScopes(),e.getContext()),qh(e.scales,(function(t){im(e,t)}));var r=e._animationsDisabled=!e.options.animation;if(e.ensureScalesHaveIDs(),e.buildOrUpdateScales(),function(t,e){if(t.size!==e.size)return!1;var n,r=kh(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(!e.has(i))return!1}}catch(M_){r.e(M_)}finally{r.f()}return!0}(new Set(Object.keys(e._listeners)),new Set(e.options.events))&&!!this._responsiveListeners===e.options.responsive||(e.unbindEvents(),e.bindEvents()),e._plugins.invalidate(),!1!==e.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})){var i=e.buildOrUpdateControllers();e.notifyPlugins("beforeElementsUpdate");for(var o=0,a=0,s=e.data.datasets.length;a<s;a++){var u=e.getDatasetMeta(a).controller,c=!r&&-1===i.indexOf(u);u.buildOrUpdateElements(c),o=Math.max(+u.getMaxOverflow(),o)}e._minPadding=o,e._updateLayout(o),r||qh(i,(function(t){t.reset()})),e._updateDatasets(t),e.notifyPlugins("afterUpdate",{mode:t}),e._layers.sort(Xm("z","_idx")),e._lastEvent&&e._eventHandler(e._lastEvent,!0),e.render()}}},{key:"_updateLayout",value:function(t){var e=this;if(!1!==e.notifyPlugins("beforeLayout",{cancelable:!0})){am(e,e.width,e.height,t);var n=e.chartArea,r=n.width<=0||n.height<=0;e._layers=[],qh(e.boxes,(function(t){var n;r&&"chartArea"===t.position||(t.configure&&t.configure(),(n=e._layers).push.apply(n,Yp(t._layers())))}),e),e._layers.forEach((function(t,e){t._idx=e})),e.notifyPlugins("afterLayout")}}},{key:"_updateDatasets",value:function(t){var e=this,n="function"===typeof t;if(!1!==e.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(var r=0,i=e.data.datasets.length;r<i;++r)e._updateDataset(r,n?t({datasetIndex:r}):t);e.notifyPlugins("afterDatasetsUpdate",{mode:t})}}},{key:"_updateDataset",value:function(t,e){var n=this,r=n.getDatasetMeta(t),i={meta:r,index:t,mode:e,cancelable:!0};!1!==n.notifyPlugins("beforeDatasetUpdate",i)&&(r.controller._update(e),i.cancelable=!1,n.notifyPlugins("afterDatasetUpdate",i))}},{key:"render",value:function(){var t=this;!1!==t.notifyPlugins("beforeRender",{cancelable:!0})&&(ev.has(t)?t.attached&&!ev.running(t)&&ev.start(t):(t.draw(),Qm({chart:t})))}},{key:"draw",value:function(){var t,e=this;if(e._resizeBeforeDraw){var n=e._resizeBeforeDraw,r=n.width,i=n.height;e._resize(r,i),e._resizeBeforeDraw=null}if(e.clear(),!(e.width<=0||e.height<=0)&&!1!==e.notifyPlugins("beforeDraw",{cancelable:!0})){var o=e._layers;for(t=0;t<o.length&&o[t].z<=0;++t)o[t].draw(e.chartArea);for(e._drawDatasets();t<o.length;++t)o[t].draw(e.chartArea);e.notifyPlugins("afterDraw")}}},{key:"_getSortedDatasetMetas",value:function(t){var e,n,r=this._sortedMetasets,i=[];for(e=0,n=r.length;e<n;++e){var o=r[e];t&&!o.visible||i.push(o)}return i}},{key:"getSortedVisibleDatasetMetas",value:function(){return this._getSortedDatasetMetas(!0)}},{key:"_drawDatasets",value:function(){var t=this;if(!1!==t.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})){for(var e=t.getSortedVisibleDatasetMetas(),n=e.length-1;n>=0;--n)t._drawDataset(e[n]);t.notifyPlugins("afterDatasetsDraw")}}},{key:"_drawDataset",value:function(t){var e=this,n=e.ctx,r=t._clip,i=!r.disabled,o=e.chartArea,a={meta:t,index:t.index,cancelable:!0};!1!==e.notifyPlugins("beforeDatasetDraw",a)&&(i&&bd(n,{left:!1===r.left?0:o.left-r.left,right:!1===r.right?e.width:o.right+r.right,top:!1===r.top?0:o.top-r.top,bottom:!1===r.bottom?e.height:o.bottom+r.bottom}),t.controller.draw(),i&&wd(n),a.cancelable=!1,e.notifyPlugins("afterDatasetDraw",a))}},{key:"getElementsAtEventForMode",value:function(t,e,n,r){var i=Uv.modes[e];return"function"===typeof i?i(this,t,n,r):[]}},{key:"getDatasetMeta",value:function(t){var e=this.data.datasets[t],n=this._metasets,r=n.filter((function(t){return t&&t._dataset===e})).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(r)),r}},{key:"getContext",value:function(){return this.$context||(this.$context={chart:this,type:"chart"})}},{key:"getVisibleDatasetCount",value:function(){return this.getSortedVisibleDatasetMetas().length}},{key:"isDatasetVisible",value:function(t){var e=this.data.datasets[t];if(!e)return!1;var n=this.getDatasetMeta(t);return"boolean"===typeof n.hidden?!n.hidden:!e.hidden}},{key:"setDatasetVisibility",value:function(t,e){this.getDatasetMeta(t).hidden=!e}},{key:"toggleDataVisibility",value:function(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}},{key:"getDataVisibility",value:function(t){return!this._hiddenIndices[t]}},{key:"_updateVisibility",value:function(t,e,n){var r=this,i=n?"show":"hide",o=r.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,i);Xh(e)?(o.data[e].hidden=!n,r.update()):(r.setDatasetVisibility(t,n),a.update(o,{visible:n}),r.update((function(e){return e.datasetIndex===t?i:void 0})))}},{key:"hide",value:function(t,e){this._updateVisibility(t,e,!1)}},{key:"show",value:function(t,e){this._updateVisibility(t,e,!0)}},{key:"_destroyDatasetMeta",value:function(t){var e=this,n=e._metasets&&e._metasets[t];n&&n.controller&&(n.controller._destroy(),delete e._metasets[t])}},{key:"destroy",value:function(){var t,e,n=this,r=n.canvas,i=n.ctx;for(n.stop(),ev.remove(n),t=0,e=n.data.datasets.length;t<e;++t)n._destroyDatasetMeta(t);n.config.clearCache(),r&&(n.unbindEvents(),md(r,i),n.platform.releaseContext(i),n.canvas=null,n.ctx=null),n.notifyPlugins("destroy"),delete ng[n.id]}},{key:"toBase64Image",value:function(){var t;return(t=this.canvas).toDataURL.apply(t,arguments)}},{key:"bindEvents",value:function(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}},{key:"bindUserEvents",value:function(){var t=this,e=t._listeners,n=t.platform,r=function(e,n,r){e.offsetX=n,e.offsetY=r,t._eventHandler(e)};qh(t.options.events,(function(i){return function(r,i){n.addEventListener(t,r,i),e[r]=i}(i,r)}))}},{key:"bindResponsiveEvents",value:function(){var t=this;t._responsiveListeners||(t._responsiveListeners={});var e,n=t._responsiveListeners,r=t.platform,i=function(e,i){r.addEventListener(t,e,i),n[e]=i},o=function(e,i){n[e]&&(r.removeEventListener(t,e,i),delete n[e])},a=function(e,n){t.canvas&&t.resize(e,n)},s=function n(){o("attach",n),t.attached=!0,t.resize(),i("resize",a),i("detach",e)};e=function(){t.attached=!1,o("resize",a),i("attach",s)},r.isAttached(t.canvas)?s():e()}},{key:"unbindEvents",value:function(){var t=this;qh(t._listeners,(function(e,n){t.platform.removeEventListener(t,n,e)})),t._listeners={},qh(t._responsiveListeners,(function(e,n){t.platform.removeEventListener(t,n,e)})),t._responsiveListeners=void 0}},{key:"updateHoverStyle",value:function(t,e,n){var r,i,o,a=n?"set":"remove";for("dataset"===e&&this.getDatasetMeta(t[0].datasetIndex).controller["_"+a+"DatasetHoverStyle"](),i=0,o=t.length;i<o;++i){var s=(r=t[i])&&this.getDatasetMeta(r.datasetIndex).controller;s&&s[a+"HoverStyle"](r.element,r.datasetIndex,r.index)}}},{key:"getActiveElements",value:function(){return this._active||[]}},{key:"setActiveElements",value:function(t){var e=this,n=e._active||[],r=t.map((function(t){var n=t.datasetIndex,r=t.index,i=e.getDatasetMeta(n);if(!i)throw new Error("No dataset found at index "+n);return{datasetIndex:n,element:i.data[r],index:r}}));!$h(r,n)&&(e._active=r,e._updateHoverStyles(r,n))}},{key:"notifyPlugins",value:function(t,e,n){return this._plugins.notify(this,t,e,n)}},{key:"_updateHoverStyles",value:function(t,e,n){var r=this,i=r.options.hover,o=function(t,e){return t.filter((function(t){return!e.some((function(e){return t.datasetIndex===e.datasetIndex&&t.index===e.index}))}))},a=o(e,t),s=n?t:o(t,e);a.length&&r.updateHoverStyle(a,i.mode,!1),s.length&&i.mode&&r.updateHoverStyle(s,i.mode,!0)}},{key:"_eventHandler",value:function(t,e){var n=this,r=this,i={event:t,replay:e,cancelable:!0},o=function(e){return(e.options.events||n.options.events).includes(t.type)};if(!1!==r.notifyPlugins("beforeEvent",i,o)){var a=r._handleEvent(t,e);return i.cancelable=!1,r.notifyPlugins("afterEvent",i,o),(a||i.changed)&&r.render(),r}}},{key:"_handleEvent",value:function(t,e){var n,r=this,i=r._active,o=void 0===i?[]:i,a=r.options,s=a.hover,u=e,c=[],l=null;return"mouseout"!==t.type&&(c=r.getElementsAtEventForMode(t,s.mode,s,u),l="click"===t.type?r._lastEvent:t),r._lastEvent=null,yd(t,r.chartArea,r._minPadding)&&(Fh(a.onHover,[t,c,r],r),"mouseup"!==t.type&&"click"!==t.type&&"contextmenu"!==t.type||Fh(a.onClick,[t,c,r],r)),((n=!$h(c,o))||e)&&(r._active=c,r._updateHoverStyles(c,o,e)),r._lastEvent=l,n}}]),t}(),og=function(){return qh(ig.instances,(function(t){return t._plugins.invalidate()}))},ag=!0;function sg(t,e,n){var r=e.startAngle,i=e.pixelMargin,o=e.x,a=e.y,s=e.outerRadius,u=e.innerRadius,c=i/s;t.beginPath(),t.arc(o,a,s,r-c,n+c),u>i?(c=i/u,t.arc(o,a,u,n+c,r-c,!0)):t.arc(o,a,i,n+af,r-af),t.closePath(),t.clip()}function ug(t,e,n,r){var i=Od(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),o=(n-e)/2,a=Math.min(o,r*e/2),s=function(t){var e=(n-Math.min(o,t))*r/2;return xf(t,0,Math.min(o,e))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:xf(i.innerStart,0,a),innerEnd:xf(i.innerEnd,0,a)}}function cg(t,e,n,r){return{x:n+t*Math.cos(e),y:r+t*Math.sin(e)}}function lg(t,e,n,r,i){var o=e.x,a=e.y,s=e.startAngle,u=e.pixelMargin,c=e.innerRadius,l=Math.max(e.outerRadius+r+n-u,0),h=c>0?c+r+n+u:0,f=0,d=i-s;if(r){var p=((c>0?c-r:0)+(l>0?l-r:0))/2;f=(d-(0!==p?d*p/(p+r):d))/2}var v=(d-Math.max(.001,d*l-n/tf)/l)/2,m=s+v+f,g=i-v-f,y=ug(e,h,l,g-m),b=y.outerStart,w=y.outerEnd,_=y.innerStart,x=y.innerEnd,k=l-b,S=l-w,C=m+b/k,M=g-w/S,E=h+_,T=h+x,A=m+_/E,O=g-x/T;if(t.beginPath(),t.arc(o,a,l,C,M),w>0){var D=cg(S,M,o,a);t.arc(D.x,D.y,w,M,g+af)}var P=cg(T,g,o,a);if(t.lineTo(P.x,P.y),x>0){var L=cg(T,O,o,a);t.arc(L.x,L.y,x,g+af,O+Math.PI)}if(t.arc(o,a,h,g-x/h,m+_/h,!0),_>0){var N=cg(E,A,o,a);t.arc(N.x,N.y,_,A+Math.PI,m-af)}var R=cg(k,m,o,a);if(t.lineTo(R.x,R.y),b>0){var I=cg(k,C,o,a);t.arc(I.x,I.y,b,m-af,C)}t.closePath()}function hg(t,e,n,r,i){var o=e.options,a="inner"===o.borderAlign;o.borderWidth&&(a?(t.lineWidth=2*o.borderWidth,t.lineJoin="round"):(t.lineWidth=o.borderWidth,t.lineJoin="bevel"),e.fullCircles&&function(t,e,n){var r,i=e.x,o=e.y,a=e.startAngle,s=e.pixelMargin,u=e.fullCircles,c=Math.max(e.outerRadius-s,0),l=e.innerRadius+s;for(n&&sg(t,e,a+ef),t.beginPath(),t.arc(i,o,l,a+ef,a,!0),r=0;r<u;++r)t.stroke();for(t.beginPath(),t.arc(i,o,c,a,a+ef),r=0;r<u;++r)t.stroke()}(t,e,a),a&&sg(t,e,i),lg(t,e,n,r,i),t.stroke())}Object.defineProperties(ig,{defaults:{enumerable:ag,value:fd},instances:{enumerable:ag,value:ng},overrides:{enumerable:ag,value:ud},registry:{enumerable:ag,value:Rm},version:{enumerable:ag,value:"3.5.1"},getChart:{enumerable:ag,value:rg},register:{enumerable:ag,value:function(){Rm.add.apply(Rm,arguments),og()}},unregister:{enumerable:ag,value:function(){Rm.remove.apply(Rm,arguments),og()}}});var fg=function(t){jp(n,t);var e=qp(n);function n(t){var r;return Xp(this,n),(r=e.call(this)).options=void 0,r.circumference=void 0,r.startAngle=void 0,r.endAngle=void 0,r.innerRadius=void 0,r.outerRadius=void 0,r.pixelMargin=0,r.fullCircles=0,t&&Object.assign(Vp(r),t),r}return tv(n,[{key:"inRange",value:function(t,e,n){var r=function(t,e){var n=e.x-t.x,r=e.y-t.y,i=Math.sqrt(n*n+r*r),o=Math.atan2(r,n);return o<-.5*tf&&(o+=ef),{angle:o,distance:i}}(this.getProps(["x","y"],n),{x:t,y:e}),i=r.angle,o=r.distance,a=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),s=a.startAngle,u=a.endAngle,c=a.innerRadius,l=a.outerRadius,h=a.circumference,f=this.options.spacing/2;return(h>=ef||_f(i,s,u))&&(o>=c+f&&o<=l+f)}},{key:"getCenterPoint",value:function(t){var e=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),n=e.x,r=e.y,i=e.startAngle,o=e.endAngle,a=e.innerRadius,s=e.outerRadius,u=this.options,c=u.offset,l=(i+o)/2,h=(a+s+u.spacing+c)/2;return{x:n+Math.cos(l)*h,y:r+Math.sin(l)*h}}},{key:"tooltipPosition",value:function(t){return this.getCenterPoint(t)}},{key:"draw",value:function(t){var e=this,n=e.options,r=e.circumference,i=(n.offset||0)/2,o=(n.spacing||0)/2;if(e.pixelMargin="inner"===n.borderAlign?.33:0,e.fullCircles=r>ef?Math.floor(r/ef):0,!(0===r||e.innerRadius<0||e.outerRadius<0)){t.save();var a=0;if(i){a=i/2;var s=(e.startAngle+e.endAngle)/2;t.translate(Math.cos(s)*a,Math.sin(s)*a),e.circumference>=tf&&(a=i)}t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor;var u=function(t,e,n,r){var i=e.fullCircles,o=e.startAngle,a=e.circumference,s=e.endAngle;if(i){lg(t,e,n,r,o+ef);for(var u=0;u<i;++u)t.fill();isNaN(a)||(s=o+a%ef,a%ef===0&&(s+=ef))}return lg(t,e,n,r,s),t.fill(),s}(t,e,a,o);hg(t,e,a,o,u),t.restore()}}}]),n}(xm);function dg(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;t.lineCap=Bh(n.borderCapStyle,e.borderCapStyle),t.setLineDash(Bh(n.borderDash,e.borderDash)),t.lineDashOffset=Bh(n.borderDashOffset,e.borderDashOffset),t.lineJoin=Bh(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=Bh(n.borderWidth,e.borderWidth),t.strokeStyle=Bh(n.borderColor,e.borderColor)}function pg(t,e,n){t.lineTo(n.x,n.y)}function vg(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.length,i=n.start,o=void 0===i?0:i,a=n.end,s=void 0===a?r-1:a,u=e.start,c=e.end,l=Math.max(o,u),h=Math.min(s,c),f=o<u&&s<u||o>c&&s>c;return{count:r,start:l,loop:e.loop,ilen:h<l&&!f?r+h-l:h-l}}function mg(t,e,n,r){var i,o,a,s=e.points,u=e.options,c=vg(s,n,r),l=c.count,h=c.start,f=c.loop,d=c.ilen,p=function(t){return t.stepped?_d:t.tension||"monotone"===t.cubicInterpolationMode?xd:pg}(u),v=r||{},m=v.move,g=void 0===m||m,y=v.reverse;for(i=0;i<=d;++i)(o=s[(h+(y?d-i:i))%l]).skip||(g?(t.moveTo(o.x,o.y),g=!1):p(t,a,o,y,u.stepped),a=o);return f&&p(t,a,o=s[(h+(y?d:0))%l],y,u.stepped),!!f}function gg(t,e,n,r){var i,o,a,s,u,c,l=e.points,h=vg(l,n,r),f=h.count,d=h.start,p=h.ilen,v=r||{},m=v.move,g=void 0===m||m,y=v.reverse,b=0,w=0,_=function(t){return(d+(y?p-t:t))%f},x=function(){s!==u&&(t.lineTo(b,u),t.lineTo(b,s),t.lineTo(b,c))};for(g&&(o=l[_(0)],t.moveTo(o.x,o.y)),i=0;i<=p;++i)if(!(o=l[_(i)]).skip){var k=o.x,S=o.y,C=0|k;C===a?(S<s?s=S:S>u&&(u=S),b=(w*b+k)/++w):(x(),t.lineTo(k,S),a=C,w=0,s=u=S),c=S}x()}function yg(t){var e=t.options,n=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&"monotone"!==e.cubicInterpolationMode&&!e.stepped&&!n?gg:mg}fg.id="arc",fg.defaults={borderAlign:"center",borderColor:"#fff",borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},fg.defaultRoutes={backgroundColor:"backgroundColor"};var bg="function"===typeof Path2D;function wg(t,e,n,r){bg&&1===e.segments.length?function(t,e,n,r){var i=e._path;i||(i=e._path=new Path2D,e.path(i,n,r)&&i.closePath()),dg(t,e.options),t.stroke(i)}(t,e,n,r):function(t,e,n,r){var i,o=e.segments,a=e.options,s=yg(e),u=Zp(o);try{for(u.s();!(i=u.n()).done;){var c=i.value;dg(t,a,c.style),t.beginPath(),s(t,e,c,{start:n,end:n+r-1})&&t.closePath(),t.stroke()}}catch(M_){u.e(M_)}finally{u.f()}}(t,e,n,r)}var _g=function(t){jp(n,t);var e=qp(n);function n(t){var r;return Xp(this,n),(r=e.call(this)).animated=!0,r.options=void 0,r._loop=void 0,r._fullLoop=void 0,r._path=void 0,r._points=void 0,r._segments=void 0,r._decimated=!1,r._pointsUpdated=!1,r._datasetIndex=void 0,t&&Object.assign(Vp(r),t),r}return tv(n,[{key:"updateControlPoints",value:function(t,e){var n=this,r=n.options;if((r.tension||"monotone"===r.cubicInterpolationMode)&&!r.stepped&&!n._pointsUpdated){var i=r.spanGaps?n._loop:n._fullLoop;up(n._points,r,t,i,e),n._pointsUpdated=!0}}},{key:"points",get:function(){return this._points},set:function(t){var e=this;e._points=t,delete e._segments,delete e._path,e._pointsUpdated=!1}},{key:"segments",get:function(){return this._segments||(this._segments=function(t,e){var n=t.points,r=t.options.spanGaps,i=n.length;if(!i)return[];var o=!!t._loop,a=function(t,e,n,r){var i=0,o=e-1;if(n&&!r)for(;i<e&&!t[i].skip;)i++;for(;i<e&&t[i].skip;)i++;for(i%=e,n&&(o+=i);o>i&&t[o%e].skip;)o--;return{start:i,end:o%=e}}(n,i,o,r),s=a.start,u=a.end;return Lp(t,!0===r?[{start:s,end:u,loop:o}]:function(t,e,n,r){var i,o=t.length,a=[],s=e,u=t[e];for(i=e+1;i<=n;++i){var c=t[i%o];c.skip||c.stop?u.skip||(r=!1,a.push({start:e%o,end:(i-1)%o,loop:r}),e=s=c.stop?i:null):(s=i,u.skip&&(e=i)),u=c}return null!==s&&a.push({start:e%o,end:s%o,loop:r}),a}(n,s,u<s?u+i:u,!!t._fullLoop&&0===s&&u===i-1),n,e)}(this,this.options.segment))}},{key:"first",value:function(){var t=this.segments,e=this.points;return t.length&&e[t[0].start]}},{key:"last",value:function(){var t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}},{key:"interpolate",value:function(t,e){var n=this,r=n.options,i=t[e],o=n.points,a=Pp(n,{property:e,start:i,end:i});if(a.length){var s,u,c=[],l=function(t){return t.stepped?xp:t.tension||"monotone"===t.cubicInterpolationMode?kp:_p}(r);for(s=0,u=a.length;s<u;++s){var h=a[s],f=h.start,d=h.end,p=o[f],v=o[d];if(p!==v){var m=l(p,v,Math.abs((i-p[e])/(v[e]-p[e])),r.stepped);m[e]=t[e],c.push(m)}else c.push(p)}return 1===c.length?c[0]:c}}},{key:"pathSegment",value:function(t,e,n){return yg(this)(t,this,e,n)}},{key:"path",value:function(t,e,n){var r=this,i=r.segments,o=yg(r),a=r._loop;e=e||0,n=n||r.points.length-e;var s,u=Zp(i);try{for(u.s();!(s=u.n()).done;){a&=o(t,r,s.value,{start:e,end:e+n-1})}}catch(M_){u.e(M_)}finally{u.f()}return!!a}},{key:"draw",value:function(t,e,n,r){var i=this,o=i.options||{};(i.points||[]).length&&o.borderWidth&&(t.save(),wg(t,i,n,r),t.restore(),i.animated&&(i._pointsUpdated=!1,i._path=void 0))}}]),n}(xm);function xg(t,e,n,r){var i=t.options,o=t.getProps([n],r)[n];return Math.abs(e-o)<i.radius+i.hitRadius}_g.id="line",_g.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},_g.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},_g.descriptors={_scriptable:!0,_indexable:function(t){return"borderDash"!==t&&"fill"!==t}};var kg=function(t){jp(n,t);var e=qp(n);function n(t){var r;return Xp(this,n),(r=e.call(this)).options=void 0,r.parsed=void 0,r.skip=void 0,r.stop=void 0,t&&Object.assign(Vp(r),t),r}return tv(n,[{key:"inRange",value:function(t,e,n){var r=this.options,i=this.getProps(["x","y"],n),o=i.x,a=i.y;return Math.pow(t-o,2)+Math.pow(e-a,2)<Math.pow(r.hitRadius+r.radius,2)}},{key:"inXRange",value:function(t,e){return xg(this,t,"x",e)}},{key:"inYRange",value:function(t,e){return xg(this,t,"y",e)}},{key:"getCenterPoint",value:function(t){var e=this.getProps(["x","y"],t);return{x:e.x,y:e.y}}},{key:"size",value:function(t){var e=(t=t||this.options||{}).radius||0;return 2*((e=Math.max(e,e&&t.hoverRadius||0))+(e&&t.borderWidth||0))}},{key:"draw",value:function(t,e){var n=this,r=n.options;n.skip||r.radius<.1||!yd(n,e,n.size(r)/2)||(t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.fillStyle=r.backgroundColor,gd(t,r,n.x,n.y))}},{key:"getRange",value:function(){var t=this.options||{};return t.radius+t.hitRadius}}]),n}(xm);function Sg(t,e){var n,r,i,o,a,s=t.getProps(["x","y","base","width","height"],e),u=s.x,c=s.y,l=s.base,h=s.width,f=s.height;return t.horizontal?(a=f/2,n=Math.min(u,l),r=Math.max(u,l),i=c-a,o=c+a):(n=u-(a=h/2),r=u+a,i=Math.min(c,l),o=Math.max(c,l)),{left:n,top:i,right:r,bottom:o}}function Cg(t,e,n,r){return t?0:xf(e,n,r)}function Mg(t){var e=Sg(t),n=e.right-e.left,r=e.bottom-e.top,i=function(t,e,n){var r=t.options.borderWidth,i=t.borderSkipped,o=Dd(r);return{t:Cg(i.top,o.top,0,n),r:Cg(i.right,o.right,0,e),b:Cg(i.bottom,o.bottom,0,n),l:Cg(i.left,o.left,0,e)}}(t,n/2,r/2),o=function(t,e,n){var r=t.getProps(["enableBorderRadius"]).enableBorderRadius,i=t.options.borderRadius,o=Pd(i),a=Math.min(e,n),s=t.borderSkipped,u=r||Rh(i);return{topLeft:Cg(!u||s.top||s.left,o.topLeft,0,a),topRight:Cg(!u||s.top||s.right,o.topRight,0,a),bottomLeft:Cg(!u||s.bottom||s.left,o.bottomLeft,0,a),bottomRight:Cg(!u||s.bottom||s.right,o.bottomRight,0,a)}}(t,n/2,r/2);return{outer:{x:e.left,y:e.top,w:n,h:r,radius:o},inner:{x:e.left+i.l,y:e.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}}function Eg(t,e,n,r){var i=null===e,o=null===n,a=t&&!(i&&o)&&Sg(t,r);return a&&(i||e>=a.left&&e<=a.right)&&(o||n>=a.top&&n<=a.bottom)}function Tg(t,e){t.rect(e.x,e.y,e.w,e.h)}function Ag(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.x!==n.x?-e:0,i=t.y!==n.y?-e:0,o=(t.x+t.w!==n.x+n.w?e:0)-r,a=(t.y+t.h!==n.y+n.h?e:0)-i;return{x:t.x+r,y:t.y+i,w:t.w+o,h:t.h+a,radius:t.radius}}kg.id="point",kg.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},kg.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var Og=function(t){jp(n,t);var e=qp(n);function n(t){var r;return Xp(this,n),(r=e.call(this)).options=void 0,r.horizontal=void 0,r.base=void 0,r.width=void 0,r.height=void 0,t&&Object.assign(Vp(r),t),r}return tv(n,[{key:"draw",value:function(t){var e,n=this.options,r=Mg(this),i=r.inner,o=r.outer,a=(e=o.radius).topLeft||e.topRight||e.bottomLeft||e.bottomRight?Md:Tg,s=.33;t.save(),o.w===i.w&&o.h===i.h||(t.beginPath(),a(t,Ag(o,s,i)),t.clip(),a(t,Ag(i,-.33,o)),t.fillStyle=n.borderColor,t.fill("evenodd")),t.beginPath(),a(t,Ag(i,s,o)),t.fillStyle=n.backgroundColor,t.fill(),t.restore()}},{key:"inRange",value:function(t,e,n){return Eg(this,t,e,n)}},{key:"inXRange",value:function(t,e){return Eg(this,t,null,e)}},{key:"inYRange",value:function(t,e){return Eg(this,null,t,e)}},{key:"getCenterPoint",value:function(t){var e=this.getProps(["x","y","base","horizontal"],t),n=e.x,r=e.y,i=e.base,o=e.horizontal;return{x:o?(n+i)/2:n,y:o?r:(r+i)/2}}},{key:"getRange",value:function(t){return"x"===t?this.width/2:this.height/2}}]),n}(xm);Og.id="bar",Og.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,enableBorderRadius:!0,pointStyle:void 0},Og.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};var Dg=Object.freeze({__proto__:null,ArcElement:fg,LineElement:_g,PointElement:kg,BarElement:Og});function Pg(t){if(t._decimated){var e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{value:e})}}function Lg(t){t.data.datasets.forEach((function(t){Pg(t)}))}var Ng={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:function(t,e,n){if(n.enabled){var r=t.width;t.data.datasets.forEach((function(e,i){var o=e._data,a=e.indexAxis,s=t.getDatasetMeta(i),u=o||e.data;if("y"!==Rd([a,t.options.indexAxis])&&"line"===s.type){var c=t.scales[s.xAxisID];if(("linear"===c.type||"time"===c.type)&&!t.options.parsing){var l=function(t,e){var n=e.length,r=0,i=t.iScale,o=i.getUserBounds(),a=o.min,s=o.max,u=o.minDefined,c=o.maxDefined;return u&&(r=xf(zd(e,i.axis,a).lo,0,n-1)),{start:r,count:c?xf(zd(e,i.axis,s).hi+1,r,n)-r:n-r}}(s,u),h=l.start,f=l.count;if(f<=(n.threshold||4*r))Pg(e);else{var d;switch(Lh(o)&&(e._data=u,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),n.algorithm){case"lttb":d=function(t,e,n,r,i){var o=i.samples||r;if(o>=n)return t.slice(e,e+n);var a,s,u,c,l,h=[],f=(n-2)/(o-2),d=0,p=e+n-1,v=e;for(h[d++]=t[v],a=0;a<o-2;a++){var m=0,g=0,y=void 0,b=Math.floor((a+1)*f)+1+e,w=Math.min(Math.floor((a+2)*f)+1,n)+e,_=w-b;for(y=b;y<w;y++)m+=t[y].x,g+=t[y].y;m/=_,g/=_;var x=Math.floor(a*f)+1+e,k=Math.min(Math.floor((a+1)*f)+1,n)+e,S=t[v],C=S.x,M=S.y;for(u=c=-1,y=x;y<k;y++)(c=.5*Math.abs((C-m)*(t[y].y-M)-(C-t[y].x)*(g-M)))>u&&(u=c,s=t[y],l=y);h[d++]=s,v=l}return h[d++]=t[p],h}(u,h,f,r,n);break;case"min-max":d=function(t,e,n,r){var i,o,a,s,u,c,l,h,f,d,p=0,v=0,m=[],g=e+n-1,y=t[e].x,b=t[g].x-y;for(i=e;i<e+n;++i){a=((o=t[i]).x-y)/b*r,s=o.y;var w=0|a;if(w===u)s<f?(f=s,c=i):s>d&&(d=s,l=i),p=(v*p+o.x)/++v;else{var _=i-1;if(!Lh(c)&&!Lh(l)){var x=Math.min(c,l),k=Math.max(c,l);x!==h&&x!==_&&m.push(zp(zp({},t[x]),{},{x:p})),k!==h&&k!==_&&m.push(zp(zp({},t[k]),{},{x:p}))}i>0&&_!==h&&m.push(t[_]),m.push(o),u=w,v=0,f=d=s,c=l=h=i}}return m}(u,h,f,r);break;default:throw new Error("Unsupported decimation algorithm '".concat(n.algorithm,"'"))}e._decimated=d}}}}))}else Lg(t)},destroy:function(t){Lg(t)}};function Rg(t,e,n){var r=function(t){var e=t.options,n=e.fill,r=Bh(n&&n.target,n);return void 0===r&&(r=!!e.backgroundColor),!1!==r&&null!==r&&(!0===r?"origin":r)}(t);if(Rh(r))return!isNaN(r.value)&&r;var i=parseFloat(r);return Ih(i)&&Math.floor(i)===i?("-"!==r[0]&&"+"!==r[0]||(i=e+i),!(i===e||i<0||i>=n)&&i):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}var Ig=function(){function t(e){Xp(this,t),this.x=e.x,this.y=e.y,this.radius=e.radius}return tv(t,[{key:"pathSegment",value:function(t,e,n){var r=this.x,i=this.y,o=this.radius;return e=e||{start:0,end:ef},t.arc(r,i,o,e.end,e.start,!0),!n.bounds}},{key:"interpolate",value:function(t){var e=this.x,n=this.y,r=this.radius,i=t.angle;return{x:e+Math.cos(i)*r,y:n+Math.sin(i)*r,angle:i}}}]),t}();function zg(t){return(t.scale||{}).getPointPositionForValue?function(t){var e,n,r,i=t.scale,o=t.fill,a=i.options,s=i.getLabels().length,u=[],c=a.reverse?i.max:i.min,l=a.reverse?i.min:i.max;if(r="start"===o?c:"end"===o?l:Rh(o)?o.value:i.getBaseValue(),a.grid.circular)return n=i.getPointPositionForValue(0,c),new Ig({x:n.x,y:n.y,radius:i.getDistanceFromCenterForValue(r)});for(e=0;e<s;++e)u.push(i.getPointPositionForValue(e,r));return u}(t):function(t){var e,n=t.scale,r=void 0===n?{}:n,i=t.fill,o=null;return"start"===i?o=r.bottom:"end"===i?o=r.top:Rh(i)?o=r.getPixelForValue(i.value):r.getBasePixel&&(o=r.getBasePixel()),Ih(o)?{x:(e=r.isHorizontal())?o:null,y:e?null:o}:null}(t)}function Bg(t,e,n){for(;e>t;e--){var r=n[e];if(!isNaN(r.x)&&!isNaN(r.y))break}return e}function jg(t){var e=t.chart,n=t.scale,r=t.index,i=t.line,o=[],a=i.segments,s=i.points,u=function(t,e){for(var n=[],r=t.getSortedVisibleDatasetMetas(),i=0;i<r.length;i++){var o=r[i];if(o.index===e)break;Fg(o)&&n.unshift(o.dataset)}return n}(e,r);u.push(Vg({x:null,y:n.bottom},i));for(var c=0;c<a.length;c++)for(var l=a[c],h=l.start;h<=l.end;h++)qg(o,s[h],u);return new _g({points:o,options:{}})}var Fg=function(t){return"line"===t.type&&!t.hidden};function qg(t,e,n){for(var r=[],i=0;i<n.length;i++){var o=$g(n[i],e,"x"),a=o.first,s=o.last,u=o.point;if(!(!u||a&&s))if(a)r.unshift(u);else if(t.push(u),!s)break}t.push.apply(t,r)}function $g(t,e,n){var r=t.interpolate(e,n);if(!r)return{};for(var i=r[n],o=t.segments,a=t.points,s=!1,u=!1,c=0;c<o.length;c++){var l=o[c],h=a[l.start][n],f=a[l.end][n];if(i>=h&&i<=f){s=i===h,u=i===f;break}}return{first:s,last:u,point:r}}function Vg(t,e){var n=[],r=!1;return Nh(t)?(r=!0,n=t):n=function(t,e){var n=t||{},r=n.x,i=void 0===r?null:r,o=n.y,a=void 0===o?null:o,s=e.points,u=[];return e.segments.forEach((function(t){var e=t.start,n=t.end;n=Bg(e,n,s);var r=s[e],o=s[n];null!==a?(u.push({x:r.x,y:a}),u.push({x:o.x,y:a})):null!==i&&(u.push({x:i,y:r.y}),u.push({x:i,y:o.y}))})),u}(t,e),n.length?new _g({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function Ug(t,e,n){var r,i=t[e].fill,o=[e];if(!n)return i;for(;!1!==i&&-1===o.indexOf(i);){if(!Ih(i))return i;if(!(r=t[i]))return!1;if(r.visible)return i;o.push(i),i=r.fill}return!1}function Hg(t,e,n){t.beginPath(),e.path(t),t.lineTo(e.last().x,n),t.lineTo(e.first().x,n),t.closePath(),t.clip()}function Wg(t,e,n,r){if(!r){var i=e[t],o=n[t];return"angle"===t&&(i=wf(i),o=wf(o)),{property:t,start:i,end:o}}}function Zg(t,e,n,r){return t&&e?r(t[n],e[n]):t?t[n]:e?e[n]:0}function Jg(t,e,n){var r=e.chart.chartArea,i=r.top,o=r.bottom,a=n||{},s=a.property,u=a.start,c=a.end;"x"===s&&(t.beginPath(),t.rect(u,i,c-u,o-i),t.clip())}function Yg(t,e,n,r){var i=e.interpolate(n,r);i&&t.lineTo(i.x,i.y)}function Kg(t,e){var n,r=e.line,i=e.target,o=e.property,a=e.color,s=e.scale,u=function(t,e,n){var r,i=t.segments,o=t.points,a=e.points,s=[],u=Zp(i);try{for(u.s();!(r=u.n()).done;){var c=r.value,l=c.start,h=c.end;h=Bg(l,h,o);var f=Wg(n,o[l],o[h],c.loop);if(e.segments){var d,p=Zp(Pp(e,f));try{for(p.s();!(d=p.n()).done;){var v,m=d.value,g=Wg(n,a[m.start],a[m.end],m.loop),y=Zp(Dp(c,o,g));try{for(y.s();!(v=y.n()).done;){var b=v.value;s.push({source:b,target:m,start:Wp({},n,Zg(f,g,"start",Math.max)),end:Wp({},n,Zg(f,g,"end",Math.min))})}}catch(M_){y.e(M_)}finally{y.f()}}}catch(M_){p.e(M_)}finally{p.f()}}else s.push({source:c,target:f,start:o[l],end:o[h]})}}catch(M_){u.e(M_)}finally{u.f()}return s}(r,i,o),c=Zp(u);try{for(c.s();!(n=c.n()).done;){var l=n.value,h=l.source,f=l.target,d=l.start,p=l.end,v=h.style,m=(v=void 0===v?{}:v).backgroundColor,g=void 0===m?a:m,y=!0!==i;t.save(),t.fillStyle=g,Jg(t,s,y&&Wg(o,d,p)),t.beginPath();var b=!!r.pathSegment(t,h),w=void 0;if(y){b?t.closePath():Yg(t,i,p,o);var _=!!i.pathSegment(t,f,{move:b,reverse:!0});(w=b&&_)||Yg(t,i,d,o)}t.closePath(),t.fill(w?"evenodd":"nonzero"),t.restore()}}catch(M_){c.e(M_)}finally{c.f()}}function Gg(t,e,n){var r=function(t){var e=t.chart,n=t.fill,r=t.line;if(Ih(n))return function(t,e){var n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}(e,n);if("stack"===n)return jg(t);if("shape"===n)return!0;var i=zg(t);return i instanceof Ig?i:Vg(i,r)}(e),i=e.line,o=e.scale,a=e.axis,s=i.options,u=s.fill,c=s.backgroundColor,l=u||{},h=l.above,f=void 0===h?c:h,d=l.below,p=void 0===d?c:d;r&&i.points.length&&(bd(t,n),function(t,e){var n=e.line,r=e.target,i=e.above,o=e.below,a=e.area,s=e.scale,u=n._loop?"angle":e.axis;t.save(),"x"===u&&o!==i&&(Hg(t,r,a.top),Kg(t,{line:n,target:r,color:i,scale:s,property:u}),t.restore(),t.save(),Hg(t,r,a.bottom)),Kg(t,{line:n,target:r,color:o,scale:s,property:u}),t.restore()}(t,{line:i,target:r,above:f,below:p,area:n,scale:o,axis:a}),wd(t))}var Xg={id:"filler",afterDatasetsUpdate:function(t,e,n){var r,i,o,a,s=(t.data.datasets||[]).length,u=[];for(i=0;i<s;++i)a=null,(o=(r=t.getDatasetMeta(i)).dataset)&&o.options&&o instanceof _g&&(a={visible:t.isDatasetVisible(i),index:i,fill:Rg(o,i,s),chart:t,axis:r.controller.options.indexAxis,scale:r.vScale,line:o}),r.$filler=a,u.push(a);for(i=0;i<s;++i)(a=u[i])&&!1!==a.fill&&(a.fill=Ug(u,i,n.propagate))},beforeDraw:function(t,e,n){for(var r="beforeDraw"===n.drawTime,i=t.getSortedVisibleDatasetMetas(),o=t.chartArea,a=i.length-1;a>=0;--a){var s=i[a].$filler;s&&(s.line.updateControlPoints(o,s.axis),r&&Gg(t.ctx,s,o))}},beforeDatasetsDraw:function(t,e,n){if("beforeDatasetsDraw"===n.drawTime)for(var r=t.getSortedVisibleDatasetMetas(),i=r.length-1;i>=0;--i){var o=r[i].$filler;o&&Gg(t.ctx,o,t.chartArea)}},beforeDatasetDraw:function(t,e,n){var r=e.meta.$filler;r&&!1!==r.fill&&"beforeDatasetDraw"===n.drawTime&&Gg(t.ctx,r,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},Qg=function(t,e){var n=t.boxHeight,r=void 0===n?e:n,i=t.boxWidth,o=void 0===i?e:i;return t.usePointStyle&&(r=Math.min(r,e),o=Math.min(o,e)),{boxWidth:o,boxHeight:r,itemHeight:Math.max(e,r)}},ty=function(t){jp(n,t);var e=qp(n);function n(t){var r;return Xp(this,n),(r=e.call(this))._added=!1,r.legendHitBoxes=[],r._hoveredItem=null,r.doughnutMode=!1,r.chart=t.chart,r.options=t.options,r.ctx=t.ctx,r.legendItems=void 0,r.columnSizes=void 0,r.lineWidths=void 0,r.maxHeight=void 0,r.maxWidth=void 0,r.top=void 0,r.bottom=void 0,r.left=void 0,r.right=void 0,r.height=void 0,r.width=void 0,r._margins=void 0,r.position=void 0,r.weight=void 0,r.fullSize=void 0,r}return tv(n,[{key:"update",value:function(t,e,n){var r=this;r.maxWidth=t,r.maxHeight=e,r._margins=n,r.setDimensions(),r.buildLabels(),r.fit()}},{key:"setDimensions",value:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=t._margins.left,t.right=t.width):(t.height=t.maxHeight,t.top=t._margins.top,t.bottom=t.height)}},{key:"buildLabels",value:function(){var t=this,e=t.options.labels||{},n=Fh(e.generateLabels,[t.chart],t)||[];e.filter&&(n=n.filter((function(n){return e.filter(n,t.chart.data)}))),e.sort&&(n=n.sort((function(n,r){return e.sort(n,r,t.chart.data)}))),t.options.reverse&&n.reverse(),t.legendItems=n}},{key:"fit",value:function(){var t=this,e=t.options,n=t.ctx;if(e.display){var r,i,o=e.labels,a=Nd(o.font),s=a.size,u=t._computeTitleHeight(),c=Qg(o,s),l=c.boxWidth,h=c.itemHeight;n.font=a.string,t.isHorizontal()?(r=t.maxWidth,i=t._fitRows(u,s,l,h)+10):(i=t.maxHeight,r=t._fitCols(u,s,l,h)+10),t.width=Math.min(r,e.maxWidth||t.maxWidth),t.height=Math.min(i,e.maxHeight||t.maxHeight)}else t.width=t.height=0}},{key:"_fitRows",value:function(t,e,n,r){var i=this,o=i.ctx,a=i.maxWidth,s=i.options.labels.padding,u=i.legendHitBoxes=[],c=i.lineWidths=[0],l=r+s,h=t;o.textAlign="left",o.textBaseline="middle";var f=-1,d=-l;return i.legendItems.forEach((function(t,i){var p=n+e/2+o.measureText(t.text).width;(0===i||c[c.length-1]+p+2*s>a)&&(h+=l,c[c.length-(i>0?0:1)]=0,d+=l,f++),u[i]={left:0,top:d,row:f,width:p,height:r},c[c.length-1]+=p+s})),h}},{key:"_fitCols",value:function(t,e,n,r){var i=this,o=i.ctx,a=i.maxHeight,s=i.options.labels.padding,u=i.legendHitBoxes=[],c=i.columnSizes=[],l=a-t,h=s,f=0,d=0,p=0,v=0;return i.legendItems.forEach((function(t,i){var a=n+e/2+o.measureText(t.text).width;i>0&&d+r+2*s>l&&(h+=f+s,c.push({width:f,height:d}),p+=f+s,v++,f=d=0),u[i]={left:p,top:d,col:v,width:a,height:r},f=Math.max(f,a),d+=r+s})),h+=f,c.push({width:f,height:d}),h}},{key:"adjustHitBoxes",value:function(){var t=this;if(t.options.display){var e=t._computeTitleHeight(),n=t.legendHitBoxes,r=t.options,i=r.align,o=r.labels.padding,a=Mp(r.rtl,t.left,t.width);if(this.isHorizontal()){var s,u=0,c=Ah(i,t.left+o,t.right-t.lineWidths[u]),l=Zp(n);try{for(l.s();!(s=l.n()).done;){var h=s.value;u!==h.row&&(u=h.row,c=Ah(i,t.left+o,t.right-t.lineWidths[u])),h.top+=t.top+e+o,h.left=a.leftForLtr(a.x(c),h.width),c+=h.width+o}}catch(M_){l.e(M_)}finally{l.f()}}else{var f,d=0,p=Ah(i,t.top+e+o,t.bottom-t.columnSizes[d].height),v=Zp(n);try{for(v.s();!(f=v.n()).done;){var m=f.value;m.col!==d&&(d=m.col,p=Ah(i,t.top+e+o,t.bottom-t.columnSizes[d].height)),m.top=p,m.left+=t.left+o,m.left=a.leftForLtr(a.x(m.left),m.width),p+=m.height+o}}catch(M_){v.e(M_)}finally{v.f()}}}}},{key:"isHorizontal",value:function(){return"top"===this.options.position||"bottom"===this.options.position}},{key:"draw",value:function(){var t=this;if(t.options.display){var e=t.ctx;bd(e,t),t._draw(),wd(e)}}},{key:"_draw",value:function(){var t,e=this,n=e.options,r=e.columnSizes,i=e.lineWidths,o=e.ctx,a=n.align,s=n.labels,u=fd.color,c=Mp(n.rtl,e.left,e.width),l=Nd(s.font),h=s.color,f=s.padding,d=l.size,p=d/2;e.drawTitle(),o.textAlign=c.textAlign("left"),o.textBaseline="middle",o.lineWidth=.5,o.font=l.string;var v=Qg(s,d),m=v.boxWidth,g=v.boxHeight,y=v.itemHeight,b=e.isHorizontal(),w=this._computeTitleHeight();t=b?{x:Ah(a,e.left+f,e.right-i[0]),y:e.top+f+w,line:0}:{x:e.left+f,y:Ah(a,e.top+w+f,e.bottom-r[0].height),line:0},Ep(e.ctx,n.textDirection);var _=y+f;e.legendItems.forEach((function(v,x){o.strokeStyle=v.fontColor||h,o.fillStyle=v.fontColor||h;var k=o.measureText(v.text).width,S=c.textAlign(v.textAlign||(v.textAlign=s.textAlign)),C=m+p+k,M=t.x,E=t.y;c.setWidth(e.width),b?x>0&&M+C+f>e.right&&(E=t.y+=_,t.line++,M=t.x=Ah(a,e.left+f,e.right-i[t.line])):x>0&&E+_>e.bottom&&(M=t.x=M+r[t.line].width+f,t.line++,E=t.y=Ah(a,e.top+w+f,e.bottom-r[t.line].height)),function(t,e,n){if(!(isNaN(m)||m<=0||isNaN(g)||g<0)){o.save();var r=Bh(n.lineWidth,1);if(o.fillStyle=Bh(n.fillStyle,u),o.lineCap=Bh(n.lineCap,"butt"),o.lineDashOffset=Bh(n.lineDashOffset,0),o.lineJoin=Bh(n.lineJoin,"miter"),o.lineWidth=r,o.strokeStyle=Bh(n.strokeStyle,u),o.setLineDash(Bh(n.lineDash,[])),s.usePointStyle){var i={radius:m*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:r},a=c.xPlus(t,m/2);gd(o,i,a,e+p)}else{var l=e+Math.max((d-g)/2,0),h=c.leftForLtr(t,m),f=Pd(n.borderRadius);o.beginPath(),Object.values(f).some((function(t){return 0!==t}))?Md(o,{x:h,y:l,w:m,h:g,radius:f}):o.rect(h,l,m,g),o.fill(),0!==r&&o.stroke()}o.restore()}}(c.x(M),E,v),M=function(t,e,n,r){return t===(r?"left":"right")?n:"center"===t?(e+n)/2:e}(S,M+m+p,b?M+C:e.right,n.rtl),function(t,e,n){kd(o,n.text,t,e+y/2,l,{strikethrough:n.hidden,textAlign:c.textAlign(n.textAlign)})}(c.x(M),E,v),b?t.x+=C+f:t.y+=_})),Tp(e.ctx,n.textDirection)}},{key:"drawTitle",value:function(){var t=this,e=t.options,n=e.title,r=Nd(n.font),i=Ld(n.padding);if(n.display){var o,a=Mp(e.rtl,t.left,t.width),s=t.ctx,u=n.position,c=r.size/2,l=i.top+c,h=t.left,f=t.width;if(this.isHorizontal())f=Math.max.apply(Math,Yp(t.lineWidths)),o=t.top+l,h=Ah(e.align,h,t.right-f);else{var d=t.columnSizes.reduce((function(t,e){return Math.max(t,e.height)}),0);o=l+Ah(e.align,t.top,t.bottom-d-e.labels.padding-t._computeTitleHeight())}var p=Ah(u,h,h+f);s.textAlign=a.textAlign(Th(u)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,kd(s,n.text,p,o,r)}}},{key:"_computeTitleHeight",value:function(){var t=this.options.title,e=Nd(t.font),n=Ld(t.padding);return t.display?e.lineHeight+n.height:0}},{key:"_getLegendItemAt",value:function(t,e){var n,r,i,o=this;if(t>=o.left&&t<=o.right&&e>=o.top&&e<=o.bottom)for(i=o.legendHitBoxes,n=0;n<i.length;++n)if(t>=(r=i[n]).left&&t<=r.left+r.width&&e>=r.top&&e<=r.top+r.height)return o.legendItems[n];return null}},{key:"handleEvent",value:function(t){var e=this,n=e.options;if(function(t,e){if("mousemove"===t&&(e.onHover||e.onLeave))return!0;if(e.onClick&&("click"===t||"mouseup"===t))return!0;return!1}(t.type,n)){var r,i,o=e._getLegendItemAt(t.x,t.y);if("mousemove"===t.type){var a=e._hoveredItem,s=(i=o,null!==(r=a)&&null!==i&&r.datasetIndex===i.datasetIndex&&r.index===i.index);a&&!s&&Fh(n.onLeave,[t,a,e],e),e._hoveredItem=o,o&&!s&&Fh(n.onHover,[t,o,e],e)}else o&&Fh(n.onClick,[t,o,e],e)}}}]),n}(xm);var ey={id:"legend",_element:ty,start:function(t,e,n){var r=t.legend=new ty({ctx:t.ctx,options:n,chart:t});om(t,r,n),rm(t,r)},stop:function(t){im(t,t.legend),delete t.legend},beforeUpdate:function(t,e,n){var r=t.legend;om(t,r,n),r.options=n},afterUpdate:function(t){var e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent:function(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick:function(t,e,n){var r=e.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),e.hidden=!0):(i.show(r),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:function(t){return t.chart.options.color},boxWidth:40,padding:10,generateLabels:function(t){var e=t.data.datasets,n=t.legend.options.labels,r=n.usePointStyle,i=n.pointStyle,o=n.textAlign,a=n.color;return t._getSortedDatasetMetas().map((function(t){var n=t.controller.getStyle(r?0:void 0),s=Ld(n.borderWidth);return{text:e[t.index].label,fillStyle:n.backgroundColor,fontColor:a,hidden:!t.visible,lineCap:n.borderCapStyle,lineDash:n.borderDash,lineDashOffset:n.borderDashOffset,lineJoin:n.borderJoinStyle,lineWidth:(s.width+s.height)/4,strokeStyle:n.borderColor,pointStyle:i||n.pointStyle,rotation:n.rotation,textAlign:o||n.textAlign,borderRadius:0,datasetIndex:t.index}}),this)}},title:{color:function(t){return t.chart.options.color},display:!1,position:"center",text:""}},descriptors:{_scriptable:function(t){return!t.startsWith("on")},labels:{_scriptable:function(t){return!["generateLabels","filter","sort"].includes(t)}}}},ny=function(t){jp(n,t);var e=qp(n);function n(t){var r;return Xp(this,n),(r=e.call(this)).chart=t.chart,r.options=t.options,r.ctx=t.ctx,r._padding=void 0,r.top=void 0,r.bottom=void 0,r.left=void 0,r.right=void 0,r.width=void 0,r.height=void 0,r.position=void 0,r.weight=void 0,r.fullSize=void 0,r}return tv(n,[{key:"update",value:function(t,e){var n=this,r=n.options;if(n.left=0,n.top=0,r.display){n.width=n.right=t,n.height=n.bottom=e;var i=Nh(r.text)?r.text.length:1;n._padding=Ld(r.padding);var o=i*Nd(r.font).lineHeight+n._padding.height;n.isHorizontal()?n.height=o:n.width=o}else n.width=n.height=n.right=n.bottom=0}},{key:"isHorizontal",value:function(){var t=this.options.position;return"top"===t||"bottom"===t}},{key:"_drawArgs",value:function(t){var e,n,r,i=this.top,o=this.left,a=this.bottom,s=this.right,u=this.options,c=u.align,l=0;return this.isHorizontal()?(n=Ah(c,o,s),r=i+t,e=s-o):("left"===u.position?(n=o+t,r=Ah(c,a,i),l=-.5*tf):(n=s-t,r=Ah(c,i,a),l=.5*tf),e=a-i),{titleX:n,titleY:r,maxWidth:e,rotation:l}}},{key:"draw",value:function(){var t=this,e=t.ctx,n=t.options;if(n.display){var r=Nd(n.font),i=r.lineHeight/2+t._padding.top,o=t._drawArgs(i),a=o.titleX,s=o.titleY,u=o.maxWidth,c=o.rotation;kd(e,n.text,0,0,r,{color:n.color,maxWidth:u,rotation:c,textAlign:Th(n.align),textBaseline:"middle",translation:[a,s]})}}}]),n}(xm);var ry={id:"title",_element:ny,start:function(t,e,n){!function(t,e){var n=new ny({ctx:t.ctx,options:e,chart:t});om(t,n,e),rm(t,n),t.titleBlock=n}(t,n)},stop:function(t){var e=t.titleBlock;im(t,e),delete t.titleBlock},beforeUpdate:function(t,e,n){var r=t.titleBlock;om(t,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},iy=new WeakMap,oy={id:"subtitle",start:function(t,e,n){var r=new ny({ctx:t.ctx,options:n,chart:t});om(t,r,n),rm(t,r),iy.set(t,r)},stop:function(t){im(t,iy.get(t)),iy.delete(t)},beforeUpdate:function(t,e,n){var r=iy.get(t);om(t,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},ay={average:function(t){if(!t.length)return!1;var e,n,r=0,i=0,o=0;for(e=0,n=t.length;e<n;++e){var a=t[e].element;if(a&&a.hasValue()){var s=a.tooltipPosition();r+=s.x,i+=s.y,++o}}return{x:r/o,y:i/o}},nearest:function(t,e){if(!t.length)return!1;var n,r,i,o=e.x,a=e.y,s=Number.POSITIVE_INFINITY;for(n=0,r=t.length;n<r;++n){var u=t[n].element;if(u&&u.hasValue()){var c=yf(e,u.getCenterPoint());c<s&&(s=c,i=u)}}if(i){var l=i.tooltipPosition();o=l.x,a=l.y}return{x:o,y:a}}};function sy(t,e){return e&&(Nh(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function uy(t){return("string"===typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function cy(t,e){var n=t._chart.ctx,r=t.body,i=t.footer,o=t.title,a=e.boxWidth,s=e.boxHeight,u=Nd(e.bodyFont),c=Nd(e.titleFont),l=Nd(e.footerFont),h=o.length,f=i.length,d=r.length,p=Ld(e.padding),v=p.height,m=0,g=r.reduce((function(t,e){return t+e.before.length+e.lines.length+e.after.length}),0);(g+=t.beforeBody.length+t.afterBody.length,h&&(v+=h*c.lineHeight+(h-1)*e.titleSpacing+e.titleMarginBottom),g)&&(v+=d*(e.displayColors?Math.max(s,u.lineHeight):u.lineHeight)+(g-d)*u.lineHeight+(g-1)*e.bodySpacing);f&&(v+=e.footerMarginTop+f*l.lineHeight+(f-1)*e.footerSpacing);var y=0,b=function(t){m=Math.max(m,n.measureText(t).width+y)};return n.save(),n.font=c.string,qh(t.title,b),n.font=u.string,qh(t.beforeBody.concat(t.afterBody),b),y=e.displayColors?a+2:0,qh(r,(function(t){qh(t.before,b),qh(t.lines,b),qh(t.after,b)})),y=0,n.font=l.string,qh(t.footer,b),n.restore(),{width:m+=p.width,height:v}}function ly(t,e,n,r){var i=n.x,o=n.width,a=t.width,s=t.chartArea,u=s.left,c=s.right,l="center";return"center"===r?l=i<=(u+c)/2?"left":"right":i<=o/2?l="left":i>=a-o/2&&(l="right"),function(t,e,n,r){var i=r.x,o=r.width,a=n.caretSize+n.caretPadding;return"left"===t&&i+o+a>e.width||"right"===t&&i-o-a<0||void 0}(l,t,e,n)&&(l="center"),l}function hy(t,e,n){var r=e.yAlign||function(t,e){var n=e.y,r=e.height;return n<r/2?"top":n>t.height-r/2?"bottom":"center"}(t,n);return{xAlign:e.xAlign||ly(t,e,n,r),yAlign:r}}function fy(t,e,n,r){var i=t.caretSize,o=t.caretPadding,a=t.cornerRadius,s=n.xAlign,u=n.yAlign,c=i+o,l=a+o,h=function(t,e){var n=t.x,r=t.width;return"right"===e?n-=r:"center"===e&&(n-=r/2),n}(e,s),f=function(t,e,n){var r=t.y,i=t.height;return"top"===e?r+=n:r-="bottom"===e?i+n:i/2,r}(e,u,c);return"center"===u?"left"===s?h+=c:"right"===s&&(h-=c):"left"===s?h-=l:"right"===s&&(h+=l),{x:xf(h,0,r.width-e.width),y:xf(f,0,r.height-e.height)}}function dy(t,e,n){var r=Ld(n.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-r.right:t.x+r.left}function py(t){return sy([],uy(t))}function vy(t,e){var n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}var my=function(t){jp(n,t);var e=qp(n);function n(t){var r;return Xp(this,n),(r=e.call(this)).opacity=0,r._active=[],r._chart=t._chart,r._eventPosition=void 0,r._size=void 0,r._cachedAnimations=void 0,r._tooltipItems=[],r.$animations=void 0,r.$context=void 0,r.options=t.options,r.dataPoints=void 0,r.title=void 0,r.beforeBody=void 0,r.body=void 0,r.afterBody=void 0,r.footer=void 0,r.xAlign=void 0,r.yAlign=void 0,r.x=void 0,r.y=void 0,r.height=void 0,r.width=void 0,r.caretX=void 0,r.caretY=void 0,r.labelColors=void 0,r.labelPointStyles=void 0,r.labelTextColors=void 0,r}return tv(n,[{key:"initialize",value:function(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}},{key:"_resolveAnimations",value:function(){var t=this,e=t._cachedAnimations;if(e)return e;var n=t._chart,r=t.options.setContext(t.getContext()),i=r.enabled&&n.options.animation&&r.animations,o=new av(t._chart,i);return i._cacheable&&(t._cachedAnimations=Object.freeze(o)),o}},{key:"getContext",value:function(){var t,e,n,r=this;return r.$context||(r.$context=(t=r._chart.getContext(),e=r,n=r._tooltipItems,Object.assign(Object.create(t),{tooltip:e,tooltipItems:n,type:"tooltip"})))}},{key:"getTitle",value:function(t,e){var n=this,r=e.callbacks,i=r.beforeTitle.apply(n,[t]),o=r.title.apply(n,[t]),a=r.afterTitle.apply(n,[t]),s=[];return s=sy(s,uy(i)),s=sy(s,uy(o)),s=sy(s,uy(a))}},{key:"getBeforeBody",value:function(t,e){return py(e.callbacks.beforeBody.apply(this,[t]))}},{key:"getBody",value:function(t,e){var n=this,r=e.callbacks,i=[];return qh(t,(function(t){var e={before:[],lines:[],after:[]},o=vy(r,t);sy(e.before,uy(o.beforeLabel.call(n,t))),sy(e.lines,o.label.call(n,t)),sy(e.after,uy(o.afterLabel.call(n,t))),i.push(e)})),i}},{key:"getAfterBody",value:function(t,e){return py(e.callbacks.afterBody.apply(this,[t]))}},{key:"getFooter",value:function(t,e){var n=this,r=e.callbacks,i=r.beforeFooter.apply(n,[t]),o=r.footer.apply(n,[t]),a=r.afterFooter.apply(n,[t]),s=[];return s=sy(s,uy(i)),s=sy(s,uy(o)),s=sy(s,uy(a))}},{key:"_createItems",value:function(t){var e,n,r,i,o,a,s,u,c,l,h,f=this,d=f._active,p=f._chart.data,v=[],m=[],g=[],y=[];for(e=0,n=d.length;e<n;++e)y.push((r=f._chart,i=d[e],o=void 0,a=void 0,s=void 0,u=void 0,c=void 0,l=void 0,h=void 0,o=i.element,a=i.datasetIndex,s=i.index,u=r.getDatasetMeta(a).controller,c=u.getLabelAndValue(s),l=c.label,h=c.value,{chart:r,label:l,parsed:u.getParsed(s),raw:r.data.datasets[a].data[s],formattedValue:h,dataset:u.getDataset(),dataIndex:s,datasetIndex:a,element:o}));return t.filter&&(y=y.filter((function(e,n,r){return t.filter(e,n,r,p)}))),t.itemSort&&(y=y.sort((function(e,n){return t.itemSort(e,n,p)}))),qh(y,(function(e){var n=vy(t.callbacks,e);v.push(n.labelColor.call(f,e)),m.push(n.labelPointStyle.call(f,e)),g.push(n.labelTextColor.call(f,e))})),f.labelColors=v,f.labelPointStyles=m,f.labelTextColors=g,f.dataPoints=y,y}},{key:"update",value:function(t,e){var n,r=this,i=r.options.setContext(r.getContext()),o=r._active,a=[];if(o.length){var s=ay[i.position].call(r,o,r._eventPosition);a=r._createItems(i),r.title=r.getTitle(a,i),r.beforeBody=r.getBeforeBody(a,i),r.body=r.getBody(a,i),r.afterBody=r.getAfterBody(a,i),r.footer=r.getFooter(a,i);var u=r._size=cy(r,i),c=Object.assign({},s,u),l=hy(r._chart,i,c),h=fy(i,c,l,r._chart);r.xAlign=l.xAlign,r.yAlign=l.yAlign,n={opacity:1,x:h.x,y:h.y,width:u.width,height:u.height,caretX:s.x,caretY:s.y}}else 0!==r.opacity&&(n={opacity:0});r._tooltipItems=a,r.$context=void 0,n&&r._resolveAnimations().update(r,n),t&&i.external&&i.external.call(r,{chart:r._chart,tooltip:r,replay:e})}},{key:"drawCaret",value:function(t,e,n,r){var i=this.getCaretPosition(t,n,r);e.lineTo(i.x1,i.y1),e.lineTo(i.x2,i.y2),e.lineTo(i.x3,i.y3)}},{key:"getCaretPosition",value:function(t,e,n){var r,i,o,a,s,u,c=this.xAlign,l=this.yAlign,h=n.cornerRadius,f=n.caretSize,d=t.x,p=t.y,v=e.width,m=e.height;return"center"===l?(s=p+m/2,"left"===c?(i=(r=d)-f,a=s+f,u=s-f):(i=(r=d+v)+f,a=s-f,u=s+f),o=r):(i="left"===c?d+h+f:"right"===c?d+v-h-f:this.caretX,"top"===l?(s=(a=p)-f,r=i-f,o=i+f):(s=(a=p+m)+f,r=i+f,o=i-f),u=a),{x1:r,x2:i,x3:o,y1:a,y2:s,y3:u}}},{key:"drawTitle",value:function(t,e,n){var r,i,o,a=this,s=a.title,u=s.length;if(u){var c=Mp(n.rtl,a.x,a.width);for(t.x=dy(a,n.titleAlign,n),e.textAlign=c.textAlign(n.titleAlign),e.textBaseline="middle",r=Nd(n.titleFont),i=n.titleSpacing,e.fillStyle=n.titleColor,e.font=r.string,o=0;o<u;++o)e.fillText(s[o],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i,o+1===u&&(t.y+=n.titleMarginBottom-i)}}},{key:"_drawColorBox",value:function(t,e,n,r,i){var o=this,a=o.labelColors[n],s=o.labelPointStyles[n],u=i.boxHeight,c=i.boxWidth,l=Nd(i.bodyFont),h=dy(o,"left",i),f=r.x(h),d=u<l.lineHeight?(l.lineHeight-u)/2:0,p=e.y+d;if(i.usePointStyle){var v={radius:Math.min(c,u)/2,pointStyle:s.pointStyle,rotation:s.rotation,borderWidth:1},m=r.leftForLtr(f,c)+c/2,g=p+u/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,gd(t,v,m,g),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,gd(t,v,m,g)}else{t.lineWidth=a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;var y=r.leftForLtr(f,c),b=r.leftForLtr(r.xPlus(f,1),c-2),w=Pd(a.borderRadius);Object.values(w).some((function(t){return 0!==t}))?(t.beginPath(),t.fillStyle=i.multiKeyBackground,Md(t,{x:y,y:p,w:c,h:u,radius:w}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Md(t,{x:b,y:p+1,w:c-2,h:u-2,radius:w}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(y,p,c,u),t.strokeRect(y,p,c,u),t.fillStyle=a.backgroundColor,t.fillRect(b,p+1,c-2,u-2))}t.fillStyle=o.labelTextColors[n]}},{key:"drawBody",value:function(t,e,n){var r,i,o,a,s,u,c,l=this,h=l.body,f=n.bodySpacing,d=n.bodyAlign,p=n.displayColors,v=n.boxHeight,m=n.boxWidth,g=Nd(n.bodyFont),y=g.lineHeight,b=0,w=Mp(n.rtl,l.x,l.width),_=function(n){e.fillText(n,w.x(t.x+b),t.y+y/2),t.y+=y+f},x=w.textAlign(d);for(e.textAlign=d,e.textBaseline="middle",e.font=g.string,t.x=dy(l,x,n),e.fillStyle=n.bodyColor,qh(l.beforeBody,_),b=p&&"right"!==x?"center"===d?m/2+1:m+2:0,a=0,u=h.length;a<u;++a){for(r=h[a],i=l.labelTextColors[a],e.fillStyle=i,qh(r.before,_),o=r.lines,p&&o.length&&(l._drawColorBox(e,t,a,w,n),y=Math.max(g.lineHeight,v)),s=0,c=o.length;s<c;++s)_(o[s]),y=g.lineHeight;qh(r.after,_)}b=0,y=g.lineHeight,qh(l.afterBody,_),t.y-=f}},{key:"drawFooter",value:function(t,e,n){var r,i,o=this,a=o.footer,s=a.length;if(s){var u=Mp(n.rtl,o.x,o.width);for(t.x=dy(o,n.footerAlign,n),t.y+=n.footerMarginTop,e.textAlign=u.textAlign(n.footerAlign),e.textBaseline="middle",r=Nd(n.footerFont),e.fillStyle=n.footerColor,e.font=r.string,i=0;i<s;++i)e.fillText(a[i],u.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+n.footerSpacing}}},{key:"drawBackground",value:function(t,e,n,r){var i=this.xAlign,o=this.yAlign,a=t.x,s=t.y,u=n.width,c=n.height,l=r.cornerRadius;e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(a+l,s),"top"===o&&this.drawCaret(t,e,n,r),e.lineTo(a+u-l,s),e.quadraticCurveTo(a+u,s,a+u,s+l),"center"===o&&"right"===i&&this.drawCaret(t,e,n,r),e.lineTo(a+u,s+c-l),e.quadraticCurveTo(a+u,s+c,a+u-l,s+c),"bottom"===o&&this.drawCaret(t,e,n,r),e.lineTo(a+l,s+c),e.quadraticCurveTo(a,s+c,a,s+c-l),"center"===o&&"left"===i&&this.drawCaret(t,e,n,r),e.lineTo(a,s+l),e.quadraticCurveTo(a,s,a+l,s),e.closePath(),e.fill(),r.borderWidth>0&&e.stroke()}},{key:"_updateAnimationTarget",value:function(t){var e=this,n=e._chart,r=e.$animations,i=r&&r.x,o=r&&r.y;if(i||o){var a=ay[t.position].call(e,e._active,e._eventPosition);if(!a)return;var s=e._size=cy(e,t),u=Object.assign({},a,e._size),c=hy(n,t,u),l=fy(t,u,c,n);i._to===l.x&&o._to===l.y||(e.xAlign=c.xAlign,e.yAlign=c.yAlign,e.width=s.width,e.height=s.height,e.caretX=a.x,e.caretY=a.y,e._resolveAnimations().update(e,l))}}},{key:"draw",value:function(t){var e=this,n=e.options.setContext(e.getContext()),r=e.opacity;if(r){e._updateAnimationTarget(n);var i={width:e.width,height:e.height},o={x:e.x,y:e.y};r=Math.abs(r)<.001?0:r;var a=Ld(n.padding),s=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;n.enabled&&s&&(t.save(),t.globalAlpha=r,e.drawBackground(o,t,i,n),Ep(t,n.textDirection),o.y+=a.top,e.drawTitle(o,t,n),e.drawBody(o,t,n),e.drawFooter(o,t,n),Tp(t,n.textDirection),t.restore())}}},{key:"getActiveElements",value:function(){return this._active||[]}},{key:"setActiveElements",value:function(t,e){var n=this,r=n._active,i=t.map((function(t){var e=t.datasetIndex,r=t.index,i=n._chart.getDatasetMeta(e);if(!i)throw new Error("Cannot find a dataset at index "+e);return{datasetIndex:e,element:i.data[r],index:r}})),o=!$h(r,i),a=n._positionChanged(i,e);(o||a)&&(n._active=i,n._eventPosition=e,n.update(!0))}},{key:"handleEvent",value:function(t,e){var n,r=this,i=r.options,o=r._active||[],a=[];"mouseout"!==t.type&&(a=r._chart.getElementsAtEventForMode(t,i.mode,i,e),i.reverse&&a.reverse());var s=r._positionChanged(a,t);return(n=e||!$h(a,o)||s)&&(r._active=a,(i.enabled||i.external)&&(r._eventPosition={x:t.x,y:t.y},r.update(!0,e))),n}},{key:"_positionChanged",value:function(t,e){var n=this.caretX,r=this.caretY,i=this.options,o=ay[i.position].call(this,t,e);return!1!==o&&(n!==o.x||r!==o.y)}}]),n}(xm);my.positioners=ay;var gy={id:"tooltip",_element:my,positioners:ay,afterInit:function(t,e,n){n&&(t.tooltip=new my({_chart:t,options:n}))},beforeUpdate:function(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset:function(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw:function(t){var e=t.tooltip,n={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",n)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n))},afterEvent:function(t,e){if(t.tooltip){var n=e.replay;t.tooltip.handleEvent(e.event,n)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:function(t,e){return e.bodyFont.size},boxWidth:function(t,e){return e.bodyFont.size},multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:Oh,title:function(t){if(t.length>0){var e=t[0],n=e.chart.data.labels,r=n?n.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex<r)return n[e.dataIndex]}return""},afterTitle:Oh,beforeBody:Oh,beforeLabel:Oh,label:function(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;var e=t.dataset.label||"";e&&(e+=": ");var n=t.formattedValue;return Lh(n)||(e+=n),e},labelColor:function(t){var e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor:function(){return this.options.bodyColor},labelPointStyle:function(t){var e=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Oh,afterBody:Oh,beforeFooter:Oh,footer:Oh,afterFooter:Oh}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:function(t){return"filter"!==t&&"itemSort"!==t&&"external"!==t},_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},yy=Object.freeze({__proto__:null,Decimation:Ng,Filler:Xg,Legend:ey,SubTitle:oy,Title:ry,Tooltip:gy});function by(t,e,n){var r=t.indexOf(e);return-1===r?function(t,e,n){return"string"===typeof e?t.push(e)-1:isNaN(e)?null:n}(t,e,n):r!==t.lastIndexOf(e)?n:r}var wy=function(t){jp(n,t);var e=qp(n);function n(t){var r;return Xp(this,n),(r=e.call(this,t))._startValue=void 0,r._valueRange=0,r}return tv(n,[{key:"parse",value:function(t,e){if(Lh(t))return null;var n=this.getLabels();return function(t,e){return null===t?null:xf(Math.round(t),0,e)}(e=isFinite(e)&&n[e]===t?e:by(n,t,Bh(e,t)),n.length-1)}},{key:"determineDataLimits",value:function(){var t=this,e=t.getUserBounds(),n=e.minDefined,r=e.maxDefined,i=t.getMinMax(!0),o=i.min,a=i.max;"ticks"===t.options.bounds&&(n||(o=0),r||(a=t.getLabels().length-1)),t.min=o,t.max=a}},{key:"buildTicks",value:function(){var t=this,e=t.min,n=t.max,r=t.options.offset,i=[],o=t.getLabels();o=0===e&&n===o.length-1?o:o.slice(e,n+1),t._valueRange=Math.max(o.length-(r?0:1),1),t._startValue=t.min-(r?.5:0);for(var a=e;a<=n;a++)i.push({value:a});return i}},{key:"getLabelForValue",value:function(t){var e=this.getLabels();return t>=0&&t<e.length?e[t]:t}},{key:"configure",value:function(){var t=this;Bp(Up(n.prototype),"configure",this).call(this),t.isHorizontal()||(t._reversePixels=!t._reversePixels)}},{key:"getPixelForValue",value:function(t){var e=this;return"number"!==typeof t&&(t=e.parse(t)),null===t?NaN:e.getPixelForDecimal((t-e._startValue)/e._valueRange)}},{key:"getPixelForTick",value:function(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}},{key:"getValueForPixel",value:function(t){var e=this;return Math.round(e._startValue+e.getDecimalForPixel(t)*e._valueRange)}},{key:"getBasePixel",value:function(){return this.bottom}}]),n}(Lm);function _y(t,e){var n,r,i,o,a,s,u,c=[],l=t.bounds,h=t.step,f=t.min,d=t.max,p=t.precision,v=t.count,m=t.maxTicks,g=t.maxDigits,y=t.includeBounds,b=h||1,w=m-1,_=e.min,x=e.max,k=!Lh(f),S=!Lh(d),C=!Lh(v),M=(x-_)/(g+1),E=hf((x-_)/w/b)*b;if(E<1e-14&&!k&&!S)return[{value:_},{value:x}];(o=Math.ceil(x/E)-Math.floor(_/E))>w&&(E=hf(o*E/w/b)*b),Lh(p)||(n=Math.pow(10,p),E=Math.ceil(E*n)/n),"ticks"===l?(r=Math.floor(_/E)*E,i=Math.ceil(x/E)*E):(r=_,i=x),k&&S&&h&&(a=(d-f)/h,s=E/1e3,(u=Math.round(a))-s<=a&&u+s>=a)?(E=(d-f)/(o=Math.round(Math.min((d-f)/E,m))),r=f,i=d):C?E=((i=S?d:i)-(r=k?f:r))/(o=v-1):o=df(o=(i-r)/E,Math.round(o),E/1e3)?Math.round(o):Math.ceil(o);var T=Math.max(gf(E),gf(r));n=Math.pow(10,Lh(p)?T:p),r=Math.round(r*n)/n,i=Math.round(i*n)/n;var A=0;for(k&&(y&&r!==f?(c.push({value:f}),r<f&&A++,df(Math.round((r+A*E)*n)/n,f,xy(f,M,t))&&A++):r<f&&A++);A<o;++A)c.push({value:Math.round((r+A*E)*n)/n});return S&&y&&i!==d?df(c[c.length-1].value,d,xy(d,M,t))?c[c.length-1].value=d:c.push({value:d}):S&&i!==d||c.push({value:i}),c}function xy(t,e,n){var r=n.horizontal,i=vf(n.minRotation),o=(r?Math.sin(i):Math.cos(i))||.001,a=.75*e*(""+t).length;return Math.min(e/o,a)}wy.id="category",wy.defaults={ticks:{callback:wy.prototype.getLabelForValue}};var ky=function(t){jp(n,t);var e=qp(n);function n(t){var r;return Xp(this,n),(r=e.call(this,t)).start=void 0,r.end=void 0,r._startValue=void 0,r._endValue=void 0,r._valueRange=0,r}return tv(n,[{key:"parse",value:function(t,e){return Lh(t)||("number"===typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}},{key:"handleTickRangeOptions",value:function(){var t=this,e=t.options.beginAtZero,n=t.getUserBounds(),r=n.minDefined,i=n.maxDefined,o=t.min,a=t.max,s=function(t){return o=r?o:t},u=function(t){return a=i?a:t};if(e){var c=lf(o),l=lf(a);c<0&&l<0?u(0):c>0&&l>0&&s(0)}if(o===a){var h=1;(a>=Number.MAX_SAFE_INTEGER||o<=Number.MIN_SAFE_INTEGER)&&(h=Math.abs(.05*a)),u(a+h),e||s(o-h)}t.min=o,t.max=a}},{key:"getTickLimit",value:function(){var t,e=this,n=e.options.ticks,r=n.maxTicksLimit,i=n.stepSize;return i?t=Math.ceil(e.max/i)-Math.floor(e.min/i)+1:(t=e.computeTickLimit(),r=r||11),r&&(t=Math.min(r,t)),t}},{key:"computeTickLimit",value:function(){return Number.POSITIVE_INFINITY}},{key:"buildTicks",value:function(){var t=this,e=t.options,n=e.ticks,r=t.getTickLimit(),i=_y({maxTicks:r=Math.max(2,r),bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:t._maxDigits(),horizontal:t.isHorizontal(),minRotation:n.minRotation||0,includeBounds:!1!==n.includeBounds},t._range||t);return"ticks"===e.bounds&&pf(i,t,"value"),e.reverse?(i.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),i}},{key:"configure",value:function(){var t=this,e=t.ticks,r=t.min,i=t.max;if(Bp(Up(n.prototype),"configure",this).call(this),t.options.offset&&e.length){var o=(i-r)/Math.max(e.length-1,1)/2;r-=o,i+=o}t._startValue=r,t._endValue=i,t._valueRange=i-r}},{key:"getLabelForValue",value:function(t){return Cp(t,this.chart.options.locale)}}]),n}(Lm),Sy=function(t){jp(n,t);var e=qp(n);function n(){return Xp(this,n),e.apply(this,arguments)}return tv(n,[{key:"determineDataLimits",value:function(){var t=this,e=t.getMinMax(!0),n=e.min,r=e.max;t.min=Ih(n)?n:0,t.max=Ih(r)?r:1,t.handleTickRangeOptions()}},{key:"computeTickLimit",value:function(){var t=this,e=t.isHorizontal(),n=e?t.width:t.height,r=vf(t.options.ticks.minRotation),i=(e?Math.sin(r):Math.cos(r))||.001,o=t._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}},{key:"getPixelForValue",value:function(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}},{key:"getValueForPixel",value:function(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}]),n}(ky);function Cy(t){return 1===t/Math.pow(10,Math.floor(cf(t)))}Sy.id="linear",Sy.defaults={ticks:{callback:Sm.formatters.numeric}};var My=function(t){jp(n,t);var e=qp(n);function n(t){var r;return Xp(this,n),(r=e.call(this,t)).start=void 0,r.end=void 0,r._startValue=void 0,r._valueRange=0,r}return tv(n,[{key:"parse",value:function(t,e){var n=ky.prototype.parse.apply(this,[t,e]);if(0!==n)return Ih(n)&&n>0?n:null;this._zero=!0}},{key:"determineDataLimits",value:function(){var t=this,e=t.getMinMax(!0),n=e.min,r=e.max;t.min=Ih(n)?Math.max(0,n):null,t.max=Ih(r)?Math.max(0,r):null,t.options.beginAtZero&&(t._zero=!0),t.handleTickRangeOptions()}},{key:"handleTickRangeOptions",value:function(){var t=this,e=t.getUserBounds(),n=e.minDefined,r=e.maxDefined,i=t.min,o=t.max,a=function(t){return i=n?i:t},s=function(t){return o=r?o:t},u=function(t,e){return Math.pow(10,Math.floor(cf(t))+e)};i===o&&(i<=0?(a(1),s(10)):(a(u(i,-1)),s(u(o,1)))),i<=0&&a(u(o,-1)),o<=0&&s(u(i,1)),t._zero&&t.min!==t._suggestedMin&&i===u(t.min,0)&&a(u(i,-1)),t.min=i,t.max=o}},{key:"buildTicks",value:function(){var t=this,e=t.options,n=function(t,e){var n=Math.floor(cf(e.max)),r=Math.ceil(e.max/Math.pow(10,n)),i=[],o=zh(t.min,Math.pow(10,Math.floor(cf(e.min)))),a=Math.floor(cf(o)),s=Math.floor(o/Math.pow(10,a)),u=a<0?Math.pow(10,Math.abs(a)):1;do{i.push({value:o,major:Cy(o)}),10===++s&&(s=1,u=++a>=0?1:u),o=Math.round(s*Math.pow(10,a)*u)/u}while(a<n||a===n&&s<r);var c=zh(t.max,o);return i.push({value:c,major:Cy(o)}),i}({min:t._userMin,max:t._userMax},t);return"ticks"===e.bounds&&pf(n,t,"value"),e.reverse?(n.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),n}},{key:"getLabelForValue",value:function(t){return void 0===t?"0":Cp(t,this.chart.options.locale)}},{key:"configure",value:function(){var t=this,e=t.min;Bp(Up(n.prototype),"configure",this).call(this),t._startValue=cf(e),t._valueRange=cf(t.max)-cf(e)}},{key:"getPixelForValue",value:function(t){var e=this;return void 0!==t&&0!==t||(t=e.min),null===t||isNaN(t)?NaN:e.getPixelForDecimal(t===e.min?0:(cf(t)-e._startValue)/e._valueRange)}},{key:"getValueForPixel",value:function(t){var e=this,n=e.getDecimalForPixel(t);return Math.pow(10,e._startValue+n*e._valueRange)}}]),n}(Lm);function Ey(t){var e=t.ticks;if(e.display&&t.display){var n=Ld(e.backdropPadding);return Bh(e.font&&e.font.size,fd.font.size)+n.height}return 0}function Ty(t,e,n,r,i){return t===r||t===i?{start:e-n/2,end:e+n/2}:t<r||t>i?{start:e-n,end:e}:{start:e,end:e+n}}function Ay(t){for(var e,n,r,i={l:0,r:t.width,t:0,b:t.height-t.paddingTop},o={},a=[],s=[],u=t.getLabels().length,c=0;c<u;c++){var l=t.options.pointLabels.setContext(t.getPointLabelContext(c));s[c]=l.padding;var h=t.getPointPosition(c,t.drawingArea+s[c]),f=Nd(l.font),d=(e=t.ctx,n=f,r=Nh(r=t._pointLabels[c])?r:[r],{w:pd(e,n.string,r),h:r.length*n.lineHeight});a[c]=d;var p=t.getIndexAngle(c),v=mf(p),m=Ty(v,h.x,d.w,0,180),g=Ty(v,h.y,d.h,90,270);m.start<i.l&&(i.l=m.start,o.l=p),m.end>i.r&&(i.r=m.end,o.r=p),g.start<i.t&&(i.t=g.start,o.t=p),g.end>i.b&&(i.b=g.end,o.b=p)}t._setReductions(t.drawingArea,i,o),t._pointLabelItems=function(t,e,n){for(var r=[],i=t.getLabels().length,o=t.options,a=Ey(o),s=t.getDistanceFromCenterForValue(o.ticks.reverse?t.min:t.max),u=0;u<i;u++){var c=0===u?a/2:0,l=t.getPointPosition(u,s+c+n[u]),h=mf(t.getIndexAngle(u)),f=e[u],d=Py(l.y,f.h,h),p=Oy(h),v=Dy(l.x,f.w,p);r.push({x:l.x,y:d,textAlign:p,left:v,top:d,right:v+f.w,bottom:d+f.h})}return r}(t,a,s)}function Oy(t){return 0===t||180===t?"center":t<180?"left":"right"}function Dy(t,e,n){return"right"===n?t-=e:"center"===n&&(t-=e/2),t}function Py(t,e,n){return 90===n||270===n?t-=e/2:(n>270||n<90)&&(t-=e),t}function Ly(t,e,n,r){var i=t.ctx;if(n)i.arc(t.xCenter,t.yCenter,e,0,ef);else{var o=t.getPointPosition(0,e);i.moveTo(o.x,o.y);for(var a=1;a<r;a++)o=t.getPointPosition(a,e),i.lineTo(o.x,o.y)}}function Ny(t){return ff(t)?t:0}My.id="logarithmic",My.defaults={ticks:{callback:Sm.formatters.logarithmic,major:{enabled:!0}}};var Ry=function(t){jp(n,t);var e=qp(n);function n(t){var r;return Xp(this,n),(r=e.call(this,t)).xCenter=void 0,r.yCenter=void 0,r.drawingArea=void 0,r._pointLabels=[],r._pointLabelItems=[],r}return tv(n,[{key:"setDimensions",value:function(){var t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=Ey(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2}},{key:"determineDataLimits",value:function(){var t=this,e=t.getMinMax(!1),n=e.min,r=e.max;t.min=Ih(n)&&!isNaN(n)?n:0,t.max=Ih(r)&&!isNaN(r)?r:0,t.handleTickRangeOptions()}},{key:"computeTickLimit",value:function(){return Math.ceil(this.drawingArea/Ey(this.options))}},{key:"generateTickLabels",value:function(t){var e=this;ky.prototype.generateTickLabels.call(e,t),e._pointLabels=e.getLabels().map((function(t,n){var r=Fh(e.options.pointLabels.callback,[t,n],e);return r||0===r?r:""}))}},{key:"fit",value:function(){var t=this,e=t.options;e.display&&e.pointLabels.display?Ay(t):t.setCenterPoint(0,0,0,0)}},{key:"_setReductions",value:function(t,e,n){var r=this,i=e.l/Math.sin(n.l),o=Math.max(e.r-r.width,0)/Math.sin(n.r),a=-e.t/Math.cos(n.t),s=-Math.max(e.b-(r.height-r.paddingTop),0)/Math.cos(n.b);i=Ny(i),o=Ny(o),a=Ny(a),s=Ny(s),r.drawingArea=Math.max(t/2,Math.min(Math.floor(t-(i+o)/2),Math.floor(t-(a+s)/2))),r.setCenterPoint(i,o,a,s)}},{key:"setCenterPoint",value:function(t,e,n,r){var i=this,o=i.width-e-i.drawingArea,a=t+i.drawingArea,s=n+i.drawingArea,u=i.height-i.paddingTop-r-i.drawingArea;i.xCenter=Math.floor((a+o)/2+i.left),i.yCenter=Math.floor((s+u)/2+i.top+i.paddingTop)}},{key:"getIndexAngle",value:function(t){return wf(t*(ef/this.getLabels().length)+vf(this.options.startAngle||0))}},{key:"getDistanceFromCenterForValue",value:function(t){var e=this;if(Lh(t))return NaN;var n=e.drawingArea/(e.max-e.min);return e.options.reverse?(e.max-t)*n:(t-e.min)*n}},{key:"getValueForDistanceFromCenter",value:function(t){if(Lh(t))return NaN;var e=this,n=t/(e.drawingArea/(e.max-e.min));return e.options.reverse?e.max-n:e.min+n}},{key:"getPointLabelContext",value:function(t){var e=this._pointLabels||[];if(t>=0&&t<e.length){var n=e[t];return function(t,e,n){return Object.assign(Object.create(t),{label:n,index:e,type:"pointLabel"})}(this.getContext(),t,n)}}},{key:"getPointPosition",value:function(t,e){var n=this,r=n.getIndexAngle(t)-af;return{x:Math.cos(r)*e+n.xCenter,y:Math.sin(r)*e+n.yCenter,angle:r}}},{key:"getPointPositionForValue",value:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}},{key:"getBasePosition",value:function(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}},{key:"getPointLabelPosition",value:function(t){var e=this._pointLabelItems[t];return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}},{key:"drawBackground",value:function(){var t=this,e=t.options,n=e.backgroundColor,r=e.grid.circular;if(n){var i=t.ctx;i.save(),i.beginPath(),Ly(t,t.getDistanceFromCenterForValue(t._endValue),r,t.getLabels().length),i.closePath(),i.fillStyle=n,i.fill(),i.restore()}}},{key:"drawGrid",value:function(){var t,e,n,r=this,i=r.ctx,o=r.options,a=o.angleLines,s=o.grid,u=r.getLabels().length;if(o.pointLabels.display&&function(t,e){for(var n=t.ctx,r=t.options.pointLabels,i=e-1;i>=0;i--){var o=r.setContext(t.getPointLabelContext(i)),a=Nd(o.font),s=t._pointLabelItems[i],u=s.x,c=s.y,l=s.textAlign,h=s.left,f=s.top,d=s.right,p=s.bottom,v=o.backdropColor;if(!Lh(v)){var m=Ld(o.backdropPadding);n.fillStyle=v,n.fillRect(h-m.left,f-m.top,d-h+m.width,p-f+m.height)}kd(n,t._pointLabels[i],u,c+a.lineHeight/2,a,{color:o.color,textAlign:l,textBaseline:"middle"})}}(r,u),s.display&&r.ticks.forEach((function(t,n){if(0!==n){e=r.getDistanceFromCenterForValue(t.value);var i=s.setContext(r.getContext(n-1));!function(t,e,n,r){var i=t.ctx,o=e.circular,a=e.color,s=e.lineWidth;!o&&!r||!a||!s||n<0||(i.save(),i.strokeStyle=a,i.lineWidth=s,i.setLineDash(e.borderDash),i.lineDashOffset=e.borderDashOffset,i.beginPath(),Ly(t,n,o,r),i.closePath(),i.stroke(),i.restore())}(r,i,e,u)}})),a.display){for(i.save(),t=r.getLabels().length-1;t>=0;t--){var c=a.setContext(r.getPointLabelContext(t)),l=c.color,h=c.lineWidth;h&&l&&(i.lineWidth=h,i.strokeStyle=l,i.setLineDash(c.borderDash),i.lineDashOffset=c.borderDashOffset,e=r.getDistanceFromCenterForValue(o.ticks.reverse?r.min:r.max),n=r.getPointPosition(t,e),i.beginPath(),i.moveTo(r.xCenter,r.yCenter),i.lineTo(n.x,n.y),i.stroke())}i.restore()}}},{key:"drawBorder",value:function(){}},{key:"drawLabels",value:function(){var t=this,e=t.ctx,n=t.options,r=n.ticks;if(r.display){var i,o,a=t.getIndexAngle(0);e.save(),e.translate(t.xCenter,t.yCenter),e.rotate(a),e.textAlign="center",e.textBaseline="middle",t.ticks.forEach((function(a,s){if(0!==s||n.reverse){var u=r.setContext(t.getContext(s)),c=Nd(u.font);if(i=t.getDistanceFromCenterForValue(t.ticks[s].value),u.showLabelBackdrop){e.font=c.string,o=e.measureText(a.label).width,e.fillStyle=u.backdropColor;var l=Ld(u.backdropPadding);e.fillRect(-o/2-l.left,-i-c.size/2-l.top,o+l.width,c.size+l.height)}kd(e,a.label,0,-i,c,{color:u.color})}})),e.restore()}}},{key:"drawTitle",value:function(){}}]),n}(ky);Ry.id="radialLinear",Ry.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Sm.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:function(t){return t},padding:5}},Ry.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},Ry.descriptors={angleLines:{_fallback:"grid"}};var Iy={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},zy=Object.keys(Iy);function By(t,e){return t-e}function jy(t,e){if(Lh(e))return null;var n=t._adapter,r=t._parseOpts,i=r.parser,o=r.round,a=r.isoWeekday,s=e;return"function"===typeof i&&(s=i(s)),Ih(s)||(s="string"===typeof i?n.parse(s,i):n.parse(s)),null===s?null:(o&&(s="week"!==o||!ff(a)&&!0!==a?n.startOf(s,o):n.startOf(s,"isoWeek",a)),+s)}function Fy(t,e,n,r){for(var i=zy.length,o=zy.indexOf(t);o<i-1;++o){var a=Iy[zy[o]],s=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-e)/(s*a.size))<=r)return zy[o]}return zy[i-1]}function qy(t,e,n){if(n){if(n.length){var r=Id(n,e),i=r.lo,o=r.hi;t[n[i]>=e?n[i]:n[o]]=!0}}else t[e]=!0}function $y(t,e,n){var r,i,o=[],a={},s=e.length;for(r=0;r<s;++r)a[i=e[r]]=r,o.push({value:i,major:!1});return 0!==s&&n?function(t,e,n,r){var i,o,a=t._adapter,s=+a.startOf(e[0].value,r),u=e[e.length-1].value;for(i=s;i<=u;i=+a.add(i,1,r))(o=n[i])>=0&&(e[o].major=!0);return e}(t,o,a,n):o}var Vy=function(t){jp(n,t);var e=qp(n);function n(t){var r;return Xp(this,n),(r=e.call(this,t))._cache={data:[],labels:[],all:[]},r._unit="day",r._majorUnit=void 0,r._offsets={},r._normalized=!1,r._parseOpts=void 0,r}return tv(n,[{key:"init",value:function(t,e){var r=t.time||(t.time={}),i=this._adapter=new zv._date(t.adapters.date);Zh(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},Bp(Up(n.prototype),"init",this).call(this,t),this._normalized=e.normalized}},{key:"parse",value:function(t,e){return void 0===t?null:jy(this,t)}},{key:"beforeLayout",value:function(){Bp(Up(n.prototype),"beforeLayout",this).call(this),this._cache={data:[],labels:[],all:[]}}},{key:"determineDataLimits",value:function(){var t=this,e=t.options,n=t._adapter,r=e.time.unit||"day",i=t.getUserBounds(),o=i.min,a=i.max,s=i.minDefined,u=i.maxDefined;function c(t){s||isNaN(t.min)||(o=Math.min(o,t.min)),u||isNaN(t.max)||(a=Math.max(a,t.max))}s&&u||(c(t._getLabelBounds()),"ticks"===e.bounds&&"labels"===e.ticks.source||c(t.getMinMax(!1))),o=Ih(o)&&!isNaN(o)?o:+n.startOf(Date.now(),r),a=Ih(a)&&!isNaN(a)?a:+n.endOf(Date.now(),r)+1,t.min=Math.min(o,a-1),t.max=Math.max(o+1,a)}},{key:"_getLabelBounds",value:function(){var t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],n=t[t.length-1]),{min:e,max:n}}},{key:"buildTicks",value:function(){var t=this,e=t.options,n=e.time,r=e.ticks,i="labels"===r.source?t.getLabelTimestamps():t._generate();"ticks"===e.bounds&&i.length&&(t.min=t._userMin||i[0],t.max=t._userMax||i[i.length-1]);var o=t.min,a=function(t,e,n){for(var r=0,i=t.length;r<i&&t[r]<e;)r++;for(;i>r&&t[i-1]>n;)i--;return r>0||i<t.length?t.slice(r,i):t}(i,o,t.max);return t._unit=n.unit||(r.autoSkip?Fy(n.minUnit,t.min,t.max,t._getLabelCapacity(o)):function(t,e,n,r,i){for(var o=zy.length-1;o>=zy.indexOf(n);o--){var a=zy[o];if(Iy[a].common&&t._adapter.diff(i,r,a)>=e-1)return a}return zy[n?zy.indexOf(n):0]}(t,a.length,n.minUnit,t.min,t.max)),t._majorUnit=r.major.enabled&&"year"!==t._unit?function(t){for(var e=zy.indexOf(t)+1,n=zy.length;e<n;++e)if(Iy[zy[e]].common)return zy[e]}(t._unit):void 0,t.initOffsets(i),e.reverse&&a.reverse(),$y(t,a,t._majorUnit)}},{key:"initOffsets",value:function(t){var e,n,r=this,i=0,o=0;r.options.offset&&t.length&&(e=r.getDecimalForValue(t[0]),i=1===t.length?1-e:(r.getDecimalForValue(t[1])-e)/2,n=r.getDecimalForValue(t[t.length-1]),o=1===t.length?n:(n-r.getDecimalForValue(t[t.length-2]))/2);var a=t.length<3?.5:.25;i=xf(i,0,a),o=xf(o,0,a),r._offsets={start:i,end:o,factor:1/(i+1+o)}}},{key:"_generate",value:function(){var t,e,n=this,r=n._adapter,i=n.min,o=n.max,a=n.options,s=a.time,u=s.unit||Fy(s.minUnit,i,o,n._getLabelCapacity(i)),c=Bh(s.stepSize,1),l="week"===u&&s.isoWeekday,h=ff(l)||!0===l,f={},d=i;if(h&&(d=+r.startOf(d,"isoWeek",l)),d=+r.startOf(d,h?"day":u),r.diff(o,i,u)>1e5*c)throw new Error(i+" and "+o+" are too far apart with stepSize of "+c+" "+u);var p="data"===a.ticks.source&&n.getDataTimestamps();for(t=d,e=0;t<o;t=+r.add(t,c,u),e++)qy(f,t,p);return t!==o&&"ticks"!==a.bounds&&1!==e||qy(f,t,p),Object.keys(f).sort((function(t,e){return t-e})).map((function(t){return+t}))}},{key:"getLabelForValue",value:function(t){var e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}},{key:"_tickFormatFunction",value:function(t,e,n,r){var i=this,o=i.options,a=o.time.displayFormats,s=i._unit,u=i._majorUnit,c=s&&a[s],l=u&&a[u],h=n[e],f=u&&l&&h&&h.major,d=i._adapter.format(t,r||(f?l:c)),p=o.ticks.callback;return p?Fh(p,[d,e,n],i):d}},{key:"generateTickLabels",value:function(t){var e,n,r;for(e=0,n=t.length;e<n;++e)(r=t[e]).label=this._tickFormatFunction(r.value,e,t)}},{key:"getDecimalForValue",value:function(t){var e=this;return null===t?NaN:(t-e.min)/(e.max-e.min)}},{key:"getPixelForValue",value:function(t){var e=this,n=e._offsets,r=e.getDecimalForValue(t);return e.getPixelForDecimal((n.start+r)*n.factor)}},{key:"getValueForPixel",value:function(t){var e=this,n=e._offsets,r=e.getDecimalForPixel(t)/n.factor-n.end;return e.min+r*(e.max-e.min)}},{key:"_getLabelSize",value:function(t){var e=this,n=e.options.ticks,r=e.ctx.measureText(t).width,i=vf(e.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(i),a=Math.sin(i),s=e._resolveTickFontOptions(0).size;return{w:r*o+s*a,h:r*a+s*o}}},{key:"_getLabelCapacity",value:function(t){var e=this,n=e.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,o=e._tickFormatFunction(t,0,$y(e,[t],e._majorUnit),i),a=e._getLabelSize(o),s=Math.floor(e.isHorizontal()?e.width/a.w:e.height/a.h)-1;return s>0?s:1}},{key:"getDataTimestamps",value:function(){var t,e,n=this,r=n._cache.data||[];if(r.length)return r;var i=n.getMatchingVisibleMetas();if(n._normalized&&i.length)return n._cache.data=i[0].controller.getAllParsedValues(n);for(t=0,e=i.length;t<e;++t)r=r.concat(i[t].controller.getAllParsedValues(n));return n._cache.data=n.normalize(r)}},{key:"getLabelTimestamps",value:function(){var t,e,n=this,r=n._cache.labels||[];if(r.length)return r;var i=n.getLabels();for(t=0,e=i.length;t<e;++t)r.push(jy(n,i[t]));return n._cache.labels=n._normalized?r:n.normalize(r)}},{key:"normalize",value:function(t){return qd(t.sort(By))}}]),n}(Lm);function Uy(t,e,n){var r,i,o,a,s=0,u=t.length-1;if(n){if(e>=t[s].pos&&e<=t[u].pos){var c=zd(t,"pos",e);s=c.lo,u=c.hi}var l=t[s];r=l.pos,o=l.time;var h=t[u];i=h.pos,a=h.time}else{if(e>=t[s].time&&e<=t[u].time){var f=zd(t,"time",e);s=f.lo,u=f.hi}var d=t[s];r=d.time,o=d.pos;var p=t[u];i=p.time,a=p.pos}var v=i-r;return v?o+(a-o)*(e-r)/v:o}Vy.id="time",Vy.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};var Hy=function(t){jp(n,t);var e=qp(n);function n(t){var r;return Xp(this,n),(r=e.call(this,t))._table=[],r._minPos=void 0,r._tableRange=void 0,r}return tv(n,[{key:"initOffsets",value:function(){var t=this,e=t._getTimestampsForTable(),r=t._table=t.buildLookupTable(e);t._minPos=Uy(r,t.min),t._tableRange=Uy(r,t.max)-t._minPos,Bp(Up(n.prototype),"initOffsets",this).call(this,e)}},{key:"buildLookupTable",value:function(t){var e,n,r,i,o,a=this.min,s=this.max,u=[],c=[];for(e=0,n=t.length;e<n;++e)(i=t[e])>=a&&i<=s&&u.push(i);if(u.length<2)return[{time:a,pos:0},{time:s,pos:1}];for(e=0,n=u.length;e<n;++e)o=u[e+1],r=u[e-1],i=u[e],Math.round((o+r)/2)!==i&&c.push({time:i,pos:e/(n-1)});return c}},{key:"_getTimestampsForTable",value:function(){var t=this,e=t._cache.all||[];if(e.length)return e;var n=t.getDataTimestamps(),r=t.getLabelTimestamps();return e=n.length&&r.length?t.normalize(n.concat(r)):n.length?n:r,e=t._cache.all=e}},{key:"getDecimalForValue",value:function(t){return(Uy(this._table,t)-this._minPos)/this._tableRange}},{key:"getValueForPixel",value:function(t){var e=this,n=e._offsets,r=e.getDecimalForPixel(t)/n.factor-n.end;return Uy(e._table,r*e._tableRange+e._minPos,!0)}}]),n}(Vy);Hy.id="timeseries",Hy.defaults=Vy.defaults;var Wy=[Nv,Dg,yy,Object.freeze({__proto__:null,CategoryScale:wy,LinearScale:Sy,LogarithmicScale:My,RadialLinearScale:Ry,TimeScale:Vy,TimeSeriesScale:Hy})];function Zy(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}ig.register.apply(ig,function(t){return function(t){if(Array.isArray(t))return Zy(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"===typeof t)return Zy(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 Zy(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.")}()}(Wy));var Jy=ig;function Yy(t,e){if(e.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}function Ky(t){return(Ky="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gy(t){Yy(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===Ky(t)&&"[object Date]"===e?new Date(t.getTime()):"number"===typeof t||"[object Number]"===e?new Date(t):("string"!==typeof t&&"[object String]"!==e||"undefined"===typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}var Xy={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Qy=function(t,e,n){var r,i=Xy[t];return r="string"===typeof i?i:1===e?i.one:i.other.replace("{{count}}",e.toString()),null!==n&&void 0!==n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function tb(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var eb={date:tb({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:tb({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:tb({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},nb={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function rb(t){return function(e,n){var r,i=n||{};if("formatting"===(i.context?String(i.context):"standalone")&&t.formattingValues){var o=t.defaultFormattingWidth||t.defaultWidth,a=i.width?String(i.width):o;r=t.formattingValues[a]||t.formattingValues[o]}else{var s=t.defaultWidth,u=i.width?String(i.width):t.defaultWidth;r=t.values[u]||t.values[s]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function ib(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(i);if(!o)return null;var a,s=o[0],u=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(u)?ab(u,(function(t){return t.test(s)})):ob(u,(function(t){return t.test(s)}));a=t.valueCallback?t.valueCallback(c):c,a=n.valueCallback?n.valueCallback(a):a;var l=e.slice(s.length);return{value:a,rest:l}}}function ob(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function ab(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n}var sb,ub={code:"en-US",formatDistance:Qy,formatLong:eb,formatRelative:function(t,e,n,r){return nb[t]},localize:{ordinalNumber:function(t,e){var n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:rb({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:rb({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:rb({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:rb({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:rb({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(sb={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.match(sb.matchPattern);if(!n)return null;var r=n[0],i=t.match(sb.parsePattern);if(!i)return null;var o=sb.valueCallback?sb.valueCallback(i[0]):i[0];o=e.valueCallback?e.valueCallback(o):o;var a=t.slice(r.length);return{value:o,rest:a}}),era:ib({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:ib({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:ib({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:ib({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:ib({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function cb(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function lb(t,e){Yy(2,arguments);var n=Gy(t).getTime(),r=cb(e);return new Date(n+r)}function hb(t,e){Yy(2,arguments);var n=cb(e);return lb(t,-n)}function fb(t,e){if(null==t)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in e=e||{})Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function db(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}}function pb(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}}var vb={p:pb,P:function(t,e){var n,r=t.match(/(P+)(p+)?/),i=r[1],o=r[2];if(!o)return db(t,e);switch(i){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;case"PPPP":default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",db(i,e)).replace("{{time}}",pb(o,e))}};function mb(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}var gb=["D","DD"],yb=["YY","YYYY"];function bb(t){return-1!==gb.indexOf(t)}function wb(t){return-1!==yb.indexOf(t)}function _b(t,e,n){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}function xb(t,e){Yy(1,arguments);var n=e||{},r=n.locale,i=r&&r.options&&r.options.weekStartsOn,o=null==i?0:cb(i),a=null==n.weekStartsOn?o:cb(n.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=Gy(t),u=s.getUTCDay(),c=(u<a?7:0)+u-a;return s.setUTCDate(s.getUTCDate()-c),s.setUTCHours(0,0,0,0),s}function kb(t,e){Yy(1,arguments);var n=Gy(t,e),r=n.getUTCFullYear(),i=e||{},o=i.locale,a=o&&o.options&&o.options.firstWeekContainsDate,s=null==a?1:cb(a),u=null==i.firstWeekContainsDate?s:cb(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=new Date(0);c.setUTCFullYear(r+1,0,u),c.setUTCHours(0,0,0,0);var l=xb(c,e),h=new Date(0);h.setUTCFullYear(r,0,u),h.setUTCHours(0,0,0,0);var f=xb(h,e);return n.getTime()>=l.getTime()?r+1:n.getTime()>=f.getTime()?r:r-1}function Sb(t,e,n){Yy(2,arguments);var r=n||{},i=r.locale,o=i&&i.options&&i.options.weekStartsOn,a=null==o?0:cb(o),s=null==r.weekStartsOn?a:cb(r.weekStartsOn);if(!(s>=0&&s<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=Gy(t),c=cb(e),l=u.getUTCDay(),h=c%7,f=(h+7)%7,d=(f<s?7:0)+c-l;return u.setUTCDate(u.getUTCDate()+d),u}function Cb(t){Yy(1,arguments);var e=1,n=Gy(t),r=n.getUTCDay(),i=(r<e?7:0)+r-e;return n.setUTCDate(n.getUTCDate()-i),n.setUTCHours(0,0,0,0),n}function Mb(t){Yy(1,arguments);var e=Gy(t),n=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var i=Cb(r),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var a=Cb(o);return e.getTime()>=i.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function Eb(t){Yy(1,arguments);var e=Mb(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=Cb(n);return r}var Tb=6048e5;function Ab(t){Yy(1,arguments);var e=Gy(t),n=Cb(e).getTime()-Eb(e).getTime();return Math.round(n/Tb)+1}function Ob(t,e){Yy(1,arguments);var n=e||{},r=n.locale,i=r&&r.options&&r.options.firstWeekContainsDate,o=null==i?1:cb(i),a=null==n.firstWeekContainsDate?o:cb(n.firstWeekContainsDate),s=kb(t,e),u=new Date(0);u.setUTCFullYear(s,0,a),u.setUTCHours(0,0,0,0);var c=xb(u,e);return c}var Db=6048e5;function Pb(t,e){Yy(1,arguments);var n=Gy(t),r=xb(n,e).getTime()-Ob(n,e).getTime();return Math.round(r/Db)+1}var Lb=/^(1[0-2]|0?\d)/,Nb=/^(3[0-1]|[0-2]?\d)/,Rb=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,Ib=/^(5[0-3]|[0-4]?\d)/,zb=/^(2[0-3]|[0-1]?\d)/,Bb=/^(2[0-4]|[0-1]?\d)/,jb=/^(1[0-1]|0?\d)/,Fb=/^(1[0-2]|0?\d)/,qb=/^[0-5]?\d/,$b=/^[0-5]?\d/,Vb=/^\d/,Ub=/^\d{1,2}/,Hb=/^\d{1,3}/,Wb=/^\d{1,4}/,Zb=/^-?\d+/,Jb=/^-?\d/,Yb=/^-?\d{1,2}/,Kb=/^-?\d{1,3}/,Gb=/^-?\d{1,4}/,Xb=/^([+-])(\d{2})(\d{2})?|Z/,Qb=/^([+-])(\d{2})(\d{2})|Z/,tw=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,ew=/^([+-])(\d{2}):(\d{2})|Z/,nw=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function rw(t,e,n){var r=e.match(t);if(!r)return null;var i=parseInt(r[0],10);return{value:n?n(i):i,rest:e.slice(r[0].length)}}function iw(t,e){var n=e.match(t);return n?"Z"===n[0]?{value:0,rest:e.slice(1)}:{value:("+"===n[1]?1:-1)*(36e5*(n[2]?parseInt(n[2],10):0)+6e4*(n[3]?parseInt(n[3],10):0)+1e3*(n[5]?parseInt(n[5],10):0)),rest:e.slice(n[0].length)}:null}function ow(t,e){return rw(Zb,t,e)}function aw(t,e,n){switch(t){case 1:return rw(Vb,e,n);case 2:return rw(Ub,e,n);case 3:return rw(Hb,e,n);case 4:return rw(Wb,e,n);default:return rw(new RegExp("^\\d{1,"+t+"}"),e,n)}}function sw(t,e,n){switch(t){case 1:return rw(Jb,e,n);case 2:return rw(Yb,e,n);case 3:return rw(Kb,e,n);case 4:return rw(Gb,e,n);default:return rw(new RegExp("^-?\\d{1,"+t+"}"),e,n)}}function uw(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function cw(t,e){var n,r=e>0,i=r?e:1-e;if(i<=50)n=t||100;else{var o=i+50;n=t+100*Math.floor(o/100)-(t>=o%100?100:0)}return r?n:1-n}var lw=[31,28,31,30,31,30,31,31,30,31,30,31],hw=[31,29,31,30,31,30,31,31,30,31,30,31];function fw(t){return t%400===0||t%4===0&&t%100!==0}var dw={G:{priority:140,parse:function(t,e,n,r){switch(e){case"G":case"GG":case"GGG":return n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"});case"GGGGG":return n.era(t,{width:"narrow"});case"GGGG":default:return n.era(t,{width:"wide"})||n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"})}},set:function(t,e,n,r){return e.era=n,t.setUTCFullYear(n,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["R","u","t","T"]},y:{priority:130,parse:function(t,e,n,r){var i=function(t){return{year:t,isTwoDigitYear:"yy"===e}};switch(e){case"y":return aw(4,t,i);case"yo":return n.ordinalNumber(t,{unit:"year",valueCallback:i});default:return aw(e.length,t,i)}},validate:function(t,e,n){return e.isTwoDigitYear||e.year>0},set:function(t,e,n,r){var i=t.getUTCFullYear();if(n.isTwoDigitYear){var o=cw(n.year,i);return t.setUTCFullYear(o,0,1),t.setUTCHours(0,0,0,0),t}var a="era"in e&&1!==e.era?1-n.year:n.year;return t.setUTCFullYear(a,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","u","w","I","i","e","c","t","T"]},Y:{priority:130,parse:function(t,e,n,r){var i=function(t){return{year:t,isTwoDigitYear:"YY"===e}};switch(e){case"Y":return aw(4,t,i);case"Yo":return n.ordinalNumber(t,{unit:"year",valueCallback:i});default:return aw(e.length,t,i)}},validate:function(t,e,n){return e.isTwoDigitYear||e.year>0},set:function(t,e,n,r){var i=kb(t,r);if(n.isTwoDigitYear){var o=cw(n.year,i);return t.setUTCFullYear(o,0,r.firstWeekContainsDate),t.setUTCHours(0,0,0,0),xb(t,r)}var a="era"in e&&1!==e.era?1-n.year:n.year;return t.setUTCFullYear(a,0,r.firstWeekContainsDate),t.setUTCHours(0,0,0,0),xb(t,r)},incompatibleTokens:["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:{priority:130,parse:function(t,e,n,r){return sw("R"===e?4:e.length,t)},set:function(t,e,n,r){var i=new Date(0);return i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0),Cb(i)},incompatibleTokens:["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:{priority:130,parse:function(t,e,n,r){return sw("u"===e?4:e.length,t)},set:function(t,e,n,r){return t.setUTCFullYear(n,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["G","y","Y","R","w","I","i","e","c","t","T"]},Q:{priority:120,parse:function(t,e,n,r){switch(e){case"Q":case"QQ":return aw(e.length,t);case"Qo":return n.ordinalNumber(t,{unit:"quarter"});case"QQQ":return n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(t,{width:"wide",context:"formatting"})||n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=1&&e<=4},set:function(t,e,n,r){return t.setUTCMonth(3*(n-1),1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:{priority:120,parse:function(t,e,n,r){switch(e){case"q":case"qq":return aw(e.length,t);case"qo":return n.ordinalNumber(t,{unit:"quarter"});case"qqq":return n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(t,{width:"wide",context:"standalone"})||n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=1&&e<=4},set:function(t,e,n,r){return t.setUTCMonth(3*(n-1),1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:{priority:110,parse:function(t,e,n,r){var i=function(t){return t-1};switch(e){case"M":return rw(Lb,t,i);case"MM":return aw(2,t,i);case"Mo":return n.ordinalNumber(t,{unit:"month",valueCallback:i});case"MMM":return n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(t,{width:"wide",context:"formatting"})||n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,r){return t.setUTCMonth(n,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]},L:{priority:110,parse:function(t,e,n,r){var i=function(t){return t-1};switch(e){case"L":return rw(Lb,t,i);case"LL":return aw(2,t,i);case"Lo":return n.ordinalNumber(t,{unit:"month",valueCallback:i});case"LLL":return n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(t,{width:"wide",context:"standalone"})||n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,r){return t.setUTCMonth(n,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:{priority:100,parse:function(t,e,n,r){switch(e){case"w":return rw(Ib,t);case"wo":return n.ordinalNumber(t,{unit:"week"});default:return aw(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=53},set:function(t,e,n,r){return xb(function(t,e,n){Yy(2,arguments);var r=Gy(t),i=cb(e),o=Pb(r,n)-i;return r.setUTCDate(r.getUTCDate()-7*o),r}(t,n,r),r)},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:{priority:100,parse:function(t,e,n,r){switch(e){case"I":return rw(Ib,t);case"Io":return n.ordinalNumber(t,{unit:"week"});default:return aw(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=53},set:function(t,e,n,r){return Cb(function(t,e){Yy(2,arguments);var n=Gy(t),r=cb(e),i=Ab(n)-r;return n.setUTCDate(n.getUTCDate()-7*i),n}(t,n,r),r)},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:{priority:90,subPriority:1,parse:function(t,e,n,r){switch(e){case"d":return rw(Nb,t);case"do":return n.ordinalNumber(t,{unit:"date"});default:return aw(e.length,t)}},validate:function(t,e,n){var r=fw(t.getUTCFullYear()),i=t.getUTCMonth();return r?e>=1&&e<=hw[i]:e>=1&&e<=lw[i]},set:function(t,e,n,r){return t.setUTCDate(n),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:{priority:90,subPriority:1,parse:function(t,e,n,r){switch(e){case"D":case"DD":return rw(Rb,t);case"Do":return n.ordinalNumber(t,{unit:"date"});default:return aw(e.length,t)}},validate:function(t,e,n){return fw(t.getUTCFullYear())?e>=1&&e<=366:e>=1&&e<=365},set:function(t,e,n,r){return t.setUTCMonth(0,n),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:{priority:90,parse:function(t,e,n,r){switch(e){case"E":case"EE":case"EEE":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,r){return(t=Sb(t,n,r)).setUTCHours(0,0,0,0),t},incompatibleTokens:["D","i","e","c","t","T"]},e:{priority:90,parse:function(t,e,n,r){var i=function(t){var e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return aw(e.length,t,i);case"eo":return n.ordinalNumber(t,{unit:"day",valueCallback:i});case"eee":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeeee":return n.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,r){return(t=Sb(t,n,r)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:{priority:90,parse:function(t,e,n,r){var i=function(t){var e=7*Math.floor((t-1)/7);return(t+r.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return aw(e.length,t,i);case"co":return n.ordinalNumber(t,{unit:"day",valueCallback:i});case"ccc":return n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"ccccc":return n.day(t,{width:"narrow",context:"standalone"});case"cccccc":return n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return n.day(t,{width:"wide",context:"standalone"})||n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"})}},validate:function(t,e,n){return e>=0&&e<=6},set:function(t,e,n,r){return(t=Sb(t,n,r)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:{priority:90,parse:function(t,e,n,r){var i=function(t){return 0===t?7:t};switch(e){case"i":case"ii":return aw(e.length,t);case"io":return n.ordinalNumber(t,{unit:"day"});case"iii":return n.day(t,{width:"abbreviated",context:"formatting",valueCallback:i})||n.day(t,{width:"short",context:"formatting",valueCallback:i})||n.day(t,{width:"narrow",context:"formatting",valueCallback:i});case"iiiii":return n.day(t,{width:"narrow",context:"formatting",valueCallback:i});case"iiiiii":return n.day(t,{width:"short",context:"formatting",valueCallback:i})||n.day(t,{width:"narrow",context:"formatting",valueCallback:i});case"iiii":default:return n.day(t,{width:"wide",context:"formatting",valueCallback:i})||n.day(t,{width:"abbreviated",context:"formatting",valueCallback:i})||n.day(t,{width:"short",context:"formatting",valueCallback:i})||n.day(t,{width:"narrow",context:"formatting",valueCallback:i})}},validate:function(t,e,n){return e>=1&&e<=7},set:function(t,e,n,r){return(t=function(t,e){Yy(2,arguments);var n=cb(e);n%7===0&&(n-=7);var r=1,i=Gy(t),o=i.getUTCDay(),a=((n%7+7)%7<r?7:0)+n-o;return i.setUTCDate(i.getUTCDate()+a),i}(t,n,r)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:{priority:80,parse:function(t,e,n,r){switch(e){case"a":case"aa":case"aaa":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,n,r){return t.setUTCHours(uw(n),0,0,0),t},incompatibleTokens:["b","B","H","K","k","t","T"]},b:{priority:80,parse:function(t,e,n,r){switch(e){case"b":case"bb":case"bbb":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,n,r){return t.setUTCHours(uw(n),0,0,0),t},incompatibleTokens:["a","B","H","K","k","t","T"]},B:{priority:80,parse:function(t,e,n,r){switch(e){case"B":case"BB":case"BBB":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}},set:function(t,e,n,r){return t.setUTCHours(uw(n),0,0,0),t},incompatibleTokens:["a","b","t","T"]},h:{priority:70,parse:function(t,e,n,r){switch(e){case"h":return rw(Fb,t);case"ho":return n.ordinalNumber(t,{unit:"hour"});default:return aw(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=12},set:function(t,e,n,r){var i=t.getUTCHours()>=12;return i&&n<12?t.setUTCHours(n+12,0,0,0):i||12!==n?t.setUTCHours(n,0,0,0):t.setUTCHours(0,0,0,0),t},incompatibleTokens:["H","K","k","t","T"]},H:{priority:70,parse:function(t,e,n,r){switch(e){case"H":return rw(zb,t);case"Ho":return n.ordinalNumber(t,{unit:"hour"});default:return aw(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=23},set:function(t,e,n,r){return t.setUTCHours(n,0,0,0),t},incompatibleTokens:["a","b","h","K","k","t","T"]},K:{priority:70,parse:function(t,e,n,r){switch(e){case"K":return rw(jb,t);case"Ko":return n.ordinalNumber(t,{unit:"hour"});default:return aw(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=11},set:function(t,e,n,r){return t.getUTCHours()>=12&&n<12?t.setUTCHours(n+12,0,0,0):t.setUTCHours(n,0,0,0),t},incompatibleTokens:["a","b","h","H","k","t","T"]},k:{priority:70,parse:function(t,e,n,r){switch(e){case"k":return rw(Bb,t);case"ko":return n.ordinalNumber(t,{unit:"hour"});default:return aw(e.length,t)}},validate:function(t,e,n){return e>=1&&e<=24},set:function(t,e,n,r){var i=n<=24?n%24:n;return t.setUTCHours(i,0,0,0),t},incompatibleTokens:["a","b","h","H","K","t","T"]},m:{priority:60,parse:function(t,e,n,r){switch(e){case"m":return rw(qb,t);case"mo":return n.ordinalNumber(t,{unit:"minute"});default:return aw(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=59},set:function(t,e,n,r){return t.setUTCMinutes(n,0,0),t},incompatibleTokens:["t","T"]},s:{priority:50,parse:function(t,e,n,r){switch(e){case"s":return rw($b,t);case"so":return n.ordinalNumber(t,{unit:"second"});default:return aw(e.length,t)}},validate:function(t,e,n){return e>=0&&e<=59},set:function(t,e,n,r){return t.setUTCSeconds(n,0),t},incompatibleTokens:["t","T"]},S:{priority:30,parse:function(t,e,n,r){return aw(e.length,t,(function(t){return Math.floor(t*Math.pow(10,3-e.length))}))},set:function(t,e,n,r){return t.setUTCMilliseconds(n),t},incompatibleTokens:["t","T"]},X:{priority:10,parse:function(t,e,n,r){switch(e){case"X":return iw(Xb,t);case"XX":return iw(Qb,t);case"XXXX":return iw(tw,t);case"XXXXX":return iw(nw,t);case"XXX":default:return iw(ew,t)}},set:function(t,e,n,r){return e.timestampIsSet?t:new Date(t.getTime()-n)},incompatibleTokens:["t","T","x"]},x:{priority:10,parse:function(t,e,n,r){switch(e){case"x":return iw(Xb,t);case"xx":return iw(Qb,t);case"xxxx":return iw(tw,t);case"xxxxx":return iw(nw,t);case"xxx":default:return iw(ew,t)}},set:function(t,e,n,r){return e.timestampIsSet?t:new Date(t.getTime()-n)},incompatibleTokens:["t","T","X"]},t:{priority:40,parse:function(t,e,n,r){return ow(t)},set:function(t,e,n,r){return[new Date(1e3*n),{timestampIsSet:!0}]},incompatibleTokens:"*"},T:{priority:20,parse:function(t,e,n,r){return ow(t)},set:function(t,e,n,r){return[new Date(n),{timestampIsSet:!0}]},incompatibleTokens:"*"}},pw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,vw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,mw=/^'([^]*?)'?$/,gw=/''/g,yw=/\S/,bw=/[a-zA-Z]/;function ww(t,e){if(e.timestampIsSet)return t;var n=new Date(0);return n.setFullYear(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()),n.setHours(t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()),n}function _w(t){return t.match(mw)[1].replace(gw,"'")}var xw=36e5,kw={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Sw=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Cw=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Mw=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Ew(t){var e,n={},r=t.split(kw.dateTimeDelimiter);if(r.length>2)return n;if(/:/.test(r[0])?(n.date=null,e=r[0]):(n.date=r[0],e=r[1],kw.timeZoneDelimiter.test(n.date)&&(n.date=t.split(kw.timeZoneDelimiter)[0],e=t.substr(n.date.length,t.length))),e){var i=kw.timezone.exec(e);i?(n.time=e.replace(i[1],""),n.timezone=i[1]):n.time=e}return n}function Tw(t,e){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=t.match(n);if(!r)return{year:null};var i=r[1]&&parseInt(r[1]),o=r[2]&&parseInt(r[2]);return{year:null==o?i:100*o,restDateString:t.slice((r[1]||r[2]).length)}}function Aw(t,e){if(null===e)return null;var n=t.match(Sw);if(!n)return null;var r=!!n[4],i=Ow(n[1]),o=Ow(n[2])-1,a=Ow(n[3]),s=Ow(n[4]),u=Ow(n[5])-1;if(r)return function(t,e,n){return e>=1&&e<=53&&n>=0&&n<=6}(0,s,u)?function(t,e,n){var r=new Date(0);r.setUTCFullYear(t,0,4);var i=r.getUTCDay()||7,o=7*(e-1)+n+1-i;return r.setUTCDate(r.getUTCDate()+o),r}(e,s,u):new Date(NaN);var c=new Date(0);return function(t,e,n){return e>=0&&e<=11&&n>=1&&n<=(Nw[e]||(Rw(t)?29:28))}(e,o,a)&&function(t,e){return e>=1&&e<=(Rw(t)?366:365)}(e,i)?(c.setUTCFullYear(e,o,Math.max(i,a)),c):new Date(NaN)}function Ow(t){return t?parseInt(t):1}function Dw(t){var e=t.match(Cw);if(!e)return null;var n=Pw(e[1]),r=Pw(e[2]),i=Pw(e[3]);return function(t,e,n){if(24===t)return 0===e&&0===n;return n>=0&&n<60&&e>=0&&e<60&&t>=0&&t<25}(n,r,i)?n*xw+6e4*r+1e3*i:NaN}function Pw(t){return t&&parseFloat(t.replace(",","."))||0}function Lw(t){if("Z"===t)return 0;var e=t.match(Mw);if(!e)return 0;var n="+"===e[1]?-1:1,r=parseInt(e[2]),i=e[3]&&parseInt(e[3])||0;return function(t,e){return e>=0&&e<=59}(0,i)?n*(r*xw+6e4*i):NaN}var Nw=[31,null,31,30,31,30,31,31,30,31,30,31];function Rw(t){return t%400===0||t%4===0&&t%100}function Iw(t){return(Iw="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function zw(t){return Yy(1,arguments),t instanceof Date||"object"===Iw(t)&&"[object Date]"===Object.prototype.toString.call(t)}function Bw(t){if(Yy(1,arguments),!zw(t)&&"number"!==typeof t)return!1;var e=Gy(t);return!isNaN(Number(e))}function jw(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length<e;)r="0"+r;return n+r}var Fw={y:function(t,e){var n=t.getUTCFullYear(),r=n>0?n:1-n;return jw("yy"===e?r%100:r,e.length)},M:function(t,e){var n=t.getUTCMonth();return"M"===e?String(n+1):jw(n+1,2)},d:function(t,e){return jw(t.getUTCDate(),e.length)},a:function(t,e){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return"am"===n?"a.m.":"p.m."}},h:function(t,e){return jw(t.getUTCHours()%12||12,e.length)},H:function(t,e){return jw(t.getUTCHours(),e.length)},m:function(t,e){return jw(t.getUTCMinutes(),e.length)},s:function(t,e){return jw(t.getUTCSeconds(),e.length)},S:function(t,e){var n=e.length,r=t.getUTCMilliseconds();return jw(Math.floor(r*Math.pow(10,n-3)),e.length)}},qw=864e5;var $w="midnight",Vw="noon",Uw="morning",Hw="afternoon",Ww="evening",Zw="night";function Jw(t,e){var n=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),o=r%60;if(0===o)return n+String(i);var a=e||"";return n+String(i)+a+jw(o,2)}function Yw(t,e){return t%60===0?(t>0?"-":"+")+jw(Math.abs(t)/60,2):Kw(t,e)}function Kw(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t);return r+jw(Math.floor(i/60),2)+n+jw(i%60,2)}var Gw={G:function(t,e,n){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){var r=t.getUTCFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return Fw.y(t,e)},Y:function(t,e,n,r){var i=kb(t,r),o=i>0?i:1-i;return"YY"===e?jw(o%100,2):"Yo"===e?n.ordinalNumber(o,{unit:"year"}):jw(o,e.length)},R:function(t,e){return jw(Mb(t),e.length)},u:function(t,e){return jw(t.getUTCFullYear(),e.length)},Q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return jw(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return jw(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){var r=t.getUTCMonth();switch(e){case"M":case"MM":return Fw.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return jw(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){var i=Pb(t,r);return"wo"===e?n.ordinalNumber(i,{unit:"week"}):jw(i,e.length)},I:function(t,e,n){var r=Ab(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):jw(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):Fw.d(t,e)},D:function(t,e,n){var r=function(t){Yy(1,arguments);var e=Gy(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),i=n-r;return Math.floor(i/qw)+1}(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):jw(r,e.length)},E:function(t,e,n){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return jw(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return jw(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,n){var r=t.getUTCDay(),i=0===r?7:r;switch(e){case"i":return String(i);case"ii":return jw(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){var r,i=t.getUTCHours();switch(r=12===i?Vw:0===i?$w:i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){var r,i=t.getUTCHours();switch(r=i>=17?Ww:i>=12?Hw:i>=4?Uw:Zw,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){var r=t.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Fw.h(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):Fw.H(t,e)},K:function(t,e,n){var r=t.getUTCHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):jw(r,e.length)},k:function(t,e,n){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):jw(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):Fw.m(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):Fw.s(t,e)},S:function(t,e){return Fw.S(t,e)},X:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();if(0===i)return"Z";switch(e){case"X":return Yw(i);case"XXXX":case"XX":return Kw(i);case"XXXXX":case"XXX":default:return Kw(i,":")}},x:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return Yw(i);case"xxxx":case"xx":return Kw(i);case"xxxxx":case"xxx":default:return Kw(i,":")}},O:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Jw(i,":");case"OOOO":default:return"GMT"+Kw(i,":")}},z:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Jw(i,":");case"zzzz":default:return"GMT"+Kw(i,":")}},t:function(t,e,n,r){var i=r._originalDate||t;return jw(Math.floor(i.getTime()/1e3),e.length)},T:function(t,e,n,r){return jw((r._originalDate||t).getTime(),e.length)}},Xw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Qw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,t_=/^'([^]*?)'?$/,e_=/''/g,n_=/[a-zA-Z]/;function r_(t){return t.match(t_)[1].replace(e_,"'")}var i_=36e5;function o_(t,e){Yy(2,arguments);var n=Gy(t),r=cb(e);return isNaN(r)?new Date(NaN):r?(n.setDate(n.getDate()+r),n):n}function a_(t,e){Yy(2,arguments);var n=Gy(t),r=cb(e);if(isNaN(r))return new Date(NaN);if(!r)return n;var i=n.getDate(),o=new Date(n.getTime());o.setMonth(n.getMonth()+r+1,0);var a=o.getDate();return i>=a?o:(n.setFullYear(o.getFullYear(),o.getMonth(),i),n)}function s_(t,e){return Yy(2,arguments),Gy(t).getTime()-Gy(e).getTime()}var u_={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}};function c_(t){return t?u_[t]:u_.trunc}Math.pow(10,8);var l_=36e5;function h_(t){Yy(1,arguments);var e=Gy(t);return e.setHours(0,0,0,0),e}var f_=864e5;function d_(t,e){Yy(2,arguments);var n=h_(t),r=h_(e),i=n.getTime()-mb(n),o=r.getTime()-mb(r);return Math.round((i-o)/f_)}function p_(t,e){var n=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return n<0?-1:n>0?1:n}function v_(t,e){Yy(2,arguments);var n=Gy(t),r=Gy(e),i=p_(n,r),o=Math.abs(d_(n,r));n.setDate(n.getDate()-i*o);var a=Number(p_(n,r)===-i),s=i*(o-a);return 0===s?0:s}function m_(t,e){Yy(2,arguments);var n=Gy(t),r=Gy(e),i=n.getFullYear()-r.getFullYear(),o=n.getMonth()-r.getMonth();return 12*i+o}function g_(t,e){Yy(2,arguments);var n=Gy(t),r=Gy(e),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}function y_(t){Yy(1,arguments);var e=Gy(t);return e.setHours(23,59,59,999),e}function b_(t){Yy(1,arguments);var e=Gy(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function w_(t){Yy(1,arguments);var e=Gy(t);return y_(e).getTime()===b_(e).getTime()}function __(t,e){Yy(2,arguments);var n,r=Gy(t),i=Gy(e),o=g_(r,i),a=Math.abs(m_(r,i));if(a<1)n=0;else{1===r.getMonth()&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-o*a);var s=g_(r,i)===-o;w_(Gy(t))&&1===a&&1===g_(t,i)&&(s=!1),n=o*(a-Number(s))}return 0===n?0:n}function x_(t,e){Yy(2,arguments);var n=Gy(t),r=Gy(e);return n.getFullYear()-r.getFullYear()}function k_(t,e){Yy(1,arguments);var n=e||{},r=n.locale,i=r&&r.options&&r.options.weekStartsOn,o=null==i?0:cb(i),a=null==n.weekStartsOn?o:cb(n.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=Gy(t),u=s.getDay(),c=(u<a?7:0)+u-a;return s.setDate(s.getDate()-c),s.setHours(0,0,0,0),s}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})(t)}var C_={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};zv._date.override({_id:"date-fns",formats:function(){return C_},parse:function(t,e){if(null===t||"undefined"===typeof t)return null;var n=S_(t);return"number"===n||t instanceof Date?t=Gy(t):"string"===n&&(t="string"===typeof e?function(t,e,n,r){Yy(3,arguments);var i=String(t),o=String(e),a=r||{},s=a.locale||ub;if(!s.match)throw new RangeError("locale must contain match property");var u=s.options&&s.options.firstWeekContainsDate,c=null==u?1:cb(u),l=null==a.firstWeekContainsDate?c:cb(a.firstWeekContainsDate);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var h=s.options&&s.options.weekStartsOn,f=null==h?0:cb(h),d=null==a.weekStartsOn?f:cb(a.weekStartsOn);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(""===o)return""===i?Gy(n):new Date(NaN);var p,v={firstWeekContainsDate:l,weekStartsOn:d,locale:s},m=[{priority:10,subPriority:-1,set:ww,index:0}],g=o.match(vw).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,vb[e])(t,s.formatLong,v):t})).join("").match(pw),y=[];for(p=0;p<g.length;p++){var b=g[p];!a.useAdditionalWeekYearTokens&&wb(b)&&_b(b,o,t),!a.useAdditionalDayOfYearTokens&&bb(b)&&_b(b,o,t);var w=b[0],_=dw[w];if(_){var x=_.incompatibleTokens;if(Array.isArray(x)){for(var k=void 0,S=0;S<y.length;S++){var C=y[S].token;if(-1!==x.indexOf(C)||C===w){k=y[S];break}}if(k)throw new RangeError("The format string mustn't contain `".concat(k.fullToken,"` and `").concat(b,"` at the same time"))}else if("*"===_.incompatibleTokens&&y.length)throw new RangeError("The format string mustn't contain `".concat(b,"` and any other token at the same time"));y.push({token:w,fullToken:b});var M=_.parse(i,b,s.match,v);if(!M)return new Date(NaN);m.push({priority:_.priority,subPriority:_.subPriority||0,set:_.set,validate:_.validate,value:M.value,index:m.length}),i=M.rest}else{if(w.match(bw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");if("''"===b?b="'":"'"===w&&(b=_w(b)),0!==i.indexOf(b))return new Date(NaN);i=i.slice(b.length)}}if(i.length>0&&yw.test(i))return new Date(NaN);var E=m.map((function(t){return t.priority})).sort((function(t,e){return e-t})).filter((function(t,e,n){return n.indexOf(t)===e})).map((function(t){return m.filter((function(e){return e.priority===t})).sort((function(t,e){return e.subPriority-t.subPriority}))})).map((function(t){return t[0]})),T=Gy(n);if(isNaN(T))return new Date(NaN);var A=hb(T,mb(T)),O={};for(p=0;p<E.length;p++){var D=E[p];if(D.validate&&!D.validate(A,D.value,v))return new Date(NaN);var P=D.set(A,O,D.value,v);P[0]?(A=P[0],fb(O,P[1])):A=P}return A}(t,e,new Date,this.options):function(t,e){Yy(1,arguments);var n=e||{},r=null==n.additionalDigits?2:cb(n.additionalDigits);if(2!==r&&1!==r&&0!==r)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!==typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var i,o=Ew(t);if(o.date){var a=Tw(o.date,r);i=Aw(a.restDateString,a.year)}if(isNaN(i)||!i)return new Date(NaN);var s,u=i.getTime(),c=0;if(o.time&&(c=Dw(o.time),isNaN(c)||null===c))return new Date(NaN);if(!o.timezone){var l=new Date(u+c),h=new Date(0);return h.setFullYear(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()),h.setHours(l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()),h}return s=Lw(o.timezone),isNaN(s)?new Date(NaN):new Date(u+c+s)}(t,this.options)),Bw(t)?t.getTime():null},format:function(t,e){return function(t,e,n){Yy(2,arguments);var r=String(e),i=n||{},o=i.locale||ub,a=o.options&&o.options.firstWeekContainsDate,s=null==a?1:cb(a),u=null==i.firstWeekContainsDate?s:cb(i.firstWeekContainsDate);if(!(u>=1&&u<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var c=o.options&&o.options.weekStartsOn,l=null==c?0:cb(c),h=null==i.weekStartsOn?l:cb(i.weekStartsOn);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!o.localize)throw new RangeError("locale must contain localize property");if(!o.formatLong)throw new RangeError("locale must contain formatLong property");var f=Gy(t);if(!Bw(f))throw new RangeError("Invalid time value");var d=mb(f),p=hb(f,d),v={firstWeekContainsDate:u,weekStartsOn:h,locale:o,_originalDate:f};return r.match(Qw).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,vb[e])(t,o.formatLong,v):t})).join("").match(Xw).map((function(n){if("''"===n)return"'";var r=n[0];if("'"===r)return r_(n);var a=Gw[r];if(a)return!i.useAdditionalWeekYearTokens&&wb(n)&&_b(n,e,t),!i.useAdditionalDayOfYearTokens&&bb(n)&&_b(n,e,t),a(p,n,o.localize,v);if(r.match(n_))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");return n})).join("")}(t,e,this.options)},add:function(t,e,n){switch(n){case"millisecond":return lb(t,e);case"second":return function(t,e){Yy(2,arguments);var n=cb(e);return lb(t,1e3*n)}(t,e);case"minute":return function(t,e){Yy(2,arguments);var n=cb(e);return lb(t,6e4*n)}(t,e);case"hour":return function(t,e){Yy(2,arguments);var n=cb(e);return lb(t,n*i_)}(t,e);case"day":return o_(t,e);case"week":return function(t,e){Yy(2,arguments);var n=cb(e);return o_(t,7*n)}(t,e);case"month":return a_(t,e);case"quarter":return function(t,e){Yy(2,arguments);var n=cb(e);return a_(t,3*n)}(t,e);case"year":return function(t,e){Yy(2,arguments);var n=cb(e);return a_(t,12*n)}(t,e);default:return t}},diff:function(t,e,n){switch(n){case"millisecond":return s_(t,e);case"second":return function(t,e,n){Yy(2,arguments);var r=s_(t,e)/1e3;return c_(null===n||void 0===n?void 0:n.roundingMethod)(r)}(t,e);case"minute":return function(t,e,n){Yy(2,arguments);var r=s_(t,e)/6e4;return c_(null===n||void 0===n?void 0:n.roundingMethod)(r)}(t,e);case"hour":return function(t,e,n){Yy(2,arguments);var r=s_(t,e)/l_;return c_(null===n||void 0===n?void 0:n.roundingMethod)(r)}(t,e);case"day":return v_(t,e);case"week":return function(t,e,n){Yy(2,arguments);var r=v_(t,e)/7;return c_(null===n||void 0===n?void 0:n.roundingMethod)(r)}(t,e);case"month":return __(t,e);case"quarter":return function(t,e,n){Yy(2,arguments);var r=__(t,e)/3;return c_(null===n||void 0===n?void 0:n.roundingMethod)(r)}(t,e);case"year":return function(t,e){Yy(2,arguments);var n=Gy(t),r=Gy(e),i=g_(n,r),o=Math.abs(x_(n,r));n.setFullYear(1584),r.setFullYear(1584);var a=g_(n,r)===-i,s=i*(o-Number(a));return 0===s?0:s}(t,e);default:return 0}},startOf:function(t,e,n){switch(e){case"second":return function(t){Yy(1,arguments);var e=Gy(t);return e.setMilliseconds(0),e}(t);case"minute":return function(t){Yy(1,arguments);var e=Gy(t);return e.setSeconds(0,0),e}(t);case"hour":return function(t){Yy(1,arguments);var e=Gy(t);return e.setMinutes(0,0,0),e}(t);case"day":return h_(t);case"week":return k_(t);case"isoWeek":return k_(t,{weekStartsOn:+n});case"month":return function(t){Yy(1,arguments);var e=Gy(t);return e.setDate(1),e.setHours(0,0,0,0),e}(t);case"quarter":return function(t){Yy(1,arguments);var e=Gy(t),n=e.getMonth(),r=n-n%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}(t);case"year":return function(t){Yy(1,arguments);var e=Gy(t),n=new Date(0);return n.setFullYear(e.getFullYear(),0,1),n.setHours(0,0,0,0),n}(t);default:return t}},endOf:function(t,e){switch(e){case"second":return function(t){Yy(1,arguments);var e=Gy(t);return e.setMilliseconds(999),e}(t);case"minute":return function(t){Yy(1,arguments);var e=Gy(t);return e.setSeconds(59,999),e}(t);case"hour":return function(t){Yy(1,arguments);var e=Gy(t);return e.setMinutes(59,59,999),e}(t);case"day":return y_(t);case"week":return function(t,e){Yy(1,arguments);var n=e||{},r=n.locale,i=r&&r.options&&r.options.weekStartsOn,o=null==i?0:cb(i),a=null==n.weekStartsOn?o:cb(n.weekStartsOn);if(!(a>=0&&a<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=Gy(t),u=s.getDay(),c=6+(u<a?-7:0)-(u-a);return s.setDate(s.getDate()+c),s.setHours(23,59,59,999),s}(t);case"month":return b_(t);case"quarter":return function(t){Yy(1,arguments);var e=Gy(t),n=e.getMonth(),r=n-n%3+3;return e.setMonth(r,0),e.setHours(23,59,59,999),e}(t);case"year":return function(t){Yy(1,arguments);var e=Gy(t),n=e.getFullYear();return e.setFullYear(n+1,0,0),e.setHours(23,59,59,999),e}(t);default:return t}}}),mh.a.use(Jy);try{window.airbrake=new yt({projectId:window.env.AIRBRAKE_PROJECT_ID,projectKey:window.env.AIRBRAKE_PROJECT_KEY,host:window.env.PANEL_URL}),console.originalError=console.error,console.error=function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return window.airbrake.notify(n.join(" ")),(t=console).originalError.apply(t,n)}}catch(E_){console.error(E_)}fh.a.start(),ph.a.start(),le.start()}]);
|
|
//# sourceMappingURL=application-d4a959210a82d3d1b10f.js.map |