/*! * Vue.js v2.6.14 * (c) 2014-2021 Evan You * Released under the MIT License. */ var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function i(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function o(e){return null!==e&&"object"==typeof e}var s=Object.prototype.toString;function a(e){return"[object Object]"===s.call(e)}function l(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function c(e){return n(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function u(e){return null==e?"":Array.isArray(e)||a(e)&&e.toString===s?JSON.stringify(e,null,2):String(e)}function d(e){var t=parseFloat(e);return isNaN(t)?e:t}function h(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i-1)return e.splice(n,1)}}var g=Object.prototype.hasOwnProperty;function v(e,t){return g.call(e,t)}function y(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var b=/-(\w)/g,w=y((function(e){return e.replace(b,(function(e,t){return t?t.toUpperCase():""}))})),x=y((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),S=/\B([A-Z])/g,k=y((function(e){return e.replace(S,"-$1").toLowerCase()}));var C=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function O(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function M(e,t){for(var n in t)e[n]=t[n];return e}function _(e){for(var t={},n=0;n0,Y=H&&H.indexOf("edge/")>0;H&&H.indexOf("android");var U=H&&/iphone|ipad|ipod|ios/.test(H)||"ios"===q;H&&/chrome\/\d+/.test(H),H&&/phantomjs/.test(H);var X,G=H&&H.match(/firefox\/(\d+)/),Z={}.watch,Q=!1;if(V)try{var ee={};Object.defineProperty(ee,"passive",{get:function(){Q=!0}}),window.addEventListener("test-passive",null,ee)}catch(wy){}var te=function(){return void 0===X&&(X=!V&&!W&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),X},ne=V&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function re(e){return"function"==typeof e&&/native code/.test(e.toString())}var ie,oe="undefined"!=typeof Symbol&&re(Symbol)&&"undefined"!=typeof Reflect&&re(Reflect.ownKeys);ie="undefined"!=typeof Set&&re(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var se=D,ae=0,le=function(){this.id=ae++,this.subs=[]};le.prototype.addSub=function(e){this.subs.push(e)},le.prototype.removeSub=function(e){m(this.subs,e)},le.prototype.depend=function(){le.target&&le.target.addDep(this)},le.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t-1)if(o&&!v(i,"default"))s=!1;else if(""===s||s===k(e)){var l=Le(String,i.type);(l<0||a0&&(ut((a=dt(a,(o||"")+"_"+s))[0])&&ut(c)&&(u[l]=me(c.text+a[0].text),a.shift()),u.push.apply(u,a)):i(a)?ut(c)?u[l]=me(c.text+a):""!==a&&u.push(me(a)):ut(a)&&ut(c)?u[l]=me(c.text+a.text):(r(e._isVList)&&n(a.tag)&&t(a.key)&&n(o)&&(a.key="__vlist"+o+"_"+s+"__"),u.push(a)));return u}function ht(e,t){if(e){for(var n=Object.create(null),r=oe?Reflect.ownKeys(e):Object.keys(e),i=0;i0,s=t?!!t.$stable:!o,a=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(s&&r&&r!==e&&a===r.$key&&!o&&!r.$hasNormal)return r;for(var l in i={},t)t[l]&&"$"!==l[0]&&(i[l]=vt(n,l,t[l]))}else i={};for(var c in n)c in i||(i[c]=yt(n,c));return t&&Object.isExtensible(t)&&(t._normalized=i),F(i,"$stable",s),F(i,"$key",a),F(i,"$hasNormal",o),i}function vt(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({}),t=(e=e&&"object"==typeof e&&!Array.isArray(e)?[e]:ct(e))&&e[0];return e&&(!t||1===e.length&&t.isComment&&!mt(t))?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function yt(e,t){return function(){return e[t]}}function bt(e,t){var r,i,s,a,l;if(Array.isArray(e)||"string"==typeof e)for(r=new Array(e.length),i=0,s=e.length;idocument.createEvent("Event").timeStamp&&(dn=function(){return hn.now()})}function fn(){var e,t;for(un=dn(),ln=!0,rn.sort((function(e,t){return e.id-t.id})),cn=0;cncn&&rn[n].id>e.id;)n--;rn.splice(n+1,0,e)}else rn.push(e);an||(an=!0,et(fn))}}(this)},mn.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user){var n='callback for watcher "'+this.expression+'"';Ve(this.cb,this.vm,[e,t],this.vm,n)}else this.cb.call(this.vm,e,t)}}},mn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},mn.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},mn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||m(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var gn={enumerable:!0,configurable:!0,get:D,set:D};function vn(e,t,n){gn.get=function(){return this[t][n]},gn.set=function(e){this[t][n]=e},Object.defineProperty(e,n,gn)}function yn(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&xe(!1);var o=function(o){i.push(o);var s=Re(o,t,n,e);Ce(r,o,s),o in e||vn(e,"_props",o)};for(var s in t)o(s);xe(!0)}(e,t.props),t.methods&&function(e,t){for(var n in e.$options.props,t)e[n]="function"!=typeof t[n]?D:C(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;a(t=e._data="function"==typeof t?function(e,t){ue();try{return e.call(t,t)}catch(wy){return Be(wy,t,"data()"),{}}finally{de()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props;e.$options.methods;var i=n.length;for(;i--;){var o=n[i];r&&v(r,o)||j(o)||vn(e,"_data",o)}ke(t,!0)}(e):ke(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=te();for(var i in t){var o=t[i],s="function"==typeof o?o:o.get;r||(n[i]=new mn(e,s||D,D,bn)),i in e||wn(e,i,o)}}(e,t.computed),t.watch&&t.watch!==Z&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===s.call(n)&&e.test(t));var n}function $n(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var s=n[o];if(s){var a=s.name;a&&!t(a)&&An(n,o,r,i)}}}function An(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,m(n,t)}Mn.prototype._init=function(t){var n=this;n._uid=Cn++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=Pe(On(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&Xt(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=ft(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return Bt(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return Bt(t,e,n,r,i,!0)};var o=r&&r.data;Ce(t,"$attrs",o&&o.attrs||e,null,!0),Ce(t,"$listeners",n._parentListeners||e,null,!0)}(n),nn(n,"beforeCreate"),function(e){var t=ht(e.$options.inject,e);t&&(xe(!1),Object.keys(t).forEach((function(n){Ce(e,n,t[n])})),xe(!0))}(n),yn(n),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(n),nn(n,"created"),n.$options.el&&n.$mount(n.$options.el)},function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=Oe,e.prototype.$delete=Me,e.prototype.$watch=function(e,t,n){var r=this;if(a(t))return kn(r,e,t,n);(n=n||{}).user=!0;var i=new mn(r,e,t,n);if(n.immediate){var o='callback for immediate watcher "'+i.expression+'"';ue(),Ve(t,r,[i.value],r,o),de()}return function(){i.teardown()}}}(Mn),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i1?O(n):n;for(var r=O(arguments,1),i='event handler for "'+e+'"',o=0,s=n.length;oparseInt(this.max)&&An(t,n[0],n,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)An(this.cache,e,this.keys)},mounted:function(){var e=this;this.cacheVNode(),this.$watch("include",(function(t){$n(e,(function(e){return Tn(t,e)}))})),this.$watch("exclude",(function(t){$n(e,(function(e){return!Tn(t,e)}))}))},updated:function(){this.cacheVNode()},render:function(){var e=this.$slots.default,t=Jt(e),n=t&&t.componentOptions;if(n){var r=Dn(n),i=this.include,o=this.exclude;if(i&&(!r||!Tn(i,r))||o&&r&&Tn(o,r))return t;var s=this.cache,a=this.keys,l=null==t.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):t.key;s[l]?(t.componentInstance=s[l].componentInstance,m(a,l),a.push(l)):(this.vnodeToCache=t,this.keyToCache=l),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return R}};Object.defineProperty(e,"config",t),e.util={warn:se,extend:M,mergeOptions:Pe,defineReactive:Ce},e.set=Oe,e.delete=Me,e.nextTick=et,e.observable=function(e){return ke(e),e},e.options=Object.create(null),P.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,M(e.options.components,Nn),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=O(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Pe(this.options,e),this}}(e),_n(e),function(e){P.forEach((function(t){e[t]=function(e,n){return n?("component"===t&&a(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}))}(e)}(Mn),Object.defineProperty(Mn.prototype,"$isServer",{get:te}),Object.defineProperty(Mn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Mn,"FunctionalRenderContext",{value:Pt}),Mn.version="2.6.14";var Pn=h("style,class"),In=h("input,textarea,option,select,progress"),Rn=function(e,t,n){return"value"===n&&In(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},zn=h("contenteditable,draggable,spellcheck"),jn=h("events,caret,typing,plaintext-only"),Fn=h("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),Ln="http://www.w3.org/1999/xlink",Bn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Vn=function(e){return Bn(e)?e.slice(6,e.length):""},Wn=function(e){return null==e||!1===e};function qn(e){for(var t=e.data,r=e,i=e;n(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=Hn(i.data,t));for(;n(r=r.parent);)r&&r.data&&(t=Hn(t,r.data));return function(e,t){if(n(e)||n(t))return Jn(e,Kn(t));return""}(t.staticClass,t.class)}function Hn(e,t){return{staticClass:Jn(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function Jn(e,t){return e?t?e+" "+t:e:t||""}function Kn(e){return Array.isArray(e)?function(e){for(var t,r="",i=0,o=e.length;i-1?yr(e,t,n):Fn(t)?Wn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):zn(t)?e.setAttribute(t,function(e,t){return Wn(t)||"false"===t?"false":"contenteditable"===e&&jn(t)?t:"true"}(t,n)):Bn(t)?Wn(n)?e.removeAttributeNS(Ln,Vn(t)):e.setAttributeNS(Ln,t,n):yr(e,t,n)}function yr(e,t,n){if(Wn(n))e.removeAttribute(t);else{if(J&&!K&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var br={create:gr,update:gr};function wr(e,r){var i=r.elm,o=r.data,s=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(s)||t(s.staticClass)&&t(s.class)))){var a=qn(r),l=i._transitionClasses;n(l)&&(a=Jn(a,Kn(l))),a!==i._prevClass&&(i.setAttribute("class",a),i._prevClass=a)}}var xr,Sr,kr,Cr,Or,Mr,_r={create:wr,update:wr},Dr=/[\w).+\-_$\]]/;function Tr(e){var t,n,r,i,o,s=!1,a=!1,l=!1,c=!1,u=0,d=0,h=0,f=0;for(r=0;r=0&&" "===(m=e.charAt(p));p--);m&&Dr.test(m)||(c=!0)}}else void 0===i?(f=r+1,i=e.slice(0,r).trim()):g();function g(){(o||(o=[])).push(e.slice(f,r).trim()),f=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==f&&g(),o)for(r=0;r-1?{exp:e.slice(0,Cr),key:'"'+e.slice(Cr+1)+'"'}:{exp:e,key:null};Sr=e,Cr=Or=Mr=0;for(;!Jr();)Kr(kr=Hr())?Ur(kr):91===kr&&Yr(kr);return{exp:e.slice(0,Or),key:e.slice(Or+1,Mr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function Hr(){return Sr.charCodeAt(++Cr)}function Jr(){return Cr>=xr}function Kr(e){return 34===e||39===e}function Yr(e){var t=1;for(Or=Cr;!Jr();)if(Kr(e=Hr()))Ur(e);else if(91===e&&t++,93===e&&t--,0===t){Mr=Cr;break}}function Ur(e){for(var t=e;!Jr()&&(e=Hr())!==t;);}var Xr;function Gr(e,t,n){var r=Xr;return function i(){var o=t.apply(null,arguments);null!==o&&ei(e,i,n,r)}}var Zr=Je&&!(G&&Number(G[1])<=53);function Qr(e,t,n,r){if(Zr){var i=un,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=i||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}Xr.addEventListener(e,t,Q?{capture:n,passive:r}:n)}function ei(e,t,n,r){(r||Xr).removeEventListener(e,t._wrapper||t,n)}function ti(e,r){if(!t(e.data.on)||!t(r.data.on)){var i=r.data.on||{},o=e.data.on||{};Xr=r.elm,function(e){if(n(e.__r)){var t=J?"change":"input";e[t]=[].concat(e.__r,e[t]||[]),delete e.__r}n(e.__c)&&(e.change=[].concat(e.__c,e.change||[]),delete e.__c)}(i),st(i,o,Qr,ei,Gr,r.context),Xr=void 0}}var ni,ri={create:ti,update:ti};function ii(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var i,o,s=r.elm,a=e.data.domProps||{},l=r.data.domProps||{};for(i in n(l.__ob__)&&(l=r.data.domProps=M({},l)),a)i in l||(s[i]="");for(i in l){if(o=l[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===a[i])continue;1===s.childNodes.length&&s.removeChild(s.childNodes[0])}if("value"===i&&"PROGRESS"!==s.tagName){s._value=o;var c=t(o)?"":String(o);oi(s,c)&&(s.value=c)}else if("innerHTML"===i&&Xn(s.tagName)&&t(s.innerHTML)){(ni=ni||document.createElement("div")).innerHTML=""+o+"";for(var u=ni.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;u.firstChild;)s.appendChild(u.firstChild)}else if(o!==a[i])try{s[i]=o}catch(wy){}}}}function oi(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(wy){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,i=e._vModifiers;if(n(i)){if(i.number)return d(r)!==d(t);if(i.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var si={create:ii,update:ii},ai=y((function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach((function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}})),t}));function li(e){var t=ci(e.style);return e.staticStyle?M(e.staticStyle,t):t}function ci(e){return Array.isArray(e)?_(e):"string"==typeof e?ai(e):e}var ui,di=/^--/,hi=/\s*!important$/,fi=function(e,t,n){if(di.test(t))e.style.setProperty(t,n);else if(hi.test(n))e.style.setProperty(k(t),n.replace(hi,""),"important");else{var r=mi(t);if(Array.isArray(n))for(var i=0,o=n.length;i-1?t.split(yi).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function wi(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(yi).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function xi(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&M(t,Si(e.name||"v")),M(t,e),t}return"string"==typeof e?Si(e):void 0}}var Si=y((function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}})),ki=V&&!K,Ci="transition",Oi="transitionend",Mi="animation",_i="animationend";ki&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Ci="WebkitTransition",Oi="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Mi="WebkitAnimation",_i="webkitAnimationEnd"));var Di=V?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Ti(e){Di((function(){Di(e)}))}function $i(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),bi(e,t))}function Ai(e,t){e._transitionClasses&&m(e._transitionClasses,t),wi(e,t)}function Ei(e,t,n){var r=Pi(e,t),i=r.type,o=r.timeout,s=r.propCount;if(!i)return n();var a="transition"===i?Oi:_i,l=0,c=function(){e.removeEventListener(a,u),n()},u=function(t){t.target===e&&++l>=s&&c()};setTimeout((function(){l0&&(n="transition",u=s,d=o.length):"animation"===t?c>0&&(n="animation",u=c,d=l.length):d=(n=(u=Math.max(s,c))>0?s>c?"transition":"animation":null)?"transition"===n?o.length:l.length:0,{type:n,timeout:u,propCount:d,hasTransform:"transition"===n&&Ni.test(r[Ci+"Property"])}}function Ii(e,t){for(;e.length1}function Bi(e,t){!0!==t.data.show&&zi(t)}var Vi=function(e){var o,s,a={},l=e.modules,c=e.nodeOps;for(o=0;op?b(e,t(i[v+1])?null:i[v+1].elm,i,f,v,o):f>v&&x(r,h,p)}(h,m,v,o,u):n(v)?(n(e.text)&&c.setTextContent(h,""),b(h,null,v,0,v.length-1,o)):n(m)?x(m,0,m.length-1):n(e.text)&&c.setTextContent(h,""):e.text!==i.text&&c.setTextContent(h,i.text),n(p)&&n(f=p.hook)&&n(f=f.postpatch)&&f(e,i)}}}function O(e,t,i){if(r(i)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o-1,s.selected!==o&&(s.selected=o);else if(A(Ki(s),r))return void(e.selectedIndex!==a&&(e.selectedIndex=a));i||(e.selectedIndex=-1)}}function Ji(e,t){return t.every((function(t){return!A(t,e)}))}function Ki(e){return"_value"in e?e._value:e.value}function Yi(e){e.target.composing=!0}function Ui(e){e.target.composing&&(e.target.composing=!1,Xi(e.target,"input"))}function Xi(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Gi(e){return!e.componentInstance||e.data&&e.data.transition?e:Gi(e.componentInstance._vnode)}var Zi={model:Wi,show:{bind:function(e,t,n){var r=t.value,i=(n=Gi(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,zi(n,(function(){e.style.display=o}))):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Gi(n)).data&&n.data.transition?(n.data.show=!0,r?zi(n,(function(){e.style.display=e.__vOriginalDisplay})):ji(n,(function(){e.style.display="none"}))):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},Qi={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function eo(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?eo(Jt(t.children)):e}function to(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[w(o)]=i[o];return t}function no(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var ro=function(e){return e.tag||mt(e)},io=function(e){return"show"===e.name},oo={name:"transition",props:Qi,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(ro)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var s=eo(o);if(!s)return o;if(this._leaving)return no(e,o);var a="__transition-"+this._uid+"-";s.key=null==s.key?s.isComment?a+"comment":a+s.tag:i(s.key)?0===String(s.key).indexOf(a)?s.key:a+s.key:s.key;var l=(s.data||(s.data={})).transition=to(this),c=this._vnode,u=eo(c);if(s.data.directives&&s.data.directives.some(io)&&(s.data.show=!0),u&&u.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(s,u)&&!mt(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var d=u.data.transition=M({},l);if("out-in"===r)return this._leaving=!0,at(d,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),no(e,o);if("in-out"===r){if(mt(s))return c;var h,f=function(){h()};at(l,"afterEnter",f),at(l,"enterCancelled",f),at(d,"delayLeave",(function(e){h=e}))}}return o}}},so=M({tag:String,moveClass:String},Qi);delete so.mode;var ao={props:so,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=Zt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],s=to(this),a=0;a-1?Qn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Qn[e]=/HTMLUnknownElement/.test(t.toString())},M(Mn.options.directives,Zi),M(Mn.options.components,ho),Mn.prototype.__patch__=V?Vi:D,Mn.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=pe),nn(e,"beforeMount"),r=function(){e._update(e._render(),n)},new mn(e,r,D,{before:function(){e._isMounted&&!e._isDestroyed&&nn(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,nn(e,"mounted")),e}(this,e=e&&V?tr(e):void 0,t)},V&&setTimeout((function(){R.devtools&&ne&&ne.emit("init",Mn)}),0);var fo=/\{\{((?:.|\r?\n)+?)\}\}/g,po=/[-.*+?^${}()|[\]\/\\]/g,mo=y((function(e){var t=e[0].replace(po,"\\$&"),n=e[1].replace(po,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")}));var go={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=Lr(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=Fr(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}};var vo,yo={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=Lr(e,"style");n&&(e.staticStyle=JSON.stringify(ai(n)));var r=Fr(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},bo=function(e){return(vo=vo||document.createElement("div")).innerHTML=e,vo.textContent},wo=h("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),xo=h("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),So=h("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),ko=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Co=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Oo="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+z.source+"]*",Mo="((?:"+Oo+"\\:)?"+Oo+")",_o=new RegExp("^<"+Mo),Do=/^\s*(\/?)>/,To=new RegExp("^<\\/"+Mo+"[^>]*>"),$o=/^]+>/i,Ao=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},Ro=/&(?:lt|gt|quot|amp|#39);/g,zo=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,jo=h("pre,textarea",!0),Fo=function(e,t){return e&&jo(e)&&"\n"===t[0]};function Lo(e,t){var n=t?zo:Ro;return e.replace(n,(function(e){return Io[e]}))}var Bo,Vo,Wo,qo,Ho,Jo,Ko,Yo,Uo=/^@|^v-on:/,Xo=/^v-|^@|^:|^#/,Go=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Zo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Qo=/^\(|\)$/g,es=/^\[.*\]$/,ts=/:(.*)$/,ns=/^:|^\.|^v-bind:/,rs=/\.[^.\]]+(?=[^\]]*$)/g,is=/^v-slot(:|$)|^#/,ss=/[\r\n]/,as=/[ \f\t\r\n]+/g,ls=y(bo);function cs(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:gs(t),rawAttrsMap:{},parent:n,children:[]}}function us(e,t){Bo=t.warn||Ar,Jo=t.isPreTag||T,Ko=t.mustUseProp||T,Yo=t.getTagNamespace||T,t.isReservedTag,Wo=Er(t.modules,"transformNode"),qo=Er(t.modules,"preTransformNode"),Ho=Er(t.modules,"postTransformNode"),Vo=t.delimiters;var n,r,i=[],o=!1!==t.preserveWhitespace,s=t.whitespace,a=!1,l=!1;function c(e){if(u(e),a||e.processed||(e=ds(e,t)),i.length||e===n||n.if&&(e.elseif||e.else)&&fs(n,{exp:e.elseif,block:e}),r&&!e.forbidden)if(e.elseif||e.else)s=e,c=function(e){for(var t=e.length;t--;){if(1===e[t].type)return e[t];e.pop()}}(r.children),c&&c.if&&fs(c,{exp:s.elseif,block:s});else{if(e.slotScope){var o=e.slotTarget||'"default"';(r.scopedSlots||(r.scopedSlots={}))[o]=e}r.children.push(e),e.parent=r}var s,c;e.children=e.children.filter((function(e){return!e.slotScope})),u(e),e.pre&&(a=!1),Jo(e.tag)&&(l=!1);for(var d=0;d]*>)","i")),h=e.replace(d,(function(e,n,r){return c=r.length,No(u)||"noscript"===u||(n=n.replace(//g,"$1").replace(//g,"$1")),Fo(u,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""}));l+=e.length-h.length,e=h,M(u,l-c,l)}else{var f=e.indexOf("<");if(0===f){if(Ao.test(e)){var p=e.indexOf("--\x3e");if(p>=0){t.shouldKeepComment&&t.comment(e.substring(4,p),l,l+p+3),k(p+3);continue}}if(Eo.test(e)){var m=e.indexOf("]>");if(m>=0){k(m+2);continue}}var g=e.match($o);if(g){k(g[0].length);continue}var v=e.match(To);if(v){var y=l;k(v[0].length),M(v[1],y,l);continue}var b=C();if(b){O(b),Fo(b.tagName,e)&&k(1);continue}}var w=void 0,x=void 0,S=void 0;if(f>=0){for(x=e.slice(f);!(To.test(x)||_o.test(x)||Ao.test(x)||Eo.test(x)||(S=x.indexOf("<",1))<0);)f+=S,x=e.slice(f);w=e.substring(0,f)}f<0&&(w=e),w&&k(w.length),t.chars&&w&&t.chars(w,l-w.length,l)}if(e===n){t.chars&&t.chars(e);break}}function k(t){l+=t,e=e.substring(t)}function C(){var t=e.match(_o);if(t){var n,r,i={tagName:t[1],attrs:[],start:l};for(k(t[0].length);!(n=e.match(Do))&&(r=e.match(Co)||e.match(ko));)r.start=l,k(r[0].length),r.end=l,i.attrs.push(r);if(n)return i.unarySlash=n[1],k(n[0].length),i.end=l,i}}function O(e){var n=e.tagName,l=e.unarySlash;o&&("p"===r&&So(n)&&M(r),a(n)&&r===n&&M(n));for(var c=s(n)||!!l,u=e.attrs.length,d=new Array(u),h=0;h=0&&i[s].lowerCasedTag!==a;s--);else s=0;if(s>=0){for(var c=i.length-1;c>=s;c--)t.end&&t.end(i[c].tag,n,o);i.length=s,r=s&&i[s-1].tag}else"br"===a?t.start&&t.start(e,[],!0,n,o):"p"===a&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}M()}(e,{warn:Bo,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,o,s,u,d){var h=r&&r.ns||Yo(e);J&&"svg"===h&&(o=function(e){for(var t=[],n=0;nl&&(a.push(o=e.slice(l,i)),s.push(JSON.stringify(o)));var c=Tr(r[1].trim());s.push("_s("+c+")"),a.push({"@binding":c}),l=i+r[0].length}return l-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),jr(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+s+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+qr(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+qr(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+qr(t,"$$c")+"}",null,!0)}(e,r,i);else if("input"===o&&"radio"===s)!function(e,t,n){var r=n&&n.number,i=Fr(e,"value")||"null";Nr(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),jr(e,"change",qr(t,i),null,!0)}(e,r,i);else if("input"===o||"textarea"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,s=i.number,a=i.trim,l=!o&&"range"!==r,c=o?"change":"range"===r?"__r":"input",u="$event.target.value";a&&(u="$event.target.value.trim()");s&&(u="_n("+u+")");var d=qr(t,u);l&&(d="if($event.target.composing)return;"+d);Nr(e,"value","("+t+")"),jr(e,c,d,null,!0),(a||s)&&jr(e,"blur","$forceUpdate()")}(e,r,i);else if(!R.isReservedTag(o))return Wr(e,r,i),!1;return!0},text:function(e,t){t.value&&Nr(e,"textContent","_s("+t.value+")",t)},html:function(e,t){t.value&&Nr(e,"innerHTML","_s("+t.value+")",t)}},Os={expectHTML:!0,modules:ws,directives:Cs,isPreTag:function(e){return"pre"===e},isUnaryTag:wo,mustUseProp:Rn,canBeLeftOpenTag:xo,isReservedTag:Gn,getTagNamespace:Zn,staticKeys:(xs=ws,xs.reduce((function(e,t){return e.concat(t.staticKeys||[])}),[]).join(","))},Ms=y((function(e){return h("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))}));function _s(e,t){e&&(Ss=Ms(t.staticKeys||""),ks=t.isReservedTag||T,Ds(e),Ts(e,!1))}function Ds(e){if(e.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||f(e.tag)||!ks(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(Ss)))}(e),1===e.type){if(!ks(e.tag)&&"slot"!==e.tag&&null==e.attrsMap["inline-template"])return;for(var t=0,n=e.children.length;t|^function(?:\s+[\w$]+)?\s*\(/,As=/\([^)]*?\);*$/,Es=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Ns={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Ps={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},Is=function(e){return"if("+e+")return null;"},Rs={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Is("$event.target !== $event.currentTarget"),ctrl:Is("!$event.ctrlKey"),shift:Is("!$event.shiftKey"),alt:Is("!$event.altKey"),meta:Is("!$event.metaKey"),left:Is("'button' in $event && $event.button !== 0"),middle:Is("'button' in $event && $event.button !== 1"),right:Is("'button' in $event && $event.button !== 2")};function zs(e,t){var n=t?"nativeOn:":"on:",r="",i="";for(var o in e){var s=js(e[o]);e[o]&&e[o].dynamic?i+=o+","+s+",":r+='"'+o+'":'+s+","}return r="{"+r.slice(0,-1)+"}",i?n+"_d("+r+",["+i.slice(0,-1)+"])":n+r}function js(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map((function(e){return js(e)})).join(",")+"]";var t=Es.test(e.value),n=$s.test(e.value),r=Es.test(e.value.replace(As,""));if(e.modifiers){var i="",o="",s=[];for(var a in e.modifiers)if(Rs[a])o+=Rs[a],Ns[a]&&s.push(a);else if("exact"===a){var l=e.modifiers;o+=Is(["ctrl","shift","alt","meta"].filter((function(e){return!l[e]})).map((function(e){return"$event."+e+"Key"})).join("||"))}else s.push(a);return s.length&&(i+=function(e){return"if(!$event.type.indexOf('key')&&"+e.map(Fs).join("&&")+")return null;"}(s)),o&&(i+=o),"function($event){"+i+(t?"return "+e.value+".apply(null, arguments)":n?"return ("+e.value+").apply(null, arguments)":r?"return "+e.value:e.value)+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function Fs(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=Ns[e],r=Ps[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var Ls={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:D},Bs=function(e){this.options=e,this.warn=e.warn||Ar,this.transforms=Er(e.modules,"transformCode"),this.dataGenFns=Er(e.modules,"genData"),this.directives=M(M({},Ls),e.directives);var t=e.isReservedTag||T;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Vs(e,t){var n=new Bs(t);return{render:"with(this){return "+(e?"script"===e.tag?"null":Ws(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function Ws(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return qs(e,t);if(e.once&&!e.onceProcessed)return Hs(e,t);if(e.for&&!e.forProcessed)return Ys(e,t);if(e.if&&!e.ifProcessed)return Js(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=Zs(e,t),i="_t("+n+(r?",function(){return "+r+"}":""),o=e.attrs||e.dynamicAttrs?ta((e.attrs||[]).concat(e.dynamicAttrs||[]).map((function(e){return{name:w(e.name),value:e.value,dynamic:e.dynamic}}))):null,s=e.attrsMap["v-bind"];!o&&!s||r||(i+=",null");o&&(i+=","+o);s&&(i+=(o?"":",null")+","+s);return i+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:Zs(t,n,!0);return"_c("+e+","+Us(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=Us(e,t));var i=e.inlineTemplate?null:Zs(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o>>0}(s):"")+")"}(e,e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var o=function(e,t){var n=e.children[0];if(n&&1===n.type){var r=Vs(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map((function(e){return"function(){"+e+"}"})).join(",")+"]}"}}(e,t);o&&(n+=o+",")}return n=n.replace(/,$/,"")+"}",e.dynamicAttrs&&(n="_b("+n+',"'+e.tag+'",'+ta(e.dynamicAttrs)+")"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function Xs(e){return 1===e.type&&("slot"===e.tag||e.children.some(Xs))}function Gs(e,t){var n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return Js(e,t,Gs,"null");if(e.for&&!e.forProcessed)return Ys(e,t,Gs);var r="_empty_"===e.slotScope?"":String(e.slotScope),i="function("+r+"){return "+("template"===e.tag?e.if&&n?"("+e.if+")?"+(Zs(e,t)||"undefined")+":undefined":Zs(e,t)||"undefined":Ws(e,t))+"}",o=r?"":",proxy:true";return"{key:"+(e.slotTarget||'"default"')+",fn:"+i+o+"}"}function Zs(e,t,n,r,i){var o=e.children;if(o.length){var s=o[0];if(1===o.length&&s.for&&"template"!==s.tag&&"slot"!==s.tag){var a=n?t.maybeComponent(s)?",1":",0":"";return""+(r||Ws)(s,t)+a}var l=n?function(e,t){for(var n=0,r=0;r':'
',sa.innerHTML.indexOf(" ")>0}var ua=!!V&&ca(!1),da=!!V&&ca(!0),ha=y((function(e){var t=tr(e);return t&&t.innerHTML})),fa=Mn.prototype.$mount;Mn.prototype.$mount=function(e,t){if((e=e&&tr(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=ha(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=la(r,{outputSourceRange:!1,shouldDecodeNewlines:ua,shouldDecodeNewlinesForHref:da,delimiters:n.delimiters,comments:n.comments},this),o=i.render,s=i.staticRenderFns;n.render=o,n.staticRenderFns=s}}return fa.call(this,e,t)},Mn.compile=la;var pa=("undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).__VUE_DEVTOOLS_GLOBAL_HOOK__;function ma(e,t){if(void 0===t&&(t=[]),null===e||"object"!=typeof e)return e;var n,r=(n=function(t){return t.original===e},t.filter(n)[0]);if(r)return r.copy;var i=Array.isArray(e)?[]:{};return t.push({original:e,copy:i}),Object.keys(e).forEach((function(n){i[n]=ma(e[n],t)})),i}function ga(e,t){Object.keys(e).forEach((function(n){return t(e[n],n)}))}function va(e){return null!==e&&"object"==typeof e}var ya=function(e,t){this.runtime=t,this._children=Object.create(null),this._rawModule=e;var n=e.state;this.state=("function"==typeof n?n():n)||{}},ba={namespaced:{configurable:!0}};ba.namespaced.get=function(){return!!this._rawModule.namespaced},ya.prototype.addChild=function(e,t){this._children[e]=t},ya.prototype.removeChild=function(e){delete this._children[e]},ya.prototype.getChild=function(e){return this._children[e]},ya.prototype.hasChild=function(e){return e in this._children},ya.prototype.update=function(e){this._rawModule.namespaced=e.namespaced,e.actions&&(this._rawModule.actions=e.actions),e.mutations&&(this._rawModule.mutations=e.mutations),e.getters&&(this._rawModule.getters=e.getters)},ya.prototype.forEachChild=function(e){ga(this._children,e)},ya.prototype.forEachGetter=function(e){this._rawModule.getters&&ga(this._rawModule.getters,e)},ya.prototype.forEachAction=function(e){this._rawModule.actions&&ga(this._rawModule.actions,e)},ya.prototype.forEachMutation=function(e){this._rawModule.mutations&&ga(this._rawModule.mutations,e)},Object.defineProperties(ya.prototype,ba);var wa,xa=function(e){this.register([],e,!1)};function Sa(e,t,n){if(t.update(n),n.modules)for(var r in n.modules){if(!t.getChild(r))return;Sa(e.concat(r),t.getChild(r),n.modules[r])}}xa.prototype.get=function(e){return e.reduce((function(e,t){return e.getChild(t)}),this.root)},xa.prototype.getNamespace=function(e){var t=this.root;return e.reduce((function(e,n){return e+((t=t.getChild(n)).namespaced?n+"/":"")}),"")},xa.prototype.update=function(e){Sa([],this.root,e)},xa.prototype.register=function(e,t,n){var r=this;void 0===n&&(n=!0);var i=new ya(t,n);0===e.length?this.root=i:this.get(e.slice(0,-1)).addChild(e[e.length-1],i);t.modules&&ga(t.modules,(function(t,i){r.register(e.concat(i),t,n)}))},xa.prototype.unregister=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1],r=t.getChild(n);r&&r.runtime&&t.removeChild(n)},xa.prototype.isRegistered=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1];return!!t&&t.hasChild(n)};var ka=function(e){var t=this;void 0===e&&(e={}),!wa&&"undefined"!=typeof window&&window.Vue&&Aa(window.Vue);var n=e.plugins;void 0===n&&(n=[]);var r=e.strict;void 0===r&&(r=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new xa(e),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new wa,this._makeLocalGettersCache=Object.create(null);var i=this,o=this.dispatch,s=this.commit;this.dispatch=function(e,t){return o.call(i,e,t)},this.commit=function(e,t,n){return s.call(i,e,t,n)},this.strict=r;var a=this._modules.root.state;Da(this,a,[],this._modules.root),_a(this,a),n.forEach((function(e){return e(t)})),(void 0!==e.devtools?e.devtools:wa.config.devtools)&&function(e){pa&&(e._devtoolHook=pa,pa.emit("vuex:init",e),pa.on("vuex:travel-to-state",(function(t){e.replaceState(t)})),e.subscribe((function(e,t){pa.emit("vuex:mutation",e,t)}),{prepend:!0}),e.subscribeAction((function(e,t){pa.emit("vuex:action",e,t)}),{prepend:!0}))}(this)},Ca={state:{configurable:!0}};function Oa(e,t,n){return t.indexOf(e)<0&&(n&&n.prepend?t.unshift(e):t.push(e)),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}function Ma(e,t){e._actions=Object.create(null),e._mutations=Object.create(null),e._wrappedGetters=Object.create(null),e._modulesNamespaceMap=Object.create(null);var n=e.state;Da(e,n,[],e._modules.root,!0),_a(e,n,t)}function _a(e,t,n){var r=e._vm;e.getters={},e._makeLocalGettersCache=Object.create(null);var i=e._wrappedGetters,o={};ga(i,(function(t,n){o[n]=function(e,t){return function(){return e(t)}}(t,e),Object.defineProperty(e.getters,n,{get:function(){return e._vm[n]},enumerable:!0})}));var s=wa.config.silent;wa.config.silent=!0,e._vm=new wa({data:{$$state:t},computed:o}),wa.config.silent=s,e.strict&&function(e){e._vm.$watch((function(){return this._data.$$state}),(function(){}),{deep:!0,sync:!0})}(e),r&&(n&&e._withCommit((function(){r._data.$$state=null})),wa.nextTick((function(){return r.$destroy()})))}function Da(e,t,n,r,i){var o=!n.length,s=e._modules.getNamespace(n);if(r.namespaced&&(e._modulesNamespaceMap[s],e._modulesNamespaceMap[s]=r),!o&&!i){var a=Ta(t,n.slice(0,-1)),l=n[n.length-1];e._withCommit((function(){wa.set(a,l,r.state)}))}var c=r.context=function(e,t,n){var r=""===t,i={dispatch:r?e.dispatch:function(n,r,i){var o=$a(n,r,i),s=o.payload,a=o.options,l=o.type;return a&&a.root||(l=t+l),e.dispatch(l,s)},commit:r?e.commit:function(n,r,i){var o=$a(n,r,i),s=o.payload,a=o.options,l=o.type;a&&a.root||(l=t+l),e.commit(l,s,a)}};return Object.defineProperties(i,{getters:{get:r?function(){return e.getters}:function(){return function(e,t){if(!e._makeLocalGettersCache[t]){var n={},r=t.length;Object.keys(e.getters).forEach((function(i){if(i.slice(0,r)===t){var o=i.slice(r);Object.defineProperty(n,o,{get:function(){return e.getters[i]},enumerable:!0})}})),e._makeLocalGettersCache[t]=n}return e._makeLocalGettersCache[t]}(e,t)}},state:{get:function(){return Ta(e.state,n)}}}),i}(e,s,n);r.forEachMutation((function(t,n){!function(e,t,n,r){(e._mutations[t]||(e._mutations[t]=[])).push((function(t){n.call(e,r.state,t)}))}(e,s+n,t,c)})),r.forEachAction((function(t,n){var r=t.root?n:s+n,i=t.handler||t;!function(e,t,n,r){(e._actions[t]||(e._actions[t]=[])).push((function(t){var i,o=n.call(e,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:e.getters,rootState:e.state},t);return(i=o)&&"function"==typeof i.then||(o=Promise.resolve(o)),e._devtoolHook?o.catch((function(t){throw e._devtoolHook.emit("vuex:error",t),t})):o}))}(e,r,i,c)})),r.forEachGetter((function(t,n){!function(e,t,n,r){if(e._wrappedGetters[t])return;e._wrappedGetters[t]=function(e){return n(r.state,r.getters,e.state,e.getters)}}(e,s+n,t,c)})),r.forEachChild((function(r,o){Da(e,t,n.concat(o),r,i)}))}function Ta(e,t){return t.reduce((function(e,t){return e[t]}),e)}function $a(e,t,n){return va(e)&&e.type&&(n=t,t=e,e=e.type),{type:e,payload:t,options:n}}function Aa(e){wa&&e===wa|| /*! * vuex v3.6.2 * (c) 2021 Evan You * @license MIT */ function(e){if(Number(e.version.split(".")[0])>=2)e.mixin({beforeCreate:n});else{var t=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[n].concat(e.init):n,t.call(this,e)}}function n(){var e=this.$options;e.store?this.$store="function"==typeof e.store?e.store():e.store:e.parent&&e.parent.$store&&(this.$store=e.parent.$store)}}(wa=e)}Ca.state.get=function(){return this._vm._data.$$state},Ca.state.set=function(e){},ka.prototype.commit=function(e,t,n){var r=this,i=$a(e,t,n),o=i.type,s=i.payload,a={type:o,payload:s},l=this._mutations[o];l&&(this._withCommit((function(){l.forEach((function(e){e(s)}))})),this._subscribers.slice().forEach((function(e){return e(a,r.state)})))},ka.prototype.dispatch=function(e,t){var n=this,r=$a(e,t),i=r.type,o=r.payload,s={type:i,payload:o},a=this._actions[i];if(a){try{this._actionSubscribers.slice().filter((function(e){return e.before})).forEach((function(e){return e.before(s,n.state)}))}catch(wy){}var l=a.length>1?Promise.all(a.map((function(e){return e(o)}))):a[0](o);return new Promise((function(e,t){l.then((function(t){try{n._actionSubscribers.filter((function(e){return e.after})).forEach((function(e){return e.after(s,n.state)}))}catch(wy){}e(t)}),(function(e){try{n._actionSubscribers.filter((function(e){return e.error})).forEach((function(t){return t.error(s,n.state,e)}))}catch(wy){}t(e)}))}))}},ka.prototype.subscribe=function(e,t){return Oa(e,this._subscribers,t)},ka.prototype.subscribeAction=function(e,t){return Oa("function"==typeof e?{before:e}:e,this._actionSubscribers,t)},ka.prototype.watch=function(e,t,n){var r=this;return this._watcherVM.$watch((function(){return e(r.state,r.getters)}),t,n)},ka.prototype.replaceState=function(e){var t=this;this._withCommit((function(){t._vm._data.$$state=e}))},ka.prototype.registerModule=function(e,t,n){void 0===n&&(n={}),"string"==typeof e&&(e=[e]),this._modules.register(e,t),Da(this,this.state,e,this._modules.get(e),n.preserveState),_a(this,this.state)},ka.prototype.unregisterModule=function(e){var t=this;"string"==typeof e&&(e=[e]),this._modules.unregister(e),this._withCommit((function(){var n=Ta(t.state,e.slice(0,-1));wa.delete(n,e[e.length-1])})),Ma(this)},ka.prototype.hasModule=function(e){return"string"==typeof e&&(e=[e]),this._modules.isRegistered(e)},ka.prototype.hotUpdate=function(e){this._modules.update(e),Ma(this,!0)},ka.prototype._withCommit=function(e){var t=this._committing;this._committing=!0,e(),this._committing=t},Object.defineProperties(ka.prototype,Ca);var Ea=za((function(e,t){var n={};return Ra(t).forEach((function(t){var r=t.key,i=t.val;n[r]=function(){var t=this.$store.state,n=this.$store.getters;if(e){var r=ja(this.$store,"mapState",e);if(!r)return;t=r.context.state,n=r.context.getters}return"function"==typeof i?i.call(this,t,n):t[i]},n[r].vuex=!0})),n})),Na=za((function(e,t){var n={};return Ra(t).forEach((function(t){var r=t.key,i=t.val;n[r]=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];var r=this.$store.commit;if(e){var o=ja(this.$store,"mapMutations",e);if(!o)return;r=o.context.commit}return"function"==typeof i?i.apply(this,[r].concat(t)):r.apply(this.$store,[i].concat(t))}})),n})),Pa=za((function(e,t){var n={};return Ra(t).forEach((function(t){var r=t.key,i=t.val;i=e+i,n[r]=function(){if(!e||ja(this.$store,"mapGetters",e))return this.$store.getters[i]},n[r].vuex=!0})),n})),Ia=za((function(e,t){var n={};return Ra(t).forEach((function(t){var r=t.key,i=t.val;n[r]=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];var r=this.$store.dispatch;if(e){var o=ja(this.$store,"mapActions",e);if(!o)return;r=o.context.dispatch}return"function"==typeof i?i.apply(this,[r].concat(t)):r.apply(this.$store,[i].concat(t))}})),n}));function Ra(e){return function(e){return Array.isArray(e)||va(e)}(e)?Array.isArray(e)?e.map((function(e){return{key:e,val:e}})):Object.keys(e).map((function(t){return{key:t,val:e[t]}})):[]}function za(e){return function(t,n){return"string"!=typeof t?(n=t,t=""):"/"!==t.charAt(t.length-1)&&(t+="/"),e(t,n)}}function ja(e,t,n){return e._modulesNamespaceMap[n]}function Fa(e,t,n){var r=n?e.groupCollapsed:e.group;try{r.call(e,t)}catch(wy){e.log(t)}}function La(e){try{e.groupEnd()}catch(wy){e.log("—— log end ——")}}function Ba(){var e=new Date;return" @ "+Va(e.getHours(),2)+":"+Va(e.getMinutes(),2)+":"+Va(e.getSeconds(),2)+"."+Va(e.getMilliseconds(),3)}function Va(e,t){return n="0",r=t-e.toString().length,new Array(r+1).join(n)+e;var n,r}var Wa={Store:ka,install:Aa,version:"3.6.2",mapState:Ea,mapMutations:Na,mapGetters:Pa,mapActions:Ia,createNamespacedHelpers:function(e){return{mapState:Ea.bind(null,e),mapGetters:Pa.bind(null,e),mapMutations:Na.bind(null,e),mapActions:Ia.bind(null,e)}},createLogger:function(e){void 0===e&&(e={});var t=e.collapsed;void 0===t&&(t=!0);var n=e.filter;void 0===n&&(n=function(e,t,n){return!0});var r=e.transformer;void 0===r&&(r=function(e){return e});var i=e.mutationTransformer;void 0===i&&(i=function(e){return e});var o=e.actionFilter;void 0===o&&(o=function(e,t){return!0});var s=e.actionTransformer;void 0===s&&(s=function(e){return e});var a=e.logMutations;void 0===a&&(a=!0);var l=e.logActions;void 0===l&&(l=!0);var c=e.logger;return void 0===c&&(c=console),function(e){var u=ma(e.state);void 0!==c&&(a&&e.subscribe((function(e,o){var s=ma(o);if(n(e,u,s)){var a=Ba(),l=i(e),d="mutation "+e.type+a;Fa(c,d,t),c.log("%c prev state","color: #9E9E9E; font-weight: bold",r(u)),c.log("%c mutation","color: #03A9F4; font-weight: bold",l),c.log("%c next state","color: #4CAF50; font-weight: bold",r(s)),La(c)}u=s})),l&&e.subscribeAction((function(e,n){if(o(e,n)){var r=Ba(),i=s(e),a="action "+e.type+r;Fa(c,a,t),c.log("%c action","color: #03A9F4; font-weight: bold",i),La(c)}})))}}};function qa(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map((function(e){e(n)})),(r=e.get("*"))&&r.slice().map((function(e){e(t,n)}))}}}var Ha,Ja,Ka="function"==typeof Map?new Map:(Ha=[],Ja=[],{has:function(e){return Ha.indexOf(e)>-1},get:function(e){return Ja[Ha.indexOf(e)]},set:function(e,t){-1===Ha.indexOf(e)&&(Ha.push(e),Ja.push(t))},delete:function(e){var t=Ha.indexOf(e);t>-1&&(Ha.splice(t,1),Ja.splice(t,1))}}),Ya=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(wy){Ya=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function Ua(e){var t=Ka.get(e);t&&t.destroy()}function Xa(e){var t=Ka.get(e);t&&t.update()}var Ga=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((Ga=function(e){return e}).destroy=function(e){return e},Ga.update=function(e){return e}):((Ga=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return function(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!Ka.has(e)){var t,n=null,r=null,i=null,o=function(){e.clientWidth!==r&&c()},s=function(t){window.removeEventListener("resize",o,!1),e.removeEventListener("input",c,!1),e.removeEventListener("keyup",c,!1),e.removeEventListener("autosize:destroy",s,!1),e.removeEventListener("autosize:update",c,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),Ka.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",s,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",c,!1),window.addEventListener("resize",o,!1),e.addEventListener("input",c,!1),e.addEventListener("autosize:update",c,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",Ka.set(e,{destroy:s,update:c}),"vertical"===(t=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),n="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(n)&&(n=0),c()}function a(t){var n=e.style.width;e.style.width="0px",e.style.width=n,e.style.overflowY=t}function l(){if(0!==e.scrollHeight){var t=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),i=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+n+"px",r=e.clientWidth,t.forEach((function(e){e.node.scrollTop=e.scrollTop})),i&&(document.documentElement.scrollTop=i)}}function c(){l();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r=t?e:""+Array(t+1-r.length).join(n)+e},y={s:v,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+v(r,2,"0")+":"+v(i,2,"0")},m:function e(t,n){if(t.date()1)return e(s[0])}else{var a=t.name;w[a]=t,i=a}return!r&&i&&(b=i),i||!r&&b},k=function(e,t){if(x(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new O(n)},C=y;C.l=S,C.i=x,C.w=function(e,t){return k(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var O=function(){function g(e){this.$L=S(e.locale,null,!0),this.parse(e)}var v=g.prototype;return v.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(C.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(p);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},v.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},v.$utils=function(){return C},v.isValid=function(){return!(this.$d.toString()===f)},v.isSame=function(e,t){var n=k(e);return this.startOf(t)<=n&&n<=this.endOf(t)},v.isAfter=function(e,t){return k(e)68?1900:2e3)},a=function(e){return function(t){this[e]=+t}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if("Z"===e)return 0;var t=e.match(/([+-]|\d\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:"+"===t[0]?-n:n}(e)}],c=function(e){var t=o[e];return t&&(t.indexOf?t:t.s.concat(t.f))},u=function(e,t){var n,r=o.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?"pm":"PM");return n},d={A:[i,function(e){this.afternoon=u(e,!1)}],a:[i,function(e){this.afternoon=u(e,!0)}],S:[/\d/,function(e){this.milliseconds=100*+e}],SS:[n,function(e){this.milliseconds=10*+e}],SSS:[/\d{3}/,function(e){this.milliseconds=+e}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n,a("day")],Do:[i,function(e){var t=o.ordinal,n=e.match(/\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\[|\]/g,"")===e&&(this.day=r)}],M:[r,a("month")],MM:[n,a("month")],MMM:[i,function(e){var t=c("months"),n=(c("monthsShort")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[i,function(e){var t=c("months").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\d+/,a("year")],YY:[n,function(e){this.year=s(e)}],YYYY:[/\d{4}/,a("year")],Z:l,ZZ:l};function h(n){var r,i;r=n,i=o&&o.formats;for(var s=(n=r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),a=s.length,l=0;l-1)return new Date(("X"===t?1e3:1)*e);var r=h(t)(e),i=r.year,o=r.month,s=r.day,a=r.hours,l=r.minutes,c=r.seconds,u=r.milliseconds,d=r.zone,f=new Date,p=s||(i||o?1:f.getDate()),m=i||f.getFullYear(),g=0;i&&!o||(g=o>0?o-1:f.getMonth());var v=a||0,y=l||0,b=c||0,w=u||0;return d?new Date(Date.UTC(m,g,p,v,y,b,w+60*d.offset*1e3)):n?new Date(Date.UTC(m,g,p,v,y,b,w)):new Date(m,g,p,v,y,b,w)}catch(x){return new Date("")}}(t,a,r),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(a)&&(this.$d=new Date("")),o={}}else if(a instanceof Array)for(var f=a.length,p=1;p<=f;p+=1){s[1]=a[p-1];var m=n.apply(this,s);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}p===f&&(this.$d=new Date(""))}else i.call(this,e)}}}();function il(e){return(il="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var ol={selector:"vue-portal-target-".concat(((e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t})())},sl=function(e){return ol.selector=e},al="undefined"!=typeof window&&void 0!==("undefined"==typeof document?"undefined":il(document)),ll=Mn.extend({abstract:!0,name:"PortalOutlet",props:["nodes","tag"],data:function(e){return{updatedNodes:e.nodes}},render:function(e){var t=this.updatedNodes&&this.updatedNodes();return t?1!==t.length||t[0].text?e(this.tag||"DIV",t):t:e()},destroyed:function(){var e=this.$el;e&&e.parentNode.removeChild(e)}}),cl=Mn.extend({name:"VueSimplePortal",props:{disabled:{type:Boolean},prepend:{type:Boolean},selector:{type:String,default:function(){return"#".concat(ol.selector)}},tag:{type:String,default:"DIV"}},render:function(e){if(this.disabled){var t=this.$scopedSlots&&this.$scopedSlots.default();return t?t.length<2&&!t[0].text?t:e(this.tag,t):e()}return e()},created:function(){this.getTargetEl()||this.insertTargetEl()},updated:function(){var e=this;this.$nextTick((function(){e.disabled||e.slotFn===e.$scopedSlots.default||(e.container.updatedNodes=e.$scopedSlots.default),e.slotFn=e.$scopedSlots.default}))},beforeDestroy:function(){this.unmount()},watch:{disabled:{immediate:!0,handler:function(e){e?this.unmount():this.$nextTick(this.mount)}}},methods:{getTargetEl:function(){if(al)return document.querySelector(this.selector)},insertTargetEl:function(){if(al){var e=document.querySelector("body"),t=document.createElement(this.tag);t.id=this.selector.substring(1),e.appendChild(t)}},mount:function(){if(al){var e=this.getTargetEl(),t=document.createElement("DIV");this.prepend&&e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t),this.container=new ll({el:t,parent:this,propsData:{tag:this.tag,nodes:this.$scopedSlots.default}})}},unmount:function(){this.container&&(this.container.$destroy(),delete this.container)}}});function ul(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.component(t.name||"portal",cl),t.defaultSelector&&sl(t.defaultSelector)}"undefined"!=typeof window&&window.Vue&&window.Vue===Mn&&Mn.use(ul);var dl={},hl={};function fl(e){return null==e}function pl(e){return null!=e}function ml(e,t){return t.tag===e.tag&&t.key===e.key}function gl(e){var t=e.tag;e.vm=new t({data:e.args})}function vl(e,t,n){var r,i,o={};for(r=t;r<=n;++r)pl(i=e[r].key)&&(o[i]=r);return o}function yl(e,t,n){for(;t<=n;++t)gl(e[t])}function bl(e,t,n){for(;t<=n;++t){var r=e[t];pl(r)&&(r.vm.$destroy(),r.vm=null)}}function wl(e,t){e!==t&&(t.vm=e.vm,function(e){for(var t=Object.keys(e.args),n=0;na?yl(t,s,u):s>u&&bl(e,o,a)}(e,t):pl(t)?yl(t,0,t.length-1):pl(e)&&bl(e,0,e.length-1)};var xl={};function Sl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function kl(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?a:a.$sub[0]:null}}},computed:{run:function(){var e=this,t=this.lazyParentModel();if(Array.isArray(t)&&t.__ob__){var n=t.__ob__.dep;n.depend();var r=n.constructor.target;if(!this._indirectWatcher){var i=r.constructor;this._indirectWatcher=new i(this,(function(){return e.runRule(t)}),null,{lazy:!0})}var o=this.getModel();if(!this._indirectWatcher.dirty&&this._lastModel===o)return this._indirectWatcher.depend(),r.value;this._lastModel=o,this._indirectWatcher.evaluate(),this._indirectWatcher.depend()}else this._indirectWatcher&&(this._indirectWatcher.teardown(),this._indirectWatcher=null);return this._indirectWatcher?this._indirectWatcher.value:this.runRule(t)},$params:function(){return this.run.params},proxy:function(){var e=this.run.output;return e.__isVuelidateAsyncVm?!!e.v:!!e},$pending:function(){var e=this.run.output;return!!e.__isVuelidateAsyncVm&&e.p}},destroyed:function(){this._indirectWatcher&&(this._indirectWatcher.teardown(),this._indirectWatcher=null)}}),a=i.extend({data:function(){return{dirty:!1,validations:null,lazyModel:null,model:null,prop:null,lazyParentModel:null,rootModel:null}},methods:s(s({},g),{},{refProxy:function(e){return this.getRef(e).proxy},getRef:function(e){return this.refs[e]},isNested:function(e){return"function"!=typeof this.validations[e]}}),computed:s(s({},p),{},{nestedKeys:function(){return this.keys.filter(this.isNested)},ruleKeys:function(){var e=this;return this.keys.filter((function(t){return!e.isNested(t)}))},keys:function(){return Object.keys(this.validations).filter((function(e){return"$params"!==e}))},proxy:function(){var e=this,t=u(this.keys,(function(t){return{enumerable:!0,configurable:!0,get:function(){return e.refProxy(t)}}})),n=u(v,(function(t){return{enumerable:!0,configurable:!0,get:function(){return e[t]}}})),r=u(y,(function(t){return{enumerable:!1,configurable:!0,get:function(){return e[t]}}})),i=this.hasIter()?{$iter:{enumerable:!0,value:Object.defineProperties({},s({},t))}}:{};return Object.defineProperties({},s(s(s(s({},t),i),{},{$model:{enumerable:!0,get:function(){var t=e.lazyParentModel();return null!=t?t[e.prop]:null},set:function(t){var n=e.lazyParentModel();null!=n&&(n[e.prop]=t,e.$touch())}}},n),r))},children:function(){var e=this;return[].concat(r(this.nestedKeys.map((function(t){return w(e,t)}))),r(this.ruleKeys.map((function(t){return x(e,t)})))).filter(Boolean)}})}),l=a.extend({methods:{isNested:function(e){return void 0!==this.validations[e]()},getRef:function(e){var t=this;return{get proxy(){return t.validations[e]()||!1}}}}}),m=a.extend({computed:{keys:function(){var e=this.getModel();return h(e)?Object.keys(e):[]},tracker:function(){var e=this,t=this.validations.$trackBy;return t?function(n){return"".concat(f(e.rootModel,e.getModelKey(n),t))}:function(e){return"".concat(e)}},getModelLazy:function(){var e=this;return function(){return e.getModel()}},children:function(){var e=this,n=this.validations,r=this.getModel(),i=s({},n);delete i.$trackBy;var o={};return this.keys.map((function(n){var s=e.tracker(n);return o.hasOwnProperty(s)?null:(o[s]=!0,(0,t.h)(a,s,{validations:i,prop:n,lazyParentModel:e.getModelLazy,model:r[n],rootModel:e.rootModel}))})).filter(Boolean)}},methods:{isNested:function(){return!0},getRef:function(e){return this.refs[this.tracker(e)]},hasIter:function(){return!0}}}),w=function(e,n){if("$each"===n)return(0,t.h)(m,n,{validations:e.validations[n],lazyParentModel:e.lazyParentModel,prop:n,lazyModel:e.getModel,rootModel:e.rootModel});var r=e.validations[n];if(Array.isArray(r)){var i=e.rootModel,o=u(r,(function(e){return function(){return f(i,i.$v,e)}}),(function(e){return Array.isArray(e)?e.join("."):e}));return(0,t.h)(l,n,{validations:o,lazyParentModel:c,prop:n,lazyModel:c,rootModel:i})}return(0,t.h)(a,n,{validations:r,lazyParentModel:e.getModel,prop:n,lazyModel:e.getModelKey,rootModel:e.rootModel})},x=function(e,n){return(0,t.h)(o,n,{rule:e.validations[n],lazyParentModel:e.lazyParentModel,lazyModel:e.getModel,rootModel:e.rootModel})};return b={VBase:i,Validation:a}},x=null;var S=function(e,n){var r=function(e){if(x)return x;for(var t=e.constructor;t.super;)t=t.super;return x=t,t}(e),i=w(r),o=i.Validation;return new(0,i.VBase)({computed:{children:function(){var r="function"==typeof n?n.call(e):n;return[(0,t.h)(o,"$v",{validations:r,lazyParentModel:c,prop:"$v",model:e,rootModel:e})]}}})},k={data:function(){var e=this.$options.validations;return e&&(this._vuelidate=S(this,e)),{}},beforeCreate:function(){var e=this.$options;e.validations&&(e.computed||(e.computed={}),e.computed.$v||(e.computed.$v=function(){return this._vuelidate?this._vuelidate.refs.$v.proxy:null}))},beforeDestroy:function(){this._vuelidate&&(this._vuelidate.$destroy(),this._vuelidate=null)}};function C(e){e.mixin(k)}e.validationMixin=k;var O=C;e.default=O}(dl);var El=Qa(dl);function Nl(e){this.content=e}function Pl(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i!=o){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let e=0;i.text[e]==o.text[e];e++)n++;return n}if(i.content.size||o.content.size){let e=Pl(i.content,o.content,n+1);if(null!=e)return e}n+=i.nodeSize}else n+=i.nodeSize}}function Il(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};let s=e.child(--i),a=t.child(--o),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let e=0,t=Math.min(s.text.length,a.text.length);for(;e>1}},Nl.from=function(e){if(e instanceof Nl)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Nl(t)};class Rl{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let n=0;ne&&!1!==n(a,r+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,e-i),Math.min(a.content.size,t-i),n,r+i)}s=l}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,((s,a)=>{s.isText?(i+=s.text.slice(Math.max(e,a)-a,t-a),o=!n):s.isLeaf&&r?(i+="function"==typeof r?r(s):r,o=!n):!o&&s.isBlock&&(i+=n,o=!0)}),0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);ie)for(let i=0,o=0;oe&&((ot)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),r+=s.nodeSize),o=a}return new Rl(n,r)}cutByIndex(e,t){return e==t?Rl.empty:0==e&&t==this.content.length?this:new Rl(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new Rl(r,i)}addToStart(e){return new Rl([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Rl(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=e)return i==e||t>0?jl(n+1,i):jl(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((e=>e.toJSON())):null}static fromJSON(e,t){if(!t)return Rl.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new Rl(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Rl.empty;let t,n=0;for(let r=0;rthis.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;te.type.rank-t.type.rank)),t}}Ll.none=[];class Bl extends Error{}class Vl{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=ql(this.content,e+this.openStart,t);return n&&new Vl(n,this.openStart,this.openEnd)}removeBetween(e,t){return new Vl(Wl(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return Vl.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new Vl(Rl.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)r++;return new Vl(e,n,r)}}function Wl(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(i==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(Wl(o.content,t-i-1,n-i-1)))}function ql(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i);if(o==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let a=ql(s.content,t-o-1,n);return a&&e.replaceChild(i,s.copy(a))}function Hl(e,t,n){if(n.openStart>e.depth)throw new Bl("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Bl("Inconsistent open depths");return Jl(e,t,n,0)}function Jl(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r=0;i--)r=t.node(i).copy(Rl.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return Gl(o,Zl(e,i,s,t,r))}{let r=e.parent,i=r.content;return Gl(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}}return Gl(o,Ql(e,t,r))}function Kl(e,t){if(!t.type.compatibleContent(e.type))throw new Bl("Cannot join "+t.type.name+" onto "+e.type.name)}function Yl(e,t,n){let r=e.node(n);return Kl(r,t.node(n)),r}function Ul(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Xl(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(Ul(e.nodeAfter,r),o++));for(let a=o;ai&&Yl(e,t,i+1),s=r.depth>i&&Yl(n,r,i+1),a=[];return Xl(null,e,i,a),o&&s&&t.index(i)==n.index(i)?(Kl(o,s),Ul(Gl(o,Zl(e,t,n,r,i+1)),a)):(o&&Ul(Gl(o,Ql(e,t,i+1)),a),Xl(t,n,i,a),s&&Ul(Gl(s,Ql(n,r,i+1)),a)),Xl(r,null,i,a),new Rl(a)}function Ql(e,t,n){let r=[];if(Xl(null,e,n,r),e.depth>n){Ul(Gl(Yl(e,t,n+1),Ql(e,t,n+1)),r)}return Xl(t,null,n,r),new Rl(r)}Vl.empty=new Vl(Rl.empty,0,0);class ec{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let i=0;i0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new ic(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let o=e;;){let{index:e,offset:t}=o.content.findIndex(i),s=i-t;if(n.push(o,e,r+t),!s)break;if(o=o.child(e),o.isText)break;i=s-1,r+=t+1}return new ec(t,n,i)}static resolveCached(e,t){for(let r=0;re&&this.nodesBetween(e,t,(e=>(n.isInSet(e.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),lc(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=Rl.empty,r=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let a=r;ae.type.name))}`);this.content.forEach((e=>e.check()))}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((e=>e.toJSON()))),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=Rl.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}}sc.prototype.text=void 0;class ac extends sc{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):lc(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ac(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ac(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function lc(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class cc{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new uc(e,t);if(null==n.next)return cc.empty;let r=dc(n);n.next&&n.err("Unexpected trailing text");let i=function(e){let t=Object.create(null);return n(vc(e,0));function n(r){let i=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let o=t[r.join(",")]=new cc(r.indexOf(e.length-1)>-1);for(let e=0;ee.to=t))}function o(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(o(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let s=n();return r(t,s),i(o(e.expr,s),s),[r(s)]}if("plus"==e.type){let s=n();return i(o(e.expr,t),s),i(o(e.expr,s),s),[r(s)]}if("opt"==e.type)return[r(t)].concat(o(e.expr,t));if("range"==e.type){let s=t;for(let t=0;te.createAndFill())));for(let e=0;e=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r{let r=n+(t.validEnd?"*":" ")+" ";for(let i=0;i"+e.indexOf(t.next[i].next);return r})).join("\n")}}cc.empty=new cc(!0);class uc{constructor(e,t){this.string=e,this.nodeTypes=t,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()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function dc(e){let t=[];do{t.push(hc(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function hc(e){let t=[];do{t.push(fc(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function fc(e){let t=function(e){if(e.eat("(")){let t=dc(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let e=n[o];e.groups.indexOf(t)>-1&&i.push(e)}0==i.length&&e.err("No node type or group '"+t+"' found");return i}(e,e.next).map((t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t})));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=mc(e,t)}return t}function pc(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function mc(e,t){let n=pc(e),r=n;return e.eat(",")&&(r="}"!=e.next?pc(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function gc(e,t){return t-e}function vc(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;tn[e]=new xc(e,t,r)));let r=t.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(let i in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class Sc{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class kc{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=wc(r.attrs),this.excluded=null;let i=yc(this.attrs);this.instance=i?new Ll(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Ll(this,bc(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,i)=>n[e]=new kc(e,r++,t,i))),n}removeFromSet(e){for(var t=0;t-1}}class Cc{constructor(e){this.cached=Object.create(null),this.spec={nodes:Nl.from(e.nodes),marks:Nl.from(e.marks||{}),topNode:e.topNode},this.nodes=xc.compile(this.spec.nodes,this),this.marks=kc.compile(this.spec.marks,this);let t=Object.create(null);for(let n in this.nodes){if(n in this.marks)throw new RangeError(n+" can not be both a node and a mark");let e=this.nodes[n],r=e.spec.content||"",i=e.spec.marks;e.contentMatch=t[r]||(t[r]=cc.parse(r,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.markSet="_"==i?null:i?Oc(this,i.split(" ")):""!=i&&e.inlineContent?null:[]}for(let n in this.marks){let e=this.marks[n],t=e.spec.excludes;e.excluded=null==t?[e]:""==t?[]:Oc(this,t.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)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof xc))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new ac(n,n.defaultAttrs,e,Ll.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return sc.fromJSON(this,e)}markFromJSON(e){return Ll.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Oc(e,t){let n=[];for(let r=0;r-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class Mc{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((e=>{e.tag?this.tags.push(e):e.style&&this.styles.push(e)})),this.normalizeLists=!this.tags.some((t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}parse(e,t={}){let n=new Ec(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Ec(this,t,!0);return n.addAll(e,t.from,t.to),Vl.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;re.length&&(61!=o.charCodeAt(e.length)||o.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r{n(e=Pc(e)),e.mark=r}))}for(let r in e.nodes){let t=e.nodes[r].spec.parseDOM;t&&t.forEach((e=>{n(e=Pc(e)),e.node=r}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Mc(e,Mc.schemaRules(e)))}}const _c={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},Dc={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Tc={ol:!0,ul:!0};function $c(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class Ac{constructor(e,t,n,r,i,o,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=Ll.none,this.stashMarks=[],this.match=o||(4&s?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Rl.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.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))}}let t=Rl.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Rl.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;tthis.insertNode(e)));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}addAll(e,t,n){let r=t||0;for(let i=t?e.childNodes[t]:e.firstChild,o=null==n?null:e.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(i);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],o=i.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=i,!o.length))break;if(i.solid)break}if(!t)return!1;this.sync(n);for(let r=0;rthis.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}addPendingMark(e){let t=function(e,t){for(let n=0;n=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);let t=r.popFromStashMark(e);t&&r.type&&r.type.allowsMarkType(t.type)&&(r.activeMarks=t.addToSet(r.activeMarks))}if(r==t)break}}}function Nc(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Pc(e){let t={};for(let n in e)t[n]=e[n];return t}function Ic(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n{if(i.length||e.marks.length){let n=0,o=0;for(;n=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&Rc.renderSpec(jc(n),r(e,t))}static renderSpec(e,t,n=null){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r,i=t[0],o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s=n?e.createElementNS(n,i):e.createElement(i),a=t[1],l=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){l=2;for(let e in a)if(null!=a[e]){let t=e.indexOf(" ");t>0?s.setAttributeNS(e.slice(0,t),e.slice(t+1),a[e]):s.setAttribute(e,a[e])}}for(let c=l;cl)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:t,contentDOM:o}=Rc.renderSpec(e,i,n);if(s.appendChild(t),o){if(r)throw new RangeError("Multiple content holes");r=o}}}return{dom:s,contentDOM:r}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Rc(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=zc(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return zc(e.marks)}}function zc(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function jc(e){return e.document||window.document}const Fc=Math.pow(2,16);function Lc(e){return 65535&e}class Bc{constructor(e,t=!1,n=null){this.pos=e,this.deleted=t,this.recover=n}}class Vc{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Vc.empty)return Vc.empty}recover(e){let t=0,n=Lc(e);if(!this.inverted)for(let r=0;re)break;let l=this.ranges[s+i],c=this.ranges[s+o],u=a+l;if(e<=u){let i=a+r+((l?e==a?-1:e==u?1:t:t)<0?0:c);if(n)return i;let o=e==(t<0?a:u)?null:s/3+(e-a)*Fc;return new Bc(i,t<0?e!=a:e!=u,o)}r+=c-l}return n?e+r:new Bc(e+r)}touches(e,t){let n=0,r=Lc(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;se)break;let a=this.ranges[s+i];if(e<=t+a&&s==3*r)return!0;n+=this.ranges[s+o]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r=0;t--){let r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new Wc;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;ni&&te.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return Jc.fromReplace(e,this.from,this.to,i)}invert(){return new Uc(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Yc(t.pos,n.pos,this.mark)}merge(e){return e instanceof Yc&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Yc(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Yc(t.from,t.to,e.markFromJSON(t.mark))}}Hc.jsonID("addMark",Yc);class Uc extends Hc{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new Vl(Kc(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return Jc.fromReplace(e,this.from,this.to,n)}invert(){return new Yc(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Uc(t.pos,n.pos,this.mark)}merge(e){return e instanceof Uc&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Uc(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Uc(t.from,t.to,e.markFromJSON(t.mark))}}Hc.jsonID("removeMark",Uc);class Xc extends Hc{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Zc(e,this.from,this.to)?Jc.fail("Structure replace would overwrite content"):Jc.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Vc([this.from,this.to-this.from,this.slice.size])}invert(e){return new Xc(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted?null:new Xc(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof Xc)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?Vl.empty:new Vl(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Xc(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?Vl.empty:new Vl(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Xc(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Xc(t.from,t.to,Vl.fromJSON(e,t.slice),!!t.structure)}}Hc.jsonID("replace",Xc);class Gc extends Hc{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(Zc(e,this.from,this.gapFrom)||Zc(e,this.gapTo,this.to)))return Jc.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Jc.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Jc.fromReplace(e,this.from,this.to,n):Jc.fail("Content does not fit in gap")}getMap(){return new Vc([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Gc(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return t.deleted&&n.deleted||rn.pos?null:new Gc(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Gc(t.from,t.to,t.gapFrom,t.gapTo,Vl.fromJSON(e,t.slice),t.insert,!!t.structure)}}function Zc(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function Qc(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function eu(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(no;c--,u--){let e=i.node(c),t=i.index(c);if(e.type.spec.isolating)return!1;let n=e.content.cutByIndex(t,e.childCount),o=r&&r[u]||e;if(o!=e&&(n=n.replaceChild(0,o.type.create(o.attrs))),!e.canReplace(t+1,e.childCount)||!o.type.validContent(n))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function iu(e,t){let n=e.resolve(t),r=n.index();return i=n.nodeBefore,o=n.nodeAfter,!(!i||!o||i.isLeaf||!i.canAppend(o))&&n.parent.canReplace(r,r+1);var i,o}function ou(e,t,n=t,r=Vl.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return su(i,o,r)?new Xc(t,n,r):new au(i,o,r).fit()}function su(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}Hc.jsonID("replaceAround",Gc);class au{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=Rl.empty;for(let r=0;r<=e.depth;r++){let t=e.node(r);this.frontier.push({type:t.type,match:t.contentMatchAt(e.indexAfter(r))})}for(let r=e.depth;r>0;r--)this.placed=Rl.from(e.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let a=new Vl(i,o,s);return e>-1?new Gc(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new Xc(n.pos,r.pos,a):null}findFittable(){for(let e=1;e<=2;e++)for(let t=this.unplaced.openStart;t>=0;t--){let n,r=null;t?(r=uu(this.unplaced.content,t-1).firstChild,n=r.content):n=this.unplaced.content;let i=n.firstChild;for(let o=this.depth;o>=0;o--){let n,{type:s,match:a}=this.frontier[o],l=null;if(1==e&&(i?a.matchType(i.type)||(l=a.fillBefore(Rl.from(i),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:t,frontierDepth:o,parent:r,inject:l};if(2==e&&i&&(n=a.findWrapping(i.type)))return{sliceDepth:t,frontierDepth:o,parent:r,wrap:n};if(r&&a.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=uu(e,t);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new Vl(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=uu(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new Vl(lu(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new Vl(lu(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let p=0;p1||0==a||e.content.size)&&(u=t,c.push(du(e.mark(d.allowedMarks(e.marks)),1==l?a:0,l==s.childCount?h:-1)))}let f=l==s.childCount;f||(h=-1),this.placed=cu(this.placed,t,Rl.from(c)),this.frontier[t].match=u,f&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let p=0,m=s;p1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t=0;n--){let{match:t,type:r}=this.frontier[n],i=hu(e,n,r,t,!0);if(!i||i.childCount)continue e}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=cu(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=cu(this.placed,this.depth,Rl.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(Rl.empty,!0);e.childCount&&(this.placed=cu(this.placed,this.frontier.length,e))}}function lu(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(lu(e.firstChild.content,t-1,n)))}function cu(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(cu(e.lastChild.content,t-1,n)))}function uu(e,t){for(let n=0;n1&&(r=r.replaceChild(0,du(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(Rl.empty,!0)))),e.copy(r)}function hu(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(e,t,n){for(let r=n;rr){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(Rl.empty,!0))}return e}function mu(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let i=e.start(r);if(it.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(i==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==i-1)&&n.push(r)}return n}let gu=class extends Error{};gu=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(gu.prototype=Object.create(Error.prototype)).constructor=gu,gu.prototype.name="TransformError";const vu=Object.create(null);class yu{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new bu(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;i--){let r=t<0?Du(e.node(0),e.node(i),e.before(i+1),e.index(i),t,n):Du(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,n);if(r)return r}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Mu(e.node(0))}static atStart(e){return Du(e,e,0,0,1)||new Mu(e)}static atEnd(e){return Du(e,e,e.content.size,e.childCount,-1)||new Mu(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=vu[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in vu)throw new RangeError("Duplicate use of selection JSON ID "+e);return vu[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Su.between(this.$anchor,this.$head).getBookmark()}}yu.prototype.visible=!0;class bu{constructor(e,t){this.$from=e,this.$to=t}}let wu=!1;function xu(e){wu||e.parent.inlineContent||(wu=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Su extends yu{constructor(e,t=e){xu(e),xu(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return yu.near(n);let r=e.resolve(t.map(this.anchor));return new Su(r.parent.inlineContent?r:n,n)}replace(e,t=Vl.empty){if(super.replace(e,t),t==Vl.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof Su&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ku(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new Su(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=yu.findFrom(t,n,!0)||yu.findFrom(t,-n,!0);if(!e)return yu.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(yu.findFrom(e,-n,!0)||yu.findFrom(e,n,!0)).$anchor).posnew Mu(e)};function Du(e,t,n,r,i,o=!1){if(t.inlineContent)return Su.create(e,n);for(let s=r-(i>0?0:1);i>0?s=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&Cu.isSelectable(r))return Cu.create(e,n-(i<0?r.nodeSize:0))}else{let t=Du(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function Tu(e,t,n){let r=e.steps.length-1;if(r{null==i&&(i=r)})),e.setSelection(yu.near(e.doc.resolve(i),n)))}class $u extends class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Wc}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new gu(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=Vl.empty){let r=ou(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new Vl(Rl.from(n),0,0))}delete(e,t){return this.replace(e,t,Vl.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(su(i,o,r))return e.step(new Xc(t,n,r));let s=mu(i,e.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let h=i.depth,f=i.pos-1;h>0;h--,f--){let e=i.node(h).type.spec;if(e.defining||e.definingAsContext||e.isolating)break;s.indexOf(h)>-1?a=h:i.before(h)==f&&s.splice(1,0,-h)}let l=s.indexOf(a),c=[],u=r.openStart;for(let h=r.content,f=0;;f++){let e=h.firstChild;if(c.push(e),f==r.openStart)break;h=e.content}for(let h=u-1;h>=0;h--){let e=c[h].type,t=fu(e);if(t&&i.node(l).type!=e)u=h;else if(t||!e.isTextblock)break}for(let h=r.openStart;h>=0;h--){let t=(h+u+1)%(r.openStart+1),a=c[t];if(a)for(let c=0;c=0&&(e.replace(t,n,r),!(e.steps.length>d));h--){let e=s[h];e<0||(t=i.before(e),n=o.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let i=r.depth-1;i>=0;i--){let e=r.index(i);if(r.node(i).canReplaceWith(e,e,n))return r.before(i+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let e=r.indexAfter(i);if(r.node(i).canReplaceWith(e,e,n))return r.after(i+1);if(e0&&(n||r.node(t-1).canReplace(r.index(t-1),i.indexAfter(t-1))))return e.delete(r.before(t),i.after(t))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return e.delete(r.before(s),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:i,depth:o}=t,s=r.before(o+1),a=i.after(o+1),l=s,c=a,u=Rl.empty,d=0;for(let p=o,m=!1;p>n;p--)m||r.index(p)>0?(m=!0,u=Rl.from(r.node(p).copy(u)),d++):l--;let h=Rl.empty,f=0;for(let p=o,m=!1;p>n;p--)m||i.after(p+1)=0;s--){if(r.size){let e=n[s].type.contentMatch.matchFragment(r);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Rl.from(n[s].type.create(n[s].attrs,r))}let i=t.start,o=t.end;e.step(new Gc(i,o,i,o,new Vl(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(r,i)&&function(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(e.doc,e.mapping.slice(o).map(n),r)){e.clearIncompatible(e.mapping.slice(o).map(n,1),r);let s=e.mapping.slice(o),a=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new Gc(a,l,a+1,l-1,new Vl(Rl.from(r.create(i,null,t.marks)),0,0),1,!0)),!1}}))}(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r=[]){return function(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Gc(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new Vl(Rl.from(s),0,0),1,!0))}(this,e,t,n,r),this}split(e,t=1,n){return function(e,t,n=1,r){let i=e.doc.resolve(t),o=Rl.empty,s=Rl.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){o=Rl.from(i.node(a).copy(o));let e=r&&r[c];s=Rl.from(e?e.type.create(e.attrs,s):i.node(a).copy(s))}e.step(new Xc(t,t,new Vl(o.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let i,o,s=[],a=[];e.doc.nodesBetween(t,n,((e,l,c)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&c.type.allowsMarkType(r.type)){let c=Math.max(l,t),d=Math.min(l+e.nodeSize,n),h=r.addToSet(u);for(let e=0;ee.step(t))),a.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,((e,s)=>{if(!e.isInline)return;o++;let a=null;if(r instanceof kc){let t,n=e.marks;for(;t=r.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(a=[r]):a=e.marks;if(a&&a.length){let r=Math.min(s+e.nodeSize,n);for(let e=0;ee.step(new Uc(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n,r=n.contentMatch){let i=e.doc.nodeAt(t),o=[],s=t+1;for(let a=0;a=0;a--)e.step(o[a])}(this,e,t,n),this}}{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return Ll.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Ll.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.setSelection(yu.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function Au(e,t){return t&&e?e.bind(t):e}class Eu{constructor(e,t,n){this.name=e,this.init=Au(t.init,n),this.apply=Au(t.apply,n)}}const Nu=[new Eu("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new Eu("selection",{init:(e,t)=>e.selection||yu.atStart(t.doc),apply:e=>e.selection}),new Eu("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new Eu("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class Pu{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Nu.slice(),t&&t.forEach((e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new Eu(e.key,e.spec.state,e))}))}}class Iu{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;ne.toJSON()))),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new Pu(e.schema,e.plugins),i=new Iu(r);return r.fields.forEach((r=>{if("doc"==r.name)i.doc=sc.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=yu.fromJSON(i.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,o))return void(i[r.name]=a.fromJSON.call(s,e,t[o],i))}i[r.name]=r.init(e,i)}})),i}}function Ru(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):"handleDOMEvents"==r&&(i=Ru(i,t,{})),n[r]=i}return n}class zu{constructor(e){this.spec=e,this.props={},e.props&&Ru(e.props,this,this.props),this.key=e.key?e.key.key:Fu("plugin")}getState(e){return e[this.key]}}const ju=Object.create(null);function Fu(e){return e in ju?e+"$"+ ++ju[e]:(ju[e]=0,e+"$")}class Lu{constructor(e="key"){this.key=Fu(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Bu="undefined"!=typeof navigator?navigator:null,Vu="undefined"!=typeof document?document:null,Wu=Bu&&Bu.userAgent||"",qu=/Edge\/(\d+)/.exec(Wu),Hu=/MSIE \d/.exec(Wu),Ju=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Wu),Ku=!!(Hu||Ju||qu),Yu=Hu?document.documentMode:Ju?+Ju[1]:qu?+qu[1]:0,Uu=!Ku&&/gecko\/(\d+)/i.test(Wu);Uu&&(/Firefox\/(\d+)/.exec(Wu)||[0,0])[1];const Xu=!Ku&&/Chrome\/(\d+)/.exec(Wu),Gu=!!Xu,Zu=Xu?+Xu[1]:0,Qu=!Ku&&!!Bu&&/Apple Computer/.test(Bu.vendor),ed=Qu&&(/Mobile\/\w+/.test(Wu)||!!Bu&&Bu.maxTouchPoints>2),td=ed||!!Bu&&/Mac/.test(Bu.platform),nd=/Android \d/.test(Wu),rd=!!Vu&&"webkitFontSmoothing"in Vu.documentElement.style,id=rd?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,od=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},sd=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let ad=null;const ld=function(e,t,n){let r=ad||(ad=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},cd=function(e,t,n,r){return n&&(dd(e,t,n,r,-1)||dd(e,t,n,r,1))},ud=/^(img|br|input|textarea|hr)$/i;function dd(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:hd(e))){let n=e.parentNode;if(!n||1!=n.nodeType||fd(e)||ud.test(e.nodeName)||"false"==e.contentEditable)return!1;t=od(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?hd(e):0}}}function hd(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function fd(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const pd=function(e){let t=e.isCollapsed;return t&&Gu&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function md(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function gd(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function vd(e,t){return"number"==typeof e?e:e[t]}function yd(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function bd(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;s=sd(s)){if(1!=s.nodeType)continue;let e=s,n=e==o.body,a=n?gd(o):yd(e),l=0,c=0;if(t.topa.bottom-vd(r,"bottom")&&(c=t.bottom-a.bottom+vd(i,"bottom")),t.lefta.right-vd(r,"right")&&(l=t.right-a.right+vd(i,"right")),l||c)if(n)o.defaultView.scrollBy(l,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),l&&(e.scrollLeft+=l);let i=e.scrollLeft-n,o=e.scrollTop-r;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}if(n)break}}function wd(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=sd(r));return t}function xd(e,t){for(let n=0;n=a){s=Math.max(d.bottom,s),a=Math.min(d.top,a);let e=d.left>t.left?d.left-t.left:d.right=(d.left+d.right)/2?1:0));continue}}!n&&(t.left>=d.right&&t.top>=d.top||t.left>=d.left&&t.top>=d.bottom)&&(o=c+1)}}return n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||i&&1==n.nodeType?{node:e,offset:o}:kd(n,r)}function Cd(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Od(e,t,n){let r=e.childNodes.length;if(r&&n.topt.top&&i++}n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?o=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(o=function(e,t,n,r){let i=-1;for(let o=t;o!=e.dom;){let t=e.docView.nearestDesc(o,!0);if(!t)return null;if(t.node.isBlock&&t.parent){let e=t.dom.getBoundingClientRect();if(e.left>r.left||e.top>r.top)i=t.posBefore;else{if(!(e.right-1?i:e.docView.posFromDOM(t,n,1)}(e,n,i,t))}null==o&&(o=function(e,t,n){let{node:r,offset:i}=kd(t,n),o=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}(e,s,t));let a=e.docView.nearestDesc(s,!0);return{pos:o,inside:a?a.posAtStart-a.border:-1}}function _d(e,t){let n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}const Dd=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Td(e,t,n){let{node:r,offset:i}=e.docView.domFromPos(t,n<0?-1:1),o=rd||Uu;if(3==r.nodeType){if(!o||!Dd.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,$d(_d(ld(r,e,t),o),o<0)}{let e=_d(ld(r,i,i),n);if(Uu&&i&&/\s/.test(r.nodeValue[i-1])&&i=0)}if(i&&(n<0||i==hd(r))){let e=r.childNodes[i-1],t=3==e.nodeType?ld(e,hd(e)-(o?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return $d(_d(t,1),!1)}if(i=0)}function $d(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function Ad(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Ed(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}const Nd=/[\u0590-\u08ac]/;let Pd=null,Id=null,Rd=!1;function zd(e,t,n){return Pd==t&&Id==n?Rd:(Pd=t,Id=n,Rd="up"==n||"down"==n?function(e,t,n){let r=t.selection,i="up"==n?r.$from:r.$to;return Ed(e,t,(()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.dom;break}t=n.dom.parentNode}let r=Td(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=ld(e,0,e.nodeValue.length).getClientRects()}for(let e=0;ei.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=e.domSelection();return Nd.test(r.parent.textContent)&&a.modify?Ed(e,t,(()=>{let t=a.getRangeAt(0),i=a.focusNode,o=a.focusOffset,s=a.caretBidiLevel;a.modify("move",n,"character");let l=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==a.focusNode.nodeType?a.focusNode:a.focusNode.parentNode)||i==a.focusNode&&o==a.focusOffset;return a.removeAllRanges(),a.addRange(t),null!=s&&(a.caretBidiLevel=s),l})):"left"==n||"backward"==n?o:s}(e,t,n))}class jd{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tod(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i,o=this.getDesc(r);if(o&&(!t||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;te||t instanceof Hd){i=e-o;break}o=n}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(;r&&!(n=this.children[r-1]).size&&n instanceof Fd&&n.side>=0;r--);if(t<=0){let e,n=!0;for(;e=r?this.children[r-1]:null,e&&e.dom.parentNode!=this.contentDOM;r--,n=!1);return e&&t&&n&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?od(e.dom)+1:0}}{let e,n=!0;for(;e=r=i&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=od(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;ef&&ot){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),l.removeAllRanges(),l.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r=n:en){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s)return this.dirty=e==n||t==o?2:1,void(e!=r||t!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-r,t-r):i.dirty=3);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirtyi?i.parent?i.parent.posBeforeChild(i):void 0:r))),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Ld extends jd{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class Bd extends jd{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let i=r.nodeViews[t.type.name],o=i&&i(t,r,n);return o&&o.dom||(o=Rc.renderSpec(document,t.type.spec.toDOM(t,n))),new Bd(e,t,o.dom,o.contentDOM||o.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty0&&(i=ih(i,0,e,n));for(let s=0;ss?s.parent?s.parent.posBeforeChild(s):void 0:o),n,r),c=l&&l.dom,u=l&&l.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else c||({dom:c,contentDOM:u}=Rc.renderSpec(document,t.type.spec.toDOM(t)));u||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let d=c;return c=Qd(c,n,t),l?s=new Jd(e,t,n,r,c,u||null,d,l,i,o+1):t.isText?new qd(e,t,n,r,c,d,i):new Vd(e,t,n,r,c,u||null,d,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let 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(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Rl.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&eh(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,s=i&&i.pos<0,a=new nh(this,o&&o.node);!function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;no;)a.push(i[s++]);let h=o+u.nodeSize;if(u.isText){let e=h;s!e.inline)):a.slice(),t.forChild(o,u),d),o=h}}(this.node,this.innerDeco,((t,i,o)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!o&&a.syncToMarks(i==this.node.childCount?Ll.none:this.node.child(i).marks,n,e),a.placeWidget(t,e,r)}),((t,o,l,c)=>{let u;a.syncToMarks(t.marks,n,e),a.findNodeMatch(t,o,l,c)||s&&e.state.selection.from>r&&e.state.selection.to-1&&a.updateNodeAt(t,o,l,u,e)||a.updateNextNode(t,o,l,e,c)||a.addNode(t,o,l,e,r),r+=t.nodeSize})),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(o&&this.protectLocalComposition(e,o),Kd(this.contentDOM,this.children,e),ed&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof Su)||nt+this.node.content.size)return null;let i=e.domSelection(),o=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=hd(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t=n){let e=a=0&&e+t.length+a>=n)return a+e;if(n==r&&l.length>=r+t.length-a&&l.slice(r-a,r-a+t.length)==t)return r}}return-1}(this.node.content,e,n-t,r-t);return i<0?null:{node:o,pos:i,text:e}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new Ld(this,i,t,r);e.input.compositionNodes.push(o),this.children=ih(this.children,n,n+r.length,e,o)}update(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(eh(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Gd(this.dom,this.nodeDOM,Xd(this.outerDeco,this.node,t),Xd(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Wd(e,t,n,r,i){return Qd(r,t,e),new Vd(void 0,e,t,n,r,r,r,i,0)}class qd extends Vd{constructor(e,t,n,r,i,o,s){super(e,t,n,r,i,null,o,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new qd(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class Hd extends jd{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class Jd extends Vd{constructor(e,t,n,r,i,o,s,a,l,c){super(e,t,n,r,i,o,s,l,c),this.spec=a}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Kd(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o0;){let a;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof Bd)){a=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n>1,o=Math.min(i,e.length);for(;r-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=Bd.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))o=this.top.children.indexOf(i,this.index);else for(let s=this.index,a=Math.min(this.top.children.length,s+5);s=n||u<=t?o.push(l):(cn&&o.push(l.slice(n-c,l.size,r)))}return o}function oh(e,t=null){let n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,l,c=r.resolve(s);if(pd(n)){for(a=c;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&Cu.isSelectable(e)&&i.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==hd(e);r||i;){if(e==n)return!0;let t=od(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==hd(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new Cu(s==e?c:r.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;a=r.resolve(t)}if(!l){l=ph(e,a,c,"pointer"==t||e.state.selection.head{n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{sh(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const lh=Qu||Gu&&Zu<63;function ch(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=rr(e,t,n)))||Su.between(t,n,r)}function mh(e){return(!e.editable||e.root.activeElement==e.dom)&&gh(e)}function gh(e){let t=e.domSelection();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(n){return!1}}function vh(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&yu.findFrom(o,t)}function yh(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function bh(e,t,n){let r=e.state.selection;if(!(r instanceof Su)){if(r instanceof Cu&&r.node.isInline)return yh(e,new Su(t>0?r.$to:r.$from));{let n=vh(e.state,t);return!!n&&yh(e,n)}}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){let n=vh(e.state,t);return!!(n&&n instanceof Cu)&&yh(e,n)}if(!(td&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let s=t<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(Cu.isSelectable(o)?yh(e,new Cu(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):!!rd&&yh(e,new Su(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function wh(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function xh(e){let t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function Sh(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(Uu&&1==n.nodeType&&r0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(xh(e))i=n,o=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(Ch(n))break;{let t=n.previousSibling;for(;t&&xh(t);)i=n.parentNode,o=od(t),t=t.previousSibling;if(t)n=t,r=wh(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?Oh(e,t,n,r):i&&Oh(e,t,i,o)}function kh(e){let t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=wh(n);for(;;)if(r{e.state==i&&ah(e)}),50)}function Mh(e,t,n){let r=e.state.selection;if(r instanceof Su&&!r.empty||n.indexOf("s")>-1)return!1;if(td&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=vh(e.state,t);if(n&&n instanceof Cu)return yh(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof Mu?yu.near(n,t):yu.findFrom(n,t);return!!s&&yh(e,s)}return!1}function _h(e,t){if(!(e.state.selection instanceof Su))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function Dh(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Th(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||td&&72==n&&"c"==r?_h(e,-1)||Sh(e):46==n||td&&68==n&&"c"==r?_h(e,1)||kh(e):13==n||27==n||(37==n||td&&66==n&&"c"==r?bh(e,-1,r)||Sh(e):39==n||td&&70==n&&"c"==r?bh(e,1,r)||kh(e):38==n||td&&80==n&&"c"==r?Mh(e,-1,r)||Sh(e):40==n||td&&78==n&&"c"==r?function(e){if(!Qu||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelection();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;Dh(e,n,"true"),setTimeout((()=>Dh(e,n,"false")),20)}return!1}(e)||Mh(e,1,r)||kh(e):r==(td?"m":"c")&&(66==n||73==n||89==n||90==n))}function $h(e,t){let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||Rc.fromSchema(e.state.schema),a=Lh(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let c,u=l.firstChild,d=0;for(;u&&1==u.nodeType&&(c=jh[u.nodeName.toLowerCase()]);){for(let e=c.length-1;e>=0;e--){let t=a.createElement(c[e]);for(;l.firstChild;)t.appendChild(l.firstChild);l.appendChild(t),d++}u=l.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`),{dom:l,text:e.someProp("clipboardTextSerializer",(e=>e(t)))||t.content.textBetween(0,t.content.size,"\n\n")}}function Ah(e,t,n,r,i){let o,s,a=i.parent.type.spec.code;if(!n&&!t)return null;let l=t&&(r||a||!n);if(l){if(e.someProp("transformPastedText",(e=>{t=e(t,a||r)})),a)return t?new Vl(Rl.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):Vl.empty;let n=e.someProp("clipboardTextParser",(e=>e(t,i,r)));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,s=Rc.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(e=>{n=e(n)})),o=function(e){let t=/^(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=Lh().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);(n=i&&jh[i[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"")).reverse().join(""));if(r.innerHTML=e,n)for(let o=0;o0&&o.firstChild;d--)o=o.firstChild;if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||Mc.fromSchema(e.state.schema);s=t.parseSlice(o,{preserveWhitespace:!(!l&&!u),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||Eh.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(u)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(wy){return e}let{content:i,openStart:o,openEnd:s}=e;for(let a=n.length-2;a>=0;a-=2){let e=r.nodes[n[a]];if(!e||e.hasRequiredAttrs())break;i=Rl.from(e.create(n[a+1],i)),o++,s++}return new Vl(i,o,s)}(zh(s,+u[1],+u[2]),u[4]);else if(s=Vl.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,i=t.node(n).contentMatchAt(t.index(n)),o=[];if(e.forEach((e=>{if(!o)return;let t,n=i.findWrapping(e.type);if(!n)return o=null;if(t=o.length&&r.length&&Ph(n,r,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=Ih(o[o.length-1],r.length));let t=Nh(e,n);o.push(t),i=i.matchType(t.type),r=n}})),o)return Rl.from(o)}return e}(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let n=s.content.firstChild;e{s=e(s)})),s}const Eh=/^(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 Nh(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,Rl.from(e));return e}function Ph(e,t,n,r,i){if(i=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(Rl.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function zh(e,t,n){return t{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Jh(e,t))}))}function Jh(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function Kh(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Yh(e){return{left:e.clientX,top:e.clientY}}function Uh(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(e.someProp(t,(t=>s>o.depth?t(e,n,o.nodeAfter,o.before(s),i,!0):t(e,n,o.node(s),o.before(s),i,!1))))return!0;return!1}function Xh(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Gh(e,t,n,r,i){return Uh(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(i?function(e,t){if(-1==t)return!1;let n,r,i=e.state.selection;i instanceof Cu&&(n=i.node);let o=e.state.doc.resolve(t);for(let s=o.depth+1;s>0;s--){let e=s>o.depth?o.nodeAfter:o.node(s);if(Cu.isSelectable(e)){r=n&&i.$from.depth>0&&s>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(s);break}}return null!=r&&(Xh(e,Cu.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&Cu.isSelectable(r))&&(Xh(e,new Cu(n),"pointer"),!0)}(e,n))}function Zh(e,t,n,r){return Uh(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function Qh(e,t,n,r){return Uh(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(n=>n(e,t,r)))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(Xh(e,Su.create(r,0,r.content.size),"pointer"),!0);let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let t=o>i.depth?i.nodeAfter:i.node(o),n=i.before(o);if(t.inlineContent)Xh(e,Su.create(r,n+1,n+1+t.content.size),"pointer");else{if(!Cu.isSelectable(t))continue;Xh(e,Cu.create(r,n),"pointer")}return!0}}(e,n,r)}function ef(e){return lf(e)}Vh.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!rf(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!nd||!Gu||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!ed||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||Th(e,n)?n.preventDefault():qh(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,md(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},Vh.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},Vh.keypress=(e,t)=>{let n=t;if(rf(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||td&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof Su&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const tf=td?"metaKey":"ctrlKey";Bh.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=ef(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[tf]&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=e.posAtCoords(Yh(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new nf(e,s,n,!!r)):("doubleClick"==o?Zh:Qh)(e,s.pos,s.inside,n)?n.preventDefault():qh(e,"pointer"))};class nf{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[tf],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:l}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||l instanceof Cu&&l.from<=o&&l.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Uu||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((()=>{this.view.input.mouseDown==this&&this.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)),qh(e,"pointer")}done(){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((()=>ah(this.view))),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Yh(e))),this.allowDefault||!t?qh(this.view,"pointer"):Gh(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Qu&&this.mightDrag&&!this.mightDrag.node.isAtom||Gu&&!(this.view.state.selection instanceof Su)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Xh(this.view,yu.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):qh(this.view,"pointer")}move(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),qh(this.view,"pointer"),0==e.buttons&&this.done()}}function rf(e,t){return!!e.composing||!!(Qu&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}Bh.touchdown=e=>{ef(e),qh(e,"pointer")},Bh.contextmenu=e=>ef(e);const of=nd?5e3:-1;function sf(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>lf(e)),t))}function af(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function lf(e,t=!1){if(!(nd&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),af(e),t||e.docView&&e.docView.dirty){let t=oh(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}Vh.compositionstart=Vh.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),lf(e,!0),e.markCursor=null;else if(lf(e),Uu&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelection();for(let e=t.focusNode,n=t.focusOffset;e&&1==e.nodeType&&0!=n;){let r=n<0?e.lastChild:e.childNodes[n-1];if(!r)break;if(3==r.nodeType){t.collapse(r,r.nodeValue.length);break}e=r,n=-1}}e.input.composing=!0}sf(e,of)},Vh.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,sf(e,20))};const cf=Ku&&Yu<15||ed&&id<604;function uf(e,t,n,r){let i=Ah(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,r,i||Vl.empty))))return!0;if(!i)return!1;let o=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(i),s=o?e.state.tr.replaceSelectionWith(o,e.input.shiftKey):e.state.tr.replaceSelection(i);return e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}Bh.copy=Vh.cut=(e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let o=cf?null:n.clipboardData,s=r.content(),{dom:a,text:l}=$h(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},Vh.paste=(e,t)=>{let n=t;if(e.composing&&!nd)return;let r=cf?null:n.clipboardData;r&&uf(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?uf(e,r.value,null,t):uf(e,r.textContent,r.innerHTML,t)}),50)}(e,n)};class df{constructor(e,t){this.slice=e,this.move=t}}const hf=td?"altKey":"ctrlKey";Bh.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,o=i.empty?null:e.posAtCoords(Yh(n));if(o&&o.pos>=i.from&&o.pos<=(i instanceof Cu?i.to-1:i.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(Cu.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&e.dispatch(e.state.tr.setSelection(Cu.create(e.state.doc,t.posBefore)))}let s=e.state.selection.content(),{dom:a,text:l}=$h(e,s);n.dataTransfer.clearData(),n.dataTransfer.setData(cf?"Text":"text/html",a.innerHTML),n.dataTransfer.effectAllowed="copyMove",cf||n.dataTransfer.setData("text/plain",l),e.dragging=new df(s,!n[hf])},Bh.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},Vh.dragover=Vh.dragenter=(e,t)=>t.preventDefault(),Vh.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(Yh(n));if(!i)return;let o=e.state.doc.resolve(i.pos);if(!o)return;let s=r&&r.slice;s?e.someProp("transformPasted",(e=>{s=e(s)})):s=Ah(e,n.dataTransfer.getData(cf?"Text":"text/plain"),cf?null:n.dataTransfer.getData("text/html"),!1,o);let a=!(!r||n[hf]);if(e.someProp("handleDrop",(t=>t(e,n,s||Vl.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let l=s?function(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o=0;e--){let t=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,n=r.index(e)+(t>0?1:0),s=r.node(e),a=!1;if(1==o)a=s.canReplace(n,n,i);else{let e=s.contentMatchAt(n).findWrapping(i.firstChild.type);a=e&&s.canReplaceWith(n,n,e[0])}if(a)return 0==t?r.pos:t<0?r.before(e+1):r.after(e+1)}return null}(e.state.doc,o.pos,s):o.pos;null==l&&(l=o.pos);let c=e.state.tr;a&&c.deleteSelection();let u=c.mapping.map(l),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,h=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(h))return;let f=c.doc.resolve(u);if(d&&Cu.isSelectable(s.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new Cu(f));else{let t=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach(((e,n,r,i)=>t=i)),c.setSelection(ph(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))},Bh.focus=e=>{e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelection())&&ah(e)}),20))},Bh.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},Bh.beforeinput=(e,t)=>{if(Gu&&nd&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,md(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let os in Vh)Bh[os]=Vh[os];function ff(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class pf{constructor(e,t){this.toDOM=e,this.spec=t||bf,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new vf(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof pf&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ff(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class mf{constructor(e,t){this.attrs=e,this.spec=t||bf}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new vf(i,o,this)}valid(e,t){return t.from=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;oe){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==xf||0==e.maps.length?this:this.mapInner(e,t,0,0,n||bf)}mapInner(e,t,n,r,i){let o;for(let s=0;s{for(let s=0;sc+o)continue;let u=a[s]+o;t>=u?a[s+1]=e<=u?-2:-1:n>=i&&(l=r-n-(t-e))&&(a[s]+=l,a[s+1]+=l)}};for(let u=0;u=r.content.size){c=!0;continue}let d=n.map(e[u+1]+o,-1)-i,{index:h,offset:f}=r.content.findIndex(l),p=r.maybeChild(h);if(p&&f==l&&f+p.nodeSize==d){let r=a[u+2].mapInner(n,p,t+1,e[u]+o+1,s);r!=xf?(a[u]=l,a[u+1]=d,a[u+2]=r):(a[u+1]=-2,c=!0)}else c=!0}if(c){let l=function(e,t,n,r,i,o,s){function a(e,t){for(let o=0;o{let s,a=o+n;if(s=Cf(t,e,a)){for(r||(r=this.children.slice());io&&t.to=e){this.children[s]==e&&(n=this.children[s+2]);break}let i=e+1,o=i+t.content.size;for(let s=0;si&&e.type instanceof mf){let t=Math.max(i,e.from)-i,n=Math.min(o,e.to)-i;tn.map(e,t,bf)));return Sf.from(n)}forChild(e,t){if(t.isLeaf)return wf.empty;let n=[];for(let r=0;rn&&o.to{let a=Cf(e,t,s+n);if(a){o=!0;let e=Mf(a,t,n+s+1,r);e!=xf&&i.push(s,s+t.nodeSize,e)}}));let s=kf(o?Of(e):e,-n).sort(_f);for(let a=0;a0;)t++;e.splice(t,0,n)}function $f(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=xf&&t.push(r)})),e.cursorWrapper&&t.push(wf.create(e.state.doc,[e.cursorWrapper.deco])),Sf.from(t)}const Af={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Ef=Ku&&Yu<=11;class Nf{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Pf{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Nf,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((e=>{for(let t=0;t"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),Ef&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&this.observer.observe(this.view.dom,Af),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;tthis.flush()),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout((()=>this.suppressingSelectionUpdates=!1),50)}onSelectionChange(){if(mh(this.view)){if(this.suppressingSelectionUpdates)return ah(this.view);if(Ku&&Yu<=11&&!this.view.state.selection.empty){let e=this.view.domSelection();if(e.focusNode&&cd(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelection())}ignoreSelectionChange(e){if(0==e.rangeCount)return!0;let t=e.getRangeAt(0).commonAncestorContainer,n=this.view.docView.nearestDesc(t);return n&&n.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}flush(){if(!this.view.docView||this.flushingSoon>-1)return;let e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);let t=this.view.domSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&mh(this.view)&&!this.ignoreSelectionChange(t),r=-1,i=-1,o=!1,s=[];if(this.view.editable)for(let a=0;a1){let e=s.filter((e=>"BR"==e.nodeName));if(2==e.length){let t=e[0],n=e[1];t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,i),function(e){if(If)return;If=!0,"normal"==getComputedStyle(e.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,s),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||ah(this.view),this.currentSelection.set(t))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;nDate.now()-50?e.input.lastSelectionOrigin:null,n=oh(e,t);if(n&&!e.state.selection.eq(n)){let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let a=e.state.selection,l=function(e,t,n){let r,{node:i,fromOffset:o,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),c=e.domSelection(),u=c.anchorNode;if(u&&e.dom.contains(1==u.nodeType?u:u.parentNode)&&(r=[{node:u,offset:c.anchorOffset}],pd(c)||r.push({node:c.focusNode,offset:c.focusOffset})),Gu&&8===e.input.lastKeyCode)for(let g=s;g>o;g--){let e=i.childNodes[g-1],t=e.pmViewDesc;if("BR"==e.nodeName&&!t){s=g;break}if(!t||t.size)break}let d=e.state.doc,h=e.someProp("domParser")||Mc.fromSchema(e.state.schema),f=d.resolve(a),p=null,m=h.parse(i,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=f.parent.type.whitespace||"full",findPositions:r,ruleFromNode:Rf,context:f});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),p={anchor:e+a,head:t+a}}return{doc:m,sel:p,from:a,to:l}}(e,t,n);if(Gu&&e.cursorWrapper&&l.sel&&l.sel.anchor==e.cursorWrapper.deco.from){let t=e.cursorWrapper.deco.type.toDOM.nextSibling,n=t&&t.nodeValue?t.nodeValue.length:1;l.sel={anchor:l.sel.anchor+n,head:l.sel.anchor+n}}let c,u,d=e.state.doc,h=d.slice(l.from,l.to);8===e.input.lastKeyCode&&Date.now()-100=s?o-r:0,a=o+(a-s),s=o}else if(a=a?o-r:0,s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}(h.content,l.doc.content,l.from,c,u);if((ed&&e.input.lastIOSEnter>Date.now()-225||nd)&&i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName))&&(!f||f.endA>=f.endB)&&e.someProp("handleKeyDown",(t=>t(e,md(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!f){if(!(r&&a instanceof Su&&!a.empty&&a.$head.sameParent(a.$anchor))||e.composing||l.sel&&l.sel.anchor!=l.sel.head){if(l.sel){let t=jf(e,e.state.doc,l.sel);t&&!t.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(t))}return}f={start:a.from,endA:a.to,endB:a.to}}e.input.domChangeCount++,e.state.selection.frome.state.selection.from&&f.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?f.start=e.state.selection.from:f.endA=e.state.selection.to-2&&e.state.selection.to<=l.to&&(f.endB+=e.state.selection.to-f.endA,f.endA=e.state.selection.to)),Ku&&Yu<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>l.from&&"  "==l.doc.textBetween(f.start-l.from-1,f.start-l.from+1)&&(f.start--,f.endA--,f.endB--);let p,m=l.doc.resolveNoCache(f.start-l.from),g=l.doc.resolveNoCache(f.endB-l.from),v=d.resolve(f.start),y=m.sameParent(g)&&m.parent.inlineContent&&v.end()>=f.endA;if((ed&&e.input.lastIOSEnter>Date.now()-225&&(!y||i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!y&&m.post(e,md(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>f.start&&function(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||Ff(r,!0,!1)n||Ff(s,!0,!1)t(e,md(8,"Backspace")))))return void(nd&&Gu&&e.domObserver.suppressSelectionUpdates());Gu&&nd&&f.endB==f.start&&(e.input.lastAndroidDelete=Date.now()),nd&&!y&&m.start()!=g.start()&&0==g.parentOffset&&m.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==f.endA&&(f.endB-=2,g=l.doc.resolveNoCache(f.endB-l.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,md(13,"Enter"))}))}),20));let b,w,x,S=f.start,k=f.endA;if(y)if(m.pos==g.pos)Ku&&Yu<=11&&0==m.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>ah(e)),20)),b=e.state.tr.delete(S,k),w=d.resolve(f.start).marksAcross(d.resolve(f.endA));else if(f.endA==f.endB&&(x=function(e,t){let n,r,i,o=e.firstChild.marks,s=t.firstChild.marks,a=o,l=s;for(let u=0;ue.mark(r.addToSet(e.marks));else{if(0!=a.length||1!=l.length)return null;r=l[0],n="remove",i=e=>e.mark(r.removeFromSet(e.marks))}let c=[];for(let u=0;un(e,S,k,t))))return;b=e.state.tr.insertText(t,S,k)}if(b||(b=e.state.tr.replace(S,k,l.doc.slice(f.start-l.from,f.endB-l.from))),l.sel){let t=jf(e,b.doc,l.sel);t&&!(Gu&&nd&&e.composing&&t.empty&&(f.start!=f.endB||e.input.lastAndroidDeletet.content.size?null:ph(e,t.resolve(n.anchor),t.resolve(n.head))}function Ff(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}class Lf{constructor(e,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 Wh,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Hf),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=Wf(this),Vf(this),this.nodeViews=qf(this),this.docView=Wd(this.state.doc,Bf(this),$f(this),this.dom,this),this.domObserver=new Pf(this,((e,t,n,r)=>zf(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in Bh){let n=Bh[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!Kh(e,t)||Jh(e,t)||!e.editable&&t.type in Vh||n(e,t)})}Qu&&e.dom.addEventListener("input",(()=>null)),Hh(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Hh(this),this._props=e,e.plugins&&(e.plugins.forEach(Hf),this.directPlugins=e.plugins),this.updateStateInner(e.state,!0)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this.state.plugins!=e.plugins)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;if(e.storedMarks&&this.composing&&(af(this),i=!0),this.state=e,t){let e=qf(this);(function(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,r=!0),Hh(this)}this.editable=Wf(this),Vf(this);let o=$f(this),s=Bf(this),a=t?"reset":e.scrollToSelection>n.scrollToSelection?"to selection":"preserve",l=r||!this.docView.matchesNode(e.doc,s,o);!l&&e.selection.eq(n.selection)||(i=!0);let c="preserve"==a&&i&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s=i-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:wd(e.dom)}}(this);if(i){this.domObserver.stop();let t=l&&(Ku||Gu)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(n.selection,e.selection);if(l){let n=Gu?this.trackWrites=this.domSelection().focusNode:null;!r&&this.docView.update(e.doc,s,o,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Wd(e.doc,s,o,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return cd(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?ah(this,t):(hh(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(n),"reset"==a)this.dom.scrollTop=0;else if("to selection"==a){let t=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(e.selection instanceof Cu){let n=this.docView.domAfterPos(e.selection.from);1==n.nodeType&&bd(this,n.getBoundingClientRect(),t)}else bd(this,this.coordsAtPos(e.selection.head,1),t)}else c&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;xd(n,0==r?0:r-t)}(c)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;tt.ownerDocument.getSelection()),this._root=t;return e||document}posAtCoords(e){return Md(this,e)}coordsAtPos(e,t=1){return Td(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return zd(this,t||this.state,e)}destroy(){this.docView&&(!function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],$f(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){Jh(e,t)||!Bh[t.type]||!e.editable&&t.type in Vh||Bh[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelection(){return this.root.getSelection()}}function Bf(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e&&(t.class+=" "+n[e]),"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))})),[vf.node(0,e.state.doc.content.size,t)]}function Vf(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:vf.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Wf(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function qf(e){let t=Object.create(null);return e.someProp("nodeViews",(e=>{for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])})),t}function Hf(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var Jf={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"},Kf={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"},Yf="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Uf="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Xf="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Gf="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Zf="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Qf=Yf&&(Gf||+Yf[1]<57)||Xf&&Gf,ep=0;ep<10;ep++)Jf[48+ep]=Jf[96+ep]=String(ep);for(ep=1;ep<=24;ep++)Jf[ep+111]="F"+ep;for(ep=65;ep<=90;ep++)Jf[ep]=String.fromCharCode(ep+32),Kf[ep]=String.fromCharCode(ep);for(var tp in Jf)Kf.hasOwnProperty(tp)||(Kf[tp]=Jf[tp]);const np="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function rp(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let a=0;a127)&&(r=Jf[n.keyCode])&&r!=i){let i=t[ip(r,n,!0)];if(i&&i(e.state,e.dispatch,e))return!0}else if(o&&n.shiftKey){let r=t[ip(i,n,!0)];if(r&&r(e.state,e.dispatch,e))return!0}return!1}}const ap=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function lp(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function cp(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function up(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=dp(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,s.createAndFill());i.setSelection(yu.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0};function fp(e,t,n){let r,i,o=t.nodeBefore,s=t.nodeAfter;if(o.type.spec.isolating||s.type.spec.isolating)return!1;if(function(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!(!(r&&i&&r.type.compatibleContent(i.type))||(!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(o,o+1)||!i.isTextblock&&!iu(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(r=(i=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&i.matchType(r[0]||s.type).validEnd){if(n){let i=t.pos+s.nodeSize,a=Rl.empty;for(let e=r.length-1;e>=0;e--)a=Rl.from(r[e].create(null,a));a=Rl.from(o.copy(a));let l=e.tr.step(new Gc(t.pos-1,i,t.pos,i,new Vl(a,1,0),r.length,!0)),c=i+2*r.length;iu(l.doc,c)&&l.join(c),n(l.scrollIntoView())}return!0}let l=yu.findFrom(t,1),c=l&&l.$from.blockRange(l.$to),u=c&&eu(c);if(null!=u&&u>=t.depth)return n&&n(e.tr.lift(c,u).scrollIntoView()),!0;if(a&&lp(s,"start",!0)&&lp(o,"end")){let r=o,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let a=s,l=1;for(;!a.isTextblock;a=a.firstChild)l++;if(r.canReplace(r.childCount,r.childCount,a.content)){if(n){let r=Rl.empty;for(let e=i.length-1;e>=0;e--)r=Rl.from(i[e].copy(r));n(e.tr.step(new Gc(t.pos-i.length,t.pos+s.nodeSize,t.pos+l,t.pos+s.nodeSize-l,new Vl(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function pp(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(Su.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}const mp=pp(-1),gp=pp(1);function vp(e,t=null){return function(n,r){let{from:i,to:o}=n.selection,s=!1;return n.doc.nodesBetween(i,o,((r,i)=>{if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{let t=n.doc.resolve(i),r=t.index();s=t.parent.canReplaceWith(r,r+1,e)}})),!!s&&(r&&r(n.tr.setBlockType(i,o,e,t).scrollIntoView()),!0)}}function yp(e,t=null){return function(n,r){let{empty:i,$cursor:o,ranges:s}=n.selection;if(i&&!o||!function(e,t,n){for(let r=0;r{if(s)return!1;s=e.inlineContent&&e.type.allowsMarkType(n)})),s)return!0}return!1}(n.doc,s,e))return!1;if(r)if(o)e.isInSet(n.storedMarks||o.marks())?r(n.tr.removeStoredMark(e)):r(n.tr.addStoredMark(e.create(t)));else{let i=!1,o=n.tr;for(let t=0;!i&&t{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;let i=cp(r);if(!i){let n=r.blockRange(),i=n&&eu(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&fp(e,i,t))return!0;if(0==r.parent.content.size&&(lp(o,"end")||Cu.isSelectable(o))){let n=ou(e.doc,r.before(),r.after(),Vl.empty);if(n&&n.slice.size{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=cp(r)}let s=o&&o.nodeBefore;return!(!s||!Cu.isSelectable(s))&&(t&&t(e.tr.setSelection(Cu.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)})),xp=bp(ap,((e,t,n)=>{let{$cursor:r}=e.selection;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)}),((e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Mu||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=dp(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index(){let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(ru(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&eu(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)}),((e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof Cu&&e.selection.node.isBlock)return!(!n.parentOffset||!ru(e.doc,n.pos))&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.parent.isBlock)return!1;if(t){let i=r.parentOffset==r.parent.content.size,o=e.tr;(e.selection instanceof Su||e.selection instanceof Mu)&&o.deleteSelection();let s=0==n.depth?null:dp(n.node(-1).contentMatchAt(n.indexAfter(-1))),a=i&&s?[{type:s}]:void 0,l=ru(o.doc,o.mapping.map(n.pos),1,a);if(a||l||!ru(o.doc,o.mapping.map(n.pos),1,s?[{type:s}]:void 0)||(s&&(a=[{type:s}]),l=!0),l&&(o.split(o.mapping.map(n.pos),1,a),!i&&!n.parentOffset&&n.parent.type!=s)){let e=o.mapping.map(n.before()),t=o.doc.resolve(e);s&&n.node(-1).canReplaceWith(t.index(),t.index()+1,s)&&o.setNodeMarkup(o.mapping.map(n.before()),s)}t(o.scrollIntoView())}return!0})),"Mod-Enter":hp,Backspace:wp,"Mod-Backspace":wp,"Shift-Backspace":wp,Delete:xp,"Mod-Delete":xp,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new Mu(e.doc))),!0)},kp={"Ctrl-h":Sp.Backspace,"Alt-Backspace":Sp["Mod-Backspace"],"Ctrl-d":Sp.Delete,"Ctrl-Alt-Backspace":Sp["Mod-Delete"],"Alt-Delete":Sp["Mod-Delete"],"Alt-d":Sp["Mod-Delete"],"Ctrl-a":mp,"Ctrl-e":gp};for(let os in Sp)kp[os]=Sp[os];const Cp=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&"darwin"==os.platform())?kp:Sp;class Op{constructor(e,t){var n;this.match=e,this.match=e,this.handler="string"==typeof t?(n=t,function(e,t,r,i){let o=n;if(t[1]){let e=t[0].lastIndexOf(t[1]);o+=t[0].slice(e+t[1].length);let n=(r+=e)-i;n>0&&(o=t[0].slice(e-n,e)+o,r=i)}return e.tr.insertText(o,r,i)}):t}}function Mp({rules:e}){let t=new zu({state:{init:()=>null,apply(e,t){let n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(n,r,i,o)=>_p(n,r,i,o,e,t),handleDOMEvents:{compositionend:n=>{setTimeout((()=>{let{$cursor:r}=n.state.selection;r&&_p(n,r.pos,r.pos,"",e,t)}))}}},isInputRules:!0});return t}function _p(e,t,n,r,i,o){if(e.composing)return!1;let s=e.state,a=s.doc.resolve(t);if(a.parent.type.spec.code)return!1;let l=a.parent.textBetween(Math.max(0,a.parentOffset-500),a.parentOffset,null,"")+r;for(let c=0;c{let n=e.plugins;for(let r=0;r=0;e--)n.step(r.steps[e].invert(r.docs[e]));if(i.text){let t=n.doc.resolve(i.from).marks();n.replaceWith(i.from,i.to,e.schema.text(i.text,t))}else n.delete(i.from,i.to);t(n)}return!0}}return!1};function Tp(e,t,n=null,r){return new Op(e,((e,i,o,s)=>{let a=n instanceof Function?n(i):n,l=e.tr.delete(o,s),c=l.doc.resolve(o).blockRange(),u=c&&tu(c,t,a);if(!u)return null;l.wrap(c,u);let d=l.doc.resolve(o-1).nodeBefore;return d&&d.type==t&&iu(l.doc,o-1)&&(!r||r(i,d))&&l.join(o-1),l}))}function $p(e,t,n=null){return new Op(e,((e,r,i,o)=>{let s=e.doc.resolve(i),a=n instanceof Function?n(r):n;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t)?e.tr.delete(i,o).setBlockType(i,i,t,a):null}))}new Op(/--$/,"—"),new Op(/\.\.\.$/,"…"),new Op(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“"),new Op(/"$/,"”"),new Op(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘"),new Op(/'$/,"’");const Ap=["ol",0],Ep=["ul",0],Np=["li",0],Pp={attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:e=>({order:e.hasAttribute("start")?+e.getAttribute("start"):1})}],toDOM:e=>1==e.attrs.order?Ap:["ol",{start:e.attrs.order},0]},Ip={parseDOM:[{tag:"ul"}],toDOM:()=>Ep},Rp={parseDOM:[{tag:"li"}],toDOM:()=>Np,defining:!0};function zp(e,t){let n={};for(let r in e)n[r]=e[r];for(let r in t)n[r]=t[r];return n}function jp(e,t,n){return e.append({ordered_list:zp(Pp,{content:"list_item+",group:n}),bullet_list:zp(Ip,{content:"list_item+",group:n}),list_item:zp(Rp,{content:t})})}function Fp(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(e)&&0==s.startIndex){if(0==i.index(s.depth-1))return!1;let e=n.doc.resolve(s.start-2);l=new ic(e,e,s.depth),s.endIndex=0;u--)o=Rl.from(n[u].type.create(n[u].attrs,o));e.step(new Gc(t.start-(r?2:0),t.end,t.start,t.end,new Vl(o,0,0),n.length,!0));let s=0;for(let u=0;u=r.depth-3;e--)i=Rl.from(r.node(e).copy(i));let s=r.indexAfter(-1){if(c>-1)return!1;e.isTextblock&&0==e.content.size&&(c=t+1)})),c>-1&&l.setSelection(yu.near(l.doc.resolve(c))),n(l.scrollIntoView())}return!0}let a=i.pos==r.end()?s.contentMatchAt(0).defaultType:null,l=t.tr.delete(r.pos,i.pos),c=a?[null,{type:a}]:void 0;return!!ru(l.doc,r.pos,2,c)&&(n&&n(l.split(r.pos,2,c).scrollIntoView()),!0)}}function Bp(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,(t=>t.childCount>0&&t.firstChild.type==e));return!!o&&(!n||(r.node(o.depth-1).type==e?function(e,t,n,r){let i=e.tr,o=r.end,s=r.$to.end(r.depth);om;p--)f-=i.child(p).nodeSize,r.delete(f-1,f+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=0==n.startIndex,l=n.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(a?0:1),u+1,s.content.append(l?Rl.empty:Rl.from(i))))return!1;let d=o.pos,h=d+s.nodeSize;return r.step(new Gc(d-(a?1:0),h+(l?1:0),d+1,h-1,new Vl((a?Rl.empty:Rl.from(i.copy(Rl.empty))).append(l?Rl.empty:Rl.from(i.copy(Rl.empty))),a?0:1,l?0:1),a?0:1)),t(r.scrollIntoView()),!0}(t,n,o)))}}function Vp(e){return function(t,n){let{$from:r,$to:i}=t.selection,o=r.blockRange(i,(t=>t.childCount>0&&t.firstChild.type==e));if(!o)return!1;let s=o.startIndex;if(0==s)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=e)return!1;if(n){let r=l.lastChild&&l.lastChild.type==a.type,i=Rl.from(r?e.create():null),s=new Vl(Rl.from(e.create(null,Rl.from(a.type.create(null,i)))),r?3:1,0),c=o.start,u=o.end;n(t.tr.step(new Gc(c-(r?3:1),u,c,u,s,1,!0)).scrollIntoView())}return!0}}var Wp=function(){};Wp.prototype.append=function(e){return e.length?(e=Wp.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},Wp.prototype.prepend=function(e){return e.length?Wp.from(e).append(this):this},Wp.prototype.appendInner=function(e){return new Hp(this,e)},Wp.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?Wp.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Wp.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Wp.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Wp.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},Wp.from=function(e){return e instanceof Wp?e:e&&e.length?new qp(e):Wp.empty};var qp=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Wp);Wp.empty=new qp([]);var Hp=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return ei&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;return!(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i))&&(!(n=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(Wp),Jp=Wp;class Kp{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,i=this.items.length;for(;;i--){if(this.items.get(i-1).selection){--i;break}}t&&(n=this.remapping(i,this.items.length),r=n.maps.length);let o,s,a=e.tr,l=[],c=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(i,t+1),r=n.maps.length),r--,void c.push(e);if(n){c.push(new Yp(e.map));let t,i=e.step.map(n.slice(r));i&&a.maybeStep(i).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],l.push(new Yp(t,void 0,void 0,l.length+c.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(o=n?e.selection.map(n.slice(r)):e.selection,s=new Kp(this.items.slice(0,i).append(c.reverse().concat(l)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:o}}addTransform(e,t,n,r){let i=[],o=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let c=0;cXp&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,l),o-=l),new Kp(s.append(i),o)}remapping(e,t){let n=new Wc;return this.items.forEach(((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new Kp(this.items.append(e.map((e=>new Yp(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let a=t;this.items.forEach((t=>{let r=i.getMirror(--a);if(null==r)return;o=Math.min(o,r);let l=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(i.slice(a+1,r));c&&s++,n.push(new Yp(l,o,c))}else n.push(new Yp(l))}),r);let l=[];for(let d=t;d500&&(u=u.compress(this.items.length-n.length)),u}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach(((o,s)=>{if(s>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=o.selection&&o.selection.map(t.slice(n));a&&i++;let l,c=new Yp(s.invert(),e,a),u=r.length-1;(l=r.length&&r[u].merge(c))?r[u]=l:r.push(c)}}else o.map&&n--}),this.items.length,0),new Kp(Jp.from(r.reverse()),i)}}Kp.empty=new Kp(Jp.empty,0);class Yp{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Yp(t.getMap().invert(),t,this.selection)}}}class Up{constructor(e,t,n,r){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r}}const Xp=20;function Gp(e){let t=[];return e.forEach(((e,n,r,i)=>t.push(r,i))),t}function Zp(e,t){if(!e)return null;let n=[];for(let r=0;rnew Up(Kp.empty,Kp.empty,null,0),apply:(t,n,r)=>function(e,t,n,r){let i,o=n.getMeta(rm);if(o)return o.historyState;n.getMeta(im)&&(e=new Up(e.done,e.undone,null,0));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(rm))return s.getMeta(rm).redo?new Up(e.done.addTransform(n,void 0,r,nm(t)),e.undone,Gp(n.mapping.maps[n.steps.length-1]),e.prevTime):new Up(e.done,e.undone.addTransform(n,void 0,r,nm(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new Up(e.done.rebased(n,i),e.undone.rebased(n,i),Zp(e.prevRanges,n.mapping),e.prevTime):new Up(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Zp(e.prevRanges,n.mapping),e.prevTime);{let i=0==e.prevTime||!s&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,r)=>{for(let i=0;i=t[i]&&(n=!0)})),n}(n,e.prevRanges)),o=s?Zp(e.prevRanges,n.mapping):Gp(n.mapping.maps[n.steps.length-1]);return new Up(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,nm(t)),Kp.empty,o,n.time)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?sm:"historyRedo"==n?am:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}const sm=(e,t)=>{let n=rm.getState(e);return!(!n||0==n.done.eventCount)&&(t&&Qp(n,e,t,!1),!0)},am=(e,t)=>{let n=rm.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&Qp(n,e,t,!0),!0)};function lm(e){let t=rm.getState(e);return t?t.done.eventCount:0}function cm(e){let t=rm.getState(e);return t?t.undone.eventCount:0}var um={},dm={},hm={},fm={};Object.defineProperty(fm,"__esModule",{value:!0}),fm.default=void 0;var pm=xl.withParams;fm.default=pm,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.req=e.regex=e.ref=e.len=void 0,Object.defineProperty(e,"withParams",{enumerable:!0,get:function(){return n.default}});var t,n=(t=fm)&&t.__esModule?t:{default:t};function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=function(e){if(Array.isArray(e))return!!e.length;if(null==e)return!1;if(!1===e)return!0;if(e instanceof Date)return!isNaN(e.getTime());if("object"===r(e)){for(var t in e)return!0;return!1}return!!String(e).length};e.req=i;e.len=function(e){return Array.isArray(e)?e.length:"object"===r(e)?Object.keys(e).length:String(e).length};e.ref=function(e,t,n){return"function"==typeof e?e.call(t,n):n[e]};e.regex=function(e,t){return(0,n.default)({type:e},(function(e){return!i(e)||t.test(e)}))}}(hm),Object.defineProperty(dm,"__esModule",{value:!0}),dm.default=void 0;var mm=(0,hm.regex)("alpha",/^[a-zA-Z]*$/);dm.default=mm;var gm={};Object.defineProperty(gm,"__esModule",{value:!0}),gm.default=void 0;var vm=(0,hm.regex)("alphaNum",/^[a-zA-Z0-9]*$/);gm.default=vm;var ym={};Object.defineProperty(ym,"__esModule",{value:!0}),ym.default=void 0;var bm=(0,hm.regex)("numeric",/^[0-9]*$/);ym.default=bm;var wm={};Object.defineProperty(wm,"__esModule",{value:!0}),wm.default=void 0;var xm=hm;wm.default=function(e,t){return(0,xm.withParams)({type:"between",min:e,max:t},(function(n){return!(0,xm.req)(n)||(!/\s/.test(n)||n instanceof Date)&&+e<=+n&&+t>=+n}))};var Sm={};Object.defineProperty(Sm,"__esModule",{value:!0}),Sm.default=void 0;var km=(0,hm.regex)("email",/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?: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]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i);Sm.default=km;var Cm={};Object.defineProperty(Cm,"__esModule",{value:!0}),Cm.default=void 0;var Om=hm,Mm=(0,Om.withParams)({type:"ipAddress"},(function(e){if(!(0,Om.req)(e))return!0;if("string"!=typeof e)return!1;var t=e.split(".");return 4===t.length&&t.every(_m)}));Cm.default=Mm;var _m=function(e){if(e.length>3||0===e.length)return!1;if("0"===e[0]&&"0"!==e)return!1;if(!e.match(/^\d+$/))return!1;var t=0|+e;return t>=0&&t<=255},Dm={};Object.defineProperty(Dm,"__esModule",{value:!0}),Dm.default=void 0;var Tm=hm;Dm.default=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:":";return(0,Tm.withParams)({type:"macAddress"},(function(t){if(!(0,Tm.req)(t))return!0;if("string"!=typeof t)return!1;var n="string"==typeof e&&""!==e?t.split(e):12===t.length||16===t.length?t.match(/.{2}/g):null;return null!==n&&(6===n.length||8===n.length)&&n.every($m)}))};var $m=function(e){return e.toLowerCase().match(/^[0-9a-f]{2}$/)},Am={};Object.defineProperty(Am,"__esModule",{value:!0}),Am.default=void 0;var Em=hm;Am.default=function(e){return(0,Em.withParams)({type:"maxLength",max:e},(function(t){return!(0,Em.req)(t)||(0,Em.len)(t)<=e}))};var Nm={};Object.defineProperty(Nm,"__esModule",{value:!0}),Nm.default=void 0;var Pm=hm;Nm.default=function(e){return(0,Pm.withParams)({type:"minLength",min:e},(function(t){return!(0,Pm.req)(t)||(0,Pm.len)(t)>=e}))};var Im={};Object.defineProperty(Im,"__esModule",{value:!0}),Im.default=void 0;var Rm=hm,zm=(0,Rm.withParams)({type:"required"},(function(e){return(0,Rm.req)("string"==typeof e?e.trim():e)}));Im.default=zm;var jm={};Object.defineProperty(jm,"__esModule",{value:!0}),jm.default=void 0;var Fm=hm;jm.default=function(e){return(0,Fm.withParams)({type:"requiredIf",prop:e},(function(t,n){return!(0,Fm.ref)(e,this,n)||(0,Fm.req)(t)}))};var Lm={};Object.defineProperty(Lm,"__esModule",{value:!0}),Lm.default=void 0;var Bm=hm;Lm.default=function(e){return(0,Bm.withParams)({type:"requiredUnless",prop:e},(function(t,n){return!!(0,Bm.ref)(e,this,n)||(0,Bm.req)(t)}))};var Vm={};Object.defineProperty(Vm,"__esModule",{value:!0}),Vm.default=void 0;var Wm=hm;Vm.default=function(e){return(0,Wm.withParams)({type:"sameAs",eq:e},(function(t,n){return t===(0,Wm.ref)(e,this,n)}))};var qm={};Object.defineProperty(qm,"__esModule",{value:!0}),qm.default=void 0;var Hm=(0,hm.regex)("url",/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i);qm.default=Hm;var Jm={};Object.defineProperty(Jm,"__esModule",{value:!0}),Jm.default=void 0;var Km=hm;Jm.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&t.reduce((function(t,n){return t||n.apply(e,r)}),!1)}))};var Ym={};Object.defineProperty(Ym,"__esModule",{value:!0}),Ym.default=void 0;var Um=hm;Ym.default=function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&t.reduce((function(t,n){return t&&n.apply(e,r)}),!0)}))};var Xm={};Object.defineProperty(Xm,"__esModule",{value:!0}),Xm.default=void 0;var Gm=hm;Xm.default=function(e){return(0,Gm.withParams)({type:"not"},(function(t,n){return!(0,Gm.req)(t)||!e.call(this,t,n)}))};var Zm={};Object.defineProperty(Zm,"__esModule",{value:!0}),Zm.default=void 0;var Qm=hm;Zm.default=function(e){return(0,Qm.withParams)({type:"minValue",min:e},(function(t){return!(0,Qm.req)(t)||(!/\s/.test(t)||t instanceof Date)&&+t>=+e}))};var eg={};Object.defineProperty(eg,"__esModule",{value:!0}),eg.default=void 0;var tg=hm;eg.default=function(e){return(0,tg.withParams)({type:"maxValue",max:e},(function(t){return!(0,tg.req)(t)||(!/\s/.test(t)||t instanceof Date)&&+t<=+e}))};var ng={};Object.defineProperty(ng,"__esModule",{value:!0}),ng.default=void 0;var rg=(0,hm.regex)("integer",/(^[0-9]*$)|(^-[0-9]+$)/);ng.default=rg;var ig={};Object.defineProperty(ig,"__esModule",{value:!0}),ig.default=void 0;var og=(0,hm.regex)("decimal",/^[-]?\d*(\.\d+)?$/); /**! * Sortable 1.10.2 * @author RubaXa * @author owenm * @license MIT */ function sg(e){return(sg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ag(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lg(){return lg=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}ig.default=og,function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"alpha",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"alphaNum",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"and",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(e,"between",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"decimal",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(e,"email",{enumerable:!0,get:function(){return s.default}}),e.helpers=void 0,Object.defineProperty(e,"integer",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(e,"ipAddress",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"macAddress",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"maxLength",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"maxValue",{enumerable:!0,get:function(){return w.default}}),Object.defineProperty(e,"minLength",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"minValue",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(e,"not",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(e,"numeric",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"or",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(e,"required",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(e,"requiredIf",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(e,"requiredUnless",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"sameAs",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(e,"url",{enumerable:!0,get:function(){return m.default}});var n=O(dm),r=O(gm),i=O(ym),o=O(wm),s=O(Sm),a=O(Cm),l=O(Dm),c=O(Am),u=O(Nm),d=O(Im),h=O(jm),f=O(Lm),p=O(Vm),m=O(qm),g=O(Jm),v=O(Ym),y=O(Xm),b=O(Zm),w=O(eg),x=O(ng),S=O(ig),k=function(e,n){if(!n&&e&&e.__esModule)return e;if(null===e||"object"!==t(e)&&"function"!=typeof e)return{default:e};var r=C(n);if(r&&r.has(e))return r.get(e);var i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var a=o?Object.getOwnPropertyDescriptor(e,s):null;a&&(a.get||a.set)?Object.defineProperty(i,s,a):i[s]=e[s]}i.default=e,r&&r.set(e,i);return i}(hm);function C(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(C=function(e){return e?n:t})(e)}function O(e){return e&&e.__esModule?e:{default:e}}e.helpers=k}(um);function dg(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var hg=dg(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),fg=dg(/Edge/i),pg=dg(/firefox/i),mg=dg(/safari/i)&&!dg(/chrome/i)&&!dg(/android/i),gg=dg(/iP(ad|od|hone)/i),vg=dg(/chrome/i)&&dg(/android/i),yg={capture:!1,passive:!1};function bg(e,t,n){e.addEventListener(t,n,!hg&&yg)}function wg(e,t,n){e.removeEventListener(t,n,!hg&&yg)}function xg(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(n){return!1}return!1}}function Sg(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function kg(e,t,n,r){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&xg(e,t):xg(e,t))||r&&e===n)return e;if(e===n)break}while(e=Sg(e))}return null}var Cg,Og=/\s+/g;function Mg(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(Og," ").replace(" "+t+" "," ");e.className=(r+(n?" "+t:"")).replace(Og," ")}}function _g(e,t,n){var r=e&&e.style;if(r){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];t in r||-1!==t.indexOf("webkit")||(t="-webkit-"+t),r[t]=n+("string"==typeof n?"":"px")}}function Dg(e,t){var n="";if("string"==typeof e)n=e;else do{var r=_g(e,"transform");r&&"none"!==r&&(n=r+" "+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Tg(e,t,n){if(e){var r=e.getElementsByTagName(t),i=0,o=r.length;if(n)for(;i=o:i<=o))return r;if(r===$g())break;r=zg(r,!1)}return!1}function Ng(e,t,n){for(var r=0,i=0,o=e.children;i2&&void 0!==arguments[2]?arguments[2]:{},r=n.evt,i=ug(n,["evt"]);Jg.pluginEvent.bind(Fv)(e,t,cg({dragEl:Ug,parentEl:Xg,ghostEl:Gg,rootEl:Zg,nextEl:Qg,lastDownEl:ev,cloneEl:tv,cloneHidden:nv,dragStarted:mv,putSortable:lv,activeSortable:Fv.active,originalEvent:r,oldIndex:rv,oldDraggableIndex:ov,newIndex:iv,newDraggableIndex:sv,hideGhostForTarget:Iv,unhideGhostForTarget:Rv,cloneNowHidden:function(){nv=!0},cloneNowShown:function(){nv=!1},dispatchSortableEvent:function(e){Yg({sortable:t,name:e,originalEvent:r})}},i))};function Yg(e){!function(e){var t=e.sortable,n=e.rootEl,r=e.name,i=e.targetEl,o=e.cloneEl,s=e.toEl,a=e.fromEl,l=e.oldIndex,c=e.newIndex,u=e.oldDraggableIndex,d=e.newDraggableIndex,h=e.originalEvent,f=e.putSortable,p=e.extraEventProperties;if(t=t||n&&n[Vg]){var m,g=t.options,v="on"+r.charAt(0).toUpperCase()+r.substr(1);!window.CustomEvent||hg||fg?(m=document.createEvent("Event")).initEvent(r,!0,!0):m=new CustomEvent(r,{bubbles:!0,cancelable:!0}),m.to=s||n,m.from=a||n,m.item=i||n,m.clone=o,m.oldIndex=l,m.newIndex=c,m.oldDraggableIndex=u,m.newDraggableIndex=d,m.originalEvent=h,m.pullMode=f?f.lastPutMode:void 0;var y=cg({},p,Jg.getEventProperties(r,t));for(var b in y)m[b]=y[b];n&&n.dispatchEvent(m),g[v]&&g[v].call(t,m)}}(cg({putSortable:lv,cloneEl:tv,targetEl:Ug,rootEl:Zg,oldIndex:rv,oldDraggableIndex:ov,newIndex:iv,newDraggableIndex:sv},e))}var Ug,Xg,Gg,Zg,Qg,ev,tv,nv,rv,iv,ov,sv,av,lv,cv,uv,dv,hv,fv,pv,mv,gv,vv,yv,bv,wv=!1,xv=!1,Sv=[],kv=!1,Cv=!1,Ov=[],Mv=!1,_v=[],Dv="undefined"!=typeof document,Tv=gg,$v=fg||hg?"cssFloat":"float",Av=Dv&&!vg&&!gg&&"draggable"in document.createElement("div"),Ev=function(){if(Dv){if(hg)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),Nv=function(e,t){var n=_g(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=Ng(e,0,t),o=Ng(e,1,t),s=i&&_g(i),a=o&&_g(o),l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+Ag(i).width,c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Ag(o).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&s.float&&"none"!==s.float){var u="left"===s.float?"left":"right";return!o||"both"!==a.clear&&a.clear!==u?"horizontal":"vertical"}return i&&("block"===s.display||"flex"===s.display||"table"===s.display||"grid"===s.display||l>=r&&"none"===n[$v]||o&&"none"===n[$v]&&l+c>r)?"vertical":"horizontal"},Pv=function(e){function t(e,n){return function(r,i,o,s){var a=r.options.group.name&&i.options.group.name&&r.options.group.name===i.options.group.name;if(null==e&&(n||a))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(r,i,o,s),n)(r,i,o,s);var l=(n?r:i).options.group.name;return!0===e||"string"==typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var n={},r=e.group;r&&"object"==sg(r)||(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},Iv=function(){!Ev&&Gg&&_g(Gg,"display","none")},Rv=function(){!Ev&&Gg&&_g(Gg,"display","")};Dv&&document.addEventListener("click",(function(e){if(xv)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),xv=!1,!1}),!0);var zv=function(e){if(Ug){e=e.touches?e.touches[0]:e;var t=(i=e.clientX,o=e.clientY,Sv.some((function(e){if(!Pg(e)){var t=Ag(e),n=e[Vg].options.emptyInsertThreshold,r=i>=t.left-n&&i<=t.right+n,a=o>=t.top-n&&o<=t.bottom+n;return n&&r&&a?s=e:void 0}})),s);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[Vg]._onDragOver(n)}}var i,o,s},jv=function(e){Ug&&Ug.parentNode[Vg]._isOutsideThisEl(e.target)};function Fv(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=lg({},t),e[Vg]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Nv(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Fv.supportPointer&&"PointerEvent"in window,emptyInsertThreshold:5};for(var r in Jg.initializePlugins(this,e,n),n)!(r in t)&&(t[r]=n[r]);for(var i in Pv(t),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!t.forceFallback&&Av,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?bg(e,"pointerdown",this._onTapStart):(bg(e,"mousedown",this._onTapStart),bg(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(bg(e,"dragover",this),bg(e,"dragenter",this)),Sv.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),lg(this,Wg())}function Lv(e,t,n,r,i,o,s,a){var l,c,u=e[Vg],d=u.options.onMove;return!window.CustomEvent||hg||fg?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=t,l.from=e,l.dragged=n,l.draggedRect=r,l.related=i||t,l.relatedRect=o||Ag(t),l.willInsertAfter=a,l.originalEvent=s,e.dispatchEvent(l),d&&(c=d.call(u,l,s)),c}function Bv(e){e.draggable=!1}function Vv(){Mv=!1}function Wv(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function qv(e){return setTimeout(e,0)}function Hv(e){return clearTimeout(e)}Fv.prototype={constructor:Fv,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(gv=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,Ug):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,i=r.preventOnFilter,o=e.type,s=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,a=(s||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||a,c=r.filter;if(function(e){_v.length=0;var t=e.getElementsByTagName("input"),n=t.length;for(;n--;){var r=t[n];r.checked&&_v.push(r)}}(n),!Ug&&!(/mousedown|pointerdown/.test(o)&&0!==e.button||r.disabled||l.isContentEditable||(a=kg(a,r.draggable,n,!1))&&a.animated||ev===a)){if(rv=Ig(a),ov=Ig(a,r.draggable),"function"==typeof c){if(c.call(this,e,a,this))return Yg({sortable:t,rootEl:l,name:"filter",targetEl:a,toEl:n,fromEl:n}),Kg("filter",t,{evt:e}),void(i&&e.cancelable&&e.preventDefault())}else if(c&&(c=c.split(",").some((function(r){if(r=kg(l,r.trim(),n,!1))return Yg({sortable:t,rootEl:r,name:"filter",targetEl:a,fromEl:n,toEl:n}),Kg("filter",t,{evt:e}),!0}))))return void(i&&e.cancelable&&e.preventDefault());r.handle&&!kg(l,r.handle,n,!1)||this._prepareDragStart(e,s,a)}}},_prepareDragStart:function(e,t,n){var r,i=this,o=i.el,s=i.options,a=o.ownerDocument;if(n&&!Ug&&n.parentNode===o){var l=Ag(n);if(Zg=o,Xg=(Ug=n).parentNode,Qg=Ug.nextSibling,ev=n,av=s.group,Fv.dragged=Ug,cv={target:Ug,clientX:(t||e).clientX,clientY:(t||e).clientY},fv=cv.clientX-l.left,pv=cv.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,Ug.style["will-change"]="all",r=function(){Kg("delayEnded",i,{evt:e}),Fv.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!pg&&i.nativeDraggable&&(Ug.draggable=!0),i._triggerDragStart(e,t),Yg({sortable:i,name:"choose",originalEvent:e}),Mg(Ug,s.chosenClass,!0))},s.ignore.split(",").forEach((function(e){Tg(Ug,e.trim(),Bv)})),bg(a,"dragover",zv),bg(a,"mousemove",zv),bg(a,"touchmove",zv),bg(a,"mouseup",i._onDrop),bg(a,"touchend",i._onDrop),bg(a,"touchcancel",i._onDrop),pg&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Ug.draggable=!0),Kg("delayStart",this,{evt:e}),!s.delay||s.delayOnTouchOnly&&!t||this.nativeDraggable&&(fg||hg))r();else{if(Fv.eventCanceled)return void this._onDrop();bg(a,"mouseup",i._disableDelayedDrag),bg(a,"touchend",i._disableDelayedDrag),bg(a,"touchcancel",i._disableDelayedDrag),bg(a,"mousemove",i._delayedDragTouchMoveHandler),bg(a,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&bg(a,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(r,s.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Ug&&Bv(Ug),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;wg(e,"mouseup",this._disableDelayedDrag),wg(e,"touchend",this._disableDelayedDrag),wg(e,"touchcancel",this._disableDelayedDrag),wg(e,"mousemove",this._delayedDragTouchMoveHandler),wg(e,"touchmove",this._delayedDragTouchMoveHandler),wg(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?bg(document,"pointermove",this._onTouchMove):bg(document,t?"touchmove":"mousemove",this._onTouchMove):(bg(Ug,"dragend",this),bg(Zg,"dragstart",this._onDragStart));try{document.selection?qv((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(n){}},_dragStarted:function(e,t){if(wv=!1,Zg&&Ug){Kg("dragStarted",this,{evt:t}),this.nativeDraggable&&bg(document,"dragover",jv);var n=this.options;!e&&Mg(Ug,n.dragClass,!1),Mg(Ug,n.ghostClass,!0),Fv.active=this,e&&this._appendGhost(),Yg({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(uv){this._lastX=uv.clientX,this._lastY=uv.clientY,Iv();for(var e=document.elementFromPoint(uv.clientX,uv.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(uv.clientX,uv.clientY))!==t;)t=e;if(Ug.parentNode[Vg]._isOutsideThisEl(e),t)do{if(t[Vg]){if(t[Vg]._onDragOver({clientX:uv.clientX,clientY:uv.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);Rv()}},_onTouchMove:function(e){if(cv){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,i=e.touches?e.touches[0]:e,o=Gg&&Dg(Gg,!0),s=Gg&&o&&o.a,a=Gg&&o&&o.d,l=Tv&&bv&&Rg(bv),c=(i.clientX-cv.clientX+r.x)/(s||1)+(l?l[0]-Ov[0]:0)/(s||1),u=(i.clientY-cv.clientY+r.y)/(a||1)+(l?l[1]-Ov[1]:0)/(a||1);if(!Fv.active&&!wv){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))r.right+i||e.clientX<=r.right&&e.clientY>r.bottom&&e.clientX>=r.left:e.clientX>r.right&&e.clientY>r.top||e.clientX<=r.right&&e.clientY>r.bottom+i}(e,i,this)&&!m.animated){if(m===Ug)return $(!1);if(m&&o===e.target&&(s=m),s&&(n=Ag(s)),!1!==Lv(Zg,o,Ug,t,s,n,e,!!s))return T(),o.appendChild(Ug),Xg=o,A(),$(!0)}else if(s.parentNode===o){n=Ag(s);var g,v,y,b=Ug.parentNode!==o,w=!function(e,t,n){var r=n?e.left:e.top,i=n?e.right:e.bottom,o=n?e.width:e.height,s=n?t.left:t.top,a=n?t.right:t.bottom,l=n?t.width:t.height;return r===s||i===a||r+o/2===s+l/2}(Ug.animated&&Ug.toRect||t,s.animated&&s.toRect||n,i),x=i?"top":"left",S=Eg(s,"top","top")||Eg(Ug,"top","top"),k=S?S.scrollTop:void 0;if(gv!==s&&(v=n[x],kv=!1,Cv=!w&&a.invertSwap||b),g=function(e,t,n,r,i,o,s,a){var l=r?e.clientY:e.clientX,c=r?n.height:n.width,u=r?n.top:n.left,d=r?n.bottom:n.right,h=!1;if(!s)if(a&&yvu+c*o/2:ld-yv)return-vv}else if(l>u+c*(1-i)/2&&ld-c*o/2))return l>u+c/2?1:-1;return 0}(e,s,n,i,w?1:a.swapThreshold,null==a.invertedSwapThreshold?a.swapThreshold:a.invertedSwapThreshold,Cv,gv===s),0!==g){var C=Ig(Ug);do{C-=g,y=Xg.children[C]}while(y&&("none"===_g(y,"display")||y===Gg))}if(0===g||y===s)return $(!1);gv=s,vv=g;var O=s.nextElementSibling,M=!1,_=Lv(Zg,o,Ug,t,s,n,e,M=1===g);if(!1!==_)return 1!==_&&-1!==_||(M=1===_),Mv=!0,setTimeout(Vv,30),T(),M&&!O?o.appendChild(Ug):s.parentNode.insertBefore(Ug,M?O:s),S&&Lg(S,0,k-S.scrollTop),Xg=Ug.parentNode,void 0===v||Cv||(yv=Math.abs(v-Ag(s)[x])),A(),$(!0)}if(o.contains(Ug))return $(!1)}return!1}function D(a,l){Kg(a,f,cg({evt:e,isOwner:u,axis:i?"vertical":"horizontal",revert:r,dragRect:t,targetRect:n,canSort:d,fromSortable:h,target:s,completed:$,onMove:function(n,r){return Lv(Zg,o,Ug,t,n,Ag(n),e,r)},changed:A},l))}function T(){D("dragOverAnimationCapture"),f.captureAnimationState(),f!==h&&h.captureAnimationState()}function $(t){return D("dragOverCompleted",{insertion:t}),t&&(u?c._hideClone():c._showClone(f),f!==h&&(Mg(Ug,lv?lv.options.ghostClass:c.options.ghostClass,!1),Mg(Ug,a.ghostClass,!0)),lv!==f&&f!==Fv.active?lv=f:f===Fv.active&&lv&&(lv=null),h===f&&(f._ignoreWhileAnimating=s),f.animateAll((function(){D("dragOverAnimationComplete"),f._ignoreWhileAnimating=null})),f!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(s===Ug&&!Ug.animated||s===o&&!s.animated)&&(gv=null),a.dragoverBubble||e.rootEl||s===document||(Ug.parentNode[Vg]._isOutsideThisEl(e.target),!t&&zv(e)),!a.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),p=!0}function A(){iv=Ig(Ug),sv=Ig(Ug,a.draggable),Yg({sortable:f,name:"change",toEl:o,newIndex:iv,newDraggableIndex:sv,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){wg(document,"mousemove",this._onTouchMove),wg(document,"touchmove",this._onTouchMove),wg(document,"pointermove",this._onTouchMove),wg(document,"dragover",zv),wg(document,"mousemove",zv),wg(document,"touchmove",zv)},_offUpEvents:function(){var e=this.el.ownerDocument;wg(e,"mouseup",this._onDrop),wg(e,"touchend",this._onDrop),wg(e,"pointerup",this._onDrop),wg(e,"touchcancel",this._onDrop),wg(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;iv=Ig(Ug),sv=Ig(Ug,n.draggable),Kg("drop",this,{evt:e}),Xg=Ug&&Ug.parentNode,iv=Ig(Ug),sv=Ig(Ug,n.draggable),Fv.eventCanceled||(wv=!1,Cv=!1,kv=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Hv(this.cloneId),Hv(this._dragStartId),this.nativeDraggable&&(wg(document,"drop",this),wg(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),mg&&_g(document.body,"user-select",""),_g(Ug,"transform",""),e&&(mv&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),Gg&&Gg.parentNode&&Gg.parentNode.removeChild(Gg),(Zg===Xg||lv&&"clone"!==lv.lastPutMode)&&tv&&tv.parentNode&&tv.parentNode.removeChild(tv),Ug&&(this.nativeDraggable&&wg(Ug,"dragend",this),Bv(Ug),Ug.style["will-change"]="",mv&&!wv&&Mg(Ug,lv?lv.options.ghostClass:this.options.ghostClass,!1),Mg(Ug,this.options.chosenClass,!1),Yg({sortable:this,name:"unchoose",toEl:Xg,newIndex:null,newDraggableIndex:null,originalEvent:e}),Zg!==Xg?(iv>=0&&(Yg({rootEl:Xg,name:"add",toEl:Xg,fromEl:Zg,originalEvent:e}),Yg({sortable:this,name:"remove",toEl:Xg,originalEvent:e}),Yg({rootEl:Xg,name:"sort",toEl:Xg,fromEl:Zg,originalEvent:e}),Yg({sortable:this,name:"sort",toEl:Xg,originalEvent:e})),lv&&lv.save()):iv!==rv&&iv>=0&&(Yg({sortable:this,name:"update",toEl:Xg,originalEvent:e}),Yg({sortable:this,name:"sort",toEl:Xg,originalEvent:e})),Fv.active&&(null!=iv&&-1!==iv||(iv=rv,sv=ov),Yg({sortable:this,name:"end",toEl:Xg,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){Kg("nulling",this),Zg=Ug=Xg=Gg=Qg=tv=ev=nv=cv=uv=mv=iv=sv=rv=ov=gv=vv=lv=av=Fv.dragged=Fv.ghost=Fv.clone=Fv.active=null,_v.forEach((function(e){e.checked=!0})),_v.length=dv=hv=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":Ug&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move");e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,r=0,i=n.length,o=this.options;re.replace(ay,((e,t)=>t?t.toUpperCase():""))));function cy(e){null!==e.parentElement&&e.parentElement.removeChild(e)}function uy(e,t,n){const r=0===n?e.children[0]:e.children[n-1].nextSibling;e.insertBefore(t,r)}function dy(e,t){this.$nextTick((()=>this.$emit(e.toLowerCase(),t)))}function hy(e){return t=>{null!==this.realList&&this["onDrag"+e](t),dy.call(this,e,t)}}function fy(e){return["transition-group","TransitionGroup"].includes(e)}function py(e,t,n){return e[n]||(t[n]?t[n]():void 0)}const my=["Start","Add","Remove","Update","End"],gy=["Choose","Unchoose","Sort","Filter","Clone"],vy=["Move",...my,...gy].map((e=>"on"+e));var yy=null;const by={name:"draggable",inheritAttrs:!1,props:{options:Object,list:{type:Array,required:!1,default:null},value:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:e=>e},element:{type:String,default:"div"},tag:{type:String,default:null},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null}},data:()=>({transitionMode:!1,noneFunctionalComponentMode:!1}),render(e){const t=this.$slots.default;this.transitionMode=function(e){if(!e||1!==e.length)return!1;const[{componentOptions:t}]=e;return!!t&&fy(t.tag)}(t);const{children:n,headerOffset:r,footerOffset:i}=function(e,t,n){let r=0,i=0;const o=py(t,n,"header");o&&(r=o.length,e=e?[...o,...e]:[...o]);const s=py(t,n,"footer");return s&&(i=s.length,e=e?[...e,...s]:[...s]),{children:e,headerOffset:r,footerOffset:i}}(t,this.$slots,this.$scopedSlots);this.headerOffset=r,this.footerOffset=i;const o=function(e,t){let n=null;const r=(e,t)=>{n=function(e,t,n){return void 0===n||((e=e||{})[t]=n),e}(n,e,t)};if(r("attrs",Object.keys(e).filter((e=>"id"===e||e.startsWith("data-"))).reduce(((t,n)=>(t[n]=e[n],t)),{})),!t)return n;const{on:i,props:o,attrs:s}=t;return r("on",i),r("props",o),Object.assign(n.attrs,s),n}(this.$attrs,this.componentData);return e(this.getTag(),o,n)},created(){null!==this.list&&null!==this.value&&sy.error("Value and list props are mutually exclusive! Please set one or another."),"div"!==this.element&&sy.warn("Element props is deprecated please use tag props instead. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#element-props"),void 0!==this.options&&sy.warn("Options props is deprecated, add sortable options directly as vue.draggable item, or use v-bind. See https://github.com/SortableJS/Vue.Draggable/blob/master/documentation/migrate.md#options-props")},mounted(){if(this.noneFunctionalComponentMode=this.getTag().toLowerCase()!==this.$el.nodeName.toLowerCase()&&!this.getIsFunctional(),this.noneFunctionalComponentMode&&this.transitionMode)throw new Error(`Transition-group inside component is not supported. Please alter tag value or remove transition-group. Current tag value: ${this.getTag()}`);const e={};my.forEach((t=>{e["on"+t]=hy.call(this,t)})),gy.forEach((t=>{e["on"+t]=dy.bind(this,t)}));const t=Object.keys(this.$attrs).reduce(((e,t)=>(e[ly(t)]=this.$attrs[t],e)),{}),n=Object.assign({},this.options,t,e,{onMove:(e,t)=>this.onDragMove(e,t)});!("draggable"in n)&&(n.draggable=">*"),this._sortable=new Fv(this.rootContainer,n),this.computeIndexes()},beforeDestroy(){void 0!==this._sortable&&this._sortable.destroy()},computed:{rootContainer(){return this.transitionMode?this.$el.children[0]:this.$el},realList(){return this.list?this.list:this.value}},watch:{options:{handler(e){this.updateOptions(e)},deep:!0},$attrs:{handler(e){this.updateOptions(e)},deep:!0},realList(){this.computeIndexes()}},methods:{getIsFunctional(){const{fnOptions:e}=this._vnode;return e&&e.functional},getTag(){return this.tag||this.element},updateOptions(e){for(var t in e){const n=ly(t);-1===vy.indexOf(n)&&this._sortable.option(n,e[t])}},getChildrenNodes(){if(this.noneFunctionalComponentMode)return this.$children[0].$slots.default;const e=this.$slots.default;return this.transitionMode?e[0].child.$slots.default:e},computeIndexes(){this.$nextTick((()=>{this.visibleIndexes=function(e,t,n,r){if(!e)return[];const i=e.map((e=>e.elm)),o=t.length-r,s=[...t].map(((e,t)=>t>=o?i.length:i.indexOf(e)));return n?s.filter((e=>-1!==e)):s}(this.getChildrenNodes(),this.rootContainer.children,this.transitionMode,this.footerOffset)}))},getUnderlyingVm(e){const t=function(e,t){return e.map((e=>e.elm)).indexOf(t)}(this.getChildrenNodes()||[],e);if(-1===t)return null;return{index:t,element:this.realList[t]}},getUnderlyingPotencialDraggableComponent:({__vue__:e})=>e&&e.$options&&fy(e.$options._componentTag)?e.$parent:!("realList"in e)&&1===e.$children.length&&"realList"in e.$children[0]?e.$children[0]:e,emitChanges(e){this.$nextTick((()=>{this.$emit("change",e)}))},alterList(e){if(this.list)return void e(this.list);const t=[...this.value];e(t),this.$emit("input",t)},spliceList(){this.alterList((e=>e.splice(...arguments)))},updatePosition(e,t){this.alterList((n=>n.splice(t,0,n.splice(e,1)[0])))},getRelatedContextFromMoveEvent({to:e,related:t}){const n=this.getUnderlyingPotencialDraggableComponent(e);if(!n)return{component:n};const r=n.realList,i={list:r,component:n};if(e!==t&&r&&n.getUnderlyingVm){const e=n.getUnderlyingVm(t);if(e)return Object.assign(e,i)}return i},getVmIndex(e){const t=this.visibleIndexes,n=t.length;return e>n-1?n:t[e]},getComponent(){return this.$slots.default[0].componentInstance},resetTransitionData(e){if(!this.noTransitionOnDrag||!this.transitionMode)return;this.getChildrenNodes()[e].data=null;const t=this.getComponent();t.children=[],t.kept=void 0},onDragStart(e){this.context=this.getUnderlyingVm(e.item),e.item._underlying_vm_=this.clone(this.context.element),yy=e.item},onDragAdd(e){const t=e.item._underlying_vm_;if(void 0===t)return;cy(e.item);const n=this.getVmIndex(e.newIndex);this.spliceList(n,0,t),this.computeIndexes();const r={element:t,newIndex:n};this.emitChanges({added:r})},onDragRemove(e){if(uy(this.rootContainer,e.item,e.oldIndex),"clone"===e.pullMode)return void cy(e.clone);const t=this.context.index;this.spliceList(t,1);const n={element:this.context.element,oldIndex:t};this.resetTransitionData(t),this.emitChanges({removed:n})},onDragUpdate(e){cy(e.item),uy(e.from,e.item,e.oldIndex);const t=this.context.index,n=this.getVmIndex(e.newIndex);this.updatePosition(t,n);const r={element:this.context.element,oldIndex:t,newIndex:n};this.emitChanges({moved:r})},updateProperty(e,t){e.hasOwnProperty(t)&&(e[t]+=this.headerOffset)},computeFutureIndex(e,t){if(!e.element)return 0;const n=[...t.to.children].filter((e=>"none"!==e.style.display)),r=n.indexOf(t.related),i=e.component.getVmIndex(r);return-1!==n.indexOf(yy)||!t.willInsertAfter?i:i+1},onDragMove(e,t){const n=this.move;if(!n||!this.realList)return!0;const r=this.getRelatedContextFromMoveEvent(e),i=this.context,o=this.computeFutureIndex(r,e);Object.assign(i,{futureIndex:o});return n(Object.assign({},e,{relatedContext:r,draggedContext:i}),t)},onDragEnd(){this.computeIndexes(),yy=null}}};"undefined"!=typeof window&&"Vue"in window&&window.Vue.component("draggable",by);export{cm as A,om as B,um as C,Mc as D,Iu as E,Rl as F,by as G,ul as H,Op as I,El as J,Cu as N,zu as P,Vl as S,Su as T,Mn as V,Wa as a,Za as b,rl as c,tl as d,bp as e,hp as f,Tp as g,$p as h,jp as i,Lp as j,Vp as k,Bp as l,qa as m,op as n,Cc as o,Mp as p,Lf as q,Rc as r,vp as s,yp as t,Dp as u,Cp as v,Fp as w,sm as x,am as y,lm as z};