mc-plus 1.0.112 → 1.0.113

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- (function(_,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):r((_=typeof globalThis<"u"?globalThis:_||self).McPlus={},_.Vue)})(this,function(_,r){"use strict";var rO=Object.defineProperty;var iO=(_,r,Kn)=>r in _?rO(_,r,{enumerable:!0,configurable:!0,writable:!0,value:Kn}):_[r]=Kn;var ke=(_,r,Kn)=>iO(_,typeof r!="symbol"?r+"":r,Kn);var Kn=typeof global=="object"&&global&&global.Object===Object&&global,$0=typeof self=="object"&&self&&self.Object===Object&&self,Xe=Kn||$0||Function("return this")(),wt=Xe.Symbol,au=Object.prototype,P0=au.hasOwnProperty,z0=au.toString,fr=wt?wt.toStringTag:void 0,F0=Object.prototype.toString,lu=wt?wt.toStringTag:void 0;function Zt(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":lu&&lu in Object(t)?function(e){var n=P0.call(e,fr),o=e[fr];try{e[fr]=void 0;var i=!0}catch{}var s=z0.call(e);return i&&(n?e[fr]=o:delete e[fr]),s}(t):function(e){return F0.call(e)}(t)}function ht(t){return t!=null&&typeof t=="object"}function Co(t){return typeof t=="symbol"||ht(t)&&Zt(t)=="[object Symbol]"}function So(t,e){for(var n=-1,o=t==null?0:t.length,i=Array(o);++n<o;)i[n]=e(t[n],n,t);return i}var ce=Array.isArray,cu=wt?wt.prototype:void 0,du=cu?cu.toString:void 0;function bi(t){if(typeof t=="string")return t;if(ce(t))return So(t,bi)+"";if(Co(t))return du?du.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var j0=/\s/,H0=/^\s+/;function xt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var W0=/^[-+]0x[0-9a-f]+$/i,K0=/^0b[01]+$/i,U0=/^0o[0-7]+$/i,q0=parseInt;function ki(t){if(typeof t=="number")return t;if(Co(t))return NaN;if(xt(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=xt(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;var n;t=(n=t)?n.slice(0,function(i){for(var s=i.length;s--&&j0.test(i.charAt(s)););return s}(n)+1).replace(H0,""):n;var o=K0.test(t);return o||U0.test(t)?q0(t.slice(2),o?2:8):W0.test(t)?NaN:+t}var J0=1/0;function Un(t){var e=function(o){return o?(o=ki(o))===J0||o===-1/0?17976931348623157e292*(o<0?-1:1):o==o?o:0:o===0?o:0}(t),n=e%1;return e==e?n?e-n:e:0}function Eo(t){return t}function He(t){if(!xt(t))return!1;var e=Zt(t);return e=="[object Function]"||e=="[object GeneratorFunction]"||e=="[object AsyncFunction]"||e=="[object Proxy]"}var uu,Oa=Xe["__core-js_shared__"],pu=(uu=/[^.]+$/.exec(Oa&&Oa.keys&&Oa.keys.IE_PROTO||""))?"Symbol(src)_1."+uu:"",G0=Function.prototype.toString;function qn(t){if(t!=null){try{return G0.call(t)}catch{}try{return t+""}catch{}}return""}var Y0=/^\[object .+?Constructor\]$/,X0=Function.prototype,Q0=Object.prototype,Z0=X0.toString,eb=Q0.hasOwnProperty,tb=RegExp("^"+Z0.call(eb).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Jn(t,e){var n=function(o,i){return o==null?void 0:o[i]}(t,e);return function(o){return!(!xt(o)||(i=o,pu&&pu in i))&&(He(o)?tb:Y0).test(qn(o));var i}(n)?n:void 0}var mr=Jn(Xe,"WeakMap"),wi=mr&&new mr,hu=wi?function(t,e){return wi.set(t,e),t}:Eo,fu=Object.create,xi=function(){function t(){}return function(e){if(!xt(e))return{};if(fu)return fu(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function gr(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=xi(t.prototype),o=t.apply(n,e);return xt(o)?o:n}}function _a(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var nb=Math.max;function mu(t,e,n,o){for(var i=-1,s=t.length,a=n.length,l=-1,c=e.length,d=nb(s-a,0),u=Array(c+d),p=!o;++l<c;)u[l]=e[l];for(;++i<a;)(p||i<s)&&(u[n[i]]=t[i]);for(;d--;)u[l++]=t[i++];return u}var ob=Math.max;function gu(t,e,n,o){for(var i=-1,s=t.length,a=-1,l=n.length,c=-1,d=e.length,u=ob(s-l,0),p=Array(u+d),h=!o;++i<u;)p[i]=t[i];for(var f=i;++c<d;)p[f+c]=e[c];for(;++a<l;)(h||i<s)&&(p[f+n[a]]=t[i++]);return p}function Va(){}function Mo(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function vu(){}Mo.prototype=xi(Va.prototype),Mo.prototype.constructor=Mo;var yu=wi?function(t){return wi.get(t)}:vu,bu={},rb=Object.prototype.hasOwnProperty;function No(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function ku(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e}No.prototype=xi(Va.prototype),No.prototype.constructor=No;var ib=Object.prototype.hasOwnProperty;function Ci(t){if(ht(t)&&!ce(t)&&!(t instanceof Mo)){if(t instanceof No)return t;if(ib.call(t,"__wrapped__"))return function(e){if(e instanceof Mo)return e.clone();var n=new No(e.__wrapped__,e.__chain__);return n.__actions__=ku(e.__actions__),n.__index__=e.__index__,n.__values__=e.__values__,n}(t)}return new No(t)}Ci.prototype=Va.prototype,Ci.prototype.constructor=Ci;var sb=Date.now;function wu(t){var e=0,n=0;return function(){var o=sb(),i=16-(o-n);if(n=o,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var xu=wu(hu),ab=/\{\n\/\* \[wrapped with (.+)\] \*/,lb=/,? & /,cb=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Si=function(){try{var t=Jn(Object,"defineProperty");return t({},"",{}),t}catch{}}(),db=Si?function(t,e){return Si(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:Eo,Cu=wu(db);function Aa(t,e){for(var n=-1,o=t==null?0:t.length;++n<o&&e(t[n],n,t)!==!1;);return t}function Su(t,e,n,o){for(var i=t.length,s=n+-1;++s<i;)if(e(t[s],s,t))return s;return-1}function ub(t){return t!=t}function Da(t,e,n){return e==e?function(o,i,s){for(var a=s-1,l=o.length;++a<l;)if(o[a]===i)return a;return-1}(t,e,n):Su(t,ub,n)}function Ia(t,e){return!(t==null||!t.length)&&Da(t,e,0)>-1}var pb=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];function Eu(t,e,n){var o=e+"";return Cu(t,function(i,s){var a=s.length;if(!a)return i;var l=a-1;return s[l]=(a>1?"& ":"")+s[l],s=s.join(a>2?", ":" "),i.replace(cb,`{
1
+ (function(_,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):r((_=typeof globalThis<"u"?globalThis:_||self).McPlus={},_.Vue)})(this,function(_,r){"use strict";var sO=Object.defineProperty;var aO=(_,r,Kn)=>r in _?sO(_,r,{enumerable:!0,configurable:!0,writable:!0,value:Kn}):_[r]=Kn;var ke=(_,r,Kn)=>aO(_,typeof r!="symbol"?r+"":r,Kn);var Kn=typeof global=="object"&&global&&global.Object===Object&&global,$0=typeof self=="object"&&self&&self.Object===Object&&self,Xe=Kn||$0||Function("return this")(),wt=Xe.Symbol,au=Object.prototype,P0=au.hasOwnProperty,z0=au.toString,fr=wt?wt.toStringTag:void 0,F0=Object.prototype.toString,lu=wt?wt.toStringTag:void 0;function Zt(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":lu&&lu in Object(t)?function(e){var n=P0.call(e,fr),o=e[fr];try{e[fr]=void 0;var i=!0}catch{}var s=z0.call(e);return i&&(n?e[fr]=o:delete e[fr]),s}(t):function(e){return F0.call(e)}(t)}function ht(t){return t!=null&&typeof t=="object"}function Co(t){return typeof t=="symbol"||ht(t)&&Zt(t)=="[object Symbol]"}function So(t,e){for(var n=-1,o=t==null?0:t.length,i=Array(o);++n<o;)i[n]=e(t[n],n,t);return i}var ce=Array.isArray,cu=wt?wt.prototype:void 0,du=cu?cu.toString:void 0;function bi(t){if(typeof t=="string")return t;if(ce(t))return So(t,bi)+"";if(Co(t))return du?du.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var j0=/\s/,H0=/^\s+/;function xt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var W0=/^[-+]0x[0-9a-f]+$/i,K0=/^0b[01]+$/i,U0=/^0o[0-7]+$/i,q0=parseInt;function ki(t){if(typeof t=="number")return t;if(Co(t))return NaN;if(xt(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=xt(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;var n;t=(n=t)?n.slice(0,function(i){for(var s=i.length;s--&&j0.test(i.charAt(s)););return s}(n)+1).replace(H0,""):n;var o=K0.test(t);return o||U0.test(t)?q0(t.slice(2),o?2:8):W0.test(t)?NaN:+t}var J0=1/0;function Un(t){var e=function(o){return o?(o=ki(o))===J0||o===-1/0?17976931348623157e292*(o<0?-1:1):o==o?o:0:o===0?o:0}(t),n=e%1;return e==e?n?e-n:e:0}function Eo(t){return t}function He(t){if(!xt(t))return!1;var e=Zt(t);return e=="[object Function]"||e=="[object GeneratorFunction]"||e=="[object AsyncFunction]"||e=="[object Proxy]"}var uu,Oa=Xe["__core-js_shared__"],pu=(uu=/[^.]+$/.exec(Oa&&Oa.keys&&Oa.keys.IE_PROTO||""))?"Symbol(src)_1."+uu:"",G0=Function.prototype.toString;function qn(t){if(t!=null){try{return G0.call(t)}catch{}try{return t+""}catch{}}return""}var Y0=/^\[object .+?Constructor\]$/,X0=Function.prototype,Q0=Object.prototype,Z0=X0.toString,eb=Q0.hasOwnProperty,tb=RegExp("^"+Z0.call(eb).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Jn(t,e){var n=function(o,i){return o==null?void 0:o[i]}(t,e);return function(o){return!(!xt(o)||(i=o,pu&&pu in i))&&(He(o)?tb:Y0).test(qn(o));var i}(n)?n:void 0}var mr=Jn(Xe,"WeakMap"),wi=mr&&new mr,hu=wi?function(t,e){return wi.set(t,e),t}:Eo,fu=Object.create,xi=function(){function t(){}return function(e){if(!xt(e))return{};if(fu)return fu(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function gr(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=xi(t.prototype),o=t.apply(n,e);return xt(o)?o:n}}function _a(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var nb=Math.max;function mu(t,e,n,o){for(var i=-1,s=t.length,a=n.length,l=-1,c=e.length,d=nb(s-a,0),u=Array(c+d),p=!o;++l<c;)u[l]=e[l];for(;++i<a;)(p||i<s)&&(u[n[i]]=t[i]);for(;d--;)u[l++]=t[i++];return u}var ob=Math.max;function gu(t,e,n,o){for(var i=-1,s=t.length,a=-1,l=n.length,c=-1,d=e.length,u=ob(s-l,0),p=Array(u+d),h=!o;++i<u;)p[i]=t[i];for(var f=i;++c<d;)p[f+c]=e[c];for(;++a<l;)(h||i<s)&&(p[f+n[a]]=t[i++]);return p}function Va(){}function Mo(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function vu(){}Mo.prototype=xi(Va.prototype),Mo.prototype.constructor=Mo;var yu=wi?function(t){return wi.get(t)}:vu,bu={},rb=Object.prototype.hasOwnProperty;function No(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function ku(t,e){var n=-1,o=t.length;for(e||(e=Array(o));++n<o;)e[n]=t[n];return e}No.prototype=xi(Va.prototype),No.prototype.constructor=No;var ib=Object.prototype.hasOwnProperty;function Ci(t){if(ht(t)&&!ce(t)&&!(t instanceof Mo)){if(t instanceof No)return t;if(ib.call(t,"__wrapped__"))return function(e){if(e instanceof Mo)return e.clone();var n=new No(e.__wrapped__,e.__chain__);return n.__actions__=ku(e.__actions__),n.__index__=e.__index__,n.__values__=e.__values__,n}(t)}return new No(t)}Ci.prototype=Va.prototype,Ci.prototype.constructor=Ci;var sb=Date.now;function wu(t){var e=0,n=0;return function(){var o=sb(),i=16-(o-n);if(n=o,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var xu=wu(hu),ab=/\{\n\/\* \[wrapped with (.+)\] \*/,lb=/,? & /,cb=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Si=function(){try{var t=Jn(Object,"defineProperty");return t({},"",{}),t}catch{}}(),db=Si?function(t,e){return Si(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:Eo,Cu=wu(db);function Da(t,e){for(var n=-1,o=t==null?0:t.length;++n<o&&e(t[n],n,t)!==!1;);return t}function Su(t,e,n,o){for(var i=t.length,s=n+-1;++s<i;)if(e(t[s],s,t))return s;return-1}function ub(t){return t!=t}function Aa(t,e,n){return e==e?function(o,i,s){for(var a=s-1,l=o.length;++a<l;)if(o[a]===i)return a;return-1}(t,e,n):Su(t,ub,n)}function Ia(t,e){return!(t==null||!t.length)&&Aa(t,e,0)>-1}var pb=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];function Eu(t,e,n){var o=e+"";return Cu(t,function(i,s){var a=s.length;if(!a)return i;var l=a-1;return s[l]=(a>1?"& ":"")+s[l],s=s.join(a>2?", ":" "),i.replace(cb,`{
2
2
  /* [wrapped with `+s+`] */
3
- `)}(o,function(i,s){return Aa(pb,function(a){var l="_."+a[0];s&a[1]&&!Ia(i,l)&&i.push(l)}),i.sort()}(function(i){var s=i.match(ab);return s?s[1].split(lb):[]}(o),n)))}function Mu(t,e,n,o,i,s,a,l,c,d){var u=8&e;e|=u?32:64,4&(e&=~(u?64:32))||(e&=-4);var p=[t,e,i,u?s:void 0,u?a:void 0,u?void 0:s,u?void 0:a,l,c,d],h=n.apply(void 0,p);return function(f){var m=function(b){for(var y=b.name+"",k=bu[y],x=rb.call(bu,y)?k.length:0;x--;){var w=k[x],C=w.func;if(C==null||C==b)return w.name}return y}(f),g=Ci[m];if(typeof g!="function"||!(m in Mo.prototype))return!1;if(f===g)return!0;var v=yu(g);return!!v&&f===v[0]}(t)&&xu(h,p),h.placeholder=o,Eu(h,t,e)}function Ra(t){return t.placeholder}var hb=/^(?:0|[1-9]\d*)$/;function Ei(t,e){var n=typeof t;return!!(e=e??9007199254740991)&&(n=="number"||n!="symbol"&&hb.test(t))&&t>-1&&t%1==0&&t<e}var fb=Math.min,Nu="__lodash_placeholder__";function vr(t,e){for(var n=-1,o=t.length,i=0,s=[];++n<o;){var a=t[n];a!==e&&a!==Nu||(t[n]=Nu,s[i++]=n)}return s}function La(t,e,n,o,i,s,a,l,c,d){var u=128&e,p=1&e,h=2&e,f=24&e,m=512&e,g=h?void 0:gr(t);return function v(){for(var b=arguments.length,y=Array(b),k=b;k--;)y[k]=arguments[k];if(f)var x=Ra(v),w=function(M,N){for(var T=M.length,D=0;T--;)M[T]===N&&++D;return D}(y,x);if(o&&(y=mu(y,o,i,f)),s&&(y=gu(y,s,a,f)),b-=w,f&&b<d){var C=vr(y,x);return Mu(t,e,La,v.placeholder,n,y,C,l,c,d-b)}var S=p?n:this,E=h?S[t]:t;return b=y.length,l?y=function(M,N){for(var T=M.length,D=fb(N.length,T),$=ku(M);D--;){var B=N[D];M[D]=Ei(B,T)?$[B]:void 0}return M}(y,l):m&&b>1&&y.reverse(),u&&c<b&&(y.length=c),this&&this!==Xe&&this instanceof v&&(E=g||gr(E)),E.apply(S,y)}}var Bu="__lodash_placeholder__",mb=Math.min,Tu=Math.max;function Ou(t,e,n){e=="__proto__"&&Si?Si(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Mi(t,e){return t===e||t!=t&&e!=e}var gb=Object.prototype.hasOwnProperty;function $a(t,e,n){var o=t[e];gb.call(t,e)&&Mi(o,n)&&(n!==void 0||e in t)||Ou(t,e,n)}var _u=Math.max;function Pa(t,e){return Cu(function(n,o,i){return o=_u(o===void 0?n.length-1:o,0),function(){for(var s=arguments,a=-1,l=_u(s.length-o,0),c=Array(l);++a<l;)c[a]=s[o+a];a=-1;for(var d=Array(o+1);++a<o;)d[a]=s[a];return d[o]=i(c),_a(n,this,d)}}(t,e,Eo),t+"")}function za(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=9007199254740991}function Pt(t){return t!=null&&za(t.length)&&!He(t)}var vb=Object.prototype;function Ni(t){var e=t&&t.constructor;return t===(typeof e=="function"&&e.prototype||vb)}function Vu(t){return ht(t)&&Zt(t)=="[object Arguments]"}var Au=Object.prototype,yb=Au.hasOwnProperty,bb=Au.propertyIsEnumerable,Bi=Vu(function(){return arguments}())?Vu:function(t){return ht(t)&&yb.call(t,"callee")&&!bb.call(t,"callee")},Du=typeof _=="object"&&_&&!_.nodeType&&_,Iu=Du&&typeof module=="object"&&module&&!module.nodeType&&module,Ru=Iu&&Iu.exports===Du?Xe.Buffer:void 0,yr=(Ru?Ru.isBuffer:void 0)||function(){return!1},Se={};function Ti(t){return function(e){return t(e)}}Se["[object Float32Array]"]=Se["[object Float64Array]"]=Se["[object Int8Array]"]=Se["[object Int16Array]"]=Se["[object Int32Array]"]=Se["[object Uint8Array]"]=Se["[object Uint8ClampedArray]"]=Se["[object Uint16Array]"]=Se["[object Uint32Array]"]=!0,Se["[object Arguments]"]=Se["[object Array]"]=Se["[object ArrayBuffer]"]=Se["[object Boolean]"]=Se["[object DataView]"]=Se["[object Date]"]=Se["[object Error]"]=Se["[object Function]"]=Se["[object Map]"]=Se["[object Number]"]=Se["[object Object]"]=Se["[object RegExp]"]=Se["[object Set]"]=Se["[object String]"]=Se["[object WeakMap]"]=!1;var Lu=typeof _=="object"&&_&&!_.nodeType&&_,br=Lu&&typeof module=="object"&&module&&!module.nodeType&&module,Fa=br&&br.exports===Lu&&Kn.process,Bo=function(){try{return br&&br.require&&br.require("util").types||Fa&&Fa.binding&&Fa.binding("util")}catch{}}(),$u=Bo&&Bo.isTypedArray,ja=$u?Ti($u):function(t){return ht(t)&&za(t.length)&&!!Se[Zt(t)]},kb=Object.prototype.hasOwnProperty;function Pu(t,e){return function(n){return t(e(n))}}var wb=Pu(Object.keys,Object),xb=Object.prototype.hasOwnProperty;function Ha(t){if(!Ni(t))return wb(t);var e=[];for(var n in Object(t))xb.call(t,n)&&n!="constructor"&&e.push(n);return e}function vn(t){return Pt(t)?function(e){var n=ce(e),o=!n&&Bi(e),i=!n&&!o&&yr(e),s=!n&&!o&&!i&&ja(e),a=n||o||i||s,l=a?function(u,p){for(var h=-1,f=Array(u);++h<u;)f[h]=p(h);return f}(e.length,String):[],c=l.length;for(var d in e)!kb.call(e,d)||a&&(d=="length"||i&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Ei(d,c))||l.push(d);return l}(t):Ha(t)}var Wa,Cb=Object.prototype.hasOwnProperty,zu=(Wa=function(t,e){if(Ni(e)||Pt(e))(function(o,i,s){var a=!s;s||(s={});for(var l=-1,c=i.length;++l<c;){var d=i[l],u=void 0;u===void 0&&(u=o[d]),a?Ou(s,d,u):$a(s,d,u)}})(e,vn(e),t);else for(var n in e)Cb.call(e,n)&&$a(t,n,e[n])},Pa(function(t,e){var n=-1,o=e.length,i=o>1?e[o-1]:void 0,s=o>2?e[2]:void 0;for(i=Wa.length>3&&typeof i=="function"?(o--,i):void 0,s&&function(l,c,d){if(!xt(d))return!1;var u=typeof c;return!!(u=="number"?Pt(d)&&Ei(c,d.length):u=="string"&&c in d)&&Mi(d[c],l)}(e[0],e[1],s)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var a=e[n];a&&Wa(t,a)}return t})),Sb=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Eb=/^\w*$/;function Ka(t,e){if(ce(t))return!1;var n=typeof t;return!(n!="number"&&n!="symbol"&&n!="boolean"&&t!=null&&!Co(t))||Eb.test(t)||!Sb.test(t)||e!=null&&t in Object(e)}var kr=Jn(Object,"create"),Mb=Object.prototype.hasOwnProperty,Nb=Object.prototype.hasOwnProperty;function Gn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}function Oi(t,e){for(var n=t.length;n--;)if(Mi(t[n][0],e))return n;return-1}Gn.prototype.clear=function(){this.__data__=kr?kr(null):{},this.size=0},Gn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Gn.prototype.get=function(t){var e=this.__data__;if(kr){var n=e[t];return n==="__lodash_hash_undefined__"?void 0:n}return Mb.call(e,t)?e[t]:void 0},Gn.prototype.has=function(t){var e=this.__data__;return kr?e[t]!==void 0:Nb.call(e,t)},Gn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=kr&&e===void 0?"__lodash_hash_undefined__":e,this};var Bb=Array.prototype.splice;function en(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}en.prototype.clear=function(){this.__data__=[],this.size=0},en.prototype.delete=function(t){var e=this.__data__,n=Oi(e,t);return!(n<0||(n==e.length-1?e.pop():Bb.call(e,n,1),--this.size,0))},en.prototype.get=function(t){var e=this.__data__,n=Oi(e,t);return n<0?void 0:e[n][1]},en.prototype.has=function(t){return Oi(this.__data__,t)>-1},en.prototype.set=function(t,e){var n=this.__data__,o=Oi(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};var wr=Jn(Xe,"Map");function _i(t,e){var n=t.__data__;return function(o){var i=typeof o;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?o!=="__proto__":o===null}(e)?n[typeof e=="string"?"string":"hash"]:n.map}function tn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}function Ua(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");var n=function(){var o=arguments,i=e?e.apply(this,o):o[0],s=n.cache;if(s.has(i))return s.get(i);var a=t.apply(this,o);return n.cache=s.set(i,a)||s,a};return n.cache=new(Ua.Cache||tn),n}tn.prototype.clear=function(){this.size=0,this.__data__={hash:new Gn,map:new(wr||en),string:new Gn}},tn.prototype.delete=function(t){var e=_i(this,t).delete(t);return this.size-=e?1:0,e},tn.prototype.get=function(t){return _i(this,t).get(t)},tn.prototype.has=function(t){return _i(this,t).has(t)},tn.prototype.set=function(t,e){var n=_i(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this},Ua.Cache=tn;var Fu,qa,Ja,Tb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ob=/\\(\\)?/g,_b=(Fu=function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Tb,function(n,o,i,s){e.push(i?s.replace(Ob,"$1"):o||n)}),e},qa=Ua(Fu,function(t){return Ja.size===500&&Ja.clear(),t}),Ja=qa.cache,qa);function To(t){return t==null?"":bi(t)}function ju(t,e){return ce(t)?t:Ka(t,e)?[t]:_b(To(t))}function Vi(t){if(typeof t=="string"||Co(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Ga(t,e){for(var n=0,o=(e=ju(e,t)).length;t!=null&&n<o;)t=t[Vi(e[n++])];return n&&n==o?t:void 0}function Oo(t,e,n){var o=t==null?void 0:Ga(t,e);return o===void 0?n:o}function Hu(t,e){for(var n=-1,o=e.length,i=t.length;++n<o;)t[i+n]=e[n];return t}var Wu=wt?wt.isConcatSpreadable:void 0;function Vb(t){return ce(t)||Bi(t)||!!(Wu&&t&&t[Wu])}var Ab=Pu(Object.getPrototypeOf,Object),Ai=Pa(function(t,e,n){var o=1;if(n.length){var i=vr(n,Ra(Ai));o|=32}return function(s,a,l,c,d,u,p,h){var f=2&a;if(!f&&typeof s!="function")throw new TypeError("Expected a function");var m=c?c.length:0;if(m||(a&=-97,c=d=void 0),p=p===void 0?p:Tu(Un(p),0),h=h===void 0?h:Un(h),m-=d?d.length:0,64&a){var g=c,v=d;c=d=void 0}var b=f?void 0:yu(s),y=[s,a,l,c,d,g,v,void 0,p,h];if(b&&function(x,w){var C=x[1],S=w[1],E=C|S,M=E<131,N=S==128&&C==8||S==128&&C==256&&x[7].length<=w[8]||S==384&&w[7].length<=w[8]&&C==8;if(!M&&!N)return x;1&S&&(x[2]=w[2],E|=1&C?0:4);var T=w[3];if(T){var D=x[3];x[3]=D?mu(D,T,w[4]):T,x[4]=D?vr(x[3],Bu):w[4]}(T=w[5])&&(D=x[5],x[5]=D?gu(D,T,w[6]):T,x[6]=D?vr(x[5],Bu):w[6]),(T=w[7])&&(x[7]=T),128&S&&(x[8]=x[8]==null?w[8]:mb(x[8],w[8])),x[9]==null&&(x[9]=w[9]),x[0]=w[0],x[1]=E}(y,b),s=y[0],a=y[1],l=y[2],c=y[3],d=y[4],!(h=y[9]=y[9]===void 0?f?0:s.length:Tu(y[9]-m,0))&&24&a&&(a&=-25),a&&a!=1)k=a==8||a==16?function(x,w,C){var S=gr(x);return function E(){for(var M=arguments.length,N=Array(M),T=M,D=Ra(E);T--;)N[T]=arguments[T];var $=M<3&&N[0]!==D&&N[M-1]!==D?[]:vr(N,D);return(M-=$.length)<C?Mu(x,w,La,E.placeholder,void 0,N,$,void 0,void 0,C-M):_a(this&&this!==Xe&&this instanceof E?S:x,this,N)}}(s,a,h):a!=32&&a!=33||d.length?La.apply(void 0,y):function(x,w,C,S){var E=1&w,M=gr(x);return function N(){for(var T=-1,D=arguments.length,$=-1,B=S.length,V=Array(B+D),O=this&&this!==Xe&&this instanceof N?M:x;++$<B;)V[$]=S[$];for(;D--;)V[$++]=arguments[++T];return _a(O,E?C:this,V)}}(s,a,l,c);else var k=function(x,w,C){var S=1&w,E=gr(x);return function M(){return(this&&this!==Xe&&this instanceof M?E:x).apply(S?C:this,arguments)}}(s,a,l);return Eu((b?hu:xu)(k,y),s,a)}(t,o,e,n,i)});Ai.placeholder={};var Db=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function Ib(t,e,n,o){var i=-1,s=t==null?0:t.length;for(o&&s&&(n=t[++i]);++i<s;)n=e(n,t[i],i,t);return n}var Rb=Xe.isFinite,Lb=Math.min;function Ku(t){var e=Math[t];return function(n,o){if(n=ki(n),(o=o==null?0:Lb(Un(o),292))&&Rb(n)){var i=(To(n)+"e").split("e");return+((i=(To(e(i[0]+"e"+(+i[1]+o)))+"e").split("e"))[0]+"e"+(+i[1]-o))}return e(n)}}var Uu=Ku("ceil");function qu(t,e,n){return t==t&&(n!==void 0&&(t=t<=n?t:n),t=t>=e?t:e),t}function zt(t){var e=this.__data__=new en(t);this.size=e.size}zt.prototype.clear=function(){this.__data__=new en,this.size=0},zt.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},zt.prototype.get=function(t){return this.__data__.get(t)},zt.prototype.has=function(t){return this.__data__.has(t)},zt.prototype.set=function(t,e){var n=this.__data__;if(n instanceof en){var o=n.__data__;if(!wr||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new tn(o)}return n.set(t,e),this.size=n.size,this};var Ju=typeof _=="object"&&_&&!_.nodeType&&_,Gu=Ju&&typeof module=="object"&&module&&!module.nodeType&&module,Yu=Gu&&Gu.exports===Ju?Xe.Buffer:void 0;function Xu(t,e){for(var n=-1,o=t==null?0:t.length,i=0,s=[];++n<o;){var a=t[n];e(a,n,t)&&(s[i++]=a)}return s}Yu&&Yu.allocUnsafe;var $b=Object.prototype.propertyIsEnumerable,Qu=Object.getOwnPropertySymbols,Pb=Qu?function(t){return t==null?[]:(t=Object(t),Xu(Qu(t),function(e){return $b.call(t,e)}))}:function(){return[]};function Ya(t){return function(e,n,o){var i=n(e);return ce(e)?i:Hu(i,o(e))}(t,vn,Pb)}var Xa=Jn(Xe,"DataView"),Qa=Jn(Xe,"Promise"),_o=Jn(Xe,"Set"),Zu="[object Map]",ep="[object Promise]",tp="[object Set]",np="[object WeakMap]",op="[object DataView]",zb=qn(Xa),Fb=qn(wr),jb=qn(Qa),Hb=qn(_o),Wb=qn(mr),ft=Zt;(Xa&&ft(new Xa(new ArrayBuffer(1)))!=op||wr&&ft(new wr)!=Zu||Qa&&ft(Qa.resolve())!=ep||_o&&ft(new _o)!=tp||mr&&ft(new mr)!=np)&&(ft=function(t){var e=Zt(t),n=e=="[object Object]"?t.constructor:void 0,o=n?qn(n):"";if(o)switch(o){case zb:return op;case Fb:return Zu;case jb:return ep;case Hb:return tp;case Wb:return np}return e});var Kb=Object.prototype.hasOwnProperty,Di=Xe.Uint8Array;function Za(t){var e=new t.constructor(t.byteLength);return new Di(e).set(new Di(t)),e}var Ub=/\w*$/,rp=wt?wt.prototype:void 0,ip=rp?rp.valueOf:void 0,sp=Bo&&Bo.isMap,qb=sp?Ti(sp):function(t){return ht(t)&&ft(t)=="[object Map]"},ap=Bo&&Bo.isSet,Jb=ap?Ti(ap):function(t){return ht(t)&&ft(t)=="[object Set]"},lp="[object Arguments]",cp="[object Function]",dp="[object Object]",we={};function Ii(t,e,n,o,i,s){var a;if(a!==void 0)return a;if(!xt(t))return t;var l=ce(t);if(l)a=function(h){var f=h.length,m=new h.constructor(f);return f&&typeof h[0]=="string"&&Kb.call(h,"index")&&(m.index=h.index,m.input=h.input),m}(t);else{var c=ft(t),d=c==cp||c=="[object GeneratorFunction]";if(yr(t))return t.slice();if(c==dp||c==lp||d&&!i)a=d?{}:function(h){return typeof h.constructor!="function"||Ni(h)?{}:xi(Ab(h))}(t);else{if(!we[c])return i?t:{};a=function(h,f){var m,g,v,b=h.constructor;switch(f){case"[object ArrayBuffer]":return Za(h);case"[object Boolean]":case"[object Date]":return new b(+h);case"[object DataView]":return v=Za((g=h).buffer),new g.constructor(v,g.byteOffset,g.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(y){var k=Za(y.buffer);return new y.constructor(k,y.byteOffset,y.length)}(h);case"[object Map]":case"[object Set]":return new b;case"[object Number]":case"[object String]":return new b(h);case"[object RegExp]":return function(y){var k=new y.constructor(y.source,Ub.exec(y));return k.lastIndex=y.lastIndex,k}(h);case"[object Symbol]":return m=h,ip?Object(ip.call(m)):{}}}(t,c)}}s||(s=new zt);var u=s.get(t);if(u)return u;s.set(t,a),Jb(t)?t.forEach(function(h){a.add(Ii(h,e,n,0,t,s))}):qb(t)&&t.forEach(function(h,f){a.set(f,Ii(h,e,n,0,t,s))});var p=l?void 0:Ya(t);return Aa(p||t,function(h,f){p&&(h=t[f=h]),$a(a,f,Ii(h,e,n,0,t,s))}),a}function Vo(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new tn;++e<n;)this.add(t[e])}function up(t,e){for(var n=-1,o=t==null?0:t.length;++n<o;)if(e(t[n],n,t))return!0;return!1}function el(t,e){return t.has(e)}function pp(t,e,n,o,i,s){var a=1&n,l=t.length,c=e.length;if(l!=c&&!(a&&c>l))return!1;var d=s.get(t),u=s.get(e);if(d&&u)return d==e&&u==t;var p=-1,h=!0,f=2&n?new Vo:void 0;for(s.set(t,e),s.set(e,t);++p<l;){var m=t[p],g=e[p];if(o)var v=a?o(g,m,p,e,t,s):o(m,g,p,t,e,s);if(v!==void 0){if(v)continue;h=!1;break}if(f){if(!up(e,function(b,y){if(!el(f,y)&&(m===b||i(m,b,n,o,s)))return f.push(y)})){h=!1;break}}else if(m!==g&&!i(m,g,n,o,s)){h=!1;break}}return s.delete(t),s.delete(e),h}function Gb(t){var e=-1,n=Array(t.size);return t.forEach(function(o,i){n[++e]=[i,o]}),n}function tl(t){var e=-1,n=Array(t.size);return t.forEach(function(o){n[++e]=o}),n}we[lp]=we["[object Array]"]=we["[object ArrayBuffer]"]=we["[object DataView]"]=we["[object Boolean]"]=we["[object Date]"]=we["[object Float32Array]"]=we["[object Float64Array]"]=we["[object Int8Array]"]=we["[object Int16Array]"]=we["[object Int32Array]"]=we["[object Map]"]=we["[object Number]"]=we[dp]=we["[object RegExp]"]=we["[object Set]"]=we["[object String]"]=we["[object Symbol]"]=we["[object Uint8Array]"]=we["[object Uint8ClampedArray]"]=we["[object Uint16Array]"]=we["[object Uint32Array]"]=!0,we["[object Error]"]=we[cp]=we["[object WeakMap]"]=!1,Vo.prototype.add=Vo.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Vo.prototype.has=function(t){return this.__data__.has(t)};var hp=wt?wt.prototype:void 0,nl=hp?hp.valueOf:void 0,Yb=Object.prototype.hasOwnProperty,fp="[object Arguments]",mp="[object Array]",Ri="[object Object]",gp=Object.prototype.hasOwnProperty;function Li(t,e,n,o,i){return t===e||(t==null||e==null||!ht(t)&&!ht(e)?t!=t&&e!=e:function(s,a,l,c,d,u){var p=ce(s),h=ce(a),f=p?mp:ft(s),m=h?mp:ft(a),g=(f=f==fp?Ri:f)==Ri,v=(m=m==fp?Ri:m)==Ri,b=f==m;if(b&&yr(s)){if(!yr(a))return!1;p=!0,g=!1}if(b&&!g)return u||(u=new zt),p||ja(s)?pp(s,a,l,c,d,u):function(C,S,E,M,N,T,D){switch(E){case"[object DataView]":if(C.byteLength!=S.byteLength||C.byteOffset!=S.byteOffset)return!1;C=C.buffer,S=S.buffer;case"[object ArrayBuffer]":return!(C.byteLength!=S.byteLength||!T(new Di(C),new Di(S)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Mi(+C,+S);case"[object Error]":return C.name==S.name&&C.message==S.message;case"[object RegExp]":case"[object String]":return C==S+"";case"[object Map]":var $=Gb;case"[object Set]":var B=1&M;if($||($=tl),C.size!=S.size&&!B)return!1;var V=D.get(C);if(V)return V==S;M|=2,D.set(C,S);var O=pp($(C),$(S),M,N,T,D);return D.delete(C),O;case"[object Symbol]":if(nl)return nl.call(C)==nl.call(S)}return!1}(s,a,f,l,c,d,u);if(!(1&l)){var y=g&&gp.call(s,"__wrapped__"),k=v&&gp.call(a,"__wrapped__");if(y||k){var x=y?s.value():s,w=k?a.value():a;return u||(u=new zt),d(x,w,l,c,u)}}return!!b&&(u||(u=new zt),function(C,S,E,M,N,T){var D=1&E,$=Ya(C),B=$.length;if(B!=Ya(S).length&&!D)return!1;for(var V=B;V--;){var O=$[V];if(!(D?O in S:Yb.call(S,O)))return!1}var A=T.get(C),F=T.get(S);if(A&&F)return A==S&&F==C;var R=!0;T.set(C,S),T.set(S,C);for(var L=D;++V<B;){var I=C[O=$[V]],P=S[O];if(M)var W=D?M(P,I,O,S,C,T):M(I,P,O,C,S,T);if(!(W===void 0?I===P||N(I,P,E,M,T):W)){R=!1;break}L||(L=O=="constructor")}if(R&&!L){var z=C.constructor,j=S.constructor;z==j||!("constructor"in C)||!("constructor"in S)||typeof z=="function"&&z instanceof z&&typeof j=="function"&&j instanceof j||(R=!1)}return T.delete(C),T.delete(S),R}(s,a,l,c,d,u))}(t,e,n,o,Li,i))}function vp(t){return t==t&&!xt(t)}function yp(t,e){return function(n){return n!=null&&n[t]===e&&(e!==void 0||t in Object(n))}}function Xb(t,e){return t!=null&&e in Object(t)}function bp(t,e,n){for(var o=-1,i=(e=ju(e,t)).length,s=!1;++o<i;){var a=Vi(e[o]);if(!(s=t!=null&&n(t,a)))break;t=t[a]}return s||++o!=i?s:!!(i=t==null?0:t.length)&&za(i)&&Ei(a,i)&&(ce(t)||Bi(t))}function kp(t){return function(e){return e==null?void 0:e[t]}}function yn(t){return typeof t=="function"?t:t==null?Eo:typeof t=="object"?ce(t)?(o=t[0],i=t[1],Ka(o)&&vp(i)?yp(Vi(o),i):function(s){var a=Oo(s,o);return a===void 0&&a===i?function(l,c){return l!=null&&bp(l,c,Xb)}(s,o):Li(i,a,3)}):(n=function(s){for(var a=vn(s),l=a.length;l--;){var c=a[l],d=s[c];a[l]=[c,d,vp(d)]}return a}(e=t),n.length==1&&n[0][2]?yp(n[0][0],n[0][1]):function(s){return s===e||function(a,l,c){var d=c.length,u=d;if(a==null)return!u;for(a=Object(a);d--;){var p=c[d];if(p[2]?p[1]!==a[p[0]]:!(p[0]in a))return!1}for(;++d<u;){var h=(p=c[d])[0],f=a[h],m=p[1];if(p[2]){if(f===void 0&&!(h in a))return!1}else if(!Li(m,f,3,void 0,new zt))return!1}return!0}(s,0,n)}):function(s){return Ka(s)?kp(Vi(s)):function(a){return function(l){return Ga(l,a)}}(s)}(t);var e,n,o,i}var wp,xr=(wp=function(t,e){return t&&function(n,o,i){for(var s=-1,a=Object(n),l=i(n),c=l.length;c--;){var d=l[++s];if(o(a[d],d,a)===!1)break}return n}(t,e,vn)},function(t,e){if(t==null)return t;if(!Pt(t))return wp(t,e);for(var n=t.length,o=-1,i=Object(t);++o<n&&e(i[o],o,i)!==!1;);return t}),ol=function(){return Xe.Date.now()},Qb=Math.max,Zb=Math.min;function $i(t,e,n){var o,i,s,a,l,c,d=0,u=!1,p=!1,h=!0;if(typeof t!="function")throw new TypeError("Expected a function");function f(y){var k=o,x=i;return o=i=void 0,d=y,a=t.apply(x,k)}function m(y){var k=y-c;return c===void 0||k>=e||k<0||p&&y-d>=s}function g(){var y=ol();if(m(y))return v(y);l=setTimeout(g,function(k){var x=e-(k-c);return p?Zb(x,s-(k-d)):x}(y))}function v(y){return l=void 0,h&&o?f(y):(o=i=void 0,a)}function b(){var y=ol(),k=m(y);if(o=arguments,i=this,c=y,k){if(l===void 0)return function(x){return d=x,l=setTimeout(g,e),u?f(x):a}(c);if(p)return clearTimeout(l),l=setTimeout(g,e),f(c)}return l===void 0&&(l=setTimeout(g,e)),a}return e=ki(e)||0,xt(n)&&(u=!!n.leading,s=(p="maxWait"in n)?Qb(ki(n.maxWait)||0,e):s,h="trailing"in n?!!n.trailing:h),b.cancel=function(){l!==void 0&&clearTimeout(l),d=0,o=c=i=l=void 0},b.flush=function(){return l===void 0?a:v(ol())},b}function xp(t){return ht(t)&&Pt(t)}var Cp=Pa(function(t,e){return xp(t)?function(n,o){var i=-1,s=Ia,a=!0,l=n.length,c=[],d=o.length;if(!l)return c;o.length>=200&&(s=el,a=!1,o=new Vo(o));e:for(;++i<l;){var u=n[i],p=u;if(u=u!==0?u:0,a&&p==p){for(var h=d;h--;)if(o[h]===p)continue e;c.push(u)}else s(o,p,void 0)||c.push(u)}return c}(t,function(n,o,i,s,a){var l=-1,c=n.length;for(i||(i=Vb),a||(a=[]);++l<c;){var d=n[l];i(d)&&Hu(a,d)}return a}(e,0,xp)):[]});function Pi(t,e){var n;return(ce(t)?Aa:xr)(t,typeof(n=e)=="function"?n:Eo)}function ek(t,e){var n=[];return xr(t,function(o,i,s){e(o,i,s)&&n.push(o)}),n}function Cr(t,e){return(ce(t)?Xu:ek)(t,yn(e))}var tk=Math.max;function Ao(t,e,n){var o=t==null?0:t.length;if(!o)return-1;var i=n==null?0:Un(n);return i<0&&(i=tk(o+i,0)),Su(t,yn(e),i)}var Sp,zi=(Sp=Ao,function(t,e,n){var o=Object(t);if(!Pt(t)){var i=yn(e);t=vn(t),e=function(a){return i(o[a],a,o)}}var s=Sp(t,e,n);return s>-1?o[i?t[s]:s]:void 0});function Ep(t){return t&&t.length?t[0]:void 0}function Mp(t,e){var n=-1,o=Pt(t)?Array(t.length):[];return xr(t,function(i,s,a){o[++n]=e(i,s,a)}),o}function bn(t,e){return(ce(t)?So:Mp)(t,yn(e))}var Fi=Ku("floor"),nk=Object.prototype.hasOwnProperty;function ok(t,e){return t!=null&&nk.call(t,e)}function rk(t,e){return t!=null&&bp(t,e,ok)}function Do(t){return typeof t=="string"||!ce(t)&&ht(t)&&Zt(t)=="[object String]"}var ik=Math.max;function Ct(t,e,n,o){var i;t=Pt(t)?t:(i=t)==null?[]:function(a,l){return So(l,function(c){return a[c]})}(i,vn(i)),n=n?Un(n):0;var s=t.length;return n<0&&(n=ik(s+n,0)),Do(t)?n<=s&&t.indexOf(e,n)>-1:!!s&&Da(t,e,n)>-1}function Np(t){return t===!0||t===!1||ht(t)&&Zt(t)=="[object Boolean]"}var sk=Object.prototype.hasOwnProperty;function Be(t){if(t==null)return!0;if(Pt(t)&&(ce(t)||typeof t=="string"||typeof t.splice=="function"||yr(t)||ja(t)||Bi(t)))return!t.length;var e=ft(t);if(e=="[object Map]"||e=="[object Set]")return!t.size;if(Ni(t))return!Ha(t).length;for(var n in t)if(sk.call(t,n))return!1;return!0}function Sr(t){return typeof t=="number"||ht(t)&&Zt(t)=="[object Number]"}function ye(t){return t==null}function ak(t,e){if(t!==e){var n=t!==void 0,o=t===null,i=t==t,s=Co(t),a=e!==void 0,l=e===null,c=e==e,d=Co(e);if(!l&&!d&&!s&&t>e||s&&a&&c&&!l&&!d||o&&a&&c||!n&&c||!i)return 1;if(!o&&!s&&!d&&t<e||d&&n&&i&&!o&&!s||l&&n&&i||!a&&i||!c)return-1}return 0}var lk=kp("length"),Bp="\\ud800-\\udfff",ck="["+Bp+"]",rl="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",il="\\ud83c[\\udffb-\\udfff]",Tp="[^"+Bp+"]",Op="(?:\\ud83c[\\udde6-\\uddff]){2}",_p="[\\ud800-\\udbff][\\udc00-\\udfff]",Vp="(?:"+rl+"|"+il+")?",Ap="[\\ufe0e\\ufe0f]?",dk=Ap+Vp+"(?:\\u200d(?:"+[Tp,Op,_p].join("|")+")"+Ap+Vp+")*",uk="(?:"+[Tp+rl+"?",rl,Op,_p,ck].join("|")+")",Dp=RegExp(il+"(?="+il+")|"+uk+dk,"g");function pk(t,e,n,o,i){return i(t,function(s,a,l){n=o?(o=!1,s):e(n,s,a,l)}),n}function sl(t){if(t==null)return 0;if(Pt(t))return Do(t)?function(o){return Db.test(o)}(e=t)?function(o){for(var i=Dp.lastIndex=0;Dp.test(o);)++i;return i}(e):lk(e):t.length;var e,n=ft(t);return n=="[object Map]"||n=="[object Set]"?t.size:Ha(t).length}function hk(t,e){var n;return xr(t,function(o,i,s){return!(n=e(o,i,s))}),!!n}function al(t,e,n){return(ce(t)?up:hk)(t,yn(e))}function Io(t,e,n){var o=!0,i=!0;if(typeof t!="function")throw new TypeError("Expected a function");return xt(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),$i(t,e,{leading:o,maxWait:e,trailing:i})}function ll(t){return To(t).toLowerCase()}var fk=_o&&1/tl(new _o([,-0]))[1]==1/0?function(t){return new _o(t)}:vu;const ee=t=>(t.install=e=>{e.component(t.name,t)},t),cl=(t=0)=>new Promise(e=>setTimeout(e,t)),dl=t=>`${t}px`,Ft=(t,e)=>{if(xt(t))return e in t?t[e]:t[e.replace(/-([a-z])/g,(n,o)=>o.toUpperCase())]},Ip="mc-icon",mk=r.defineComponent({name:Ip,__name:"mc-icon",props:{name:{},size:{default:24},color:{}},emits:["click"],setup(t,{expose:e,emit:n}){const o=n,i=r.ref();return e({ref:i}),(s,a)=>(r.openBlock(),r.createElementBlock("span",{class:"mc-icon",style:r.normalizeStyle({fontSize:`${t.size}px`,width:`${t.size}px`,height:`${t.size}px`,color:t.color})},[r.createElementVNode("i",{ref_key:"_ref",ref:i,class:r.normalizeClass(["mc-iconfont",`mc-icon--${t.name}`]),onClick:a[0]||(a[0]=l=>(c=>{o("click",c)})(l))},null,2)],4))}}),q=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},Yn=q(mk,[["__scopeId","data-v-248771e8"]]),ge=ee(Yn),Rp="mc-alert-message",gk={class:"mc-alert-message-header"},vk={class:"mc-alert-message-title-container"},yk={key:0,class:"mc-alert-message-icon-group"},bk={class:"mc-alert-message-icon-wrapper"},kk={class:"mc-alert-message-icon-wrapper"},wk={key:0,class:"mc-alert-message-body"},xk=r.defineComponent({name:Rp,__name:"mc-alert-message",props:{modelValue:{type:Boolean,default:!0},width:{},height:{},type:{default:"info"},message:{},content:{},closable:{type:Boolean,default:!1},hideIcon:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1}},emits:["click","close","update:modelValue","expand"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref(),a=r.useSlots(),l=r.computed(()=>o.content||a.content),c=r.computed(()=>p.value||a.icon),d=r.ref(!1),u=r.computed(()=>!o.expandable||d.value),p=r.computed(()=>{if(!o.hideIcon)switch(o.type){case"success":return"Accept_02";case"error":return"Error_04";case"warning":return"Error_02";case"info":return"Info_02";default:return}}),h=()=>{i("update:modelValue",!1),i("close")},f=()=>{i("click"),o.expandable&&(d.value=!d.value,i("expand",d.value))};return e({ref:s,close:h,show:()=>{d.value=!0},hide:()=>{d.value=!1}}),(m,g)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"_ref",ref:s,class:r.normalizeClass(["mc-alert-message",[`mc-alert-message-${t.type}`]]),style:r.normalizeStyle({width:t.width,height:t.height,cursor:t.expandable?"pointer":"default"}),onClick:f},[r.createElementVNode("div",gk,[r.createElementVNode("div",vk,[c.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-alert-message-icon",style:r.normalizeStyle({height:l.value?"30px":"24px"})},[r.renderSlot(m.$slots,"icon",{},()=>[r.createVNode(r.unref(ge),{name:p.value,size:24},null,8,["name"])],!0)],4)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"mc-alert-message-title",style:r.normalizeStyle({fontSize:l.value?"18px":"16px",fontWeight:l.value?"600":"400",lineHeight:l.value?"30px":"24px"})},[r.renderSlot(m.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.message),1)],!0)],4)]),t.closable||t.expandable?(r.openBlock(),r.createElementBlock("div",yk,[r.createElementVNode("div",bk,[t.expandable?(r.openBlock(),r.createBlock(r.unref(ge),{key:0,name:"Down-Chevron",size:24,class:"mc-alert-message-tool-icon mc-alert-message-tool-icon-expand",style:r.normalizeStyle({transform:u.value?"rotate(180deg)":"rotate(0deg)"})},null,8,["style"])):r.createCommentVNode("",!0)]),r.createElementVNode("div",kk,[t.closable?(r.openBlock(),r.createBlock(r.unref(ge),{key:0,name:"Cross",size:24,class:"mc-alert-message-tool-icon mc-alert-message-tool-icon-close",onClick:r.withModifiers(h,["stop"])})):r.createCommentVNode("",!0)])])):r.createCommentVNode("",!0)]),l.value?(r.openBlock(),r.createElementBlock("div",wk,[r.createVNode(r.Transition,{name:"mc-alert-message-content-transition"},{default:r.withCtx(()=>[u.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-alert-message-content",style:r.normalizeStyle({paddingLeft:c.value?"48px":"16px"})},[r.renderSlot(m.$slots,"content",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0)],4)):r.createCommentVNode("",!0)]),_:3})])):r.createCommentVNode("",!0)],6))}}),Lp=ee(q(xk,[["__scopeId","data-v-638e4b6b"]])),ji=(t,e,n)=>{r.isRef(t)?r.watch(t,(o,i)=>{i==null||i.removeEventListener(e,n),o==null||o.addEventListener(e,n)}):r.onMounted(()=>t==null?void 0:t.addEventListener(e,n)),r.onBeforeUnmount(()=>{var o;return(o=r.unref(t))==null?void 0:o.removeEventListener(e,n)})},Hi=(t,e,n="click")=>{ji(document,n,o=>{if(t.value&&o.target)if(ce(t.value)){let i=!0;for(let s=0;s<t.value.length;s++)if(t.value[s].contains(o.target)){i=!1;break}i&&e(o)}else t.value.contains(o.target)||e(o)})},Xn=(t,{afterFocus:e,beforeBlur:n,afterBlur:o}={})=>{const i=r.getCurrentInstance(),{emit:s}=i,a=r.ref(),l=r.ref(!1);return ji(a,"click",()=>{var c;(c=t.value)==null||c.focus()}),{wrapperRef:a,isFocused:l,handleFocus:c=>{l.value||(l.value=!0,s("focus",c),e==null||e())},handleBlur:c=>{var d;He(n)&&n(c)||c.relatedTarget&&((d=a.value)!=null&&d.contains(c.relatedTarget))||(l.value=!1,s("blur",c),o==null||o())}}};function ue(t){const e=r.getCurrentInstance();if(!e)throw new Error("useProp must be used within a component");return r.computed(()=>{var o;const n=(o=e==null?void 0:e.proxy)==null?void 0:o.$props;if(!ce(t))return n==null?void 0:n[t];for(const i of t)if(rk(n,i))return n==null?void 0:n[i]})}const $p=(t,e,n=300)=>{const o=new ResizeObserver(Io(a=>{for(let l of a)e(l.contentRect)},n)),i=a=>{o.observe(a)},s=a=>{o.unobserve(a)};return r.onMounted(()=>{t.value&&i(t.value)}),r.onBeforeUnmount(()=>{t.value&&s(t.value)}),r.watch(t,a=>{a&&i(a)}),{resizeObserver:o,observe:i,unobserve:s}},lt=()=>{const t=ue("width"),e=ue("height");return{width:r.computed(()=>typeof t.value=="number"?`${t.value}px`:t.value||void 0),height:r.computed(()=>typeof e.value=="number"?`${e.value}px`:e.value||void 0)}},ul=t=>{const e=r.ref(!1),n=()=>{e.value=!0},o=()=>{e.value=!1};return r.onMounted(()=>{t.value&&(t.value.addEventListener("mouseenter",n),t.value.addEventListener("mouseleave",o))}),r.onBeforeMount(()=>{t.value&&(t.value.removeEventListener("mouseenter",n),t.value.removeEventListener("mouseleave",o))}),{isHovering:e}},Pp="mc-button",Ck=["type","disabled"],Sk={key:1,class:"loading-icon"},Ek={class:"mc-button-text"},Mk=r.defineComponent({name:Pp,__name:"mc-button",props:{type:{default:"primary"},nativeType:{default:"button"},size:{default:"medium"},disabled:{type:Boolean},loading:{type:Boolean},useThrottle:{type:Boolean,default:!0},throttleDuration:{default:500},leftIcon:{},rightIcon:{},content:{},height:{},width:{}},emits:["click"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref(),{width:a,height:l}=lt(),c=u=>{o.loading||o.disabled||i("click",u)},d=Io(c,o.throttleDuration,{trailing:!1});return e({ref:s}),(u,p)=>(r.openBlock(),r.createElementBlock("button",{ref_key:"_ref",ref:s,style:r.normalizeStyle({width:r.unref(a),height:r.unref(l)}),class:r.normalizeClass(["mc-button",{[`mc-button--${t.type}`]:t.type,[`mc-button--${t.size}`]:t.size,"is-loading":t.loading,"is-disabled":t.disabled}]),type:t.nativeType,disabled:!(!t.disabled&&!t.loading)||void 0,onClick:p[0]||(p[0]=h=>t.useThrottle?r.unref(d)(h):c(h))},[t.leftIcon&&!t.loading?(r.openBlock(),r.createBlock(r.unref(ge),{key:0,name:t.leftIcon},null,8,["name"])):r.createCommentVNode("",!0),t.loading&&!t.disabled?(r.openBlock(),r.createElementBlock("span",Sk,[r.createVNode(r.unref(ge),{name:"Loading",size:16})])):r.createCommentVNode("",!0),r.createElementVNode("div",Ek,[r.renderSlot(u.$slots,"default",{},void 0,!0)]),t.rightIcon?(r.openBlock(),r.createBlock(r.unref(ge),{key:2,name:t.rightIcon},null,8,["name"])):r.createCommentVNode("",!0)],14,Ck))}}),Wi=ee(q(Mk,[["__scopeId","data-v-0ef41dbd"]])),Ro=Symbol("mc-form-context"),zp="mc-form";function Qn(){return Qn=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Qn.apply(this,arguments)}function pl(t){return pl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pl(t)}function Er(t,e){return Er=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Er(t,e)}function hl(t,e,n){return hl=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}()?Reflect.construct.bind():function(o,i,s){var a=[null];a.push.apply(a,i);var l=new(Function.bind.apply(o,a));return s&&Er(l,s.prototype),l},hl.apply(null,arguments)}function fl(t){var e=typeof Map=="function"?new Map:void 0;return fl=function(n){if(n===null||(o=n,Function.toString.call(o).indexOf("[native code]")===-1))return n;var o;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return hl(n,arguments,pl(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Er(i,n)},fl(t)}var Nk=/%[sdj%]/g,Fp=function(){};function ml(t){if(!t||!t.length)return null;var e={};return t.forEach(function(n){var o=n.field;e[o]=e[o]||[],e[o].push(n)}),e}function mt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];var i=0,s=n.length;return typeof t=="function"?t.apply(null,n):typeof t=="string"?t.replace(Nk,function(a){if(a==="%%")return"%";if(i>=s)return a;switch(a){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch{return"[Circular]"}break;default:return a}}):t}function je(t,e){return t==null||!(e!=="array"||!Array.isArray(t)||t.length)||!(!function(n){return n==="string"||n==="url"||n==="hex"||n==="email"||n==="date"||n==="pattern"}(e)||typeof t!="string"||t)}function jp(t,e,n){var o=0,i=t.length;(function s(a){if(a&&a.length)n(a);else{var l=o;o+=1,l<i?e(t[l],s):n([])}})([])}typeof process<"u"&&process.env&&process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof document<"u"&&(Fp=function(t,e){typeof console<"u"&&console.warn&&typeof ASYNC_VALIDATOR_NO_WARNING>"u"&&e.every(function(n){return typeof n=="string"})&&console.warn(t,e)});var Hp=function(t){var e,n;function o(i,s){var a;return(a=t.call(this,"Async Validation Error")||this).errors=i,a.fields=s,a}return n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,Er(e,n),o}(fl(Error));function Wp(t,e){return function(n){var o,i;return o=t.fullFields?function(s,a){for(var l=s,c=0;c<a.length;c++){if(l==null)return l;l=l[a[c]]}return l}(e,t.fullFields):e[n.field||t.fullField],(i=n)&&i.message!==void 0?(n.field=n.field||t.fullField,n.fieldValue=o,n):{message:typeof n=="function"?n():n,fieldValue:o,field:n.field||t.fullField}}}function Kp(t,e){if(e){for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];typeof o=="object"&&typeof t[n]=="object"?t[n]=Qn({},t[n],o):t[n]=o}}return t}var gl,Up=function(t,e,n,o,i,s){!t.required||n.hasOwnProperty(t.field)&&!je(e,s||t.type)||o.push(mt(i.messages.required,t.fullField))},Bk=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,Tk=/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i,Mr={integer:function(t){return Mr.number(t)&&parseInt(t,10)===t},float:function(t){return Mr.number(t)&&!Mr.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return!isNaN(t)&&typeof t=="number"},object:function(t){return typeof t=="object"&&!Mr.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(Bk)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(function(){if(gl)return gl;var e="[a-fA-F\\d:]",n=function(h){return h&&h.includeBoundaries?"(?:(?<=\\s|^)(?="+e+")|(?<="+e+")(?=\\s|$))":""},o="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",i="[a-fA-F\\d]{1,4}",s=(`
3
+ `)}(o,function(i,s){return Da(pb,function(a){var l="_."+a[0];s&a[1]&&!Ia(i,l)&&i.push(l)}),i.sort()}(function(i){var s=i.match(ab);return s?s[1].split(lb):[]}(o),n)))}function Mu(t,e,n,o,i,s,a,l,c,d){var u=8&e;e|=u?32:64,4&(e&=~(u?64:32))||(e&=-4);var p=[t,e,i,u?s:void 0,u?a:void 0,u?void 0:s,u?void 0:a,l,c,d],h=n.apply(void 0,p);return function(f){var m=function(b){for(var y=b.name+"",k=bu[y],x=rb.call(bu,y)?k.length:0;x--;){var w=k[x],C=w.func;if(C==null||C==b)return w.name}return y}(f),g=Ci[m];if(typeof g!="function"||!(m in Mo.prototype))return!1;if(f===g)return!0;var v=yu(g);return!!v&&f===v[0]}(t)&&xu(h,p),h.placeholder=o,Eu(h,t,e)}function Ra(t){return t.placeholder}var hb=/^(?:0|[1-9]\d*)$/;function Ei(t,e){var n=typeof t;return!!(e=e??9007199254740991)&&(n=="number"||n!="symbol"&&hb.test(t))&&t>-1&&t%1==0&&t<e}var fb=Math.min,Nu="__lodash_placeholder__";function vr(t,e){for(var n=-1,o=t.length,i=0,s=[];++n<o;){var a=t[n];a!==e&&a!==Nu||(t[n]=Nu,s[i++]=n)}return s}function La(t,e,n,o,i,s,a,l,c,d){var u=128&e,p=1&e,h=2&e,f=24&e,m=512&e,g=h?void 0:gr(t);return function v(){for(var b=arguments.length,y=Array(b),k=b;k--;)y[k]=arguments[k];if(f)var x=Ra(v),w=function(M,N){for(var T=M.length,A=0;T--;)M[T]===N&&++A;return A}(y,x);if(o&&(y=mu(y,o,i,f)),s&&(y=gu(y,s,a,f)),b-=w,f&&b<d){var C=vr(y,x);return Mu(t,e,La,v.placeholder,n,y,C,l,c,d-b)}var S=p?n:this,E=h?S[t]:t;return b=y.length,l?y=function(M,N){for(var T=M.length,A=fb(N.length,T),$=ku(M);A--;){var B=N[A];M[A]=Ei(B,T)?$[B]:void 0}return M}(y,l):m&&b>1&&y.reverse(),u&&c<b&&(y.length=c),this&&this!==Xe&&this instanceof v&&(E=g||gr(E)),E.apply(S,y)}}var Bu="__lodash_placeholder__",mb=Math.min,Tu=Math.max;function Ou(t,e,n){e=="__proto__"&&Si?Si(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Mi(t,e){return t===e||t!=t&&e!=e}var gb=Object.prototype.hasOwnProperty;function $a(t,e,n){var o=t[e];gb.call(t,e)&&Mi(o,n)&&(n!==void 0||e in t)||Ou(t,e,n)}var _u=Math.max;function Pa(t,e){return Cu(function(n,o,i){return o=_u(o===void 0?n.length-1:o,0),function(){for(var s=arguments,a=-1,l=_u(s.length-o,0),c=Array(l);++a<l;)c[a]=s[o+a];a=-1;for(var d=Array(o+1);++a<o;)d[a]=s[a];return d[o]=i(c),_a(n,this,d)}}(t,e,Eo),t+"")}function za(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=9007199254740991}function Pt(t){return t!=null&&za(t.length)&&!He(t)}var vb=Object.prototype;function Ni(t){var e=t&&t.constructor;return t===(typeof e=="function"&&e.prototype||vb)}function Vu(t){return ht(t)&&Zt(t)=="[object Arguments]"}var Du=Object.prototype,yb=Du.hasOwnProperty,bb=Du.propertyIsEnumerable,Bi=Vu(function(){return arguments}())?Vu:function(t){return ht(t)&&yb.call(t,"callee")&&!bb.call(t,"callee")},Au=typeof _=="object"&&_&&!_.nodeType&&_,Iu=Au&&typeof module=="object"&&module&&!module.nodeType&&module,Ru=Iu&&Iu.exports===Au?Xe.Buffer:void 0,yr=(Ru?Ru.isBuffer:void 0)||function(){return!1},Se={};function Ti(t){return function(e){return t(e)}}Se["[object Float32Array]"]=Se["[object Float64Array]"]=Se["[object Int8Array]"]=Se["[object Int16Array]"]=Se["[object Int32Array]"]=Se["[object Uint8Array]"]=Se["[object Uint8ClampedArray]"]=Se["[object Uint16Array]"]=Se["[object Uint32Array]"]=!0,Se["[object Arguments]"]=Se["[object Array]"]=Se["[object ArrayBuffer]"]=Se["[object Boolean]"]=Se["[object DataView]"]=Se["[object Date]"]=Se["[object Error]"]=Se["[object Function]"]=Se["[object Map]"]=Se["[object Number]"]=Se["[object Object]"]=Se["[object RegExp]"]=Se["[object Set]"]=Se["[object String]"]=Se["[object WeakMap]"]=!1;var Lu=typeof _=="object"&&_&&!_.nodeType&&_,br=Lu&&typeof module=="object"&&module&&!module.nodeType&&module,Fa=br&&br.exports===Lu&&Kn.process,Bo=function(){try{return br&&br.require&&br.require("util").types||Fa&&Fa.binding&&Fa.binding("util")}catch{}}(),$u=Bo&&Bo.isTypedArray,ja=$u?Ti($u):function(t){return ht(t)&&za(t.length)&&!!Se[Zt(t)]},kb=Object.prototype.hasOwnProperty;function Pu(t,e){return function(n){return t(e(n))}}var wb=Pu(Object.keys,Object),xb=Object.prototype.hasOwnProperty;function Ha(t){if(!Ni(t))return wb(t);var e=[];for(var n in Object(t))xb.call(t,n)&&n!="constructor"&&e.push(n);return e}function vn(t){return Pt(t)?function(e){var n=ce(e),o=!n&&Bi(e),i=!n&&!o&&yr(e),s=!n&&!o&&!i&&ja(e),a=n||o||i||s,l=a?function(u,p){for(var h=-1,f=Array(u);++h<u;)f[h]=p(h);return f}(e.length,String):[],c=l.length;for(var d in e)!kb.call(e,d)||a&&(d=="length"||i&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Ei(d,c))||l.push(d);return l}(t):Ha(t)}var Wa,Cb=Object.prototype.hasOwnProperty,zu=(Wa=function(t,e){if(Ni(e)||Pt(e))(function(o,i,s){var a=!s;s||(s={});for(var l=-1,c=i.length;++l<c;){var d=i[l],u=void 0;u===void 0&&(u=o[d]),a?Ou(s,d,u):$a(s,d,u)}})(e,vn(e),t);else for(var n in e)Cb.call(e,n)&&$a(t,n,e[n])},Pa(function(t,e){var n=-1,o=e.length,i=o>1?e[o-1]:void 0,s=o>2?e[2]:void 0;for(i=Wa.length>3&&typeof i=="function"?(o--,i):void 0,s&&function(l,c,d){if(!xt(d))return!1;var u=typeof c;return!!(u=="number"?Pt(d)&&Ei(c,d.length):u=="string"&&c in d)&&Mi(d[c],l)}(e[0],e[1],s)&&(i=o<3?void 0:i,o=1),t=Object(t);++n<o;){var a=e[n];a&&Wa(t,a)}return t})),Sb=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Eb=/^\w*$/;function Ka(t,e){if(ce(t))return!1;var n=typeof t;return!(n!="number"&&n!="symbol"&&n!="boolean"&&t!=null&&!Co(t))||Eb.test(t)||!Sb.test(t)||e!=null&&t in Object(e)}var kr=Jn(Object,"create"),Mb=Object.prototype.hasOwnProperty,Nb=Object.prototype.hasOwnProperty;function Gn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}function Oi(t,e){for(var n=t.length;n--;)if(Mi(t[n][0],e))return n;return-1}Gn.prototype.clear=function(){this.__data__=kr?kr(null):{},this.size=0},Gn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Gn.prototype.get=function(t){var e=this.__data__;if(kr){var n=e[t];return n==="__lodash_hash_undefined__"?void 0:n}return Mb.call(e,t)?e[t]:void 0},Gn.prototype.has=function(t){var e=this.__data__;return kr?e[t]!==void 0:Nb.call(e,t)},Gn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=kr&&e===void 0?"__lodash_hash_undefined__":e,this};var Bb=Array.prototype.splice;function en(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}en.prototype.clear=function(){this.__data__=[],this.size=0},en.prototype.delete=function(t){var e=this.__data__,n=Oi(e,t);return!(n<0||(n==e.length-1?e.pop():Bb.call(e,n,1),--this.size,0))},en.prototype.get=function(t){var e=this.__data__,n=Oi(e,t);return n<0?void 0:e[n][1]},en.prototype.has=function(t){return Oi(this.__data__,t)>-1},en.prototype.set=function(t,e){var n=this.__data__,o=Oi(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this};var wr=Jn(Xe,"Map");function _i(t,e){var n=t.__data__;return function(o){var i=typeof o;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?o!=="__proto__":o===null}(e)?n[typeof e=="string"?"string":"hash"]:n.map}function tn(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}function Ua(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");var n=function(){var o=arguments,i=e?e.apply(this,o):o[0],s=n.cache;if(s.has(i))return s.get(i);var a=t.apply(this,o);return n.cache=s.set(i,a)||s,a};return n.cache=new(Ua.Cache||tn),n}tn.prototype.clear=function(){this.size=0,this.__data__={hash:new Gn,map:new(wr||en),string:new Gn}},tn.prototype.delete=function(t){var e=_i(this,t).delete(t);return this.size-=e?1:0,e},tn.prototype.get=function(t){return _i(this,t).get(t)},tn.prototype.has=function(t){return _i(this,t).has(t)},tn.prototype.set=function(t,e){var n=_i(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this},Ua.Cache=tn;var Fu,qa,Ja,Tb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ob=/\\(\\)?/g,_b=(Fu=function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Tb,function(n,o,i,s){e.push(i?s.replace(Ob,"$1"):o||n)}),e},qa=Ua(Fu,function(t){return Ja.size===500&&Ja.clear(),t}),Ja=qa.cache,qa);function To(t){return t==null?"":bi(t)}function ju(t,e){return ce(t)?t:Ka(t,e)?[t]:_b(To(t))}function Vi(t){if(typeof t=="string"||Co(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Ga(t,e){for(var n=0,o=(e=ju(e,t)).length;t!=null&&n<o;)t=t[Vi(e[n++])];return n&&n==o?t:void 0}function Oo(t,e,n){var o=t==null?void 0:Ga(t,e);return o===void 0?n:o}function Hu(t,e){for(var n=-1,o=e.length,i=t.length;++n<o;)t[i+n]=e[n];return t}var Wu=wt?wt.isConcatSpreadable:void 0;function Vb(t){return ce(t)||Bi(t)||!!(Wu&&t&&t[Wu])}var Db=Pu(Object.getPrototypeOf,Object),Di=Pa(function(t,e,n){var o=1;if(n.length){var i=vr(n,Ra(Di));o|=32}return function(s,a,l,c,d,u,p,h){var f=2&a;if(!f&&typeof s!="function")throw new TypeError("Expected a function");var m=c?c.length:0;if(m||(a&=-97,c=d=void 0),p=p===void 0?p:Tu(Un(p),0),h=h===void 0?h:Un(h),m-=d?d.length:0,64&a){var g=c,v=d;c=d=void 0}var b=f?void 0:yu(s),y=[s,a,l,c,d,g,v,void 0,p,h];if(b&&function(x,w){var C=x[1],S=w[1],E=C|S,M=E<131,N=S==128&&C==8||S==128&&C==256&&x[7].length<=w[8]||S==384&&w[7].length<=w[8]&&C==8;if(!M&&!N)return x;1&S&&(x[2]=w[2],E|=1&C?0:4);var T=w[3];if(T){var A=x[3];x[3]=A?mu(A,T,w[4]):T,x[4]=A?vr(x[3],Bu):w[4]}(T=w[5])&&(A=x[5],x[5]=A?gu(A,T,w[6]):T,x[6]=A?vr(x[5],Bu):w[6]),(T=w[7])&&(x[7]=T),128&S&&(x[8]=x[8]==null?w[8]:mb(x[8],w[8])),x[9]==null&&(x[9]=w[9]),x[0]=w[0],x[1]=E}(y,b),s=y[0],a=y[1],l=y[2],c=y[3],d=y[4],!(h=y[9]=y[9]===void 0?f?0:s.length:Tu(y[9]-m,0))&&24&a&&(a&=-25),a&&a!=1)k=a==8||a==16?function(x,w,C){var S=gr(x);return function E(){for(var M=arguments.length,N=Array(M),T=M,A=Ra(E);T--;)N[T]=arguments[T];var $=M<3&&N[0]!==A&&N[M-1]!==A?[]:vr(N,A);return(M-=$.length)<C?Mu(x,w,La,E.placeholder,void 0,N,$,void 0,void 0,C-M):_a(this&&this!==Xe&&this instanceof E?S:x,this,N)}}(s,a,h):a!=32&&a!=33||d.length?La.apply(void 0,y):function(x,w,C,S){var E=1&w,M=gr(x);return function N(){for(var T=-1,A=arguments.length,$=-1,B=S.length,V=Array(B+A),O=this&&this!==Xe&&this instanceof N?M:x;++$<B;)V[$]=S[$];for(;A--;)V[$++]=arguments[++T];return _a(O,E?C:this,V)}}(s,a,l,c);else var k=function(x,w,C){var S=1&w,E=gr(x);return function M(){return(this&&this!==Xe&&this instanceof M?E:x).apply(S?C:this,arguments)}}(s,a,l);return Eu((b?hu:xu)(k,y),s,a)}(t,o,e,n,i)});Di.placeholder={};var Ab=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function Ib(t,e,n,o){var i=-1,s=t==null?0:t.length;for(o&&s&&(n=t[++i]);++i<s;)n=e(n,t[i],i,t);return n}var Rb=Xe.isFinite,Lb=Math.min;function Ku(t){var e=Math[t];return function(n,o){if(n=ki(n),(o=o==null?0:Lb(Un(o),292))&&Rb(n)){var i=(To(n)+"e").split("e");return+((i=(To(e(i[0]+"e"+(+i[1]+o)))+"e").split("e"))[0]+"e"+(+i[1]-o))}return e(n)}}var Uu=Ku("ceil");function qu(t,e,n){return t==t&&(n!==void 0&&(t=t<=n?t:n),t=t>=e?t:e),t}function zt(t){var e=this.__data__=new en(t);this.size=e.size}zt.prototype.clear=function(){this.__data__=new en,this.size=0},zt.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},zt.prototype.get=function(t){return this.__data__.get(t)},zt.prototype.has=function(t){return this.__data__.has(t)},zt.prototype.set=function(t,e){var n=this.__data__;if(n instanceof en){var o=n.__data__;if(!wr||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new tn(o)}return n.set(t,e),this.size=n.size,this};var Ju=typeof _=="object"&&_&&!_.nodeType&&_,Gu=Ju&&typeof module=="object"&&module&&!module.nodeType&&module,Yu=Gu&&Gu.exports===Ju?Xe.Buffer:void 0;function Xu(t,e){for(var n=-1,o=t==null?0:t.length,i=0,s=[];++n<o;){var a=t[n];e(a,n,t)&&(s[i++]=a)}return s}Yu&&Yu.allocUnsafe;var $b=Object.prototype.propertyIsEnumerable,Qu=Object.getOwnPropertySymbols,Pb=Qu?function(t){return t==null?[]:(t=Object(t),Xu(Qu(t),function(e){return $b.call(t,e)}))}:function(){return[]};function Ya(t){return function(e,n,o){var i=n(e);return ce(e)?i:Hu(i,o(e))}(t,vn,Pb)}var Xa=Jn(Xe,"DataView"),Qa=Jn(Xe,"Promise"),_o=Jn(Xe,"Set"),Zu="[object Map]",ep="[object Promise]",tp="[object Set]",np="[object WeakMap]",op="[object DataView]",zb=qn(Xa),Fb=qn(wr),jb=qn(Qa),Hb=qn(_o),Wb=qn(mr),ft=Zt;(Xa&&ft(new Xa(new ArrayBuffer(1)))!=op||wr&&ft(new wr)!=Zu||Qa&&ft(Qa.resolve())!=ep||_o&&ft(new _o)!=tp||mr&&ft(new mr)!=np)&&(ft=function(t){var e=Zt(t),n=e=="[object Object]"?t.constructor:void 0,o=n?qn(n):"";if(o)switch(o){case zb:return op;case Fb:return Zu;case jb:return ep;case Hb:return tp;case Wb:return np}return e});var Kb=Object.prototype.hasOwnProperty,Ai=Xe.Uint8Array;function Za(t){var e=new t.constructor(t.byteLength);return new Ai(e).set(new Ai(t)),e}var Ub=/\w*$/,rp=wt?wt.prototype:void 0,ip=rp?rp.valueOf:void 0,sp=Bo&&Bo.isMap,qb=sp?Ti(sp):function(t){return ht(t)&&ft(t)=="[object Map]"},ap=Bo&&Bo.isSet,Jb=ap?Ti(ap):function(t){return ht(t)&&ft(t)=="[object Set]"},lp="[object Arguments]",cp="[object Function]",dp="[object Object]",we={};function Ii(t,e,n,o,i,s){var a;if(a!==void 0)return a;if(!xt(t))return t;var l=ce(t);if(l)a=function(h){var f=h.length,m=new h.constructor(f);return f&&typeof h[0]=="string"&&Kb.call(h,"index")&&(m.index=h.index,m.input=h.input),m}(t);else{var c=ft(t),d=c==cp||c=="[object GeneratorFunction]";if(yr(t))return t.slice();if(c==dp||c==lp||d&&!i)a=d?{}:function(h){return typeof h.constructor!="function"||Ni(h)?{}:xi(Db(h))}(t);else{if(!we[c])return i?t:{};a=function(h,f){var m,g,v,b=h.constructor;switch(f){case"[object ArrayBuffer]":return Za(h);case"[object Boolean]":case"[object Date]":return new b(+h);case"[object DataView]":return v=Za((g=h).buffer),new g.constructor(v,g.byteOffset,g.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(y){var k=Za(y.buffer);return new y.constructor(k,y.byteOffset,y.length)}(h);case"[object Map]":case"[object Set]":return new b;case"[object Number]":case"[object String]":return new b(h);case"[object RegExp]":return function(y){var k=new y.constructor(y.source,Ub.exec(y));return k.lastIndex=y.lastIndex,k}(h);case"[object Symbol]":return m=h,ip?Object(ip.call(m)):{}}}(t,c)}}s||(s=new zt);var u=s.get(t);if(u)return u;s.set(t,a),Jb(t)?t.forEach(function(h){a.add(Ii(h,e,n,0,t,s))}):qb(t)&&t.forEach(function(h,f){a.set(f,Ii(h,e,n,0,t,s))});var p=l?void 0:Ya(t);return Da(p||t,function(h,f){p&&(h=t[f=h]),$a(a,f,Ii(h,e,n,0,t,s))}),a}function Vo(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new tn;++e<n;)this.add(t[e])}function up(t,e){for(var n=-1,o=t==null?0:t.length;++n<o;)if(e(t[n],n,t))return!0;return!1}function el(t,e){return t.has(e)}function pp(t,e,n,o,i,s){var a=1&n,l=t.length,c=e.length;if(l!=c&&!(a&&c>l))return!1;var d=s.get(t),u=s.get(e);if(d&&u)return d==e&&u==t;var p=-1,h=!0,f=2&n?new Vo:void 0;for(s.set(t,e),s.set(e,t);++p<l;){var m=t[p],g=e[p];if(o)var v=a?o(g,m,p,e,t,s):o(m,g,p,t,e,s);if(v!==void 0){if(v)continue;h=!1;break}if(f){if(!up(e,function(b,y){if(!el(f,y)&&(m===b||i(m,b,n,o,s)))return f.push(y)})){h=!1;break}}else if(m!==g&&!i(m,g,n,o,s)){h=!1;break}}return s.delete(t),s.delete(e),h}function Gb(t){var e=-1,n=Array(t.size);return t.forEach(function(o,i){n[++e]=[i,o]}),n}function tl(t){var e=-1,n=Array(t.size);return t.forEach(function(o){n[++e]=o}),n}we[lp]=we["[object Array]"]=we["[object ArrayBuffer]"]=we["[object DataView]"]=we["[object Boolean]"]=we["[object Date]"]=we["[object Float32Array]"]=we["[object Float64Array]"]=we["[object Int8Array]"]=we["[object Int16Array]"]=we["[object Int32Array]"]=we["[object Map]"]=we["[object Number]"]=we[dp]=we["[object RegExp]"]=we["[object Set]"]=we["[object String]"]=we["[object Symbol]"]=we["[object Uint8Array]"]=we["[object Uint8ClampedArray]"]=we["[object Uint16Array]"]=we["[object Uint32Array]"]=!0,we["[object Error]"]=we[cp]=we["[object WeakMap]"]=!1,Vo.prototype.add=Vo.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Vo.prototype.has=function(t){return this.__data__.has(t)};var hp=wt?wt.prototype:void 0,nl=hp?hp.valueOf:void 0,Yb=Object.prototype.hasOwnProperty,fp="[object Arguments]",mp="[object Array]",Ri="[object Object]",gp=Object.prototype.hasOwnProperty;function Li(t,e,n,o,i){return t===e||(t==null||e==null||!ht(t)&&!ht(e)?t!=t&&e!=e:function(s,a,l,c,d,u){var p=ce(s),h=ce(a),f=p?mp:ft(s),m=h?mp:ft(a),g=(f=f==fp?Ri:f)==Ri,v=(m=m==fp?Ri:m)==Ri,b=f==m;if(b&&yr(s)){if(!yr(a))return!1;p=!0,g=!1}if(b&&!g)return u||(u=new zt),p||ja(s)?pp(s,a,l,c,d,u):function(C,S,E,M,N,T,A){switch(E){case"[object DataView]":if(C.byteLength!=S.byteLength||C.byteOffset!=S.byteOffset)return!1;C=C.buffer,S=S.buffer;case"[object ArrayBuffer]":return!(C.byteLength!=S.byteLength||!T(new Ai(C),new Ai(S)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Mi(+C,+S);case"[object Error]":return C.name==S.name&&C.message==S.message;case"[object RegExp]":case"[object String]":return C==S+"";case"[object Map]":var $=Gb;case"[object Set]":var B=1&M;if($||($=tl),C.size!=S.size&&!B)return!1;var V=A.get(C);if(V)return V==S;M|=2,A.set(C,S);var O=pp($(C),$(S),M,N,T,A);return A.delete(C),O;case"[object Symbol]":if(nl)return nl.call(C)==nl.call(S)}return!1}(s,a,f,l,c,d,u);if(!(1&l)){var y=g&&gp.call(s,"__wrapped__"),k=v&&gp.call(a,"__wrapped__");if(y||k){var x=y?s.value():s,w=k?a.value():a;return u||(u=new zt),d(x,w,l,c,u)}}return!!b&&(u||(u=new zt),function(C,S,E,M,N,T){var A=1&E,$=Ya(C),B=$.length;if(B!=Ya(S).length&&!A)return!1;for(var V=B;V--;){var O=$[V];if(!(A?O in S:Yb.call(S,O)))return!1}var D=T.get(C),F=T.get(S);if(D&&F)return D==S&&F==C;var R=!0;T.set(C,S),T.set(S,C);for(var L=A;++V<B;){var I=C[O=$[V]],P=S[O];if(M)var W=A?M(P,I,O,S,C,T):M(I,P,O,C,S,T);if(!(W===void 0?I===P||N(I,P,E,M,T):W)){R=!1;break}L||(L=O=="constructor")}if(R&&!L){var z=C.constructor,j=S.constructor;z==j||!("constructor"in C)||!("constructor"in S)||typeof z=="function"&&z instanceof z&&typeof j=="function"&&j instanceof j||(R=!1)}return T.delete(C),T.delete(S),R}(s,a,l,c,d,u))}(t,e,n,o,Li,i))}function vp(t){return t==t&&!xt(t)}function yp(t,e){return function(n){return n!=null&&n[t]===e&&(e!==void 0||t in Object(n))}}function Xb(t,e){return t!=null&&e in Object(t)}function bp(t,e,n){for(var o=-1,i=(e=ju(e,t)).length,s=!1;++o<i;){var a=Vi(e[o]);if(!(s=t!=null&&n(t,a)))break;t=t[a]}return s||++o!=i?s:!!(i=t==null?0:t.length)&&za(i)&&Ei(a,i)&&(ce(t)||Bi(t))}function kp(t){return function(e){return e==null?void 0:e[t]}}function yn(t){return typeof t=="function"?t:t==null?Eo:typeof t=="object"?ce(t)?(o=t[0],i=t[1],Ka(o)&&vp(i)?yp(Vi(o),i):function(s){var a=Oo(s,o);return a===void 0&&a===i?function(l,c){return l!=null&&bp(l,c,Xb)}(s,o):Li(i,a,3)}):(n=function(s){for(var a=vn(s),l=a.length;l--;){var c=a[l],d=s[c];a[l]=[c,d,vp(d)]}return a}(e=t),n.length==1&&n[0][2]?yp(n[0][0],n[0][1]):function(s){return s===e||function(a,l,c){var d=c.length,u=d;if(a==null)return!u;for(a=Object(a);d--;){var p=c[d];if(p[2]?p[1]!==a[p[0]]:!(p[0]in a))return!1}for(;++d<u;){var h=(p=c[d])[0],f=a[h],m=p[1];if(p[2]){if(f===void 0&&!(h in a))return!1}else if(!Li(m,f,3,void 0,new zt))return!1}return!0}(s,0,n)}):function(s){return Ka(s)?kp(Vi(s)):function(a){return function(l){return Ga(l,a)}}(s)}(t);var e,n,o,i}var wp,xr=(wp=function(t,e){return t&&function(n,o,i){for(var s=-1,a=Object(n),l=i(n),c=l.length;c--;){var d=l[++s];if(o(a[d],d,a)===!1)break}return n}(t,e,vn)},function(t,e){if(t==null)return t;if(!Pt(t))return wp(t,e);for(var n=t.length,o=-1,i=Object(t);++o<n&&e(i[o],o,i)!==!1;);return t}),ol=function(){return Xe.Date.now()},Qb=Math.max,Zb=Math.min;function $i(t,e,n){var o,i,s,a,l,c,d=0,u=!1,p=!1,h=!0;if(typeof t!="function")throw new TypeError("Expected a function");function f(y){var k=o,x=i;return o=i=void 0,d=y,a=t.apply(x,k)}function m(y){var k=y-c;return c===void 0||k>=e||k<0||p&&y-d>=s}function g(){var y=ol();if(m(y))return v(y);l=setTimeout(g,function(k){var x=e-(k-c);return p?Zb(x,s-(k-d)):x}(y))}function v(y){return l=void 0,h&&o?f(y):(o=i=void 0,a)}function b(){var y=ol(),k=m(y);if(o=arguments,i=this,c=y,k){if(l===void 0)return function(x){return d=x,l=setTimeout(g,e),u?f(x):a}(c);if(p)return clearTimeout(l),l=setTimeout(g,e),f(c)}return l===void 0&&(l=setTimeout(g,e)),a}return e=ki(e)||0,xt(n)&&(u=!!n.leading,s=(p="maxWait"in n)?Qb(ki(n.maxWait)||0,e):s,h="trailing"in n?!!n.trailing:h),b.cancel=function(){l!==void 0&&clearTimeout(l),d=0,o=c=i=l=void 0},b.flush=function(){return l===void 0?a:v(ol())},b}function xp(t){return ht(t)&&Pt(t)}var Cp=Pa(function(t,e){return xp(t)?function(n,o){var i=-1,s=Ia,a=!0,l=n.length,c=[],d=o.length;if(!l)return c;o.length>=200&&(s=el,a=!1,o=new Vo(o));e:for(;++i<l;){var u=n[i],p=u;if(u=u!==0?u:0,a&&p==p){for(var h=d;h--;)if(o[h]===p)continue e;c.push(u)}else s(o,p,void 0)||c.push(u)}return c}(t,function(n,o,i,s,a){var l=-1,c=n.length;for(i||(i=Vb),a||(a=[]);++l<c;){var d=n[l];i(d)&&Hu(a,d)}return a}(e,0,xp)):[]});function Pi(t,e){var n;return(ce(t)?Da:xr)(t,typeof(n=e)=="function"?n:Eo)}function ek(t,e){var n=[];return xr(t,function(o,i,s){e(o,i,s)&&n.push(o)}),n}function Cr(t,e){return(ce(t)?Xu:ek)(t,yn(e))}var tk=Math.max;function Do(t,e,n){var o=t==null?0:t.length;if(!o)return-1;var i=n==null?0:Un(n);return i<0&&(i=tk(o+i,0)),Su(t,yn(e),i)}var Sp,zi=(Sp=Do,function(t,e,n){var o=Object(t);if(!Pt(t)){var i=yn(e);t=vn(t),e=function(a){return i(o[a],a,o)}}var s=Sp(t,e,n);return s>-1?o[i?t[s]:s]:void 0});function Ep(t){return t&&t.length?t[0]:void 0}function Mp(t,e){var n=-1,o=Pt(t)?Array(t.length):[];return xr(t,function(i,s,a){o[++n]=e(i,s,a)}),o}function bn(t,e){return(ce(t)?So:Mp)(t,yn(e))}var Fi=Ku("floor"),nk=Object.prototype.hasOwnProperty;function ok(t,e){return t!=null&&nk.call(t,e)}function rk(t,e){return t!=null&&bp(t,e,ok)}function Ao(t){return typeof t=="string"||!ce(t)&&ht(t)&&Zt(t)=="[object String]"}var ik=Math.max;function Ct(t,e,n,o){var i;t=Pt(t)?t:(i=t)==null?[]:function(a,l){return So(l,function(c){return a[c]})}(i,vn(i)),n=n?Un(n):0;var s=t.length;return n<0&&(n=ik(s+n,0)),Ao(t)?n<=s&&t.indexOf(e,n)>-1:!!s&&Aa(t,e,n)>-1}function Np(t){return t===!0||t===!1||ht(t)&&Zt(t)=="[object Boolean]"}var sk=Object.prototype.hasOwnProperty;function Be(t){if(t==null)return!0;if(Pt(t)&&(ce(t)||typeof t=="string"||typeof t.splice=="function"||yr(t)||ja(t)||Bi(t)))return!t.length;var e=ft(t);if(e=="[object Map]"||e=="[object Set]")return!t.size;if(Ni(t))return!Ha(t).length;for(var n in t)if(sk.call(t,n))return!1;return!0}function Sr(t){return typeof t=="number"||ht(t)&&Zt(t)=="[object Number]"}function ye(t){return t==null}function ak(t,e){if(t!==e){var n=t!==void 0,o=t===null,i=t==t,s=Co(t),a=e!==void 0,l=e===null,c=e==e,d=Co(e);if(!l&&!d&&!s&&t>e||s&&a&&c&&!l&&!d||o&&a&&c||!n&&c||!i)return 1;if(!o&&!s&&!d&&t<e||d&&n&&i&&!o&&!s||l&&n&&i||!a&&i||!c)return-1}return 0}var lk=kp("length"),Bp="\\ud800-\\udfff",ck="["+Bp+"]",rl="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",il="\\ud83c[\\udffb-\\udfff]",Tp="[^"+Bp+"]",Op="(?:\\ud83c[\\udde6-\\uddff]){2}",_p="[\\ud800-\\udbff][\\udc00-\\udfff]",Vp="(?:"+rl+"|"+il+")?",Dp="[\\ufe0e\\ufe0f]?",dk=Dp+Vp+"(?:\\u200d(?:"+[Tp,Op,_p].join("|")+")"+Dp+Vp+")*",uk="(?:"+[Tp+rl+"?",rl,Op,_p,ck].join("|")+")",Ap=RegExp(il+"(?="+il+")|"+uk+dk,"g");function pk(t,e,n,o,i){return i(t,function(s,a,l){n=o?(o=!1,s):e(n,s,a,l)}),n}function sl(t){if(t==null)return 0;if(Pt(t))return Ao(t)?function(o){return Ab.test(o)}(e=t)?function(o){for(var i=Ap.lastIndex=0;Ap.test(o);)++i;return i}(e):lk(e):t.length;var e,n=ft(t);return n=="[object Map]"||n=="[object Set]"?t.size:Ha(t).length}function hk(t,e){var n;return xr(t,function(o,i,s){return!(n=e(o,i,s))}),!!n}function al(t,e,n){return(ce(t)?up:hk)(t,yn(e))}function Io(t,e,n){var o=!0,i=!0;if(typeof t!="function")throw new TypeError("Expected a function");return xt(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),$i(t,e,{leading:o,maxWait:e,trailing:i})}function ll(t){return To(t).toLowerCase()}var fk=_o&&1/tl(new _o([,-0]))[1]==1/0?function(t){return new _o(t)}:vu;const ee=t=>(t.install=e=>{e.component(t.name,t)},t),cl=(t=0)=>new Promise(e=>setTimeout(e,t)),dl=t=>`${t}px`,Ft=(t,e)=>{if(xt(t))return e in t?t[e]:t[e.replace(/-([a-z])/g,(n,o)=>o.toUpperCase())]},Ip="mc-icon",mk=r.defineComponent({name:Ip,__name:"mc-icon",props:{name:{},size:{default:24},color:{}},emits:["click"],setup(t,{expose:e,emit:n}){const o=n,i=r.ref();return e({ref:i}),(s,a)=>(r.openBlock(),r.createElementBlock("span",{class:"mc-icon",style:r.normalizeStyle({fontSize:`${t.size}px`,width:`${t.size}px`,height:`${t.size}px`,color:t.color})},[r.createElementVNode("i",{ref_key:"_ref",ref:i,class:r.normalizeClass(["mc-iconfont",`mc-icon--${t.name}`]),onClick:a[0]||(a[0]=l=>(c=>{o("click",c)})(l))},null,2)],4))}}),q=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},Yn=q(mk,[["__scopeId","data-v-248771e8"]]),ge=ee(Yn),Rp="mc-alert-message",gk={class:"mc-alert-message-header"},vk={class:"mc-alert-message-title-container"},yk={key:0,class:"mc-alert-message-icon-group"},bk={class:"mc-alert-message-icon-wrapper"},kk={class:"mc-alert-message-icon-wrapper"},wk={key:0,class:"mc-alert-message-body"},xk=r.defineComponent({name:Rp,__name:"mc-alert-message",props:{modelValue:{type:Boolean,default:!0},width:{},height:{},type:{default:"info"},message:{},content:{},closable:{type:Boolean,default:!1},hideIcon:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1}},emits:["click","close","update:modelValue","expand"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref(),a=r.useSlots(),l=r.computed(()=>o.content||a.content),c=r.computed(()=>p.value||a.icon),d=r.ref(!1),u=r.computed(()=>!o.expandable||d.value),p=r.computed(()=>{if(!o.hideIcon)switch(o.type){case"success":return"Accept_02";case"error":return"Error_04";case"warning":return"Error_02";case"info":return"Info_02";default:return}}),h=()=>{i("update:modelValue",!1),i("close")},f=()=>{i("click"),o.expandable&&(d.value=!d.value,i("expand",d.value))};return e({ref:s,close:h,show:()=>{d.value=!0},hide:()=>{d.value=!1}}),(m,g)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"_ref",ref:s,class:r.normalizeClass(["mc-alert-message",[`mc-alert-message-${t.type}`]]),style:r.normalizeStyle({width:t.width,height:t.height,cursor:t.expandable?"pointer":"default"}),onClick:f},[r.createElementVNode("div",gk,[r.createElementVNode("div",vk,[c.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-alert-message-icon",style:r.normalizeStyle({height:l.value?"30px":"24px"})},[r.renderSlot(m.$slots,"icon",{},()=>[r.createVNode(r.unref(ge),{name:p.value,size:24},null,8,["name"])],!0)],4)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"mc-alert-message-title",style:r.normalizeStyle({fontSize:l.value?"18px":"16px",fontWeight:l.value?"600":"400",lineHeight:l.value?"30px":"24px"})},[r.renderSlot(m.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.message),1)],!0)],4)]),t.closable||t.expandable?(r.openBlock(),r.createElementBlock("div",yk,[r.createElementVNode("div",bk,[t.expandable?(r.openBlock(),r.createBlock(r.unref(ge),{key:0,name:"Down-Chevron",size:24,class:"mc-alert-message-tool-icon mc-alert-message-tool-icon-expand",style:r.normalizeStyle({transform:u.value?"rotate(180deg)":"rotate(0deg)"})},null,8,["style"])):r.createCommentVNode("",!0)]),r.createElementVNode("div",kk,[t.closable?(r.openBlock(),r.createBlock(r.unref(ge),{key:0,name:"Cross",size:24,class:"mc-alert-message-tool-icon mc-alert-message-tool-icon-close",onClick:r.withModifiers(h,["stop"])})):r.createCommentVNode("",!0)])])):r.createCommentVNode("",!0)]),l.value?(r.openBlock(),r.createElementBlock("div",wk,[r.createVNode(r.Transition,{name:"mc-alert-message-content-transition"},{default:r.withCtx(()=>[u.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-alert-message-content",style:r.normalizeStyle({paddingLeft:c.value?"48px":"16px"})},[r.renderSlot(m.$slots,"content",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0)],4)):r.createCommentVNode("",!0)]),_:3})])):r.createCommentVNode("",!0)],6))}}),Lp=ee(q(xk,[["__scopeId","data-v-638e4b6b"]])),ji=(t,e,n)=>{r.isRef(t)?r.watch(t,(o,i)=>{i==null||i.removeEventListener(e,n),o==null||o.addEventListener(e,n)}):r.onMounted(()=>t==null?void 0:t.addEventListener(e,n)),r.onBeforeUnmount(()=>{var o;return(o=r.unref(t))==null?void 0:o.removeEventListener(e,n)})},Hi=(t,e,n="click")=>{ji(document,n,o=>{const i=r.unref(t);if(!i)return;const s=(ce(i)?i:[i]).filter(a=>!!a);s.length!==0&&(((a,l)=>{var d;const c=((d=l.composedPath)==null?void 0:d.call(l))??[l.target];return a.some(u=>u&&c.includes(u))})(s,o)||e(o))})},Xn=(t,{afterFocus:e,beforeBlur:n,afterBlur:o}={})=>{const i=r.getCurrentInstance(),{emit:s}=i,a=r.ref(),l=r.ref(!1);return ji(a,"click",()=>{var c;(c=t.value)==null||c.focus()}),{wrapperRef:a,isFocused:l,handleFocus:c=>{l.value||(l.value=!0,s("focus",c),e==null||e())},handleBlur:c=>{var d;He(n)&&n(c)||c.relatedTarget&&((d=a.value)!=null&&d.contains(c.relatedTarget))||(l.value=!1,s("blur",c),o==null||o())}}};function ue(t){const e=r.getCurrentInstance();if(!e)throw new Error("useProp must be used within a component");return r.computed(()=>{var o;const n=(o=e==null?void 0:e.proxy)==null?void 0:o.$props;if(!ce(t))return n==null?void 0:n[t];for(const i of t)if(rk(n,i))return n==null?void 0:n[i]})}const $p=(t,e,n=300)=>{const o=new ResizeObserver(Io(a=>{for(let l of a)e(l.contentRect)},n)),i=a=>{o.observe(a)},s=a=>{o.unobserve(a)};return r.onMounted(()=>{t.value&&i(t.value)}),r.onBeforeUnmount(()=>{t.value&&s(t.value)}),r.watch(t,a=>{a&&i(a)}),{resizeObserver:o,observe:i,unobserve:s}},lt=()=>{const t=ue("width"),e=ue("height");return{width:r.computed(()=>typeof t.value=="number"?`${t.value}px`:t.value||void 0),height:r.computed(()=>typeof e.value=="number"?`${e.value}px`:e.value||void 0)}},ul=t=>{const e=r.ref(!1),n=()=>{e.value=!0},o=()=>{e.value=!1};return r.onMounted(()=>{t.value&&(t.value.addEventListener("mouseenter",n),t.value.addEventListener("mouseleave",o))}),r.onBeforeMount(()=>{t.value&&(t.value.removeEventListener("mouseenter",n),t.value.removeEventListener("mouseleave",o))}),{isHovering:e}},Pp="mc-button",Ck=["type","disabled"],Sk={key:1,class:"loading-icon"},Ek={class:"mc-button-text"},Mk=r.defineComponent({name:Pp,__name:"mc-button",props:{type:{default:"primary"},nativeType:{default:"button"},size:{default:"medium"},disabled:{type:Boolean},loading:{type:Boolean},useThrottle:{type:Boolean,default:!0},throttleDuration:{default:500},leftIcon:{},rightIcon:{},content:{},height:{},width:{}},emits:["click"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref(),{width:a,height:l}=lt(),c=u=>{o.loading||o.disabled||i("click",u)},d=Io(c,o.throttleDuration,{trailing:!1});return e({ref:s}),(u,p)=>(r.openBlock(),r.createElementBlock("button",{ref_key:"_ref",ref:s,style:r.normalizeStyle({width:r.unref(a),height:r.unref(l)}),class:r.normalizeClass(["mc-button",{[`mc-button--${t.type}`]:t.type,[`mc-button--${t.size}`]:t.size,"is-loading":t.loading,"is-disabled":t.disabled}]),type:t.nativeType,disabled:!(!t.disabled&&!t.loading)||void 0,onClick:p[0]||(p[0]=h=>t.useThrottle?r.unref(d)(h):c(h))},[t.leftIcon&&!t.loading?(r.openBlock(),r.createBlock(r.unref(ge),{key:0,name:t.leftIcon},null,8,["name"])):r.createCommentVNode("",!0),t.loading&&!t.disabled?(r.openBlock(),r.createElementBlock("span",Sk,[r.createVNode(r.unref(ge),{name:"Loading",size:16})])):r.createCommentVNode("",!0),r.createElementVNode("div",Ek,[r.renderSlot(u.$slots,"default",{},void 0,!0)]),t.rightIcon?(r.openBlock(),r.createBlock(r.unref(ge),{key:2,name:t.rightIcon},null,8,["name"])):r.createCommentVNode("",!0)],14,Ck))}}),Wi=ee(q(Mk,[["__scopeId","data-v-0ef41dbd"]])),Ro=Symbol("mc-form-context"),zp="mc-form";function Qn(){return Qn=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Qn.apply(this,arguments)}function pl(t){return pl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pl(t)}function Er(t,e){return Er=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Er(t,e)}function hl(t,e,n){return hl=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}()?Reflect.construct.bind():function(o,i,s){var a=[null];a.push.apply(a,i);var l=new(Function.bind.apply(o,a));return s&&Er(l,s.prototype),l},hl.apply(null,arguments)}function fl(t){var e=typeof Map=="function"?new Map:void 0;return fl=function(n){if(n===null||(o=n,Function.toString.call(o).indexOf("[native code]")===-1))return n;var o;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return hl(n,arguments,pl(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Er(i,n)},fl(t)}var Nk=/%[sdj%]/g,Fp=function(){};function ml(t){if(!t||!t.length)return null;var e={};return t.forEach(function(n){var o=n.field;e[o]=e[o]||[],e[o].push(n)}),e}function mt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];var i=0,s=n.length;if(typeof t=="function")return t.apply(null,n);if(typeof t=="string"){var a=t.replace(Nk,function(l){if(l==="%%")return"%";if(i>=s)return l;switch(l){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch{return"[Circular]"}break;default:return l}});return a}return t}function je(t,e){return t==null||!(e!=="array"||!Array.isArray(t)||t.length)||!(!function(n){return n==="string"||n==="url"||n==="hex"||n==="email"||n==="date"||n==="pattern"}(e)||typeof t!="string"||t)}function jp(t,e,n){var o=0,i=t.length;(function s(a){if(a&&a.length)n(a);else{var l=o;o+=1,l<i?e(t[l],s):n([])}})([])}typeof process<"u"&&process.env&&process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof document<"u"&&(Fp=function(t,e){typeof console<"u"&&console.warn&&typeof ASYNC_VALIDATOR_NO_WARNING>"u"&&e.every(function(n){return typeof n=="string"})&&console.warn(t,e)});var Hp=function(t){var e,n;function o(i,s){var a;return(a=t.call(this,"Async Validation Error")||this).errors=i,a.fields=s,a}return n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,Er(e,n),o}(fl(Error));function Wp(t,e){return function(n){var o,i;return o=t.fullFields?function(s,a){for(var l=s,c=0;c<a.length;c++){if(l==null)return l;l=l[a[c]]}return l}(e,t.fullFields):e[n.field||t.fullField],(i=n)&&i.message!==void 0?(n.field=n.field||t.fullField,n.fieldValue=o,n):{message:typeof n=="function"?n():n,fieldValue:o,field:n.field||t.fullField}}}function Kp(t,e){if(e){for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];typeof o=="object"&&typeof t[n]=="object"?t[n]=Qn({},t[n],o):t[n]=o}}return t}var gl,Up=function(t,e,n,o,i,s){!t.required||n.hasOwnProperty(t.field)&&!je(e,s||t.type)||o.push(mt(i.messages.required,t.fullField))},Bk=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,Tk=/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i,Mr={integer:function(t){return Mr.number(t)&&parseInt(t,10)===t},float:function(t){return Mr.number(t)&&!Mr.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return!isNaN(t)&&typeof t=="number"},object:function(t){return typeof t=="object"&&!Mr.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(Bk)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(function(){if(gl)return gl;var e="[a-fA-F\\d:]",n=function(h){return h&&h.includeBoundaries?"(?:(?<=\\s|^)(?="+e+")|(?<="+e+")(?=\\s|$))":""},o="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",i="[a-fA-F\\d]{1,4}",s=(`
4
4
  (?:
5
5
  (?:`+i+":){7}(?:"+i+`|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
6
6
  (?:`+i+":){6}(?:"+o+"|:"+i+`|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
@@ -11,7 +11,7 @@
11
11
  (?:`+i+":){1}(?:(?::"+i+"){0,4}:"+o+"|(?::"+i+`){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
12
12
  (?::(?:(?::`+i+"){0,5}:"+o+"|(?::"+i+`){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
13
13
  )(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
14
- `).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),a=new RegExp("(?:^"+o+"$)|(?:^"+s+"$)"),l=new RegExp("^"+o+"$"),c=new RegExp("^"+s+"$"),d=function(h){return h&&h.exact?a:new RegExp("(?:"+n(h)+o+n(h)+")|(?:"+n(h)+s+n(h)+")","g")};d.v4=function(h){return h&&h.exact?l:new RegExp(""+n(h)+o+n(h),"g")},d.v6=function(h){return h&&h.exact?c:new RegExp(""+n(h)+s+n(h),"g")};var u=d.v4().source,p=d.v6().source;return gl=new RegExp("(?:^(?:(?:(?:[a-z]+:)?//)|www\\.)(?:\\S+(?::\\S*)?@)?(?:localhost|"+u+"|"+p+'|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:[/?#][^\\s"]*)?$)',"i")}())},hex:function(t){return typeof t=="string"&&!!t.match(Tk)}},Lo="enum",tt=Up,Dt=function(t,e,n,o,i){if(t.required&&e===void 0)Up(t,e,n,o,i);else{var s=t.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(s)>-1?Mr[s](e)||o.push(mt(i.messages.types[s],t.fullField,t.type)):s&&typeof e!==t.type&&o.push(mt(i.messages.types[s],t.fullField,t.type))}},$o=function(t,e,n,o,i){var s=typeof t.len=="number",a=typeof t.min=="number",l=typeof t.max=="number",c=e,d=null,u=typeof e=="number",p=typeof e=="string",h=Array.isArray(e);if(u?d="number":p?d="string":h&&(d="array"),!d)return!1;h&&(c=e.length),p&&(c=e.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),s?c!==t.len&&o.push(mt(i.messages[d].len,t.fullField,t.len)):a&&!l&&c<t.min?o.push(mt(i.messages[d].min,t.fullField,t.min)):l&&!a&&c>t.max?o.push(mt(i.messages[d].max,t.fullField,t.max)):a&&l&&(c<t.min||c>t.max)&&o.push(mt(i.messages[d].range,t.fullField,t.min,t.max))},qp=function(t,e,n,o,i){t.pattern&&(t.pattern instanceof RegExp?(t.pattern.lastIndex=0,t.pattern.test(e)||o.push(mt(i.messages.pattern.mismatch,t.fullField,e,t.pattern))):typeof t.pattern=="string"&&(new RegExp(t.pattern).test(e)||o.push(mt(i.messages.pattern.mismatch,t.fullField,e,t.pattern))))},vl=function(t,e,n,o,i){var s=t.type,a=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e,s)&&!t.required)return n();tt(t,e,o,a,i,s),je(e,s)||Dt(t,e,o,a,i)}n(a)},Nr={string:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e,"string")&&!t.required)return n();tt(t,e,o,s,i,"string"),je(e,"string")||(Dt(t,e,o,s,i),$o(t,e,0,s,i),qp(t,e,0,s,i),t.whitespace===!0&&function(a,l,c,d,u){(/^\s+$/.test(l)||l==="")&&d.push(mt(u.messages.whitespace,a.fullField))}(t,e,0,s,i))}n(s)},method:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e)&&!t.required)return n();tt(t,e,o,s,i),e!==void 0&&Dt(t,e,o,s,i)}n(s)},number:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(e===""&&(e=void 0),je(e)&&!t.required)return n();tt(t,e,o,s,i),e!==void 0&&(Dt(t,e,o,s,i),$o(t,e,0,s,i))}n(s)},boolean:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e)&&!t.required)return n();tt(t,e,o,s,i),e!==void 0&&Dt(t,e,o,s,i)}n(s)},regexp:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e)&&!t.required)return n();tt(t,e,o,s,i),je(e)||Dt(t,e,o,s,i)}n(s)},integer:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e)&&!t.required)return n();tt(t,e,o,s,i),e!==void 0&&(Dt(t,e,o,s,i),$o(t,e,0,s,i))}n(s)},float:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e)&&!t.required)return n();tt(t,e,o,s,i),e!==void 0&&(Dt(t,e,o,s,i),$o(t,e,0,s,i))}n(s)},array:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(e==null&&!t.required)return n();tt(t,e,o,s,i,"array"),e!=null&&(Dt(t,e,o,s,i),$o(t,e,0,s,i))}n(s)},object:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e)&&!t.required)return n();tt(t,e,o,s,i),e!==void 0&&Dt(t,e,o,s,i)}n(s)},enum:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e)&&!t.required)return n();tt(t,e,o,s,i),e!==void 0&&function(a,l,c,d,u){a[Lo]=Array.isArray(a[Lo])?a[Lo]:[],a[Lo].indexOf(l)===-1&&d.push(mt(u.messages[Lo],a.fullField,a[Lo].join(", ")))}(t,e,0,s,i)}n(s)},pattern:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e,"string")&&!t.required)return n();tt(t,e,o,s,i),je(e,"string")||qp(t,e,0,s,i)}n(s)},date:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e,"date")&&!t.required)return n();var a;tt(t,e,o,s,i),je(e,"date")||(a=e instanceof Date?e:new Date(e),Dt(t,a,o,s,i),a&&$o(t,a.getTime(),0,s,i))}n(s)},url:vl,hex:vl,email:vl,required:function(t,e,n,o,i){var s=[],a=Array.isArray(e)?"array":typeof e;tt(t,e,o,s,i,a),n(s)},any:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e)&&!t.required)return n();tt(t,e,o,s,i)}n(s)}};function yl(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var bl=yl(),Br=function(){function t(n){this.rules=null,this._messages=bl,this.define(n)}var e=t.prototype;return e.define=function(n){var o=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(typeof n!="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(i){var s=n[i];o.rules[i]=Array.isArray(s)?s:[s]})},e.messages=function(n){return n&&(this._messages=Kp(yl(),n)),this._messages},e.validate=function(n,o,i){var s=this;o===void 0&&(o={}),i===void 0&&(i=function(){});var a=n,l=o,c=i;if(typeof l=="function"&&(c=l,l={}),!this.rules||Object.keys(this.rules).length===0)return c&&c(null,a),Promise.resolve(a);if(l.messages){var d=this.messages();d===bl&&(d=yl()),Kp(d,l.messages),l.messages=d}else l.messages=this.messages();var u={};(l.keys||Object.keys(this.rules)).forEach(function(h){var f=s.rules[h],m=a[h];f.forEach(function(g){var v=g;typeof v.transform=="function"&&(a===n&&(a=Qn({},a)),m=a[h]=v.transform(m)),(v=typeof v=="function"?{validator:v}:Qn({},v)).validator=s.getValidationMethod(v),v.validator&&(v.field=h,v.fullField=v.fullField||h,v.type=s.getType(v),u[h]=u[h]||[],u[h].push({rule:v,value:m,source:a,field:h}))})});var p={};return function(h,f,m,g,v){if(f.first){var b=new Promise(function(E,M){var N=function(T){var D=[];return Object.keys(T).forEach(function($){D.push.apply(D,T[$]||[])}),D}(h);jp(N,m,function(T){return g(T),T.length?M(new Hp(T,ml(T))):E(v)})});return b.catch(function(E){return E}),b}var y=f.firstFields===!0?Object.keys(h):f.firstFields||[],k=Object.keys(h),x=k.length,w=0,C=[],S=new Promise(function(E,M){var N=function(T){if(C.push.apply(C,T),++w===x)return g(C),C.length?M(new Hp(C,ml(C))):E(v)};k.length||(g(C),E(v)),k.forEach(function(T){var D=h[T];y.indexOf(T)!==-1?jp(D,m,N):function($,B,V){var O=[],A=0,F=$.length;function R(L){O.push.apply(O,L||[]),++A===F&&V(O)}$.forEach(function(L){B(L,R)})}(D,m,N)})});return S.catch(function(E){return E}),S}(u,l,function(h,f){var m,g=h.rule,v=!(g.type!=="object"&&g.type!=="array"||typeof g.fields!="object"&&typeof g.defaultField!="object");function b(k,x){return Qn({},x,{fullField:g.fullField+"."+k,fullFields:g.fullFields?[].concat(g.fullFields,[k]):[k]})}function y(k){k===void 0&&(k=[]);var x=Array.isArray(k)?k:[k];!l.suppressWarning&&x.length&&t.warning("async-validator:",x),x.length&&g.message!==void 0&&(x=[].concat(g.message));var w=x.map(Wp(g,a));if(l.first&&w.length)return p[g.field]=1,f(w);if(v){if(g.required&&!h.value)return g.message!==void 0?w=[].concat(g.message).map(Wp(g,a)):l.error&&(w=[l.error(g,mt(l.messages.required,g.field))]),f(w);var C={};g.defaultField&&Object.keys(h.value).map(function(M){C[M]=g.defaultField}),C=Qn({},C,h.rule.fields);var S={};Object.keys(C).forEach(function(M){var N=C[M],T=Array.isArray(N)?N:[N];S[M]=T.map(b.bind(null,M))});var E=new t(S);E.messages(l.messages),h.rule.options&&(h.rule.options.messages=l.messages,h.rule.options.error=l.error),E.validate(h.value,h.rule.options||l,function(M){var N=[];w&&w.length&&N.push.apply(N,w),M&&M.length&&N.push.apply(N,M),f(N.length?N:null)})}else f(w)}if(v=v&&(g.required||!g.required&&h.value),g.field=h.field,g.asyncValidator)m=g.asyncValidator(g,h.value,y,h.source,l);else if(g.validator){try{m=g.validator(g,h.value,y,h.source,l)}catch(k){console.error==null||console.error(k),l.suppressValidatorError||setTimeout(function(){throw k},0),y(k.message)}m===!0?y():m===!1?y(typeof g.message=="function"?g.message(g.fullField||g.field):g.message||(g.fullField||g.field)+" fails"):m instanceof Array?y(m):m instanceof Error&&y(m.message)}m&&m.then&&m.then(function(){return y()},function(k){return y(k)})},function(h){(function(f){var m=[],g={};function v(y){var k;Array.isArray(y)?m=(k=m).concat.apply(k,y):m.push(y)}for(var b=0;b<f.length;b++)v(f[b]);m.length?(g=ml(m),c(m,g)):c(null,a)})(h)},a)},e.getType=function(n){if(n.type===void 0&&n.pattern instanceof RegExp&&(n.type="pattern"),typeof n.validator!="function"&&n.type&&!Nr.hasOwnProperty(n.type))throw new Error(mt("Unknown rule type %s",n.type));return n.type||"string"},e.getValidationMethod=function(n){if(typeof n.validator=="function")return n.validator;var o=Object.keys(n),i=o.indexOf("message");return i!==-1&&o.splice(i,1),o.length===1&&o[0]==="required"?Nr.required:Nr[this.getType(n)]||void 0},t}();Br.register=function(t,e){if(typeof e!="function")throw new Error("Cannot register a validator by type, validator is not a function");Nr[t]=e},Br.warning=Fp,Br.messages=bl,Br.validators=Nr;var ct="top",St="bottom",Et="right",nt="left",kl="auto",Tr=[ct,St,Et,nt],Po="start",Or="end",Jp="viewport",_r="popper",Gp=Tr.reduce(function(t,e){return t.concat([e+"-"+Po,e+"-"+Or])},[]),Yp=[].concat(Tr,[kl]).reduce(function(t,e){return t.concat([e,e+"-"+Po,e+"-"+Or])},[]),Ok=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function jt(t){return t?(t.nodeName||"").toLowerCase():null}function gt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Zn(t){return t instanceof gt(t).Element||t instanceof Element}function Mt(t){return t instanceof gt(t).HTMLElement||t instanceof HTMLElement}function wl(t){return typeof ShadowRoot<"u"&&(t instanceof gt(t).ShadowRoot||t instanceof ShadowRoot)}const _k={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var o=e.styles[n]||{},i=e.attributes[n]||{},s=e.elements[n];Mt(s)&&jt(s)&&(Object.assign(s.style,o),Object.keys(i).forEach(function(a){var l=i[a];l===!1?s.removeAttribute(a):s.setAttribute(a,l===!0?"":l)}))})},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(o){var i=e.elements[o],s=e.attributes[o]||{},a=Object.keys(e.styles.hasOwnProperty(o)?e.styles[o]:n[o]).reduce(function(l,c){return l[c]="",l},{});Mt(i)&&jt(i)&&(Object.assign(i.style,a),Object.keys(s).forEach(function(l){i.removeAttribute(l)}))})}},requires:["computeStyles"]};function Ht(t){return t.split("-")[0]}var eo=Math.max,Ki=Math.min,zo=Math.round;function xl(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Xp(){return!/^((?!chrome|android).)*safari/i.test(xl())}function Fo(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var o=t.getBoundingClientRect(),i=1,s=1;e&&Mt(t)&&(i=t.offsetWidth>0&&zo(o.width)/t.offsetWidth||1,s=t.offsetHeight>0&&zo(o.height)/t.offsetHeight||1);var a=(Zn(t)?gt(t):window).visualViewport,l=!Xp()&&n,c=(o.left+(l&&a?a.offsetLeft:0))/i,d=(o.top+(l&&a?a.offsetTop:0))/s,u=o.width/i,p=o.height/s;return{width:u,height:p,top:d,right:c+u,bottom:d+p,left:c,x:c,y:d}}function Cl(t){var e=Fo(t),n=t.offsetWidth,o=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-o)<=1&&(o=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:o}}function Qp(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&wl(n)){var o=e;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function nn(t){return gt(t).getComputedStyle(t)}function Vk(t){return["table","td","th"].indexOf(jt(t))>=0}function kn(t){return((Zn(t)?t.ownerDocument:t.document)||window.document).documentElement}function Ui(t){return jt(t)==="html"?t:t.assignedSlot||t.parentNode||(wl(t)?t.host:null)||kn(t)}function Zp(t){return Mt(t)&&nn(t).position!=="fixed"?t.offsetParent:null}function Vr(t){for(var e=gt(t),n=Zp(t);n&&Vk(n)&&nn(n).position==="static";)n=Zp(n);return n&&(jt(n)==="html"||jt(n)==="body"&&nn(n).position==="static")?e:n||function(o){var i=/firefox/i.test(xl());if(/Trident/i.test(xl())&&Mt(o)&&nn(o).position==="fixed")return null;var s=Ui(o);for(wl(s)&&(s=s.host);Mt(s)&&["html","body"].indexOf(jt(s))<0;){var a=nn(s);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||i&&a.willChange==="filter"||i&&a.filter&&a.filter!=="none")return s;s=s.parentNode}return null}(t)||e}function Sl(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Ar(t,e,n){return eo(t,Ki(e,n))}function eh(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function th(t,e){return e.reduce(function(n,o){return n[o]=t,n},{})}const Ak={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,o=t.name,i=t.options,s=n.elements.arrow,a=n.modifiersData.popperOffsets,l=Ht(n.placement),c=Sl(l),d=[nt,Et].indexOf(l)>=0?"height":"width";if(s&&a){var u=function(E,M){return eh(typeof(E=typeof E=="function"?E(Object.assign({},M.rects,{placement:M.placement})):E)!="number"?E:th(E,Tr))}(i.padding,n),p=Cl(s),h=c==="y"?ct:nt,f=c==="y"?St:Et,m=n.rects.reference[d]+n.rects.reference[c]-a[c]-n.rects.popper[d],g=a[c]-n.rects.reference[c],v=Vr(s),b=v?c==="y"?v.clientHeight||0:v.clientWidth||0:0,y=m/2-g/2,k=u[h],x=b-p[d]-u[f],w=b/2-p[d]/2+y,C=Ar(k,w,x),S=c;n.modifiersData[o]=((e={})[S]=C,e.centerOffset=C-w,e)}},effect:function(t){var e=t.state,n=t.options.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o!="string"||(o=e.elements.popper.querySelector(o)))&&Qp(e.elements.popper,o)&&(e.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function jo(t){return t.split("-")[1]}var Dk={top:"auto",right:"auto",bottom:"auto",left:"auto"};function nh(t){var e,n=t.popper,o=t.popperRect,i=t.placement,s=t.variation,a=t.offsets,l=t.position,c=t.gpuAcceleration,d=t.adaptive,u=t.roundOffsets,p=t.isFixed,h=a.x,f=h===void 0?0:h,m=a.y,g=m===void 0?0:m,v=typeof u=="function"?u({x:f,y:g}):{x:f,y:g};f=v.x,g=v.y;var b=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),k=nt,x=ct,w=window;if(d){var C=Vr(n),S="clientHeight",E="clientWidth";C===gt(n)&&nn(C=kn(n)).position!=="static"&&l==="absolute"&&(S="scrollHeight",E="scrollWidth"),(i===ct||(i===nt||i===Et)&&s===Or)&&(x=St,g-=(p&&C===w&&w.visualViewport?w.visualViewport.height:C[S])-o.height,g*=c?1:-1),i!==nt&&(i!==ct&&i!==St||s!==Or)||(k=Et,f-=(p&&C===w&&w.visualViewport?w.visualViewport.width:C[E])-o.width,f*=c?1:-1)}var M,N=Object.assign({position:l},d&&Dk),T=u===!0?function(D,$){var B=D.x,V=D.y,O=$.devicePixelRatio||1;return{x:zo(B*O)/O||0,y:zo(V*O)/O||0}}({x:f,y:g},gt(n)):{x:f,y:g};return f=T.x,g=T.y,c?Object.assign({},N,((M={})[x]=y?"0":"",M[k]=b?"0":"",M.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",M)):Object.assign({},N,((e={})[x]=y?g+"px":"",e[k]=b?f+"px":"",e.transform="",e))}var qi={passive:!0},Ik={left:"right",right:"left",bottom:"top",top:"bottom"};function Ji(t){return t.replace(/left|right|bottom|top/g,function(e){return Ik[e]})}var Rk={start:"end",end:"start"};function oh(t){return t.replace(/start|end/g,function(e){return Rk[e]})}function El(t){var e=gt(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ml(t){return Fo(kn(t)).left+El(t).scrollLeft}function Nl(t){var e=nn(t),n=e.overflow,o=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+o)}function rh(t){return["html","body","#document"].indexOf(jt(t))>=0?t.ownerDocument.body:Mt(t)&&Nl(t)?t:rh(Ui(t))}function Dr(t,e){var n;e===void 0&&(e=[]);var o=rh(t),i=o===((n=t.ownerDocument)==null?void 0:n.body),s=gt(o),a=i?[s].concat(s.visualViewport||[],Nl(o)?o:[]):o,l=e.concat(a);return i?l:l.concat(Dr(Ui(a)))}function Bl(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ih(t,e,n){return e===Jp?Bl(function(o,i){var s=gt(o),a=kn(o),l=s.visualViewport,c=a.clientWidth,d=a.clientHeight,u=0,p=0;if(l){c=l.width,d=l.height;var h=Xp();(h||!h&&i==="fixed")&&(u=l.offsetLeft,p=l.offsetTop)}return{width:c,height:d,x:u+Ml(o),y:p}}(t,n)):Zn(e)?function(o,i){var s=Fo(o,!1,i==="fixed");return s.top=s.top+o.clientTop,s.left=s.left+o.clientLeft,s.bottom=s.top+o.clientHeight,s.right=s.left+o.clientWidth,s.width=o.clientWidth,s.height=o.clientHeight,s.x=s.left,s.y=s.top,s}(e,n):Bl(function(o){var i,s=kn(o),a=El(o),l=(i=o.ownerDocument)==null?void 0:i.body,c=eo(s.scrollWidth,s.clientWidth,l?l.scrollWidth:0,l?l.clientWidth:0),d=eo(s.scrollHeight,s.clientHeight,l?l.scrollHeight:0,l?l.clientHeight:0),u=-a.scrollLeft+Ml(o),p=-a.scrollTop;return nn(l||s).direction==="rtl"&&(u+=eo(s.clientWidth,l?l.clientWidth:0)-c),{width:c,height:d,x:u,y:p}}(kn(t)))}function sh(t){var e,n=t.reference,o=t.element,i=t.placement,s=i?Ht(i):null,a=i?jo(i):null,l=n.x+n.width/2-o.width/2,c=n.y+n.height/2-o.height/2;switch(s){case ct:e={x:l,y:n.y-o.height};break;case St:e={x:l,y:n.y+n.height};break;case Et:e={x:n.x+n.width,y:c};break;case nt:e={x:n.x-o.width,y:c};break;default:e={x:n.x,y:n.y}}var d=s?Sl(s):null;if(d!=null){var u=d==="y"?"height":"width";switch(a){case Po:e[d]=e[d]-(n[u]/2-o[u]/2);break;case Or:e[d]=e[d]+(n[u]/2-o[u]/2)}}return e}function Ir(t,e){e===void 0&&(e={});var n=e,o=n.placement,i=o===void 0?t.placement:o,s=n.strategy,a=s===void 0?t.strategy:s,l=n.boundary,c=l===void 0?"clippingParents":l,d=n.rootBoundary,u=d===void 0?Jp:d,p=n.elementContext,h=p===void 0?_r:p,f=n.altBoundary,m=f!==void 0&&f,g=n.padding,v=g===void 0?0:g,b=eh(typeof v!="number"?v:th(v,Tr)),y=h===_r?"reference":_r,k=t.rects.popper,x=t.elements[m?y:h],w=function($,B,V,O){var A=B==="clippingParents"?function(I){var P=Dr(Ui(I)),W=["absolute","fixed"].indexOf(nn(I).position)>=0&&Mt(I)?Vr(I):I;return Zn(W)?P.filter(function(z){return Zn(z)&&Qp(z,W)&&jt(z)!=="body"}):[]}($):[].concat(B),F=[].concat(A,[V]),R=F[0],L=F.reduce(function(I,P){var W=ih($,P,O);return I.top=eo(W.top,I.top),I.right=Ki(W.right,I.right),I.bottom=Ki(W.bottom,I.bottom),I.left=eo(W.left,I.left),I},ih($,R,O));return L.width=L.right-L.left,L.height=L.bottom-L.top,L.x=L.left,L.y=L.top,L}(Zn(x)?x:x.contextElement||kn(t.elements.popper),c,u,a),C=Fo(t.elements.reference),S=sh({reference:C,element:k,placement:i}),E=Bl(Object.assign({},k,S)),M=h===_r?E:C,N={top:w.top-M.top+b.top,bottom:M.bottom-w.bottom+b.bottom,left:w.left-M.left+b.left,right:M.right-w.right+b.right},T=t.modifiersData.offset;if(h===_r&&T){var D=T[i];Object.keys(N).forEach(function($){var B=[Et,St].indexOf($)>=0?1:-1,V=[ct,St].indexOf($)>=0?"y":"x";N[$]+=D[V]*B})}return N}function Lk(t,e){e===void 0&&(e={});var n=e,o=n.placement,i=n.boundary,s=n.rootBoundary,a=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,d=c===void 0?Yp:c,u=jo(o),p=u?l?Gp:Gp.filter(function(m){return jo(m)===u}):Tr,h=p.filter(function(m){return d.indexOf(m)>=0});h.length===0&&(h=p);var f=h.reduce(function(m,g){return m[g]=Ir(t,{placement:g,boundary:i,rootBoundary:s,padding:a})[Ht(g)],m},{});return Object.keys(f).sort(function(m,g){return f[m]-f[g]})}const $k={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,o=t.name;if(!e.modifiersData[o]._skip){for(var i=n.mainAxis,s=i===void 0||i,a=n.altAxis,l=a===void 0||a,c=n.fallbackPlacements,d=n.padding,u=n.boundary,p=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,m=f===void 0||f,g=n.allowedAutoPlacements,v=e.options.placement,b=Ht(v),y=c||(b!==v&&m?function(I){if(Ht(I)===kl)return[];var P=Ji(I);return[oh(I),P,oh(P)]}(v):[Ji(v)]),k=[v].concat(y).reduce(function(I,P){return I.concat(Ht(P)===kl?Lk(e,{placement:P,boundary:u,rootBoundary:p,padding:d,flipVariations:m,allowedAutoPlacements:g}):P)},[]),x=e.rects.reference,w=e.rects.popper,C=new Map,S=!0,E=k[0],M=0;M<k.length;M++){var N=k[M],T=Ht(N),D=jo(N)===Po,$=[ct,St].indexOf(T)>=0,B=$?"width":"height",V=Ir(e,{placement:N,boundary:u,rootBoundary:p,altBoundary:h,padding:d}),O=$?D?Et:nt:D?St:ct;x[B]>w[B]&&(O=Ji(O));var A=Ji(O),F=[];if(s&&F.push(V[T]<=0),l&&F.push(V[O]<=0,V[A]<=0),F.every(function(I){return I})){E=N,S=!1;break}C.set(N,F)}if(S)for(var R=function(I){var P=k.find(function(W){var z=C.get(W);if(z)return z.slice(0,I).every(function(j){return j})});if(P)return E=P,"break"},L=m?3:1;L>0&&R(L)!=="break";L--);e.placement!==E&&(e.modifiersData[o]._skip=!0,e.placement=E,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ah(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function lh(t){return[ct,Et,St,nt].some(function(e){return t[e]>=0})}const Pk={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,o=t.name,i=n.mainAxis,s=i===void 0||i,a=n.altAxis,l=a!==void 0&&a,c=n.boundary,d=n.rootBoundary,u=n.altBoundary,p=n.padding,h=n.tether,f=h===void 0||h,m=n.tetherOffset,g=m===void 0?0:m,v=Ir(e,{boundary:c,rootBoundary:d,padding:p,altBoundary:u}),b=Ht(e.placement),y=jo(e.placement),k=!y,x=Sl(b),w=x==="x"?"y":"x",C=e.modifiersData.popperOffsets,S=e.rects.reference,E=e.rects.popper,M=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,N=typeof M=="number"?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),T=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,D={x:0,y:0};if(C){if(s){var $,B=x==="y"?ct:nt,V=x==="y"?St:Et,O=x==="y"?"height":"width",A=C[x],F=A+v[B],R=A-v[V],L=f?-E[O]/2:0,I=y===Po?S[O]:E[O],P=y===Po?-E[O]:-S[O],W=e.elements.arrow,z=f&&W?Cl(W):{width:0,height:0},j=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},K=j[B],G=j[V],Z=Ar(0,S[O],z[O]),J=k?S[O]/2-L-Z-K-N.mainAxis:I-Z-K-N.mainAxis,Y=k?-S[O]/2+L+Z+G+N.mainAxis:P+Z+G+N.mainAxis,te=e.elements.arrow&&Vr(e.elements.arrow),pe=te?x==="y"?te.clientTop||0:te.clientLeft||0:0,X=($=T==null?void 0:T[x])!=null?$:0,oe=A+Y-X,ae=Ar(f?Ki(F,A+J-X-pe):F,A,f?eo(R,oe):R);C[x]=ae,D[x]=ae-A}if(l){var se,be=x==="x"?ct:nt,Fe=x==="x"?St:Et,Me=C[w],Ne=w==="y"?"height":"width",de=Me+v[be],me=Me-v[Fe],at=[ct,nt].indexOf(b)!==-1,Le=(se=T==null?void 0:T[w])!=null?se:0,_e=at?de:Me-S[Ne]-E[Ne]-Le+N.altAxis,ie=at?Me+S[Ne]+E[Ne]-Le-N.altAxis:me,Wn=f&&at?function(Qt,oO,ru){var A0=Ar(Qt,oO,ru);return A0>ru?ru:A0}(_e,Me,ie):Ar(f?_e:de,Me,f?ie:me);C[w]=Wn,D[w]=Wn-Me}e.modifiersData[o]=D}},requiresIfExists:["offset"]};function zk(t,e,n){n===void 0&&(n=!1);var o,i,s=Mt(e),a=Mt(e)&&function(p){var h=p.getBoundingClientRect(),f=zo(h.width)/p.offsetWidth||1,m=zo(h.height)/p.offsetHeight||1;return f!==1||m!==1}(e),l=kn(e),c=Fo(t,a,n),d={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(s||!s&&!n)&&((jt(e)!=="body"||Nl(l))&&(d=(o=e)!==gt(o)&&Mt(o)?{scrollLeft:(i=o).scrollLeft,scrollTop:i.scrollTop}:El(o)),Mt(e)?((u=Fo(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):l&&(u.x=Ml(l))),{x:c.left+d.scrollLeft-u.x,y:c.top+d.scrollTop-u.y,width:c.width,height:c.height}}function Fk(t){var e=new Map,n=new Set,o=[];function i(s){n.add(s.name),[].concat(s.requires||[],s.requiresIfExists||[]).forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&i(l)}}),o.push(s)}return t.forEach(function(s){e.set(s.name,s)}),t.forEach(function(s){n.has(s.name)||i(s)}),o}var ch={placement:"bottom",modifiers:[],strategy:"absolute"};function dh(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function jk(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,o=n===void 0?[]:n,i=e.defaultOptions,s=i===void 0?ch:i;return function(a,l,c){c===void 0&&(c=s);var d,u,p={placement:"bottom",orderedModifiers:[],options:Object.assign({},ch,s),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},h=[],f=!1,m={state:p,setOptions:function(v){var b=typeof v=="function"?v(p.options):v;g(),p.options=Object.assign({},s,p.options,b),p.scrollParents={reference:Zn(a)?Dr(a):a.contextElement?Dr(a.contextElement):[],popper:Dr(l)};var y=function(k){var x=Fk(k);return Ok.reduce(function(w,C){return w.concat(x.filter(function(S){return S.phase===C}))},[])}(function(k){var x=k.reduce(function(w,C){var S=w[C.name];return w[C.name]=S?Object.assign({},S,C,{options:Object.assign({},S.options,C.options),data:Object.assign({},S.data,C.data)}):C,w},{});return Object.keys(x).map(function(w){return x[w]})}([].concat(o,p.options.modifiers)));return p.orderedModifiers=y.filter(function(k){return k.enabled}),p.orderedModifiers.forEach(function(k){var x=k.name,w=k.options,C=w===void 0?{}:w,S=k.effect;if(typeof S=="function"){var E=S({state:p,name:x,instance:m,options:C});h.push(E||function(){})}}),m.update()},forceUpdate:function(){if(!f){var v=p.elements,b=v.reference,y=v.popper;if(dh(b,y)){p.rects={reference:zk(b,Vr(y),p.options.strategy==="fixed"),popper:Cl(y)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(M){return p.modifiersData[M.name]=Object.assign({},M.data)});for(var k=0;k<p.orderedModifiers.length;k++)if(p.reset!==!0){var x=p.orderedModifiers[k],w=x.fn,C=x.options,S=C===void 0?{}:C,E=x.name;typeof w=="function"&&(p=w({state:p,options:S,name:E,instance:m})||p)}else p.reset=!1,k=-1}}},update:(d=function(){return new Promise(function(v){m.forceUpdate(),v(p)})},function(){return u||(u=new Promise(function(v){Promise.resolve().then(function(){u=void 0,v(d())})})),u}),destroy:function(){g(),f=!0}};if(!dh(a,l))return m;function g(){h.forEach(function(v){return v()}),h=[]}return m.setOptions(c).then(function(v){!f&&c.onFirstUpdate&&c.onFirstUpdate(v)}),m}}var Hk=jk({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,o=t.options,i=o.scroll,s=i===void 0||i,a=o.resize,l=a===void 0||a,c=gt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&d.forEach(function(u){u.addEventListener("scroll",n.update,qi)}),l&&c.addEventListener("resize",n.update,qi),function(){s&&d.forEach(function(u){u.removeEventListener("scroll",n.update,qi)}),l&&c.removeEventListener("resize",n.update,qi)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=sh({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,o=n.gpuAcceleration,i=o===void 0||o,s=n.adaptive,a=s===void 0||s,l=n.roundOffsets,c=l===void 0||l,d={placement:Ht(e.placement),variation:jo(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,nh(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,nh(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},_k,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,o=t.name,i=n.offset,s=i===void 0?[0,0]:i,a=Yp.reduce(function(u,p){return u[p]=function(h,f,m){var g=Ht(h),v=[nt,ct].indexOf(g)>=0?-1:1,b=typeof m=="function"?m(Object.assign({},f,{placement:h})):m,y=b[0],k=b[1];return y=y||0,k=(k||0)*v,[nt,Et].indexOf(g)>=0?{x:k,y}:{x:y,y:k}}(p,e.rects,s),u},{}),l=a[e.placement],c=l.x,d=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=d),e.modifiersData[o]=a}},$k,Pk,Ak,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,o=e.rects.reference,i=e.rects.popper,s=e.modifiersData.preventOverflow,a=Ir(e,{elementContext:"reference"}),l=Ir(e,{altBoundary:!0}),c=ah(a,o),d=ah(l,i,s),u=lh(c),p=lh(d);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}}]});const uh="mc-popper",Wk={key:0,id:"arrow",class:"mc-popper-arrow","data-popper-arrow":""},Gi=ee(q(r.defineComponent({name:uh,__name:"mc-popper",props:{content:{},trigger:{default:"hover"},placement:{default:"top"},disabled:{type:Boolean},popperOptions:{},showTimeout:{default:0},hideTimeout:{default:300},transitionName:{default:"fade"},showArrow:{type:Boolean,default:!0}},emits:["visible:change","click:outside"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref({}),a=r.ref({}),l=r.ref({}),c=r.ref(),d=r.ref(),u=r.ref(),p=r.ref(!1),h=w=>{o.disabled&&(w=!1),p.value=w,i("visible:change",w)},f=r.computed(()=>({placement:o.placement,modifiers:[{name:"offset",options:{offset:[0,8]}}],...o.popperOptions}));let m,g,v;r.watch(p,w=>{w&&d.value&&u.value&&(m=Hk(d.value,u.value,f.value))},{flush:"post"}),r.onUnmounted(()=>{ye(m)||(m.destroy(),m=void 0)});const b=r.computed(()=>o.trigger==="hover"?o.showTimeout:0),y=r.computed(()=>o.trigger==="hover"?o.hideTimeout:0);r.watchEffect(()=>{s.value={},a.value={},l.value={},o.disabled?x(!1):o.trigger==="click"?s.value.click=()=>{p.value?x():k()}:o.trigger==="hover"&&(s.value.mouseenter=()=>k(),a.value.mouseleave=()=>x(),l.value.mouseenter=()=>k()),g=$i(Ai(h,null,!0),b.value),v=$i(Ai(h,null,!1),y.value)});const k=(w=!0)=>{v==null||v.cancel(),w?g==null||g():h(!0)},x=(w=!0)=>{g==null||g.cancel(),w?v==null||v():h(!1)};return Hi(c,()=>{i("click:outside"),o.trigger==="click"&&p.value&&x(!1)}),e({show:()=>k(!1),hide:()=>x(!1)}),(w,C)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({class:"mc-popper",ref_key:"containerNode",ref:c},r.toHandlers(a.value,!0)),[r.createElementVNode("div",r.mergeProps({class:"mc-popper-trigger",ref_key:"triggerNode",ref:d},r.toHandlers(s.value,!0)),[r.renderSlot(w.$slots,"default",{},void 0,!0)],16),r.createVNode(r.Transition,{name:t.transitionName},{default:r.withCtx(()=>[p.value?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,class:"mc-popper-popper",ref_key:"popperNode",ref:u},r.toHandlers(l.value,!0)),[r.renderSlot(w.$slots,"content",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0),t.showArrow?(r.openBlock(),r.createElementBlock("div",Wk)):r.createCommentVNode("",!0)],16)):r.createCommentVNode("",!0)]),_:3},8,["name"])],16))}}),[["__scopeId","data-v-b21e38ee"]])),ph="mc-tooltip",Kk={class:"mc-tooltip"},Ho=ee(q(r.defineComponent({name:ph,__name:"mc-tooltip",props:{iconSize:{default:24},iconName:{default:"Info"},content:{},theme:{default:"light"},placement:{default:"top"},showArrow:{type:Boolean,default:!0},iconColor:{},trigger:{default:"hover"}},setup(t,{expose:e}){const n=r.computed(()=>({strategy:"fixed"})),o=r.ref();return e({hide:()=>{var i;return(i=o.value)==null?void 0:i.hide()},show:()=>{var i;return(i=o.value)==null?void 0:i.show()}}),(i,s)=>(r.openBlock(),r.createElementBlock("div",Kk,[r.createVNode(r.unref(Gi),{ref_key:"popperRef",ref:o,placement:t.placement,"show-arrow":t.showArrow,"popper-options":n.value,trigger:t.trigger},{content:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["mc-tooltip-content",`mc-tooltip-content-${t.theme}`])},[r.renderSlot(i.$slots,"content",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0)],2)]),default:r.withCtx(()=>[r.renderSlot(i.$slots,"default",{},()=>[r.createVNode(r.unref(ge),{class:"mc-tooltip-icon",name:t.iconName,size:t.iconSize,color:t.iconColor},null,8,["name","size","color"])],!0)]),_:3},8,["placement","show-arrow","popper-options","trigger"])]))}}),[["__scopeId","data-v-a76a6974"]])),Uk={class:"mc-form"},hh=ee(q(r.defineComponent({name:zp,__name:"mc-form",props:{model:{default:()=>({})},modelValue:{},rules:{default:()=>({})},disabled:{type:Boolean},direction:{default:"vertical"},scrollToError:{type:Boolean,default:!1}},emits:["update:modelValue","reset"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=new Map,a=d=>{if(ce(d)){if(Be(d))return Array.from(s.values());{const u=[];return Pi(d,p=>{const h=s.get(p);h&&u.push(h)}),u}}return s.get(d)},l=async(d=[],u,p=!0)=>{try{return p&&c(),await(async(f,m)=>{const g=a(f);if(Be(g))return m==null||m(!0),!0;try{return await(async v=>{const b=[];for(const y of v)try{await y.validate()}catch(k){b.push(k)}return!sl(b)||Promise.reject(b)})(ce(g)?g:[g]),m==null||m(!0),!0}catch(v){if(v instanceof Error)throw v;const b=v;return m==null||m(!1,b),Promise.reject(b)}})(d,u)}catch(h){return o.scrollToError&&(async f=>{const m=vn(Ep(f))[0],g=a(m);if(Be(g))return;const v=g.id;if(!v.size)return;const b=Ep(Array.from(v));if(!b)return;const y=document.getElementById(b);y==null||y.scrollIntoView({block:"center",inline:"center",behavior:"smooth"}),await cl(500),y==null||y.focus()})(h),Promise.reject(h)}},c=(d=[])=>{const u=a(d);Be(u)||(ce(u)?Pi(u,p=>p.clearValidate()):u.clearValidate())};return r.provide(Ro,{model:r.computed(()=>ye(o.modelValue)?o.model:o.modelValue),rules:r.computed(()=>o.rules),disabled:r.computed(()=>!!o.disabled),direction:r.computed(()=>o.direction),addFormItem:d=>{Be(d.prop)||s.set(d.prop,d)},removeFormItem:d=>{Be(d.prop)||s.delete(d.prop)}}),e({validate:l,validateFields:async(d,u)=>l(d,u,!1),resetFields:async(d=[])=>{const u=a(d);if(Be(u))return;const p={};ce(u)?Pi(u,h=>{p[h.prop]=h.getInitialValue()}):p[u.prop]=u.getInitialValue(),await r.nextTick(),i("reset",p),i("update:modelValue",p),await r.nextTick(),c(d)},clearValidate:c}),(d,u)=>(r.openBlock(),r.createElementBlock("div",Uk,[r.createElementVNode("form",{onSubmit:u[0]||(u[0]=r.withModifiers(()=>{},["prevent"]))},[r.renderSlot(d.$slots,"default",{},void 0,!0)],32)]))}}),[["__scopeId","data-v-70bd19cc"]])),Tl=Symbol("mc-form-item-context"),fh="mc-form-item",qk={class:"mc-form-item-label-wrapper"},Jk={key:0,class:"mc-form-item-label"},Gk={key:0,class:"mc-form-item-help"},Yk={key:0,class:"mc-form-item-desc"},Xk={class:"mc-form-item__content"},Qk={key:0,class:"mc-form-item__error"},Zk=r.defineComponent({name:fh,__name:"mc-form-item",props:{prop:{default:""},label:{},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},rules:{},help:{},desc:{}},setup(t){const e=t,n=r.reactive(new Map),o=r.reactive(new Map),i=r.computed(()=>o.values().next().value),s=r.inject(Ro,void 0),{addFormId:a,removeFormId:l}=(v=>{const b=r.inject(Ro,void 0),y=new Map,k=ue("prop"),x=()=>{if(ye(k.value))return;const C=ce(k.value)?k.value:[k.value];for(const S of C){const E=v(S);y.set(S,E),b==null||b.addFormItem(E)}},w=()=>{for(const C of y.values())b==null||b.removeFormItem(C)};return r.onBeforeMount(()=>{x()}),r.onBeforeUnmount(()=>{w()}),r.watch(()=>k.value,C=>{w(),Be(C)||x()},{deep:!0}),{formItemInstances:y,addFormId:(C,S)=>{const E=y.get(C);E&&E.id.add(S)},removeFormId:(C,S)=>{const E=y.get(C);E&&E.id.delete(S)}}})(v=>(n.set(v,"init"),{prop:v,id:new Set,validate:c(v),getInitialValue:d(v),clearValidate:h})),c=v=>async(b,y)=>f(v,b,y),d=v=>()=>{const b=s==null?void 0:s.model.value;if(!ye(b))return u(v)},{getInitialValue:u}=(()=>{const v=r.inject(Ro,void 0),b=ue("prop"),y=new Map,k=x=>{const w=v==null?void 0:v.model.value;if(ye(x)||Be(x))y.clear();else if(ce(x))for(const C of x)y.set(C,Oo(w,C));else y.set(x,Oo(w,x))};return r.onMounted(()=>{k(b.value)}),r.watch(()=>b.value,x=>{k(x)}),{getInitialValue:x=>{if(!ye(x))return Ii(y.get(x),5)}}})();let p=!1;const h=()=>{for(const v of n.keys())n.set(v,"init");for(const v of o.keys())o.delete(v);p=!1},f=async(v,b,y)=>{if(p||e.disabled)return Promise.resolve(!0);const k=(C=>{const S=[],E=!!e.required;E&&S.push({required:!0}),e.rules&&S.push(...e.rules);const M=s==null?void 0:s.rules.value;if(M){const N=Oo(M,C);N&&S.push(...N)}if(E){const N=Cr(bn(S,(T,D)=>[T,D]),T=>Ct(vn(T[0]),"required"));if(sl(N))for(const T of N){const[D,$]=T;D.required!==E&&(S[$]={...D,required:E})}else S.push({required:E})}return S})(v),x=((C,S)=>Cr(C,E=>!(!E.trigger&&S&&S!=="change")&&(!E.trigger||!S||(ce(E.trigger)?Ct(E.trigger,S):E.trigger===S))).map(({trigger:E,...M})=>M))(k,b);if(Be(x))return y==null||y(!0),Promise.resolve(!0);n.set(v,"validating");const w=((C,S)=>{const E=new Br({[C]:S}),M=s==null?void 0:s.model.value;return E.validate({[C]:Oo(M,C)},{firstFields:!0})})(v,x);try{return await w,n.set(v,"success"),o.delete(v),y==null||y(!0),Promise.resolve(!0)}catch(C){const{errors:S,fields:E}=C;n.set(v,"error");const M=S&&sl(S)>0?S[0].message??"":"";return o.set(v,M),y==null||y(!1,E),Promise.reject(E)}},m=r.computed(()=>(s==null?void 0:s.direction.value)==="horizontal"),g=r.computed(()=>{var k;if(e.required)return!0;if((k=e.rules)!=null&&k.length)return al(e.rules,x=>!!x.required);const v=s==null?void 0:s.rules.value,b=ce(e.prop)?e.prop:[e.prop],y=[];for(const x of b){const w=Oo(v,x);w&&y.push(...w)}return al(y,x=>!!x.required)});return r.provide(Tl,{disabled:r.computed(()=>e.disabled),validateStatus:n,prop:r.computed(()=>e.prop),addFormId:a,removeFormId:l,validate:f}),(v,b)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-form-item",{"mc-form-item-horizontal":m.value}])},[r.renderSlot(v.$slots,"label",{required:g.value},()=>[r.createElementVNode("div",null,[r.createElementVNode("div",qk,[t.label?(r.openBlock(),r.createElementBlock("label",Jk,[r.createElementVNode("span",{class:r.normalizeClass(["mc-form-item-lable-text",{"mc-form-item-label-required":g.value}])},r.toDisplayString(t.label),3),t.help||v.$slots.help?(r.openBlock(),r.createElementBlock("div",Gk,[r.renderSlot(v.$slots,"help",{},()=>[r.createVNode(r.unref(Ho),{content:t.help,"icon-size":20},null,8,["content"])],!0)])):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.renderSlot(v.$slots,"tool",{},void 0,!0)]),t.desc||v.$slots.desc?(r.openBlock(),r.createElementBlock("div",Yk,[r.renderSlot(v.$slots,"desc",{},()=>[r.createTextVNode(r.toDisplayString(t.desc),1)],!0)])):r.createCommentVNode("",!0)])],!0),r.createElementVNode("div",Xk,[r.renderSlot(v.$slots,"default",{},void 0,!0),r.createVNode(r.Transition,{name:"mc-form-item-error"},{default:r.withCtx(()=>[i.value?(r.openBlock(),r.createElementBlock("div",Qk,r.toDisplayString(i.value),1)):r.createCommentVNode("",!0)]),_:1})])],2))}}),mh=ee(q(Zk,[["__scopeId","data-v-c3eae309"]])),Nt=({externalId:t,externalDisabled:e,disableValidation:n,validator:o}={})=>{const i=ue(["disableValidation","disable-validation"]),s=ue(["validateProp","validate-prop"]),a=r.computed(()=>!!i.value||!!(n!=null&&n.value)),{formCtx:l,formItemCtx:c,formId:d,formDisabled:u}=(({externalId:x,externalDisabled:w}={})=>{const C=r.inject(Ro,void 0),S=r.inject(Tl,void 0),E=ue(["validateProp","validate-prop"]),M=(D=>{const $=ue("id");if($.value)return $.value;{const B=((V=10)=>String(Date.now()).slice(-V))();return D?`${D}-${B}`:B}})((x==null?void 0:x.value)??"mc-form-item");r.onMounted(()=>{N()}),r.onBeforeUnmount(()=>{N("remove")});const N=(D="add")=>{const $=E.value;if($)D==="add"?S==null||S.addFormId($,M):S==null||S.removeFormId($,M);else{const B=S==null?void 0:S.prop.value;if(Be(B))return;const V=ce(B)?B:[B];for(const O of V)D==="add"?O&&(S==null||S.addFormId(O,M)):O&&(S==null||S.removeFormId(O,M))}},T=(({formCtx:D,formItemCtx:$,externalDisabled:B})=>{const V=ue("disabled");return r.computed(()=>V.value||!!(D!=null&&D.disabled.value)||!!($!=null&&$.disabled.value)||!!(B!=null&&B.value))})({formCtx:C,formItemCtx:S,externalDisabled:w});return{formCtx:C,formItemCtx:S,formId:M,formDisabled:T}})({externalId:t,externalDisabled:e}),p=r.computed(()=>{if(a.value)return"init";if(He(o)&&o()==="error")return"error";const x=c==null?void 0:c.validateStatus;return x!=null&&x.size?s.value?x.get(s.value)||"init":x.values().next().value||"init":"init"}),h=r.computed(()=>a.value?"":`mc-form-validate-${p.value}`),f=r.computed(()=>!a.value&&p.value==="error"),m=r.computed(()=>!a.value&&p.value==="success"),g=ue(["hideValidationIcon","hide-validation-icon"]),v=r.computed(()=>!a.value&&!g.value&&(f.value?"Reject_02":!!m.value&&"Accept_02")),b=ue("modelValue"),y=x=>Sr(x)?ye(x):Be(x);r.watch(()=>b.value,(x,w)=>{y(x)&&y(w)||k("change")});const k=async x=>{if(!a.value)try{if(s.value)await(c==null?void 0:c.validate(s.value,x));else{const w=c==null?void 0:c.prop.value;if(w){const C=ce(w)?w:[w],S=[];for(const E of C)S.push(c==null?void 0:c.validate(E,x));await Promise.all(S)}}}catch(w){console.error("[mc-form] validate error: ",w)}};return{formCtx:l,formItemCtx:c,formId:d,formDisabled:u,validateStatus:p,validateStyle:h,isError:f,isSuccess:m,statusIcon:v,validateByTrigger:k}},gh="mc-checkbox",Ol=Symbol("mc-checkbox-group-context"),vh="mc-checkbox-group",ew={class:"mc-checkbox"},tw=["id","value","disabled","onKeypress"],nw={key:0,class:"mc-checkbox-content"},ow={key:0,class:"mc-checkbox-remarks"},rw=r.defineComponent({name:gh,__name:"mc-checkbox",props:{modelValue:{type:Boolean},disabled:{type:Boolean},content:{},remarks:{},partial:{type:Boolean},value:{},disableValidation:{type:Boolean,default:!1},hideValidationIcon:{type:Boolean}},emits:["update:modelValue","change","focus","blur"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(),{wrapperRef:s,isFocused:a,handleFocus:l,handleBlur:c}=Xn(i),{checkboxGroupCtx:d,checkboxGroupDisabled:u,isCheckboxGroup:p,isCheckboxSelected:h,handleCheckboxSelect:f}=(()=>{const x=r.inject(Ol,void 0),w=r.computed(()=>{var S;return!!((S=x==null?void 0:x.disabled)!=null&&S.value)}),C=r.computed(()=>!!x&&He(x==null?void 0:x.handleSelect));return{checkboxGroupCtx:x,checkboxGroupDisabled:w,isCheckboxGroup:C,isCheckboxSelected:S=>{var E;return!ye(S)&&Ct((E=x==null?void 0:x.modelValue)==null?void 0:E.value,S)},handleCheckboxSelect:S=>{x==null||x.handleSelect(S)}}})(),{formId:m,formDisabled:g,validateStyle:v,validateByTrigger:b}=Nt({externalDisabled:u,disableValidation:d==null?void 0:d.disableValidation}),y=r.computed(()=>p.value?h(n.value):!!n.modelValue),k=async()=>{g.value||(p.value?f(n.value):(o("update:modelValue",!n.modelValue),o("change",!n.modelValue),await r.nextTick(),b("input")))};return(x,w)=>(r.openBlock(),r.createElementBlock("div",ew,[r.createElementVNode("label",{ref_key:"checkboxRef",ref:s,class:r.normalizeClass(["mc-checkbox-wrapper",{"mc-checkbox-disabled":r.unref(g),"mc-checkbox-checked":y.value,"mc-checkbox-partial":t.partial,"mc-checkbox-focused":r.unref(a),[r.unref(v)]:r.unref(v)}]),onClick:r.withModifiers(k,["prevent"])},[r.createElementVNode("input",{ref_key:"checkboxInputRef",ref:i,id:r.unref(m),type:"checkbox",class:"mc-checkbox-input",value:y.value,disabled:r.unref(g),onKeypress:r.withKeys(r.withModifiers(k,["prevent","stop"]),["enter"]),onFocus:w[0]||(w[0]=(...C)=>r.unref(l)&&r.unref(l)(...C)),onBlur:w[1]||(w[1]=(...C)=>r.unref(c)&&r.unref(c)(...C))},null,40,tw),w[2]||(w[2]=r.createElementVNode("div",{class:"mc-checkbox-box"},null,-1)),t.content||x.$slots.default?(r.openBlock(),r.createElementBlock("div",nw,[r.renderSlot(x.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0)])):r.createCommentVNode("",!0)],2),t.remarks||x.$slots.remarks?(r.openBlock(),r.createElementBlock("div",ow,[r.renderSlot(x.$slots,"remarks",{},()=>[r.createTextVNode(r.toDisplayString(t.remarks),1)],!0)])):r.createCommentVNode("",!0)]))}}),Wo=ee(q(rw,[["__scopeId","data-v-9c2e6378"]])),iw=["id"],yh=ee(r.defineComponent({name:vh,__name:"mc-checkbox-group",props:{modelValue:{default:()=>[]},disabled:{type:Boolean,default:!1},disableValidation:{type:Boolean},hideValidationIcon:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,{formId:i,validateByTrigger:s}=Nt();return r.provide(Ol,{modelValue:r.computed(()=>n.modelValue),disabled:r.computed(()=>n.disabled),disableValidation:r.computed(()=>!!n.disableValidation),handleSelect:async a=>{if(!a)return;const l=[...n.modelValue],c=(u=a,(d=l)!=null&&d.length?Da(d,u,0):-1);var d,u;c>-1?l.splice(c,1):l.push(a),o("update:modelValue",l),o("change",l),await r.nextTick(),s("input")}}),(a,l)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-checkbox-group",id:r.unref(i)},[r.renderSlot(a.$slots,"default")],8,iw))}})),_l=Symbol("mc-collapse-context"),bh="mc-collapse",sw={class:"mc-collapse"},kh=ee(q(r.defineComponent({name:bh,__name:"mc-collapse",props:{modelValue:{default:()=>[]},accordion:{type:Boolean,default:!1},transition:{type:Boolean,default:!1},destroyOnHide:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e;return r.watchEffect(()=>{n.accordion&&n.modelValue.length}),r.provide(_l,{activeNames:r.computed(()=>n.modelValue),transition:r.computed(()=>n.transition),destroyOnHide:r.computed(()=>n.destroyOnHide),handleItemClick:i=>{let s=[...n.modelValue??[]];if(n.accordion)s=[s[0]===i?"":i];else{const a=s.indexOf(i);a>-1?s.splice(a,1):s.push(i)}o("update:modelValue",s),o("change",s)}}),(i,s)=>(r.openBlock(),r.createElementBlock("div",sw,[r.renderSlot(i.$slots,"default",{},void 0,!0)]))}}),[["__scopeId","data-v-0935b3b5"]])),wh="mc-icon-plus",aw=r.defineComponent({name:wh,__name:"mc-icon-plus",props:{name:{},size:{default:24},width:{},height:{},color:{},cursor:{default:"inherit"}},emits:["click"],setup(t,{emit:e}){const n=t,o=e,{width:i,height:s}=lt(),a=r.computed(()=>n.width?i.value:`${n.size}px`),l=r.computed(()=>n.height?s.value:`${n.size}px`),c=()=>{o("click",n.name)};return(d,u)=>(r.openBlock(),r.createElementBlock("span",{class:"mc-icon-plus",style:r.normalizeStyle({fontSize:`${t.size}px`,width:a.value,height:l.value,color:t.color,cursor:t.cursor}),onClick:c},[r.createElementVNode("i",{class:r.normalizeClass(["mc-iconfont-plus",`mc-icon-plus-${t.name}`])},null,2)],4))}}),xh=q(aw,[["__scopeId","data-v-73d0e9a6"]]),Ee=ee(xh),Ch="mc-collapse-item",lw={class:"mc-collapse-item-header"},cw={class:"mc-collapse-item-title"},dw={key:0,class:"mc-collapse-item-content"},uw=r.defineComponent({name:Ch,__name:"mc-collapse-item",props:{name:{},title:{},disabled:{type:Boolean}},setup(t){const e=r.inject(_l,void 0),n=r.computed(()=>{var l;return!!((l=e==null?void 0:e.activeNames.value)!=null&&l.includes(t.name))}),o=r.computed(()=>!!(e!=null&&e.transition.value)),i=r.computed(()=>!!(e!=null&&e.destroyOnHide.value)),s=r.computed(()=>!i.value||n.value),a=()=>{t.disabled||(e==null||e.handleItemClick(t.name))};return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-collapse-item",onClick:a},[r.createElementVNode("div",lw,[r.createElementVNode("span",cw,[r.renderSlot(l.$slots,"title",{isActive:n.value},()=>[r.createTextVNode(r.toDisplayString(t.title),1)],!0)]),r.createElementVNode("span",{class:r.normalizeClass(["triangle-icon",{"triangle-icon-active":n.value}])},[r.createVNode(r.unref(Ee),{name:"up-chevron",cursor:"pointer"})],2)]),r.createVNode(r.Transition,{name:"mc-collapse-item-content-"+(o.value?"transition":"no-transition")},{default:r.withCtx(()=>[s.value?r.withDirectives((r.openBlock(),r.createElementBlock("div",dw,[r.renderSlot(l.$slots,"default",{isActive:n.value},void 0,!0)],512)),[[r.vShow,n.value]]):r.createCommentVNode("",!0)]),_:3},8,["name"])]))}}),Sh=ee(q(uw,[["__scopeId","data-v-c9afe7eb"]])),Eh="mc-toast",pw={key:0,class:"mc-toast-msg-icon"},hw={key:1,class:"mc-toast-msg-text"},fw={class:"mc-toast-msg-close-container"},mw={key:0,class:"mc-toast-countdown"},gw={key:1,class:"mc-toast-msg-close"},vw={key:0,class:"mc-toast-content-container"},Mh=q(r.defineComponent({name:Eh,__name:"mc-toast",props:{type:{default:"info"},message:{},content:{},closable:{type:Boolean,default:!0},autoClose:{type:Boolean,default:!0},duration:{default:void 0},hideIcon:{type:Boolean,default:!1},countDownIcon:{type:Boolean,default:!0},width:{},onClose:{}},emits:["close"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.computed(()=>{if(!o.hideIcon)switch(o.type){case"success":return"Accept_02";case"error":return"Error_04";case"warning":return"Error_02";case"info":return"Info_02";default:return}}),a=r.computed(()=>o.countDownIcon&&!!o.duration),l=r.computed(()=>o.duration||3e3),c=r.ref(Math.floor(l.value/1e3));let d=null;o.autoClose&&(d=setInterval(()=>{c.value>0?c.value--:u()},1e3));const u=()=>{p(),i("close")},p=()=>{d&&clearInterval(d)};return r.onUnmounted(()=>{p()}),e({close:u}),(h,f)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-toast",[`mc-toast-${t.type}`]]),style:r.normalizeStyle({width:t.width})},[r.createElementVNode("div",{class:r.normalizeClass(["mc-toast-msg-container",{"mc-toast-has-content":t.content||h.$slots.content}])},[s.value?(r.openBlock(),r.createElementBlock("div",pw,[r.createVNode(r.unref(ge),{name:s.value},null,8,["name"])])):r.createCommentVNode("",!0),t.message||h.$slots.default?(r.openBlock(),r.createElementBlock("div",hw,[r.renderSlot(h.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.message),1)],!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",fw,[a.value?(r.openBlock(),r.createElementBlock("div",mw,r.toDisplayString(c.value),1)):r.createCommentVNode("",!0),t.closable?(r.openBlock(),r.createElementBlock("div",gw,[r.createVNode(r.unref(ge),{name:"Cross",onClick:u})])):r.createCommentVNode("",!0)])],2),t.content||h.$slots.content?(r.openBlock(),r.createElementBlock("div",vw,[r.renderSlot(h.$slots,"content",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0)])):r.createCommentVNode("",!0)],6))}}),[["__scopeId","data-v-db24a98f"]]),on=[];let Ie=null;const Yi=t=>{let e={};e=typeof t=="string"?{message:t}:{...t},e.type=e.type||"info",e.autoClose=e.autoClose!==!1,e.closable=e.closable!==!1,on.length>=5&&on.length>0&&on[0].close();const n=Ie||(Ie=document.createElement("div"),Ie.className="mc-toast-container",Ie.style.position="fixed",Ie.style.top="5vh",Ie.style.left="50%",Ie.style.transform="translateX(-50%)",Ie.style.zIndex="9999",Ie.style.display="flex",Ie.style.flexDirection="column",Ie.style.gap="12px",Ie.style.pointerEvents="none",document.body.appendChild(Ie),Ie),o=document.createElement("div");o.style.pointerEvents="auto",o.style.animation="toast-slide-in 0.3s ease-out";const i=Date.now().toString(36)+Math.random().toString(36).slice(2),s=r.createVNode(Mh,{...e,onClose:()=>{o.style.animation="toast-slide-out 0.3s ease-in",e.onClose&&e.onClose(),setTimeout(()=>{(l=>{const c=on.findIndex(d=>d.id===l);if(c!==-1){const d=on[c];r.render(null,d.wrapper),Ie&&Ie.contains(d.wrapper)&&Ie.removeChild(d.wrapper),on.splice(c,1),Ie&&document.body.contains(Ie)&&on.length===0&&(document.body.removeChild(Ie),Ie=null)}})(i)},300)}});r.render(s,o),n.appendChild(o);const a={id:i,wrapper:o,close:()=>{var c;const l=s.component;l&&l.exposed&&((c=l.exposed)==null||c.close())}};return on.push(a),{...a}},Xi={success:t=>Yi(typeof t=="string"?{message:t,type:"success"}:{...t,type:"success"}),error:t=>Yi(typeof t=="string"?{message:t,type:"error"}:{...t,type:"error"}),warning:t=>Yi(typeof t=="string"?{message:t,type:"warning"}:{...t,type:"warning"}),info:t=>Yi(typeof t=="string"?{message:t,type:"info"}:{...t,type:"info"}),closeAll:()=>{on.forEach(t=>{t.close()})}};(()=>{if(document.getElementById("mc-toast-v2-styles"))return;const t=document.createElement("style");t.id="mc-toast-v2-styles",t.textContent=`
14
+ `).replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),a=new RegExp("(?:^"+o+"$)|(?:^"+s+"$)"),l=new RegExp("^"+o+"$"),c=new RegExp("^"+s+"$"),d=function(h){return h&&h.exact?a:new RegExp("(?:"+n(h)+o+n(h)+")|(?:"+n(h)+s+n(h)+")","g")};d.v4=function(h){return h&&h.exact?l:new RegExp(""+n(h)+o+n(h),"g")},d.v6=function(h){return h&&h.exact?c:new RegExp(""+n(h)+s+n(h),"g")};var u=d.v4().source,p=d.v6().source;return gl=new RegExp("(?:^(?:(?:(?:[a-z]+:)?//)|www\\.)(?:\\S+(?::\\S*)?@)?(?:localhost|"+u+"|"+p+'|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:[/?#][^\\s"]*)?$)',"i")}())},hex:function(t){return typeof t=="string"&&!!t.match(Tk)}},Lo="enum",tt=Up,At=function(t,e,n,o,i){if(t.required&&e===void 0)Up(t,e,n,o,i);else{var s=t.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(s)>-1?Mr[s](e)||o.push(mt(i.messages.types[s],t.fullField,t.type)):s&&typeof e!==t.type&&o.push(mt(i.messages.types[s],t.fullField,t.type))}},$o=function(t,e,n,o,i){var s=typeof t.len=="number",a=typeof t.min=="number",l=typeof t.max=="number",c=e,d=null,u=typeof e=="number",p=typeof e=="string",h=Array.isArray(e);if(u?d="number":p?d="string":h&&(d="array"),!d)return!1;h&&(c=e.length),p&&(c=e.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),s?c!==t.len&&o.push(mt(i.messages[d].len,t.fullField,t.len)):a&&!l&&c<t.min?o.push(mt(i.messages[d].min,t.fullField,t.min)):l&&!a&&c>t.max?o.push(mt(i.messages[d].max,t.fullField,t.max)):a&&l&&(c<t.min||c>t.max)&&o.push(mt(i.messages[d].range,t.fullField,t.min,t.max))},qp=function(t,e,n,o,i){t.pattern&&(t.pattern instanceof RegExp?(t.pattern.lastIndex=0,t.pattern.test(e)||o.push(mt(i.messages.pattern.mismatch,t.fullField,e,t.pattern))):typeof t.pattern=="string"&&(new RegExp(t.pattern).test(e)||o.push(mt(i.messages.pattern.mismatch,t.fullField,e,t.pattern))))},vl=function(t,e,n,o,i){var s=t.type,a=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e,s)&&!t.required)return n();tt(t,e,o,a,i,s),je(e,s)||At(t,e,o,a,i)}n(a)},Nr={string:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e,"string")&&!t.required)return n();tt(t,e,o,s,i,"string"),je(e,"string")||(At(t,e,o,s,i),$o(t,e,0,s,i),qp(t,e,0,s,i),t.whitespace===!0&&function(a,l,c,d,u){(/^\s+$/.test(l)||l==="")&&d.push(mt(u.messages.whitespace,a.fullField))}(t,e,0,s,i))}n(s)},method:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e)&&!t.required)return n();tt(t,e,o,s,i),e!==void 0&&At(t,e,o,s,i)}n(s)},number:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(e===""&&(e=void 0),je(e)&&!t.required)return n();tt(t,e,o,s,i),e!==void 0&&(At(t,e,o,s,i),$o(t,e,0,s,i))}n(s)},boolean:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e)&&!t.required)return n();tt(t,e,o,s,i),e!==void 0&&At(t,e,o,s,i)}n(s)},regexp:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e)&&!t.required)return n();tt(t,e,o,s,i),je(e)||At(t,e,o,s,i)}n(s)},integer:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e)&&!t.required)return n();tt(t,e,o,s,i),e!==void 0&&(At(t,e,o,s,i),$o(t,e,0,s,i))}n(s)},float:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e)&&!t.required)return n();tt(t,e,o,s,i),e!==void 0&&(At(t,e,o,s,i),$o(t,e,0,s,i))}n(s)},array:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(e==null&&!t.required)return n();tt(t,e,o,s,i,"array"),e!=null&&(At(t,e,o,s,i),$o(t,e,0,s,i))}n(s)},object:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e)&&!t.required)return n();tt(t,e,o,s,i),e!==void 0&&At(t,e,o,s,i)}n(s)},enum:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e)&&!t.required)return n();tt(t,e,o,s,i),e!==void 0&&function(a,l,c,d,u){a[Lo]=Array.isArray(a[Lo])?a[Lo]:[],a[Lo].indexOf(l)===-1&&d.push(mt(u.messages[Lo],a.fullField,a[Lo].join(", ")))}(t,e,0,s,i)}n(s)},pattern:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e,"string")&&!t.required)return n();tt(t,e,o,s,i),je(e,"string")||qp(t,e,0,s,i)}n(s)},date:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e,"date")&&!t.required)return n();var a;tt(t,e,o,s,i),je(e,"date")||(a=e instanceof Date?e:new Date(e),At(t,a,o,s,i),a&&$o(t,a.getTime(),0,s,i))}n(s)},url:vl,hex:vl,email:vl,required:function(t,e,n,o,i){var s=[],a=Array.isArray(e)?"array":typeof e;tt(t,e,o,s,i,a),n(s)},any:function(t,e,n,o,i){var s=[];if(t.required||!t.required&&o.hasOwnProperty(t.field)){if(je(e)&&!t.required)return n();tt(t,e,o,s,i)}n(s)}};function yl(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var bl=yl(),Br=function(){function t(n){this.rules=null,this._messages=bl,this.define(n)}var e=t.prototype;return e.define=function(n){var o=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(typeof n!="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(i){var s=n[i];o.rules[i]=Array.isArray(s)?s:[s]})},e.messages=function(n){return n&&(this._messages=Kp(yl(),n)),this._messages},e.validate=function(n,o,i){var s=this;o===void 0&&(o={}),i===void 0&&(i=function(){});var a=n,l=o,c=i;if(typeof l=="function"&&(c=l,l={}),!this.rules||Object.keys(this.rules).length===0)return c&&c(null,a),Promise.resolve(a);if(l.messages){var d=this.messages();d===bl&&(d=yl()),Kp(d,l.messages),l.messages=d}else l.messages=this.messages();var u={};(l.keys||Object.keys(this.rules)).forEach(function(h){var f=s.rules[h],m=a[h];f.forEach(function(g){var v=g;typeof v.transform=="function"&&(a===n&&(a=Qn({},a)),m=a[h]=v.transform(m)),(v=typeof v=="function"?{validator:v}:Qn({},v)).validator=s.getValidationMethod(v),v.validator&&(v.field=h,v.fullField=v.fullField||h,v.type=s.getType(v),u[h]=u[h]||[],u[h].push({rule:v,value:m,source:a,field:h}))})});var p={};return function(h,f,m,g,v){if(f.first){var b=new Promise(function(E,M){var N=function(T){var A=[];return Object.keys(T).forEach(function($){A.push.apply(A,T[$]||[])}),A}(h);jp(N,m,function(T){return g(T),T.length?M(new Hp(T,ml(T))):E(v)})});return b.catch(function(E){return E}),b}var y=f.firstFields===!0?Object.keys(h):f.firstFields||[],k=Object.keys(h),x=k.length,w=0,C=[],S=new Promise(function(E,M){var N=function(T){if(C.push.apply(C,T),++w===x)return g(C),C.length?M(new Hp(C,ml(C))):E(v)};k.length||(g(C),E(v)),k.forEach(function(T){var A=h[T];y.indexOf(T)!==-1?jp(A,m,N):function($,B,V){var O=[],D=0,F=$.length;function R(L){O.push.apply(O,L||[]),++D===F&&V(O)}$.forEach(function(L){B(L,R)})}(A,m,N)})});return S.catch(function(E){return E}),S}(u,l,function(h,f){var m,g=h.rule,v=!(g.type!=="object"&&g.type!=="array"||typeof g.fields!="object"&&typeof g.defaultField!="object");function b(k,x){return Qn({},x,{fullField:g.fullField+"."+k,fullFields:g.fullFields?[].concat(g.fullFields,[k]):[k]})}function y(k){k===void 0&&(k=[]);var x=Array.isArray(k)?k:[k];!l.suppressWarning&&x.length&&t.warning("async-validator:",x),x.length&&g.message!==void 0&&(x=[].concat(g.message));var w=x.map(Wp(g,a));if(l.first&&w.length)return p[g.field]=1,f(w);if(v){if(g.required&&!h.value)return g.message!==void 0?w=[].concat(g.message).map(Wp(g,a)):l.error&&(w=[l.error(g,mt(l.messages.required,g.field))]),f(w);var C={};g.defaultField&&Object.keys(h.value).map(function(M){C[M]=g.defaultField}),C=Qn({},C,h.rule.fields);var S={};Object.keys(C).forEach(function(M){var N=C[M],T=Array.isArray(N)?N:[N];S[M]=T.map(b.bind(null,M))});var E=new t(S);E.messages(l.messages),h.rule.options&&(h.rule.options.messages=l.messages,h.rule.options.error=l.error),E.validate(h.value,h.rule.options||l,function(M){var N=[];w&&w.length&&N.push.apply(N,w),M&&M.length&&N.push.apply(N,M),f(N.length?N:null)})}else f(w)}if(v=v&&(g.required||!g.required&&h.value),g.field=h.field,g.asyncValidator)m=g.asyncValidator(g,h.value,y,h.source,l);else if(g.validator){try{m=g.validator(g,h.value,y,h.source,l)}catch(k){console.error==null||console.error(k),l.suppressValidatorError||setTimeout(function(){throw k},0),y(k.message)}m===!0?y():m===!1?y(typeof g.message=="function"?g.message(g.fullField||g.field):g.message||(g.fullField||g.field)+" fails"):m instanceof Array?y(m):m instanceof Error&&y(m.message)}m&&m.then&&m.then(function(){return y()},function(k){return y(k)})},function(h){(function(f){var m=[],g={};function v(y){var k;Array.isArray(y)?m=(k=m).concat.apply(k,y):m.push(y)}for(var b=0;b<f.length;b++)v(f[b]);m.length?(g=ml(m),c(m,g)):c(null,a)})(h)},a)},e.getType=function(n){if(n.type===void 0&&n.pattern instanceof RegExp&&(n.type="pattern"),typeof n.validator!="function"&&n.type&&!Nr.hasOwnProperty(n.type))throw new Error(mt("Unknown rule type %s",n.type));return n.type||"string"},e.getValidationMethod=function(n){if(typeof n.validator=="function")return n.validator;var o=Object.keys(n),i=o.indexOf("message");return i!==-1&&o.splice(i,1),o.length===1&&o[0]==="required"?Nr.required:Nr[this.getType(n)]||void 0},t}();Br.register=function(t,e){if(typeof e!="function")throw new Error("Cannot register a validator by type, validator is not a function");Nr[t]=e},Br.warning=Fp,Br.messages=bl,Br.validators=Nr;var ct="top",St="bottom",Et="right",nt="left",kl="auto",Tr=[ct,St,Et,nt],Po="start",Or="end",Jp="viewport",_r="popper",Gp=Tr.reduce(function(t,e){return t.concat([e+"-"+Po,e+"-"+Or])},[]),Yp=[].concat(Tr,[kl]).reduce(function(t,e){return t.concat([e,e+"-"+Po,e+"-"+Or])},[]),Ok=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function jt(t){return t?(t.nodeName||"").toLowerCase():null}function gt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Zn(t){return t instanceof gt(t).Element||t instanceof Element}function Mt(t){return t instanceof gt(t).HTMLElement||t instanceof HTMLElement}function wl(t){return typeof ShadowRoot<"u"&&(t instanceof gt(t).ShadowRoot||t instanceof ShadowRoot)}const _k={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var o=e.styles[n]||{},i=e.attributes[n]||{},s=e.elements[n];Mt(s)&&jt(s)&&(Object.assign(s.style,o),Object.keys(i).forEach(function(a){var l=i[a];l===!1?s.removeAttribute(a):s.setAttribute(a,l===!0?"":l)}))})},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(o){var i=e.elements[o],s=e.attributes[o]||{},a=Object.keys(e.styles.hasOwnProperty(o)?e.styles[o]:n[o]).reduce(function(l,c){return l[c]="",l},{});Mt(i)&&jt(i)&&(Object.assign(i.style,a),Object.keys(s).forEach(function(l){i.removeAttribute(l)}))})}},requires:["computeStyles"]};function Ht(t){return t.split("-")[0]}var eo=Math.max,Ki=Math.min,zo=Math.round;function xl(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Xp(){return!/^((?!chrome|android).)*safari/i.test(xl())}function Fo(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var o=t.getBoundingClientRect(),i=1,s=1;e&&Mt(t)&&(i=t.offsetWidth>0&&zo(o.width)/t.offsetWidth||1,s=t.offsetHeight>0&&zo(o.height)/t.offsetHeight||1);var a=(Zn(t)?gt(t):window).visualViewport,l=!Xp()&&n,c=(o.left+(l&&a?a.offsetLeft:0))/i,d=(o.top+(l&&a?a.offsetTop:0))/s,u=o.width/i,p=o.height/s;return{width:u,height:p,top:d,right:c+u,bottom:d+p,left:c,x:c,y:d}}function Cl(t){var e=Fo(t),n=t.offsetWidth,o=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-o)<=1&&(o=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:o}}function Qp(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&wl(n)){var o=e;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function nn(t){return gt(t).getComputedStyle(t)}function Vk(t){return["table","td","th"].indexOf(jt(t))>=0}function kn(t){return((Zn(t)?t.ownerDocument:t.document)||window.document).documentElement}function Ui(t){return jt(t)==="html"?t:t.assignedSlot||t.parentNode||(wl(t)?t.host:null)||kn(t)}function Zp(t){return Mt(t)&&nn(t).position!=="fixed"?t.offsetParent:null}function Vr(t){for(var e=gt(t),n=Zp(t);n&&Vk(n)&&nn(n).position==="static";)n=Zp(n);return n&&(jt(n)==="html"||jt(n)==="body"&&nn(n).position==="static")?e:n||function(o){var i=/firefox/i.test(xl());if(/Trident/i.test(xl())&&Mt(o)&&nn(o).position==="fixed")return null;var s=Ui(o);for(wl(s)&&(s=s.host);Mt(s)&&["html","body"].indexOf(jt(s))<0;){var a=nn(s);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||i&&a.willChange==="filter"||i&&a.filter&&a.filter!=="none")return s;s=s.parentNode}return null}(t)||e}function Sl(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Dr(t,e,n){return eo(t,Ki(e,n))}function eh(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function th(t,e){return e.reduce(function(n,o){return n[o]=t,n},{})}const Dk={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,o=t.name,i=t.options,s=n.elements.arrow,a=n.modifiersData.popperOffsets,l=Ht(n.placement),c=Sl(l),d=[nt,Et].indexOf(l)>=0?"height":"width";if(s&&a){var u=function(E,M){return eh(typeof(E=typeof E=="function"?E(Object.assign({},M.rects,{placement:M.placement})):E)!="number"?E:th(E,Tr))}(i.padding,n),p=Cl(s),h=c==="y"?ct:nt,f=c==="y"?St:Et,m=n.rects.reference[d]+n.rects.reference[c]-a[c]-n.rects.popper[d],g=a[c]-n.rects.reference[c],v=Vr(s),b=v?c==="y"?v.clientHeight||0:v.clientWidth||0:0,y=m/2-g/2,k=u[h],x=b-p[d]-u[f],w=b/2-p[d]/2+y,C=Dr(k,w,x),S=c;n.modifiersData[o]=((e={})[S]=C,e.centerOffset=C-w,e)}},effect:function(t){var e=t.state,n=t.options.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o!="string"||(o=e.elements.popper.querySelector(o)))&&Qp(e.elements.popper,o)&&(e.elements.arrow=o)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function jo(t){return t.split("-")[1]}var Ak={top:"auto",right:"auto",bottom:"auto",left:"auto"};function nh(t){var e,n=t.popper,o=t.popperRect,i=t.placement,s=t.variation,a=t.offsets,l=t.position,c=t.gpuAcceleration,d=t.adaptive,u=t.roundOffsets,p=t.isFixed,h=a.x,f=h===void 0?0:h,m=a.y,g=m===void 0?0:m,v=typeof u=="function"?u({x:f,y:g}):{x:f,y:g};f=v.x,g=v.y;var b=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),k=nt,x=ct,w=window;if(d){var C=Vr(n),S="clientHeight",E="clientWidth";C===gt(n)&&nn(C=kn(n)).position!=="static"&&l==="absolute"&&(S="scrollHeight",E="scrollWidth"),(i===ct||(i===nt||i===Et)&&s===Or)&&(x=St,g-=(p&&C===w&&w.visualViewport?w.visualViewport.height:C[S])-o.height,g*=c?1:-1),i!==nt&&(i!==ct&&i!==St||s!==Or)||(k=Et,f-=(p&&C===w&&w.visualViewport?w.visualViewport.width:C[E])-o.width,f*=c?1:-1)}var M,N=Object.assign({position:l},d&&Ak),T=u===!0?function(A,$){var B=A.x,V=A.y,O=$.devicePixelRatio||1;return{x:zo(B*O)/O||0,y:zo(V*O)/O||0}}({x:f,y:g},gt(n)):{x:f,y:g};return f=T.x,g=T.y,c?Object.assign({},N,((M={})[x]=y?"0":"",M[k]=b?"0":"",M.transform=(w.devicePixelRatio||1)<=1?"translate("+f+"px, "+g+"px)":"translate3d("+f+"px, "+g+"px, 0)",M)):Object.assign({},N,((e={})[x]=y?g+"px":"",e[k]=b?f+"px":"",e.transform="",e))}var qi={passive:!0},Ik={left:"right",right:"left",bottom:"top",top:"bottom"};function Ji(t){return t.replace(/left|right|bottom|top/g,function(e){return Ik[e]})}var Rk={start:"end",end:"start"};function oh(t){return t.replace(/start|end/g,function(e){return Rk[e]})}function El(t){var e=gt(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ml(t){return Fo(kn(t)).left+El(t).scrollLeft}function Nl(t){var e=nn(t),n=e.overflow,o=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+o)}function rh(t){return["html","body","#document"].indexOf(jt(t))>=0?t.ownerDocument.body:Mt(t)&&Nl(t)?t:rh(Ui(t))}function Ar(t,e){var n;e===void 0&&(e=[]);var o=rh(t),i=o===((n=t.ownerDocument)==null?void 0:n.body),s=gt(o),a=i?[s].concat(s.visualViewport||[],Nl(o)?o:[]):o,l=e.concat(a);return i?l:l.concat(Ar(Ui(a)))}function Bl(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function ih(t,e,n){return e===Jp?Bl(function(o,i){var s=gt(o),a=kn(o),l=s.visualViewport,c=a.clientWidth,d=a.clientHeight,u=0,p=0;if(l){c=l.width,d=l.height;var h=Xp();(h||!h&&i==="fixed")&&(u=l.offsetLeft,p=l.offsetTop)}return{width:c,height:d,x:u+Ml(o),y:p}}(t,n)):Zn(e)?function(o,i){var s=Fo(o,!1,i==="fixed");return s.top=s.top+o.clientTop,s.left=s.left+o.clientLeft,s.bottom=s.top+o.clientHeight,s.right=s.left+o.clientWidth,s.width=o.clientWidth,s.height=o.clientHeight,s.x=s.left,s.y=s.top,s}(e,n):Bl(function(o){var i,s=kn(o),a=El(o),l=(i=o.ownerDocument)==null?void 0:i.body,c=eo(s.scrollWidth,s.clientWidth,l?l.scrollWidth:0,l?l.clientWidth:0),d=eo(s.scrollHeight,s.clientHeight,l?l.scrollHeight:0,l?l.clientHeight:0),u=-a.scrollLeft+Ml(o),p=-a.scrollTop;return nn(l||s).direction==="rtl"&&(u+=eo(s.clientWidth,l?l.clientWidth:0)-c),{width:c,height:d,x:u,y:p}}(kn(t)))}function sh(t){var e,n=t.reference,o=t.element,i=t.placement,s=i?Ht(i):null,a=i?jo(i):null,l=n.x+n.width/2-o.width/2,c=n.y+n.height/2-o.height/2;switch(s){case ct:e={x:l,y:n.y-o.height};break;case St:e={x:l,y:n.y+n.height};break;case Et:e={x:n.x+n.width,y:c};break;case nt:e={x:n.x-o.width,y:c};break;default:e={x:n.x,y:n.y}}var d=s?Sl(s):null;if(d!=null){var u=d==="y"?"height":"width";switch(a){case Po:e[d]=e[d]-(n[u]/2-o[u]/2);break;case Or:e[d]=e[d]+(n[u]/2-o[u]/2)}}return e}function Ir(t,e){e===void 0&&(e={});var n=e,o=n.placement,i=o===void 0?t.placement:o,s=n.strategy,a=s===void 0?t.strategy:s,l=n.boundary,c=l===void 0?"clippingParents":l,d=n.rootBoundary,u=d===void 0?Jp:d,p=n.elementContext,h=p===void 0?_r:p,f=n.altBoundary,m=f!==void 0&&f,g=n.padding,v=g===void 0?0:g,b=eh(typeof v!="number"?v:th(v,Tr)),y=h===_r?"reference":_r,k=t.rects.popper,x=t.elements[m?y:h],w=function($,B,V,O){var D=B==="clippingParents"?function(I){var P=Ar(Ui(I)),W=["absolute","fixed"].indexOf(nn(I).position)>=0&&Mt(I)?Vr(I):I;return Zn(W)?P.filter(function(z){return Zn(z)&&Qp(z,W)&&jt(z)!=="body"}):[]}($):[].concat(B),F=[].concat(D,[V]),R=F[0],L=F.reduce(function(I,P){var W=ih($,P,O);return I.top=eo(W.top,I.top),I.right=Ki(W.right,I.right),I.bottom=Ki(W.bottom,I.bottom),I.left=eo(W.left,I.left),I},ih($,R,O));return L.width=L.right-L.left,L.height=L.bottom-L.top,L.x=L.left,L.y=L.top,L}(Zn(x)?x:x.contextElement||kn(t.elements.popper),c,u,a),C=Fo(t.elements.reference),S=sh({reference:C,element:k,placement:i}),E=Bl(Object.assign({},k,S)),M=h===_r?E:C,N={top:w.top-M.top+b.top,bottom:M.bottom-w.bottom+b.bottom,left:w.left-M.left+b.left,right:M.right-w.right+b.right},T=t.modifiersData.offset;if(h===_r&&T){var A=T[i];Object.keys(N).forEach(function($){var B=[Et,St].indexOf($)>=0?1:-1,V=[ct,St].indexOf($)>=0?"y":"x";N[$]+=A[V]*B})}return N}function Lk(t,e){e===void 0&&(e={});var n=e,o=n.placement,i=n.boundary,s=n.rootBoundary,a=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,d=c===void 0?Yp:c,u=jo(o),p=u?l?Gp:Gp.filter(function(m){return jo(m)===u}):Tr,h=p.filter(function(m){return d.indexOf(m)>=0});h.length===0&&(h=p);var f=h.reduce(function(m,g){return m[g]=Ir(t,{placement:g,boundary:i,rootBoundary:s,padding:a})[Ht(g)],m},{});return Object.keys(f).sort(function(m,g){return f[m]-f[g]})}const $k={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,o=t.name;if(!e.modifiersData[o]._skip){for(var i=n.mainAxis,s=i===void 0||i,a=n.altAxis,l=a===void 0||a,c=n.fallbackPlacements,d=n.padding,u=n.boundary,p=n.rootBoundary,h=n.altBoundary,f=n.flipVariations,m=f===void 0||f,g=n.allowedAutoPlacements,v=e.options.placement,b=Ht(v),y=c||(b!==v&&m?function(I){if(Ht(I)===kl)return[];var P=Ji(I);return[oh(I),P,oh(P)]}(v):[Ji(v)]),k=[v].concat(y).reduce(function(I,P){return I.concat(Ht(P)===kl?Lk(e,{placement:P,boundary:u,rootBoundary:p,padding:d,flipVariations:m,allowedAutoPlacements:g}):P)},[]),x=e.rects.reference,w=e.rects.popper,C=new Map,S=!0,E=k[0],M=0;M<k.length;M++){var N=k[M],T=Ht(N),A=jo(N)===Po,$=[ct,St].indexOf(T)>=0,B=$?"width":"height",V=Ir(e,{placement:N,boundary:u,rootBoundary:p,altBoundary:h,padding:d}),O=$?A?Et:nt:A?St:ct;x[B]>w[B]&&(O=Ji(O));var D=Ji(O),F=[];if(s&&F.push(V[T]<=0),l&&F.push(V[O]<=0,V[D]<=0),F.every(function(I){return I})){E=N,S=!1;break}C.set(N,F)}if(S)for(var R=function(I){var P=k.find(function(W){var z=C.get(W);if(z)return z.slice(0,I).every(function(j){return j})});if(P)return E=P,"break"},L=m?3:1;L>0&&R(L)!=="break";L--);e.placement!==E&&(e.modifiersData[o]._skip=!0,e.placement=E,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ah(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function lh(t){return[ct,Et,St,nt].some(function(e){return t[e]>=0})}const Pk={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,o=t.name,i=n.offset,s=i===void 0?[0,0]:i,a=Yp.reduce(function(u,p){return u[p]=function(h,f,m){var g=Ht(h),v=[nt,ct].indexOf(g)>=0?-1:1,b=typeof m=="function"?m(Object.assign({},f,{placement:h})):m,y=b[0],k=b[1];return y=y||0,k=(k||0)*v,[nt,Et].indexOf(g)>=0?{x:k,y}:{x:y,y:k}}(p,e.rects,s),u},{}),l=a[e.placement],c=l.x,d=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=d),e.modifiersData[o]=a}},zk={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,o=t.name,i=n.mainAxis,s=i===void 0||i,a=n.altAxis,l=a!==void 0&&a,c=n.boundary,d=n.rootBoundary,u=n.altBoundary,p=n.padding,h=n.tether,f=h===void 0||h,m=n.tetherOffset,g=m===void 0?0:m,v=Ir(e,{boundary:c,rootBoundary:d,padding:p,altBoundary:u}),b=Ht(e.placement),y=jo(e.placement),k=!y,x=Sl(b),w=x==="x"?"y":"x",C=e.modifiersData.popperOffsets,S=e.rects.reference,E=e.rects.popper,M=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,N=typeof M=="number"?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),T=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,A={x:0,y:0};if(C){if(s){var $,B=x==="y"?ct:nt,V=x==="y"?St:Et,O=x==="y"?"height":"width",D=C[x],F=D+v[B],R=D-v[V],L=f?-E[O]/2:0,I=y===Po?S[O]:E[O],P=y===Po?-E[O]:-S[O],W=e.elements.arrow,z=f&&W?Cl(W):{width:0,height:0},j=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},K=j[B],G=j[V],Z=Dr(0,S[O],z[O]),J=k?S[O]/2-L-Z-K-N.mainAxis:I-Z-K-N.mainAxis,Y=k?-S[O]/2+L+Z+G+N.mainAxis:P+Z+G+N.mainAxis,te=e.elements.arrow&&Vr(e.elements.arrow),pe=te?x==="y"?te.clientTop||0:te.clientLeft||0:0,X=($=T==null?void 0:T[x])!=null?$:0,oe=D+Y-X,ae=Dr(f?Ki(F,D+J-X-pe):F,D,f?eo(R,oe):R);C[x]=ae,A[x]=ae-D}if(l){var se,be=x==="x"?ct:nt,Fe=x==="x"?St:Et,Me=C[w],Ne=w==="y"?"height":"width",de=Me+v[be],me=Me-v[Fe],at=[ct,nt].indexOf(b)!==-1,Le=(se=T==null?void 0:T[w])!=null?se:0,_e=at?de:Me-S[Ne]-E[Ne]-Le+N.altAxis,ie=at?Me+S[Ne]+E[Ne]-Le-N.altAxis:me,Wn=f&&at?function(Qt,iO,ru){var D0=Dr(Qt,iO,ru);return D0>ru?ru:D0}(_e,Me,ie):Dr(f?_e:de,Me,f?ie:me);C[w]=Wn,A[w]=Wn-Me}e.modifiersData[o]=A}},requiresIfExists:["offset"]};function Fk(t,e,n){n===void 0&&(n=!1);var o,i,s=Mt(e),a=Mt(e)&&function(p){var h=p.getBoundingClientRect(),f=zo(h.width)/p.offsetWidth||1,m=zo(h.height)/p.offsetHeight||1;return f!==1||m!==1}(e),l=kn(e),c=Fo(t,a,n),d={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(s||!s&&!n)&&((jt(e)!=="body"||Nl(l))&&(d=(o=e)!==gt(o)&&Mt(o)?{scrollLeft:(i=o).scrollLeft,scrollTop:i.scrollTop}:El(o)),Mt(e)?((u=Fo(e,!0)).x+=e.clientLeft,u.y+=e.clientTop):l&&(u.x=Ml(l))),{x:c.left+d.scrollLeft-u.x,y:c.top+d.scrollTop-u.y,width:c.width,height:c.height}}function jk(t){var e=new Map,n=new Set,o=[];function i(s){n.add(s.name),[].concat(s.requires||[],s.requiresIfExists||[]).forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&i(l)}}),o.push(s)}return t.forEach(function(s){e.set(s.name,s)}),t.forEach(function(s){n.has(s.name)||i(s)}),o}var ch={placement:"bottom",modifiers:[],strategy:"absolute"};function dh(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function Hk(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,o=n===void 0?[]:n,i=e.defaultOptions,s=i===void 0?ch:i;return function(a,l,c){c===void 0&&(c=s);var d,u,p={placement:"bottom",orderedModifiers:[],options:Object.assign({},ch,s),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},h=[],f=!1,m={state:p,setOptions:function(v){var b=typeof v=="function"?v(p.options):v;g(),p.options=Object.assign({},s,p.options,b),p.scrollParents={reference:Zn(a)?Ar(a):a.contextElement?Ar(a.contextElement):[],popper:Ar(l)};var y=function(k){var x=jk(k);return Ok.reduce(function(w,C){return w.concat(x.filter(function(S){return S.phase===C}))},[])}(function(k){var x=k.reduce(function(w,C){var S=w[C.name];return w[C.name]=S?Object.assign({},S,C,{options:Object.assign({},S.options,C.options),data:Object.assign({},S.data,C.data)}):C,w},{});return Object.keys(x).map(function(w){return x[w]})}([].concat(o,p.options.modifiers)));return p.orderedModifiers=y.filter(function(k){return k.enabled}),p.orderedModifiers.forEach(function(k){var x=k.name,w=k.options,C=w===void 0?{}:w,S=k.effect;if(typeof S=="function"){var E=S({state:p,name:x,instance:m,options:C});h.push(E||function(){})}}),m.update()},forceUpdate:function(){if(!f){var v=p.elements,b=v.reference,y=v.popper;if(dh(b,y)){p.rects={reference:Fk(b,Vr(y),p.options.strategy==="fixed"),popper:Cl(y)},p.reset=!1,p.placement=p.options.placement,p.orderedModifiers.forEach(function(M){return p.modifiersData[M.name]=Object.assign({},M.data)});for(var k=0;k<p.orderedModifiers.length;k++)if(p.reset!==!0){var x=p.orderedModifiers[k],w=x.fn,C=x.options,S=C===void 0?{}:C,E=x.name;typeof w=="function"&&(p=w({state:p,options:S,name:E,instance:m})||p)}else p.reset=!1,k=-1}}},update:(d=function(){return new Promise(function(v){m.forceUpdate(),v(p)})},function(){return u||(u=new Promise(function(v){Promise.resolve().then(function(){u=void 0,v(d())})})),u}),destroy:function(){g(),f=!0}};if(!dh(a,l))return m;function g(){h.forEach(function(v){return v()}),h=[]}return m.setOptions(c).then(function(v){!f&&c.onFirstUpdate&&c.onFirstUpdate(v)}),m}}var Wk=Hk({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,o=t.options,i=o.scroll,s=i===void 0||i,a=o.resize,l=a===void 0||a,c=gt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&d.forEach(function(u){u.addEventListener("scroll",n.update,qi)}),l&&c.addEventListener("resize",n.update,qi),function(){s&&d.forEach(function(u){u.removeEventListener("scroll",n.update,qi)}),l&&c.removeEventListener("resize",n.update,qi)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=sh({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,o=n.gpuAcceleration,i=o===void 0||o,s=n.adaptive,a=s===void 0||s,l=n.roundOffsets,c=l===void 0||l,d={placement:Ht(e.placement),variation:jo(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,nh(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,nh(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},_k,Pk,$k,zk,Dk,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,o=e.rects.reference,i=e.rects.popper,s=e.modifiersData.preventOverflow,a=Ir(e,{elementContext:"reference"}),l=Ir(e,{altBoundary:!0}),c=ah(a,o),d=ah(l,i,s),u=lh(c),p=lh(d);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}}]});const uh="mc-popper",Kk={key:0,id:"arrow",class:"mc-popper-arrow","data-popper-arrow":""},Gi=ee(q(r.defineComponent({name:uh,__name:"mc-popper",props:{content:{},trigger:{default:"hover"},placement:{default:"top"},disabled:{type:Boolean},popperOptions:{},showTimeout:{default:0},hideTimeout:{default:300},transitionName:{default:"fade"},showArrow:{type:Boolean,default:!0}},emits:["visible:change","click:outside"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref({}),a=r.ref({}),l=r.ref({}),c=r.ref(),d=r.ref(),u=r.ref(),p=r.ref(!1),h=w=>{o.disabled&&(w=!1),p.value=w,i("visible:change",w)},f=r.computed(()=>({placement:o.placement,modifiers:[{name:"offset",options:{offset:[0,8]}}],...o.popperOptions}));let m,g,v;r.watch(p,w=>{w&&d.value&&u.value&&(m=Wk(d.value,u.value,f.value))},{flush:"post"}),r.onUnmounted(()=>{ye(m)||(m.destroy(),m=void 0)});const b=r.computed(()=>o.trigger==="hover"?o.showTimeout:0),y=r.computed(()=>o.trigger==="hover"?o.hideTimeout:0);r.watchEffect(()=>{s.value={},a.value={},l.value={},o.disabled?x(!1):o.trigger==="click"?s.value.click=()=>{p.value?x():k()}:o.trigger==="hover"&&(s.value.mouseenter=()=>k(),a.value.mouseleave=()=>x(),l.value.mouseenter=()=>k()),g=$i(Di(h,null,!0),b.value),v=$i(Di(h,null,!1),y.value)});const k=(w=!0)=>{v==null||v.cancel(),w?g==null||g():h(!0)},x=(w=!0)=>{g==null||g.cancel(),w?v==null||v():h(!1)};return Hi(c,()=>{i("click:outside"),o.trigger==="click"&&p.value&&x(!1)}),e({show:()=>k(!1),hide:()=>x(!1)}),(w,C)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps({class:"mc-popper",ref_key:"containerNode",ref:c},r.toHandlers(a.value,!0)),[r.createElementVNode("div",r.mergeProps({class:"mc-popper-trigger",ref_key:"triggerNode",ref:d},r.toHandlers(s.value,!0)),[r.renderSlot(w.$slots,"default",{},void 0,!0)],16),r.createVNode(r.Transition,{name:t.transitionName},{default:r.withCtx(()=>[p.value?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0,class:"mc-popper-popper",ref_key:"popperNode",ref:u},r.toHandlers(l.value,!0)),[r.renderSlot(w.$slots,"content",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0),t.showArrow?(r.openBlock(),r.createElementBlock("div",Kk)):r.createCommentVNode("",!0)],16)):r.createCommentVNode("",!0)]),_:3},8,["name"])],16))}}),[["__scopeId","data-v-b21e38ee"]])),ph="mc-tooltip",Uk={class:"mc-tooltip"},Ho=ee(q(r.defineComponent({name:ph,__name:"mc-tooltip",props:{iconSize:{default:24},iconName:{default:"Info"},content:{},theme:{default:"light"},placement:{default:"top"},showArrow:{type:Boolean,default:!0},iconColor:{},trigger:{default:"hover"}},setup(t,{expose:e}){const n=r.computed(()=>({strategy:"fixed"})),o=r.ref();return e({hide:()=>{var i;return(i=o.value)==null?void 0:i.hide()},show:()=>{var i;return(i=o.value)==null?void 0:i.show()}}),(i,s)=>(r.openBlock(),r.createElementBlock("div",Uk,[r.createVNode(r.unref(Gi),{ref_key:"popperRef",ref:o,placement:t.placement,"show-arrow":t.showArrow,"popper-options":n.value,trigger:t.trigger},{content:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["mc-tooltip-content",`mc-tooltip-content-${t.theme}`])},[r.renderSlot(i.$slots,"content",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0)],2)]),default:r.withCtx(()=>[r.renderSlot(i.$slots,"default",{},()=>[r.createVNode(r.unref(ge),{class:"mc-tooltip-icon",name:t.iconName,size:t.iconSize,color:t.iconColor},null,8,["name","size","color"])],!0)]),_:3},8,["placement","show-arrow","popper-options","trigger"])]))}}),[["__scopeId","data-v-a76a6974"]])),qk={class:"mc-form"},hh=ee(q(r.defineComponent({name:zp,__name:"mc-form",props:{model:{default:()=>({})},modelValue:{},rules:{default:()=>({})},disabled:{type:Boolean},direction:{default:"vertical"},scrollToError:{type:Boolean,default:!1}},emits:["update:modelValue","reset"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=new Map,a=d=>{if(ce(d)){if(Be(d))return Array.from(s.values());{const u=[];return Pi(d,p=>{const h=s.get(p);h&&u.push(h)}),u}}return s.get(d)},l=async(d=[],u,p=!0)=>{try{return p&&c(),await(async(f,m)=>{const g=a(f);if(Be(g))return m==null||m(!0),!0;try{return await(async v=>{const b=[];for(const y of v)try{await y.validate()}catch(k){b.push(k)}return!sl(b)||Promise.reject(b)})(ce(g)?g:[g]),m==null||m(!0),!0}catch(v){if(v instanceof Error)throw v;const b=v;return m==null||m(!1,b),Promise.reject(b)}})(d,u)}catch(h){return o.scrollToError&&(async f=>{const m=vn(Ep(f))[0],g=a(m);if(Be(g))return;const v=g.id;if(!v.size)return;const b=Ep(Array.from(v));if(!b)return;const y=document.getElementById(b);y==null||y.scrollIntoView({block:"center",inline:"center",behavior:"smooth"}),await cl(500),y==null||y.focus()})(h),Promise.reject(h)}},c=(d=[])=>{const u=a(d);Be(u)||(ce(u)?Pi(u,p=>p.clearValidate()):u.clearValidate())};return r.provide(Ro,{model:r.computed(()=>ye(o.modelValue)?o.model:o.modelValue),rules:r.computed(()=>o.rules),disabled:r.computed(()=>!!o.disabled),direction:r.computed(()=>o.direction),addFormItem:d=>{Be(d.prop)||s.set(d.prop,d)},removeFormItem:d=>{Be(d.prop)||s.delete(d.prop)}}),e({validate:l,validateFields:async(d,u)=>l(d,u,!1),resetFields:async(d=[])=>{const u=a(d);if(Be(u))return;const p={};ce(u)?Pi(u,h=>{p[h.prop]=h.getInitialValue()}):p[u.prop]=u.getInitialValue(),await r.nextTick(),i("reset",p),i("update:modelValue",p),await r.nextTick(),c(d)},clearValidate:c}),(d,u)=>(r.openBlock(),r.createElementBlock("div",qk,[r.createElementVNode("form",{onSubmit:u[0]||(u[0]=r.withModifiers(()=>{},["prevent"]))},[r.renderSlot(d.$slots,"default",{},void 0,!0)],32)]))}}),[["__scopeId","data-v-70bd19cc"]])),Tl=Symbol("mc-form-item-context"),fh="mc-form-item",Jk={class:"mc-form-item-label-wrapper"},Gk={key:0,class:"mc-form-item-label"},Yk={key:0,class:"mc-form-item-help"},Xk={key:0,class:"mc-form-item-desc"},Qk={class:"mc-form-item__content"},Zk={key:0,class:"mc-form-item__error"},ew=r.defineComponent({name:fh,__name:"mc-form-item",props:{prop:{default:""},label:{},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},rules:{},help:{},desc:{}},setup(t){const e=t,n=r.reactive(new Map),o=r.reactive(new Map),i=r.computed(()=>o.values().next().value),s=r.inject(Ro,void 0),{addFormId:a,removeFormId:l}=(v=>{const b=r.inject(Ro,void 0),y=new Map,k=ue("prop"),x=()=>{if(ye(k.value))return;const C=ce(k.value)?k.value:[k.value];for(const S of C){const E=v(S);y.set(S,E),b==null||b.addFormItem(E)}},w=()=>{for(const C of y.values())b==null||b.removeFormItem(C)};return r.onBeforeMount(()=>{x()}),r.onBeforeUnmount(()=>{w()}),r.watch(()=>k.value,C=>{w(),Be(C)||x()},{deep:!0}),{formItemInstances:y,addFormId:(C,S)=>{const E=y.get(C);E&&E.id.add(S)},removeFormId:(C,S)=>{const E=y.get(C);E&&E.id.delete(S)}}})(v=>(n.set(v,"init"),{prop:v,id:new Set,validate:c(v),getInitialValue:d(v),clearValidate:h})),c=v=>async(b,y)=>f(v,b,y),d=v=>()=>{const b=s==null?void 0:s.model.value;if(!ye(b))return u(v)},{getInitialValue:u}=(()=>{const v=r.inject(Ro,void 0),b=ue("prop"),y=new Map,k=x=>{const w=v==null?void 0:v.model.value;if(ye(x)||Be(x))y.clear();else if(ce(x))for(const C of x)y.set(C,Oo(w,C));else y.set(x,Oo(w,x))};return r.onMounted(()=>{k(b.value)}),r.watch(()=>b.value,x=>{k(x)}),{getInitialValue:x=>{if(!ye(x))return Ii(y.get(x),5)}}})();let p=!1;const h=()=>{for(const v of n.keys())n.set(v,"init");for(const v of o.keys())o.delete(v);p=!1},f=async(v,b,y)=>{if(p||e.disabled)return Promise.resolve(!0);const k=(C=>{const S=[],E=!!e.required;E&&S.push({required:!0}),e.rules&&S.push(...e.rules);const M=s==null?void 0:s.rules.value;if(M){const N=Oo(M,C);N&&S.push(...N)}if(E){const N=Cr(bn(S,(T,A)=>[T,A]),T=>Ct(vn(T[0]),"required"));if(sl(N))for(const T of N){const[A,$]=T;A.required!==E&&(S[$]={...A,required:E})}else S.push({required:E})}return S})(v),x=((C,S)=>Cr(C,E=>!(!E.trigger&&S&&S!=="change")&&(!E.trigger||!S||(ce(E.trigger)?Ct(E.trigger,S):E.trigger===S))).map(({trigger:E,...M})=>M))(k,b);if(Be(x))return y==null||y(!0),Promise.resolve(!0);n.set(v,"validating");const w=((C,S)=>{const E=new Br({[C]:S}),M=s==null?void 0:s.model.value;return E.validate({[C]:Oo(M,C)},{firstFields:!0})})(v,x);try{return await w,n.set(v,"success"),o.delete(v),y==null||y(!0),Promise.resolve(!0)}catch(C){const{errors:S,fields:E}=C;n.set(v,"error");const M=S&&sl(S)>0?S[0].message??"":"";return o.set(v,M),y==null||y(!1,E),Promise.reject(E)}},m=r.computed(()=>(s==null?void 0:s.direction.value)==="horizontal"),g=r.computed(()=>{var k;if(e.required)return!0;if((k=e.rules)!=null&&k.length)return al(e.rules,x=>!!x.required);const v=s==null?void 0:s.rules.value,b=ce(e.prop)?e.prop:[e.prop],y=[];for(const x of b){const w=Oo(v,x);w&&y.push(...w)}return al(y,x=>!!x.required)});return r.provide(Tl,{disabled:r.computed(()=>e.disabled),validateStatus:n,prop:r.computed(()=>e.prop),addFormId:a,removeFormId:l,validate:f}),(v,b)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-form-item",{"mc-form-item-horizontal":m.value}])},[r.renderSlot(v.$slots,"label",{required:g.value},()=>[r.createElementVNode("div",null,[r.createElementVNode("div",Jk,[t.label?(r.openBlock(),r.createElementBlock("label",Gk,[r.createElementVNode("span",{class:r.normalizeClass(["mc-form-item-lable-text",{"mc-form-item-label-required":g.value}])},r.toDisplayString(t.label),3),t.help||v.$slots.help?(r.openBlock(),r.createElementBlock("div",Yk,[r.renderSlot(v.$slots,"help",{},()=>[r.createVNode(r.unref(Ho),{content:t.help,"icon-size":20},null,8,["content"])],!0)])):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.renderSlot(v.$slots,"tool",{},void 0,!0)]),t.desc||v.$slots.desc?(r.openBlock(),r.createElementBlock("div",Xk,[r.renderSlot(v.$slots,"desc",{},()=>[r.createTextVNode(r.toDisplayString(t.desc),1)],!0)])):r.createCommentVNode("",!0)])],!0),r.createElementVNode("div",Qk,[r.renderSlot(v.$slots,"default",{},void 0,!0),r.createVNode(r.Transition,{name:"mc-form-item-error"},{default:r.withCtx(()=>[i.value?(r.openBlock(),r.createElementBlock("div",Zk,r.toDisplayString(i.value),1)):r.createCommentVNode("",!0)]),_:1})])],2))}}),mh=ee(q(ew,[["__scopeId","data-v-c3eae309"]])),Nt=({externalId:t,externalDisabled:e,disableValidation:n,validator:o}={})=>{const i=ue(["disableValidation","disable-validation"]),s=ue(["validateProp","validate-prop"]),a=r.computed(()=>!!i.value||!!(n!=null&&n.value)),{formCtx:l,formItemCtx:c,formId:d,formDisabled:u}=(({externalId:x,externalDisabled:w}={})=>{const C=r.inject(Ro,void 0),S=r.inject(Tl,void 0),E=ue(["validateProp","validate-prop"]),M=(A=>{const $=ue("id");if($.value)return $.value;{const B=((V=10)=>String(Date.now()).slice(-V))();return A?`${A}-${B}`:B}})((x==null?void 0:x.value)??"mc-form-item");r.onMounted(()=>{N()}),r.onBeforeUnmount(()=>{N("remove")});const N=(A="add")=>{const $=E.value;if($)A==="add"?S==null||S.addFormId($,M):S==null||S.removeFormId($,M);else{const B=S==null?void 0:S.prop.value;if(Be(B))return;const V=ce(B)?B:[B];for(const O of V)A==="add"?O&&(S==null||S.addFormId(O,M)):O&&(S==null||S.removeFormId(O,M))}},T=(({formCtx:A,formItemCtx:$,externalDisabled:B})=>{const V=ue("disabled");return r.computed(()=>V.value||!!(A!=null&&A.disabled.value)||!!($!=null&&$.disabled.value)||!!(B!=null&&B.value))})({formCtx:C,formItemCtx:S,externalDisabled:w});return{formCtx:C,formItemCtx:S,formId:M,formDisabled:T}})({externalId:t,externalDisabled:e}),p=r.computed(()=>{if(a.value)return"init";if(He(o)&&o()==="error")return"error";const x=c==null?void 0:c.validateStatus;return x!=null&&x.size?s.value?x.get(s.value)||"init":x.values().next().value||"init":"init"}),h=r.computed(()=>a.value?"":`mc-form-validate-${p.value}`),f=r.computed(()=>!a.value&&p.value==="error"),m=r.computed(()=>!a.value&&p.value==="success"),g=ue(["hideValidationIcon","hide-validation-icon"]),v=r.computed(()=>!a.value&&!g.value&&(f.value?"Reject_02":!!m.value&&"Accept_02")),b=ue("modelValue"),y=x=>Sr(x)?ye(x):Be(x);r.watch(()=>b.value,(x,w)=>{y(x)&&y(w)||k("change")});const k=async x=>{if(!a.value)try{if(s.value)await(c==null?void 0:c.validate(s.value,x));else{const w=c==null?void 0:c.prop.value;if(w){const C=ce(w)?w:[w],S=[];for(const E of C)S.push(c==null?void 0:c.validate(E,x));await Promise.all(S)}}}catch(w){console.error("[mc-form] validate error: ",w)}};return{formCtx:l,formItemCtx:c,formId:d,formDisabled:u,validateStatus:p,validateStyle:h,isError:f,isSuccess:m,statusIcon:v,validateByTrigger:k}},gh="mc-checkbox",Ol=Symbol("mc-checkbox-group-context"),vh="mc-checkbox-group",tw={class:"mc-checkbox"},nw=["id","value","disabled","onKeypress"],ow={key:0,class:"mc-checkbox-content"},rw={key:0,class:"mc-checkbox-remarks"},iw=r.defineComponent({name:gh,__name:"mc-checkbox",props:{modelValue:{type:Boolean},disabled:{type:Boolean},content:{},remarks:{},partial:{type:Boolean},value:{},disableValidation:{type:Boolean,default:!1},hideValidationIcon:{type:Boolean}},emits:["update:modelValue","change","focus","blur"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(),{wrapperRef:s,isFocused:a,handleFocus:l,handleBlur:c}=Xn(i),{checkboxGroupCtx:d,checkboxGroupDisabled:u,isCheckboxGroup:p,isCheckboxSelected:h,handleCheckboxSelect:f}=(()=>{const x=r.inject(Ol,void 0),w=r.computed(()=>{var S;return!!((S=x==null?void 0:x.disabled)!=null&&S.value)}),C=r.computed(()=>!!x&&He(x==null?void 0:x.handleSelect));return{checkboxGroupCtx:x,checkboxGroupDisabled:w,isCheckboxGroup:C,isCheckboxSelected:S=>{var E;return!ye(S)&&Ct((E=x==null?void 0:x.modelValue)==null?void 0:E.value,S)},handleCheckboxSelect:S=>{x==null||x.handleSelect(S)}}})(),{formId:m,formDisabled:g,validateStyle:v,validateByTrigger:b}=Nt({externalDisabled:u,disableValidation:d==null?void 0:d.disableValidation}),y=r.computed(()=>p.value?h(n.value):!!n.modelValue),k=async()=>{g.value||(p.value?f(n.value):(o("update:modelValue",!n.modelValue),o("change",!n.modelValue),await r.nextTick(),b("input")))};return(x,w)=>(r.openBlock(),r.createElementBlock("div",tw,[r.createElementVNode("label",{ref_key:"checkboxRef",ref:s,class:r.normalizeClass(["mc-checkbox-wrapper",{"mc-checkbox-disabled":r.unref(g),"mc-checkbox-checked":y.value,"mc-checkbox-partial":t.partial,"mc-checkbox-focused":r.unref(a),[r.unref(v)]:r.unref(v)}]),onClick:r.withModifiers(k,["prevent"])},[r.createElementVNode("input",{ref_key:"checkboxInputRef",ref:i,id:r.unref(m),type:"checkbox",class:"mc-checkbox-input",value:y.value,disabled:r.unref(g),onKeypress:r.withKeys(r.withModifiers(k,["prevent","stop"]),["enter"]),onFocus:w[0]||(w[0]=(...C)=>r.unref(l)&&r.unref(l)(...C)),onBlur:w[1]||(w[1]=(...C)=>r.unref(c)&&r.unref(c)(...C))},null,40,nw),w[2]||(w[2]=r.createElementVNode("div",{class:"mc-checkbox-box"},null,-1)),t.content||x.$slots.default?(r.openBlock(),r.createElementBlock("div",ow,[r.renderSlot(x.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0)])):r.createCommentVNode("",!0)],2),t.remarks||x.$slots.remarks?(r.openBlock(),r.createElementBlock("div",rw,[r.renderSlot(x.$slots,"remarks",{},()=>[r.createTextVNode(r.toDisplayString(t.remarks),1)],!0)])):r.createCommentVNode("",!0)]))}}),Wo=ee(q(iw,[["__scopeId","data-v-9c2e6378"]])),sw=["id"],yh=ee(r.defineComponent({name:vh,__name:"mc-checkbox-group",props:{modelValue:{default:()=>[]},disabled:{type:Boolean,default:!1},disableValidation:{type:Boolean},hideValidationIcon:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,{formId:i,validateByTrigger:s}=Nt();return r.provide(Ol,{modelValue:r.computed(()=>n.modelValue),disabled:r.computed(()=>n.disabled),disableValidation:r.computed(()=>!!n.disableValidation),handleSelect:async a=>{if(!a)return;const l=[...n.modelValue],c=(u=a,(d=l)!=null&&d.length?Aa(d,u,0):-1);var d,u;c>-1?l.splice(c,1):l.push(a),o("update:modelValue",l),o("change",l),await r.nextTick(),s("input")}}),(a,l)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-checkbox-group",id:r.unref(i)},[r.renderSlot(a.$slots,"default")],8,sw))}})),_l=Symbol("mc-collapse-context"),bh="mc-collapse",aw={class:"mc-collapse"},kh=ee(q(r.defineComponent({name:bh,__name:"mc-collapse",props:{modelValue:{default:()=>[]},accordion:{type:Boolean,default:!1},transition:{type:Boolean,default:!1},destroyOnHide:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e;return r.watchEffect(()=>{n.accordion&&n.modelValue.length}),r.provide(_l,{activeNames:r.computed(()=>n.modelValue),transition:r.computed(()=>n.transition),destroyOnHide:r.computed(()=>n.destroyOnHide),handleItemClick:i=>{let s=[...n.modelValue??[]];if(n.accordion)s=[s[0]===i?"":i];else{const a=s.indexOf(i);a>-1?s.splice(a,1):s.push(i)}o("update:modelValue",s),o("change",s)}}),(i,s)=>(r.openBlock(),r.createElementBlock("div",aw,[r.renderSlot(i.$slots,"default",{},void 0,!0)]))}}),[["__scopeId","data-v-0935b3b5"]])),wh="mc-icon-plus",lw=r.defineComponent({name:wh,__name:"mc-icon-plus",props:{name:{},size:{default:24},width:{},height:{},color:{},cursor:{default:"inherit"}},emits:["click"],setup(t,{emit:e}){const n=t,o=e,{width:i,height:s}=lt(),a=r.computed(()=>n.width?i.value:`${n.size}px`),l=r.computed(()=>n.height?s.value:`${n.size}px`),c=()=>{o("click",n.name)};return(d,u)=>(r.openBlock(),r.createElementBlock("span",{class:"mc-icon-plus",style:r.normalizeStyle({fontSize:`${t.size}px`,width:a.value,height:l.value,color:t.color,cursor:t.cursor}),onClick:c},[r.createElementVNode("i",{class:r.normalizeClass(["mc-iconfont-plus",`mc-icon-plus-${t.name}`])},null,2)],4))}}),xh=q(lw,[["__scopeId","data-v-73d0e9a6"]]),Ee=ee(xh),Ch="mc-collapse-item",cw={class:"mc-collapse-item-header"},dw={class:"mc-collapse-item-title"},uw={key:0,class:"mc-collapse-item-content"},pw=r.defineComponent({name:Ch,__name:"mc-collapse-item",props:{name:{},title:{},disabled:{type:Boolean}},setup(t){const e=r.inject(_l,void 0),n=r.computed(()=>{var l;return!!((l=e==null?void 0:e.activeNames.value)!=null&&l.includes(t.name))}),o=r.computed(()=>!!(e!=null&&e.transition.value)),i=r.computed(()=>!!(e!=null&&e.destroyOnHide.value)),s=r.computed(()=>!i.value||n.value),a=()=>{t.disabled||(e==null||e.handleItemClick(t.name))};return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-collapse-item",onClick:a},[r.createElementVNode("div",cw,[r.createElementVNode("span",dw,[r.renderSlot(l.$slots,"title",{isActive:n.value},()=>[r.createTextVNode(r.toDisplayString(t.title),1)],!0)]),r.createElementVNode("span",{class:r.normalizeClass(["triangle-icon",{"triangle-icon-active":n.value}])},[r.createVNode(r.unref(Ee),{name:"up-chevron",cursor:"pointer"})],2)]),r.createVNode(r.Transition,{name:"mc-collapse-item-content-"+(o.value?"transition":"no-transition")},{default:r.withCtx(()=>[s.value?r.withDirectives((r.openBlock(),r.createElementBlock("div",uw,[r.renderSlot(l.$slots,"default",{isActive:n.value},void 0,!0)],512)),[[r.vShow,n.value]]):r.createCommentVNode("",!0)]),_:3},8,["name"])]))}}),Sh=ee(q(pw,[["__scopeId","data-v-c9afe7eb"]])),Eh="mc-toast",hw={key:0,class:"mc-toast-msg-icon"},fw={key:1,class:"mc-toast-msg-text"},mw={class:"mc-toast-msg-close-container"},gw={key:0,class:"mc-toast-countdown"},vw={key:1,class:"mc-toast-msg-close"},yw={key:0,class:"mc-toast-content-container"},Mh=q(r.defineComponent({name:Eh,__name:"mc-toast",props:{type:{default:"info"},message:{},content:{},closable:{type:Boolean,default:!0},autoClose:{type:Boolean,default:!0},duration:{default:void 0},hideIcon:{type:Boolean,default:!1},countDownIcon:{type:Boolean,default:!0},width:{},onClose:{}},emits:["close"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.computed(()=>{if(!o.hideIcon)switch(o.type){case"success":return"Accept_02";case"error":return"Error_04";case"warning":return"Error_02";case"info":return"Info_02";default:return}}),a=r.computed(()=>o.countDownIcon&&!!o.duration),l=r.computed(()=>o.duration||3e3),c=r.ref(Math.floor(l.value/1e3));let d=null;o.autoClose&&(d=setInterval(()=>{c.value>0?c.value--:u()},1e3));const u=()=>{p(),i("close")},p=()=>{d&&clearInterval(d)};return r.onUnmounted(()=>{p()}),e({close:u}),(h,f)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-toast",[`mc-toast-${t.type}`]]),style:r.normalizeStyle({width:t.width})},[r.createElementVNode("div",{class:r.normalizeClass(["mc-toast-msg-container",{"mc-toast-has-content":t.content||h.$slots.content}])},[s.value?(r.openBlock(),r.createElementBlock("div",hw,[r.createVNode(r.unref(ge),{name:s.value},null,8,["name"])])):r.createCommentVNode("",!0),t.message||h.$slots.default?(r.openBlock(),r.createElementBlock("div",fw,[r.renderSlot(h.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.message),1)],!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",mw,[a.value?(r.openBlock(),r.createElementBlock("div",gw,r.toDisplayString(c.value),1)):r.createCommentVNode("",!0),t.closable?(r.openBlock(),r.createElementBlock("div",vw,[r.createVNode(r.unref(ge),{name:"Cross",onClick:u})])):r.createCommentVNode("",!0)])],2),t.content||h.$slots.content?(r.openBlock(),r.createElementBlock("div",yw,[r.renderSlot(h.$slots,"content",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0)])):r.createCommentVNode("",!0)],6))}}),[["__scopeId","data-v-db24a98f"]]),on=[];let Ie=null;const Yi=t=>{let e={};e=typeof t=="string"?{message:t}:{...t},e.type=e.type||"info",e.autoClose=e.autoClose!==!1,e.closable=e.closable!==!1,on.length>=5&&on.length>0&&on[0].close();const n=Ie||(Ie=document.createElement("div"),Ie.className="mc-toast-container",Ie.style.position="fixed",Ie.style.top="5vh",Ie.style.left="50%",Ie.style.transform="translateX(-50%)",Ie.style.zIndex="9999",Ie.style.display="flex",Ie.style.flexDirection="column",Ie.style.gap="12px",Ie.style.pointerEvents="none",document.body.appendChild(Ie),Ie),o=document.createElement("div");o.style.pointerEvents="auto",o.style.animation="toast-slide-in 0.3s ease-out";const i=Date.now().toString(36)+Math.random().toString(36).slice(2),s=r.createVNode(Mh,{...e,onClose:()=>{o.style.animation="toast-slide-out 0.3s ease-in",e.onClose&&e.onClose(),setTimeout(()=>{(l=>{const c=on.findIndex(d=>d.id===l);if(c!==-1){const d=on[c];r.render(null,d.wrapper),Ie&&Ie.contains(d.wrapper)&&Ie.removeChild(d.wrapper),on.splice(c,1),Ie&&document.body.contains(Ie)&&on.length===0&&(document.body.removeChild(Ie),Ie=null)}})(i)},300)}});r.render(s,o),n.appendChild(o);const a={id:i,wrapper:o,close:()=>{var c;const l=s.component;l&&l.exposed&&((c=l.exposed)==null||c.close())}};return on.push(a),{...a}},Xi={success:t=>Yi(typeof t=="string"?{message:t,type:"success"}:{...t,type:"success"}),error:t=>Yi(typeof t=="string"?{message:t,type:"error"}:{...t,type:"error"}),warning:t=>Yi(typeof t=="string"?{message:t,type:"warning"}:{...t,type:"warning"}),info:t=>Yi(typeof t=="string"?{message:t,type:"info"}:{...t,type:"info"}),closeAll:()=>{on.forEach(t=>{t.close()})}};(()=>{if(document.getElementById("mc-toast-v2-styles"))return;const t=document.createElement("style");t.id="mc-toast-v2-styles",t.textContent=`
15
15
  @keyframes toast-slide-in {
16
16
  from {
17
17
  transform: translateY(100%);
@@ -33,19 +33,19 @@
33
33
  opacity: 0;
34
34
  }
35
35
  }
36
- `,document.head.appendChild(t)})();const Nh=ee(Mh),Bh="mc-copy",yw={class:"mc-copy"},bw={class:"mc-copy-text"},Th=ee(q(r.defineComponent({name:Bh,__name:"mc-copy",props:{text:{},showToast:{type:Boolean,default:!1},toastSuccessText:{default:"copy succeed"},toastErrorText:{default:"copy failed"},manual:{type:Boolean,default:!1}},emits:["copy","success","error"],setup(t,{emit:e}){const n=t,o=e,i=async()=>{if(n.text)if(n.manual)o("copy",n.text);else try{await navigator.clipboard.writeText(n.text),o("success",n.text),n.showToast&&Xi.success(n.toastSuccessText)}catch(s){console.error(s),o("error",n.text,s),n.showToast&&Xi.error(n.toastErrorText)}};return(s,a)=>(r.openBlock(),r.createElementBlock("div",yw,[r.renderSlot(s.$slots,"default",{},()=>[r.createElementVNode("span",bw,r.toDisplayString(t.text),1)],!0),r.createVNode(r.unref(ge),{name:"Duplicate",class:"mc-copy-icon",onClick:i})]))}}),[["__scopeId","data-v-549b134c"]])),Oh="mc-count",kw={key:0,class:"mc-count-number"},_h=ee(q(r.defineComponent({name:Oh,__name:"mc-count",props:{value:{},theme:{default:"red"},type:{default:"medium"},hiddenZero:{type:Boolean,default:!0},max:{default:99}},emits:["change"],setup(t,{emit:e}){const n=t,o=e,i=r.computed(()=>{const c=Number(n.value);return isNaN(c)?(console.warn("mc-count: value is not a number"),0):c}),s=r.computed(()=>!n.hiddenZero||i.value>0),a=r.computed(()=>n.max&&i.value>n.max?`${n.max}+`:`${i.value}`),l=r.computed(()=>n.type==="tiny");return r.watch(()=>n.value,(c,d)=>{c!==d&&o("change",c)}),(c,d)=>s.value?(r.openBlock(),r.createElementBlock("i",{key:0,class:r.normalizeClass(["mc-count",[`mc-count-${t.theme}`,`mc-count-${t.type}`]])},[l.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",kw,r.toDisplayString(a.value),1))],2)):r.createCommentVNode("",!0)}}),[["__scopeId","data-v-dac26190"]])),Vh="mc-currency-icon",ww={class:"mc-currency-icon-img-wrapper"},xw=["src","alt"],Cw={class:"mc-currency-icon-label"},Sw={class:"mc-currency-icon-text"},Ew=r.defineComponent({name:Vh,__name:"mc-currency-icon",props:{currency:{},direction:{default:"horizontal"},desc:{},cdnUrl:{},suffix:{default:"svg"},height:{},width:{}},setup(t){const e=t,{generateFileUrl:n}=(o=e.cdnUrl,i=e.suffix,{generateFileUrl:l=>{if(o&&i&&l)return`${o}/${l}.${i}`}});var o,i;const{width:s,height:a}=lt();return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-currency-icon",style:r.normalizeStyle({width:r.unref(s),height:r.unref(a)})},[r.createElementVNode("div",ww,[r.renderSlot(l.$slots,"icon",{},()=>[r.createElementVNode("img",{src:r.unref(n)(t.currency),class:"mc-currency-icon-img",alt:`${t.currency}-icon`},null,8,xw)],!0)]),r.createElementVNode("div",{class:r.normalizeClass(["mc-currency-icon-content",[`mc-currency-icon-content-${t.direction}`]])},[r.createElementVNode("div",Cw,[r.renderSlot(l.$slots,"default",{},()=>[r.createElementVNode("span",null,r.toDisplayString(t.currency),1)],!0)]),r.createElementVNode("div",Sw,[r.renderSlot(l.$slots,"desc",{},()=>[r.createElementVNode("span",null,r.toDisplayString(t.desc),1)],!0)])],2)],4))}}),Ah=ee(q(Ew,[["__scopeId","data-v-8858a1e7"]])),Dh="mc-date-picker",Ih="mc-date-picker-item",Rh="mc-date-picker-list",Lh="mc-date-picker-content",Ko=new Map([[0,{shortName:"Jan",fullName:"January"}],[1,{shortName:"Feb",fullName:"February"}],[2,{shortName:"Mar",fullName:"March"}],[3,{shortName:"Apr",fullName:"April"}],[4,{shortName:"May",fullName:"May"}],[5,{shortName:"Jun",fullName:"June"}],[6,{shortName:"Jul",fullName:"July"}],[7,{shortName:"Aug",fullName:"August"}],[8,{shortName:"Sep",fullName:"September"}],[9,{shortName:"Oct",fullName:"October"}],[10,{shortName:"Nov",fullName:"November"}],[11,{shortName:"Dec",fullName:"December"}]]),$h=new Map([[0,"Sun"],[1,"Mon"],[2,"Tue"],[3,"Wed"],[4,"Thu"],[5,"Fri"],[6,"Sat"]]),Mw={class:"mc-date-picker-item-text"},Nw=r.defineComponent({name:Ih,__name:"mc-date-picker-item",props:{isToday:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1},isActive:{type:Boolean,default:!1},isStart:{type:Boolean,default:!1},isEnd:{type:Boolean,default:!1},isDuration:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:e}){const n=e,o=()=>{n("click")};return(i,s)=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-date-picker-item",{"mc-date-picker-item-today":t.isToday,"mc-date-picker-item-disabled":t.isDisabled,"mc-date-picker-item-active":t.isActive,"mc-date-picker-item-start":t.isStart,"mc-date-picker-item-end":t.isEnd,"mc-date-picker-item-duration":t.isDuration}]),onClick:o},[r.createElementVNode("span",Mw,[r.renderSlot(i.$slots,"default",{},void 0,!0)])],2))}}),Bw=q(Nw,[["__scopeId","data-v-797f3810"]]),Uo=(t,e,n)=>{if(e.disabled||!n)return!1;const o=n.getFullYear(),i=n.getMonth(),s=n.getDate(),a=e.date.getFullYear(),l=e.date.getMonth(),c=e.date.getDate();return t==="day"?s===c&&i===l&&o===a:t==="month"?i===l&&o===a:t==="year"&&o===a},Vl=(t,e=1)=>{const n=new Date(t);return n.setFullYear(n.getFullYear()+e),n},Al=(t,e=1)=>{const n=new Date(t);return n.setFullYear(n.getFullYear()-e),n},Ph=(t,e="up")=>{const n=e==="up";switch(t){case"day":return n?"month":"day";case"month":return n?"year":"day";case"year":return n?"year":"month";default:return"day"}},Tw=r.defineComponent({name:Rh,__name:"mc-date-picker-list",props:{modelValue:{},startDate:{},endDate:{},range:{type:Boolean},type:{default:"day"},dateSeed:{default:()=>new Date}},emits:["update:modelValue","update:startDate","update:endDate","update:dateSeed","update:type"],setup(t,{expose:e,emit:n}){const o=t,i=n,{generateDays:s,generateMonths:a,generateYears:l}={generateDays:b=>{const y=[],k=b.getMonth(),x=b.getFullYear(),w=new Date(x,k+1,0).getDate();for(let N=1;N<=w;N++){const T=new Date(x,k,N);y.push({key:T.getTime(),type:"day",label:String(N),value:T.getDate(),date:T})}let C=42-y.length;const S=y[0].date,E=Math.min(S.getDay(),C);for(let N=1;N<=E;N++){const T=new Date(S);T.setDate(T.getDate()-N),y.unshift({key:T.getTime(),type:"day",label:String(T.getDate()),value:T.getDate(),date:T,disabled:!0})}C=42-y.length;const M=y[y.length-1].date;for(let N=1;N<=C;N++){const T=new Date(M);T.setDate(T.getDate()+N),y.push({key:T.getTime(),type:"day",label:String(T.getDate()),value:T.getDate(),date:T,disabled:!0})}return y},generateMonths:b=>{const y=b.getFullYear();return Array.from(Ko.entries()).map(([k,x])=>{const w=new Date(y,k,1);return{key:w.getTime(),type:"month",label:x.shortName,value:w.getMonth(),date:w}})},generateYears:b=>{const y=[];for(let k=1;k<=10;k++){const x=Al(b,k);y.unshift({key:x.getTime(),type:"year",label:String(x.getFullYear()),value:x.getFullYear(),date:x})}y.push({key:b.getTime(),type:"year",label:String(b.getFullYear()),value:b.getFullYear(),date:b});for(let k=1;k<=10;k++){const x=Vl(b,k);y.push({key:x.getTime(),type:"year",label:String(x.getFullYear()),value:x.getFullYear(),date:x})}return y}},c=r.computed(()=>o.type==="day"?s(o.dateSeed):o.type==="month"?a(o.dateSeed):o.type==="year"?l(o.dateSeed):[]),{updateDate:d}=(()=>{var C;const b=(C=r.getCurrentInstance())==null?void 0:C.emit,y=ue("range"),k=ue("startDate"),x=ue("endDate"),w=r.ref(!0);return{updateDate:S=>{y.value?((E=>{w.value?x.value&&x.value<E?(b==null||b("update:endDate",E),b==null||b("update:startDate",x.value)):b==null||b("update:startDate",E):k.value&&k.value>E?(b==null||b("update:startDate",E),b==null||b("update:endDate",k.value)):b==null||b("update:endDate",E)})(S),w.value=!w.value):(E=>{b==null||b("update:modelValue",E)})(S)}}})(),u=r.computed(()=>Array.from($h.values())),p=(b,y)=>!y.disabled&&Uo(b,y,new Date),h=(b,y)=>!y.disabled&&(o.range?Uo(b,y,o.startDate)||Uo(b,y,o.endDate):Uo(b,y,o.modelValue)),f=(b,y)=>!(y.disabled||!o.startDate||!o.endDate)&&Uo(b,y,o.startDate),m=(b,y)=>!(y.disabled||!o.startDate||!o.endDate)&&Uo(b,y,o.endDate),g=b=>{if(!o.startDate||!o.endDate)return!1;const y=b.date,k=o.startDate,x=o.endDate;return y>k&&y<x},v=r.computed(()=>o.type==="day");return e({setToday:()=>{i("update:dateSeed",new Date),i("update:type","day"),d(new Date)}}),(b,y)=>(r.openBlock(),r.createElementBlock("ul",{class:r.normalizeClass(["mc-date-picker-list",`mc-date-picker-list-${t.type}`])},[v.value?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(u.value,k=>(r.openBlock(),r.createElementBlock("li",{key:k,class:"mc-date-picker-list-weekday"},r.toDisplayString(k),1))),128)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,(k,x)=>(r.openBlock(),r.createBlock(Bw,{key:x,item:k,"is-disabled":k.disabled,"is-today":p(k.type,k),"is-active":h(k.type,k),"is-start":f(k.type,k),"is-end":m(k.type,k),"is-duration":g(k),onClick:()=>(w=>{if(o.type==="day")w.disabled&&i("update:dateSeed",w.date),d(w.date);else{i("update:dateSeed",w.date);const C=Ph(o.type,"down");i("update:type",C)}})(k)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(k.label),1)]),_:2},1032,["item","is-disabled","is-today","is-active","is-start","is-end","is-duration","onClick"]))),128))],2))}}),Ow=q(Tw,[["__scopeId","data-v-45c51c88"]]),_w={class:"mc-date-picker-content"},Vw={class:"mc-date-picker-header"},Aw={class:"mc-date-picker-display-text"},Dw={class:"mc-date-picker-navigation"},Iw={class:"mc-date-picker-footer"},Rw=q(r.defineComponent({name:Lh,__name:"mc-date-picker-content",props:{range:{type:Boolean,default:!1},modelValue:{},startDate:{},endDate:{}},emits:["update:modelValue","update:startDate","update:endDate","stop:close"],setup(t,{emit:e}){const n=t,o=e,i=r.ref((g=n.range,v=n.modelValue,b=n.startDate,y=g?b||new Date:v||new Date,new Date(y.getFullYear(),y.getMonth(),1))),s=r.ref("day"),a=r.computed(()=>{var C;const k=i.value.getFullYear(),x=i.value.getMonth(),w=(C=Ko.get(x))==null?void 0:C.fullName;return s.value==="day"?`${w} ${k}`:s.value==="month"?`${k}`:s.value==="year"?`${k-10} - ${k+10}`:""}),l=()=>{o("stop:close"),s.value==="day"?i.value=((k,x=1)=>{const w=new Date(k);return w.setMonth(w.getMonth()-x),w})(i.value):s.value==="month"?i.value=Al(i.value):s.value==="year"&&(i.value=Al(i.value,21))},c=()=>{o("stop:close"),s.value==="day"?i.value=((k,x=1)=>{const w=new Date(k);return w.setMonth(w.getMonth()+x),w})(i.value):s.value==="month"?i.value=Vl(i.value):s.value==="year"&&(i.value=Vl(i.value,21))},d=()=>{o("stop:close"),s.value=Ph(s.value)},u=r.ref(),p=()=>{var k;o("stop:close"),(k=u.value)==null||k.setToday()},h=k=>{o("update:modelValue",k)},f=k=>{o("update:startDate",k)},m=k=>{o("update:endDate",k)};var g,v,b,y;return(k,x)=>(r.openBlock(),r.createElementBlock("div",_w,[r.createElementVNode("div",Vw,[r.createElementVNode("div",{class:"mc-date-picker-date-display",onClick:d},[r.createElementVNode("span",Aw,r.toDisplayString(a.value),1),r.createVNode(r.unref(Ee),{class:"mc-date-picker-current-display-icon",name:"right-chevron-02",cursor:"pointer"})]),r.createElementVNode("div",Dw,[r.createVNode(r.unref(Ee),{name:"left-chevron",cursor:"pointer",onClick:l}),r.createVNode(r.unref(Ee),{name:"right-chevron",cursor:"pointer",onClick:c})])]),r.createVNode(Ow,{ref_key:"datePickerListRef",ref:u,"model-value":t.modelValue,"start-date":t.startDate,"end-date":t.endDate,range:t.range,"date-seed":i.value,"onUpdate:dateSeed":x[0]||(x[0]=w=>i.value=w),type:s.value,"onUpdate:type":x[1]||(x[1]=w=>s.value=w),"onUpdate:modelValue":h,"onUpdate:startDate":f,"onUpdate:endDate":m},null,8,["model-value","start-date","end-date","range","date-seed","type"]),r.createElementVNode("div",Iw,[r.createVNode(r.unref(Wi),{type:"plain",size:"small",onClick:p},{default:r.withCtx(()=>[...x[2]||(x[2]=[r.createTextVNode(" Today ",-1)])]),_:1})])]))}}),[["__scopeId","data-v-694005ff"]]),Lw=["id","placeholder","value","disabled"],$w={class:"mc-date-picker-icon-wrapper"},Pw={key:0,class:"mc-date-picker-status-icon"},zh=ee(q(r.defineComponent({name:Dh,__name:"mc-date-picker",props:{modelValue:{},startDate:{},width:{},height:{},endDate:{},disabled:{type:Boolean,default:!1},placeholder:{},range:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},disableValidation:{type:Boolean},hideValidationIcon:{type:Boolean}},emits:["clear","focus","blur","change","update:modelValue","update:startDate","update:endDate"],setup(t,{emit:e}){const n=t,o=e,{width:i,height:s}=lt(),a=r.ref(),{formId:l,formDisabled:c,validateStyle:d,statusIcon:u,validateByTrigger:p}=Nt(),{wrapperRef:h,isFocused:f,handleFocus:m,handleBlur:g}=Xn(a,{afterBlur:async()=>{await cl(300),await p("blur")}}),{isExpanded:v,popperRef:b,datePickerRef:y,popperOptions:k,toggleExpand:x}=(()=>{const O=r.ref(),A=r.ref(!1),F=ue("disabled"),R=W=>{F.value?A.value=!1:A.value=W};r.watch(F,W=>{W&&(A.value=!1)}),r.watch(A,W=>{var z,j;W?(z=O.value)==null||z.show():(j=O.value)==null||j.hide()});const L=r.ref();Hi(L,()=>{A.value=!1},"mousedown");let I=null;const P=()=>{I&&clearTimeout(I),I=null};return{isExpanded:A,popperRef:O,datePickerRef:L,popperOptions:{modifiers:[{name:"offset",options:{offset:[0,0]}}]},toggleExpand:R,closeExpand:(W=1e3)=>{P(),I=setTimeout(()=>{R(!1),P()},W)},stopClose:()=>{P()}}})(),w=O=>{o("update:modelValue",O),x(!1)},C=O=>{o("update:startDate",O)},S=O=>{o("update:endDate",O),x(!1)},E=r.computed(()=>!!v.value||!!f.value),M=()=>{n.disabled||x(!v.value)},N=r.computed(()=>{var O,A,F;if(n.modelValue){const R=n.modelValue.getFullYear(),L=n.modelValue.getMonth(),I=n.modelValue.getDate(),P=(O=Ko.get(L))==null?void 0:O.fullName;return`${I} ${P} ${R}`}if(n.startDate||n.endDate){let R="",L="";if(n.startDate){const I=n.startDate.getFullYear(),P=n.startDate.getMonth(),W=n.startDate.getDate(),z=(A=Ko.get(P))==null?void 0:A.fullName;R=`${W} ${z} ${I}`}if(n.endDate){const I=n.endDate.getFullYear(),P=n.endDate.getMonth(),W=n.endDate.getDate(),z=(F=Ko.get(P))==null?void 0:F.fullName;L=`${W} ${z} ${I}`}return`${R} - ${L}`}}),T=r.computed(()=>n.placeholder?n.placeholder:n.range?"dd mmm yyyy - dd mmm yyyy":"dd mmm yyyy"),D=r.ref(),{isHovering:$}=ul(D),B=r.computed(()=>!(c.value||!$.value||!n.clearable||(n.range?!n.startDate&&!n.endDate:!n.modelValue))),V=()=>{o("update:modelValue",void 0),o("update:startDate",void 0),o("update:endDate",void 0),o("clear"),x(!1)};return(O,A)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"datePickerRef",ref:y,class:r.normalizeClass(["mc-date-picker",{"mc-date-picker-actived":E.value,"mc-date-picker-disabled":r.unref(c),[r.unref(d)]:r.unref(d)}]),style:r.normalizeStyle({width:r.unref(i),height:r.unref(s)})},[r.createVNode(r.unref(Gi),{ref_key:"popperRef",ref:b,placement:"bottom-start",trigger:"manual","show-arrow":!1,"popper-options":r.unref(k),"hide-timeout":100},{content:r.withCtx(()=>[r.createVNode(Rw,{"model-value":t.modelValue,"start-date":t.startDate,"end-date":t.endDate,range:t.range,"onUpdate:modelValue":w,"onUpdate:startDate":C,"onUpdate:endDate":S},null,8,["model-value","start-date","end-date","range"])]),default:r.withCtx(()=>[r.createElementVNode("div",{ref_key:"triggerRef",ref:h,class:"mc-date-picker-input-wrapper",onClick:M},[r.createElementVNode("input",{id:r.unref(l),ref_key:"inputRef",ref:a,class:"mc-date-picker-input",placeholder:T.value,value:N.value,type:"text",readonly:"",disabled:r.unref(c),onFocus:A[0]||(A[0]=(...F)=>r.unref(m)&&r.unref(m)(...F)),onBlur:A[1]||(A[1]=(...F)=>r.unref(g)&&r.unref(g)(...F)),onKeypress:r.withKeys(M,["enter"])},null,40,Lw),r.createElementVNode("div",$w,[r.unref(u)?(r.openBlock(),r.createElementBlock("span",Pw,[r.createVNode(r.unref(ge),{name:r.unref(u)},null,8,["name"])])):r.createCommentVNode("",!0),r.createElementVNode("span",{ref_key:"calendarIconRef",ref:D,class:"mc-date-picker-calendar-icon",onClick:A[2]||(A[2]=r.withModifiers(()=>{},["stop"]))},[B.value?(r.openBlock(),r.createBlock(r.unref(Ee),{key:0,name:"rejectfail",cursor:"pointer",size:18,onClick:V})):(r.openBlock(),r.createBlock(r.unref(Ee),{key:1,name:"calendar",cursor:r.unref(c)?"not-allowed":"pointer"},null,8,["cursor"]))],512)])],512)]),_:1},8,["popper-options"])],6))}}),[["__scopeId","data-v-25e143a5"]])),Fh="mc-divider",Dl=ee(q(r.defineComponent({name:Fh,__name:"mc-divider",props:{size:{default:"small"},emphasis:{default:"minimal"},orientation:{default:"horizontal"}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-divider",[`mc-divider-${t.orientation}`,`mc-divider-${t.size}`,`mc-divider-${t.emphasis}`]])},null,2))}),[["__scopeId","data-v-7b6ad4ad"]])),jh="mc-overlay",zw={key:0},Fw=r.defineComponent({name:jh,__name:"mc-overlay",props:{visible:{type:Boolean},fixed:{type:Boolean,default:!0},portCssSelector:{default:"body"}},emits:["click"],setup(t,{expose:e,emit:n}){const o=t,i=n;r.onBeforeMount(()=>{const a=document.querySelector(o.portCssSelector);a&&window.getComputedStyle(a).position==="static"&&(a.style.position="relative")});const s=r.ref();return e({ref:s}),(a,l)=>t.visible?(r.openBlock(),r.createElementBlock("div",zw,[(r.openBlock(),r.createBlock(r.Teleport,{to:t.portCssSelector},[r.createElementVNode("div",{ref_key:"_ref",ref:s,class:"mc-overlay",onClick:l[0]||(l[0]=c=>(d=>{d.target===s.value&&i("click")})(c)),style:r.normalizeStyle({position:t.fixed?"fixed":"absolute"})},[r.renderSlot(a.$slots,"default",{},void 0,!0)],4)],8,["to"]))])):r.createCommentVNode("",!0)}}),Qi=ee(q(Fw,[["__scopeId","data-v-e3860c3c"]])),Hh="mc-reset",Il=ee(q(r.defineComponent({name:Hh,__name:"mc-reset",props:{rotate:{type:Boolean,default:!1},autoRotate:{type:Boolean,default:!0},duration:{default:300}},emits:["reset"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(!1),s=r.computed(()=>n.autoRotate?i.value:n.rotate),a=async()=>{o("reset"),n.autoRotate&&(i.value=!0,await cl(n.duration),i.value=!1)};return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-reset",onClick:a},[r.createVNode(r.unref(ge),{name:"Refresh",size:24,class:r.normalizeClass(["mc-reset-icon",{"mc-reset-rotate":s.value}])},null,8,["class"]),r.createElementVNode("span",null,[r.renderSlot(l.$slots,"default",{},()=>[c[0]||(c[0]=r.createTextVNode("Reset",-1))],!0)])]))}}),[["__scopeId","data-v-6b9f7103"]])),Wh="mc-title-toolbar",jw={key:0,class:"mc-title-toolbar-reset"},Hw={key:1,class:"mc-title-toolbar-line"},Ww={key:2,class:"mc-title-toolbar-mandatory"},Rl=ee(q(r.defineComponent({name:Wh,__name:"mc-title-tool-bar",props:{showReset:{type:Boolean,default:!0},showMandatory:{type:Boolean,default:!0}},emits:["reset"],setup(t,{expose:e,emit:n}){const o=r.ref(),i=n,s=r.ref(!1);let a;const l=Io(()=>{clearTimeout(a),s.value=!0,a=setTimeout(()=>{s.value=!1},300),i("reset")},300);return e({ref:o}),(c,d)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-title-toolbar",ref_key:"_ref",ref:o},[t.showReset?(r.openBlock(),r.createElementBlock("div",jw,[r.createVNode(r.unref(Il),{rotate:s.value,onReset:r.unref(l),"auto-rotate":!1},{default:r.withCtx(()=>[r.renderSlot(c.$slots,"reset",{},void 0,!0)]),_:3},8,["rotate","onReset"])])):r.createCommentVNode("",!0),t.showReset&&t.showMandatory?(r.openBlock(),r.createElementBlock("div",Hw)):r.createCommentVNode("",!0),t.showMandatory?(r.openBlock(),r.createElementBlock("div",Ww,[r.renderSlot(c.$slots,"mandatory",{},()=>[d[0]||(d[0]=r.createTextVNode("Mandatory",-1))],!0)])):r.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-bdba2ae8"]])),Kh="mc-title",Kw={class:"mc-title-content"},Uw={class:"mc-title-text"},qw={class:"mc-title-tool-bar"},Ll=ee(q(r.defineComponent({name:Kh,__name:"mc-title",props:{width:{default:"100%"},height:{default:"auto"},title:{},showToolBar:{type:Boolean,default:!0},showBorder:{type:Boolean,default:!1},showReset:{type:Boolean,default:!0},showMandatory:{type:Boolean,default:!0}},emits:["reset"],setup(t,{expose:e,emit:n}){const o=n,i=r.ref();return e({ref:i}),(s,a)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-title",{"mc-title-border":t.showBorder}]),ref_key:"_ref",ref:i,style:r.normalizeStyle({width:t.width,height:t.height})},[r.createElementVNode("div",Kw,[r.renderSlot(s.$slots,"default",{},()=>[r.createElementVNode("h1",Uw,r.toDisplayString(t.title),1)],!0)]),r.createElementVNode("div",qw,[r.renderSlot(s.$slots,"tool-bar",{},()=>[t.showToolBar?(r.openBlock(),r.createBlock(r.unref(Rl),{key:0,"show-reset":t.showReset,"show-mandatory":t.showMandatory,onReset:a[0]||(a[0]=l=>o("reset"))},{reset:r.withCtx(()=>[r.renderSlot(s.$slots,"reset",{},void 0,!0)]),mandatory:r.withCtx(()=>[r.renderSlot(s.$slots,"mandatory",{},void 0,!0)]),_:3},8,["show-reset","show-mandatory"])):r.createCommentVNode("",!0)],!0)])],6))}}),[["__scopeId","data-v-a7488e2a"]])),Uh="mc-modal-header",Jw={class:"mc-modal-header"},Zi=ee(q(r.defineComponent({name:Uh,__name:"mc-modal-header",props:{title:{},showBorder:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0}},emits:["close"],setup(t,{emit:e}){const n=e;return(o,i)=>(r.openBlock(),r.createElementBlock("div",Jw,[r.createVNode(r.unref(Ll),{title:t.title,"show-border":t.showBorder,height:"100%",class:"mc-modal-header-title"},{"tool-bar":r.withCtx(()=>[r.createVNode(r.unref(ge),{name:"Cross",size:24,class:"mc-modal-header-close-icon",onClick:i[0]||(i[0]=s=>n("close"))})]),default:r.withCtx(()=>[r.renderSlot(o.$slots,"default",{},void 0,!0)]),_:3},8,["title","show-border"])]))}}),[["__scopeId","data-v-1b48d2ce"]])),qh="mc-footer",Gw={key:0,class:"mc-footer-content"},Yw={class:"mc-footer-bottom"},Xw={class:"mc-footer-bottom-content"},Qw={class:"mc-footer-left"},Zw={class:"mc-footer-right"},e1={class:"mc-footer-right-button-group"},es=ee(q(r.defineComponent({name:qh,__name:"mc-footer",props:{width:{},height:{},wrapperWidth:{},showborder:{type:Boolean,default:!0}},setup(t,{expose:e}){const n=r.ref();return e({ref:n}),(o,i)=>(r.openBlock(),r.createElementBlock("section",{class:r.normalizeClass(["mc-footer",{"mc-footer-border":t.showborder}]),style:r.normalizeStyle({width:t.width,height:t.height}),ref_key:"_ref",ref:n},[o.$slots.desc?(r.openBlock(),r.createElementBlock("div",Gw,[r.createElementVNode("div",{class:"mc-footer-wrapper",style:r.normalizeStyle({width:t.wrapperWidth})},[r.renderSlot(o.$slots,"desc",{},void 0,!0)],4)])):r.createCommentVNode("",!0),r.createElementVNode("div",Yw,[r.createElementVNode("div",{class:"mc-footer-wrapper",style:r.normalizeStyle({width:t.wrapperWidth})},[r.createElementVNode("div",Xw,[r.createElementVNode("div",Qw,[r.renderSlot(o.$slots,"left",{},void 0,!0)]),r.createElementVNode("div",Zw,[r.renderSlot(o.$slots,"right",{},()=>[r.createElementVNode("div",e1,[r.renderSlot(o.$slots,"right-button-group",{},void 0,!0)])],!0)])])],4)])],6))}}),[["__scopeId","data-v-99697235"]])),Jh=(t=300)=>{const e=r.ref(!1),n=r.ref(!1),o=()=>{e.value=!0},i=()=>{e.value=!1},s=()=>{n.value=!0},a=()=>{n.value=!1};let l=null;const c=()=>{l&&clearTimeout(l)};return r.onUnmounted(()=>{c()}),{isOverlayShow:e,isContentShow:n,setOverlayShow:o,setOverlayHide:i,setContentShow:s,setContentHide:a,openOverlay:()=>{c(),o(),l=setTimeout(()=>{s()},t)},closeOverlay:()=>{c(),a(),l=setTimeout(()=>{i()},t)}}},Gh="mc-drawer",t1={key:0,class:"mc-drawer-container"},n1={class:"mc-drawer-header"},o1={class:"mc-drawer-content-wrapper"},r1={class:"mc-drawer-content"},i1={key:0,class:"mc-drawer-footer"},s1=r.defineComponent({name:Gh,__name:"mc-drawer",props:{modelValue:{type:Boolean},title:{},size:{default:"medium"},maskClosable:{type:Boolean,default:!0},fixed:{type:Boolean,default:!0},portCssSelector:{default:"body"},showBorder:{type:Boolean,default:!0},hideFooter:{type:Boolean,default:!1},position:{default:"right"}},emits:["update:modelValue","close"],setup(t,{expose:e,emit:n}){const o=t,i=r.ref(!1),{isOverlayShow:s,isContentShow:a,openOverlay:l,closeOverlay:c}=Jh(),d=()=>{i.value=!0,l()},u=()=>{c()},p=()=>{i.value=!1,h("close"),h("update:modelValue",!1)};r.watch(()=>o.modelValue,(v,b)=>{!b&&v?d():u()});const h=n,f=()=>{o.maskClosable&&u()},m=()=>{u()},g=r.ref();return e({ref:g,open:d,close:u}),(v,b)=>i.value?(r.openBlock(),r.createElementBlock("div",t1,[r.createVNode(r.Transition,{name:"mc-drawer-overlay",onAfterLeave:p},{default:r.withCtx(()=>[r.createVNode(r.unref(Qi),{visible:r.unref(s),fixed:t.fixed,"port-css-selector":t.portCssSelector,onClick:f},{default:r.withCtx(()=>[r.createVNode(r.Transition,{name:`mc-drawer-content-${t.position}`},{default:r.withCtx(()=>[r.unref(a)?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["mc-drawer",[`mc-drawer-${t.size}`,`mc-drawer-${t.position}`]]),ref_key:"_ref",ref:g},[r.createElementVNode("div",n1,[r.renderSlot(v.$slots,"header",{},()=>[r.createVNode(r.unref(Zi),{title:t.title,"show-border":t.showBorder,onClose:m},{default:r.withCtx(()=>[r.renderSlot(v.$slots,"header-title",{},void 0,!0)]),_:3},8,["title","show-border"])],!0)]),r.createElementVNode("div",o1,[r.createElementVNode("div",r1,[r.renderSlot(v.$slots,"default",{},void 0,!0)])]),t.hideFooter?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",i1,[r.renderSlot(v.$slots,"footer",{},()=>[r.createVNode(r.unref(es),null,{left:r.withCtx(()=>[r.renderSlot(v.$slots,"footer-left",{},void 0,!0)]),right:r.withCtx(()=>[r.renderSlot(v.$slots,"footer-right",{},void 0,!0)]),"right-button-group":r.withCtx(()=>[r.renderSlot(v.$slots,"footer-right-button-group",{},void 0,!0)]),desc:r.withCtx(()=>[r.renderSlot(v.$slots,"footer-desc",{},void 0,!0)]),_:3})],!0)]))],2)):r.createCommentVNode("",!0)]),_:3},8,["name"])]),_:3},8,["visible","fixed","port-css-selector"])]),_:3})])):r.createCommentVNode("",!0)}}),Yh=ee(q(s1,[["__scopeId","data-v-bee2c674"]])),Rr=Symbol("mc-input-group-context"),Xh="mc-input-group",Qh=ee(q(r.defineComponent({name:Xh,__name:"mc-input-group",props:{disabled:{type:Boolean,default:!1},suffixFlex:{default:1},prefixFlex:{default:1}},setup(t){const e=t,n=r.ref(!1);return r.provide(Rr,{disabled:r.computed(()=>e.disabled),setValidateStatus:o=>{n.value=o==="error"}}),(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-input-group",{"is-error":n.value,"is-disabled":t.disabled}])},[r.createElementVNode("div",{class:"mc-input-group-prefix",style:r.normalizeStyle({flex:t.prefixFlex})},[r.renderSlot(o.$slots,"prefix",{},void 0,!0)],4),i[0]||(i[0]=r.createElementVNode("div",{class:"mc-input-group-divider"},null,-1)),r.createElementVNode("div",{class:"mc-input-group-suffix",style:r.normalizeStyle({flex:t.suffixFlex})},[r.renderSlot(o.$slots,"suffix",{},void 0,!0)],4)],2))}}),[["__scopeId","data-v-d55c7451"]])),Zh="mc-input",Wt=".",a1={key:0,class:"mc-input-prepend"},l1={class:"mc-input-container"},c1=["id","value","placeholder","type","disabled","readonly","autocomplete","autofocus","maxlength"],d1={key:0,class:"mc-input-placeholder"},u1={key:0},p1={key:1,class:"mc-input-status-icon"},h1={key:2,class:"mc-input-toolbar"},f1={key:3,class:"mc-input-append"},m1=r.defineComponent({name:Zh,__name:"mc-input",props:{modelValue:{},id:{},type:{default:"text"},placeholder:{default:"Please enter"},disabled:{type:Boolean,default:!1},prefixIcon:{},suffixIcon:{},autocomplete:{type:Boolean,default:!0},readonly:{type:Boolean},autofocus:{type:Boolean},maxlength:{},textAlign:{},currencyAccuracy:{default:void 0},disableValidation:{type:Boolean},hideValidationIcon:{type:Boolean},validateProp:{},clearable:{type:Boolean},width:{default:320},height:{default:40}},emits:["update:modelValue","focus","blur","input","change","paste","delete","clear"],setup(t,{emit:e}){const n=t,o=e,{width:i,height:s}=lt(),a=r.ref(),l=r.inject(Rr,void 0),{formId:c,formDisabled:d,validateStyle:u,validateStatus:p,statusIcon:h,isError:f,validateByTrigger:m}=Nt({externalDisabled:r.computed(()=>!!(l!=null&&l.disabled.value))});r.watch(p,I=>{l&&l.setValidateStatus(I)});const{wrapperRef:g,isFocused:v,handleFocus:b,handleBlur:y}=Xn(a,{afterBlur(){m("blur")}}),k=I=>{var P,W,z;y(I),n.type!=="currency"&&n.type!=="number"||((P=n.modelValue)!=null&&P.startsWith(Wt)&&o("update:modelValue",`0${n.modelValue}`),(W=n.modelValue)!=null&&W.endsWith(Wt)&&o("update:modelValue",(z=n.modelValue)==null?void 0:z.slice(0,-1)))},{inputType:x,passwordVisible:w,handlePasswordVisible:C}=(()=>{const I=ue("type"),P=r.ref(!1);return{inputType:r.computed(()=>I.value==="password"?P.value?"text":"password":"text"),passwordVisible:P,handlePasswordVisible:()=>{P.value=!P.value}}})(),{formatter:S,parser:E}=(()=>{const I=ue("type"),P=(z,j)=>((K,G)=>{if(ye(G))return K;const[Z,J]=K.split(Wt);if(G>0&&K.includes(Wt)){const Y=J.slice(0,G);return`${Z}${Wt}${Y}`}return Z})(z=(K=>{const G=K.indexOf(Wt);return G!==-1&&(K=K.substring(0,G+1)+K.substring(G+1).replace(/\./g,"")),K})(z=z.replace(/[^0-9.]/g,"")),j),W=(z,j)=>P(z,j);return{formatter:(z,j)=>I.value==="number"?P(z,j):I.value==="currency"?(K=>{const[G,Z]=K.split(Wt),J=G.replace(/(\d)(?=(\d{3})+$)/g,"$1,");return K.includes(Wt)?`${J}${Wt}${Z}`:J})(P(z,j)):z,parser:(z,j)=>I.value==="number"?W(z,j):I.value==="currency"?(K=>K.replace(/(?:[^0-9.]+)/g,""))(W(z,j)):z}})(),M=r.computed(()=>S(ye(n.modelValue)?"":n.modelValue.toString(),n.currencyAccuracy)),{recordCursor:N,setCursor:T,handleAdjustCursor:D}=(I=>{const P=r.reactive({}),W=ue("type");return{recordCursor:()=>{if(!I.value)return;const{selectionStart:z,selectionEnd:j,value:K}=I.value;if(!z||!j)return;const G=K.slice(0,z),Z=K.slice(j);zu(P,{selectionStart:z,selectionEnd:j,value:K,beforeTxt:G,afterTxt:Z})},setCursor:()=>{if(!I.value)return;const{value:z}=I.value,{beforeTxt:j,afterTxt:K,selectionStart:G}=P;if(!j||!K||!G)return;let Z=z.length;if(function(J,Y,te){J=To(J),Y=bi(Y);var pe=J.length,X=te=te===void 0?pe:qu(Un(te),0,pe);return(te-=Y.length)>=0&&J.slice(te,X)==Y}(z,K))Z=z.length-K.length;else if(function(J,Y,te){return J=To(J),te=te==null?0:qu(Un(te),0,J.length),Y=bi(Y),J.slice(te,te+Y.length)==Y}(z,j))Z=j.length;else{const J=j[G-1],Y=z.indexOf(J,G-1);Y!==-1&&(Z=Y+1)}I.value.setSelectionRange(Z,Z)},handleAdjustCursor:z=>{if(!I.value||W.value!=="currency")return;const j=I.value,{value:K,selectionStart:G,selectionEnd:Z}=j;if(!K||!G||!Z||G!==Z)return;let J=0;if(z==="left"?J=G-2:z==="right"?J=G:z==="click"&&(J=G-1),K[J]===","){const Y=z==="click"?J:J+1;I.value.setSelectionRange(Y,Y)}}}})(a);r.watch(()=>n.currencyAccuracy,()=>{const I=E(n.modelValue??"",n.currencyAccuracy);o("update:modelValue",I)});const $=I=>{o("update:modelValue",I),o("input",I)},B=async I=>{const{value:P}=I.target;N();const W=E(P,n.currencyAccuracy);Be(W)?(a.value.value="",$(W)):function(z,j){return Li(z,j)}(W,n.modelValue)?a.value.value=S(W,n.currencyAccuracy):$(W),await r.nextTick(),T(),m("input")},V=()=>{o("delete")},O=I=>{o("paste",I)},A=I=>{const{value:P}=I.target;o("change",E(P))},{showClearIcon:F,mouseOverIcon:R}=(()=>{const I=r.ref(!1),P=ue("modelValue"),W=ue("clearable"),z=ue("disabled");return{showClearIcon:r.computed(()=>!!W.value&&I.value&&!z.value&&!Be(P.value)),mouseOverIcon:j=>{W.value&&!z.value&&(I.value=j)}}})(),L=()=>{o("update:modelValue",""),o("clear")};return(I,P)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"wrapperRef",ref:g,class:r.normalizeClass(["mc-input-plus",{"is-disabled":r.unref(d),"is-focused":r.unref(v),"is-active":!r.unref(Be)(M.value),[r.unref(u)]:r.unref(u)}]),style:r.normalizeStyle({width:r.unref(i),height:r.unref(s)}),onMouseenter:P[4]||(P[4]=W=>r.unref(R)(!0)),onMouseleave:P[5]||(P[5]=W=>r.unref(R)(!1))},[I.$slots.prepend?(r.openBlock(),r.createElementBlock("div",a1,[r.renderSlot(I.$slots,"prepend",{},void 0,!0)])):r.createCommentVNode("",!0),r.renderSlot(I.$slots,"prefix",{},()=>[t.prefixIcon?(r.openBlock(),r.createBlock(r.unref(Ee),{key:0,class:"mc-input-icon",name:t.prefixIcon},null,8,["name"])):r.createCommentVNode("",!0)],!0),r.createElementVNode("div",l1,[r.createElementVNode("input",{id:r.unref(c),ref_key:"inputRef",ref:a,value:M.value,class:"mc-input-inner",style:r.normalizeStyle({textAlign:t.textAlign}),placeholder:t.placeholder,type:r.unref(x),disabled:r.unref(d),readonly:t.readonly||r.unref(d),autocomplete:t.autocomplete?"on":"off",autofocus:t.autofocus,maxlength:t.maxlength,onFocus:P[0]||(P[0]=(...W)=>r.unref(b)&&r.unref(b)(...W)),onBlur:k,onInput:B,onChange:A,onKeydown:[r.withKeys(V,["delete"]),P[2]||(P[2]=r.withKeys(()=>r.unref(D)("left"),["left"])),P[3]||(P[3]=r.withKeys(()=>r.unref(D)("right"),["right"]))],onPaste:O,onClick:P[1]||(P[1]=()=>r.unref(D)("click"))},null,44,c1),t.placeholder||I.$slots.placeholder?r.withDirectives((r.openBlock(),r.createElementBlock("div",d1,[r.renderSlot(I.$slots,"placeholder",{},()=>[t.placeholder?(r.openBlock(),r.createElementBlock("span",u1,r.toDisplayString(t.placeholder),1)):r.createCommentVNode("",!0)],!0)],512)),[[r.vShow,!M.value]]):r.createCommentVNode("",!0)]),r.renderSlot(I.$slots,"suffix",{},()=>[t.suffixIcon?(r.openBlock(),r.createBlock(r.unref(Ee),{key:0,class:"mc-input-icon",name:t.suffixIcon},null,8,["name"])):r.createCommentVNode("",!0)],!0),r.unref(h)?(r.openBlock(),r.createElementBlock("div",p1,[r.createVNode(r.unref(Ee),{name:r.unref(f)?"reject-fail-rev":"accept-success-rev"},null,8,["name"])])):r.createCommentVNode("",!0),t.type==="password"||t.clearable?(r.openBlock(),r.createElementBlock("div",h1,[t.type==="password"?(r.openBlock(),r.createBlock(r.unref(Ee),{key:0,class:"mc-input-icon",name:r.unref(w)?"view-hidden":"view",cursor:"pointer",onClick:r.unref(C)},null,8,["name","onClick"])):r.createCommentVNode("",!0),r.withDirectives(r.createVNode(r.unref(Ee),{class:"mc-input-icon",name:"rejectfail",size:16,cursor:"pointer",onClick:L},null,512),[[r.vShow,r.unref(F)]])])):r.createCommentVNode("",!0),I.$slots.append?(r.openBlock(),r.createElementBlock("div",f1,[r.renderSlot(I.$slots,"append",{},void 0,!0)])):r.createCommentVNode("",!0)],38))}}),$l=ee(q(m1,[["__scopeId","data-v-11de44de"]])),ef="mc-lightbox",g1={key:0,class:"mc-lightbox-container"},v1={class:"mc-lightbox-header"},y1={class:"mc-lightbox-content-wrapper"},b1={key:0,class:"mc-lightbox-footer"},k1=r.defineComponent({name:ef,__name:"mc-lightbox",props:{modelValue:{type:Boolean,default:!1},title:{},size:{default:"medium"},maskClosable:{type:Boolean,default:!0},fixed:{type:Boolean,default:!0},portCssSelector:{default:"body"},hideFooter:{type:Boolean,default:!1},showBorder:{type:Boolean,default:!1},minHeight:{default:void 0}},emits:["update:modelValue","open","close"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref(),a=r.ref(),l=r.ref(!1),{isOverlayShow:c,isContentShow:d,openOverlay:u,closeOverlay:p}=Jh(),h=()=>{o.maskClosable&&g()},f=()=>{g()},m=()=>{l.value=!0,u(),i("open"),i("update:modelValue",!0)},g=()=>{p()},v=()=>{l.value=!1,i("close"),i("update:modelValue",!1)};return r.onMounted(()=>{o.modelValue&&m()}),r.watch(()=>o.modelValue,(b,y)=>{!y&&b?m():y&&!b&&g()}),e({ref:s,open:m,close:g}),(b,y)=>l.value?(r.openBlock(),r.createElementBlock("div",g1,[r.createVNode(r.Transition,{name:"mc-lightbox-overlay",onAfterLeave:v},{default:r.withCtx(()=>[r.createVNode(r.unref(Qi),{visible:r.unref(c),fixed:t.fixed,"port-css-selector":t.portCssSelector,onClick:h},{default:r.withCtx(()=>[r.createVNode(r.Transition,{name:"mc-lightbox-content"},{default:r.withCtx(()=>[r.unref(d)?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["mc-lightbox",[`mc-lightbox-${t.size}`]]),ref_key:"lightboxRef",ref:s},[r.createElementVNode("div",v1,[r.renderSlot(b.$slots,"header",{},()=>[r.createVNode(r.unref(Zi),{title:t.title,"show-border":t.showBorder,onClose:f},{default:r.withCtx(()=>[r.renderSlot(b.$slots,"header-title",{},void 0,!0)]),_:3},8,["title","show-border"])],!0)]),r.createElementVNode("div",y1,[r.createElementVNode("div",{class:"mc-lightbox-content",style:r.normalizeStyle({minHeight:t.minHeight?`${t.minHeight}px`:void 0}),ref_key:"contentRef",ref:a},[r.renderSlot(b.$slots,"default",{},void 0,!0)],4)]),t.hideFooter?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",b1,[r.renderSlot(b.$slots,"footer",{},()=>[r.createVNode(r.unref(es),null,{left:r.withCtx(()=>[r.renderSlot(b.$slots,"footer-left",{},void 0,!0)]),right:r.withCtx(()=>[r.renderSlot(b.$slots,"footer-right",{},void 0,!0)]),"right-button-group":r.withCtx(()=>[r.renderSlot(b.$slots,"footer-right-button-group",{},void 0,!0)]),desc:r.withCtx(()=>[r.renderSlot(b.$slots,"footer-desc",{},void 0,!0)]),_:3})],!0)]))],2)):r.createCommentVNode("",!0)]),_:3})]),_:3},8,["visible","fixed","port-css-selector"])]),_:3})])):r.createCommentVNode("",!0)}}),tf=ee(q(k1,[["__scopeId","data-v-120fea0c"]])),nf="mc-loading",w1={key:0,class:"mc-loading-pulse"},x1={key:1,class:"mc-loading-spin"},C1={class:"mc-loading-text"},Pl=ee(q(r.defineComponent({name:nf,__name:"mc-loading",props:{loading:{type:Boolean},loadingText:{},size:{default:"medium"},type:{default:"spin"}},setup(t){const e=t,n=r.computed(()=>e.size==="small"?24:e.size==="medium"?32:64);return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-loading",[`mc-loading-${t.size}`,{"mc-loading-active":t.loading}]])},[t.type==="pulse"?(r.openBlock(),r.createElementBlock("div",w1,[...i[0]||(i[0]=[r.createElementVNode("i",{class:"mc-loading-pulse-dot"},null,-1),r.createElementVNode("i",{class:"mc-loading-pulse-dot"},null,-1),r.createElementVNode("i",{class:"mc-loading-pulse-dot"},null,-1),r.createElementVNode("i",{class:"mc-loading-pulse-dot"},null,-1)])])):t.type==="spin"?(r.openBlock(),r.createElementBlock("div",x1,[r.createVNode(r.unref(ge),{name:"Loading_Line",size:n.value},null,8,["size"])])):r.createCommentVNode("",!0),t.loadingText||o.$slots.default?r.renderSlot(o.$slots,"default",{key:2},()=>[r.createElementVNode("p",C1,r.toDisplayString(t.loadingText),1)],!0):r.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-f7edd2a3"]])),of="mc-removable-tag",S1={class:"mc-removable-tag-content"},E1=r.defineComponent({name:of,__name:"mc-removable-tag",props:{label:{},value:{},disabled:{type:Boolean,default:!1}},emits:["remove"],setup(t,{emit:e}){const n=t,o=e,i=()=>{n.disabled||o("remove",n.value)};return(s,a)=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-removable-tag",{"mc-removable-tag-disabled":t.disabled}])},[r.createElementVNode("span",S1,[r.renderSlot(s.$slots,"default",{label:t.label},()=>[r.createTextVNode(r.toDisplayString(t.label??t.value),1)],!0)]),t.disabled?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(r.unref(Ee),{key:0,class:"mc-removable-tag-close-icon",name:"cross",cursor:t.disabled?"not-allowed":"pointer",onClick:i},null,8,["cursor"]))],2))}}),zl=ee(q(E1,[["__scopeId","data-v-e80a358c"]])),rf="mc-multi-tag",M1={class:"mc-multi-tag-label"},N1={class:"mc-multi-tag-option-list"},sf=ee(q(r.defineComponent({name:rf,__name:"mc-multi-tag",props:{label:{},tags:{default:()=>[]},disabled:{type:Boolean,default:!1},disableTags:{default:()=>[]}},emits:["remove:all","remove:tag"],setup(t,{emit:e}){const n=t,o=e,i=r.computed(()=>n.disabled||n.disableTags.length),s=l=>{n.disabled||o("remove:tag",l,n.label)},a=()=>{i.value||o("remove:all",n.label)};return(l,c)=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-multi-tag",{"mc-multi-tag-disabled":t.disabled}])},[i.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createVNode(r.unref(Ee),{class:"mc-multi-tag-close-all-icon",name:"cross",cursor:t.disabled?"not-allowed":"pointer",onClick:a},null,8,["cursor"]),c[0]||(c[0]=r.createElementVNode("i",{class:"mc-multi-tag-divider"},null,-1))],64)),r.createElementVNode("span",M1,r.toDisplayString(`${t.label} :`),1),r.createElementVNode("ul",N1,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.tags,d=>{return r.openBlock(),r.createBlock(r.unref(zl),{key:d,label:d.label,value:d.value,disabled:(u=d.value,!!n.disabled||!!n.disableTags.includes(u)),onRemove:s},null,8,["label","value","disabled"]);var u}),128))])],2))}}),[["__scopeId","data-v-a55e30d7"]])),af="mc-otp",B1=["id"],T1={class:"mc-otp-input-list"},O1=["onClick"],_1=["onUpdate:modelValue","disabled","onInput","onKeydown"],V1=r.defineComponent({name:af,__name:"mc-otp",props:{modelValue:{},disabled:{type:Boolean,default:!1},length:{default:6},disableValidation:{type:Boolean},hideValidationIcon:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,i=r.ref([]),s=r.reactive(new Array(n.length)),{focusIndex:a,setFocus:l,nextFocus:c,prevFocus:d}=(b=>{const y=r.ref(),k=S=>{y.value=S};Hi(b,()=>{ye(y.value)||m("blur"),k(void 0)});const x=ue("length"),w=S=>{var T;const E=x.value??0;S<0&&(S=0),S>E-1&&(S=E-1),y.value=S;const M=b.value[S],N=(T=M==null?void 0:M.children)==null?void 0:T[0];N==null||N.focus()},C=ue("modelValue");return{focusIndex:y,setFocusIndex:k,setFocus:w,nextFocus:()=>{r.nextTick(()=>{var E;const S=((E=C.value)==null?void 0:E.length)??0;S<(x.value??0)&&w(S)})},prevFocus:()=>{r.nextTick(()=>{var E;const S=((E=C.value)==null?void 0:E.length)??0;S-1>=0&&w(S-1)})}}})(i),{formId:u,formDisabled:p,validateStyle:h,statusIcon:f,validateByTrigger:m}=Nt({externalDisabled:r.computed(()=>n.disabled)}),g=b=>{for(let y=0;y<n.length;y++)s[y]=(b==null?void 0:b[y])||""};r.onMounted(()=>{g(n.modelValue)}),r.watch(()=>n.modelValue,b=>{g(b)});const v=async()=>{o("change",s.join("")),o("update:modelValue",s.join("")),await r.nextTick(),m("input")};return r.watchEffect(()=>{var b;if((((b=n.modelValue)==null?void 0:b.length)??0)>n.length)throw new Error("modelValue length is greater than length.")}),(b,y)=>(r.openBlock(),r.createElementBlock("div",{id:r.unref(u),class:r.normalizeClass(["mc-otp",{"mc-otp-disabled":r.unref(p),[r.unref(h)]:r.unref(h)}])},[r.createElementVNode("ul",T1,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.length,k=>(r.openBlock(),r.createElementBlock("li",{key:k,class:r.normalizeClass(["mc-otp-input-item",{"mc-otp-input-item-focus":r.unref(a)===k-1}]),ref_for:!0,ref:x=>((w,C)=>{C&&(i.value[w]=C)})(k-1,x),onClick:x=>(async w=>{Be(s[w])?c():l(w)})(k-1)},[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":x=>s[k-1]=x,class:"mc-otp-input",type:"number",disabled:r.unref(p),onInput:x=>(async(w,C)=>{if(p.value)return;const S=C.target;let E=S.value.slice(0,1);S.value=E,s[w]=E,v(),E&&c()})(k-1,x),onPaste:y[0]||(y[0]=x=>(async w=>{var S;if(w.preventDefault(),p.value)return;const C=((S=w.clipboardData)==null?void 0:S.getData("text").slice(0,n.length))||"";g(C),v(),c()})(x)),onKeydown:[r.withKeys(r.withModifiers(x=>(async w=>{s[w]="",v(),d()})(k-1),["prevent","stop"]),["backspace"]),r.withKeys(r.withModifiers(x=>r.unref(l)(k-2),["prevent","stop"]),["left"]),r.withKeys(r.withModifiers(x=>r.unref(l)(k),["prevent","stop"]),["right"]),y[2]||(y[2]=r.withKeys(r.withModifiers(()=>{},["prevent","stop"]),["tab"]))],onMousedown:y[1]||(y[1]=r.withModifiers(()=>{},["prevent"]))},null,40,_1),[[r.vModelText,s[k-1]]])],10,O1))),128))]),r.unref(f)?(r.openBlock(),r.createBlock(r.unref(ge),{key:0,class:"mc-otp-status-icon",name:r.unref(f),size:24},null,8,["name"])):r.createCommentVNode("",!0)],10,B1))}}),lf=ee(q(V1,[["__scopeId","data-v-bc5e6a1e"]])),qo=Math.min,vt=Math.max,ts=Math.round,ns=Math.floor,Kt=t=>({x:t,y:t}),A1={left:"right",right:"left",bottom:"top",top:"bottom"},D1={start:"end",end:"start"};function cf(t,e,n){return vt(t,qo(e,n))}function rs(t,e){return typeof t=="function"?t(e):t}function to(t){return t.split("-")[0]}function is(t){return t.split("-")[1]}function df(t){return t==="x"?"y":"x"}function uf(t){return t==="y"?"height":"width"}const I1=new Set(["top","bottom"]);function wn(t){return I1.has(to(t))?"y":"x"}function pf(t){return df(wn(t))}function Fl(t){return t.replace(/start|end/g,e=>D1[e])}const hf=["left","right"],ff=["right","left"],R1=["top","bottom"],L1=["bottom","top"];function ss(t){return t.replace(/left|right|bottom|top/g,e=>A1[e])}function as(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function mf(t,e,n){let{reference:o,floating:i}=t;const s=wn(e),a=pf(e),l=uf(a),c=to(e),d=s==="y",u=o.x+o.width/2-i.width/2,p=o.y+o.height/2-i.height/2,h=o[l]/2-i[l]/2;let f;switch(c){case"top":f={x:u,y:o.y-i.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:p};break;case"left":f={x:o.x-i.width,y:p};break;default:f={x:o.x,y:o.y}}switch(is(e)){case"start":f[a]-=h*(n&&d?-1:1);break;case"end":f[a]+=h*(n&&d?-1:1)}return f}async function jl(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:s,rects:a,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:h=!1,padding:f=0}=rs(e,t),m=function(w){return typeof w!="number"?function(C){return{top:0,right:0,bottom:0,left:0,...C}}(w):{top:w,right:w,bottom:w,left:w}}(f),g=l[h?p==="floating"?"reference":"floating":p],v=as(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),b=p==="floating"?{x:o,y:i,width:a.floating.width,height:a.floating.height}:a.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),k=await(s.isElement==null?void 0:s.isElement(y))&&await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1},x=as(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:y,strategy:c}):b);return{top:(v.top-x.top+m.top)/k.y,bottom:(x.bottom-v.bottom+m.bottom)/k.y,left:(v.left-x.left+m.left)/k.x,right:(x.right-v.right+m.right)/k.x}}function ls(){return typeof window<"u"}function no(t){return Hl(t)?(t.nodeName||"").toLowerCase():"#document"}function yt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ut(t){var e;return(e=(Hl(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Hl(t){return!!ls()&&(t instanceof Node||t instanceof yt(t).Node)}function It(t){return!!ls()&&(t instanceof Element||t instanceof yt(t).Element)}function qt(t){return!!ls()&&(t instanceof HTMLElement||t instanceof yt(t).HTMLElement)}function gf(t){return!(!ls()||typeof ShadowRoot>"u")&&(t instanceof ShadowRoot||t instanceof yt(t).ShadowRoot)}const $1=new Set(["inline","contents"]);function Lr(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=Rt(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!$1.has(i)}const P1=new Set(["table","td","th"]);function z1(t){return P1.has(no(t))}const F1=[":popover-open",":modal"];function cs(t){return F1.some(e=>{try{return t.matches(e)}catch{return!1}})}const j1=["transform","translate","scale","rotate","perspective"],H1=["transform","translate","scale","rotate","perspective","filter"],W1=["paint","layout","strict","content"];function Wl(t){const e=Kl(),n=It(t)?Rt(t):t;return j1.some(o=>!!n[o]&&n[o]!=="none")||!!n.containerType&&n.containerType!=="normal"||!e&&!!n.backdropFilter&&n.backdropFilter!=="none"||!e&&!!n.filter&&n.filter!=="none"||H1.some(o=>(n.willChange||"").includes(o))||W1.some(o=>(n.contain||"").includes(o))}function Kl(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const K1=new Set(["html","body","#document"]);function Jo(t){return K1.has(no(t))}function Rt(t){return yt(t).getComputedStyle(t)}function ds(t){return It(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function xn(t){if(no(t)==="html")return t;const e=t.assignedSlot||t.parentNode||gf(t)&&t.host||Ut(t);return gf(e)?e.host:e}function vf(t){const e=xn(t);return Jo(e)?t.ownerDocument?t.ownerDocument.body:t.body:qt(e)&&Lr(e)?e:vf(e)}function $r(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=vf(t),s=i===((o=t.ownerDocument)==null?void 0:o.body),a=yt(i);if(s){const l=Ul(a);return e.concat(a,a.visualViewport||[],Lr(i)?i:[],l&&n?$r(l):[])}return e.concat(i,$r(i,[],n))}function Ul(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function yf(t){const e=Rt(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=qt(t),s=i?t.offsetWidth:n,a=i?t.offsetHeight:o,l=ts(n)!==s||ts(o)!==a;return l&&(n=s,o=a),{width:n,height:o,$:l}}function ql(t){return It(t)?t:t.contextElement}function Go(t){const e=ql(t);if(!qt(e))return Kt(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:s}=yf(e);let a=(s?ts(n.width):n.width)/o,l=(s?ts(n.height):n.height)/i;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}const U1=Kt(0);function bf(t){const e=yt(t);return Kl()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:U1}function oo(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=ql(t);let a=Kt(1);e&&(o?It(o)&&(a=Go(o)):a=Go(t));const l=function(h,f,m){return f===void 0&&(f=!1),!(!m||f&&m!==yt(h))&&f}(s,n,o)?bf(s):Kt(0);let c=(i.left+l.x)/a.x,d=(i.top+l.y)/a.y,u=i.width/a.x,p=i.height/a.y;if(s){const h=yt(s),f=o&&It(o)?yt(o):o;let m=h,g=Ul(m);for(;g&&o&&f!==m;){const v=Go(g),b=g.getBoundingClientRect(),y=Rt(g),k=b.left+(g.clientLeft+parseFloat(y.paddingLeft))*v.x,x=b.top+(g.clientTop+parseFloat(y.paddingTop))*v.y;c*=v.x,d*=v.y,u*=v.x,p*=v.y,c+=k,d+=x,m=yt(g),g=Ul(m)}}return as({width:u,height:p,x:c,y:d})}function us(t,e){const n=ds(t).scrollLeft;return e?e.left+n:oo(Ut(t)).left+n}function kf(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-us(t,n),y:n.top+e.scrollTop}}const q1=new Set(["absolute","fixed"]);function wf(t,e,n){let o;if(e==="viewport")o=function(i,s){const a=yt(i),l=Ut(i),c=a.visualViewport;let d=l.clientWidth,u=l.clientHeight,p=0,h=0;if(c){d=c.width,u=c.height;const m=Kl();(!m||m&&s==="fixed")&&(p=c.offsetLeft,h=c.offsetTop)}const f=us(l);if(f<=0){const m=l.ownerDocument,g=m.body,v=getComputedStyle(g),b=m.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,y=Math.abs(l.clientWidth-g.clientWidth-b);y<=25&&(d-=y)}else f<=25&&(d+=f);return{width:d,height:u,x:p,y:h}}(t,n);else if(e==="document")o=function(i){const s=Ut(i),a=ds(i),l=i.ownerDocument.body,c=vt(s.scrollWidth,s.clientWidth,l.scrollWidth,l.clientWidth),d=vt(s.scrollHeight,s.clientHeight,l.scrollHeight,l.clientHeight);let u=-a.scrollLeft+us(i);const p=-a.scrollTop;return Rt(l).direction==="rtl"&&(u+=vt(s.clientWidth,l.clientWidth)-c),{width:c,height:d,x:u,y:p}}(Ut(t));else if(It(e))o=function(i,s){const a=oo(i,!0,s==="fixed"),l=a.top+i.clientTop,c=a.left+i.clientLeft,d=qt(i)?Go(i):Kt(1);return{width:i.clientWidth*d.x,height:i.clientHeight*d.y,x:c*d.x,y:l*d.y}}(e,n);else{const i=bf(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return as(o)}function xf(t,e){const n=xn(t);return!(n===e||!It(n)||Jo(n))&&(Rt(n).position==="fixed"||xf(n,e))}function J1(t,e,n){const o=qt(e),i=Ut(e),s=n==="fixed",a=oo(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const c=Kt(0);function d(){c.x=us(i)}if(o||!o&&!s)if((no(e)!=="body"||Lr(i))&&(l=ds(e)),o){const p=oo(e,!0,s,e);c.x=p.x+e.clientLeft,c.y=p.y+e.clientTop}else i&&d();s&&!o&&i&&d();const u=!i||o||s?Kt(0):kf(i,l);return{x:a.left+l.scrollLeft-c.x-u.x,y:a.top+l.scrollTop-c.y-u.y,width:a.width,height:a.height}}function Jl(t){return Rt(t).position==="static"}function Cf(t,e){if(!qt(t)||Rt(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Ut(t)===n&&(n=n.ownerDocument.body),n}function Sf(t,e){const n=yt(t);if(cs(t))return n;if(!qt(t)){let i=xn(t);for(;i&&!Jo(i);){if(It(i)&&!Jl(i))return i;i=xn(i)}return n}let o=Cf(t,e);for(;o&&z1(o)&&Jl(o);)o=Cf(o,e);return o&&Jo(o)&&Jl(o)&&!Wl(o)?n:o||function(i){let s=xn(i);for(;qt(s)&&!Jo(s);){if(Wl(s))return s;if(cs(s))return null;s=xn(s)}return null}(t)||n}const G1={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s=i==="fixed",a=Ut(o),l=!!e&&cs(e.floating);if(o===a||l&&s)return n;let c={scrollLeft:0,scrollTop:0},d=Kt(1);const u=Kt(0),p=qt(o);if((p||!p&&!s)&&((no(o)!=="body"||Lr(a))&&(c=ds(o)),qt(o))){const f=oo(o);d=Go(o),u.x=f.x+o.clientLeft,u.y=f.y+o.clientTop}const h=!a||p||s?Kt(0):kf(a,c);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+u.x+h.x,y:n.y*d.y-c.scrollTop*d.y+u.y+h.y}},getDocumentElement:Ut,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=n==="clippingAncestors"?cs(e)?[]:function(d,u){const p=u.get(d);if(p)return p;let h=$r(d,[],!1).filter(v=>It(v)&&no(v)!=="body"),f=null;const m=Rt(d).position==="fixed";let g=m?xn(d):d;for(;It(g)&&!Jo(g);){const v=Rt(g),b=Wl(g);b||v.position!=="fixed"||(f=null),(m?!b&&!f:!b&&v.position==="static"&&f&&q1.has(f.position)||Lr(g)&&!b&&xf(d,g))?h=h.filter(y=>y!==g):f=v,g=xn(g)}return u.set(d,h),h}(e,this._c):[].concat(n),a=[...s,o],l=a[0],c=a.reduce((d,u)=>{const p=wf(e,u,i);return d.top=vt(p.top,d.top),d.right=qo(p.right,d.right),d.bottom=qo(p.bottom,d.bottom),d.left=vt(p.left,d.left),d},wf(e,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:Sf,getElementRects:async function(t){const e=this.getOffsetParent||Sf,n=this.getDimensions,o=await n(t.floating);return{reference:J1(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=yf(t);return{width:e,height:n}},getScale:Go,isElement:It,isRTL:function(t){return Rt(t).direction==="rtl"}};function Ef(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Y1(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,d=ql(t),u=i||s?[...d?$r(d):[],...$r(e)]:[];u.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const p=d&&l?function(v,b){let y,k=null;const x=Ut(v);function w(){var C;clearTimeout(y),(C=k)==null||C.disconnect(),k=null}return function C(S,E){S===void 0&&(S=!1),E===void 0&&(E=1),w();const M=v.getBoundingClientRect(),{left:N,top:T,width:D,height:$}=M;if(S||b(),!D||!$)return;const B={rootMargin:-ns(T)+"px "+-ns(x.clientWidth-(N+D))+"px "+-ns(x.clientHeight-(T+$))+"px "+-ns(N)+"px",threshold:vt(0,qo(1,E))||1};let V=!0;function O(A){const F=A[0].intersectionRatio;if(F!==E){if(!V)return C();F?C(!1,F):y=setTimeout(()=>{C(!1,1e-7)},1e3)}F!==1||Ef(M,v.getBoundingClientRect())||C(),V=!1}try{k=new IntersectionObserver(O,{...B,root:x.ownerDocument})}catch{k=new IntersectionObserver(O,B)}k.observe(v)}(!0),w}(d,n):null;let h,f=-1,m=null;a&&(m=new ResizeObserver(v=>{let[b]=v;b&&b.target===d&&m&&(m.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=m)==null||y.observe(e)})),n()}),d&&!c&&m.observe(d),m.observe(e));let g=c?oo(t):null;return c&&function v(){const b=oo(t);g&&!Ef(g,b)&&n(),g=b,h=requestAnimationFrame(v)}(),n(),()=>{var v;u.forEach(b=>{i&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),p==null||p(),(v=m)==null||v.disconnect(),m=null,c&&cancelAnimationFrame(h)}}const X1=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:s,rects:a,initialPlacement:l,platform:c,elements:d}=e,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...v}=rs(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=to(i),y=wn(l),k=to(l)===l,x=await(c.isRTL==null?void 0:c.isRTL(d.floating)),w=h||(k||!g?[ss(l)]:function(B){const V=ss(B);return[Fl(B),V,Fl(V)]}(l)),C=m!=="none";!h&&C&&w.push(...function(B,V,O,A){const F=is(B);let R=function(L,I,P){switch(L){case"top":case"bottom":return P?I?ff:hf:I?hf:ff;case"left":case"right":return I?R1:L1;default:return[]}}(to(B),O==="start",A);return F&&(R=R.map(L=>L+"-"+F),V&&(R=R.concat(R.map(Fl)))),R}(l,g,m,x));const S=[l,...w],E=await jl(e,v),M=[];let N=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&M.push(E[b]),p){const B=function(V,O,A){A===void 0&&(A=!1);const F=is(V),R=pf(V),L=uf(R);let I=R==="x"?F===(A?"end":"start")?"right":"left":F==="start"?"bottom":"top";return O.reference[L]>O.floating[L]&&(I=ss(I)),[I,ss(I)]}(i,a,x);M.push(E[B[0]],E[B[1]])}if(N=[...N,{placement:i,overflows:M}],!M.every(B=>B<=0)){var T,D;const B=(((T=s.flip)==null?void 0:T.index)||0)+1,V=S[B];if(V&&(p!=="alignment"||y===wn(V)||N.every(A=>wn(A.placement)!==y||A.overflows[0]>0)))return{data:{index:B,overflows:N},reset:{placement:V}};let O=(D=N.filter(A=>A.overflows[0]<=0).sort((A,F)=>A.overflows[1]-F.overflows[1])[0])==null?void 0:D.placement;if(!O)switch(f){case"bestFit":{var $;const A=($=N.filter(F=>{if(C){const R=wn(F.placement);return R===y||R==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(R=>R>0).reduce((R,L)=>R+L,0)]).sort((F,R)=>F[1]-R[1])[0])==null?void 0:$[0];A&&(O=A);break}case"initialPlacement":O=l}if(i!==O)return{reset:{placement:O}}}return{}}}},Q1=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:s,platform:a,elements:l}=e,{apply:c=()=>{},...d}=rs(t,e),u=await jl(e,d),p=to(i),h=is(i),f=wn(i)==="y",{width:m,height:g}=s.floating;let v,b;p==="top"||p==="bottom"?(v=p,b=h===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(b=p,v=h==="end"?"top":"bottom");const y=g-u.top-u.bottom,k=m-u.left-u.right,x=qo(g-u[v],y),w=qo(m-u[b],k),C=!e.middlewareData.shift;let S=x,E=w;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(E=k),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(S=y),C&&!h){const N=vt(u.left,0),T=vt(u.right,0),D=vt(u.top,0),$=vt(u.bottom,0);f?E=m-2*(N!==0||T!==0?N+T:vt(u.left,u.right)):S=g-2*(D!==0||$!==0?D+$:vt(u.top,u.bottom))}await c({...e,availableWidth:E,availableHeight:S});const M=await a.getDimensions(l.floating);return m!==M.width||g!==M.height?{reset:{rects:!0}}:{}}}};function Mf(t){if(function(e){return e!=null&&typeof e=="object"&&"$el"in e}(t)){const e=t.$el;return Hl(e)&&no(e)==="#comment"?null:e}return t}function Pr(t){return typeof t=="function"?t():r.unref(t)}function Nf(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Bf(t,e){const n=Nf(t);return Math.round(e*n)/n}const Tf="mc-popper-plus",Z1={class:"mc-popper-plus"},ex=r.defineComponent({name:Tf,__name:"mc-popper-plus",props:{isShow:{type:Boolean},placement:{default:"bottom-start"},strategy:{default:"absolute"},teleportTo:{default:""}},emits:["update:isShow","update:placement"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(),s=r.ref(),{x:a,y:l,strategy:c,placement:d}=function(p,h,f){f===void 0&&(f={});const m=f.whileElementsMounted,g=r.computed(()=>{var O;return(O=Pr(f.open))==null||O}),v=r.computed(()=>Pr(f.middleware)),b=r.computed(()=>{var O;return(O=Pr(f.placement))!=null?O:"bottom"}),y=r.computed(()=>{var O;return(O=Pr(f.strategy))!=null?O:"absolute"}),k=r.computed(()=>{var O;return(O=Pr(f.transform))==null||O}),x=r.computed(()=>Mf(p.value)),w=r.computed(()=>Mf(h.value)),C=r.ref(0),S=r.ref(0),E=r.ref(y.value),M=r.ref(b.value),N=r.shallowRef({}),T=r.ref(!1),D=r.computed(()=>{const O={position:E.value,left:"0",top:"0"};if(!w.value)return O;const A=Bf(w.value,C.value),F=Bf(w.value,S.value);return k.value?{...O,transform:"translate("+A+"px, "+F+"px)",...Nf(w.value)>=1.5&&{willChange:"transform"}}:{position:E.value,left:A+"px",top:F+"px"}});let $;function B(){if(x.value==null||w.value==null)return;const O=g.value;((A,F,R)=>{const L=new Map,I={platform:G1,...R},P={...I.platform,_c:L};return(async(W,z,j)=>{const{placement:K="bottom",strategy:G="absolute",middleware:Z=[],platform:J}=j,Y=Z.filter(Boolean),te=await(J.isRTL==null?void 0:J.isRTL(z));let pe=await J.getElementRects({reference:W,floating:z,strategy:G}),{x:X,y:oe}=mf(pe,K,te),ae=K,se={},be=0;for(let Fe=0;Fe<Y.length;Fe++){const{name:Me,fn:Ne}=Y[Fe],{x:de,y:me,data:at,reset:Le}=await Ne({x:X,y:oe,initialPlacement:K,placement:ae,strategy:G,middlewareData:se,rects:pe,platform:J,elements:{reference:W,floating:z}});X=de??X,oe=me??oe,se={...se,[Me]:{...se[Me],...at}},Le&&be<=50&&(be++,typeof Le=="object"&&(Le.placement&&(ae=Le.placement),Le.rects&&(pe=Le.rects===!0?await J.getElementRects({reference:W,floating:z,strategy:G}):Le.rects),{x:X,y:oe}=mf(pe,ae,te)),Fe=-1)}return{x:X,y:oe,placement:ae,strategy:G,middlewareData:se}})(A,F,{...I,platform:P})})(x.value,w.value,{middleware:v.value,placement:b.value,strategy:y.value}).then(A=>{C.value=A.x,S.value=A.y,E.value=A.strategy,M.value=A.placement,N.value=A.middlewareData,T.value=O!==!1})}function V(){typeof $=="function"&&($(),$=void 0)}return r.watch([v,b,y,g],B,{flush:"sync"}),r.watch([x,w],function(){V(),m!==void 0?x.value==null||w.value==null||($=m(x.value,w.value,B)):B()},{flush:"sync"}),r.watch(g,function(){g.value||(T.value=!1)},{flush:"sync"}),r.getCurrentScope()&&r.onScopeDispose(V),{x:r.shallowReadonly(C),y:r.shallowReadonly(S),strategy:r.shallowReadonly(E),placement:r.shallowReadonly(M),middlewareData:r.shallowReadonly(N),isPositioned:r.shallowReadonly(T),floatingStyles:D,update:B}}(i,s,{whileElementsMounted:Y1,placement:n.placement,strategy:n.strategy,middleware:[X1({fallbackPlacements:["top-start"]}),(u===void 0&&(u={}),{name:"shift",options:u,async fn(p){const{x:h,y:f,placement:m}=p,{mainAxis:g=!0,crossAxis:v=!1,limiter:b={fn:N=>{let{x:T,y:D}=N;return{x:T,y:D}}},...y}=rs(u,p),k={x:h,y:f},x=await jl(p,y),w=wn(to(m)),C=df(w);let S=k[C],E=k[w];if(g){const N=C==="y"?"bottom":"right";S=cf(S+x[C==="y"?"top":"left"],S,S-x[N])}if(v){const N=w==="y"?"bottom":"right";E=cf(E+x[w==="y"?"top":"left"],E,E-x[N])}const M=b.fn({...p,[C]:S,[w]:E});return{...M,data:{x:M.x-h,y:M.y-f,enabled:{[C]:g,[w]:v}}}}}),Q1({apply({rects:p,elements:h}){Object.assign(h.floating.style,{width:`${p.reference.width}px`})}})]});var u;return r.watch(d,p=>{o("update:placement",p)}),(p,h)=>(r.openBlock(),r.createElementBlock("div",Z1,[r.createElementVNode("div",{ref_key:"triggerRef",ref:i,class:"mc-popper-trigger"},[r.renderSlot(p.$slots,"default",{},void 0,!0)],512),(r.openBlock(),r.createBlock(r.Teleport,{to:t.teleportTo||"body",disabled:!t.teleportTo},[t.isShow?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"contentRef",ref:s,class:"mc-popper-content",style:r.normalizeStyle({position:r.unref(c),top:`${r.unref(l)??0}px`,left:`${r.unref(a)??0}px`})},[r.renderSlot(p.$slots,"content",{},void 0,!0)],4)):r.createCommentVNode("",!0)],8,["to","disabled"]))]))}}),ps=ee(q(ex,[["__scopeId","data-v-448b7a83"]])),Of="mc-progress-bar",tx={key:0,class:"mc-progress-bar-shimmer"},nx={key:0,class:"mc-progress-bar-remarks"},Gl=ee(q(r.defineComponent({name:Of,__name:"mc-progress-bar",props:{percentage:{default:0},height:{default:"4px"},width:{default:"100%"},remarks:{},showPercentage:{type:Boolean,default:!1},transitionDuration:{default:300},shimmer:{type:Boolean,default:!1}},emits:["update:percentage","complete"],setup(t,{expose:e,emit:n}){const o=t,i=n,{width:s,height:a}=lt(),l=r.ref();r.watchEffect(()=>{l.value&&l.value.style.setProperty("--border-radius",a.value||"auto")});const c=r.computed(()=>{const p=o.percentage/100;return p>1?1:p<0?0:p});r.watch(()=>o.percentage,p=>{p>=100&&i("complete")},{immediate:!0});const d=r.useSlots(),u=r.computed(()=>o.showPercentage||!!o.remarks||!!d.remarks);return e({updatePercentage:p=>{i("update:percentage",p)},complete:()=>{i("update:percentage",100),i("complete")},reset:()=>{i("update:percentage",0)}}),(p,h)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-progress-bar",style:r.normalizeStyle({width:r.unref(s)})},[r.createElementVNode("div",{ref_key:"progressBarRef",ref:l,class:"mc-progress-bar-wrapper",style:r.normalizeStyle({width:r.unref(s),height:r.unref(a)})},[r.createElementVNode("div",{class:"mc-progress-bar-inner",style:r.normalizeStyle({transform:`scaleX(${c.value})`,transitionDuration:`${t.transitionDuration}ms`})},null,4),t.shimmer?(r.openBlock(),r.createElementBlock("i",tx)):r.createCommentVNode("",!0)],4),u.value?(r.openBlock(),r.createElementBlock("div",nx,[r.renderSlot(p.$slots,"remarks",{},()=>[r.createElementVNode("span",null,r.toDisplayString(t.remarks||`${r.unref(Uu)(100*c.value)}%`),1)],!0)])):r.createCommentVNode("",!0)],4))}}),[["__scopeId","data-v-9ef9daf3"]])),_f="mc-success-icon",Yo=ee(q(r.defineComponent({name:_f,__name:"mc-success-icon",props:{width:{default:"40px"},height:{default:"40px"}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("svg",{class:"success-icon",style:r.normalizeStyle({width:t.width,height:t.height}),viewBox:"0 0 400 400"},[...n[0]||(n[0]=[r.createElementVNode("circle",{class:"circle",fill:"none",transform:"rotate(-90 200 200)","stroke-width":"20",cx:"200",cy:"200",r:"190","stroke-linecap":"round"},null,-1),r.createElementVNode("polyline",{class:"tick",fill:"none","stroke-width":"26",points:"120,214 173,260 274,160","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],4))}),[["__scopeId","data-v-9078d5a9"]])),Vf="mc-progress-indicator",Af="mc-progress-indicator-step",Df="mc-progress-indicator-step-num",ox={key:0,class:"mc-progress-indicator-step-num-icon"},rx={key:1},ix=q(r.defineComponent({name:Df,__name:"mc-progress-indicator-step-num",props:{num:{},status:{default:"default"},showSuccessIcon:{type:Boolean,default:!0},isChild:{type:Boolean,default:!1},icon:{}},setup(t){const e=t,n=r.computed(()=>e.showSuccessIcon&&e.status==="success"&&!e.isChild);return(o,i)=>n.value?(r.openBlock(),r.createBlock(r.unref(Yo),{key:0})):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["mc-progress-indicator-step-num",[`mc-progress-indicator-step-num-${t.status}`,{"mc-progress-indicator-step-num-child":t.isChild}]])},[t.isChild?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",ox,[t.icon?(r.openBlock(),r.createBlock(r.unref(Ee),{key:0,name:t.icon},null,8,["name"])):(r.openBlock(),r.createElementBlock("span",rx,r.toDisplayString(t.num),1))]))],2))}}),[["__scopeId","data-v-2ba90f0e"]]);class If{constructor(e,n){ke(this,"id");ke(this,"stepKey");ke(this,"index");ke(this,"parentIndex");ke(this,"childIndex");ke(this,"label");ke(this,"icon");ke(this,"showContent");ke(this,"success");ke(this,"hiddenHeader");ke(this,"hiddenFooter");ke(this,"hiddenFooterLeft");ke(this,"hiddenFooterRight");ke(this,"previousStep");ke(this,"nextStep");ke(this,"parentStep");ke(this,"childrenSteps");ke(this,"iconSlot");ke(this,"labelSlot");ke(this,"defaultSlot");ke(this,"contentTitleSlot");ke(this,"contentToolbarSlot");ke(this,"contentSlot");ke(this,"contentFooterSlot");ke(this,"contentFooterLeftSlot");ke(this,"contentFooterRightSlot");var i;const o=((s=10)=>String(Date.now()).slice(-s))();this.id=e!=null&&e.id||e!=null&&e.step?`${o}-${(i=e==null?void 0:e.step)==null?void 0:i.toString()}`:o,this.stepKey=e==null?void 0:e.step,this.label=e==null?void 0:e.label,this.icon=e==null?void 0:e.icon,this.showContent=Ft(e,"show-content"),this.success=e==null?void 0:e.success,this.hiddenHeader=Ft(e,"hidden-header"),this.hiddenFooter=Ft(e,"hidden-footer"),this.hiddenFooterLeft=Ft(e,"hidden-footer-left"),this.hiddenFooterRight=Ft(e,"hidden-footer-right"),this.iconSlot=n==null?void 0:n.icon,this.labelSlot=n==null?void 0:n.label,this.defaultSlot=n==null?void 0:n.default,this.contentTitleSlot=Ft(n,"content-title"),this.contentToolbarSlot=Ft(n,"content-toolbar"),this.contentSlot=n==null?void 0:n.content,this.contentFooterSlot=Ft(n,"content-footer"),this.contentFooterLeftSlot=Ft(n,"content-footer-left"),this.contentFooterRightSlot=Ft(n,"content-footer-right")}get isChild(){return!!this.parentStep}get hasChildren(){var e;return!!((e=this.childrenSteps)!=null&&e.size)}getChildrenSteps(){var e;return Array.from(((e=this.childrenSteps)==null?void 0:e.values())||[])}hasChildStep(e){var n;return!!((n=this.childrenSteps)!=null&&n.has(e))}getFirstChildStep(){var e;return(e=this.childrenSteps)==null?void 0:e.values().next().value}getLastChildStep(){var e;return Array.from(((e=this.childrenSteps)==null?void 0:e.values())||[]).pop()}appendChildStep(e){this.childrenSteps||(this.childrenSteps=new Map),this.childrenSteps.set(e.stepKey,e)}removeChildStep(e){var n,o;(n=this.childrenSteps)==null||n.delete(e),((o=this.childrenSteps)==null?void 0:o.size)===0&&(this.childrenSteps=void 0)}clearContent(){this.defaultSlot=void 0,this.contentSlot=void 0,this.contentTitleSlot=void 0,this.contentToolbarSlot=void 0,this.contentFooterSlot=void 0,this.contentFooterLeftSlot=void 0,this.contentFooterRightSlot=void 0}}const Yl="mc-progress-indicator-item",sx={class:"mc-grogress-indicator-item"},Rf=ee(r.defineComponent({name:Yl,__name:"mc-progress-indicator-item",props:{icon:{},id:{},step:{},label:{},showContent:{type:Boolean},success:{type:Boolean},hiddenHeader:{type:Boolean},hiddenFooter:{type:Boolean},hiddenFooterLeft:{type:Boolean},hiddenFooterRight:{type:Boolean}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",sx))})),Xl="mc-progress-indicator-child-item",ax={class:"mc-grogress-indicator-child-item"},Lf=ee(r.defineComponent({name:Xl,__name:"mc-progress-indicator-child-item",props:{id:{},step:{},label:{},showContent:{type:Boolean},success:{type:Boolean},hiddenHeader:{type:Boolean},hiddenFooter:{type:Boolean},hiddenFooterLeft:{type:Boolean},hiddenFooterRight:{type:Boolean}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",ax))})),lx=(t,e)=>t===0?"first":t===e-1?"last":"middle",hs=(t,e,n="manual")=>{const o=r.unref(e);if(Np(t==null?void 0:t.success)&&t.success||t!=null&&t.parentStep&&hs(t.parentStep,e)==="success")return"success";if(!(o&&t&&Sr(o.index)&&Sr(t.index)))return"default";if(n==="auto"){if(t.isChild||!t.hasChildren){if(t.index<o.index)return"success"}else if(t.hasChildren){let i=!0;for(const s of t==null?void 0:t.getChildrenSteps())if(hs(s,e,n)!=="success"){i=!1;break}if(i)return"success"}}return t.index<=o.index?"active":"default"},$f=(t,e)=>Np(t==null?void 0:t.showContent)?t==null?void 0:t.showContent:!ye(t==null?void 0:t.stepKey)&&t.stepKey===(e==null?void 0:e.stepKey),cx=["id"],dx={key:0,class:"mc-progress-indicator-step-container"},ux={class:"mc-progress-indicator-step-content"},px={key:0,class:"mc-progress-indicator-step-content-header"},hx={key:0,class:"mc-progress-indicator-step-content-footer-container"},fx={class:"mc-progress-indicator-step-content-footer"},mx={class:"mc-progress-indicator-step-content-footer-left-container"},gx={key:0,class:"mc-progress-indicator-step-content-footer-left"},vx={class:"mc-progress-indicator-step-content-footer-right-container"},yx={key:0,class:"mc-progress-indicator-step-content-footer-right"},bx=q(r.defineComponent({name:Af,__name:"mc-progress-indicator-step",props:{successBehavior:{default:"auto"},currentStep:{},step:{},position:{default:"middle"},showSuccessIcon:{type:Boolean,default:!0}},setup(t){const e=t,n=r.computed(()=>$f(e.step,r.unref(e.currentStep))),o=r.computed(()=>$f(e.step.nextStep,r.unref(e.currentStep))),i=r.computed(()=>!!e.step.isChild),s=r.computed(()=>hs(e.step,e.currentStep,e.successBehavior)),a=r.computed(()=>hs(e.step.previousStep,e.currentStep,e.successBehavior)),l=r.computed(()=>Sr(e.step.parentIndex)?e.step.parentIndex+1:0);return(c,d)=>(r.openBlock(),r.createElementBlock("div",{id:t.step.id,class:"mc-progress-indicator-step"},[r.createElementVNode("div",{class:r.normalizeClass(["mc-progress-indicator-step-item",{"mc-progress-indicator-step-item-child":i.value}])},[r.createElementVNode("i",{class:r.normalizeClass(["mc-progress-indicator-step-line mc-progress-indicator-step-line-up",[`mc-progress-indicator-step-line-${a.value}`,`mc-progress-indicator-step-line-${t.position}`]])},null,2),r.renderSlot(c.$slots,"icon",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},()=>[r.createVNode(ix,{num:l.value,icon:t.step.icon,status:s.value,"show-success-icon":t.showSuccessIcon,"is-child":i.value},null,8,["num","icon","status","show-success-icon","is-child"])],!0),r.createElementVNode("i",{class:r.normalizeClass(["mc-progress-indicator-step-line mc-progress-indicator-step-line-down",[`mc-progress-indicator-step-line-${s.value}`,`mc-progress-indicator-step-line-${t.position}`]])},null,2)],2),n.value?(r.openBlock(),r.createElementBlock("div",dx,[r.renderSlot(c.$slots,"default",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},()=>[r.createElementVNode("div",ux,[t.step.hiddenHeader?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",px,[r.renderSlot(c.$slots,"content-title",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},()=>[r.createElementVNode("span",{class:r.normalizeClass(["mc-progress-indicator-step-content-title",[`mc-progress-indicator-step-content-title-${s.value}`]])},r.toDisplayString(t.step.label),3)],!0),r.renderSlot(c.$slots,"content-toolbar",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},void 0,!0)])),r.renderSlot(c.$slots,"content",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},void 0,!0)]),t.step.hiddenFooter?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",hx,[r.renderSlot(c.$slots,"content-footer",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},()=>[r.createElementVNode("div",fx,[r.createElementVNode("div",mx,[t.step.hiddenFooterLeft?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",gx,[r.renderSlot(c.$slots,"content-footer-left",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},void 0,!0)]))]),r.createElementVNode("div",vx,[t.step.hiddenFooterRight?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",yx,[r.renderSlot(c.$slots,"content-footer-right",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},void 0,!0)]))])])],!0)]))],!0)])):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["mc-progress-indicator-step-label",[`mc-progress-indicator-step-label-${s.value}`,{"mc-progress-indicator-step-label-child":i.value,"mc-progress-indicator-step-label-need-padding-bottom":o.value}]])},[r.renderSlot(c.$slots,"label",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},()=>[r.createTextVNode(r.toDisplayString(t.step.label),1)],!0)],2))],8,cx))}}),[["__scopeId","data-v-7c4594d6"]]),kx={class:"mc-grogress-indicator"},Pf=ee(q(r.defineComponent({name:Vf,__name:"mc-progress-indicator",props:{modelValue:{},successSteps:{},successBehavior:{default:"auto"},previousBehavior:{default:"last-child"},showSuccessIcon:{type:Boolean,default:!0},scrollToStep:{type:Boolean,default:!1}},emits:["update:modelValue","update:successSteps","change","click:step"],setup(t,{expose:e,emit:n}){const o=t,i=n,{stepItems:s,currentStep:a}=(()=>{const d=r.ref([]),u=r.ref(new Map),p=r.useSlots();r.watchEffect(()=>{var v;const{stepItems:m,stepMap:g}=(b=>{const y=[],k=new Map;let x,w=0,C=0;const S=(E,M)=>{ce(E)&&E.forEach(N=>{var D,$,B;const T=(D=(N==null?void 0:N.type)||{})==null?void 0:D.name;if(T===Yl){const V=Do(N.children)||ce(N.children)||!He(($=N.children)==null?void 0:$.default)?N.children:(B=N.children)==null?void 0:B.default(),O=N.props,A=N.children,F=new If(O,A);F.parentIndex=w++,F.index=C++,x&&(F.previousStep=x,x.nextStep=F),x=F,y.push(F),k.set(F.stepKey,F),S(V,F)}else if(T===Xl){const V=N.props,O=N.children,A=new If(V,O);A.index=C++,M&&(M.clearContent(),M.appendChildStep(A),A.parentIndex=M.parentIndex,A.parentStep=M,A.childIndex=M.getChildrenSteps().length),x&&(A.previousStep=x,x.nextStep=A),k.set(A.stepKey,A),y.push(A),x=A}else ce(N.children)&&S(N.children,M)})};return S(b),{stepItems:y,stepMap:k}})((v=p.default)==null?void 0:v.call(p));d.value=m,u.value=g});const h=ue("modelValue"),f=r.computed(()=>u.value.get(h.value));return{stepItems:d,currentStep:f}})(),l=d=>{ye(d)||i("update:modelValue",d)},c=async d=>{if(!o.scrollToStep||ye(d==null?void 0:d.stepKey))return;await r.nextTick();const u=document.getElementById(d.id);u&&u.scrollIntoView({behavior:"smooth"})};return e({goStep:l,goNextStep:()=>{var u,p;const d=(u=a.value)==null?void 0:u.nextStep;ye(d==null?void 0:d.stepKey)||(d.hasChildren?l((p=d==null?void 0:d.getFirstChildStep())==null?void 0:p.stepKey):l(d.stepKey),c(d))},goPreviousStep:()=>{var u,p,h,f,m,g;const d=(u=a.value)==null?void 0:u.previousStep;if(!ye(d==null?void 0:d.stepKey))if((p=a.value)!=null&&p.isChild&&d===((h=a.value)==null?void 0:h.parentStep)){const v=d.previousStep;o.previousBehavior==="last-child"?(l(v==null?void 0:v.stepKey),c(v)):v!=null&&v.isChild?(l((m=(f=v.parentStep)==null?void 0:f.getFirstChildStep())==null?void 0:m.stepKey),c(v.parentStep)):(l(v==null?void 0:v.stepKey),c(v))}else l(d==null?void 0:d.stepKey),d!=null&&d.isChild&&((g=d.parentStep)==null?void 0:g.getFirstChildStep())===d?c(d.parentStep):c(d)}}),(d,u)=>(r.openBlock(),r.createElementBlock("div",kx,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(s),(p,h)=>(r.openBlock(),r.createBlock(bx,{key:p.stepKey,position:r.unref(lx)(h,r.unref(s).length),step:p,"current-step":r.unref(a),"success-behavior":t.successBehavior,"show-success-icon":t.showSuccessIcon},r.createSlots({_:2},[p.labelSlot?{name:"label",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.labelSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"0"}:void 0,p.iconSlot?{name:"icon",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.iconSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"1"}:void 0,p.defaultSlot?{name:"default",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.defaultSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"2"}:void 0,p.contentTitleSlot?{name:"content-title",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentTitleSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"3"}:void 0,p.contentToolbarSlot?{name:"content-toolbar",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentToolbarSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"4"}:void 0,p.contentSlot?{name:"content",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"5"}:void 0,p.contentFooterSlot?{name:"content-footer",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentFooterSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"6"}:void 0,p.contentFooterLeftSlot?{name:"content-footer-left",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentFooterLeftSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"7"}:void 0,p.contentFooterRightSlot?{name:"content-footer-right",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentFooterRightSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"8"}:void 0]),1032,["position","step","current-step","success-behavior","show-success-icon"]))),128))]))}}),[["__scopeId","data-v-9de07c8e"]])),Ql=Symbol("mc-radio-group-context"),zf="mc-radio-group",wx=["id"],Ff=ee(q(r.defineComponent({name:zf,__name:"mc-radio-group",props:{modelValue:{type:[Number,String,Boolean]},disabled:{type:Boolean},disableValidation:{type:Boolean},hideValidationIcon:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,{formId:i}=Nt();return r.provide(Ql,{modelValue:r.computed(()=>n.modelValue),disabled:r.computed(()=>n.disabled),handleSelect:s=>{o("update:modelValue",s),o("change",s)}}),(s,a)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-radio-group",id:r.unref(i)},[r.renderSlot(s.$slots,"default",{},void 0,!0)],8,wx))}}),[["__scopeId","data-v-3c7ef5f1"]])),jf="mc-radio",xx=["disabled","onKeypress"],Cx={class:"mc-radio-wrapper"},Sx={class:"mc-radio-content"},Ex={key:0,class:"mc-radio-help"},Mx={class:"mc-radio-remark"},Hf=ee(q(r.defineComponent({name:jf,__name:"mc-radio",props:{label:{},value:{type:[Number,String,Boolean]},disabled:{type:Boolean},remark:{},help:{}},emits:["focus","blur"],setup(t){const e=t,n=r.inject(Ql,void 0),o=r.ref(),{wrapperRef:i,isFocused:s,handleFocus:a,handleBlur:l}=Xn(o),c=r.computed(()=>{var f;return((f=n==null?void 0:n.modelValue)==null?void 0:f.value)===e.value}),{formDisabled:d,validateStyle:u,validateByTrigger:p}=Nt({externalDisabled:r.computed(()=>{var f;return!!((f=n==null?void 0:n.disabled)!=null&&f.value)})}),h=async()=>{d.value||(n==null||n.handleSelect(e.value),await r.nextTick(),p("input"))};return(f,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"wrapperRef",ref:i,class:r.normalizeClass(["mc-radio",{"mc-radio-has-remark":!!t.remark}])},[r.createElementVNode("label",{class:r.normalizeClass(["mc-radio-label",{"mc-radio-checked":c.value,"mc-radio-disabled":r.unref(d),"mc-radio-focused":r.unref(s),[r.unref(u)]:r.unref(u)}]),onClick:r.withModifiers(h,["prevent"])},[r.createElementVNode("input",{ref_key:"inputRef",ref:o,type:"radio",class:"mc-radio-input",disabled:r.unref(d),onFocus:m[0]||(m[0]=(...g)=>r.unref(a)&&r.unref(a)(...g)),onBlur:m[1]||(m[1]=(...g)=>r.unref(l)&&r.unref(l)(...g)),onKeypress:r.withKeys(r.withModifiers(h,["prevent","stop"]),["enter"])},null,40,xx),r.createElementVNode("div",Cx,[m[2]||(m[2]=r.createElementVNode("span",{class:"mc-radio-circle"},null,-1)),r.createElementVNode("div",Sx,[r.renderSlot(f.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.label),1)],!0)]),t.help||f.$slots.help?(r.openBlock(),r.createElementBlock("div",Ex,[r.renderSlot(f.$slots,"help",{},()=>[r.createVNode(r.unref(Ho),{content:t.help,"icon-size":24},null,8,["content"])],!0)])):r.createCommentVNode("",!0)])],2),r.createElementVNode("div",Mx,[r.renderSlot(f.$slots,"remark",{},()=>[r.createTextVNode(r.toDisplayString(t.remark),1)],!0)])],2))}}),[["__scopeId","data-v-a35770ad"]]));function Je(t){this.content=t}function Wf(t,e,n){for(let o=0;;o++){if(o==t.childCount||o==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(o),s=e.child(o);if(i!=s){if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let a=0;i.text[a]==s.text[a];a++)n++;return n}if(i.content.size||s.content.size){let a=Wf(i.content,s.content,n+1);if(a!=null)return a}n+=i.nodeSize}else n+=i.nodeSize}}function Kf(t,e,n,o){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:o};let a=t.child(--i),l=e.child(--s),c=a.nodeSize;if(a!=l){if(!a.sameMarkup(l))return{a:n,b:o};if(a.isText&&a.text!=l.text){let d=0,u=Math.min(a.text.length,l.text.length);for(;d<u&&a.text[a.text.length-d-1]==l.text[l.text.length-d-1];)d++,n--,o--;return{a:n,b:o}}if(a.content.size||l.content.size){let d=Kf(a.content,l.content,n-1,o-1);if(d)return d}n-=c,o-=c}else n-=c,o-=c}}Je.prototype={constructor:Je,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var o=n&&n!=t?this.remove(n):this,i=o.find(t),s=o.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new Je(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Je(n)},addToStart:function(t,e){return new Je([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Je(n)},addBefore:function(t,e,n){var o=this.remove(e),i=o.content.slice(),s=o.find(t);return i.splice(s==-1?i.length:s,0,e,n),new Je(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=Je.from(t)).size?new Je(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=Je.from(t)).size?new Je(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Je.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},Je.from=function(t){if(t instanceof Je)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Je(e)};class H{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let o=0;o<e.length;o++)this.size+=e[o].nodeSize}nodesBetween(e,n,o,i=0,s){for(let a=0,l=0;l<n;a++){let c=this.content[a],d=l+c.nodeSize;if(d>e&&o(c,i+l,s||null,a)!==!1&&c.content.size){let u=l+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,n-u),o,i+u)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,o,i){let s="",a=!0;return this.nodesBetween(e,n,(l,c)=>{let d=l.isText?l.text.slice(Math.max(e,c)-c,n-c):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&o&&(a?a=!1:s+=o),s+=d},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,o=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(o)&&(i[i.length-1]=n.withText(n.text+o.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new H(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let o=[],i=0;if(n>e)for(let s=0,a=0;a<n;s++){let l=this.content[s],c=a+l.nodeSize;c>e&&((a<e||c>n)&&(l=l.isText?l.cut(Math.max(0,e-a),Math.min(l.text.length,n-a)):l.cut(Math.max(0,e-a-1),Math.min(l.content.size,n-a-1))),o.push(l),i+=l.nodeSize),a=c}return new H(o,i)}cutByIndex(e,n){return e==n?H.empty:e==0&&n==this.content.length?this:new H(this.content.slice(e,n))}replaceChild(e,n){let o=this.content[e];if(o==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-o.nodeSize;return i[e]=n,new H(i,s)}addToStart(e){return new H([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new H(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,o=0;n<this.content.length;n++){let i=this.content[n];e(i,o,n),o+=i.nodeSize}}findDiffStart(e,n=0){return Wf(this,e,n)}findDiffEnd(e,n=this.size,o=e.size){return Kf(this,e,n,o)}findIndex(e){if(e==0)return fs(0,e);if(e==this.size)return fs(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,o=0;;n++){let i=o+this.child(n).nodeSize;if(i>=e)return i==e?fs(n+1,i):fs(n,o);o=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,n){if(!n)return H.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new H(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return H.empty;let n,o=0;for(let i=0;i<e.length;i++){let s=e[i];o+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new H(n||e,o)}static from(e){if(!e)return H.empty;if(e instanceof H)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new H([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}H.empty=new H([],0);const Zl={index:0,offset:0};function fs(t,e){return Zl.index=t,Zl.offset=e,Zl}function ms(t,e){if(t===e)return!0;if(!t||typeof t!="object"||!e||typeof e!="object")return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let o=0;o<t.length;o++)if(!ms(t[o],e[o]))return!1}else{for(let o in t)if(!(o in e)||!ms(t[o],e[o]))return!1;for(let o in e)if(!(o in t))return!1}return!0}let xe=class iu{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,o=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!o&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),o=!0),n&&n.push(s)}}return n||(n=e.slice()),o||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ms(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let o=e.marks[n.type];if(!o)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=o.create(n.attrs);return o.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let o=0;o<e.length;o++)if(!e[o].eq(n[o]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return iu.none;if(e instanceof iu)return[e];let n=e.slice();return n.sort((o,i)=>o.type.rank-i.type.rank),n}};xe.none=[];class gs extends Error{}class Q{constructor(e,n,o){this.content=e,this.openStart=n,this.openEnd=o}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let o=qf(this.content,e+this.openStart,n);return o&&new Q(o,this.openStart,this.openEnd)}removeBetween(e,n){return new Q(Uf(this.content,e+this.openStart,n+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,n){if(!n)return Q.empty;let o=n.openStart||0,i=n.openEnd||0;if(typeof o!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Q(H.fromJSON(e,n.content),o,i)}static maxOpen(e,n=!0){let o=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)o++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new Q(e,o,i)}}function Uf(t,e,n){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o),{index:a,offset:l}=t.findIndex(n);if(i==e||s.isText){if(l!=n&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(o!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(o,s.copy(Uf(s.content,e-i-1,n-i-1)))}function qf(t,e,n,o){let{index:i,offset:s}=t.findIndex(e),a=t.maybeChild(i);if(s==e||a.isText)return o&&!o.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let l=qf(a.content,e-s-1,n,a);return l&&t.replaceChild(i,a.copy(l))}function Nx(t,e,n){if(n.openStart>t.depth)throw new gs("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new gs("Inconsistent open depths");return Jf(t,e,n,0)}function Jf(t,e,n,o){let i=t.index(o),s=t.node(o);if(i==e.index(o)&&o<t.depth-n.openStart){let a=Jf(t,e,n,o+1);return s.copy(s.content.replaceChild(i,a))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=o||e.depth!=o){let{start:a,end:l}=function(c,d){let u=d.depth-c.openStart,p=d.node(u).copy(c.content);for(let h=u-1;h>=0;h--)p=d.node(h).copy(H.from(p));return{start:p.resolveNoCache(c.openStart+u),end:p.resolveNoCache(p.content.size-c.openEnd-u)}}(n,t);return io(s,Yf(t,a,l,e,o))}{let a=t.parent,l=a.content;return io(a,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}}return io(s,vs(t,e,o))}function Gf(t,e){if(!e.type.compatibleContent(t.type))throw new gs("Cannot join "+e.type.name+" onto "+t.type.name)}function ec(t,e,n){let o=t.node(n);return Gf(o,e.node(n)),o}function ro(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function zr(t,e,n,o){let i=(e||t).node(n),s=0,a=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(ro(t.nodeAfter,o),s++));for(let l=s;l<a;l++)ro(i.child(l),o);e&&e.depth==n&&e.textOffset&&ro(e.nodeBefore,o)}function io(t,e){return t.type.checkContent(e),t.copy(e)}function Yf(t,e,n,o,i){let s=t.depth>i&&ec(t,e,i+1),a=o.depth>i&&ec(n,o,i+1),l=[];return zr(null,t,i,l),s&&a&&e.index(i)==n.index(i)?(Gf(s,a),ro(io(s,Yf(t,e,n,o,i+1)),l)):(s&&ro(io(s,vs(t,e,i+1)),l),zr(e,n,i,l),a&&ro(io(a,vs(n,o,i+1)),l)),zr(o,null,i,l),new H(l)}function vs(t,e,n){let o=[];return zr(null,t,n,o),t.depth>n&&ro(io(ec(t,e,n+1),vs(t,e,n+1)),o),zr(e,null,n,o),new H(o)}Q.empty=new Q(H.empty,0,0);class Fr{constructor(e,n,o){this.pos=e,this.path=n,this.parentOffset=o,this.depth=n.length/3-1}resolveDepth(e){return e==null?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(e=this.resolveDepth(e))==0?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,n=this.index(this.depth);if(n==e.childCount)return null;let o=this.pos-this.path[this.path.length-1],i=e.child(n);return o?e.child(n).cut(o):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let o=this.path[3*n],i=n==0?0:this.path[3*n-1]+1;for(let s=0;s<e;s++)i+=o.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return xe.none;if(this.textOffset)return e.child(n).marks;let o=e.maybeChild(n-1),i=e.maybeChild(n);if(!o){let l=o;o=i,i=l}let s=o.marks;for(var a=0;a<s.length;a++)s[a].type.spec.inclusive!==!1||i&&s[a].isInSet(i.marks)||(s=s[a--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let o=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<o.length;s++)o[s].type.spec.inclusive!==!1||i&&o[s].isInSet(i.marks)||(o=o[s--].removeFromSet(o));return o}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let o=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);o>=0;o--)if(e.pos<=this.end(o)&&(!n||n(this.node(o))))return new ys(this,e,o);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<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let o=[],i=0,s=n;for(let a=e;;){let{index:l,offset:c}=a.content.findIndex(s),d=s-c;if(o.push(a,l,i+c),!d||(a=a.child(l),a.isText))break;s=d-1,i+=c+1}return new Fr(n,o,s)}static resolveCached(e,n){let o=Xf.get(e);if(o)for(let s=0;s<o.elts.length;s++){let a=o.elts[s];if(a.pos==n)return a}else Xf.set(e,o=new Bx);let i=o.elts[o.i]=Fr.resolve(e,n);return o.i=(o.i+1)%Tx,i}}class Bx{constructor(){this.elts=[],this.i=0}}const Tx=12,Xf=new WeakMap;class ys{constructor(e,n,o){this.$from=e,this.$to=n,this.depth=o}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Ox=Object.create(null);let Cn=class su{constructor(e,n,o,i=xe.none){this.type=e,this.attrs=n,this.marks=i,this.content=o||H.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,o,i=0){this.content.nodesBetween(e,n,o,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,o,i){return this.content.textBetween(e,n,o,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,o){return this.type==e&&ms(this.attrs,n||e.defaultAttrs||Ox)&&xe.sameSet(this.marks,o||xe.none)}copy(e=null){return e==this.content?this:new su(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new su(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,o=!1){if(e==n)return Q.empty;let i=this.resolve(e),s=this.resolve(n),a=o?0:i.sharedDepth(n),l=i.start(a),c=i.node(a).content.cut(i.pos-l,s.pos-l);return new Q(c,i.depth-a,s.depth-a)}replace(e,n,o){return Nx(this.resolve(e),this.resolve(n),o)}nodeAt(e){for(let n=this;;){let{index:o,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(o),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:o}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:o}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:o}=this.content.findIndex(e);if(o<e)return{node:this.content.child(n),index:n,offset:o};let i=this.content.child(n-1);return{node:i,index:n-1,offset:o-i.nodeSize}}resolve(e){return Fr.resolveCached(this,e)}resolveNoCache(e){return Fr.resolve(this,e)}rangeHasMark(e,n,o){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(o.isInSet(s.marks)&&(i=!0),!i)),i}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()+")"),Qf(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,o=H.empty,i=0,s=o.childCount){let a=this.contentMatchAt(e).matchFragment(o,i,s),l=a&&a.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let c=i;c<s;c++)if(!this.type.allowsMarks(o.child(c).marks))return!1;return!0}canReplaceWith(e,n,o,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(o),a=s&&s.matchFragment(this.content,n);return!!a&&a.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=xe.none;for(let n=0;n<this.marks.length;n++){let o=this.marks[n];o.type.checkAttrs(o.attrs),e=o.addToSet(e)}if(!xe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n 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(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let o;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");o=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,o)}let i=H.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,o);return s.type.checkAttrs(s.attrs),s}};Cn.prototype.text=void 0;class bs extends Cn{constructor(e,n,o,i){if(super(e,n,null,i),!o)throw new RangeError("Empty text nodes are not allowed");this.text=o}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Qf(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new bs(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new bs(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Qf(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class so{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let o=new _x(e,n);if(o.next==null)return so.empty;let i=Zf(o);o.next&&o.err("Unexpected trailing text");let s=function(a){let l=Object.create(null);return function c(d){let u=[];d.forEach(h=>{a[h].forEach(({term:f,to:m})=>{if(!f)return;let g;for(let v=0;v<u.length;v++)u[v][0]==f&&(g=u[v][1]);nm(a,m).forEach(v=>{g||u.push([f,g=[]]),g.indexOf(v)==-1&&g.push(v)})})});let p=l[d.join(",")]=new so(d.indexOf(a.length-1)>-1);for(let h=0;h<u.length;h++){let f=u[h][1].sort(tm);p.next.push({type:u[h][0],next:l[f.join(",")]||c(f)})}return p}(nm(a,0))}(function(a){let l=[[]];return u(function p(h,f){if(h.type=="choice")return h.exprs.reduce((m,g)=>m.concat(p(g,f)),[]);if(h.type!="seq"){if(h.type=="star"){let m=c();return d(f,m),u(p(h.expr,m),m),[d(m)]}if(h.type=="plus"){let m=c();return u(p(h.expr,f),m),u(p(h.expr,m),m),[d(m)]}if(h.type=="opt")return[d(f)].concat(p(h.expr,f));if(h.type=="range"){let m=f;for(let g=0;g<h.min;g++){let v=c();u(p(h.expr,m),v),m=v}if(h.max==-1)u(p(h.expr,m),m);else for(let g=h.min;g<h.max;g++){let v=c();d(m,v),u(p(h.expr,m),v),m=v}return[d(m)]}if(h.type=="name")return[d(f,void 0,h.value)];throw new Error("Unknown expr type")}for(let m=0;;m++){let g=p(h.exprs[m],f);if(m==h.exprs.length-1)return g;u(g,f=c())}}(a,0),c()),l;function c(){return l.push([])-1}function d(p,h,f){let m={term:f,to:h};return l[p].push(m),m}function u(p,h){p.forEach(f=>f.to=h)}}(i));return function(a,l){for(let c=0,d=[a];c<d.length;c++){let u=d[c],p=!u.validEnd,h=[];for(let f=0;f<u.next.length;f++){let{type:m,next:g}=u.next[f];h.push(m.name),!p||m.isText||m.hasRequiredAttrs()||(p=!1),d.indexOf(g)==-1&&d.push(g)}p&&l.err("Only non-generatable nodes ("+h.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(s,o),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,o=e.childCount){let i=this;for(let s=n;i&&s<o;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!n.isText&&!n.hasRequiredAttrs())return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let o=0;o<e.next.length;o++)if(this.next[n].type==e.next[o].type)return!0;return!1}fillBefore(e,n=!1,o=0){let i=[this];return function s(a,l){let c=a.matchFragment(e,o);if(c&&(!n||c.validEnd))return H.from(l.map(d=>d.createAndFill()));for(let d=0;d<a.next.length;d++){let{type:u,next:p}=a.next[d];if(!u.isText&&!u.hasRequiredAttrs()&&i.indexOf(p)==-1){i.push(p);let h=s(p,l.concat(u));if(h)return h}}return null}(this,[])}findWrapping(e){for(let o=0;o<this.wrapCache.length;o+=2)if(this.wrapCache[o]==e)return this.wrapCache[o+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),o=[{match:this,type:null,via:null}];for(;o.length;){let i=o.shift(),s=i.match;if(s.matchType(e)){let a=[];for(let l=i;l.type;l=l.via)a.push(l.type);return a.reverse()}for(let a=0;a<s.next.length;a++){let{type:l,next:c}=s.next[a];l.isLeaf||l.hasRequiredAttrs()||l.name in n||i.type&&!c.validEnd||(o.push({match:l.contentMatch,type:l,via:i}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(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 n(o){e.push(o);for(let i=0;i<o.next.length;i++)e.indexOf(o.next[i].next)==-1&&n(o.next[i].next)}(this),e.map((n,o)=>{let i=o+(n.validEnd?"*":" ")+" ";for(let s=0;s<n.next.length;s++)i+=(s?", ":"")+n.next[s].type.name+"->"+e.indexOf(n.next[s].next);return i}).join(`
37
- `)}}so.empty=new so(!0);class _x{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}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 Zf(t){let e=[];do e.push(Vx(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Vx(t){let e=[];do e.push(Ax(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Ax(t){let e=function(n){if(n.eat("(")){let o=Zf(n);return n.eat(")")||n.err("Missing closing paren"),o}if(!/\W/.test(n.next)){let o=function(i,s){let a=i.nodeTypes,l=a[s];if(l)return[l];let c=[];for(let d in a){let u=a[d];u.isInGroup(s)&&c.push(u)}return c.length==0&&i.err("No node type or group '"+s+"' found"),c}(n,n.next).map(i=>(n.inline==null?n.inline=i.isInline:n.inline!=i.isInline&&n.err("Mixing inline and block content"),{type:"name",value:i}));return n.pos++,o.length==1?o[0]:{type:"choice",exprs:o}}n.err("Unexpected token '"+n.next+"'")}(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=Dx(t,e)}return e}function em(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Dx(t,e){let n=em(t),o=n;return t.eat(",")&&(o=t.next!="}"?em(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:o,expr:e}}function tm(t,e){return e-t}function nm(t,e){let n=[];return function o(i){let s=t[i];if(s.length==1&&!s[0].term)return o(s[0].to);n.push(i);for(let a=0;a<s.length;a++){let{term:l,to:c}=s[a];l||n.indexOf(c)!=-1||o(c)}}(e),n.sort(tm)}function om(t){let e=Object.create(null);for(let n in t){let o=t[n];if(!o.hasDefault)return null;e[n]=o.default}return e}function rm(t,e){let n=Object.create(null);for(let o in t){let i=e&&e[o];if(i===void 0){let s=t[o];if(!s.hasDefault)throw new RangeError("No value supplied for attribute "+o);i=s.default}n[o]=i}return n}function im(t,e,n,o){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let s=t[i];s.validate&&s.validate(e[i])}}function sm(t,e){let n=Object.create(null);if(e)for(let o in e)n[o]=new Ix(t,o,e[o]);return n}let am=class D0{constructor(e,n,o){this.name=e,this.schema=n,this.spec=o,this.markSet=null,this.groups=o.group?o.group.split(" "):[],this.attrs=sm(e,o.attrs),this.defaultAttrs=om(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(o.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==so.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:rm(this.attrs,e)}create(e=null,n,o){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Cn(this,this.computeAttrs(e),H.from(n),xe.setFrom(o))}createChecked(e=null,n,o){return n=H.from(n),this.checkContent(n),new Cn(this,this.computeAttrs(e),n,xe.setFrom(o))}createAndFill(e=null,n,o){if(e=this.computeAttrs(e),(n=H.from(n)).size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(H.empty,!0);return s?new Cn(this,e,n.append(s),xe.setFrom(o)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let o=0;o<e.childCount;o++)if(!this.allowsMarks(e.child(o).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){im(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let o=0;o<e.length;o++)this.allowsMarkType(e[o].type)?n&&n.push(e[o]):n||(n=e.slice(0,o));return n?n.length?n:xe.none:e}static compile(e,n){let o=Object.create(null);e.forEach((s,a)=>o[s]=new D0(s,n,a));let i=n.spec.topNode||"doc";if(!o[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!o.text)throw new RangeError("Every schema needs a 'text' type");for(let s in o.text.attrs)throw new RangeError("The text node type should not have attributes");return o}};class Ix{constructor(e,n,o){this.hasDefault=Object.prototype.hasOwnProperty.call(o,"default"),this.default=o.default,this.validate=typeof o.validate=="string"?function(i,s,a){let l=a.split("|");return c=>{let d=c===null?"null":typeof c;if(l.indexOf(d)<0)throw new RangeError(`Expected value of type ${l} for attribute ${s} on type ${i}, got ${d}`)}}(e,n,o.validate):o.validate}get isRequired(){return!this.hasDefault}}class ks{constructor(e,n,o,i){this.name=e,this.rank=n,this.schema=o,this.spec=i,this.attrs=sm(e,i.attrs),this.excluded=null;let s=om(this.attrs);this.instance=s?new xe(this,s):null}create(e=null){return!e&&this.instance?this.instance:new xe(this,rm(this.attrs,e))}static compile(e,n){let o=Object.create(null),i=0;return e.forEach((s,a)=>o[s]=new ks(s,i++,n,a)),o}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){im(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class lm{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Je.from(e.nodes),n.marks=Je.from(e.marks||{}),this.nodes=am.compile(this.spec.nodes,this),this.marks=ks.compile(this.spec.marks,this);let o=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],a=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=o[a]||(o[a]=so.parse(a,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?cm(this,l.split(" ")):l!=""&&s.inlineContent?null:[]}for(let i in this.marks){let s=this.marks[i],a=s.spec.excludes;s.excluded=a==null?[s]:a==""?[]:cm(this,a.split(" "))}this.nodeFromJSON=i=>Cn.fromJSON(this,i),this.markFromJSON=i=>xe.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,o,i){if(typeof e=="string")e=this.nodeType(e);else{if(!(e instanceof am))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(n,o,i)}text(e,n){let o=this.nodes.text;return new bs(o,o.defaultAttrs,e,xe.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function cm(t,e){let n=[];for(let o=0;o<e.length;o++){let i=e[o],s=t.marks[i],a=s;if(s)n.push(s);else for(let l in t.marks){let c=t.marks[l];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=c)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[o]+"'")}return n}class Sn{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let o=this.matchedStyles=[];n.forEach(i=>{if(function(s){return s.tag!=null}(i))this.tags.push(i);else if(function(s){return s.style!=null}(i)){let s=/[^=]*/.exec(i.style)[0];o.indexOf(s)<0&&o.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let o=new hm(this,n,!1);return o.addAll(e,xe.none,n.from,n.to),o.finish()}parseSlice(e,n={}){let o=new hm(this,n,!0);return o.addAll(e,xe.none,n.from,n.to),Q.maxOpen(o.finish())}matchTag(e,n,o){for(let i=o?this.tags.indexOf(o)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(Lx(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let a=s.getAttrs(e);if(a===!1)continue;s.attrs=a||void 0}return s}}}matchStyle(e,n,o,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let a=this.styles[s],l=a.style;if(!(l.indexOf(e)!=0||a.context&&!o.matchesContext(a.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(a.getAttrs){let c=a.getAttrs(n);if(c===!1)continue;a.attrs=c||void 0}return a}}}static schemaRules(e){let n=[];function o(i){let s=i.priority==null?50:i.priority,a=0;for(;a<n.length;a++){let l=n[a];if((l.priority==null?50:l.priority)<s)break}n.splice(a,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(a=>{o(a=fm(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(a=>{o(a=fm(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Sn(e,Sn.schemaRules(e)))}}const dm={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},Rx={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},um={ol:!0,ul:!0};function pm(t,e,n){return e!=null?(e?1:0)|(e==="full"?2:0):t&&t.whitespace=="pre"?3:-5&n}class tc{constructor(e,n,o,i,s,a){this.type=e,this.attrs=n,this.marks=o,this.solid=i,this.options=a,this.content=[],this.activeMarks=xe.none,this.match=s||(4&a?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(H.from(e));if(!n){let o,i=this.type.contentMatch;return(o=i.findWrapping(e.type))?(this.match=i,o):null}this.match=this.type.contentMatch.matchFragment(n)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let o,i=this.content[this.content.length-1];if(i&&i.isText&&(o=/[ \t\r\n\u000c]+$/.exec(i.text))){let s=i;i.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-o[0].length))}}let n=H.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(H.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!dm.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class hm{constructor(e,n,o){this.parser=e,this.options=n,this.isOpen=o,this.open=0,this.localPreserveWS=!1;let i,s=n.topNode,a=pm(null,n.preserveWhitespace,0)|(o?4:0);i=s?new tc(s.type,s.attrs,xe.none,!0,n.topMatch||s.type.contentMatch,a):new tc(o?null:e.schema.topNodeType,null,xe.none,!0,null,a),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let o=e.nodeValue,i=this.top,s=2&i.options?"full":this.localPreserveWS||(1&i.options)>0;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(o)){if(s)o=s!=="full"?o.replace(/\r?\n|\r/g," "):o.replace(/\r\n?/g,`
38
- `);else if(o=o.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(o)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(o=o.slice(1))}o&&this.insertNode(this.parser.schema.text(o),n,!/\S/.test(o)),this.findInText(e)}else this.findInside(e)}addElement(e,n,o){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a,l=e.nodeName.toLowerCase();um.hasOwnProperty(l)&&this.parser.normalizeLists&&function(d){for(let u=d.firstChild,p=null;u;u=u.nextSibling){let h=u.nodeType==1?u.nodeName.toLowerCase():null;h&&um.hasOwnProperty(h)&&p?(p.appendChild(u),u=p):h=="li"?p=u:h&&(p=null)}}(e);let c=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,o));e:if(c?c.ignore:Rx.hasOwnProperty(l))this.findInside(e),this.ignoreFallback(e,n);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(e=c.skip);let d,u=this.needsBlock;if(dm.hasOwnProperty(l))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),d=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let p=c&&c.skip?n:this.readStyles(e,n);p&&this.addAll(e,p),d&&this.sync(s),this.needsBlock=u}else{let d=this.readStyles(e,n);d&&this.addElementByRule(e,c,d,c.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
39
- `),n)}ignoreFallback(e,n){e.nodeName!="BR"||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let o=e.style;if(o&&o.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],a=o.getPropertyValue(s);if(a)for(let l;;){let c=this.parser.matchStyle(s,a,this,l);if(!c)break;if(c.ignore)return null;if(n=c.clearMark?n.filter(d=>!c.clearMark(d)):n.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming!==!1)break;l=c}}return n}addElementByRule(e,n,o,i){let s,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),o,e.nodeName=="BR")||this.leafFallback(e,o);else{let c=this.enter(a,n.attrs||null,o,n.preserveWhitespace);c&&(s=!0,o=c)}else{let c=this.parser.schema.marks[n.mark];o=o.concat(c.create(n.attrs))}let l=this.top;if(a&&a.isLeaf)this.findInside(e);else if(i)this.addElement(e,o,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,o,!1));else{let c=e;typeof n.contentElement=="string"?c=e.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(e):n.contentElement&&(c=n.contentElement),this.findAround(e,c,!0),this.addAll(c,o),this.findAround(e,c,!1)}s&&this.sync(l)&&this.open--}addAll(e,n,o,i){let s=o||0;for(let a=o?e.childNodes[o]:e.firstChild,l=i==null?null:e.childNodes[i];a!=l;a=a.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(a,n);this.findAtPoint(e,s)}findPlace(e,n,o){let i,s;for(let a=this.open,l=0;a>=0;a--){let c=this.nodes[a],d=c.findWrapping(e);if(d&&(!i||i.length>d.length+l)&&(i=d,s=c,!d.length))break;if(c.solid){if(o)break;l+=2}}if(!i)return null;this.sync(s);for(let a=0;a<i.length;a++)n=this.enterInner(i[a],null,n,!1);return n}insertNode(e,n,o){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let i=this.findPlace(e,n,o);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let a=xe.none;for(let l of i.concat(e.marks))(s.type?s.type.allowsMarkType(l.type):mm(l.type,e.type))&&(a=l.addToSet(a));return s.content.push(e.mark(a)),!0}return!1}enter(e,n,o,i){let s=this.findPlace(e.create(n),o,!1);return s&&(s=this.enterInner(e,n,o,!0,i)),s}enterInner(e,n,o,i=!1,s){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let l=pm(e,s,a.options);4&a.options&&a.content.length==0&&(l|=4);let c=xe.none;return o=o.filter(d=>!(a.type?a.type.allowsMarkType(d.type):mm(d.type,e))||(c=d.addToSet(c),!1)),this.nodes.push(new tc(e,n,c,i,null,l)),this.open++,o}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].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 n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=1)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let o=this.nodes[n].content;for(let i=o.length-1;i>=0;i--)e+=o[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let o=0;o<this.find.length;o++)this.find[o].node==e&&this.find[o].offset==n&&(this.find[o].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,o){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(o?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),o=this.options.context,i=!(this.isOpen||o&&o.parent.type!=this.nodes[0].type),s=-(o?o.depth+1:0)+(i?0:1),a=(l,c)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;c>=s;c--)if(a(l-1,c))return!0;return!1}{let u=c>0||c==0&&i?this.nodes[c].type:o&&c>=s?o.node(c-s).type:null;if(!u||u.name!=d&&!u.isInGroup(d))return!1;c--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(o&&o.isTextblock&&o.defaultAttrs)return o}for(let n in this.parser.schema.nodes){let o=this.parser.schema.nodes[n];if(o.isTextblock&&o.defaultAttrs)return o}}}function Lx(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function fm(t){let e={};for(let n in t)e[n]=t[n];return e}function mm(t,e){let n=e.schema.nodes;for(let o in n){let i=n[o];if(!i.allowsMarkType(t))continue;let s=[],a=l=>{s.push(l);for(let c=0;c<l.edgeCount;c++){let{type:d,next:u}=l.edge(c);if(d==e||s.indexOf(u)<0&&a(u))return!0}};if(a(i.contentMatch))return!0}}class ao{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},o){o||(o=nc(n).createDocumentFragment());let i=o,s=[];return e.forEach(a=>{if(s.length||a.marks.length){let l=0,c=0;for(;l<s.length&&c<a.marks.length;){let d=a.marks[c];if(this.marks[d.type.name]){if(!d.eq(s[l][0])||d.type.spec.spanning===!1)break;l++,c++}else c++}for(;l<s.length;)i=s.pop()[1];for(;c<a.marks.length;){let d=a.marks[c++],u=this.serializeMark(d,a.isInline,n);u&&(s.push([d,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(a,n))}),o}serializeNodeInner(e,n){let{dom:o,contentDOM:i}=ws(nc(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return o}serializeNode(e,n={}){let o=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(o),o=s.dom)}return o}serializeMark(e,n,o={}){let i=this.marks[e.type.name];return i&&ws(nc(o),i(e,n),null,e.attrs)}static renderSpec(e,n,o=null,i){return ws(e,n,o,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ao(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=gm(e.nodes);return n.text||(n.text=o=>o.text),n}static marksFromSchema(e){return gm(e.marks)}}function gm(t){let e={};for(let n in t){let o=t[n].spec.toDOM;o&&(e[n]=o)}return e}function nc(t){return t.document||window.document}const vm=new WeakMap;function ws(t,e,n,o){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i,s=e[0];if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(o&&(i=function(p){let h=vm.get(p);return h===void 0&&vm.set(p,h=function(f){let m=null;return function g(v){if(v&&typeof v=="object")if(Array.isArray(v))if(typeof v[0]=="string")m||(m=[]),m.push(v);else for(let b=0;b<v.length;b++)g(v[b]);else for(let b in v)g(v[b])}(f),m}(p)),h}(o))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a,l=s.indexOf(" ");l>0&&(n=s.slice(0,l),s=s.slice(l+1));let c=n?t.createElementNS(n,s):t.createElement(s),d=e[1],u=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){u=2;for(let p in d)if(d[p]!=null){let h=p.indexOf(" ");h>0?c.setAttributeNS(p.slice(0,h),p.slice(h+1),d[p]):p=="style"&&c.style?c.style.cssText=d[p]:c.setAttribute(p,d[p])}}for(let p=u;p<e.length;p++){let h=e[p];if(h===0){if(p<e.length-1||p>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}{let{dom:f,contentDOM:m}=ws(t,h,n,o);if(c.appendChild(f),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:c,contentDOM:a}}const ym=Math.pow(2,16);function $x(t,e){return t+e*ym}function bm(t){return 65535&t}class oc{constructor(e,n,o){this.pos=e,this.delInfo=n,this.recover=o}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class bt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&bt.empty)return bt.empty}recover(e){let n=0,o=bm(e);if(!this.inverted)for(let i=0;i<o;i++)n+=this.ranges[3*i+2]-this.ranges[3*i+1];return this.ranges[3*o]+n+function(i){return(i-(65535&i))/ym}(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,o){let i=0,s=this.inverted?2:1,a=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?i:0);if(c>e)break;let d=this.ranges[l+s],u=this.ranges[l+a],p=c+d;if(e<=p){let h=c+i+((d?e==c?-1:e==p?1:n:n)<0?0:u);if(o)return h;let f=e==(n<0?c:p)?null:$x(l/3,e-c),m=e==c?2:e==p?1:4;return(n<0?e!=c:e!=p)&&(m|=8),new oc(h,m,f)}i+=u-d}return o?e+i:new oc(e+i,0,null)}touches(e,n){let o=0,i=bm(n),s=this.inverted?2:1,a=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?o:0);if(c>e)break;let d=this.ranges[l+s];if(e<=c+d&&l==3*i)return!0;o+=this.ranges[l+a]-d}return!1}forEach(e){let n=this.inverted?2:1,o=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let a=this.ranges[i],l=a-(this.inverted?s:0),c=a+(this.inverted?0:s),d=this.ranges[i+n],u=this.ranges[i+o];e(l,l+d,c,c+u),s+=u-d}}invert(){return new bt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?bt.empty:new bt(e<0?[0,-e,0]:[0,0,e])}}bt.empty=new bt([]);class jr{constructor(e,n,o=0,i=e?e.length:0){this.mirror=n,this.from=o,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new jr(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,o=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],i!=null&&i<n?o+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,o=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?o-i-1:void 0)}}invert(){let e=new jr;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let o=this.from;o<this.to;o++)e=this._maps[o].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,o){let i=0;for(let s=this.from;s<this.to;s++){let a=this._maps[s].mapResult(e,n);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return o?e:new oc(e,i,null)}}const rc=Object.create(null);class Qe{getMap(){return bt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let o=rc[n.stepType];if(!o)throw new RangeError(`No step type ${n.stepType} defined`);return o.fromJSON(e,n)}static jsonID(e,n){if(e in rc)throw new RangeError("Duplicate use of step JSON ID "+e);return rc[e]=n,n.prototype.jsonID=e,n}}class $e{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new $e(e,null)}static fail(e){return new $e(null,e)}static fromReplace(e,n,o,i){try{return $e.ok(e.replace(n,o,i))}catch(s){if(s instanceof gs)return $e.fail(s.message);throw s}}}function ic(t,e,n){let o=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(ic(s.content,e,s))),s.isInline&&(s=e(s,n,i)),o.push(s)}return H.fromArray(o)}class En extends Qe{constructor(e,n,o){super(),this.from=e,this.to=n,this.mark=o}apply(e){let n=e.slice(this.from,this.to),o=e.resolve(this.from),i=o.node(o.sharedDepth(this.to)),s=new Q(ic(n.content,(a,l)=>a.isAtom&&l.type.allowsMarkType(this.mark.type)?a.mark(this.mark.addToSet(a.marks)):a,i),n.openStart,n.openEnd);return $e.fromReplace(e,this.from,this.to,s)}invert(){return new Lt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),o=e.mapResult(this.to,-1);return n.deleted&&o.deleted||n.pos>=o.pos?null:new En(n.pos,o.pos,this.mark)}merge(e){return e instanceof En&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new En(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new En(n.from,n.to,e.markFromJSON(n.mark))}}Qe.jsonID("addMark",En);class Lt extends Qe{constructor(e,n,o){super(),this.from=e,this.to=n,this.mark=o}apply(e){let n=e.slice(this.from,this.to),o=new Q(ic(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return $e.fromReplace(e,this.from,this.to,o)}invert(){return new En(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),o=e.mapResult(this.to,-1);return n.deleted&&o.deleted||n.pos>=o.pos?null:new Lt(n.pos,o.pos,this.mark)}merge(e){return e instanceof Lt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Lt(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Lt(n.from,n.to,e.markFromJSON(n.mark))}}Qe.jsonID("removeMark",Lt);class Mn extends Qe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return $e.fail("No node at mark step's position");let o=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return $e.fromReplace(e,this.pos,this.pos+1,new Q(H.from(o),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let o=this.mark.addToSet(n.marks);if(o.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(o))return new Mn(this.pos,n.marks[i]);return new Mn(this.pos,this.mark)}}return new lo(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Mn(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Mn(n.pos,e.markFromJSON(n.mark))}}Qe.jsonID("addNodeMark",Mn);class lo extends Qe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return $e.fail("No node at mark step's position");let o=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return $e.fromReplace(e,this.pos,this.pos+1,new Q(H.from(o),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return n&&this.mark.isInSet(n.marks)?new Mn(this.pos,this.mark):this}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new lo(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new lo(n.pos,e.markFromJSON(n.mark))}}Qe.jsonID("removeNodeMark",lo);class We extends Qe{constructor(e,n,o,i=!1){super(),this.from=e,this.to=n,this.slice=o,this.structure=i}apply(e){return this.structure&&sc(e,this.from,this.to)?$e.fail("Structure replace would overwrite content"):$e.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new bt([this.from,this.to-this.from,this.slice.size])}invert(e){return new We(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),o=e.mapResult(this.to,-1);return n.deletedAcross&&o.deletedAcross?null:new We(n.pos,Math.max(n.pos,o.pos),this.slice,this.structure)}merge(e){if(!(e instanceof We)||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 n=this.slice.size+e.slice.size==0?Q.empty:new Q(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new We(e.from,this.to,n,this.structure)}}{let n=this.slice.size+e.slice.size==0?Q.empty:new Q(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new We(this.from,this.to+(e.to-e.from),n,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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new We(n.from,n.to,Q.fromJSON(e,n.slice),!!n.structure)}}Qe.jsonID("replace",We);class Ke extends Qe{constructor(e,n,o,i,s,a,l=!1){super(),this.from=e,this.to=n,this.gapFrom=o,this.gapTo=i,this.slice=s,this.insert=a,this.structure=l}apply(e){if(this.structure&&(sc(e,this.from,this.gapFrom)||sc(e,this.gapTo,this.to)))return $e.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return $e.fail("Gap is not a flat range");let o=this.slice.insertAt(this.insert,n.content);return o?$e.fromReplace(e,this.from,this.to,o):$e.fail("Content does not fit in gap")}getMap(){return new bt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Ke(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),o=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?o.pos:e.map(this.gapTo,1);return n.deletedAcross&&o.deletedAcross||i<n.pos||s>o.pos?null:new Ke(n.pos,o.pos,i,s,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,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ke(n.from,n.to,n.gapFrom,n.gapTo,Q.fromJSON(e,n.slice),n.insert,!!n.structure)}}function sc(t,e,n){let o=t.resolve(e),i=n-e,s=o.depth;for(;i>0&&s>0&&o.indexAfter(s)==o.node(s).childCount;)s--,i--;if(i>0){let a=o.node(s).maybeChild(o.indexAfter(s));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function ac(t,e,n,o=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),a=[],l=e+1;for(let c=0;c<s.childCount;c++){let d=s.child(c),u=l+d.nodeSize,p=o.matchType(d.type);if(p){o=p;for(let h=0;h<d.marks.length;h++)n.allowsMarkType(d.marks[h].type)||t.step(new Lt(l,u,d.marks[h]));if(i&&d.isText&&n.whitespace!="pre"){let h,f,m=/\r?\n|\r/g;for(;h=m.exec(d.text);)f||(f=new Q(H.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),a.push(new We(l+h.index,l+h.index+h[0].length,f))}}else a.push(new We(l,u,Q.empty));l=u}if(!o.validEnd){let c=o.fillBefore(H.empty,!0);t.replace(l,l,new Q(c,0,0))}for(let c=a.length-1;c>=0;c--)t.step(a[c])}function Px(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Xo(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let o=t.$from.node(n),i=t.$from.index(n),s=t.$to.indexAfter(n);if(n<t.depth&&o.canReplace(i,s,e))return n;if(n==0||o.type.spec.isolating||!Px(o,i,s))break}return null}function lc(t,e,n=null,o=t){let i=function(a,l){let{parent:c,startIndex:d,endIndex:u}=a,p=c.contentMatchAt(d).findWrapping(l);if(!p)return null;let h=p.length?p[0]:l;return c.canReplaceWith(d,u,h)?p:null}(t,e),s=i&&function(a,l){let{parent:c,startIndex:d,endIndex:u}=a,p=c.child(d),h=l.contentMatch.findWrapping(p.type);if(!h)return null;let f=(h.length?h[h.length-1]:l).contentMatch;for(let m=d;f&&m<u;m++)f=f.matchType(c.child(m).type);return f&&f.validEnd?h:null}(o,e);return s?i.map(km).concat({type:e,attrs:n}).concat(s.map(km)):null}function km(t){return{type:t,attrs:null}}function wm(t,e,n,o){e.forEach((i,s)=>{if(i.isText){let a,l=/\r?\n|\r/g;for(;a=l.exec(i.text);){let c=t.mapping.slice(o).map(n+1+s+a.index);t.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function xm(t,e,n,o){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let a=t.mapping.slice(o).map(n+1+s);t.replaceWith(a,a+1,e.type.schema.text(`
40
- `))}})}function rn(t,e,n=1,o){let i=t.resolve(e),s=i.depth-n,a=o&&o[o.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,u=n-2;d>s;d--,u--){let p=i.node(d),h=i.index(d);if(p.type.spec.isolating)return!1;let f=p.content.cutByIndex(h,p.childCount),m=o&&o[u+1];m&&(f=f.replaceChild(0,m.type.create(m.attrs)));let g=o&&o[u]||p;if(!p.canReplace(h+1,p.childCount)||!g.type.validContent(f))return!1}let l=i.indexAfter(s),c=o&&o[0];return i.node(s).canReplaceWith(l,l,c?c.type:i.node(s+1).type)}function Nn(t,e){let n=t.resolve(e),o=n.index();return Cm(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(o,o+1)}function Cm(t,e){return!(!t||!e||t.isLeaf||!function(n,o){o.content.size||n.type.compatibleContent(o.type);let i=n.contentMatchAt(n.childCount),{linebreakReplacement:s}=n.type.schema;for(let a=0;a<o.childCount;a++){let l=o.child(a),c=l.type==s?n.type.schema.nodes.text:l.type;if(i=i.matchType(c),!i||!n.type.allowsMarks(l.marks))return!1}return i.validEnd}(t,e))}function xs(t,e,n=-1){let o=t.resolve(e);for(let i=o.depth;;i--){let s,a,l=o.index(i);if(i==o.depth?(s=o.nodeBefore,a=o.nodeAfter):n>0?(s=o.node(i+1),l++,a=o.node(i).maybeChild(l)):(s=o.node(i).maybeChild(l-1),a=o.node(i+1)),s&&!s.isTextblock&&Cm(s,a)&&o.node(i).canReplace(l,l+1))return e;if(i==0)break;e=n<0?o.before(i):o.after(i)}}function Sm(t,e,n){let o=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let s=0;s<n.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let a=o.depth;a>=0;a--){let l=a==o.depth?0:o.pos<=(o.start(a+1)+o.end(a+1))/2?-1:1,c=o.index(a)+(l>0?1:0),d=o.node(a),u=!1;if(s==1)u=d.canReplace(c,c,i);else{let p=d.contentMatchAt(c).findWrapping(i.firstChild.type);u=p&&d.canReplaceWith(c,c,p[0])}if(u)return l==0?o.pos:l<0?o.before(a+1):o.after(a+1)}return null}function Cs(t,e,n=e,o=Q.empty){if(e==n&&!o.size)return null;let i=t.resolve(e),s=t.resolve(n);return Em(i,s,o)?new We(e,n,o):new zx(i,s,o).fit()}function Em(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}Qe.jsonID("replaceAround",Ke);class zx{constructor(e,n,o){this.$from=e,this.$to=n,this.unplaced=o,this.frontier=[],this.placed=H.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=H.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,o=this.$from,i=this.close(e<0?this.$to:o.doc.resolve(e));if(!i)return null;let s=this.placed,a=o.depth,l=i.depth;for(;a&&l&&s.childCount==1;)s=s.firstChild.content,a--,l--;let c=new Q(s,a,l);return e>-1?new Ke(o.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||o.pos!=this.$to.pos?new We(o.pos,i.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,o=0,i=this.unplaced.openEnd;o<e;o++){let s=n.firstChild;if(n.childCount>1&&(i=0),s.type.spec.isolating&&i<=o){e=o;break}n=s.content}for(let n=1;n<=2;n++)for(let o=n==1?e:this.unplaced.openStart;o>=0;o--){let i,s=null;o?(s=cc(this.unplaced.content,o-1).firstChild,i=s.content):i=this.unplaced.content;let a=i.firstChild;for(let l=this.depth;l>=0;l--){let c,{type:d,match:u}=this.frontier[l],p=null;if(n==1&&(a?u.matchType(a.type)||(p=u.fillBefore(H.from(a),!1)):s&&d.compatibleContent(s.type)))return{sliceDepth:o,frontierDepth:l,parent:s,inject:p};if(n==2&&a&&(c=u.findWrapping(a.type)))return{sliceDepth:o,frontierDepth:l,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:o}=this.unplaced,i=cc(e,n);return!(!i.childCount||i.firstChild.isLeaf||(this.unplaced=new Q(e,n+1,Math.max(o,i.size+n>=e.size-o?n+1:0)),0))}dropNode(){let{content:e,openStart:n,openEnd:o}=this.unplaced,i=cc(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new Q(Hr(e,n-1,1),n-1,s?n-1:o)}else this.unplaced=new Q(Hr(e,n,1),n,o)}placeNodes({sliceDepth:e,frontierDepth:n,parent:o,inject:i,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let g=0;g<s.length;g++)this.openFrontierNode(s[g]);let a=this.unplaced,l=o?o.content:a.content,c=a.openStart-e,d=0,u=[],{match:p,type:h}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)u.push(i.child(g));p=p.matchFragment(i)}let f=l.size+e-(a.content.size-a.openEnd);for(;d<l.childCount;){let g=l.child(d),v=p.matchType(g.type);if(!v)break;d++,(d>1||c==0||g.content.size)&&(p=v,u.push(Mm(g.mark(h.allowedMarks(g.marks)),d==1?c:0,d==l.childCount?f:-1)))}let m=d==l.childCount;m||(f=-1),this.placed=Wr(this.placed,n,H.from(u)),this.frontier[n].match=p,m&&f<0&&o&&o.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,v=l;g<f;g++){let b=v.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),v=b.content}this.unplaced=m?e==0?Q.empty:new Q(Hr(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new Q(Hr(a.content,e,d),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,n=this.frontier[this.depth];if(!n.type.isTextblock||!dc(this.$to,this.$to.depth,n.type,n.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:o}=this.$to,i=this.$to.after(o);for(;o>1&&i==this.$to.end(--o);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:o,type:i}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),a=dc(e,n,i,o,s);if(a){for(let l=n-1;l>=0;l--){let{match:c,type:d}=this.frontier[l],u=dc(e,l,d,c,!0);if(!u||u.childCount)continue e}return{depth:n,fit:a,move:s?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Wr(this.placed,n.depth,n.fit)),e=n.move;for(let o=n.depth+1;o<=e.depth;o++){let i=e.node(o),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(o));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,n=null,o){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Wr(this.placed,this.depth,H.from(e.create(n,o))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(H.empty,!0);e.childCount&&(this.placed=Wr(this.placed,this.frontier.length,e))}}function Hr(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Hr(t.firstChild.content,e-1,n)))}function Wr(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Wr(t.lastChild.content,e-1,n)))}function cc(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Mm(t,e,n){if(e<=0)return t;let o=t.content;return e>1&&(o=o.replaceChild(0,Mm(o.firstChild,e-1,o.childCount==1?n-1:0))),e>0&&(o=t.type.contentMatch.fillBefore(o).append(o),n<=0&&(o=o.append(t.type.contentMatch.matchFragment(o).fillBefore(H.empty,!0)))),t.copy(o)}function dc(t,e,n,o,i){let s=t.node(e),a=i?t.indexAfter(e):t.index(e);if(a==s.childCount&&!n.compatibleContent(s.type))return null;let l=o.fillBefore(s.content,!0,a);return l&&!function(c,d,u){for(let p=u;p<d.childCount;p++)if(!c.allowsMarks(d.child(p).marks))return!0;return!1}(n,s.content,a)?l:null}function Fx(t){return t.spec.defining||t.spec.definingForContent}function Nm(t,e,n,o,i){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(Nm(s.content,e+1,n,o,s)))}if(e>o){let s=i.contentMatchAt(0),a=s.fillBefore(t).append(t);t=a.append(s.matchFragment(a).fillBefore(H.empty,!0))}return t}function Bm(t,e){let n=[];for(let o=Math.min(t.depth,e.depth);o>=0;o--){let i=t.start(o);if(i<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&n.push(o)}return n}class Qo extends Qe{constructor(e,n,o){super(),this.pos=e,this.attr=n,this.value=o}apply(e){let n=e.nodeAt(this.pos);if(!n)return $e.fail("No node at attribute step's position");let o=Object.create(null);for(let s in n.attrs)o[s]=n.attrs[s];o[this.attr]=this.value;let i=n.type.create(o,null,n.marks);return $e.fromReplace(e,this.pos,this.pos+1,new Q(H.from(i),0,n.isLeaf?0:1))}getMap(){return bt.empty}invert(e){return new Qo(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Qo(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Qo(n.pos,n.attr,n.value)}}Qe.jsonID("attr",Qo);class Kr extends Qe{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let o=e.type.create(n,e.content,e.marks);return $e.ok(o)}getMap(){return bt.empty}invert(e){return new Kr(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Kr(n.attr,n.value)}}Qe.jsonID("docAttr",Kr);let Ur=class extends Error{};Ur=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(Ur.prototype=Object.create(Error.prototype)).constructor=Ur,Ur.prototype.name="TransformError";class Tm{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new jr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Ur(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,o=Q.empty){let i=Cs(this.doc,e,n,o);return i&&this.step(i),this}replaceWith(e,n,o){return this.replace(e,n,new Q(H.from(o),0,0))}delete(e,n){return this.replace(e,n,Q.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,o){return function(i,s,a,l){if(!l.size)return i.deleteRange(s,a);let c=i.doc.resolve(s),d=i.doc.resolve(a);if(Em(c,d,l))return i.step(new We(s,a,l));let u=Bm(c,i.doc.resolve(a));u[u.length-1]==0&&u.pop();let p=-(c.depth+1);u.unshift(p);for(let v=c.depth,b=c.pos-1;v>0;v--,b--){let y=c.node(v).type.spec;if(y.defining||y.definingAsContext||y.isolating)break;u.indexOf(v)>-1?p=v:c.before(v)==b&&u.splice(1,0,-v)}let h=u.indexOf(p),f=[],m=l.openStart;for(let v=l.content,b=0;;b++){let y=v.firstChild;if(f.push(y),b==l.openStart)break;v=y.content}for(let v=m-1;v>=0;v--){let b=f[v],y=Fx(b.type);if(y&&!b.sameMarkup(c.node(Math.abs(p)-1)))m=v;else if(y||!b.type.isTextblock)break}for(let v=l.openStart;v>=0;v--){let b=(v+m+1)%(l.openStart+1),y=f[b];if(y)for(let k=0;k<u.length;k++){let x=u[(k+h)%u.length],w=!0;x<0&&(w=!1,x=-x);let C=c.node(x-1),S=c.index(x-1);if(C.canReplaceWith(S,S,y.type,y.marks))return i.replace(c.before(x),w?d.after(x):a,new Q(Nm(l.content,0,l.openStart,b),b,l.openEnd))}}let g=i.steps.length;for(let v=u.length-1;v>=0&&(i.replace(s,a,l),!(i.steps.length>g));v--){let b=u[v];b<0||(s=c.before(b),a=d.after(b))}}(this,e,n,o),this}replaceRangeWith(e,n,o){return function(i,s,a,l){if(!l.isInline&&s==a&&i.doc.resolve(s).parent.content.size){let c=function(d,u,p){let h=d.resolve(u);if(h.parent.canReplaceWith(h.index(),h.index(),p))return u;if(h.parentOffset==0)for(let f=h.depth-1;f>=0;f--){let m=h.index(f);if(h.node(f).canReplaceWith(m,m,p))return h.before(f+1);if(m>0)return null}if(h.parentOffset==h.parent.content.size)for(let f=h.depth-1;f>=0;f--){let m=h.indexAfter(f);if(h.node(f).canReplaceWith(m,m,p))return h.after(f+1);if(m<h.node(f).childCount)return null}return null}(i.doc,s,l.type);c!=null&&(s=a=c)}i.replaceRange(s,a,new Q(H.from(l),0,0))}(this,e,n,o),this}deleteRange(e,n){return function(o,i,s){let a=o.doc.resolve(i),l=o.doc.resolve(s),c=Bm(a,l);for(let d=0;d<c.length;d++){let u=c[d],p=d==c.length-1;if(p&&u==0||a.node(u).type.contentMatch.validEnd)return o.delete(a.start(u),l.end(u));if(u>0&&(p||a.node(u-1).canReplace(a.index(u-1),l.indexAfter(u-1))))return o.delete(a.before(u),l.after(u))}for(let d=1;d<=a.depth&&d<=l.depth;d++)if(i-a.start(d)==a.depth-d&&s>a.end(d)&&l.end(d)-s!=l.depth-d&&a.start(d-1)==l.start(d-1)&&a.node(d-1).canReplace(a.index(d-1),l.index(d-1)))return o.delete(a.before(d),s);o.delete(i,s)}(this,e,n),this}lift(e,n){return function(o,i,s){let{$from:a,$to:l,depth:c}=i,d=a.before(c+1),u=l.after(c+1),p=d,h=u,f=H.empty,m=0;for(let b=c,y=!1;b>s;b--)y||a.index(b)>0?(y=!0,f=H.from(a.node(b).copy(f)),m++):p--;let g=H.empty,v=0;for(let b=c,y=!1;b>s;b--)y||l.after(b+1)<l.end(b)?(y=!0,g=H.from(l.node(b).copy(g)),v++):h++;o.step(new Ke(p,h,d,u,new Q(f.append(g),m,v),f.size-m,!0))}(this,e,n),this}join(e,n=1){return function(o,i,s){let a=null,{linebreakReplacement:l}=o.doc.type.schema,c=o.doc.resolve(i-s),d=c.node().type;if(l&&d.inlineContent){let f=d.whitespace=="pre",m=!!d.contentMatch.matchType(l);f&&!m?a=!1:!f&&m&&(a=!0)}let u=o.steps.length;if(a===!1){let f=o.doc.resolve(i+s);xm(o,f.node(),f.before(),u)}d.inlineContent&&ac(o,i+s-1,d,c.node().contentMatchAt(c.index()),a==null);let p=o.mapping.slice(u),h=p.map(i-s);if(o.step(new We(h,p.map(i+s,-1),Q.empty,!0)),a===!0){let f=o.doc.resolve(h);wm(o,f.node(),f.before(),o.steps.length)}}(this,e,n),this}wrap(e,n){return function(o,i,s){let a=H.empty;for(let d=s.length-1;d>=0;d--){if(a.size){let u=s[d].type.contentMatch.matchFragment(a);if(!u||!u.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}a=H.from(s[d].type.create(s[d].attrs,a))}let l=i.start,c=i.end;o.step(new Ke(l,c,l,c,new Q(a,0,0),s.length,!0))}(this,e,n),this}setBlockType(e,n=e,o,i=null){return function(s,a,l,c,d){if(!c.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let u=s.steps.length;s.doc.nodesBetween(a,l,(p,h)=>{let f=typeof d=="function"?d(p):d;if(p.isTextblock&&!p.hasMarkup(c,f)&&function(m,g,v){let b=m.resolve(g),y=b.index();return b.parent.canReplaceWith(y,y+1,v)}(s.doc,s.mapping.slice(u).map(h),c)){let m=null;if(c.schema.linebreakReplacement){let y=c.whitespace=="pre",k=!!c.contentMatch.matchType(c.schema.linebreakReplacement);y&&!k?m=!1:!y&&k&&(m=!0)}m===!1&&xm(s,p,h,u),ac(s,s.mapping.slice(u).map(h,1),c,void 0,m===null);let g=s.mapping.slice(u),v=g.map(h,1),b=g.map(h+p.nodeSize,1);return s.step(new Ke(v,b,v+1,b-1,new Q(H.from(c.create(f,null,p.marks)),0,0),1,!0)),m===!0&&wm(s,p,h,u),!1}})}(this,e,n,o,i),this}setNodeMarkup(e,n,o=null,i){return function(s,a,l,c,d){let u=s.doc.nodeAt(a);if(!u)throw new RangeError("No node at given position");l||(l=u.type);let p=l.create(c,null,d||u.marks);if(u.isLeaf)return s.replaceWith(a,a+u.nodeSize,p);if(!l.validContent(u.content))throw new RangeError("Invalid content for node type "+l.name);s.step(new Ke(a,a+u.nodeSize,a+1,a+u.nodeSize-1,new Q(H.from(p),0,0),1,!0))}(this,e,n,o,i),this}setNodeAttribute(e,n,o){return this.step(new Qo(e,n,o)),this}setDocAttribute(e,n){return this.step(new Kr(e,n)),this}addNodeMark(e,n){return this.step(new Mn(e,n)),this}removeNodeMark(e,n){let o=this.doc.nodeAt(e);if(!o)throw new RangeError("No node at position "+e);if(n instanceof xe)n.isInSet(o.marks)&&this.step(new lo(e,n));else{let i,s=o.marks,a=[];for(;i=n.isInSet(s);)a.push(new lo(e,i)),s=i.removeFromSet(s);for(let l=a.length-1;l>=0;l--)this.step(a[l])}return this}split(e,n=1,o){return function(i,s,a=1,l){let c=i.doc.resolve(s),d=H.empty,u=H.empty;for(let p=c.depth,h=c.depth-a,f=a-1;p>h;p--,f--){d=H.from(c.node(p).copy(d));let m=l&&l[f];u=H.from(m?m.type.create(m.attrs,u):c.node(p).copy(u))}i.step(new We(s,s,new Q(d.append(u),a,a),!0))}(this,e,n,o),this}addMark(e,n,o){return function(i,s,a,l){let c,d,u=[],p=[];i.doc.nodesBetween(s,a,(h,f,m)=>{if(!h.isInline)return;let g=h.marks;if(!l.isInSet(g)&&m.type.allowsMarkType(l.type)){let v=Math.max(f,s),b=Math.min(f+h.nodeSize,a),y=l.addToSet(g);for(let k=0;k<g.length;k++)g[k].isInSet(y)||(c&&c.to==v&&c.mark.eq(g[k])?c.to=b:u.push(c=new Lt(v,b,g[k])));d&&d.to==v?d.to=b:p.push(d=new En(v,b,l))}}),u.forEach(h=>i.step(h)),p.forEach(h=>i.step(h))}(this,e,n,o),this}removeMark(e,n,o){return function(i,s,a,l){let c=[],d=0;i.doc.nodesBetween(s,a,(u,p)=>{if(!u.isInline)return;d++;let h=null;if(l instanceof ks){let f,m=u.marks;for(;f=l.isInSet(m);)(h||(h=[])).push(f),m=f.removeFromSet(m)}else l?l.isInSet(u.marks)&&(h=[l]):h=u.marks;if(h&&h.length){let f=Math.min(p+u.nodeSize,a);for(let m=0;m<h.length;m++){let g,v=h[m];for(let b=0;b<c.length;b++){let y=c[b];y.step==d-1&&v.eq(c[b].style)&&(g=y)}g?(g.to=f,g.step=d):c.push({style:v,from:Math.max(p,s),to:f,step:d})}}}),c.forEach(u=>i.step(new Lt(u.from,u.to,u.style)))}(this,e,n,o),this}clearIncompatible(e,n,o){return ac(this,e,n,o),this}}const uc=Object.create(null);class he{constructor(e,n,o){this.$anchor=e,this.$head=n,this.ranges=o||[new jx(e.min(n),e.max(n))]}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 n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=Q.empty){let o=n.content.lastChild,i=null;for(let l=0;l<n.openEnd;l++)i=o,o=o.lastChild;let s=e.steps.length,a=this.ranges;for(let l=0;l<a.length;l++){let{$from:c,$to:d}=a[l],u=e.mapping.slice(s);e.replaceRange(u.map(c.pos),u.map(d.pos),l?Q.empty:n),l==0&&Vm(e,s,(o?o.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let o=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:l}=i[s],c=e.mapping.slice(o),d=c.map(a.pos),u=c.map(l.pos);s?e.deleteRange(d,u):(e.replaceRangeWith(d,u,n),Vm(e,o,n.isInline?-1:1))}}static findFrom(e,n,o=!1){let i=e.parent.inlineContent?new le(e):Zo(e.node(0),e.parent,e.pos,e.index(),n,o);if(i)return i;for(let s=e.depth-1;s>=0;s--){let a=n<0?Zo(e.node(0),e.node(s),e.before(s+1),e.index(s),n,o):Zo(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,o);if(a)return a}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new kt(e.node(0))}static atStart(e){return Zo(e,e,0,0,1)||new kt(e)}static atEnd(e){return Zo(e,e,e.content.size,e.childCount,-1)||new kt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let o=uc[n.type];if(!o)throw new RangeError(`No selection type ${n.type} defined`);return o.fromJSON(e,n)}static jsonID(e,n){if(e in uc)throw new RangeError("Duplicate use of selection JSON ID "+e);return uc[e]=n,n.prototype.jsonID=e,n}getBookmark(){return le.between(this.$anchor,this.$head).getBookmark()}}he.prototype.visible=!0;class jx{constructor(e,n){this.$from=e,this.$to=n}}let Om=!1;function _m(t){Om||t.parent.inlineContent||(Om=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class le extends he{constructor(e,n=e){_m(e),_m(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let o=e.resolve(n.map(this.head));if(!o.parent.inlineContent)return he.near(o);let i=e.resolve(n.map(this.anchor));return new le(i.parent.inlineContent?i:o,o)}replace(e,n=Q.empty){if(super.replace(e,n),n==Q.empty){let o=this.$from.marksAcross(this.$to);o&&e.ensureMarks(o)}}eq(e){return e instanceof le&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ss(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new le(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,o=n){let i=e.resolve(n);return new this(i,o==n?i:e.resolve(o))}static between(e,n,o){let i=e.pos-n.pos;if(o&&!i||(o=i>=0?1:-1),!n.parent.inlineContent){let s=he.findFrom(n,o,!0)||he.findFrom(n,-o,!0);if(!s)return he.near(n,o);n=s.$head}return e.parent.inlineContent||(i==0||(e=(he.findFrom(e,-o,!0)||he.findFrom(e,o,!0)).$anchor).pos<n.pos!=i<0)&&(e=n),new le(e,n)}}he.jsonID("text",le);class Ss{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Ss(e.map(this.anchor),e.map(this.head))}resolve(e){return le.between(e.resolve(this.anchor),e.resolve(this.head))}}class re extends he{constructor(e){let n=e.nodeAfter,o=e.node(0).resolve(e.pos+n.nodeSize);super(e,o),this.node=n}map(e,n){let{deleted:o,pos:i}=n.mapResult(this.anchor),s=e.resolve(i);return o?he.near(s):new re(s)}content(){return new Q(H.from(this.node),0,0)}eq(e){return e instanceof re&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new pc(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new re(e.resolve(n.anchor))}static create(e,n){return new re(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}re.prototype.visible=!1,he.jsonID("node",re);class pc{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:o}=e.mapResult(this.anchor);return n?new Ss(o,o):new pc(o)}resolve(e){let n=e.resolve(this.anchor),o=n.nodeAfter;return o&&re.isSelectable(o)?new re(n):he.near(n)}}class kt extends he{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=Q.empty){if(n==Q.empty){e.delete(0,e.doc.content.size);let o=he.atStart(e.doc);o.eq(e.selection)||e.setSelection(o)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new kt(e)}map(e){return new kt(e)}eq(e){return e instanceof kt}getBookmark(){return Hx}}he.jsonID("all",kt);const Hx={map(){return this},resolve:t=>new kt(t)};function Zo(t,e,n,o,i,s=!1){if(e.inlineContent)return le.create(t,n);for(let a=o-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){let l=e.child(a);if(l.isAtom){if(!s&&re.isSelectable(l))return re.create(t,n-(i<0?l.nodeSize:0))}else{let c=Zo(t,l,n+i,i<0?l.childCount:0,i,s);if(c)return c}n+=l.nodeSize*i}return null}function Vm(t,e,n){let o=t.steps.length-1;if(o<e)return;let i,s=t.steps[o];(s instanceof We||s instanceof Ke)&&(t.mapping.maps[o].forEach((a,l,c,d)=>{i==null&&(i=d)}),t.setSelection(he.near(t.doc.resolve(i),n)))}class Wx extends Tm{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.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return xe.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,n){super.addStep(e,n),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,n=!0){let o=this.selection;return n&&(e=e.mark(this.storedMarks||(o.empty?o.$from.marks():o.$from.marksAcross(o.$to)||xe.none))),o.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,o){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(o==null&&(o=n),o=o??n,!e)return this.deleteRange(n,o);let s=this.storedMarks;if(!s){let a=this.doc.resolve(n);s=o==n?a.marks():a.marksAcross(this.doc.resolve(o))}return this.replaceRangeWith(n,o,i.text(e,s)),this.selection.empty||this.setSelection(he.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?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 Am(t,e){return e&&t?t.bind(e):t}class qr{constructor(e,n,o){this.name=e,this.init=Am(n.init,o),this.apply=Am(n.apply,o)}}const Kx=[new qr("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new qr("selection",{init:(t,e)=>t.selection||he.atStart(e.doc),apply:t=>t.selection}),new qr("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,o)=>o.selection.$cursor?t.storedMarks:null}),new qr("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})];class hc{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Kx.slice(),n&&n.forEach(o=>{if(this.pluginsByKey[o.key])throw new RangeError("Adding different instances of a keyed plugin ("+o.key+")");this.plugins.push(o),this.pluginsByKey[o.key]=o,o.spec.state&&this.fields.push(new qr(o.key,o.spec.state,o))})}}class er{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,n=-1){for(let o=0;o<this.config.plugins.length;o++)if(o!=n){let i=this.config.plugins[o];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],o=this.applyInner(e),i=null;for(;;){let s=!1;for(let a=0;a<this.config.plugins.length;a++){let l=this.config.plugins[a];if(l.spec.appendTransaction){let c=i?i[a].n:0,d=i?i[a].state:this,u=c<n.length&&l.spec.appendTransaction.call(l,c?n.slice(c):n,d,o);if(u&&o.filterTransaction(u,a)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(let p=0;p<this.config.plugins.length;p++)i.push(p<a?{state:o,n:n.length}:{state:this,n:0})}n.push(u),o=o.applyInner(u),s=!0}i&&(i[a]={state:o,n:n.length})}}if(!s)return{state:o,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new er(this.config),o=this.config.fields;for(let i=0;i<o.length;i++){let s=o[i];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new Wx(this)}static create(e){let n=new hc(e.doc?e.doc.type.schema:e.schema,e.plugins),o=new er(n);for(let i=0;i<n.fields.length;i++)o[n.fields[i].name]=n.fields[i].init(e,o);return o}reconfigure(e){let n=new hc(this.schema,e.plugins),o=n.fields,i=new er(n);for(let s=0;s<o.length;s++){let a=o[s].name;i[a]=this.hasOwnProperty(a)?this[a]:o[s].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(o=>o.toJSON())),e&&typeof e=="object")for(let o in e){if(o=="doc"||o=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[o],s=i.spec.state;s&&s.toJSON&&(n[o]=s.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,o){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new hc(e.schema,e.plugins),s=new er(i);return i.fields.forEach(a=>{if(a.name=="doc")s.doc=Cn.fromJSON(e.schema,n.doc);else if(a.name=="selection")s.selection=he.fromJSON(s.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(o)for(let l in o){let c=o[l],d=c.spec.state;if(c.key==a.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,l))return void(s[a.name]=d.fromJSON.call(c,e,n[l],s))}s[a.name]=a.init(e,s)}}),s}}function Dm(t,e,n){for(let o in t){let i=t[o];i instanceof Function?i=i.bind(e):o=="handleDOMEvents"&&(i=Dm(i,e,{})),n[o]=i}return n}class Ve{constructor(e){this.spec=e,this.props={},e.props&&Dm(e.props,this,this.props),this.key=e.key?e.key.key:Im("plugin")}getState(e){return e[this.key]}}const fc=Object.create(null);function Im(t){return t in fc?t+"$"+ ++fc[t]:(fc[t]=0,t+"$")}class Ue{constructor(e="key"){this.key=Im(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const mc=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Rm(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const Lm=(t,e,n)=>{let o=Rm(t,n);if(!o)return!1;let i=gc(o);if(!i){let a=o.blockRange(),l=a&&Xo(a);return l!=null&&(e&&e(t.tr.lift(a,l).scrollIntoView()),!0)}let s=i.nodeBefore;if(Um(t,i,e,-1))return!0;if(o.parent.content.size==0&&(tr(s,"end")||re.isSelectable(s)))for(let a=o.depth;;a--){let l=Cs(t.doc,o.before(a),o.after(a),Q.empty);if(l&&l.slice.size<l.to-l.from){if(e){let c=t.tr.step(l);c.setSelection(tr(s,"end")?he.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):re.create(c.doc,i.pos-s.nodeSize)),e(c.scrollIntoView())}return!0}if(a==1||o.node(a-1).childCount>1)break}return!(!s.isAtom||i.depth!=o.depth-1||(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),0))};function $m(t,e,n){let o=e.nodeBefore,i=e.pos-1;for(;!o.isTextblock;i--){if(o.type.spec.isolating)return!1;let c=o.lastChild;if(!c)return!1;o=c}let s=e.nodeAfter,a=e.pos+1;for(;!s.isTextblock;a++){if(s.type.spec.isolating)return!1;let c=s.firstChild;if(!c)return!1;s=c}let l=Cs(t.doc,i,a,Q.empty);if(!l||l.from!=i||l instanceof We&&l.slice.size>=a-i)return!1;if(n){let c=t.tr.step(l);c.setSelection(le.create(c.doc,i)),n(c.scrollIntoView())}return!0}function tr(t,e,n=!1){for(let o=t;o;o=e=="start"?o.firstChild:o.lastChild){if(o.isTextblock)return!0;if(n&&o.childCount!=1)return!1}return!1}const Pm=(t,e,n)=>{let{$head:o,empty:i}=t.selection,s=o;if(!i)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):o.parentOffset>0)return!1;s=gc(o)}let a=s&&s.nodeBefore;return!(!a||!re.isSelectable(a)||(e&&e(t.tr.setSelection(re.create(t.doc,s.pos-a.nodeSize)).scrollIntoView()),0))};function gc(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function zm(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const Fm=(t,e,n)=>{let o=zm(t,n);if(!o)return!1;let i=vc(o);if(!i)return!1;let s=i.nodeAfter;if(Um(t,i,e,1))return!0;if(o.parent.content.size==0&&(tr(s,"start")||re.isSelectable(s))){let a=Cs(t.doc,o.before(),o.after(),Q.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(tr(s,"start")?he.findFrom(l.doc.resolve(l.mapping.map(i.pos)),1):re.create(l.doc,l.mapping.map(i.pos))),e(l.scrollIntoView())}return!0}}return!(!s.isAtom||i.depth!=o.depth-1||(e&&e(t.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),0))},jm=(t,e,n)=>{let{$head:o,empty:i}=t.selection,s=o;if(!i)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):o.parentOffset<o.parent.content.size)return!1;s=vc(o)}let a=s&&s.nodeAfter;return!(!a||!re.isSelectable(a)||(e&&e(t.tr.setSelection(re.create(t.doc,s.pos)).scrollIntoView()),0))};function vc(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const Hm=(t,e)=>{let{$head:n,$anchor:o}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(o)||(e&&e(t.tr.insertText(`
41
- `).scrollIntoView()),0))};function yc(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Wm=(t,e)=>{let n=t.selection,{$from:o,$to:i}=n;if(n instanceof kt||o.parent.inlineContent||i.parent.inlineContent)return!1;let s=yc(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let a=(!o.parentOffset&&i.index()<i.parent.childCount?o:i).pos,l=t.tr.insert(a,s.createAndFill());l.setSelection(le.create(l.doc,a+1)),e(l.scrollIntoView())}return!0},Km=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(rn(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let o=n.blockRange(),i=o&&Xo(o);return i!=null&&(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)};function Um(t,e,n,o){let i,s,a=e.nodeBefore,l=e.nodeAfter,c=a.type.spec.isolating||l.type.spec.isolating;if(!c&&function(f,m,g){let v=m.nodeBefore,b=m.nodeAfter,y=m.index();return!(!(v&&b&&v.type.compatibleContent(b.type))||(!v.content.size&&m.parent.canReplace(y-1,y)?(g&&g(f.tr.delete(m.pos-v.nodeSize,m.pos).scrollIntoView()),0):!m.parent.canReplace(y,y+1)||!b.isTextblock&&!Nn(f.doc,m.pos)||(g&&g(f.tr.join(m.pos).scrollIntoView()),0)))}(t,e,n))return!0;let d=!c&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(i=(s=a.contentMatchAt(a.childCount)).findWrapping(l.type))&&s.matchType(i[0]||l.type).validEnd){if(n){let f=e.pos+l.nodeSize,m=H.empty;for(let b=i.length-1;b>=0;b--)m=H.from(i[b].create(null,m));m=H.from(a.copy(m));let g=t.tr.step(new Ke(e.pos-1,f,e.pos,f,new Q(m,1,0),i.length,!0)),v=g.doc.resolve(f+2*i.length);v.nodeAfter&&v.nodeAfter.type==a.type&&Nn(g.doc,v.pos)&&g.join(v.pos),n(g.scrollIntoView())}return!0}let u=l.type.spec.isolating||o>0&&c?null:he.findFrom(e,1),p=u&&u.$from.blockRange(u.$to),h=p&&Xo(p);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(p,h).scrollIntoView()),!0;if(d&&tr(l,"start",!0)&&tr(a,"end")){let f=a,m=[];for(;m.push(f),!f.isTextblock;)f=f.lastChild;let g=l,v=1;for(;!g.isTextblock;g=g.firstChild)v++;if(f.canReplace(f.childCount,f.childCount,g.content)){if(n){let b=H.empty;for(let y=m.length-1;y>=0;y--)b=H.from(m[y].copy(b));n(t.tr.step(new Ke(e.pos-m.length,e.pos+l.nodeSize,e.pos+v,e.pos+l.nodeSize-v,new Q(b,m.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function qm(t){return function(e,n){let o=e.selection,i=t<0?o.$from:o.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return!!i.node(s).isTextblock&&(n&&n(e.tr.setSelection(le.create(e.doc,t<0?i.start(s):i.end(s)))),!0)}}const Ux=qm(-1),qx=qm(1);function Jm(t,e=null){return function(n,o){let i=!1;for(let s=0;s<n.selection.ranges.length&&!i;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];n.doc.nodesBetween(a,l,(c,d)=>{if(i)return!1;if(c.isTextblock&&!c.hasMarkup(t,e))if(c.type==t)i=!0;else{let u=n.doc.resolve(d),p=u.index();i=u.parent.canReplaceWith(p,p+1,t)}})}if(!i)return!1;if(o){let s=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:l},$to:{pos:c}}=n.selection.ranges[a];s.setBlockType(l,c,t,e)}o(s.scrollIntoView())}return!0}}function bc(...t){return function(e,n,o){for(let i=0;i<t.length;i++)if(t[i](e,n,o))return!0;return!1}}bc(mc,Lm,Pm),bc(mc,Fm,jm),bc(Hm,Wm,Km,(t,e)=>{let{$from:n,$to:o}=t.selection;if(t.selection instanceof re&&t.selection.node.isBlock)return!(!n.parentOffset||!rn(t.doc,n.pos)||(e&&e(t.tr.split(n.pos).scrollIntoView()),0));if(!n.depth)return!1;let i,s,a=[],l=!1,c=!1;for(let h=n.depth;;h--){if(n.node(h).isBlock){l=n.end(h)==n.pos+(n.depth-h),c=n.start(h)==n.pos-(n.depth-h),s=yc(n.node(h-1).contentMatchAt(n.indexAfter(h-1))),a.unshift(l&&s?{type:s}:null),i=h;break}if(h==1)return!1;a.unshift(null)}let d=t.tr;(t.selection instanceof le||t.selection instanceof kt)&&d.deleteSelection();let u=d.mapping.map(n.pos),p=rn(d.doc,u,a.length,a);if(p||(a[0]=s?{type:s}:null,p=rn(d.doc,u,a.length,a)),!p)return!1;if(d.split(u,a.length,a),!l&&c&&n.node(i).type!=s){let h=d.mapping.map(n.before(i)),f=d.doc.resolve(h);s&&n.node(i-1).canReplaceWith(f.index(),f.index()+1,s)&&d.setNodeMarkup(d.mapping.map(n.before(i)),s)}return e&&e(d.scrollIntoView()),!0}),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform();const Ge=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},nr=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let kc=null;const sn=function(t,e,n){let o=kc||(kc=document.createRange());return o.setEnd(t,n??t.nodeValue.length),o.setStart(t,e||0),o},co=function(t,e,n,o){return n&&(Gm(t,e,n,o,-1)||Gm(t,e,n,o,1))},Jx=/^(img|br|input|textarea|hr)$/i;function Gm(t,e,n,o,i){for(var s;;){if(t==n&&e==o)return!0;if(e==(i<0?0:Bt(t))){let a=t.parentNode;if(!a||a.nodeType!=1||Jr(t)||Jx.test(t.nodeName)||t.contentEditable=="false")return!1;e=Ge(t)+(i<0?0:1),t=a}else{if(t.nodeType!=1)return!1;{let a=t.childNodes[e+(i<0?-1:0)];if(a.nodeType==1&&a.contentEditable=="false"){if(!(!((s=a.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection))return!1;e+=i}else t=a,e=i<0?Bt(t):0}}}}function Bt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Jr(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Es=function(t){return t.focusNode&&co(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function uo(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}const Jt=typeof navigator<"u"?navigator:null,Ym=typeof document<"u"?document:null,Bn=Jt&&Jt.userAgent||"",wc=/Edge\/(\d+)/.exec(Bn),Xm=/MSIE \d/.exec(Bn),xc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Bn),dt=!!(Xm||xc||wc),Tn=Xm?document.documentMode:xc?+xc[1]:wc?+wc[1]:0,Tt=!dt&&/gecko\/(\d+)/i.test(Bn);Tt&&(/Firefox\/(\d+)/.exec(Bn)||[0,0])[1];const Cc=!dt&&/Chrome\/(\d+)/.exec(Bn),Ze=!!Cc,Qm=Cc?+Cc[1]:0,ot=!dt&&!!Jt&&/Apple Computer/.test(Jt.vendor),or=ot&&(/Mobile\/\w+/.test(Bn)||!!Jt&&Jt.maxTouchPoints>2),Ot=or||!!Jt&&/Mac/.test(Jt.platform),Gx=!!Jt&&/Win/.test(Jt.platform),an=/Android \d/.test(Bn),Gr=!!Ym&&"webkitFontSmoothing"in Ym.documentElement.style,Yx=Gr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Xx(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function ln(t,e){return typeof t=="number"?t:t[e]}function Qx(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,o=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*o}}function Zm(t,e,n){let o=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let a=n||t.dom;a;){if(a.nodeType!=1){a=nr(a);continue}let l=a,c=l==s.body,d=c?Xx(s):Qx(l),u=0,p=0;if(e.top<d.top+ln(o,"top")?p=-(d.top-e.top+ln(i,"top")):e.bottom>d.bottom-ln(o,"bottom")&&(p=e.bottom-e.top>d.bottom-d.top?e.top+ln(i,"top")-d.top:e.bottom-d.bottom+ln(i,"bottom")),e.left<d.left+ln(o,"left")?u=-(d.left-e.left+ln(i,"left")):e.right>d.right-ln(o,"right")&&(u=e.right-d.right+ln(i,"right")),u||p)if(c)s.defaultView.scrollBy(u,p);else{let f=l.scrollLeft,m=l.scrollTop;p&&(l.scrollTop+=p),u&&(l.scrollLeft+=u);let g=l.scrollLeft-f,v=l.scrollTop-m;e={left:e.left-g,top:e.top-v,right:e.right-g,bottom:e.bottom-v}}let h=c?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(h))break;a=h=="absolute"?a.offsetParent:nr(a)}}function eg(t){let e=[],n=t.ownerDocument;for(let o=t;o&&(e.push({dom:o,top:o.scrollTop,left:o.scrollLeft}),t!=n);o=nr(o));return e}function tg(t,e){for(let n=0;n<t.length;n++){let{dom:o,top:i,left:s}=t[n];o.scrollTop!=i+e&&(o.scrollTop=i+e),o.scrollLeft!=s&&(o.scrollLeft=s)}}let rr=null;function ng(t,e){let n,o,i,s,a=2e8,l=0,c=e.top,d=e.top;for(let u=t.firstChild,p=0;u;u=u.nextSibling,p++){let h;if(u.nodeType==1)h=u.getClientRects();else{if(u.nodeType!=3)continue;h=sn(u).getClientRects()}for(let f=0;f<h.length;f++){let m=h[f];if(m.top<=c&&m.bottom>=d){c=Math.max(m.bottom,c),d=Math.min(m.top,d);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<a){n=u,a=g,o=g&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&g&&(l=p+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!i&&m.left<=e.left&&m.right>=e.left&&(i=u,s={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(l=p+1)}}return!n&&i&&(n=i,o=s,a=0),n&&n.nodeType==3?function(u,p){let h=u.nodeValue.length,f=document.createRange();for(let m=0;m<h;m++){f.setEnd(u,m+1),f.setStart(u,m);let g=On(f,1);if(g.top!=g.bottom&&Sc(p,g))return{node:u,offset:m+(p.left>=(g.left+g.right)/2?1:0)}}return{node:u,offset:0}}(n,o):!n||a&&n.nodeType==1?{node:t,offset:l}:ng(n,o)}function Sc(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function og(t,e,n){let o=t.childNodes.length;if(o&&n.top<n.bottom)for(let i=Math.max(0,Math.min(o-1,Math.floor(o*(e.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let a=t.childNodes[s];if(a.nodeType==1){let l=a.getClientRects();for(let c=0;c<l.length;c++){let d=l[c];if(Sc(e,d))return og(a,e,d)}}if((s=(s+1)%o)==i)break}return t}function Zx(t,e){let n,o=t.dom.ownerDocument,i=0,s=function(d,u,p){if(d.caretPositionFromPoint)try{let h=d.caretPositionFromPoint(u,p);if(h)return{node:h.offsetNode,offset:Math.min(Bt(h.offsetNode),h.offset)}}catch{}if(d.caretRangeFromPoint){let h=d.caretRangeFromPoint(u,p);if(h)return{node:h.startContainer,offset:Math.min(Bt(h.startContainer),h.startOffset)}}}(o,e.left,e.top);s&&({node:n,offset:i}=s);let a,l=(t.root.elementFromPoint?t.root:o).elementFromPoint(e.left,e.top);if(!l||!t.dom.contains(l.nodeType!=1?l.parentNode:l)){let d=t.dom.getBoundingClientRect();if(!Sc(e,d)||(l=og(t.dom,e,d),!l))return null}if(ot)for(let d=l;n&&d;d=nr(d))d.draggable&&(n=void 0);if(l=function(d,u){let p=d.parentNode;return p&&/^li$/i.test(p.nodeName)&&u.left<d.getBoundingClientRect().left?p:d}(l,e),n){if(Tt&&n.nodeType==1&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let u,p=n.childNodes[i];p.nodeName=="IMG"&&(u=p.getBoundingClientRect()).right<=e.left&&u.bottom>e.top&&i++}let d;Gr&&i&&n.nodeType==1&&(d=n.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,n==t.dom&&i==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:i!=0&&n.nodeType==1&&n.childNodes[i-1].nodeName=="BR"||(a=function(u,p,h,f){let m=-1;for(let g=p,v=!1;g!=u.dom;){let b,y=u.docView.nearestDesc(g,!0);if(!y)return null;if(y.dom.nodeType==1&&(y.node.isBlock&&y.parent||!y.contentDOM)&&((b=y.dom.getBoundingClientRect()).width||b.height)&&(y.node.isBlock&&y.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(y.dom.nodeName)&&(!v&&b.left>f.left||b.top>f.top?m=y.posBefore:(!v&&b.right<f.left||b.bottom<f.top)&&(m=y.posAfter),v=!0),!y.contentDOM&&m<0&&!y.node.isText))return(y.node.isBlock?f.top<(b.top+b.bottom)/2:f.left<(b.left+b.right)/2)?y.posBefore:y.posAfter;g=y.dom.parentNode}return m>-1?m:u.docView.posFromDOM(p,h,-1)}(t,n,i,e))}a==null&&(a=function(d,u,p){let{node:h,offset:f}=ng(u,p),m=-1;if(h.nodeType==1&&!h.firstChild){let g=h.getBoundingClientRect();m=g.left!=g.right&&p.left>(g.left+g.right)/2?1:-1}return d.docView.posFromDOM(h,f,m)}(t,l,e));let c=t.docView.nearestDesc(l,!0);return{pos:a,inside:c?c.posAtStart-c.border:-1}}function rg(t){return t.top<t.bottom||t.left<t.right}function On(t,e){let n=t.getClientRects();if(n.length){let o=n[e<0?0:n.length-1];if(rg(o))return o}return Array.prototype.find.call(n,rg)||t.getBoundingClientRect()}const eC=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function ig(t,e,n){let{node:o,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),a=Gr||Tt;if(o.nodeType==3){if(!a||!eC.test(o.nodeValue)&&(n<0?i:i!=o.nodeValue.length)){let l=i,c=i,d=n<0?1:-1;return n<0&&!i?(c++,d=-1):n>=0&&i==o.nodeValue.length?(l--,d=1):n<0?l--:c++,Yr(On(sn(o,l,c),d),d<0)}{let l=On(sn(o,i,i),n);if(Tt&&i&&/\s/.test(o.nodeValue[i-1])&&i<o.nodeValue.length){let c=On(sn(o,i-1,i-1),-1);if(c.top==l.top){let d=On(sn(o,i,i+1),-1);if(d.top!=l.top)return Yr(d,d.left<c.left)}}return l}}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==Bt(o))){let l=o.childNodes[i-1];if(l.nodeType==1)return Ec(l.getBoundingClientRect(),!1)}if(s==null&&i<Bt(o)){let l=o.childNodes[i];if(l.nodeType==1)return Ec(l.getBoundingClientRect(),!0)}return Ec(o.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==Bt(o))){let l=o.childNodes[i-1],c=l.nodeType==3?sn(l,Bt(l)-(a?0:1)):l.nodeType!=1||l.nodeName=="BR"&&l.nextSibling?null:l;if(c)return Yr(On(c,1),!1)}if(s==null&&i<Bt(o)){let l=o.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?sn(l,0,a?0:1):l.nodeType==1?l:null:null;if(c)return Yr(On(c,-1),!0)}return Yr(On(o.nodeType==3?sn(o):o,-n),n>=0)}function Yr(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Ec(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function sg(t,e,n){let o=t.state,i=t.root.activeElement;o!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{o!=e&&t.updateState(o),i!=t.dom&&i&&i.focus()}}const tC=/[\u0590-\u08ac]/;let ag=null,lg=null,cg=!1;class Xr{constructor(e,n,o,i){this.parent=e,this.children=n,this.dom=o,this.contentDOM=i,this.dirty=0,o.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,o){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,o=this.posAtStart;;n++){let i=this.children[n];if(i==e)return o;o+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,o){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode)){if(o<0){let s,a;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&(!(a=s.pmViewDesc)||a.parent!=this);)s=s.previousSibling;return s?this.posBeforeChild(a)+a.size:this.posAtStart}{let s,a;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&(!(a=s.pmViewDesc)||a.parent!=this);)s=s.nextSibling;return s?this.posBeforeChild(a):this.posAtEnd}}let i;if(e==this.dom&&this.contentDOM)i=n>Ge(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??o>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let o=!0,i=e;i;i=i.parentNode){let s,a=this.getDesc(i);if(a&&(!n||a.node)){if(!o||!(s=a.nodeDOM)||(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))return a;o=!1}}}getDesc(e){let n=e.pmViewDesc;for(let o=n;o;o=o.parent)if(o==this)return n}posFromDOM(e,n,o){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,n,o)}return-1}descAt(e){for(let n=0,o=0;n<this.children.length;n++){let i=this.children[n],s=o+i.size;if(o==e&&s!=o){for(;!i.border&&i.children.length;)for(let a=0;a<i.children.length;a++){let l=i.children[a];if(l.size){i=l;break}}return i}if(e<s)return i.descAt(e-o-i.border);o=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let o=0,i=0;for(let s=0;o<this.children.length;o++){let a=this.children[o],l=s+a.size;if(l>e||a instanceof pg){i=e-s;break}s=l}if(i)return this.children[o].domFromPos(i-this.children[o].border,n);for(let s;o&&!(s=this.children[o-1]).size&&s instanceof dg&&s.side>=0;o--);if(n<=0){let s,a=!0;for(;s=o?this.children[o-1]:null,s&&s.dom.parentNode!=this.contentDOM;o--,a=!1);return s&&n&&a&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?Ge(s.dom)+1:0}}{let s,a=!0;for(;s=o<this.children.length?this.children[o]:null,s&&s.dom.parentNode!=this.contentDOM;o++,a=!1);return s&&a&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?Ge(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,o=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let a=o,l=0;;l++){let c=this.children[l],d=a+c.size;if(i==-1&&e<=d){let u=a+c.border;if(e>=u&&n<=d-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,n,u);e=a;for(let p=l;p>0;p--){let h=this.children[p-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=Ge(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(d>n||l==this.children.length-1)){n=d;for(let u=l+1;u<this.children.length;u++){let p=this.children[u];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(-1)){s=Ge(p.dom);break}n+=p.size}s==-1&&(s=this.contentDOM.childNodes.length);break}a=d}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:o}=this.domFromPos(e,0);if(n.nodeType!=1||o==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[o]}setSelection(e,n,o,i=!1){let s=Math.min(e,n),a=Math.max(e,n);for(let f=0,m=0;f<this.children.length;f++){let g=this.children[f],v=m+g.size;if(s>m&&a<v)return g.setSelection(e-m-g.border,n-m-g.border,o,i);m=v}let l=this.domFromPos(e,e?-1:1),c=n==e?l:this.domFromPos(n,n?-1:1),d=o.root.getSelection(),u=o.domSelectionRange(),p=!1;if((Tt||ot)&&e==n){let{node:f,offset:m}=l;if(f.nodeType==3){if(p=!(!m||f.nodeValue[m-1]!=`
42
- `),p&&m==f.nodeValue.length)for(let g,v=f;v;v=v.parentNode){if(g=v.nextSibling){g.nodeName=="BR"&&(l=c={node:g.parentNode,offset:Ge(g)+1});break}let b=v.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let g=f.childNodes[m-1];p=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(Tt&&u.focusNode&&u.focusNode!=c.node&&u.focusNode.nodeType==1){let f=u.focusNode.childNodes[u.focusOffset];f&&f.contentEditable=="false"&&(i=!0)}if(!(i||p&&ot)&&co(l.node,l.offset,u.anchorNode,u.anchorOffset)&&co(c.node,c.offset,u.focusNode,u.focusOffset))return;let h=!1;if((d.extend||e==n)&&(!p||!Tt)){d.collapse(l.node,l.offset);try{e!=n&&d.extend(c.node,c.offset),h=!0}catch{}}if(!h){if(e>n){let m=l;l=c,c=m}let f=document.createRange();f.setEnd(c.node,c.offset),f.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let o=0,i=0;i<this.children.length;i++){let s=this.children[i],a=o+s.size;if(o==a?e<=a&&n>=o:e<a&&n>o){let l=o+s.border,c=a-s.border;if(e>=l&&n<=c)return this.dirty=e==o||n==a?2:1,void(e!=l||n!=c||!s.contentLost&&s.dom.parentNode==this.contentDOM?s.markDirty(e-l,n-l):s.dirty=3);s.dirty=s.dom!=s.contentDOM||s.dom.parentNode!=this.contentDOM||s.children.length?3:2}o=a}this.dirty=2}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let o=e==1?2:1;n.dirty<o&&(n.dirty=o)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class dg extends Xr{constructor(e,n,o,i){let s,a=n.type.toDOM;if(typeof a=="function"&&(a=a(o,()=>s?s.parent?s.parent.posBeforeChild(s):void 0:i)),!n.type.spec.raw){if(a.nodeType!=1){let l=document.createElement("span");l.appendChild(a),a=l}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(e,[],a,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==0&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return!!n&&n(e)}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class nC extends Xr{constructor(e,n,o,i){super(e,[],n,null),this.textDOM=o,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class po extends Xr{constructor(e,n,o,i,s){super(e,[],o,i),this.mark=n,this.spec=s}static create(e,n,o,i){let s=i.nodeViews[n.type.name],a=s&&s(n,i,o);return a&&a.dom||(a=ao.renderSpec(document,n.type.spec.toDOM(n,o),null,n.attrs)),new po(e,n,a.dom,a.contentDOM||a.dom,a)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=3&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=0){let o=this.parent;for(;!o.node;)o=o.parent;o.dirty<this.dirty&&(o.dirty=this.dirty),this.dirty=0}}slice(e,n,o){let i=po.create(this.parent,this.mark,!0,o),s=this.children,a=this.size;n<a&&(s=Nc(s,n,a,o)),e>0&&(s=Nc(s,0,e,o));for(let l=0;l<s.length;l++)s[l].parent=i;return i.children=s,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class _n extends Xr{constructor(e,n,o,i,s,a,l,c,d){super(e,[],s,a),this.node=n,this.outerDeco=o,this.innerDeco=i,this.nodeDOM=l}static create(e,n,o,i,s,a){let l,c=s.nodeViews[n.type.name],d=c&&c(n,s,()=>l?l.parent?l.parent.posBeforeChild(l):void 0:a,o,i),u=d&&d.dom,p=d&&d.contentDOM;if(n.isText)if(u){if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u=document.createTextNode(n.text);else u||({dom:u,contentDOM:p}=ao.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));p||n.isText||u.nodeName=="BR"||(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let h=u;return u=mg(u,o,n),d?l=new oC(e,n,o,i,u,p||null,h,d,s,a+1):n.isText?new Ms(e,n,o,i,u,h,s):new _n(e,n,o,i,u,p||null,h,s,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let n=this.children.length-1;n>=0;n--){let o=this.children[n];if(this.dom.contains(o.dom.parentNode)){e.contentElement=o.dom.parentNode;break}}e.contentElement||(e.getContent=()=>H.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,n,o){return this.dirty==0&&e.eq(this.node)&&Ns(n,this.outerDeco)&&o.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let o=this.node.inlineContent,i=n,s=e.composing?this.localCompositionInfo(e,n):null,a=s&&s.pos>-1?s:null,l=s&&s.pos<0,c=new iC(this,a&&a.node,e);(function(d,u,p,h){let f=u.locals(d),m=0;if(f.length==0){for(let y=0;y<d.childCount;y++){let k=d.child(y);h(k,f,u.forChild(m,k),y),m+=k.nodeSize}return}let g=0,v=[],b=null;for(let y=0;;){let k,x,w,C;for(;g<f.length&&f[g].to==m;){let E=f[g++];E.widget&&(k?(x||(x=[k])).push(E):k=E)}if(k)if(x){x.sort(sC);for(let E=0;E<x.length;E++)p(x[E],y,!!b)}else p(k,y,!!b);if(b)C=-1,w=b,b=null;else{if(!(y<d.childCount))break;C=y,w=d.child(y++)}for(let E=0;E<v.length;E++)v[E].to<=m&&v.splice(E--,1);for(;g<f.length&&f[g].from<=m&&f[g].to>m;)v.push(f[g++]);let S=m+w.nodeSize;if(w.isText){let E=S;g<f.length&&f[g].from<E&&(E=f[g].from);for(let M=0;M<v.length;M++)v[M].to<E&&(E=v[M].to);E<S&&(b=w.cut(E-m),w=w.cut(0,E-m),S=E,C=-1)}else for(;g<f.length&&f[g].to<S;)g++;h(w,w.isInline&&!w.isLeaf?v.filter(E=>!E.inline):v.slice(),u.forChild(m,w),C),m=S}})(this.node,this.innerDeco,(d,u,p)=>{d.spec.marks?c.syncToMarks(d.spec.marks,o,e):d.type.side>=0&&!p&&c.syncToMarks(u==this.node.childCount?xe.none:this.node.child(u).marks,o,e),c.placeWidget(d,e,i)},(d,u,p,h)=>{let f;c.syncToMarks(d.marks,o,e),c.findNodeMatch(d,u,p,h)||l&&e.state.selection.from>i&&e.state.selection.to<i+d.nodeSize&&(f=c.findIndexWithChild(s.node))>-1&&c.updateNodeAt(d,u,p,f,e)||c.updateNextNode(d,u,p,e,h,i)||c.addNode(d,u,p,e,i),i+=d.nodeSize}),c.syncToMarks([],o,e),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==2)&&(a&&this.protectLocalComposition(e,a),hg(this.contentDOM,this.children,e),or&&function(d){if(d.nodeName=="UL"||d.nodeName=="OL"){let u=d.style.cssText;d.style.cssText=u+"; list-style: square !important",window.getComputedStyle(d).listStyle,d.style.cssText=u}}(this.dom))}localCompositionInfo(e,n){let{from:o,to:i}=e.state.selection;if(!(e.state.selection instanceof le)||o<n||i>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,l=function(c,d,u,p){for(let h=0,f=0;h<c.childCount&&f<=p;){let m=c.child(h++),g=f;if(f+=m.nodeSize,!m.isText)continue;let v=m.text;for(;h<c.childCount;){let b=c.child(h++);if(f+=b.nodeSize,!b.isText)break;v+=b.text}if(f>=u){if(f>=p&&v.slice(p-d.length-g,p-g)==d)return p-d.length;let b=g<p?v.lastIndexOf(d,p-g-1):-1;if(b>=0&&b+d.length+g>=u)return g+b;if(u==p&&v.length>=p+d.length-g&&v.slice(p-g,p-g+d.length)==d)return p}}return-1}(this.node.content,a,o-n,i-n);return l<0?null:{node:s,pos:l,text:a}}return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:o,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let a=new nC(this,s,n,i);e.input.compositionNodes.push(a),this.children=Nc(this.children,o,o+i.length,e,a)}update(e,n,o,i){return!(this.dirty==3||!e.sameMarkup(this.node)||(this.updateInner(e,n,o,i),0))}updateInner(e,n,o,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=o,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(Ns(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,o=this.dom;this.dom=fg(this.dom,this.nodeDOM,Mc(this.outerDeco,this.node,n),Mc(e,this.node,n)),this.dom!=o&&(o.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function ug(t,e,n,o,i){mg(o,e,t);let s=new _n(void 0,t,e,n,o,o,o,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class Ms extends _n{constructor(e,n,o,i,s,a,l){super(e,n,o,i,s,null,a,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,o,i){return!(this.dirty==3||this.dirty!=0&&!this.inParent()||!e.sameMarkup(this.node)||(this.updateOuterDeco(n),this.dirty==0&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=0,0))}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,o){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,o)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,o){let i=this.node.cut(e,n),s=document.createTextNode(i.text);return new Ms(this.parent,i,this.outerDeco,this.innerDeco,s,s,o)}markDirty(e,n){super.markDirty(e,n),this.dom==this.nodeDOM||e!=0&&n!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class pg extends Xr{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==0&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class oC extends _n{constructor(e,n,o,i,s,a,l,c,d,u){super(e,n,o,i,s,a,l,d,u),this.spec=c}update(e,n,o,i){if(this.dirty==3)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,o);return s&&this.updateInner(e,n,o,i),s}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,n,o,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,o,i){this.spec.setSelection?this.spec.setSelection(e,n,o.root):super.setSelection(e,n,o,i)}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 hg(t,e,n){let o=t.firstChild,i=!1;for(let s=0;s<e.length;s++){let a=e[s],l=a.dom;if(l.parentNode==t){for(;l!=o;)o=gg(o),i=!0;o=o.nextSibling}else i=!0,t.insertBefore(l,o);if(a instanceof po){let c=o?o.previousSibling:t.lastChild;hg(a.contentDOM,a.children,n),o=c?c.nextSibling:t.firstChild}}for(;o;)o=gg(o),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const Qr=function(t){t&&(this.nodeName=t)};Qr.prototype=Object.create(null);const ho=[new Qr];function Mc(t,e,n){if(t.length==0)return ho;let o=n?ho[0]:new Qr,i=[o];for(let s=0;s<t.length;s++){let a=t[s].type.attrs;if(a){a.nodeName&&i.push(o=new Qr(a.nodeName));for(let l in a){let c=a[l];c!=null&&(n&&i.length==1&&i.push(o=new Qr(e.isInline?"span":"div")),l=="class"?o.class=(o.class?o.class+" ":"")+c:l=="style"?o.style=(o.style?o.style+";":"")+c:l!="nodeName"&&(o[l]=c))}}}return i}function fg(t,e,n,o){if(n==ho&&o==ho)return e;let i=e;for(let s=0;s<o.length;s++){let a=o[s],l=n[s];if(s){let c;l&&l.nodeName==a.nodeName&&i!=t&&(c=i.parentNode)&&c.nodeName.toLowerCase()==a.nodeName||(c=document.createElement(a.nodeName),c.pmIsDeco=!0,c.appendChild(i),l=ho[0]),i=c}rC(i,l||ho[0],a)}return i}function rC(t,e,n){for(let o in e)o=="class"||o=="style"||o=="nodeName"||o in n||t.removeAttribute(o);for(let o in n)o!="class"&&o!="style"&&o!="nodeName"&&n[o]!=e[o]&&t.setAttribute(o,n[o]);if(e.class!=n.class){let o=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<o.length;s++)i.indexOf(o[s])==-1&&t.classList.remove(o[s]);for(let s=0;s<i.length;s++)o.indexOf(i[s])==-1&&t.classList.add(i[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let o,i=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;o=i.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function mg(t,e,n){return fg(t,t,ho,Mc(e,n,t.nodeType!=1))}function Ns(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function gg(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class iC{constructor(e,n,o){this.lock=n,this.view=o,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(i,s){let a=s,l=a.children.length,c=i.childCount,d=new Map,u=[];e:for(;c>0;){let p;for(;;)if(l){let f=a.children[l-1];if(!(f instanceof po)){p=f,l--;break}a=f,l=f.children.length}else{if(a==s)break e;l=a.parent.children.indexOf(a),a=a.parent}let h=p.node;if(h){if(h!=i.child(c-1))break;--c,d.set(p,c),u.push(p)}}return{index:c,matched:d,matches:u.reverse()}}(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let o=e;o<n;o++)this.top.children[o].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,o){let i=0,s=this.stack.length>>1,a=Math.min(s,e.length);for(;i<a&&(i==s-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<s;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let l=-1;for(let c=this.index;c<Math.min(this.index+3,this.top.children.length);c++){let d=this.top.children[c];if(d.matchesMark(e[s])&&!this.isLocked(d.dom)){l=c;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let c=po.create(this.top,e[s],n,o);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,s++}}findNodeMatch(e,n,o,i){let s,a=-1;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,o))a=this.top.children.indexOf(s,this.index);else for(let l=this.index,c=Math.min(this.top.children.length,l+5);l<c;l++){let d=this.top.children[l];if(d.matchesNode(e,n,o)&&!this.preMatch.matched.has(d)){a=l;break}}return!(a<0||(this.destroyBetween(this.index,a),this.index++,0))}updateNodeAt(e,n,o,i,s){let a=this.top.children[i];return a.dirty==3&&a.dom==a.contentDOM&&(a.dirty=2),!!a.update(e,n,o,s)&&(this.destroyBetween(this.index,i),this.index++,!0)}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let o=e.pmViewDesc;if(o){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==o)return i}return-1}e=n}}updateNextNode(e,n,o,i,s,a){for(let l=this.index;l<this.top.children.length;l++){let c=this.top.children[l];if(c instanceof _n){let d=this.preMatch.matched.get(c);if(d!=null&&d!=s)return!1;let u,p=c.dom,h=this.isLocked(p)&&!(e.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==e.text&&c.dirty!=3&&Ns(n,c.outerDeco));if(!h&&c.update(e,n,o,i))return this.destroyBetween(this.index,l),c.dom!=p&&(this.changed=!0),this.index++,!0;if(!h&&(u=this.recreateWrapper(c,e,n,o,i,a)))return this.destroyBetween(this.index,l),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=2,u.updateChildren(i,a+1),u.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,o,i,s,a){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!Ns(o,e.outerDeco)||!i.eq(e.innerDeco))return null;let l=_n.create(this.top,n,o,i,s,a);if(l.contentDOM){l.children=e.children,e.children=[];for(let c of l.children)c.parent=l}return e.destroy(),l}addNode(e,n,o,i,s){let a=_n.create(this.top,e,n,o,i,s);a.contentDOM&&a.updateChildren(i,s+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,n,o){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(!i||!i.matchesWidget(e)||e!=i.widget&&i.widget.type.toDOM.parentNode){let s=new dg(this.top,e,n,o);this.top.children.splice(this.index++,0,s),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof po;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Ms)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((ot||Ze)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let o=document.createElement(e);e=="IMG"&&(o.className="ProseMirror-separator",o.alt=""),e=="BR"&&(o.className="ProseMirror-trailingBreak");let i=new pg(this.top,[],o,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function sC(t,e){return t.type.side-e.type.side}function Nc(t,e,n,o,i){let s=[];for(let a=0,l=0;a<t.length;a++){let c=t[a],d=l,u=l+=c.size;d>=n||u<=e?s.push(c):(d<e&&s.push(c.slice(0,e-d,o)),i&&(s.push(i),i=void 0),u>n&&s.push(c.slice(n-d,c.size,o)))}return s}function Bc(t,e=null){let n=t.domSelectionRange(),o=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),s=i&&i.size==0,a=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let l,c,d=o.resolve(a);if(Es(n)){for(l=a;i&&!i.node;)i=i.parent;let p=i.node;if(i&&p.isAtom&&re.isSelectable(p)&&i.parent&&(!p.isInline||!function(h,f,m){for(let g=f==0,v=f==Bt(h);g||v;){if(h==m)return!0;let b=Ge(h);if(!(h=h.parentNode))return!1;g=g&&b==0,v=v&&b==Bt(h)}}(n.focusNode,n.focusOffset,i.dom))){let h=i.posBefore;c=new re(a==h?d:o.resolve(h))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let p=a,h=a;for(let f=0;f<n.rangeCount;f++){let m=n.getRangeAt(f);p=Math.min(p,t.docView.posFromDOM(m.startContainer,m.startOffset,1)),h=Math.max(h,t.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(p<0)return null;[l,a]=h==t.state.selection.anchor?[h,p]:[p,h],d=o.resolve(a)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let u=o.resolve(l);return c||(c=Oc(t,u,d,e=="pointer"||t.state.selection.head<d.pos&&!s?1:-1)),c}function vg(t){return t.editable?t.hasFocus():Sg(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function cn(t,e=!1){let n=t.state.selection;if(wg(t,n),vg(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Ze){let o=t.domSelectionRange(),i=t.domObserver.currentSelection;if(o.anchorNode&&i.anchorNode&&co(o.anchorNode,o.anchorOffset,i.anchorNode,i.anchorOffset))return t.input.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)(function(o){let i=o.domSelection();if(!i)return;let s=o.cursorWrapper.dom,a=s.nodeName=="IMG";a?i.collapse(s.parentNode,Ge(s)+1):i.collapse(s,0),!a&&!o.state.selection.visible&&dt&&Tn<=11&&(s.disabled=!0,s.disabled=!1)})(t);else{let o,i,{anchor:s,head:a}=n;!yg||n instanceof le||(n.$from.parent.inlineContent||(o=bg(t,n.from)),n.empty||n.$from.parent.inlineContent||(i=bg(t,n.to))),t.docView.setSelection(s,a,t,e),yg&&(o&&kg(o),i&&kg(i)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(l){let c=l.dom.ownerDocument;c.removeEventListener("selectionchange",l.input.hideSelectionGuard);let d=l.domSelectionRange(),u=d.anchorNode,p=d.anchorOffset;c.addEventListener("selectionchange",l.input.hideSelectionGuard=()=>{d.anchorNode==u&&d.anchorOffset==p||(c.removeEventListener("selectionchange",l.input.hideSelectionGuard),setTimeout(()=>{vg(l)&&!l.state.selection.visible||l.dom.classList.remove("ProseMirror-hideselection")},20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const yg=ot||Ze&&Qm<63;function bg(t,e){let{node:n,offset:o}=t.docView.domFromPos(e,0),i=o<n.childNodes.length?n.childNodes[o]:null,s=o?n.childNodes[o-1]:null;if(ot&&i&&i.contentEditable=="false")return Tc(i);if(!(i&&i.contentEditable!="false"||s&&s.contentEditable!="false")){if(i)return Tc(i);if(s)return Tc(s)}}function Tc(t){return t.contentEditable="true",ot&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function kg(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function wg(t,e){if(e instanceof re){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(xg(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else xg(t)}function xg(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Oc(t,e,n,o){return t.someProp("createSelectionBetween",i=>i(t,e,n))||le.between(e,n,o)}function Cg(t){return!(t.editable&&!t.hasFocus())&&Sg(t)}function Sg(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function _c(t,e){let{$anchor:n,$head:o}=t.selection,i=e>0?n.max(o):n.min(o),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&he.findFrom(s,e)}function Vn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Eg(t,e,n){let o=t.state.selection;if(!(o instanceof le)){if(o instanceof re&&o.node.isInline)return Vn(t,new le(e>0?o.$to:o.$from));{let i=_c(t.state,e);return!!i&&Vn(t,i)}}if(n.indexOf("s")>-1){let{$head:i}=o,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let a=t.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return Vn(t,new le(o.$anchor,a))}if(!o.empty)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){let i=_c(t.state,e);return!!(i&&i instanceof re)&&Vn(t,i)}if(!(Ot&&n.indexOf("m")>-1)){let i,s=o.$head,a=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!a||a.isText)return!1;let l=e<0?s.pos-a.nodeSize:s.pos;return!!(a.isAtom||(i=t.docView.descAt(l))&&!i.contentDOM)&&(re.isSelectable(a)?Vn(t,new re(e<0?t.state.doc.resolve(s.pos-a.nodeSize):s)):!!Gr&&Vn(t,new le(t.state.doc.resolve(e<0?l:l+a.nodeSize))))}}function Bs(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Zr(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function ir(t,e){return e<0?function(n){let o=n.domSelectionRange(),i=o.focusNode,s=o.focusOffset;if(!i)return;let a,l,c=!1;for(Tt&&i.nodeType==1&&s<Bs(i)&&Zr(i.childNodes[s],-1)&&(c=!0);;)if(s>0){if(i.nodeType!=1)break;{let d=i.childNodes[s-1];if(Zr(d,-1))a=i,l=--s;else{if(d.nodeType!=3)break;i=d,s=i.nodeValue.length}}}else{if(Mg(i))break;{let d=i.previousSibling;for(;d&&Zr(d,-1);)a=i.parentNode,l=Ge(d),d=d.previousSibling;if(d)i=d,s=Bs(i);else{if(i=i.parentNode,i==n.dom)break;s=0}}}c?Vc(n,i,s):a&&Vc(n,a,l)}(t):function(n){let o=n.domSelectionRange(),i=o.focusNode,s=o.focusOffset;if(!i)return;let a,l,c=Bs(i);for(;;)if(s<c){if(i.nodeType!=1||!Zr(i.childNodes[s],1))break;a=i,l=++s}else{if(Mg(i))break;{let d=i.nextSibling;for(;d&&Zr(d,1);)a=d.parentNode,l=Ge(d)+1,d=d.nextSibling;if(d)i=d,s=0,c=Bs(i);else{if(i=i.parentNode,i==n.dom)break;s=c=0}}}a&&Vc(n,a,l)}(t)}function Mg(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Vc(t,e,n){if(e.nodeType!=3){let s,a;(a=function(l,c){for(;l&&c==l.childNodes.length&&!Jr(l);)c=Ge(l)+1,l=l.parentNode;for(;l&&c<l.childNodes.length;){let d=l.childNodes[c];if(d.nodeType==3)return d;if(d.nodeType==1&&d.contentEditable=="false")break;l=d,c=0}}(e,n))?(e=a,n=0):(s=function(l,c){for(;l&&!c&&!Jr(l);)c=Ge(l),l=l.parentNode;for(;l&&c;){let d=l.childNodes[c-1];if(d.nodeType==3)return d;if(d.nodeType==1&&d.contentEditable=="false")break;c=(l=d).childNodes.length}}(e,n))&&(e=s,n=s.nodeValue.length)}let o=t.domSelection();if(!o)return;if(Es(o)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),o.removeAllRanges(),o.addRange(s)}else o.extend&&o.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&cn(t)},50)}function Ng(t,e){let n=t.state.doc.resolve(e);if(!Ze&&!Gx&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left<o.left?"ltr":"rtl"}if(e<n.end()){let i=t.coordsAtPos(e+1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Bg(t,e,n){let o=t.state.selection;if(o instanceof le&&!o.empty||n.indexOf("s")>-1||Ot&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=o;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let a=_c(t.state,e);if(a&&a instanceof re)return Vn(t,a)}if(!i.parent.inlineContent){let a=e<0?i:s,l=o instanceof kt?he.near(a,e):he.findFrom(a,e);return!!l&&Vn(t,l)}return!1}function Tg(t,e){if(!(t.state.selection instanceof le))return!0;let{$head:n,$anchor:o,empty:i}=t.state.selection;if(!n.sameParent(o))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let a=t.state.tr;return e<0?a.delete(n.pos-s.nodeSize,n.pos):a.delete(n.pos,n.pos+s.nodeSize),t.dispatch(a),!0}return!1}function Og(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Ac(t,e){t.someProp("transformCopied",h=>{e=h(e,t)});let n=[],{content:o,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&o.childCount==1&&o.firstChild.childCount==1;){i--,s--;let h=o.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),o=h.content}let a=t.someProp("clipboardSerializer")||ao.fromSchema(t.state.schema),l=$g(),c=l.createElement("div");c.appendChild(a.serializeFragment(o,{document:l}));let d,u=c.firstChild,p=0;for(;u&&u.nodeType==1&&(d=Rg[u.nodeName.toLowerCase()]);){for(let h=d.length-1;h>=0;h--){let f=l.createElement(d[h]);for(;c.firstChild;)f.appendChild(c.firstChild);c.appendChild(f),p++}u=c.firstChild}return u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${s}${p?` -${p}`:""} ${JSON.stringify(n)}`),{dom:c,text:t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,`
36
+ `,document.head.appendChild(t)})();const Nh=ee(Mh),Bh="mc-copy",bw={class:"mc-copy"},kw={class:"mc-copy-text"},Th=ee(q(r.defineComponent({name:Bh,__name:"mc-copy",props:{text:{},showToast:{type:Boolean,default:!1},toastSuccessText:{default:"copy succeed"},toastErrorText:{default:"copy failed"},manual:{type:Boolean,default:!1}},emits:["copy","success","error"],setup(t,{emit:e}){const n=t,o=e,i=async()=>{if(n.text)if(n.manual)o("copy",n.text);else try{await navigator.clipboard.writeText(n.text),o("success",n.text),n.showToast&&Xi.success(n.toastSuccessText)}catch(s){console.error(s),o("error",n.text,s),n.showToast&&Xi.error(n.toastErrorText)}};return(s,a)=>(r.openBlock(),r.createElementBlock("div",bw,[r.renderSlot(s.$slots,"default",{},()=>[r.createElementVNode("span",kw,r.toDisplayString(t.text),1)],!0),r.createVNode(r.unref(ge),{name:"Duplicate",class:"mc-copy-icon",onClick:i})]))}}),[["__scopeId","data-v-549b134c"]])),Oh="mc-count",ww={key:0,class:"mc-count-number"},_h=ee(q(r.defineComponent({name:Oh,__name:"mc-count",props:{value:{},theme:{default:"red"},type:{default:"medium"},hiddenZero:{type:Boolean,default:!0},max:{default:99}},emits:["change"],setup(t,{emit:e}){const n=t,o=e,i=r.computed(()=>{const c=Number(n.value);return isNaN(c)?(console.warn("mc-count: value is not a number"),0):c}),s=r.computed(()=>!n.hiddenZero||i.value>0),a=r.computed(()=>n.max&&i.value>n.max?`${n.max}+`:`${i.value}`),l=r.computed(()=>n.type==="tiny");return r.watch(()=>n.value,(c,d)=>{c!==d&&o("change",c)}),(c,d)=>s.value?(r.openBlock(),r.createElementBlock("i",{key:0,class:r.normalizeClass(["mc-count",[`mc-count-${t.theme}`,`mc-count-${t.type}`]])},[l.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("span",ww,r.toDisplayString(a.value),1))],2)):r.createCommentVNode("",!0)}}),[["__scopeId","data-v-dac26190"]])),Vh="mc-currency-icon",xw={class:"mc-currency-icon-img-wrapper"},Cw=["src","alt"],Sw={class:"mc-currency-icon-label"},Ew={class:"mc-currency-icon-text"},Mw=r.defineComponent({name:Vh,__name:"mc-currency-icon",props:{currency:{},direction:{default:"horizontal"},desc:{},cdnUrl:{},suffix:{default:"svg"},height:{},width:{}},setup(t){const e=t,{generateFileUrl:n}=(o=e.cdnUrl,i=e.suffix,{generateFileUrl:l=>{if(o&&i&&l)return`${o}/${l}.${i}`}});var o,i;const{width:s,height:a}=lt();return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-currency-icon",style:r.normalizeStyle({width:r.unref(s),height:r.unref(a)})},[r.createElementVNode("div",xw,[r.renderSlot(l.$slots,"icon",{},()=>[r.createElementVNode("img",{src:r.unref(n)(t.currency),class:"mc-currency-icon-img",alt:`${t.currency}-icon`},null,8,Cw)],!0)]),r.createElementVNode("div",{class:r.normalizeClass(["mc-currency-icon-content",[`mc-currency-icon-content-${t.direction}`]])},[r.createElementVNode("div",Sw,[r.renderSlot(l.$slots,"default",{},()=>[r.createElementVNode("span",null,r.toDisplayString(t.currency),1)],!0)]),r.createElementVNode("div",Ew,[r.renderSlot(l.$slots,"desc",{},()=>[r.createElementVNode("span",null,r.toDisplayString(t.desc),1)],!0)])],2)],4))}}),Dh=ee(q(Mw,[["__scopeId","data-v-8858a1e7"]])),Ah="mc-date-picker",Ih="mc-date-picker-item",Rh="mc-date-picker-list",Lh="mc-date-picker-content",Ko=new Map([[0,{shortName:"Jan",fullName:"January"}],[1,{shortName:"Feb",fullName:"February"}],[2,{shortName:"Mar",fullName:"March"}],[3,{shortName:"Apr",fullName:"April"}],[4,{shortName:"May",fullName:"May"}],[5,{shortName:"Jun",fullName:"June"}],[6,{shortName:"Jul",fullName:"July"}],[7,{shortName:"Aug",fullName:"August"}],[8,{shortName:"Sep",fullName:"September"}],[9,{shortName:"Oct",fullName:"October"}],[10,{shortName:"Nov",fullName:"November"}],[11,{shortName:"Dec",fullName:"December"}]]),$h=new Map([[0,"Sun"],[1,"Mon"],[2,"Tue"],[3,"Wed"],[4,"Thu"],[5,"Fri"],[6,"Sat"]]),Nw={class:"mc-date-picker-item-text"},Bw=r.defineComponent({name:Ih,__name:"mc-date-picker-item",props:{isToday:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1},isActive:{type:Boolean,default:!1},isStart:{type:Boolean,default:!1},isEnd:{type:Boolean,default:!1},isDuration:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:e}){const n=e,o=()=>{n("click")};return(i,s)=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-date-picker-item",{"mc-date-picker-item-today":t.isToday,"mc-date-picker-item-disabled":t.isDisabled,"mc-date-picker-item-active":t.isActive,"mc-date-picker-item-start":t.isStart,"mc-date-picker-item-end":t.isEnd,"mc-date-picker-item-duration":t.isDuration}]),onClick:o},[r.createElementVNode("span",Nw,[r.renderSlot(i.$slots,"default",{},void 0,!0)])],2))}}),Tw=q(Bw,[["__scopeId","data-v-797f3810"]]),Uo=(t,e,n)=>{if(e.disabled||!n)return!1;const o=n.getFullYear(),i=n.getMonth(),s=n.getDate(),a=e.date.getFullYear(),l=e.date.getMonth(),c=e.date.getDate();return t==="day"?s===c&&i===l&&o===a:t==="month"?i===l&&o===a:t==="year"&&o===a},Vl=(t,e=1)=>{const n=new Date(t);return n.setFullYear(n.getFullYear()+e),n},Dl=(t,e=1)=>{const n=new Date(t);return n.setFullYear(n.getFullYear()-e),n},Ph=(t,e="up")=>{const n=e==="up";switch(t){case"day":return n?"month":"day";case"month":return n?"year":"day";case"year":return n?"year":"month";default:return"day"}},Ow=r.defineComponent({name:Rh,__name:"mc-date-picker-list",props:{modelValue:{},startDate:{},endDate:{},range:{type:Boolean},type:{default:"day"},dateSeed:{default:()=>new Date}},emits:["update:modelValue","update:startDate","update:endDate","update:dateSeed","update:type"],setup(t,{expose:e,emit:n}){const o=t,i=n,{generateDays:s,generateMonths:a,generateYears:l}={generateDays:b=>{const y=[],k=b.getMonth(),x=b.getFullYear(),w=new Date(x,k+1,0).getDate();for(let N=1;N<=w;N++){const T=new Date(x,k,N);y.push({key:T.getTime(),type:"day",label:String(N),value:T.getDate(),date:T})}let C=42-y.length;const S=y[0].date,E=Math.min(S.getDay(),C);for(let N=1;N<=E;N++){const T=new Date(S);T.setDate(T.getDate()-N),y.unshift({key:T.getTime(),type:"day",label:String(T.getDate()),value:T.getDate(),date:T,disabled:!0})}C=42-y.length;const M=y[y.length-1].date;for(let N=1;N<=C;N++){const T=new Date(M);T.setDate(T.getDate()+N),y.push({key:T.getTime(),type:"day",label:String(T.getDate()),value:T.getDate(),date:T,disabled:!0})}return y},generateMonths:b=>{const y=b.getFullYear();return Array.from(Ko.entries()).map(([k,x])=>{const w=new Date(y,k,1);return{key:w.getTime(),type:"month",label:x.shortName,value:w.getMonth(),date:w}})},generateYears:b=>{const y=[];for(let k=1;k<=10;k++){const x=Dl(b,k);y.unshift({key:x.getTime(),type:"year",label:String(x.getFullYear()),value:x.getFullYear(),date:x})}y.push({key:b.getTime(),type:"year",label:String(b.getFullYear()),value:b.getFullYear(),date:b});for(let k=1;k<=10;k++){const x=Vl(b,k);y.push({key:x.getTime(),type:"year",label:String(x.getFullYear()),value:x.getFullYear(),date:x})}return y}},c=r.computed(()=>o.type==="day"?s(o.dateSeed):o.type==="month"?a(o.dateSeed):o.type==="year"?l(o.dateSeed):[]),{updateDate:d}=(()=>{var C;const b=(C=r.getCurrentInstance())==null?void 0:C.emit,y=ue("range"),k=ue("startDate"),x=ue("endDate"),w=r.ref(!0);return{updateDate:S=>{y.value?((E=>{w.value?x.value&&x.value<E?(b==null||b("update:endDate",E),b==null||b("update:startDate",x.value)):b==null||b("update:startDate",E):k.value&&k.value>E?(b==null||b("update:startDate",E),b==null||b("update:endDate",k.value)):b==null||b("update:endDate",E)})(S),w.value=!w.value):(E=>{b==null||b("update:modelValue",E)})(S)}}})(),u=r.computed(()=>Array.from($h.values())),p=(b,y)=>!y.disabled&&Uo(b,y,new Date),h=(b,y)=>!y.disabled&&(o.range?Uo(b,y,o.startDate)||Uo(b,y,o.endDate):Uo(b,y,o.modelValue)),f=(b,y)=>!(y.disabled||!o.startDate||!o.endDate)&&Uo(b,y,o.startDate),m=(b,y)=>!(y.disabled||!o.startDate||!o.endDate)&&Uo(b,y,o.endDate),g=b=>{if(!o.startDate||!o.endDate)return!1;const y=b.date,k=o.startDate,x=o.endDate;return y>k&&y<x},v=r.computed(()=>o.type==="day");return e({setToday:()=>{i("update:dateSeed",new Date),i("update:type","day"),d(new Date)}}),(b,y)=>(r.openBlock(),r.createElementBlock("ul",{class:r.normalizeClass(["mc-date-picker-list",`mc-date-picker-list-${t.type}`])},[v.value?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(u.value,k=>(r.openBlock(),r.createElementBlock("li",{key:k,class:"mc-date-picker-list-weekday"},r.toDisplayString(k),1))),128)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,(k,x)=>(r.openBlock(),r.createBlock(Tw,{key:x,item:k,"is-disabled":k.disabled,"is-today":p(k.type,k),"is-active":h(k.type,k),"is-start":f(k.type,k),"is-end":m(k.type,k),"is-duration":g(k),onClick:()=>(w=>{if(o.type==="day")w.disabled&&i("update:dateSeed",w.date),d(w.date);else{i("update:dateSeed",w.date);const C=Ph(o.type,"down");i("update:type",C)}})(k)},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(k.label),1)]),_:2},1032,["item","is-disabled","is-today","is-active","is-start","is-end","is-duration","onClick"]))),128))],2))}}),_w=q(Ow,[["__scopeId","data-v-45c51c88"]]),Vw={class:"mc-date-picker-content"},Dw={class:"mc-date-picker-header"},Aw={class:"mc-date-picker-display-text"},Iw={class:"mc-date-picker-navigation"},Rw={class:"mc-date-picker-footer"},Lw=q(r.defineComponent({name:Lh,__name:"mc-date-picker-content",props:{range:{type:Boolean,default:!1},modelValue:{},startDate:{},endDate:{}},emits:["update:modelValue","update:startDate","update:endDate","stop:close"],setup(t,{emit:e}){const n=t,o=e,i=r.ref((g=n.range,v=n.modelValue,b=n.startDate,y=g?b||new Date:v||new Date,new Date(y.getFullYear(),y.getMonth(),1))),s=r.ref("day"),a=r.computed(()=>{var C;const k=i.value.getFullYear(),x=i.value.getMonth(),w=(C=Ko.get(x))==null?void 0:C.fullName;return s.value==="day"?`${w} ${k}`:s.value==="month"?`${k}`:s.value==="year"?`${k-10} - ${k+10}`:""}),l=()=>{o("stop:close"),s.value==="day"?i.value=((k,x=1)=>{const w=new Date(k);return w.setMonth(w.getMonth()-x),w})(i.value):s.value==="month"?i.value=Dl(i.value):s.value==="year"&&(i.value=Dl(i.value,21))},c=()=>{o("stop:close"),s.value==="day"?i.value=((k,x=1)=>{const w=new Date(k);return w.setMonth(w.getMonth()+x),w})(i.value):s.value==="month"?i.value=Vl(i.value):s.value==="year"&&(i.value=Vl(i.value,21))},d=()=>{o("stop:close"),s.value=Ph(s.value)},u=r.ref(),p=()=>{var k;o("stop:close"),(k=u.value)==null||k.setToday()},h=k=>{o("update:modelValue",k)},f=k=>{o("update:startDate",k)},m=k=>{o("update:endDate",k)};var g,v,b,y;return(k,x)=>(r.openBlock(),r.createElementBlock("div",Vw,[r.createElementVNode("div",Dw,[r.createElementVNode("div",{class:"mc-date-picker-date-display",onClick:d},[r.createElementVNode("span",Aw,r.toDisplayString(a.value),1),r.createVNode(r.unref(Ee),{class:"mc-date-picker-current-display-icon",name:"right-chevron-02",cursor:"pointer"})]),r.createElementVNode("div",Iw,[r.createVNode(r.unref(Ee),{name:"left-chevron",cursor:"pointer",onClick:l}),r.createVNode(r.unref(Ee),{name:"right-chevron",cursor:"pointer",onClick:c})])]),r.createVNode(_w,{ref_key:"datePickerListRef",ref:u,"model-value":t.modelValue,"start-date":t.startDate,"end-date":t.endDate,range:t.range,"date-seed":i.value,"onUpdate:dateSeed":x[0]||(x[0]=w=>i.value=w),type:s.value,"onUpdate:type":x[1]||(x[1]=w=>s.value=w),"onUpdate:modelValue":h,"onUpdate:startDate":f,"onUpdate:endDate":m},null,8,["model-value","start-date","end-date","range","date-seed","type"]),r.createElementVNode("div",Rw,[r.createVNode(r.unref(Wi),{type:"plain",size:"small",onClick:p},{default:r.withCtx(()=>[...x[2]||(x[2]=[r.createTextVNode(" Today ",-1)])]),_:1})])]))}}),[["__scopeId","data-v-694005ff"]]),$w=["id","placeholder","value","disabled"],Pw={class:"mc-date-picker-icon-wrapper"},zw={key:0,class:"mc-date-picker-status-icon"},zh=ee(q(r.defineComponent({name:Ah,__name:"mc-date-picker",props:{modelValue:{},startDate:{},width:{},height:{},endDate:{},disabled:{type:Boolean,default:!1},placeholder:{},range:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},disableValidation:{type:Boolean},hideValidationIcon:{type:Boolean}},emits:["clear","focus","blur","change","update:modelValue","update:startDate","update:endDate"],setup(t,{emit:e}){const n=t,o=e,{width:i,height:s}=lt(),a=r.ref(),{formId:l,formDisabled:c,validateStyle:d,statusIcon:u,validateByTrigger:p}=Nt(),{wrapperRef:h,isFocused:f,handleFocus:m,handleBlur:g}=Xn(a,{afterBlur:async()=>{await cl(300),await p("blur")}}),{isExpanded:v,popperRef:b,datePickerRef:y,popperOptions:k,toggleExpand:x}=(()=>{const O=r.ref(),D=r.ref(!1),F=ue("disabled"),R=W=>{F.value?D.value=!1:D.value=W};r.watch(F,W=>{W&&(D.value=!1)}),r.watch(D,W=>{var z,j;W?(z=O.value)==null||z.show():(j=O.value)==null||j.hide()});const L=r.ref();Hi(L,()=>{D.value=!1},"mousedown");let I=null;const P=()=>{I&&clearTimeout(I),I=null};return{isExpanded:D,popperRef:O,datePickerRef:L,popperOptions:{modifiers:[{name:"offset",options:{offset:[0,0]}}]},toggleExpand:R,closeExpand:(W=1e3)=>{P(),I=setTimeout(()=>{R(!1),P()},W)},stopClose:()=>{P()}}})(),w=O=>{o("update:modelValue",O),x(!1)},C=O=>{o("update:startDate",O)},S=O=>{o("update:endDate",O),x(!1)},E=r.computed(()=>!!v.value||!!f.value),M=()=>{n.disabled||x(!v.value)},N=r.computed(()=>{var O,D,F;if(n.modelValue){const R=n.modelValue.getFullYear(),L=n.modelValue.getMonth(),I=n.modelValue.getDate(),P=(O=Ko.get(L))==null?void 0:O.fullName;return`${I} ${P} ${R}`}if(n.startDate||n.endDate){let R="",L="";if(n.startDate){const I=n.startDate.getFullYear(),P=n.startDate.getMonth(),W=n.startDate.getDate(),z=(D=Ko.get(P))==null?void 0:D.fullName;R=`${W} ${z} ${I}`}if(n.endDate){const I=n.endDate.getFullYear(),P=n.endDate.getMonth(),W=n.endDate.getDate(),z=(F=Ko.get(P))==null?void 0:F.fullName;L=`${W} ${z} ${I}`}return`${R} - ${L}`}}),T=r.computed(()=>n.placeholder?n.placeholder:n.range?"dd mmm yyyy - dd mmm yyyy":"dd mmm yyyy"),A=r.ref(),{isHovering:$}=ul(A),B=r.computed(()=>!(c.value||!$.value||!n.clearable||(n.range?!n.startDate&&!n.endDate:!n.modelValue))),V=()=>{o("update:modelValue",void 0),o("update:startDate",void 0),o("update:endDate",void 0),o("clear"),x(!1)};return(O,D)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"datePickerRef",ref:y,class:r.normalizeClass(["mc-date-picker",{"mc-date-picker-actived":E.value,"mc-date-picker-disabled":r.unref(c),[r.unref(d)]:r.unref(d)}]),style:r.normalizeStyle({width:r.unref(i),height:r.unref(s)})},[r.createVNode(r.unref(Gi),{ref_key:"popperRef",ref:b,placement:"bottom-start",trigger:"manual","show-arrow":!1,"popper-options":r.unref(k),"hide-timeout":100},{content:r.withCtx(()=>[r.createVNode(Lw,{"model-value":t.modelValue,"start-date":t.startDate,"end-date":t.endDate,range:t.range,"onUpdate:modelValue":w,"onUpdate:startDate":C,"onUpdate:endDate":S},null,8,["model-value","start-date","end-date","range"])]),default:r.withCtx(()=>[r.createElementVNode("div",{ref_key:"triggerRef",ref:h,class:"mc-date-picker-input-wrapper",onClick:M},[r.createElementVNode("input",{id:r.unref(l),ref_key:"inputRef",ref:a,class:"mc-date-picker-input",placeholder:T.value,value:N.value,type:"text",readonly:"",disabled:r.unref(c),onFocus:D[0]||(D[0]=(...F)=>r.unref(m)&&r.unref(m)(...F)),onBlur:D[1]||(D[1]=(...F)=>r.unref(g)&&r.unref(g)(...F)),onKeypress:r.withKeys(M,["enter"])},null,40,$w),r.createElementVNode("div",Pw,[r.unref(u)?(r.openBlock(),r.createElementBlock("span",zw,[r.createVNode(r.unref(ge),{name:r.unref(u)},null,8,["name"])])):r.createCommentVNode("",!0),r.createElementVNode("span",{ref_key:"calendarIconRef",ref:A,class:"mc-date-picker-calendar-icon",onClick:D[2]||(D[2]=r.withModifiers(()=>{},["stop"]))},[B.value?(r.openBlock(),r.createBlock(r.unref(Ee),{key:0,name:"rejectfail",cursor:"pointer",size:18,onClick:V})):(r.openBlock(),r.createBlock(r.unref(Ee),{key:1,name:"calendar",cursor:r.unref(c)?"not-allowed":"pointer"},null,8,["cursor"]))],512)])],512)]),_:1},8,["popper-options"])],6))}}),[["__scopeId","data-v-25e143a5"]])),Fh="mc-divider",Al=ee(q(r.defineComponent({name:Fh,__name:"mc-divider",props:{size:{default:"small"},emphasis:{default:"minimal"},orientation:{default:"horizontal"}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-divider",[`mc-divider-${t.orientation}`,`mc-divider-${t.size}`,`mc-divider-${t.emphasis}`]])},null,2))}),[["__scopeId","data-v-7b6ad4ad"]])),jh="mc-overlay",Fw={key:0},jw=r.defineComponent({name:jh,__name:"mc-overlay",props:{visible:{type:Boolean},fixed:{type:Boolean,default:!0},portCssSelector:{default:"body"}},emits:["click"],setup(t,{expose:e,emit:n}){const o=t,i=n;r.onBeforeMount(()=>{const a=document.querySelector(o.portCssSelector);a&&window.getComputedStyle(a).position==="static"&&(a.style.position="relative")});const s=r.ref();return e({ref:s}),(a,l)=>t.visible?(r.openBlock(),r.createElementBlock("div",Fw,[(r.openBlock(),r.createBlock(r.Teleport,{to:t.portCssSelector},[r.createElementVNode("div",{ref_key:"_ref",ref:s,class:"mc-overlay",onClick:l[0]||(l[0]=c=>(d=>{d.target===s.value&&i("click")})(c)),style:r.normalizeStyle({position:t.fixed?"fixed":"absolute"})},[r.renderSlot(a.$slots,"default",{},void 0,!0)],4)],8,["to"]))])):r.createCommentVNode("",!0)}}),Qi=ee(q(jw,[["__scopeId","data-v-e3860c3c"]])),Hh="mc-reset",Il=ee(q(r.defineComponent({name:Hh,__name:"mc-reset",props:{rotate:{type:Boolean,default:!1},autoRotate:{type:Boolean,default:!0},duration:{default:300}},emits:["reset"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(!1),s=r.computed(()=>n.autoRotate?i.value:n.rotate),a=async()=>{o("reset"),n.autoRotate&&(i.value=!0,await cl(n.duration),i.value=!1)};return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-reset",onClick:a},[r.createVNode(r.unref(ge),{name:"Refresh",size:24,class:r.normalizeClass(["mc-reset-icon",{"mc-reset-rotate":s.value}])},null,8,["class"]),r.createElementVNode("span",null,[r.renderSlot(l.$slots,"default",{},()=>[c[0]||(c[0]=r.createTextVNode("Reset",-1))],!0)])]))}}),[["__scopeId","data-v-6b9f7103"]])),Wh="mc-title-toolbar",Hw={key:0,class:"mc-title-toolbar-reset"},Ww={key:1,class:"mc-title-toolbar-line"},Kw={key:2,class:"mc-title-toolbar-mandatory"},Rl=ee(q(r.defineComponent({name:Wh,__name:"mc-title-tool-bar",props:{showReset:{type:Boolean,default:!0},showMandatory:{type:Boolean,default:!0}},emits:["reset"],setup(t,{expose:e,emit:n}){const o=r.ref(),i=n,s=r.ref(!1);let a;const l=Io(()=>{clearTimeout(a),s.value=!0,a=setTimeout(()=>{s.value=!1},300),i("reset")},300);return e({ref:o}),(c,d)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-title-toolbar",ref_key:"_ref",ref:o},[t.showReset?(r.openBlock(),r.createElementBlock("div",Hw,[r.createVNode(r.unref(Il),{rotate:s.value,onReset:r.unref(l),"auto-rotate":!1},{default:r.withCtx(()=>[r.renderSlot(c.$slots,"reset",{},void 0,!0)]),_:3},8,["rotate","onReset"])])):r.createCommentVNode("",!0),t.showReset&&t.showMandatory?(r.openBlock(),r.createElementBlock("div",Ww)):r.createCommentVNode("",!0),t.showMandatory?(r.openBlock(),r.createElementBlock("div",Kw,[r.renderSlot(c.$slots,"mandatory",{},()=>[d[0]||(d[0]=r.createTextVNode("Mandatory",-1))],!0)])):r.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-bdba2ae8"]])),Kh="mc-title",Uw={class:"mc-title-content"},qw={class:"mc-title-text"},Jw={class:"mc-title-tool-bar"},Ll=ee(q(r.defineComponent({name:Kh,__name:"mc-title",props:{width:{default:"100%"},height:{default:"auto"},title:{},showToolBar:{type:Boolean,default:!0},showBorder:{type:Boolean,default:!1},showReset:{type:Boolean,default:!0},showMandatory:{type:Boolean,default:!0}},emits:["reset"],setup(t,{expose:e,emit:n}){const o=n,i=r.ref();return e({ref:i}),(s,a)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-title",{"mc-title-border":t.showBorder}]),ref_key:"_ref",ref:i,style:r.normalizeStyle({width:t.width,height:t.height})},[r.createElementVNode("div",Uw,[r.renderSlot(s.$slots,"default",{},()=>[r.createElementVNode("h1",qw,r.toDisplayString(t.title),1)],!0)]),r.createElementVNode("div",Jw,[r.renderSlot(s.$slots,"tool-bar",{},()=>[t.showToolBar?(r.openBlock(),r.createBlock(r.unref(Rl),{key:0,"show-reset":t.showReset,"show-mandatory":t.showMandatory,onReset:a[0]||(a[0]=l=>o("reset"))},{reset:r.withCtx(()=>[r.renderSlot(s.$slots,"reset",{},void 0,!0)]),mandatory:r.withCtx(()=>[r.renderSlot(s.$slots,"mandatory",{},void 0,!0)]),_:3},8,["show-reset","show-mandatory"])):r.createCommentVNode("",!0)],!0)])],6))}}),[["__scopeId","data-v-a7488e2a"]])),Uh="mc-modal-header",Gw={class:"mc-modal-header"},Zi=ee(q(r.defineComponent({name:Uh,__name:"mc-modal-header",props:{title:{},showBorder:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0}},emits:["close"],setup(t,{emit:e}){const n=e;return(o,i)=>(r.openBlock(),r.createElementBlock("div",Gw,[r.createVNode(r.unref(Ll),{title:t.title,"show-border":t.showBorder,height:"100%",class:"mc-modal-header-title"},{"tool-bar":r.withCtx(()=>[r.createVNode(r.unref(ge),{name:"Cross",size:24,class:"mc-modal-header-close-icon",onClick:i[0]||(i[0]=s=>n("close"))})]),default:r.withCtx(()=>[r.renderSlot(o.$slots,"default",{},void 0,!0)]),_:3},8,["title","show-border"])]))}}),[["__scopeId","data-v-1b48d2ce"]])),qh="mc-footer",Yw={key:0,class:"mc-footer-content"},Xw={class:"mc-footer-bottom"},Qw={class:"mc-footer-bottom-content"},Zw={class:"mc-footer-left"},e1={class:"mc-footer-right"},t1={class:"mc-footer-right-button-group"},es=ee(q(r.defineComponent({name:qh,__name:"mc-footer",props:{width:{},height:{},wrapperWidth:{},showborder:{type:Boolean,default:!0}},setup(t,{expose:e}){const n=r.ref();return e({ref:n}),(o,i)=>(r.openBlock(),r.createElementBlock("section",{class:r.normalizeClass(["mc-footer",{"mc-footer-border":t.showborder}]),style:r.normalizeStyle({width:t.width,height:t.height}),ref_key:"_ref",ref:n},[o.$slots.desc?(r.openBlock(),r.createElementBlock("div",Yw,[r.createElementVNode("div",{class:"mc-footer-wrapper",style:r.normalizeStyle({width:t.wrapperWidth})},[r.renderSlot(o.$slots,"desc",{},void 0,!0)],4)])):r.createCommentVNode("",!0),r.createElementVNode("div",Xw,[r.createElementVNode("div",{class:"mc-footer-wrapper",style:r.normalizeStyle({width:t.wrapperWidth})},[r.createElementVNode("div",Qw,[r.createElementVNode("div",Zw,[r.renderSlot(o.$slots,"left",{},void 0,!0)]),r.createElementVNode("div",e1,[r.renderSlot(o.$slots,"right",{},()=>[r.createElementVNode("div",t1,[r.renderSlot(o.$slots,"right-button-group",{},void 0,!0)])],!0)])])],4)])],6))}}),[["__scopeId","data-v-99697235"]])),Jh=(t=300)=>{const e=r.ref(!1),n=r.ref(!1),o=()=>{e.value=!0},i=()=>{e.value=!1},s=()=>{n.value=!0},a=()=>{n.value=!1};let l=null;const c=()=>{l&&clearTimeout(l)};return r.onUnmounted(()=>{c()}),{isOverlayShow:e,isContentShow:n,setOverlayShow:o,setOverlayHide:i,setContentShow:s,setContentHide:a,openOverlay:()=>{c(),o(),l=setTimeout(()=>{s()},t)},closeOverlay:()=>{c(),a(),l=setTimeout(()=>{i()},t)}}},Gh="mc-drawer",n1={key:0,class:"mc-drawer-container"},o1={class:"mc-drawer-header"},r1={class:"mc-drawer-content-wrapper"},i1={class:"mc-drawer-content"},s1={key:0,class:"mc-drawer-footer"},a1=r.defineComponent({name:Gh,__name:"mc-drawer",props:{modelValue:{type:Boolean},title:{},size:{default:"medium"},maskClosable:{type:Boolean,default:!0},fixed:{type:Boolean,default:!0},portCssSelector:{default:"body"},showBorder:{type:Boolean,default:!0},hideFooter:{type:Boolean,default:!1},position:{default:"right"}},emits:["update:modelValue","close"],setup(t,{expose:e,emit:n}){const o=t,i=r.ref(!1),{isOverlayShow:s,isContentShow:a,openOverlay:l,closeOverlay:c}=Jh(),d=()=>{i.value=!0,l()},u=()=>{c()},p=()=>{i.value=!1,h("close"),h("update:modelValue",!1)};r.watch(()=>o.modelValue,(v,b)=>{!b&&v?d():u()});const h=n,f=()=>{o.maskClosable&&u()},m=()=>{u()},g=r.ref();return e({ref:g,open:d,close:u}),(v,b)=>i.value?(r.openBlock(),r.createElementBlock("div",n1,[r.createVNode(r.Transition,{name:"mc-drawer-overlay",onAfterLeave:p},{default:r.withCtx(()=>[r.createVNode(r.unref(Qi),{visible:r.unref(s),fixed:t.fixed,"port-css-selector":t.portCssSelector,onClick:f},{default:r.withCtx(()=>[r.createVNode(r.Transition,{name:`mc-drawer-content-${t.position}`},{default:r.withCtx(()=>[r.unref(a)?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["mc-drawer",[`mc-drawer-${t.size}`,`mc-drawer-${t.position}`]]),ref_key:"_ref",ref:g},[r.createElementVNode("div",o1,[r.renderSlot(v.$slots,"header",{},()=>[r.createVNode(r.unref(Zi),{title:t.title,"show-border":t.showBorder,onClose:m},{default:r.withCtx(()=>[r.renderSlot(v.$slots,"header-title",{},void 0,!0)]),_:3},8,["title","show-border"])],!0)]),r.createElementVNode("div",r1,[r.createElementVNode("div",i1,[r.renderSlot(v.$slots,"default",{},void 0,!0)])]),t.hideFooter?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",s1,[r.renderSlot(v.$slots,"footer",{},()=>[r.createVNode(r.unref(es),null,{left:r.withCtx(()=>[r.renderSlot(v.$slots,"footer-left",{},void 0,!0)]),right:r.withCtx(()=>[r.renderSlot(v.$slots,"footer-right",{},void 0,!0)]),"right-button-group":r.withCtx(()=>[r.renderSlot(v.$slots,"footer-right-button-group",{},void 0,!0)]),desc:r.withCtx(()=>[r.renderSlot(v.$slots,"footer-desc",{},void 0,!0)]),_:3})],!0)]))],2)):r.createCommentVNode("",!0)]),_:3},8,["name"])]),_:3},8,["visible","fixed","port-css-selector"])]),_:3})])):r.createCommentVNode("",!0)}}),Yh=ee(q(a1,[["__scopeId","data-v-bee2c674"]])),Rr=Symbol("mc-input-group-context"),Xh="mc-input-group",Qh=ee(q(r.defineComponent({name:Xh,__name:"mc-input-group",props:{disabled:{type:Boolean,default:!1},suffixFlex:{default:1},prefixFlex:{default:1}},setup(t){const e=t,n=r.ref(!1);return r.provide(Rr,{disabled:r.computed(()=>e.disabled),setValidateStatus:o=>{n.value=o==="error"}}),(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-input-group",{"is-error":n.value,"is-disabled":t.disabled}])},[r.createElementVNode("div",{class:"mc-input-group-prefix",style:r.normalizeStyle({flex:t.prefixFlex})},[r.renderSlot(o.$slots,"prefix",{},void 0,!0)],4),i[0]||(i[0]=r.createElementVNode("div",{class:"mc-input-group-divider"},null,-1)),r.createElementVNode("div",{class:"mc-input-group-suffix",style:r.normalizeStyle({flex:t.suffixFlex})},[r.renderSlot(o.$slots,"suffix",{},void 0,!0)],4)],2))}}),[["__scopeId","data-v-d55c7451"]])),Zh="mc-input",Wt=".",l1={key:0,class:"mc-input-prepend"},c1={class:"mc-input-container"},d1=["id","value","placeholder","type","disabled","readonly","autocomplete","autofocus","maxlength"],u1={key:0,class:"mc-input-placeholder"},p1={key:0},h1={key:1,class:"mc-input-status-icon"},f1={key:2,class:"mc-input-toolbar"},m1={key:3,class:"mc-input-append"},g1=r.defineComponent({name:Zh,__name:"mc-input",props:{modelValue:{},id:{},type:{default:"text"},placeholder:{default:"Please enter"},disabled:{type:Boolean,default:!1},prefixIcon:{},suffixIcon:{},autocomplete:{type:Boolean,default:!0},readonly:{type:Boolean},autofocus:{type:Boolean},maxlength:{},textAlign:{},currencyAccuracy:{default:void 0},disableValidation:{type:Boolean},hideValidationIcon:{type:Boolean},validateProp:{},clearable:{type:Boolean},width:{default:320},height:{default:40}},emits:["update:modelValue","focus","blur","input","change","paste","delete","clear"],setup(t,{emit:e}){const n=t,o=e,{width:i,height:s}=lt(),a=r.ref(),l=r.inject(Rr,void 0),{formId:c,formDisabled:d,validateStyle:u,validateStatus:p,statusIcon:h,isError:f,validateByTrigger:m}=Nt({externalDisabled:r.computed(()=>!!(l!=null&&l.disabled.value))});r.watch(p,I=>{l&&l.setValidateStatus(I)});const{wrapperRef:g,isFocused:v,handleFocus:b,handleBlur:y}=Xn(a,{afterBlur(){m("blur")}}),k=I=>{var P,W,z;y(I),n.type!=="currency"&&n.type!=="number"||((P=n.modelValue)!=null&&P.startsWith(Wt)&&o("update:modelValue",`0${n.modelValue}`),(W=n.modelValue)!=null&&W.endsWith(Wt)&&o("update:modelValue",(z=n.modelValue)==null?void 0:z.slice(0,-1)))},{inputType:x,passwordVisible:w,handlePasswordVisible:C}=(()=>{const I=ue("type"),P=r.ref(!1);return{inputType:r.computed(()=>I.value==="password"?P.value?"text":"password":"text"),passwordVisible:P,handlePasswordVisible:()=>{P.value=!P.value}}})(),{formatter:S,parser:E}=(()=>{const I=ue("type"),P=(z,j)=>((K,G)=>{if(ye(G))return K;const[Z,J]=K.split(Wt);if(G>0&&K.includes(Wt)){const Y=J.slice(0,G);return`${Z}${Wt}${Y}`}return Z})(z=(K=>{const G=K.indexOf(Wt);return G!==-1&&(K=K.substring(0,G+1)+K.substring(G+1).replace(/\./g,"")),K})(z=z.replace(/[^0-9.]/g,"")),j),W=(z,j)=>P(z,j);return{formatter:(z,j)=>I.value==="number"?P(z,j):I.value==="currency"?(K=>{const[G,Z]=K.split(Wt),J=G.replace(/(\d)(?=(\d{3})+$)/g,"$1,");return K.includes(Wt)?`${J}${Wt}${Z}`:J})(P(z,j)):z,parser:(z,j)=>I.value==="number"?W(z,j):I.value==="currency"?(K=>K.replace(/(?:[^0-9.]+)/g,""))(W(z,j)):z}})(),M=r.computed(()=>S(ye(n.modelValue)?"":n.modelValue.toString(),n.currencyAccuracy)),{recordCursor:N,setCursor:T,handleAdjustCursor:A}=(I=>{const P=r.reactive({}),W=ue("type");return{recordCursor:()=>{if(!I.value)return;const{selectionStart:z,selectionEnd:j,value:K}=I.value;if(!z||!j)return;const G=K.slice(0,z),Z=K.slice(j);zu(P,{selectionStart:z,selectionEnd:j,value:K,beforeTxt:G,afterTxt:Z})},setCursor:()=>{if(!I.value)return;const{value:z}=I.value,{beforeTxt:j,afterTxt:K,selectionStart:G}=P;if(!j||!K||!G)return;let Z=z.length;if(function(J,Y,te){J=To(J),Y=bi(Y);var pe=J.length,X=te=te===void 0?pe:qu(Un(te),0,pe);return(te-=Y.length)>=0&&J.slice(te,X)==Y}(z,K))Z=z.length-K.length;else if(function(J,Y,te){return J=To(J),te=te==null?0:qu(Un(te),0,J.length),Y=bi(Y),J.slice(te,te+Y.length)==Y}(z,j))Z=j.length;else{const J=j[G-1],Y=z.indexOf(J,G-1);Y!==-1&&(Z=Y+1)}I.value.setSelectionRange(Z,Z)},handleAdjustCursor:z=>{if(!I.value||W.value!=="currency")return;const j=I.value,{value:K,selectionStart:G,selectionEnd:Z}=j;if(!K||!G||!Z||G!==Z)return;let J=0;if(z==="left"?J=G-2:z==="right"?J=G:z==="click"&&(J=G-1),K[J]===","){const Y=z==="click"?J:J+1;I.value.setSelectionRange(Y,Y)}}}})(a);r.watch(()=>n.currencyAccuracy,()=>{const I=E(n.modelValue??"",n.currencyAccuracy);o("update:modelValue",I)});const $=I=>{o("update:modelValue",I),o("input",I)},B=async I=>{const{value:P}=I.target;N();const W=E(P,n.currencyAccuracy);Be(W)?(a.value.value="",$(W)):function(z,j){return Li(z,j)}(W,n.modelValue)?a.value.value=S(W,n.currencyAccuracy):$(W),await r.nextTick(),T(),m("input")},V=()=>{o("delete")},O=I=>{o("paste",I)},D=I=>{const{value:P}=I.target;o("change",E(P))},{showClearIcon:F,mouseOverIcon:R}=(()=>{const I=r.ref(!1),P=ue("modelValue"),W=ue("clearable"),z=ue("disabled");return{showClearIcon:r.computed(()=>!!W.value&&I.value&&!z.value&&!Be(P.value)),mouseOverIcon:j=>{W.value&&!z.value&&(I.value=j)}}})(),L=()=>{o("update:modelValue",""),o("clear")};return(I,P)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"wrapperRef",ref:g,class:r.normalizeClass(["mc-input-plus",{"is-disabled":r.unref(d),"is-focused":r.unref(v),"is-active":!r.unref(Be)(M.value),[r.unref(u)]:r.unref(u)}]),style:r.normalizeStyle({width:r.unref(i),height:r.unref(s)}),onMouseenter:P[4]||(P[4]=W=>r.unref(R)(!0)),onMouseleave:P[5]||(P[5]=W=>r.unref(R)(!1))},[I.$slots.prepend?(r.openBlock(),r.createElementBlock("div",l1,[r.renderSlot(I.$slots,"prepend",{},void 0,!0)])):r.createCommentVNode("",!0),r.renderSlot(I.$slots,"prefix",{},()=>[t.prefixIcon?(r.openBlock(),r.createBlock(r.unref(Ee),{key:0,class:"mc-input-icon",name:t.prefixIcon},null,8,["name"])):r.createCommentVNode("",!0)],!0),r.createElementVNode("div",c1,[r.createElementVNode("input",{id:r.unref(c),ref_key:"inputRef",ref:a,value:M.value,class:"mc-input-inner",style:r.normalizeStyle({textAlign:t.textAlign}),placeholder:t.placeholder,type:r.unref(x),disabled:r.unref(d),readonly:t.readonly||r.unref(d),autocomplete:t.autocomplete?"on":"off",autofocus:t.autofocus,maxlength:t.maxlength,onFocus:P[0]||(P[0]=(...W)=>r.unref(b)&&r.unref(b)(...W)),onBlur:k,onInput:B,onChange:D,onKeydown:[r.withKeys(V,["delete"]),P[2]||(P[2]=r.withKeys(()=>r.unref(A)("left"),["left"])),P[3]||(P[3]=r.withKeys(()=>r.unref(A)("right"),["right"]))],onPaste:O,onClick:P[1]||(P[1]=()=>r.unref(A)("click"))},null,44,d1),t.placeholder||I.$slots.placeholder?r.withDirectives((r.openBlock(),r.createElementBlock("div",u1,[r.renderSlot(I.$slots,"placeholder",{},()=>[t.placeholder?(r.openBlock(),r.createElementBlock("span",p1,r.toDisplayString(t.placeholder),1)):r.createCommentVNode("",!0)],!0)],512)),[[r.vShow,!M.value]]):r.createCommentVNode("",!0)]),r.renderSlot(I.$slots,"suffix",{},()=>[t.suffixIcon?(r.openBlock(),r.createBlock(r.unref(Ee),{key:0,class:"mc-input-icon",name:t.suffixIcon},null,8,["name"])):r.createCommentVNode("",!0)],!0),r.unref(h)?(r.openBlock(),r.createElementBlock("div",h1,[r.createVNode(r.unref(Ee),{name:r.unref(f)?"reject-fail-rev":"accept-success-rev"},null,8,["name"])])):r.createCommentVNode("",!0),t.type==="password"||t.clearable?(r.openBlock(),r.createElementBlock("div",f1,[t.type==="password"?(r.openBlock(),r.createBlock(r.unref(Ee),{key:0,class:"mc-input-icon",name:r.unref(w)?"view-hidden":"view",cursor:"pointer",onClick:r.unref(C)},null,8,["name","onClick"])):r.createCommentVNode("",!0),r.withDirectives(r.createVNode(r.unref(Ee),{class:"mc-input-icon",name:"rejectfail",size:16,cursor:"pointer",onClick:L},null,512),[[r.vShow,r.unref(F)]])])):r.createCommentVNode("",!0),I.$slots.append?(r.openBlock(),r.createElementBlock("div",m1,[r.renderSlot(I.$slots,"append",{},void 0,!0)])):r.createCommentVNode("",!0)],38))}}),$l=ee(q(g1,[["__scopeId","data-v-11de44de"]])),ef="mc-lightbox",v1={key:0,class:"mc-lightbox-container"},y1={class:"mc-lightbox-header"},b1={class:"mc-lightbox-content-wrapper"},k1={key:0,class:"mc-lightbox-footer"},w1=r.defineComponent({name:ef,__name:"mc-lightbox",props:{modelValue:{type:Boolean,default:!1},title:{},size:{default:"medium"},maskClosable:{type:Boolean,default:!0},fixed:{type:Boolean,default:!0},portCssSelector:{default:"body"},hideFooter:{type:Boolean,default:!1},showBorder:{type:Boolean,default:!1},minHeight:{default:void 0}},emits:["update:modelValue","open","close"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref(),a=r.ref(),l=r.ref(!1),{isOverlayShow:c,isContentShow:d,openOverlay:u,closeOverlay:p}=Jh(),h=()=>{o.maskClosable&&g()},f=()=>{g()},m=()=>{l.value=!0,u(),i("open"),i("update:modelValue",!0)},g=()=>{p()},v=()=>{l.value=!1,i("close"),i("update:modelValue",!1)};return r.onMounted(()=>{o.modelValue&&m()}),r.watch(()=>o.modelValue,(b,y)=>{!y&&b?m():y&&!b&&g()}),e({ref:s,open:m,close:g}),(b,y)=>l.value?(r.openBlock(),r.createElementBlock("div",v1,[r.createVNode(r.Transition,{name:"mc-lightbox-overlay",onAfterLeave:v},{default:r.withCtx(()=>[r.createVNode(r.unref(Qi),{visible:r.unref(c),fixed:t.fixed,"port-css-selector":t.portCssSelector,onClick:h},{default:r.withCtx(()=>[r.createVNode(r.Transition,{name:"mc-lightbox-content"},{default:r.withCtx(()=>[r.unref(d)?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["mc-lightbox",[`mc-lightbox-${t.size}`]]),ref_key:"lightboxRef",ref:s},[r.createElementVNode("div",y1,[r.renderSlot(b.$slots,"header",{},()=>[r.createVNode(r.unref(Zi),{title:t.title,"show-border":t.showBorder,onClose:f},{default:r.withCtx(()=>[r.renderSlot(b.$slots,"header-title",{},void 0,!0)]),_:3},8,["title","show-border"])],!0)]),r.createElementVNode("div",b1,[r.createElementVNode("div",{class:"mc-lightbox-content",style:r.normalizeStyle({minHeight:t.minHeight?`${t.minHeight}px`:void 0}),ref_key:"contentRef",ref:a},[r.renderSlot(b.$slots,"default",{},void 0,!0)],4)]),t.hideFooter?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",k1,[r.renderSlot(b.$slots,"footer",{},()=>[r.createVNode(r.unref(es),null,{left:r.withCtx(()=>[r.renderSlot(b.$slots,"footer-left",{},void 0,!0)]),right:r.withCtx(()=>[r.renderSlot(b.$slots,"footer-right",{},void 0,!0)]),"right-button-group":r.withCtx(()=>[r.renderSlot(b.$slots,"footer-right-button-group",{},void 0,!0)]),desc:r.withCtx(()=>[r.renderSlot(b.$slots,"footer-desc",{},void 0,!0)]),_:3})],!0)]))],2)):r.createCommentVNode("",!0)]),_:3})]),_:3},8,["visible","fixed","port-css-selector"])]),_:3})])):r.createCommentVNode("",!0)}}),tf=ee(q(w1,[["__scopeId","data-v-120fea0c"]])),nf="mc-loading",x1={key:0,class:"mc-loading-pulse"},C1={key:1,class:"mc-loading-spin"},S1={class:"mc-loading-text"},Pl=ee(q(r.defineComponent({name:nf,__name:"mc-loading",props:{loading:{type:Boolean},loadingText:{},size:{default:"medium"},type:{default:"spin"}},setup(t){const e=t,n=r.computed(()=>e.size==="small"?24:e.size==="medium"?32:64);return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-loading",[`mc-loading-${t.size}`,{"mc-loading-active":t.loading}]])},[t.type==="pulse"?(r.openBlock(),r.createElementBlock("div",x1,[...i[0]||(i[0]=[r.createElementVNode("i",{class:"mc-loading-pulse-dot"},null,-1),r.createElementVNode("i",{class:"mc-loading-pulse-dot"},null,-1),r.createElementVNode("i",{class:"mc-loading-pulse-dot"},null,-1),r.createElementVNode("i",{class:"mc-loading-pulse-dot"},null,-1)])])):t.type==="spin"?(r.openBlock(),r.createElementBlock("div",C1,[r.createVNode(r.unref(ge),{name:"Loading_Line",size:n.value},null,8,["size"])])):r.createCommentVNode("",!0),t.loadingText||o.$slots.default?r.renderSlot(o.$slots,"default",{key:2},()=>[r.createElementVNode("p",S1,r.toDisplayString(t.loadingText),1)],!0):r.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-f7edd2a3"]])),of="mc-removable-tag",E1={class:"mc-removable-tag-content"},M1=r.defineComponent({name:of,__name:"mc-removable-tag",props:{label:{},value:{},disabled:{type:Boolean,default:!1}},emits:["remove"],setup(t,{emit:e}){const n=t,o=e,i=()=>{n.disabled||o("remove",n.value)};return(s,a)=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-removable-tag",{"mc-removable-tag-disabled":t.disabled}])},[r.createElementVNode("span",E1,[r.renderSlot(s.$slots,"default",{label:t.label},()=>[r.createTextVNode(r.toDisplayString(t.label??t.value),1)],!0)]),t.disabled?r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(r.unref(Ee),{key:0,class:"mc-removable-tag-close-icon",name:"cross",cursor:t.disabled?"not-allowed":"pointer",onClick:i},null,8,["cursor"]))],2))}}),zl=ee(q(M1,[["__scopeId","data-v-e80a358c"]])),rf="mc-multi-tag",N1={class:"mc-multi-tag-label"},B1={class:"mc-multi-tag-option-list"},sf=ee(q(r.defineComponent({name:rf,__name:"mc-multi-tag",props:{label:{},tags:{default:()=>[]},disabled:{type:Boolean,default:!1},disableTags:{default:()=>[]}},emits:["remove:all","remove:tag"],setup(t,{emit:e}){const n=t,o=e,i=r.computed(()=>n.disabled||n.disableTags.length),s=l=>{n.disabled||o("remove:tag",l,n.label)},a=()=>{i.value||o("remove:all",n.label)};return(l,c)=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-multi-tag",{"mc-multi-tag-disabled":t.disabled}])},[i.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createVNode(r.unref(Ee),{class:"mc-multi-tag-close-all-icon",name:"cross",cursor:t.disabled?"not-allowed":"pointer",onClick:a},null,8,["cursor"]),c[0]||(c[0]=r.createElementVNode("i",{class:"mc-multi-tag-divider"},null,-1))],64)),r.createElementVNode("span",N1,r.toDisplayString(`${t.label} :`),1),r.createElementVNode("ul",B1,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.tags,d=>{return r.openBlock(),r.createBlock(r.unref(zl),{key:d,label:d.label,value:d.value,disabled:(u=d.value,!!n.disabled||!!n.disableTags.includes(u)),onRemove:s},null,8,["label","value","disabled"]);var u}),128))])],2))}}),[["__scopeId","data-v-a55e30d7"]])),af="mc-otp",T1=["id"],O1={class:"mc-otp-input-list"},_1=["onClick"],V1=["onUpdate:modelValue","disabled","onInput","onKeydown"],D1=r.defineComponent({name:af,__name:"mc-otp",props:{modelValue:{},disabled:{type:Boolean,default:!1},length:{default:6},disableValidation:{type:Boolean},hideValidationIcon:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,i=r.ref([]),s=r.reactive(new Array(n.length)),{focusIndex:a,setFocus:l,nextFocus:c,prevFocus:d}=(b=>{const y=r.ref(),k=S=>{y.value=S};Hi(b,()=>{ye(y.value)||m("blur"),k(void 0)});const x=ue("length"),w=S=>{var T;const E=x.value??0;S<0&&(S=0),S>E-1&&(S=E-1),y.value=S;const M=b.value[S],N=(T=M==null?void 0:M.children)==null?void 0:T[0];N==null||N.focus()},C=ue("modelValue");return{focusIndex:y,setFocusIndex:k,setFocus:w,nextFocus:()=>{r.nextTick(()=>{var E;const S=((E=C.value)==null?void 0:E.length)??0;S<(x.value??0)&&w(S)})},prevFocus:()=>{r.nextTick(()=>{var E;const S=((E=C.value)==null?void 0:E.length)??0;S-1>=0&&w(S-1)})}}})(i),{formId:u,formDisabled:p,validateStyle:h,statusIcon:f,validateByTrigger:m}=Nt({externalDisabled:r.computed(()=>n.disabled)}),g=b=>{for(let y=0;y<n.length;y++)s[y]=(b==null?void 0:b[y])||""};r.onMounted(()=>{g(n.modelValue)}),r.watch(()=>n.modelValue,b=>{g(b)});const v=async()=>{o("change",s.join("")),o("update:modelValue",s.join("")),await r.nextTick(),m("input")};return r.watchEffect(()=>{var b;if((((b=n.modelValue)==null?void 0:b.length)??0)>n.length)throw new Error("modelValue length is greater than length.")}),(b,y)=>(r.openBlock(),r.createElementBlock("div",{id:r.unref(u),class:r.normalizeClass(["mc-otp",{"mc-otp-disabled":r.unref(p),[r.unref(h)]:r.unref(h)}])},[r.createElementVNode("ul",O1,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.length,k=>(r.openBlock(),r.createElementBlock("li",{key:k,class:r.normalizeClass(["mc-otp-input-item",{"mc-otp-input-item-focus":r.unref(a)===k-1}]),ref_for:!0,ref:x=>((w,C)=>{C&&(i.value[w]=C)})(k-1,x),onClick:x=>(async w=>{Be(s[w])?c():l(w)})(k-1)},[r.withDirectives(r.createElementVNode("input",{"onUpdate:modelValue":x=>s[k-1]=x,class:"mc-otp-input",type:"number",disabled:r.unref(p),onInput:x=>(async(w,C)=>{if(p.value)return;const S=C.target;let E=S.value.slice(0,1);S.value=E,s[w]=E,v(),E&&c()})(k-1,x),onPaste:y[0]||(y[0]=x=>(async w=>{var S;if(w.preventDefault(),p.value)return;const C=((S=w.clipboardData)==null?void 0:S.getData("text").slice(0,n.length))||"";g(C),v(),c()})(x)),onKeydown:[r.withKeys(r.withModifiers(x=>(async w=>{s[w]="",v(),d()})(k-1),["prevent","stop"]),["backspace"]),r.withKeys(r.withModifiers(x=>r.unref(l)(k-2),["prevent","stop"]),["left"]),r.withKeys(r.withModifiers(x=>r.unref(l)(k),["prevent","stop"]),["right"]),y[2]||(y[2]=r.withKeys(r.withModifiers(()=>{},["prevent","stop"]),["tab"]))],onMousedown:y[1]||(y[1]=r.withModifiers(()=>{},["prevent"]))},null,40,V1),[[r.vModelText,s[k-1]]])],10,_1))),128))]),r.unref(f)?(r.openBlock(),r.createBlock(r.unref(ge),{key:0,class:"mc-otp-status-icon",name:r.unref(f),size:24},null,8,["name"])):r.createCommentVNode("",!0)],10,T1))}}),lf=ee(q(D1,[["__scopeId","data-v-bc5e6a1e"]])),qo=Math.min,vt=Math.max,ts=Math.round,ns=Math.floor,Kt=t=>({x:t,y:t}),A1={left:"right",right:"left",bottom:"top",top:"bottom"},I1={start:"end",end:"start"};function cf(t,e,n){return vt(t,qo(e,n))}function rs(t,e){return typeof t=="function"?t(e):t}function to(t){return t.split("-")[0]}function is(t){return t.split("-")[1]}function df(t){return t==="x"?"y":"x"}function uf(t){return t==="y"?"height":"width"}const R1=new Set(["top","bottom"]);function wn(t){return R1.has(to(t))?"y":"x"}function pf(t){return df(wn(t))}function Fl(t){return t.replace(/start|end/g,e=>I1[e])}const hf=["left","right"],ff=["right","left"],L1=["top","bottom"],$1=["bottom","top"];function ss(t){return t.replace(/left|right|bottom|top/g,e=>A1[e])}function as(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function mf(t,e,n){let{reference:o,floating:i}=t;const s=wn(e),a=pf(e),l=uf(a),c=to(e),d=s==="y",u=o.x+o.width/2-i.width/2,p=o.y+o.height/2-i.height/2,h=o[l]/2-i[l]/2;let f;switch(c){case"top":f={x:u,y:o.y-i.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:p};break;case"left":f={x:o.x-i.width,y:p};break;default:f={x:o.x,y:o.y}}switch(is(e)){case"start":f[a]-=h*(n&&d?-1:1);break;case"end":f[a]+=h*(n&&d?-1:1)}return f}async function jl(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:s,rects:a,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:p="floating",altBoundary:h=!1,padding:f=0}=rs(e,t),m=function(w){return typeof w!="number"?function(C){return{top:0,right:0,bottom:0,left:0,...C}}(w):{top:w,right:w,bottom:w,left:w}}(f),g=l[h?p==="floating"?"reference":"floating":p],v=as(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),b=p==="floating"?{x:o,y:i,width:a.floating.width,height:a.floating.height}:a.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),k=await(s.isElement==null?void 0:s.isElement(y))&&await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1},x=as(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:y,strategy:c}):b);return{top:(v.top-x.top+m.top)/k.y,bottom:(x.bottom-v.bottom+m.bottom)/k.y,left:(v.left-x.left+m.left)/k.x,right:(x.right-v.right+m.right)/k.x}}function ls(){return typeof window<"u"}function no(t){return Hl(t)?(t.nodeName||"").toLowerCase():"#document"}function yt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ut(t){var e;return(e=(Hl(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Hl(t){return!!ls()&&(t instanceof Node||t instanceof yt(t).Node)}function It(t){return!!ls()&&(t instanceof Element||t instanceof yt(t).Element)}function qt(t){return!!ls()&&(t instanceof HTMLElement||t instanceof yt(t).HTMLElement)}function gf(t){return!(!ls()||typeof ShadowRoot>"u")&&(t instanceof ShadowRoot||t instanceof yt(t).ShadowRoot)}const P1=new Set(["inline","contents"]);function Lr(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=Rt(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!P1.has(i)}const z1=new Set(["table","td","th"]);function F1(t){return z1.has(no(t))}const j1=[":popover-open",":modal"];function cs(t){return j1.some(e=>{try{return t.matches(e)}catch{return!1}})}const H1=["transform","translate","scale","rotate","perspective"],W1=["transform","translate","scale","rotate","perspective","filter"],K1=["paint","layout","strict","content"];function Wl(t){const e=Kl(),n=It(t)?Rt(t):t;return H1.some(o=>!!n[o]&&n[o]!=="none")||!!n.containerType&&n.containerType!=="normal"||!e&&!!n.backdropFilter&&n.backdropFilter!=="none"||!e&&!!n.filter&&n.filter!=="none"||W1.some(o=>(n.willChange||"").includes(o))||K1.some(o=>(n.contain||"").includes(o))}function Kl(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const U1=new Set(["html","body","#document"]);function Jo(t){return U1.has(no(t))}function Rt(t){return yt(t).getComputedStyle(t)}function ds(t){return It(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function xn(t){if(no(t)==="html")return t;const e=t.assignedSlot||t.parentNode||gf(t)&&t.host||Ut(t);return gf(e)?e.host:e}function vf(t){const e=xn(t);return Jo(e)?t.ownerDocument?t.ownerDocument.body:t.body:qt(e)&&Lr(e)?e:vf(e)}function $r(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=vf(t),s=i===((o=t.ownerDocument)==null?void 0:o.body),a=yt(i);if(s){const l=Ul(a);return e.concat(a,a.visualViewport||[],Lr(i)?i:[],l&&n?$r(l):[])}return e.concat(i,$r(i,[],n))}function Ul(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function yf(t){const e=Rt(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=qt(t),s=i?t.offsetWidth:n,a=i?t.offsetHeight:o,l=ts(n)!==s||ts(o)!==a;return l&&(n=s,o=a),{width:n,height:o,$:l}}function ql(t){return It(t)?t:t.contextElement}function Go(t){const e=ql(t);if(!qt(e))return Kt(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:s}=yf(e);let a=(s?ts(n.width):n.width)/o,l=(s?ts(n.height):n.height)/i;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}const q1=Kt(0);function bf(t){const e=yt(t);return Kl()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:q1}function oo(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=ql(t);let a=Kt(1);e&&(o?It(o)&&(a=Go(o)):a=Go(t));const l=function(h,f,m){return f===void 0&&(f=!1),!(!m||f&&m!==yt(h))&&f}(s,n,o)?bf(s):Kt(0);let c=(i.left+l.x)/a.x,d=(i.top+l.y)/a.y,u=i.width/a.x,p=i.height/a.y;if(s){const h=yt(s),f=o&&It(o)?yt(o):o;let m=h,g=Ul(m);for(;g&&o&&f!==m;){const v=Go(g),b=g.getBoundingClientRect(),y=Rt(g),k=b.left+(g.clientLeft+parseFloat(y.paddingLeft))*v.x,x=b.top+(g.clientTop+parseFloat(y.paddingTop))*v.y;c*=v.x,d*=v.y,u*=v.x,p*=v.y,c+=k,d+=x,m=yt(g),g=Ul(m)}}return as({width:u,height:p,x:c,y:d})}function us(t,e){const n=ds(t).scrollLeft;return e?e.left+n:oo(Ut(t)).left+n}function kf(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-us(t,n),y:n.top+e.scrollTop}}const J1=new Set(["absolute","fixed"]);function wf(t,e,n){let o;if(e==="viewport")o=function(i,s){const a=yt(i),l=Ut(i),c=a.visualViewport;let d=l.clientWidth,u=l.clientHeight,p=0,h=0;if(c){d=c.width,u=c.height;const m=Kl();(!m||m&&s==="fixed")&&(p=c.offsetLeft,h=c.offsetTop)}const f=us(l);if(f<=0){const m=l.ownerDocument,g=m.body,v=getComputedStyle(g),b=m.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,y=Math.abs(l.clientWidth-g.clientWidth-b);y<=25&&(d-=y)}else f<=25&&(d+=f);return{width:d,height:u,x:p,y:h}}(t,n);else if(e==="document")o=function(i){const s=Ut(i),a=ds(i),l=i.ownerDocument.body,c=vt(s.scrollWidth,s.clientWidth,l.scrollWidth,l.clientWidth),d=vt(s.scrollHeight,s.clientHeight,l.scrollHeight,l.clientHeight);let u=-a.scrollLeft+us(i);const p=-a.scrollTop;return Rt(l).direction==="rtl"&&(u+=vt(s.clientWidth,l.clientWidth)-c),{width:c,height:d,x:u,y:p}}(Ut(t));else if(It(e))o=function(i,s){const a=oo(i,!0,s==="fixed"),l=a.top+i.clientTop,c=a.left+i.clientLeft,d=qt(i)?Go(i):Kt(1);return{width:i.clientWidth*d.x,height:i.clientHeight*d.y,x:c*d.x,y:l*d.y}}(e,n);else{const i=bf(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return as(o)}function xf(t,e){const n=xn(t);return!(n===e||!It(n)||Jo(n))&&(Rt(n).position==="fixed"||xf(n,e))}function G1(t,e,n){const o=qt(e),i=Ut(e),s=n==="fixed",a=oo(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const c=Kt(0);function d(){c.x=us(i)}if(o||!o&&!s)if((no(e)!=="body"||Lr(i))&&(l=ds(e)),o){const p=oo(e,!0,s,e);c.x=p.x+e.clientLeft,c.y=p.y+e.clientTop}else i&&d();s&&!o&&i&&d();const u=!i||o||s?Kt(0):kf(i,l);return{x:a.left+l.scrollLeft-c.x-u.x,y:a.top+l.scrollTop-c.y-u.y,width:a.width,height:a.height}}function Jl(t){return Rt(t).position==="static"}function Cf(t,e){if(!qt(t)||Rt(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Ut(t)===n&&(n=n.ownerDocument.body),n}function Sf(t,e){const n=yt(t);if(cs(t))return n;if(!qt(t)){let i=xn(t);for(;i&&!Jo(i);){if(It(i)&&!Jl(i))return i;i=xn(i)}return n}let o=Cf(t,e);for(;o&&F1(o)&&Jl(o);)o=Cf(o,e);return o&&Jo(o)&&Jl(o)&&!Wl(o)?n:o||function(i){let s=xn(i);for(;qt(s)&&!Jo(s);){if(Wl(s))return s;if(cs(s))return null;s=xn(s)}return null}(t)||n}const Y1={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const s=i==="fixed",a=Ut(o),l=!!e&&cs(e.floating);if(o===a||l&&s)return n;let c={scrollLeft:0,scrollTop:0},d=Kt(1);const u=Kt(0),p=qt(o);if((p||!p&&!s)&&((no(o)!=="body"||Lr(a))&&(c=ds(o)),qt(o))){const f=oo(o);d=Go(o),u.x=f.x+o.clientLeft,u.y=f.y+o.clientTop}const h=!a||p||s?Kt(0):kf(a,c);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+u.x+h.x,y:n.y*d.y-c.scrollTop*d.y+u.y+h.y}},getDocumentElement:Ut,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=n==="clippingAncestors"?cs(e)?[]:function(d,u){const p=u.get(d);if(p)return p;let h=$r(d,[],!1).filter(v=>It(v)&&no(v)!=="body"),f=null;const m=Rt(d).position==="fixed";let g=m?xn(d):d;for(;It(g)&&!Jo(g);){const v=Rt(g),b=Wl(g);b||v.position!=="fixed"||(f=null),(m?!b&&!f:!b&&v.position==="static"&&f&&J1.has(f.position)||Lr(g)&&!b&&xf(d,g))?h=h.filter(y=>y!==g):f=v,g=xn(g)}return u.set(d,h),h}(e,this._c):[].concat(n),a=[...s,o],l=a[0],c=a.reduce((d,u)=>{const p=wf(e,u,i);return d.top=vt(p.top,d.top),d.right=qo(p.right,d.right),d.bottom=qo(p.bottom,d.bottom),d.left=vt(p.left,d.left),d},wf(e,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:Sf,getElementRects:async function(t){const e=this.getOffsetParent||Sf,n=this.getDimensions,o=await n(t.floating);return{reference:G1(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=yf(t);return{width:e,height:n}},getScale:Go,isElement:It,isRTL:function(t){return Rt(t).direction==="rtl"}};function Ef(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function X1(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,d=ql(t),u=i||s?[...d?$r(d):[],...$r(e)]:[];u.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const p=d&&l?function(v,b){let y,k=null;const x=Ut(v);function w(){var C;clearTimeout(y),(C=k)==null||C.disconnect(),k=null}return function C(S,E){S===void 0&&(S=!1),E===void 0&&(E=1),w();const M=v.getBoundingClientRect(),{left:N,top:T,width:A,height:$}=M;if(S||b(),!A||!$)return;const B={rootMargin:-ns(T)+"px "+-ns(x.clientWidth-(N+A))+"px "+-ns(x.clientHeight-(T+$))+"px "+-ns(N)+"px",threshold:vt(0,qo(1,E))||1};let V=!0;function O(D){const F=D[0].intersectionRatio;if(F!==E){if(!V)return C();F?C(!1,F):y=setTimeout(()=>{C(!1,1e-7)},1e3)}F!==1||Ef(M,v.getBoundingClientRect())||C(),V=!1}try{k=new IntersectionObserver(O,{...B,root:x.ownerDocument})}catch{k=new IntersectionObserver(O,B)}k.observe(v)}(!0),w}(d,n):null;let h,f=-1,m=null;a&&(m=new ResizeObserver(v=>{let[b]=v;b&&b.target===d&&m&&(m.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=m)==null||y.observe(e)})),n()}),d&&!c&&m.observe(d),m.observe(e));let g=c?oo(t):null;return c&&function v(){const b=oo(t);g&&!Ef(g,b)&&n(),g=b,h=requestAnimationFrame(v)}(),n(),()=>{var v;u.forEach(b=>{i&&b.removeEventListener("scroll",n),s&&b.removeEventListener("resize",n)}),p==null||p(),(v=m)==null||v.disconnect(),m=null,c&&cancelAnimationFrame(h)}}const Q1=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:s,rects:a,initialPlacement:l,platform:c,elements:d}=e,{mainAxis:u=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...v}=rs(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=to(i),y=wn(l),k=to(l)===l,x=await(c.isRTL==null?void 0:c.isRTL(d.floating)),w=h||(k||!g?[ss(l)]:function(B){const V=ss(B);return[Fl(B),V,Fl(V)]}(l)),C=m!=="none";!h&&C&&w.push(...function(B,V,O,D){const F=is(B);let R=function(L,I,P){switch(L){case"top":case"bottom":return P?I?ff:hf:I?hf:ff;case"left":case"right":return I?L1:$1;default:return[]}}(to(B),O==="start",D);return F&&(R=R.map(L=>L+"-"+F),V&&(R=R.concat(R.map(Fl)))),R}(l,g,m,x));const S=[l,...w],E=await jl(e,v),M=[];let N=((o=s.flip)==null?void 0:o.overflows)||[];if(u&&M.push(E[b]),p){const B=function(V,O,D){D===void 0&&(D=!1);const F=is(V),R=pf(V),L=uf(R);let I=R==="x"?F===(D?"end":"start")?"right":"left":F==="start"?"bottom":"top";return O.reference[L]>O.floating[L]&&(I=ss(I)),[I,ss(I)]}(i,a,x);M.push(E[B[0]],E[B[1]])}if(N=[...N,{placement:i,overflows:M}],!M.every(B=>B<=0)){var T,A;const B=(((T=s.flip)==null?void 0:T.index)||0)+1,V=S[B];if(V&&(p!=="alignment"||y===wn(V)||N.every(D=>wn(D.placement)!==y||D.overflows[0]>0)))return{data:{index:B,overflows:N},reset:{placement:V}};let O=(A=N.filter(D=>D.overflows[0]<=0).sort((D,F)=>D.overflows[1]-F.overflows[1])[0])==null?void 0:A.placement;if(!O)switch(f){case"bestFit":{var $;const D=($=N.filter(F=>{if(C){const R=wn(F.placement);return R===y||R==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(R=>R>0).reduce((R,L)=>R+L,0)]).sort((F,R)=>F[1]-R[1])[0])==null?void 0:$[0];D&&(O=D);break}case"initialPlacement":O=l}if(i!==O)return{reset:{placement:O}}}return{}}}},Z1=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:s,platform:a,elements:l}=e,{apply:c=()=>{},...d}=rs(t,e),u=await jl(e,d),p=to(i),h=is(i),f=wn(i)==="y",{width:m,height:g}=s.floating;let v,b;p==="top"||p==="bottom"?(v=p,b=h===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(b=p,v=h==="end"?"top":"bottom");const y=g-u.top-u.bottom,k=m-u.left-u.right,x=qo(g-u[v],y),w=qo(m-u[b],k),C=!e.middlewareData.shift;let S=x,E=w;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(E=k),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(S=y),C&&!h){const N=vt(u.left,0),T=vt(u.right,0),A=vt(u.top,0),$=vt(u.bottom,0);f?E=m-2*(N!==0||T!==0?N+T:vt(u.left,u.right)):S=g-2*(A!==0||$!==0?A+$:vt(u.top,u.bottom))}await c({...e,availableWidth:E,availableHeight:S});const M=await a.getDimensions(l.floating);return m!==M.width||g!==M.height?{reset:{rects:!0}}:{}}}};function Mf(t){if(function(e){return e!=null&&typeof e=="object"&&"$el"in e}(t)){const e=t.$el;return Hl(e)&&no(e)==="#comment"?null:e}return t}function Pr(t){return typeof t=="function"?t():r.unref(t)}function Nf(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Bf(t,e){const n=Nf(t);return Math.round(e*n)/n}const Tf="mc-popper-plus",ex={class:"mc-popper-plus"},tx=r.defineComponent({name:Tf,__name:"mc-popper-plus",props:{isShow:{type:Boolean},placement:{default:"bottom-start"},strategy:{default:"absolute"},teleportTo:{default:""}},emits:["update:isShow","update:placement"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(),s=r.ref(),{x:a,y:l,strategy:c,placement:d}=function(p,h,f){f===void 0&&(f={});const m=f.whileElementsMounted,g=r.computed(()=>{var O;return(O=Pr(f.open))==null||O}),v=r.computed(()=>Pr(f.middleware)),b=r.computed(()=>{var O;return(O=Pr(f.placement))!=null?O:"bottom"}),y=r.computed(()=>{var O;return(O=Pr(f.strategy))!=null?O:"absolute"}),k=r.computed(()=>{var O;return(O=Pr(f.transform))==null||O}),x=r.computed(()=>Mf(p.value)),w=r.computed(()=>Mf(h.value)),C=r.ref(0),S=r.ref(0),E=r.ref(y.value),M=r.ref(b.value),N=r.shallowRef({}),T=r.ref(!1),A=r.computed(()=>{const O={position:E.value,left:"0",top:"0"};if(!w.value)return O;const D=Bf(w.value,C.value),F=Bf(w.value,S.value);return k.value?{...O,transform:"translate("+D+"px, "+F+"px)",...Nf(w.value)>=1.5&&{willChange:"transform"}}:{position:E.value,left:D+"px",top:F+"px"}});let $;function B(){if(x.value==null||w.value==null)return;const O=g.value;((D,F,R)=>{const L=new Map,I={platform:Y1,...R},P={...I.platform,_c:L};return(async(W,z,j)=>{const{placement:K="bottom",strategy:G="absolute",middleware:Z=[],platform:J}=j,Y=Z.filter(Boolean),te=await(J.isRTL==null?void 0:J.isRTL(z));let pe=await J.getElementRects({reference:W,floating:z,strategy:G}),{x:X,y:oe}=mf(pe,K,te),ae=K,se={},be=0;for(let Fe=0;Fe<Y.length;Fe++){const{name:Me,fn:Ne}=Y[Fe],{x:de,y:me,data:at,reset:Le}=await Ne({x:X,y:oe,initialPlacement:K,placement:ae,strategy:G,middlewareData:se,rects:pe,platform:J,elements:{reference:W,floating:z}});X=de??X,oe=me??oe,se={...se,[Me]:{...se[Me],...at}},Le&&be<=50&&(be++,typeof Le=="object"&&(Le.placement&&(ae=Le.placement),Le.rects&&(pe=Le.rects===!0?await J.getElementRects({reference:W,floating:z,strategy:G}):Le.rects),{x:X,y:oe}=mf(pe,ae,te)),Fe=-1)}return{x:X,y:oe,placement:ae,strategy:G,middlewareData:se}})(D,F,{...I,platform:P})})(x.value,w.value,{middleware:v.value,placement:b.value,strategy:y.value}).then(D=>{C.value=D.x,S.value=D.y,E.value=D.strategy,M.value=D.placement,N.value=D.middlewareData,T.value=O!==!1})}function V(){typeof $=="function"&&($(),$=void 0)}return r.watch([v,b,y,g],B,{flush:"sync"}),r.watch([x,w],function(){V(),m!==void 0?x.value==null||w.value==null||($=m(x.value,w.value,B)):B()},{flush:"sync"}),r.watch(g,function(){g.value||(T.value=!1)},{flush:"sync"}),r.getCurrentScope()&&r.onScopeDispose(V),{x:r.shallowReadonly(C),y:r.shallowReadonly(S),strategy:r.shallowReadonly(E),placement:r.shallowReadonly(M),middlewareData:r.shallowReadonly(N),isPositioned:r.shallowReadonly(T),floatingStyles:A,update:B}}(i,s,{whileElementsMounted:X1,placement:n.placement,strategy:n.strategy,middleware:[Q1({fallbackPlacements:["top-start"]}),(u===void 0&&(u={}),{name:"shift",options:u,async fn(p){const{x:h,y:f,placement:m}=p,{mainAxis:g=!0,crossAxis:v=!1,limiter:b={fn:N=>{let{x:T,y:A}=N;return{x:T,y:A}}},...y}=rs(u,p),k={x:h,y:f},x=await jl(p,y),w=wn(to(m)),C=df(w);let S=k[C],E=k[w];if(g){const N=C==="y"?"bottom":"right";S=cf(S+x[C==="y"?"top":"left"],S,S-x[N])}if(v){const N=w==="y"?"bottom":"right";E=cf(E+x[w==="y"?"top":"left"],E,E-x[N])}const M=b.fn({...p,[C]:S,[w]:E});return{...M,data:{x:M.x-h,y:M.y-f,enabled:{[C]:g,[w]:v}}}}}),Z1({apply({rects:p,elements:h}){Object.assign(h.floating.style,{width:`${p.reference.width}px`})}})]});var u;return r.watch(d,p=>{o("update:placement",p)}),(p,h)=>(r.openBlock(),r.createElementBlock("div",ex,[r.createElementVNode("div",{ref_key:"triggerRef",ref:i,class:"mc-popper-trigger"},[r.renderSlot(p.$slots,"default",{},void 0,!0)],512),(r.openBlock(),r.createBlock(r.Teleport,{to:t.teleportTo||"body",disabled:!t.teleportTo},[t.isShow?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"contentRef",ref:s,class:"mc-popper-content",style:r.normalizeStyle({position:r.unref(c),top:`${r.unref(l)??0}px`,left:`${r.unref(a)??0}px`})},[r.renderSlot(p.$slots,"content",{},void 0,!0)],4)):r.createCommentVNode("",!0)],8,["to","disabled"]))]))}}),ps=ee(q(tx,[["__scopeId","data-v-448b7a83"]])),Of="mc-progress-bar",nx={key:0,class:"mc-progress-bar-shimmer"},ox={key:0,class:"mc-progress-bar-remarks"},Gl=ee(q(r.defineComponent({name:Of,__name:"mc-progress-bar",props:{percentage:{default:0},height:{default:"4px"},width:{default:"100%"},remarks:{},showPercentage:{type:Boolean,default:!1},transitionDuration:{default:300},shimmer:{type:Boolean,default:!1}},emits:["update:percentage","complete"],setup(t,{expose:e,emit:n}){const o=t,i=n,{width:s,height:a}=lt(),l=r.ref();r.watchEffect(()=>{l.value&&l.value.style.setProperty("--border-radius",a.value||"auto")});const c=r.computed(()=>{const p=o.percentage/100;return p>1?1:p<0?0:p});r.watch(()=>o.percentage,p=>{p>=100&&i("complete")},{immediate:!0});const d=r.useSlots(),u=r.computed(()=>o.showPercentage||!!o.remarks||!!d.remarks);return e({updatePercentage:p=>{i("update:percentage",p)},complete:()=>{i("update:percentage",100),i("complete")},reset:()=>{i("update:percentage",0)}}),(p,h)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-progress-bar",style:r.normalizeStyle({width:r.unref(s)})},[r.createElementVNode("div",{ref_key:"progressBarRef",ref:l,class:"mc-progress-bar-wrapper",style:r.normalizeStyle({width:r.unref(s),height:r.unref(a)})},[r.createElementVNode("div",{class:"mc-progress-bar-inner",style:r.normalizeStyle({transform:`scaleX(${c.value})`,transitionDuration:`${t.transitionDuration}ms`})},null,4),t.shimmer?(r.openBlock(),r.createElementBlock("i",nx)):r.createCommentVNode("",!0)],4),u.value?(r.openBlock(),r.createElementBlock("div",ox,[r.renderSlot(p.$slots,"remarks",{},()=>[r.createElementVNode("span",null,r.toDisplayString(t.remarks||`${r.unref(Uu)(100*c.value)}%`),1)],!0)])):r.createCommentVNode("",!0)],4))}}),[["__scopeId","data-v-9ef9daf3"]])),_f="mc-success-icon",Yo=ee(q(r.defineComponent({name:_f,__name:"mc-success-icon",props:{width:{default:"40px"},height:{default:"40px"}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("svg",{class:"success-icon",style:r.normalizeStyle({width:t.width,height:t.height}),viewBox:"0 0 400 400"},[...n[0]||(n[0]=[r.createElementVNode("circle",{class:"circle",fill:"none",transform:"rotate(-90 200 200)","stroke-width":"20",cx:"200",cy:"200",r:"190","stroke-linecap":"round"},null,-1),r.createElementVNode("polyline",{class:"tick",fill:"none","stroke-width":"26",points:"120,214 173,260 274,160","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],4))}),[["__scopeId","data-v-9078d5a9"]])),Vf="mc-progress-indicator",Df="mc-progress-indicator-step",Af="mc-progress-indicator-step-num",rx={key:0,class:"mc-progress-indicator-step-num-icon"},ix={key:1},sx=q(r.defineComponent({name:Af,__name:"mc-progress-indicator-step-num",props:{num:{},status:{default:"default"},showSuccessIcon:{type:Boolean,default:!0},isChild:{type:Boolean,default:!1},icon:{}},setup(t){const e=t,n=r.computed(()=>e.showSuccessIcon&&e.status==="success"&&!e.isChild);return(o,i)=>n.value?(r.openBlock(),r.createBlock(r.unref(Yo),{key:0})):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["mc-progress-indicator-step-num",[`mc-progress-indicator-step-num-${t.status}`,{"mc-progress-indicator-step-num-child":t.isChild}]])},[t.isChild?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",rx,[t.icon?(r.openBlock(),r.createBlock(r.unref(Ee),{key:0,name:t.icon},null,8,["name"])):(r.openBlock(),r.createElementBlock("span",ix,r.toDisplayString(t.num),1))]))],2))}}),[["__scopeId","data-v-2ba90f0e"]]);class If{constructor(e,n){ke(this,"id");ke(this,"stepKey");ke(this,"index");ke(this,"parentIndex");ke(this,"childIndex");ke(this,"label");ke(this,"icon");ke(this,"showContent");ke(this,"success");ke(this,"hiddenHeader");ke(this,"hiddenFooter");ke(this,"hiddenFooterLeft");ke(this,"hiddenFooterRight");ke(this,"previousStep");ke(this,"nextStep");ke(this,"parentStep");ke(this,"childrenSteps");ke(this,"iconSlot");ke(this,"labelSlot");ke(this,"defaultSlot");ke(this,"contentTitleSlot");ke(this,"contentToolbarSlot");ke(this,"contentSlot");ke(this,"contentFooterSlot");ke(this,"contentFooterLeftSlot");ke(this,"contentFooterRightSlot");var i;const o=((s=10)=>String(Date.now()).slice(-s))();this.id=e!=null&&e.id||e!=null&&e.step?`${o}-${(i=e==null?void 0:e.step)==null?void 0:i.toString()}`:o,this.stepKey=e==null?void 0:e.step,this.label=e==null?void 0:e.label,this.icon=e==null?void 0:e.icon,this.showContent=Ft(e,"show-content"),this.success=e==null?void 0:e.success,this.hiddenHeader=Ft(e,"hidden-header"),this.hiddenFooter=Ft(e,"hidden-footer"),this.hiddenFooterLeft=Ft(e,"hidden-footer-left"),this.hiddenFooterRight=Ft(e,"hidden-footer-right"),this.iconSlot=n==null?void 0:n.icon,this.labelSlot=n==null?void 0:n.label,this.defaultSlot=n==null?void 0:n.default,this.contentTitleSlot=Ft(n,"content-title"),this.contentToolbarSlot=Ft(n,"content-toolbar"),this.contentSlot=n==null?void 0:n.content,this.contentFooterSlot=Ft(n,"content-footer"),this.contentFooterLeftSlot=Ft(n,"content-footer-left"),this.contentFooterRightSlot=Ft(n,"content-footer-right")}get isChild(){return!!this.parentStep}get hasChildren(){var e;return!!((e=this.childrenSteps)!=null&&e.size)}getChildrenSteps(){var e;return Array.from(((e=this.childrenSteps)==null?void 0:e.values())||[])}hasChildStep(e){var n;return!!((n=this.childrenSteps)!=null&&n.has(e))}getFirstChildStep(){var e;return(e=this.childrenSteps)==null?void 0:e.values().next().value}getLastChildStep(){var e;return Array.from(((e=this.childrenSteps)==null?void 0:e.values())||[]).pop()}appendChildStep(e){this.childrenSteps||(this.childrenSteps=new Map),this.childrenSteps.set(e.stepKey,e)}removeChildStep(e){var n,o;(n=this.childrenSteps)==null||n.delete(e),((o=this.childrenSteps)==null?void 0:o.size)===0&&(this.childrenSteps=void 0)}clearContent(){this.defaultSlot=void 0,this.contentSlot=void 0,this.contentTitleSlot=void 0,this.contentToolbarSlot=void 0,this.contentFooterSlot=void 0,this.contentFooterLeftSlot=void 0,this.contentFooterRightSlot=void 0}}const Yl="mc-progress-indicator-item",ax={class:"mc-grogress-indicator-item"},Rf=ee(r.defineComponent({name:Yl,__name:"mc-progress-indicator-item",props:{icon:{},id:{},step:{},label:{},showContent:{type:Boolean},success:{type:Boolean},hiddenHeader:{type:Boolean},hiddenFooter:{type:Boolean},hiddenFooterLeft:{type:Boolean},hiddenFooterRight:{type:Boolean}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",ax))})),Xl="mc-progress-indicator-child-item",lx={class:"mc-grogress-indicator-child-item"},Lf=ee(r.defineComponent({name:Xl,__name:"mc-progress-indicator-child-item",props:{id:{},step:{},label:{},showContent:{type:Boolean},success:{type:Boolean},hiddenHeader:{type:Boolean},hiddenFooter:{type:Boolean},hiddenFooterLeft:{type:Boolean},hiddenFooterRight:{type:Boolean}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",lx))})),cx=(t,e)=>t===0?"first":t===e-1?"last":"middle",hs=(t,e,n="manual")=>{const o=r.unref(e);if(Np(t==null?void 0:t.success)&&t.success||t!=null&&t.parentStep&&hs(t.parentStep,e)==="success")return"success";if(!(o&&t&&Sr(o.index)&&Sr(t.index)))return"default";if(n==="auto"){if(t.isChild||!t.hasChildren){if(t.index<o.index)return"success"}else if(t.hasChildren){let i=!0;for(const s of t==null?void 0:t.getChildrenSteps())if(hs(s,e,n)!=="success"){i=!1;break}if(i)return"success"}}return t.index<=o.index?"active":"default"},$f=(t,e)=>Np(t==null?void 0:t.showContent)?t==null?void 0:t.showContent:!ye(t==null?void 0:t.stepKey)&&t.stepKey===(e==null?void 0:e.stepKey),dx=["id"],ux={key:0,class:"mc-progress-indicator-step-container"},px={class:"mc-progress-indicator-step-content"},hx={key:0,class:"mc-progress-indicator-step-content-header"},fx={key:0,class:"mc-progress-indicator-step-content-footer-container"},mx={class:"mc-progress-indicator-step-content-footer"},gx={class:"mc-progress-indicator-step-content-footer-left-container"},vx={key:0,class:"mc-progress-indicator-step-content-footer-left"},yx={class:"mc-progress-indicator-step-content-footer-right-container"},bx={key:0,class:"mc-progress-indicator-step-content-footer-right"},kx=q(r.defineComponent({name:Df,__name:"mc-progress-indicator-step",props:{successBehavior:{default:"auto"},currentStep:{},step:{},position:{default:"middle"},showSuccessIcon:{type:Boolean,default:!0}},setup(t){const e=t,n=r.computed(()=>$f(e.step,r.unref(e.currentStep))),o=r.computed(()=>$f(e.step.nextStep,r.unref(e.currentStep))),i=r.computed(()=>!!e.step.isChild),s=r.computed(()=>hs(e.step,e.currentStep,e.successBehavior)),a=r.computed(()=>hs(e.step.previousStep,e.currentStep,e.successBehavior)),l=r.computed(()=>Sr(e.step.parentIndex)?e.step.parentIndex+1:0);return(c,d)=>(r.openBlock(),r.createElementBlock("div",{id:t.step.id,class:"mc-progress-indicator-step"},[r.createElementVNode("div",{class:r.normalizeClass(["mc-progress-indicator-step-item",{"mc-progress-indicator-step-item-child":i.value}])},[r.createElementVNode("i",{class:r.normalizeClass(["mc-progress-indicator-step-line mc-progress-indicator-step-line-up",[`mc-progress-indicator-step-line-${a.value}`,`mc-progress-indicator-step-line-${t.position}`]])},null,2),r.renderSlot(c.$slots,"icon",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},()=>[r.createVNode(sx,{num:l.value,icon:t.step.icon,status:s.value,"show-success-icon":t.showSuccessIcon,"is-child":i.value},null,8,["num","icon","status","show-success-icon","is-child"])],!0),r.createElementVNode("i",{class:r.normalizeClass(["mc-progress-indicator-step-line mc-progress-indicator-step-line-down",[`mc-progress-indicator-step-line-${s.value}`,`mc-progress-indicator-step-line-${t.position}`]])},null,2)],2),n.value?(r.openBlock(),r.createElementBlock("div",ux,[r.renderSlot(c.$slots,"default",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},()=>[r.createElementVNode("div",px,[t.step.hiddenHeader?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",hx,[r.renderSlot(c.$slots,"content-title",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},()=>[r.createElementVNode("span",{class:r.normalizeClass(["mc-progress-indicator-step-content-title",[`mc-progress-indicator-step-content-title-${s.value}`]])},r.toDisplayString(t.step.label),3)],!0),r.renderSlot(c.$slots,"content-toolbar",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},void 0,!0)])),r.renderSlot(c.$slots,"content",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},void 0,!0)]),t.step.hiddenFooter?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",fx,[r.renderSlot(c.$slots,"content-footer",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},()=>[r.createElementVNode("div",mx,[r.createElementVNode("div",gx,[t.step.hiddenFooterLeft?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",vx,[r.renderSlot(c.$slots,"content-footer-left",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},void 0,!0)]))]),r.createElementVNode("div",yx,[t.step.hiddenFooterRight?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",bx,[r.renderSlot(c.$slots,"content-footer-right",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},void 0,!0)]))])])],!0)]))],!0)])):(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["mc-progress-indicator-step-label",[`mc-progress-indicator-step-label-${s.value}`,{"mc-progress-indicator-step-label-child":i.value,"mc-progress-indicator-step-label-need-padding-bottom":o.value}]])},[r.renderSlot(c.$slots,"label",{stepKey:t.step.stepKey,label:t.step.label,status:s.value},()=>[r.createTextVNode(r.toDisplayString(t.step.label),1)],!0)],2))],8,dx))}}),[["__scopeId","data-v-7c4594d6"]]),wx={class:"mc-grogress-indicator"},Pf=ee(q(r.defineComponent({name:Vf,__name:"mc-progress-indicator",props:{modelValue:{},successSteps:{},successBehavior:{default:"auto"},previousBehavior:{default:"last-child"},showSuccessIcon:{type:Boolean,default:!0},scrollToStep:{type:Boolean,default:!1}},emits:["update:modelValue","update:successSteps","change","click:step"],setup(t,{expose:e,emit:n}){const o=t,i=n,{stepItems:s,currentStep:a}=(()=>{const d=r.ref([]),u=r.ref(new Map),p=r.useSlots();r.watchEffect(()=>{var v;const{stepItems:m,stepMap:g}=(b=>{const y=[],k=new Map;let x,w=0,C=0;const S=(E,M)=>{ce(E)&&E.forEach(N=>{var A,$,B;const T=(A=(N==null?void 0:N.type)||{})==null?void 0:A.name;if(T===Yl){const V=Ao(N.children)||ce(N.children)||!He(($=N.children)==null?void 0:$.default)?N.children:(B=N.children)==null?void 0:B.default(),O=N.props,D=N.children,F=new If(O,D);F.parentIndex=w++,F.index=C++,x&&(F.previousStep=x,x.nextStep=F),x=F,y.push(F),k.set(F.stepKey,F),S(V,F)}else if(T===Xl){const V=N.props,O=N.children,D=new If(V,O);D.index=C++,M&&(M.clearContent(),M.appendChildStep(D),D.parentIndex=M.parentIndex,D.parentStep=M,D.childIndex=M.getChildrenSteps().length),x&&(D.previousStep=x,x.nextStep=D),k.set(D.stepKey,D),y.push(D),x=D}else ce(N.children)&&S(N.children,M)})};return S(b),{stepItems:y,stepMap:k}})((v=p.default)==null?void 0:v.call(p));d.value=m,u.value=g});const h=ue("modelValue"),f=r.computed(()=>u.value.get(h.value));return{stepItems:d,currentStep:f}})(),l=d=>{ye(d)||i("update:modelValue",d)},c=async d=>{if(!o.scrollToStep||ye(d==null?void 0:d.stepKey))return;await r.nextTick();const u=document.getElementById(d.id);u&&u.scrollIntoView({behavior:"smooth"})};return e({goStep:l,goNextStep:()=>{var u,p;const d=(u=a.value)==null?void 0:u.nextStep;ye(d==null?void 0:d.stepKey)||(d.hasChildren?l((p=d==null?void 0:d.getFirstChildStep())==null?void 0:p.stepKey):l(d.stepKey),c(d))},goPreviousStep:()=>{var u,p,h,f,m,g;const d=(u=a.value)==null?void 0:u.previousStep;if(!ye(d==null?void 0:d.stepKey))if((p=a.value)!=null&&p.isChild&&d===((h=a.value)==null?void 0:h.parentStep)){const v=d.previousStep;o.previousBehavior==="last-child"?(l(v==null?void 0:v.stepKey),c(v)):v!=null&&v.isChild?(l((m=(f=v.parentStep)==null?void 0:f.getFirstChildStep())==null?void 0:m.stepKey),c(v.parentStep)):(l(v==null?void 0:v.stepKey),c(v))}else l(d==null?void 0:d.stepKey),d!=null&&d.isChild&&((g=d.parentStep)==null?void 0:g.getFirstChildStep())===d?c(d.parentStep):c(d)}}),(d,u)=>(r.openBlock(),r.createElementBlock("div",wx,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(s),(p,h)=>(r.openBlock(),r.createBlock(kx,{key:p.stepKey,position:r.unref(cx)(h,r.unref(s).length),step:p,"current-step":r.unref(a),"success-behavior":t.successBehavior,"show-success-icon":t.showSuccessIcon},r.createSlots({_:2},[p.labelSlot?{name:"label",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.labelSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"0"}:void 0,p.iconSlot?{name:"icon",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.iconSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"1"}:void 0,p.defaultSlot?{name:"default",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.defaultSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"2"}:void 0,p.contentTitleSlot?{name:"content-title",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentTitleSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"3"}:void 0,p.contentToolbarSlot?{name:"content-toolbar",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentToolbarSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"4"}:void 0,p.contentSlot?{name:"content",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"5"}:void 0,p.contentFooterSlot?{name:"content-footer",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentFooterSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"6"}:void 0,p.contentFooterLeftSlot?{name:"content-footer-left",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentFooterLeftSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"7"}:void 0,p.contentFooterRightSlot?{name:"content-footer-right",fn:r.withCtx(({stepKey:f,label:m,status:g})=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.contentFooterRightSlot),{stepKey:f,label:m,status:g},null,8,["stepKey","label","status"]))]),key:"8"}:void 0]),1032,["position","step","current-step","success-behavior","show-success-icon"]))),128))]))}}),[["__scopeId","data-v-9de07c8e"]])),Ql=Symbol("mc-radio-group-context"),zf="mc-radio-group",xx=["id"],Ff=ee(q(r.defineComponent({name:zf,__name:"mc-radio-group",props:{modelValue:{type:[Number,String,Boolean]},disabled:{type:Boolean},disableValidation:{type:Boolean},hideValidationIcon:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,{formId:i}=Nt();return r.provide(Ql,{modelValue:r.computed(()=>n.modelValue),disabled:r.computed(()=>n.disabled),handleSelect:s=>{o("update:modelValue",s),o("change",s)}}),(s,a)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-radio-group",id:r.unref(i)},[r.renderSlot(s.$slots,"default",{},void 0,!0)],8,xx))}}),[["__scopeId","data-v-3c7ef5f1"]])),jf="mc-radio",Cx=["disabled","onKeypress"],Sx={class:"mc-radio-wrapper"},Ex={class:"mc-radio-content"},Mx={key:0,class:"mc-radio-help"},Nx={class:"mc-radio-remark"},Hf=ee(q(r.defineComponent({name:jf,__name:"mc-radio",props:{label:{},value:{type:[Number,String,Boolean]},disabled:{type:Boolean},remark:{},help:{}},emits:["focus","blur"],setup(t){const e=t,n=r.inject(Ql,void 0),o=r.ref(),{wrapperRef:i,isFocused:s,handleFocus:a,handleBlur:l}=Xn(o),c=r.computed(()=>{var f;return((f=n==null?void 0:n.modelValue)==null?void 0:f.value)===e.value}),{formDisabled:d,validateStyle:u,validateByTrigger:p}=Nt({externalDisabled:r.computed(()=>{var f;return!!((f=n==null?void 0:n.disabled)!=null&&f.value)})}),h=async()=>{d.value||(n==null||n.handleSelect(e.value),await r.nextTick(),p("input"))};return(f,m)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"wrapperRef",ref:i,class:r.normalizeClass(["mc-radio",{"mc-radio-has-remark":!!t.remark}])},[r.createElementVNode("label",{class:r.normalizeClass(["mc-radio-label",{"mc-radio-checked":c.value,"mc-radio-disabled":r.unref(d),"mc-radio-focused":r.unref(s),[r.unref(u)]:r.unref(u)}]),onClick:r.withModifiers(h,["prevent"])},[r.createElementVNode("input",{ref_key:"inputRef",ref:o,type:"radio",class:"mc-radio-input",disabled:r.unref(d),onFocus:m[0]||(m[0]=(...g)=>r.unref(a)&&r.unref(a)(...g)),onBlur:m[1]||(m[1]=(...g)=>r.unref(l)&&r.unref(l)(...g)),onKeypress:r.withKeys(r.withModifiers(h,["prevent","stop"]),["enter"])},null,40,Cx),r.createElementVNode("div",Sx,[m[2]||(m[2]=r.createElementVNode("span",{class:"mc-radio-circle"},null,-1)),r.createElementVNode("div",Ex,[r.renderSlot(f.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.label),1)],!0)]),t.help||f.$slots.help?(r.openBlock(),r.createElementBlock("div",Mx,[r.renderSlot(f.$slots,"help",{},()=>[r.createVNode(r.unref(Ho),{content:t.help,"icon-size":24},null,8,["content"])],!0)])):r.createCommentVNode("",!0)])],2),r.createElementVNode("div",Nx,[r.renderSlot(f.$slots,"remark",{},()=>[r.createTextVNode(r.toDisplayString(t.remark),1)],!0)])],2))}}),[["__scopeId","data-v-a35770ad"]]));function Je(t){this.content=t}function Wf(t,e,n){for(let o=0;;o++){if(o==t.childCount||o==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(o),s=e.child(o);if(i!=s){if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let a=0;i.text[a]==s.text[a];a++)n++;return n}if(i.content.size||s.content.size){let a=Wf(i.content,s.content,n+1);if(a!=null)return a}n+=i.nodeSize}else n+=i.nodeSize}}function Kf(t,e,n,o){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:o};let a=t.child(--i),l=e.child(--s),c=a.nodeSize;if(a!=l){if(!a.sameMarkup(l))return{a:n,b:o};if(a.isText&&a.text!=l.text){let d=0,u=Math.min(a.text.length,l.text.length);for(;d<u&&a.text[a.text.length-d-1]==l.text[l.text.length-d-1];)d++,n--,o--;return{a:n,b:o}}if(a.content.size||l.content.size){let d=Kf(a.content,l.content,n-1,o-1);if(d)return d}n-=c,o-=c}else n-=c,o-=c}}Je.prototype={constructor:Je,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var o=n&&n!=t?this.remove(n):this,i=o.find(t),s=o.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new Je(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Je(n)},addToStart:function(t,e){return new Je([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Je(n)},addBefore:function(t,e,n){var o=this.remove(e),i=o.content.slice(),s=o.find(t);return i.splice(s==-1?i.length:s,0,e,n),new Je(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return(t=Je.from(t)).size?new Je(t.content.concat(this.subtract(t).content)):this},append:function(t){return(t=Je.from(t)).size?new Je(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Je.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},Je.from=function(t){if(t instanceof Je)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Je(e)};class H{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let o=0;o<e.length;o++)this.size+=e[o].nodeSize}nodesBetween(e,n,o,i=0,s){for(let a=0,l=0;l<n;a++){let c=this.content[a],d=l+c.nodeSize;if(d>e&&o(c,i+l,s||null,a)!==!1&&c.content.size){let u=l+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,n-u),o,i+u)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,o,i){let s="",a=!0;return this.nodesBetween(e,n,(l,c)=>{let d=l.isText?l.text.slice(Math.max(e,c)-c,n-c):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&o&&(a?a=!1:s+=o),s+=d},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,o=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(o)&&(i[i.length-1]=n.withText(n.text+o.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new H(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let o=[],i=0;if(n>e)for(let s=0,a=0;a<n;s++){let l=this.content[s],c=a+l.nodeSize;c>e&&((a<e||c>n)&&(l=l.isText?l.cut(Math.max(0,e-a),Math.min(l.text.length,n-a)):l.cut(Math.max(0,e-a-1),Math.min(l.content.size,n-a-1))),o.push(l),i+=l.nodeSize),a=c}return new H(o,i)}cutByIndex(e,n){return e==n?H.empty:e==0&&n==this.content.length?this:new H(this.content.slice(e,n))}replaceChild(e,n){let o=this.content[e];if(o==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-o.nodeSize;return i[e]=n,new H(i,s)}addToStart(e){return new H([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new H(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,o=0;n<this.content.length;n++){let i=this.content[n];e(i,o,n),o+=i.nodeSize}}findDiffStart(e,n=0){return Wf(this,e,n)}findDiffEnd(e,n=this.size,o=e.size){return Kf(this,e,n,o)}findIndex(e){if(e==0)return fs(0,e);if(e==this.size)return fs(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,o=0;;n++){let i=o+this.child(n).nodeSize;if(i>=e)return i==e?fs(n+1,i):fs(n,o);o=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,n){if(!n)return H.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new H(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return H.empty;let n,o=0;for(let i=0;i<e.length;i++){let s=e[i];o+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new H(n||e,o)}static from(e){if(!e)return H.empty;if(e instanceof H)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new H([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}H.empty=new H([],0);const Zl={index:0,offset:0};function fs(t,e){return Zl.index=t,Zl.offset=e,Zl}function ms(t,e){if(t===e)return!0;if(!t||typeof t!="object"||!e||typeof e!="object")return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let o=0;o<t.length;o++)if(!ms(t[o],e[o]))return!1}else{for(let o in t)if(!(o in e)||!ms(t[o],e[o]))return!1;for(let o in e)if(!(o in t))return!1}return!0}let xe=class iu{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,o=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!o&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),o=!0),n&&n.push(s)}}return n||(n=e.slice()),o||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ms(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let o=e.marks[n.type];if(!o)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=o.create(n.attrs);return o.checkAttrs(i.attrs),i}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let o=0;o<e.length;o++)if(!e[o].eq(n[o]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return iu.none;if(e instanceof iu)return[e];let n=e.slice();return n.sort((o,i)=>o.type.rank-i.type.rank),n}};xe.none=[];class gs extends Error{}class Q{constructor(e,n,o){this.content=e,this.openStart=n,this.openEnd=o}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let o=qf(this.content,e+this.openStart,n);return o&&new Q(o,this.openStart,this.openEnd)}removeBetween(e,n){return new Q(Uf(this.content,e+this.openStart,n+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,n){if(!n)return Q.empty;let o=n.openStart||0,i=n.openEnd||0;if(typeof o!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Q(H.fromJSON(e,n.content),o,i)}static maxOpen(e,n=!0){let o=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)o++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new Q(e,o,i)}}function Uf(t,e,n){let{index:o,offset:i}=t.findIndex(e),s=t.maybeChild(o),{index:a,offset:l}=t.findIndex(n);if(i==e||s.isText){if(l!=n&&!t.child(a).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(o!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(o,s.copy(Uf(s.content,e-i-1,n-i-1)))}function qf(t,e,n,o){let{index:i,offset:s}=t.findIndex(e),a=t.maybeChild(i);if(s==e||a.isText)return o&&!o.canReplace(i,i,n)?null:t.cut(0,e).append(n).append(t.cut(e));let l=qf(a.content,e-s-1,n,a);return l&&t.replaceChild(i,a.copy(l))}function Bx(t,e,n){if(n.openStart>t.depth)throw new gs("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new gs("Inconsistent open depths");return Jf(t,e,n,0)}function Jf(t,e,n,o){let i=t.index(o),s=t.node(o);if(i==e.index(o)&&o<t.depth-n.openStart){let a=Jf(t,e,n,o+1);return s.copy(s.content.replaceChild(i,a))}if(n.content.size){if(n.openStart||n.openEnd||t.depth!=o||e.depth!=o){let{start:a,end:l}=function(c,d){let u=d.depth-c.openStart,p=d.node(u).copy(c.content);for(let h=u-1;h>=0;h--)p=d.node(h).copy(H.from(p));return{start:p.resolveNoCache(c.openStart+u),end:p.resolveNoCache(p.content.size-c.openEnd-u)}}(n,t);return io(s,Yf(t,a,l,e,o))}{let a=t.parent,l=a.content;return io(a,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}}return io(s,vs(t,e,o))}function Gf(t,e){if(!e.type.compatibleContent(t.type))throw new gs("Cannot join "+e.type.name+" onto "+t.type.name)}function ec(t,e,n){let o=t.node(n);return Gf(o,e.node(n)),o}function ro(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function zr(t,e,n,o){let i=(e||t).node(n),s=0,a=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(ro(t.nodeAfter,o),s++));for(let l=s;l<a;l++)ro(i.child(l),o);e&&e.depth==n&&e.textOffset&&ro(e.nodeBefore,o)}function io(t,e){return t.type.checkContent(e),t.copy(e)}function Yf(t,e,n,o,i){let s=t.depth>i&&ec(t,e,i+1),a=o.depth>i&&ec(n,o,i+1),l=[];return zr(null,t,i,l),s&&a&&e.index(i)==n.index(i)?(Gf(s,a),ro(io(s,Yf(t,e,n,o,i+1)),l)):(s&&ro(io(s,vs(t,e,i+1)),l),zr(e,n,i,l),a&&ro(io(a,vs(n,o,i+1)),l)),zr(o,null,i,l),new H(l)}function vs(t,e,n){let o=[];return zr(null,t,n,o),t.depth>n&&ro(io(ec(t,e,n+1),vs(t,e,n+1)),o),zr(e,null,n,o),new H(o)}Q.empty=new Q(H.empty,0,0);class Fr{constructor(e,n,o){this.pos=e,this.path=n,this.parentOffset=o,this.depth=n.length/3-1}resolveDepth(e){return e==null?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(e=this.resolveDepth(e))==0?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,n=this.index(this.depth);if(n==e.childCount)return null;let o=this.pos-this.path[this.path.length-1],i=e.child(n);return o?e.child(n).cut(o):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let o=this.path[3*n],i=n==0?0:this.path[3*n-1]+1;for(let s=0;s<e;s++)i+=o.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return xe.none;if(this.textOffset)return e.child(n).marks;let o=e.maybeChild(n-1),i=e.maybeChild(n);if(!o){let l=o;o=i,i=l}let s=o.marks;for(var a=0;a<s.length;a++)s[a].type.spec.inclusive!==!1||i&&s[a].isInSet(i.marks)||(s=s[a--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let o=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<o.length;s++)o[s].type.spec.inclusive!==!1||i&&o[s].isInSet(i.marks)||(o=o[s--].removeFromSet(o));return o}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let o=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);o>=0;o--)if(e.pos<=this.end(o)&&(!n||n(this.node(o))))return new ys(this,e,o);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<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let o=[],i=0,s=n;for(let a=e;;){let{index:l,offset:c}=a.content.findIndex(s),d=s-c;if(o.push(a,l,i+c),!d||(a=a.child(l),a.isText))break;s=d-1,i+=c+1}return new Fr(n,o,s)}static resolveCached(e,n){let o=Xf.get(e);if(o)for(let s=0;s<o.elts.length;s++){let a=o.elts[s];if(a.pos==n)return a}else Xf.set(e,o=new Tx);let i=o.elts[o.i]=Fr.resolve(e,n);return o.i=(o.i+1)%Ox,i}}class Tx{constructor(){this.elts=[],this.i=0}}const Ox=12,Xf=new WeakMap;class ys{constructor(e,n,o){this.$from=e,this.$to=n,this.depth=o}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const _x=Object.create(null);let Cn=class su{constructor(e,n,o,i=xe.none){this.type=e,this.attrs=n,this.marks=i,this.content=o||H.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,o,i=0){this.content.nodesBetween(e,n,o,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,o,i){return this.content.textBetween(e,n,o,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,o){return this.type==e&&ms(this.attrs,n||e.defaultAttrs||_x)&&xe.sameSet(this.marks,o||xe.none)}copy(e=null){return e==this.content?this:new su(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new su(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,o=!1){if(e==n)return Q.empty;let i=this.resolve(e),s=this.resolve(n),a=o?0:i.sharedDepth(n),l=i.start(a),c=i.node(a).content.cut(i.pos-l,s.pos-l);return new Q(c,i.depth-a,s.depth-a)}replace(e,n,o){return Bx(this.resolve(e),this.resolve(n),o)}nodeAt(e){for(let n=this;;){let{index:o,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(o),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:o}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:o}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:o}=this.content.findIndex(e);if(o<e)return{node:this.content.child(n),index:n,offset:o};let i=this.content.child(n-1);return{node:i,index:n-1,offset:o-i.nodeSize}}resolve(e){return Fr.resolveCached(this,e)}resolveNoCache(e){return Fr.resolve(this,e)}rangeHasMark(e,n,o){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(o.isInSet(s.marks)&&(i=!0),!i)),i}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()+")"),Qf(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,o=H.empty,i=0,s=o.childCount){let a=this.contentMatchAt(e).matchFragment(o,i,s),l=a&&a.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let c=i;c<s;c++)if(!this.type.allowsMarks(o.child(c).marks))return!1;return!0}canReplaceWith(e,n,o,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(o),a=s&&s.matchFragment(this.content,n);return!!a&&a.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=xe.none;for(let n=0;n<this.marks.length;n++){let o=this.marks[n];o.type.checkAttrs(o.attrs),e=o.addToSet(e)}if(!xe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n 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(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let o;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");o=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,o)}let i=H.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,i,o);return s.type.checkAttrs(s.attrs),s}};Cn.prototype.text=void 0;class bs extends Cn{constructor(e,n,o,i){if(super(e,n,null,i),!o)throw new RangeError("Empty text nodes are not allowed");this.text=o}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Qf(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new bs(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new bs(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Qf(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class so{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let o=new Vx(e,n);if(o.next==null)return so.empty;let i=Zf(o);o.next&&o.err("Unexpected trailing text");let s=function(a){let l=Object.create(null);return function c(d){let u=[];d.forEach(h=>{a[h].forEach(({term:f,to:m})=>{if(!f)return;let g;for(let v=0;v<u.length;v++)u[v][0]==f&&(g=u[v][1]);nm(a,m).forEach(v=>{g||u.push([f,g=[]]),g.indexOf(v)==-1&&g.push(v)})})});let p=l[d.join(",")]=new so(d.indexOf(a.length-1)>-1);for(let h=0;h<u.length;h++){let f=u[h][1].sort(tm);p.next.push({type:u[h][0],next:l[f.join(",")]||c(f)})}return p}(nm(a,0))}(function(a){let l=[[]];return u(function p(h,f){if(h.type=="choice")return h.exprs.reduce((m,g)=>m.concat(p(g,f)),[]);if(h.type!="seq"){if(h.type=="star"){let m=c();return d(f,m),u(p(h.expr,m),m),[d(m)]}if(h.type=="plus"){let m=c();return u(p(h.expr,f),m),u(p(h.expr,m),m),[d(m)]}if(h.type=="opt")return[d(f)].concat(p(h.expr,f));if(h.type=="range"){let m=f;for(let g=0;g<h.min;g++){let v=c();u(p(h.expr,m),v),m=v}if(h.max==-1)u(p(h.expr,m),m);else for(let g=h.min;g<h.max;g++){let v=c();d(m,v),u(p(h.expr,m),v),m=v}return[d(m)]}if(h.type=="name")return[d(f,void 0,h.value)];throw new Error("Unknown expr type")}for(let m=0;;m++){let g=p(h.exprs[m],f);if(m==h.exprs.length-1)return g;u(g,f=c())}}(a,0),c()),l;function c(){return l.push([])-1}function d(p,h,f){let m={term:f,to:h};return l[p].push(m),m}function u(p,h){p.forEach(f=>f.to=h)}}(i));return function(a,l){for(let c=0,d=[a];c<d.length;c++){let u=d[c],p=!u.validEnd,h=[];for(let f=0;f<u.next.length;f++){let{type:m,next:g}=u.next[f];h.push(m.name),!p||m.isText||m.hasRequiredAttrs()||(p=!1),d.indexOf(g)==-1&&d.push(g)}p&&l.err("Only non-generatable nodes ("+h.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(s,o),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,o=e.childCount){let i=this;for(let s=n;i&&s<o;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!n.isText&&!n.hasRequiredAttrs())return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let o=0;o<e.next.length;o++)if(this.next[n].type==e.next[o].type)return!0;return!1}fillBefore(e,n=!1,o=0){let i=[this];return function s(a,l){let c=a.matchFragment(e,o);if(c&&(!n||c.validEnd))return H.from(l.map(d=>d.createAndFill()));for(let d=0;d<a.next.length;d++){let{type:u,next:p}=a.next[d];if(!u.isText&&!u.hasRequiredAttrs()&&i.indexOf(p)==-1){i.push(p);let h=s(p,l.concat(u));if(h)return h}}return null}(this,[])}findWrapping(e){for(let o=0;o<this.wrapCache.length;o+=2)if(this.wrapCache[o]==e)return this.wrapCache[o+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),o=[{match:this,type:null,via:null}];for(;o.length;){let i=o.shift(),s=i.match;if(s.matchType(e)){let a=[];for(let l=i;l.type;l=l.via)a.push(l.type);return a.reverse()}for(let a=0;a<s.next.length;a++){let{type:l,next:c}=s.next[a];l.isLeaf||l.hasRequiredAttrs()||l.name in n||i.type&&!c.validEnd||(o.push({match:l.contentMatch,type:l,via:i}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(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 n(o){e.push(o);for(let i=0;i<o.next.length;i++)e.indexOf(o.next[i].next)==-1&&n(o.next[i].next)}(this),e.map((n,o)=>{let i=o+(n.validEnd?"*":" ")+" ";for(let s=0;s<n.next.length;s++)i+=(s?", ":"")+n.next[s].type.name+"->"+e.indexOf(n.next[s].next);return i}).join(`
37
+ `)}}so.empty=new so(!0);class Vx{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}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 Zf(t){let e=[];do e.push(Dx(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Dx(t){let e=[];do e.push(Ax(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Ax(t){let e=function(n){if(n.eat("(")){let o=Zf(n);return n.eat(")")||n.err("Missing closing paren"),o}if(!/\W/.test(n.next)){let o=function(i,s){let a=i.nodeTypes,l=a[s];if(l)return[l];let c=[];for(let d in a){let u=a[d];u.isInGroup(s)&&c.push(u)}return c.length==0&&i.err("No node type or group '"+s+"' found"),c}(n,n.next).map(i=>(n.inline==null?n.inline=i.isInline:n.inline!=i.isInline&&n.err("Mixing inline and block content"),{type:"name",value:i}));return n.pos++,o.length==1?o[0]:{type:"choice",exprs:o}}n.err("Unexpected token '"+n.next+"'")}(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=Ix(t,e)}return e}function em(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function Ix(t,e){let n=em(t),o=n;return t.eat(",")&&(o=t.next!="}"?em(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:o,expr:e}}function tm(t,e){return e-t}function nm(t,e){let n=[];return function o(i){let s=t[i];if(s.length==1&&!s[0].term)return o(s[0].to);n.push(i);for(let a=0;a<s.length;a++){let{term:l,to:c}=s[a];l||n.indexOf(c)!=-1||o(c)}}(e),n.sort(tm)}function om(t){let e=Object.create(null);for(let n in t){let o=t[n];if(!o.hasDefault)return null;e[n]=o.default}return e}function rm(t,e){let n=Object.create(null);for(let o in t){let i=e&&e[o];if(i===void 0){let s=t[o];if(!s.hasDefault)throw new RangeError("No value supplied for attribute "+o);i=s.default}n[o]=i}return n}function im(t,e,n,o){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in t){let s=t[i];s.validate&&s.validate(e[i])}}function sm(t,e){let n=Object.create(null);if(e)for(let o in e)n[o]=new Rx(t,o,e[o]);return n}let am=class A0{constructor(e,n,o){this.name=e,this.schema=n,this.spec=o,this.markSet=null,this.groups=o.group?o.group.split(" "):[],this.attrs=sm(e,o.attrs),this.defaultAttrs=om(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(o.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==so.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:rm(this.attrs,e)}create(e=null,n,o){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Cn(this,this.computeAttrs(e),H.from(n),xe.setFrom(o))}createChecked(e=null,n,o){return n=H.from(n),this.checkContent(n),new Cn(this,this.computeAttrs(e),n,xe.setFrom(o))}createAndFill(e=null,n,o){if(e=this.computeAttrs(e),(n=H.from(n)).size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(H.empty,!0);return s?new Cn(this,e,n.append(s),xe.setFrom(o)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let o=0;o<e.childCount;o++)if(!this.allowsMarks(e.child(o).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){im(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let o=0;o<e.length;o++)this.allowsMarkType(e[o].type)?n&&n.push(e[o]):n||(n=e.slice(0,o));return n?n.length?n:xe.none:e}static compile(e,n){let o=Object.create(null);e.forEach((s,a)=>o[s]=new A0(s,n,a));let i=n.spec.topNode||"doc";if(!o[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!o.text)throw new RangeError("Every schema needs a 'text' type");for(let s in o.text.attrs)throw new RangeError("The text node type should not have attributes");return o}};class Rx{constructor(e,n,o){this.hasDefault=Object.prototype.hasOwnProperty.call(o,"default"),this.default=o.default,this.validate=typeof o.validate=="string"?function(i,s,a){let l=a.split("|");return c=>{let d=c===null?"null":typeof c;if(l.indexOf(d)<0)throw new RangeError(`Expected value of type ${l} for attribute ${s} on type ${i}, got ${d}`)}}(e,n,o.validate):o.validate}get isRequired(){return!this.hasDefault}}class ks{constructor(e,n,o,i){this.name=e,this.rank=n,this.schema=o,this.spec=i,this.attrs=sm(e,i.attrs),this.excluded=null;let s=om(this.attrs);this.instance=s?new xe(this,s):null}create(e=null){return!e&&this.instance?this.instance:new xe(this,rm(this.attrs,e))}static compile(e,n){let o=Object.create(null),i=0;return e.forEach((s,a)=>o[s]=new ks(s,i++,n,a)),o}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}checkAttrs(e){im(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class lm{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Je.from(e.nodes),n.marks=Je.from(e.marks||{}),this.nodes=am.compile(this.spec.nodes,this),this.marks=ks.compile(this.spec.marks,this);let o=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],a=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=o[a]||(o[a]=so.parse(a,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?cm(this,l.split(" ")):l!=""&&s.inlineContent?null:[]}for(let i in this.marks){let s=this.marks[i],a=s.spec.excludes;s.excluded=a==null?[s]:a==""?[]:cm(this,a.split(" "))}this.nodeFromJSON=i=>Cn.fromJSON(this,i),this.markFromJSON=i=>xe.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,o,i){if(typeof e=="string")e=this.nodeType(e);else{if(!(e instanceof am))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(n,o,i)}text(e,n){let o=this.nodes.text;return new bs(o,o.defaultAttrs,e,xe.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function cm(t,e){let n=[];for(let o=0;o<e.length;o++){let i=e[o],s=t.marks[i],a=s;if(s)n.push(s);else for(let l in t.marks){let c=t.marks[l];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&n.push(a=c)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[o]+"'")}return n}class Sn{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let o=this.matchedStyles=[];n.forEach(i=>{if(function(s){return s.tag!=null}(i))this.tags.push(i);else if(function(s){return s.style!=null}(i)){let s=/[^=]*/.exec(i.style)[0];o.indexOf(s)<0&&o.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let o=new hm(this,n,!1);return o.addAll(e,xe.none,n.from,n.to),o.finish()}parseSlice(e,n={}){let o=new hm(this,n,!0);return o.addAll(e,xe.none,n.from,n.to),Q.maxOpen(o.finish())}matchTag(e,n,o){for(let i=o?this.tags.indexOf(o)+1:0;i<this.tags.length;i++){let s=this.tags[i];if($x(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let a=s.getAttrs(e);if(a===!1)continue;s.attrs=a||void 0}return s}}}matchStyle(e,n,o,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let a=this.styles[s],l=a.style;if(!(l.indexOf(e)!=0||a.context&&!o.matchesContext(a.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(a.getAttrs){let c=a.getAttrs(n);if(c===!1)continue;a.attrs=c||void 0}return a}}}static schemaRules(e){let n=[];function o(i){let s=i.priority==null?50:i.priority,a=0;for(;a<n.length;a++){let l=n[a];if((l.priority==null?50:l.priority)<s)break}n.splice(a,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(a=>{o(a=fm(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(a=>{o(a=fm(a)),a.node||a.ignore||a.mark||(a.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Sn(e,Sn.schemaRules(e)))}}const dm={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},Lx={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},um={ol:!0,ul:!0};function pm(t,e,n){return e!=null?(e?1:0)|(e==="full"?2:0):t&&t.whitespace=="pre"?3:-5&n}class tc{constructor(e,n,o,i,s,a){this.type=e,this.attrs=n,this.marks=o,this.solid=i,this.options=a,this.content=[],this.activeMarks=xe.none,this.match=s||(4&a?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(H.from(e));if(!n){let o,i=this.type.contentMatch;return(o=i.findWrapping(e.type))?(this.match=i,o):null}this.match=this.type.contentMatch.matchFragment(n)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let o,i=this.content[this.content.length-1];if(i&&i.isText&&(o=/[ \t\r\n\u000c]+$/.exec(i.text))){let s=i;i.text.length==o[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-o[0].length))}}let n=H.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(H.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!dm.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class hm{constructor(e,n,o){this.parser=e,this.options=n,this.isOpen=o,this.open=0,this.localPreserveWS=!1;let i,s=n.topNode,a=pm(null,n.preserveWhitespace,0)|(o?4:0);i=s?new tc(s.type,s.attrs,xe.none,!0,n.topMatch||s.type.contentMatch,a):new tc(o?null:e.schema.topNodeType,null,xe.none,!0,null,a),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,n){e.nodeType==3?this.addTextNode(e,n):e.nodeType==1&&this.addElement(e,n)}addTextNode(e,n){let o=e.nodeValue,i=this.top,s=2&i.options?"full":this.localPreserveWS||(1&i.options)>0;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(o)){if(s)o=s!=="full"?o.replace(/\r?\n|\r/g," "):o.replace(/\r\n?/g,`
38
+ `);else if(o=o.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(o)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(o=o.slice(1))}o&&this.insertNode(this.parser.schema.text(o),n,!/\S/.test(o)),this.findInText(e)}else this.findInside(e)}addElement(e,n,o){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a,l=e.nodeName.toLowerCase();um.hasOwnProperty(l)&&this.parser.normalizeLists&&function(d){for(let u=d.firstChild,p=null;u;u=u.nextSibling){let h=u.nodeType==1?u.nodeName.toLowerCase():null;h&&um.hasOwnProperty(h)&&p?(p.appendChild(u),u=p):h=="li"?p=u:h&&(p=null)}}(e);let c=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,o));e:if(c?c.ignore:Lx.hasOwnProperty(l))this.findInside(e),this.ignoreFallback(e,n);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(e=c.skip);let d,u=this.needsBlock;if(dm.hasOwnProperty(l))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),d=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let p=c&&c.skip?n:this.readStyles(e,n);p&&this.addAll(e,p),d&&this.sync(s),this.needsBlock=u}else{let d=this.readStyles(e,n);d&&this.addElementByRule(e,c,d,c.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
39
+ `),n)}ignoreFallback(e,n){e.nodeName!="BR"||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(e,n){let o=e.style;if(o&&o.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],a=o.getPropertyValue(s);if(a)for(let l;;){let c=this.parser.matchStyle(s,a,this,l);if(!c)break;if(c.ignore)return null;if(n=c.clearMark?n.filter(d=>!c.clearMark(d)):n.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming!==!1)break;l=c}}return n}addElementByRule(e,n,o,i){let s,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),o,e.nodeName=="BR")||this.leafFallback(e,o);else{let c=this.enter(a,n.attrs||null,o,n.preserveWhitespace);c&&(s=!0,o=c)}else{let c=this.parser.schema.marks[n.mark];o=o.concat(c.create(n.attrs))}let l=this.top;if(a&&a.isLeaf)this.findInside(e);else if(i)this.addElement(e,o,i);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,o,!1));else{let c=e;typeof n.contentElement=="string"?c=e.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(e):n.contentElement&&(c=n.contentElement),this.findAround(e,c,!0),this.addAll(c,o),this.findAround(e,c,!1)}s&&this.sync(l)&&this.open--}addAll(e,n,o,i){let s=o||0;for(let a=o?e.childNodes[o]:e.firstChild,l=i==null?null:e.childNodes[i];a!=l;a=a.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(a,n);this.findAtPoint(e,s)}findPlace(e,n,o){let i,s;for(let a=this.open,l=0;a>=0;a--){let c=this.nodes[a],d=c.findWrapping(e);if(d&&(!i||i.length>d.length+l)&&(i=d,s=c,!d.length))break;if(c.solid){if(o)break;l+=2}}if(!i)return null;this.sync(s);for(let a=0;a<i.length;a++)n=this.enterInner(i[a],null,n,!1);return n}insertNode(e,n,o){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let i=this.findPlace(e,n,o);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let a=xe.none;for(let l of i.concat(e.marks))(s.type?s.type.allowsMarkType(l.type):mm(l.type,e.type))&&(a=l.addToSet(a));return s.content.push(e.mark(a)),!0}return!1}enter(e,n,o,i){let s=this.findPlace(e.create(n),o,!1);return s&&(s=this.enterInner(e,n,o,!0,i)),s}enterInner(e,n,o,i=!1,s){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let l=pm(e,s,a.options);4&a.options&&a.content.length==0&&(l|=4);let c=xe.none;return o=o.filter(d=>!(a.type?a.type.allowsMarkType(d.type):mm(d.type,e))||(c=d.addToSet(c),!1)),this.nodes.push(new tc(e,n,c,i,null,l)),this.open++,o}closeExtra(e=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].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 n=this.open;n>=0;n--){if(this.nodes[n]==e)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=1)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let o=this.nodes[n].content;for(let i=o.length-1;i>=0;i--)e+=o[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let o=0;o<this.find.length;o++)this.find[o].node==e&&this.find[o].offset==n&&(this.find[o].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,o){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(o?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),o=this.options.context,i=!(this.isOpen||o&&o.parent.type!=this.nodes[0].type),s=-(o?o.depth+1:0)+(i?0:1),a=(l,c)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;c>=s;c--)if(a(l-1,c))return!0;return!1}{let u=c>0||c==0&&i?this.nodes[c].type:o&&c>=s?o.node(c-s).type:null;if(!u||u.name!=d&&!u.isInGroup(d))return!1;c--}}return!0};return a(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(o&&o.isTextblock&&o.defaultAttrs)return o}for(let n in this.parser.schema.nodes){let o=this.parser.schema.nodes[n];if(o.isTextblock&&o.defaultAttrs)return o}}}function $x(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function fm(t){let e={};for(let n in t)e[n]=t[n];return e}function mm(t,e){let n=e.schema.nodes;for(let o in n){let i=n[o];if(!i.allowsMarkType(t))continue;let s=[],a=l=>{s.push(l);for(let c=0;c<l.edgeCount;c++){let{type:d,next:u}=l.edge(c);if(d==e||s.indexOf(u)<0&&a(u))return!0}};if(a(i.contentMatch))return!0}}class ao{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},o){o||(o=nc(n).createDocumentFragment());let i=o,s=[];return e.forEach(a=>{if(s.length||a.marks.length){let l=0,c=0;for(;l<s.length&&c<a.marks.length;){let d=a.marks[c];if(this.marks[d.type.name]){if(!d.eq(s[l][0])||d.type.spec.spanning===!1)break;l++,c++}else c++}for(;l<s.length;)i=s.pop()[1];for(;c<a.marks.length;){let d=a.marks[c++],u=this.serializeMark(d,a.isInline,n);u&&(s.push([d,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(a,n))}),o}serializeNodeInner(e,n){let{dom:o,contentDOM:i}=ws(nc(n),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return o}serializeNode(e,n={}){let o=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(o),o=s.dom)}return o}serializeMark(e,n,o={}){let i=this.marks[e.type.name];return i&&ws(nc(o),i(e,n),null,e.attrs)}static renderSpec(e,n,o=null,i){return ws(e,n,o,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new ao(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=gm(e.nodes);return n.text||(n.text=o=>o.text),n}static marksFromSchema(e){return gm(e.marks)}}function gm(t){let e={};for(let n in t){let o=t[n].spec.toDOM;o&&(e[n]=o)}return e}function nc(t){return t.document||window.document}const vm=new WeakMap;function ws(t,e,n,o){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i,s=e[0];if(typeof s!="string")throw new RangeError("Invalid array passed to renderSpec");if(o&&(i=function(p){let h=vm.get(p);return h===void 0&&vm.set(p,h=function(f){let m=null;return function g(v){if(v&&typeof v=="object")if(Array.isArray(v))if(typeof v[0]=="string")m||(m=[]),m.push(v);else for(let b=0;b<v.length;b++)g(v[b]);else for(let b in v)g(v[b])}(f),m}(p)),h}(o))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let a,l=s.indexOf(" ");l>0&&(n=s.slice(0,l),s=s.slice(l+1));let c=n?t.createElementNS(n,s):t.createElement(s),d=e[1],u=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){u=2;for(let p in d)if(d[p]!=null){let h=p.indexOf(" ");h>0?c.setAttributeNS(p.slice(0,h),p.slice(h+1),d[p]):p=="style"&&c.style?c.style.cssText=d[p]:c.setAttribute(p,d[p])}}for(let p=u;p<e.length;p++){let h=e[p];if(h===0){if(p<e.length-1||p>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}{let{dom:f,contentDOM:m}=ws(t,h,n,o);if(c.appendChild(f),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:c,contentDOM:a}}const ym=Math.pow(2,16);function Px(t,e){return t+e*ym}function bm(t){return 65535&t}class oc{constructor(e,n,o){this.pos=e,this.delInfo=n,this.recover=o}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class bt{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&bt.empty)return bt.empty}recover(e){let n=0,o=bm(e);if(!this.inverted)for(let i=0;i<o;i++)n+=this.ranges[3*i+2]-this.ranges[3*i+1];return this.ranges[3*o]+n+function(i){return(i-(65535&i))/ym}(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,o){let i=0,s=this.inverted?2:1,a=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?i:0);if(c>e)break;let d=this.ranges[l+s],u=this.ranges[l+a],p=c+d;if(e<=p){let h=c+i+((d?e==c?-1:e==p?1:n:n)<0?0:u);if(o)return h;let f=e==(n<0?c:p)?null:Px(l/3,e-c),m=e==c?2:e==p?1:4;return(n<0?e!=c:e!=p)&&(m|=8),new oc(h,m,f)}i+=u-d}return o?e+i:new oc(e+i,0,null)}touches(e,n){let o=0,i=bm(n),s=this.inverted?2:1,a=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?o:0);if(c>e)break;let d=this.ranges[l+s];if(e<=c+d&&l==3*i)return!0;o+=this.ranges[l+a]-d}return!1}forEach(e){let n=this.inverted?2:1,o=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let a=this.ranges[i],l=a-(this.inverted?s:0),c=a+(this.inverted?0:s),d=this.ranges[i+n],u=this.ranges[i+o];e(l,l+d,c,c+u),s+=u-d}}invert(){return new bt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?bt.empty:new bt(e<0?[0,-e,0]:[0,0,e])}}bt.empty=new bt([]);class jr{constructor(e,n,o=0,i=e?e.length:0){this.mirror=n,this.from=o,this.to=i,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new jr(this._maps,this.mirror,e,n)}appendMap(e,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(e){for(let n=0,o=this._maps.length;n<e._maps.length;n++){let i=e.getMirror(n);this.appendMap(e._maps[n],i!=null&&i<n?o+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,o=this._maps.length+e._maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e._maps[n].invert(),i!=null&&i>n?o-i-1:void 0)}}invert(){let e=new jr;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let o=this.from;o<this.to;o++)e=this._maps[o].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,o){let i=0;for(let s=this.from;s<this.to;s++){let a=this._maps[s].mapResult(e,n);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return o?e:new oc(e,i,null)}}const rc=Object.create(null);class Qe{getMap(){return bt.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let o=rc[n.stepType];if(!o)throw new RangeError(`No step type ${n.stepType} defined`);return o.fromJSON(e,n)}static jsonID(e,n){if(e in rc)throw new RangeError("Duplicate use of step JSON ID "+e);return rc[e]=n,n.prototype.jsonID=e,n}}class $e{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new $e(e,null)}static fail(e){return new $e(null,e)}static fromReplace(e,n,o,i){try{return $e.ok(e.replace(n,o,i))}catch(s){if(s instanceof gs)return $e.fail(s.message);throw s}}}function ic(t,e,n){let o=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(ic(s.content,e,s))),s.isInline&&(s=e(s,n,i)),o.push(s)}return H.fromArray(o)}class En extends Qe{constructor(e,n,o){super(),this.from=e,this.to=n,this.mark=o}apply(e){let n=e.slice(this.from,this.to),o=e.resolve(this.from),i=o.node(o.sharedDepth(this.to)),s=new Q(ic(n.content,(a,l)=>a.isAtom&&l.type.allowsMarkType(this.mark.type)?a.mark(this.mark.addToSet(a.marks)):a,i),n.openStart,n.openEnd);return $e.fromReplace(e,this.from,this.to,s)}invert(){return new Lt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),o=e.mapResult(this.to,-1);return n.deleted&&o.deleted||n.pos>=o.pos?null:new En(n.pos,o.pos,this.mark)}merge(e){return e instanceof En&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new En(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new En(n.from,n.to,e.markFromJSON(n.mark))}}Qe.jsonID("addMark",En);class Lt extends Qe{constructor(e,n,o){super(),this.from=e,this.to=n,this.mark=o}apply(e){let n=e.slice(this.from,this.to),o=new Q(ic(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return $e.fromReplace(e,this.from,this.to,o)}invert(){return new En(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),o=e.mapResult(this.to,-1);return n.deleted&&o.deleted||n.pos>=o.pos?null:new Lt(n.pos,o.pos,this.mark)}merge(e){return e instanceof Lt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Lt(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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Lt(n.from,n.to,e.markFromJSON(n.mark))}}Qe.jsonID("removeMark",Lt);class Mn extends Qe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return $e.fail("No node at mark step's position");let o=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return $e.fromReplace(e,this.pos,this.pos+1,new Q(H.from(o),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let o=this.mark.addToSet(n.marks);if(o.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(o))return new Mn(this.pos,n.marks[i]);return new Mn(this.pos,this.mark)}}return new lo(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Mn(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Mn(n.pos,e.markFromJSON(n.mark))}}Qe.jsonID("addNodeMark",Mn);class lo extends Qe{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return $e.fail("No node at mark step's position");let o=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return $e.fromReplace(e,this.pos,this.pos+1,new Q(H.from(o),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return n&&this.mark.isInSet(n.marks)?new Mn(this.pos,this.mark):this}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new lo(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new lo(n.pos,e.markFromJSON(n.mark))}}Qe.jsonID("removeNodeMark",lo);class We extends Qe{constructor(e,n,o,i=!1){super(),this.from=e,this.to=n,this.slice=o,this.structure=i}apply(e){return this.structure&&sc(e,this.from,this.to)?$e.fail("Structure replace would overwrite content"):$e.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new bt([this.from,this.to-this.from,this.slice.size])}invert(e){return new We(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),o=e.mapResult(this.to,-1);return n.deletedAcross&&o.deletedAcross?null:new We(n.pos,Math.max(n.pos,o.pos),this.slice,this.structure)}merge(e){if(!(e instanceof We)||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 n=this.slice.size+e.slice.size==0?Q.empty:new Q(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new We(e.from,this.to,n,this.structure)}}{let n=this.slice.size+e.slice.size==0?Q.empty:new Q(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new We(this.from,this.to+(e.to-e.from),n,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,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new We(n.from,n.to,Q.fromJSON(e,n.slice),!!n.structure)}}Qe.jsonID("replace",We);class Ke extends Qe{constructor(e,n,o,i,s,a,l=!1){super(),this.from=e,this.to=n,this.gapFrom=o,this.gapTo=i,this.slice=s,this.insert=a,this.structure=l}apply(e){if(this.structure&&(sc(e,this.from,this.gapFrom)||sc(e,this.gapTo,this.to)))return $e.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return $e.fail("Gap is not a flat range");let o=this.slice.insertAt(this.insert,n.content);return o?$e.fromReplace(e,this.from,this.to,o):$e.fail("Content does not fit in gap")}getMap(){return new bt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Ke(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),o=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?o.pos:e.map(this.gapTo,1);return n.deletedAcross&&o.deletedAcross||i<n.pos||s>o.pos?null:new Ke(n.pos,o.pos,i,s,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,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ke(n.from,n.to,n.gapFrom,n.gapTo,Q.fromJSON(e,n.slice),n.insert,!!n.structure)}}function sc(t,e,n){let o=t.resolve(e),i=n-e,s=o.depth;for(;i>0&&s>0&&o.indexAfter(s)==o.node(s).childCount;)s--,i--;if(i>0){let a=o.node(s).maybeChild(o.indexAfter(s));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function ac(t,e,n,o=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),a=[],l=e+1;for(let c=0;c<s.childCount;c++){let d=s.child(c),u=l+d.nodeSize,p=o.matchType(d.type);if(p){o=p;for(let h=0;h<d.marks.length;h++)n.allowsMarkType(d.marks[h].type)||t.step(new Lt(l,u,d.marks[h]));if(i&&d.isText&&n.whitespace!="pre"){let h,f,m=/\r?\n|\r/g;for(;h=m.exec(d.text);)f||(f=new Q(H.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),a.push(new We(l+h.index,l+h.index+h[0].length,f))}}else a.push(new We(l,u,Q.empty));l=u}if(!o.validEnd){let c=o.fillBefore(H.empty,!0);t.replace(l,l,new Q(c,0,0))}for(let c=a.length-1;c>=0;c--)t.step(a[c])}function zx(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Xo(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let o=t.$from.node(n),i=t.$from.index(n),s=t.$to.indexAfter(n);if(n<t.depth&&o.canReplace(i,s,e))return n;if(n==0||o.type.spec.isolating||!zx(o,i,s))break}return null}function lc(t,e,n=null,o=t){let i=function(a,l){let{parent:c,startIndex:d,endIndex:u}=a,p=c.contentMatchAt(d).findWrapping(l);if(!p)return null;let h=p.length?p[0]:l;return c.canReplaceWith(d,u,h)?p:null}(t,e),s=i&&function(a,l){let{parent:c,startIndex:d,endIndex:u}=a,p=c.child(d),h=l.contentMatch.findWrapping(p.type);if(!h)return null;let f=(h.length?h[h.length-1]:l).contentMatch;for(let m=d;f&&m<u;m++)f=f.matchType(c.child(m).type);return f&&f.validEnd?h:null}(o,e);return s?i.map(km).concat({type:e,attrs:n}).concat(s.map(km)):null}function km(t){return{type:t,attrs:null}}function wm(t,e,n,o){e.forEach((i,s)=>{if(i.isText){let a,l=/\r?\n|\r/g;for(;a=l.exec(i.text);){let c=t.mapping.slice(o).map(n+1+s+a.index);t.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function xm(t,e,n,o){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let a=t.mapping.slice(o).map(n+1+s);t.replaceWith(a,a+1,e.type.schema.text(`
40
+ `))}})}function rn(t,e,n=1,o){let i=t.resolve(e),s=i.depth-n,a=o&&o[o.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,u=n-2;d>s;d--,u--){let p=i.node(d),h=i.index(d);if(p.type.spec.isolating)return!1;let f=p.content.cutByIndex(h,p.childCount),m=o&&o[u+1];m&&(f=f.replaceChild(0,m.type.create(m.attrs)));let g=o&&o[u]||p;if(!p.canReplace(h+1,p.childCount)||!g.type.validContent(f))return!1}let l=i.indexAfter(s),c=o&&o[0];return i.node(s).canReplaceWith(l,l,c?c.type:i.node(s+1).type)}function Nn(t,e){let n=t.resolve(e),o=n.index();return Cm(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(o,o+1)}function Cm(t,e){return!(!t||!e||t.isLeaf||!function(n,o){o.content.size||n.type.compatibleContent(o.type);let i=n.contentMatchAt(n.childCount),{linebreakReplacement:s}=n.type.schema;for(let a=0;a<o.childCount;a++){let l=o.child(a),c=l.type==s?n.type.schema.nodes.text:l.type;if(i=i.matchType(c),!i||!n.type.allowsMarks(l.marks))return!1}return i.validEnd}(t,e))}function xs(t,e,n=-1){let o=t.resolve(e);for(let i=o.depth;;i--){let s,a,l=o.index(i);if(i==o.depth?(s=o.nodeBefore,a=o.nodeAfter):n>0?(s=o.node(i+1),l++,a=o.node(i).maybeChild(l)):(s=o.node(i).maybeChild(l-1),a=o.node(i+1)),s&&!s.isTextblock&&Cm(s,a)&&o.node(i).canReplace(l,l+1))return e;if(i==0)break;e=n<0?o.before(i):o.after(i)}}function Sm(t,e,n){let o=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let s=0;s<n.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let a=o.depth;a>=0;a--){let l=a==o.depth?0:o.pos<=(o.start(a+1)+o.end(a+1))/2?-1:1,c=o.index(a)+(l>0?1:0),d=o.node(a),u=!1;if(s==1)u=d.canReplace(c,c,i);else{let p=d.contentMatchAt(c).findWrapping(i.firstChild.type);u=p&&d.canReplaceWith(c,c,p[0])}if(u)return l==0?o.pos:l<0?o.before(a+1):o.after(a+1)}return null}function Cs(t,e,n=e,o=Q.empty){if(e==n&&!o.size)return null;let i=t.resolve(e),s=t.resolve(n);return Em(i,s,o)?new We(e,n,o):new Fx(i,s,o).fit()}function Em(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}Qe.jsonID("replaceAround",Ke);class Fx{constructor(e,n,o){this.$from=e,this.$to=n,this.unplaced=o,this.frontier=[],this.placed=H.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=H.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,o=this.$from,i=this.close(e<0?this.$to:o.doc.resolve(e));if(!i)return null;let s=this.placed,a=o.depth,l=i.depth;for(;a&&l&&s.childCount==1;)s=s.firstChild.content,a--,l--;let c=new Q(s,a,l);return e>-1?new Ke(o.pos,e,this.$to.pos,this.$to.end(),c,n):c.size||o.pos!=this.$to.pos?new We(o.pos,i.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,o=0,i=this.unplaced.openEnd;o<e;o++){let s=n.firstChild;if(n.childCount>1&&(i=0),s.type.spec.isolating&&i<=o){e=o;break}n=s.content}for(let n=1;n<=2;n++)for(let o=n==1?e:this.unplaced.openStart;o>=0;o--){let i,s=null;o?(s=cc(this.unplaced.content,o-1).firstChild,i=s.content):i=this.unplaced.content;let a=i.firstChild;for(let l=this.depth;l>=0;l--){let c,{type:d,match:u}=this.frontier[l],p=null;if(n==1&&(a?u.matchType(a.type)||(p=u.fillBefore(H.from(a),!1)):s&&d.compatibleContent(s.type)))return{sliceDepth:o,frontierDepth:l,parent:s,inject:p};if(n==2&&a&&(c=u.findWrapping(a.type)))return{sliceDepth:o,frontierDepth:l,parent:s,wrap:c};if(s&&u.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:o}=this.unplaced,i=cc(e,n);return!(!i.childCount||i.firstChild.isLeaf||(this.unplaced=new Q(e,n+1,Math.max(o,i.size+n>=e.size-o?n+1:0)),0))}dropNode(){let{content:e,openStart:n,openEnd:o}=this.unplaced,i=cc(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new Q(Hr(e,n-1,1),n-1,s?n-1:o)}else this.unplaced=new Q(Hr(e,n,1),n,o)}placeNodes({sliceDepth:e,frontierDepth:n,parent:o,inject:i,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let g=0;g<s.length;g++)this.openFrontierNode(s[g]);let a=this.unplaced,l=o?o.content:a.content,c=a.openStart-e,d=0,u=[],{match:p,type:h}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)u.push(i.child(g));p=p.matchFragment(i)}let f=l.size+e-(a.content.size-a.openEnd);for(;d<l.childCount;){let g=l.child(d),v=p.matchType(g.type);if(!v)break;d++,(d>1||c==0||g.content.size)&&(p=v,u.push(Mm(g.mark(h.allowedMarks(g.marks)),d==1?c:0,d==l.childCount?f:-1)))}let m=d==l.childCount;m||(f=-1),this.placed=Wr(this.placed,n,H.from(u)),this.frontier[n].match=p,m&&f<0&&o&&o.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,v=l;g<f;g++){let b=v.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),v=b.content}this.unplaced=m?e==0?Q.empty:new Q(Hr(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new Q(Hr(a.content,e,d),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,n=this.frontier[this.depth];if(!n.type.isTextblock||!dc(this.$to,this.$to.depth,n.type,n.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:o}=this.$to,i=this.$to.after(o);for(;o>1&&i==this.$to.end(--o);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:o,type:i}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),a=dc(e,n,i,o,s);if(a){for(let l=n-1;l>=0;l--){let{match:c,type:d}=this.frontier[l],u=dc(e,l,d,c,!0);if(!u||u.childCount)continue e}return{depth:n,fit:a,move:s?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Wr(this.placed,n.depth,n.fit)),e=n.move;for(let o=n.depth+1;o<=e.depth;o++){let i=e.node(o),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(o));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,n=null,o){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Wr(this.placed,this.depth,H.from(e.create(n,o))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(H.empty,!0);e.childCount&&(this.placed=Wr(this.placed,this.frontier.length,e))}}function Hr(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Hr(t.firstChild.content,e-1,n)))}function Wr(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Wr(t.lastChild.content,e-1,n)))}function cc(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Mm(t,e,n){if(e<=0)return t;let o=t.content;return e>1&&(o=o.replaceChild(0,Mm(o.firstChild,e-1,o.childCount==1?n-1:0))),e>0&&(o=t.type.contentMatch.fillBefore(o).append(o),n<=0&&(o=o.append(t.type.contentMatch.matchFragment(o).fillBefore(H.empty,!0)))),t.copy(o)}function dc(t,e,n,o,i){let s=t.node(e),a=i?t.indexAfter(e):t.index(e);if(a==s.childCount&&!n.compatibleContent(s.type))return null;let l=o.fillBefore(s.content,!0,a);return l&&!function(c,d,u){for(let p=u;p<d.childCount;p++)if(!c.allowsMarks(d.child(p).marks))return!0;return!1}(n,s.content,a)?l:null}function jx(t){return t.spec.defining||t.spec.definingForContent}function Nm(t,e,n,o,i){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(Nm(s.content,e+1,n,o,s)))}if(e>o){let s=i.contentMatchAt(0),a=s.fillBefore(t).append(t);t=a.append(s.matchFragment(a).fillBefore(H.empty,!0))}return t}function Bm(t,e){let n=[];for(let o=Math.min(t.depth,e.depth);o>=0;o--){let i=t.start(o);if(i<t.pos-(t.depth-o)||e.end(o)>e.pos+(e.depth-o)||t.node(o).type.spec.isolating||e.node(o).type.spec.isolating)break;(i==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==i-1)&&n.push(o)}return n}class Qo extends Qe{constructor(e,n,o){super(),this.pos=e,this.attr=n,this.value=o}apply(e){let n=e.nodeAt(this.pos);if(!n)return $e.fail("No node at attribute step's position");let o=Object.create(null);for(let s in n.attrs)o[s]=n.attrs[s];o[this.attr]=this.value;let i=n.type.create(o,null,n.marks);return $e.fromReplace(e,this.pos,this.pos+1,new Q(H.from(i),0,n.isLeaf?0:1))}getMap(){return bt.empty}invert(e){return new Qo(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Qo(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Qo(n.pos,n.attr,n.value)}}Qe.jsonID("attr",Qo);class Kr extends Qe{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let o=e.type.create(n,e.content,e.marks);return $e.ok(o)}getMap(){return bt.empty}invert(e){return new Kr(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Kr(n.attr,n.value)}}Qe.jsonID("docAttr",Kr);let Ur=class extends Error{};Ur=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},(Ur.prototype=Object.create(Error.prototype)).constructor=Ur,Ur.prototype.name="TransformError";class Tm{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new jr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Ur(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,o=Q.empty){let i=Cs(this.doc,e,n,o);return i&&this.step(i),this}replaceWith(e,n,o){return this.replace(e,n,new Q(H.from(o),0,0))}delete(e,n){return this.replace(e,n,Q.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,o){return function(i,s,a,l){if(!l.size)return i.deleteRange(s,a);let c=i.doc.resolve(s),d=i.doc.resolve(a);if(Em(c,d,l))return i.step(new We(s,a,l));let u=Bm(c,i.doc.resolve(a));u[u.length-1]==0&&u.pop();let p=-(c.depth+1);u.unshift(p);for(let v=c.depth,b=c.pos-1;v>0;v--,b--){let y=c.node(v).type.spec;if(y.defining||y.definingAsContext||y.isolating)break;u.indexOf(v)>-1?p=v:c.before(v)==b&&u.splice(1,0,-v)}let h=u.indexOf(p),f=[],m=l.openStart;for(let v=l.content,b=0;;b++){let y=v.firstChild;if(f.push(y),b==l.openStart)break;v=y.content}for(let v=m-1;v>=0;v--){let b=f[v],y=jx(b.type);if(y&&!b.sameMarkup(c.node(Math.abs(p)-1)))m=v;else if(y||!b.type.isTextblock)break}for(let v=l.openStart;v>=0;v--){let b=(v+m+1)%(l.openStart+1),y=f[b];if(y)for(let k=0;k<u.length;k++){let x=u[(k+h)%u.length],w=!0;x<0&&(w=!1,x=-x);let C=c.node(x-1),S=c.index(x-1);if(C.canReplaceWith(S,S,y.type,y.marks))return i.replace(c.before(x),w?d.after(x):a,new Q(Nm(l.content,0,l.openStart,b),b,l.openEnd))}}let g=i.steps.length;for(let v=u.length-1;v>=0&&(i.replace(s,a,l),!(i.steps.length>g));v--){let b=u[v];b<0||(s=c.before(b),a=d.after(b))}}(this,e,n,o),this}replaceRangeWith(e,n,o){return function(i,s,a,l){if(!l.isInline&&s==a&&i.doc.resolve(s).parent.content.size){let c=function(d,u,p){let h=d.resolve(u);if(h.parent.canReplaceWith(h.index(),h.index(),p))return u;if(h.parentOffset==0)for(let f=h.depth-1;f>=0;f--){let m=h.index(f);if(h.node(f).canReplaceWith(m,m,p))return h.before(f+1);if(m>0)return null}if(h.parentOffset==h.parent.content.size)for(let f=h.depth-1;f>=0;f--){let m=h.indexAfter(f);if(h.node(f).canReplaceWith(m,m,p))return h.after(f+1);if(m<h.node(f).childCount)return null}return null}(i.doc,s,l.type);c!=null&&(s=a=c)}i.replaceRange(s,a,new Q(H.from(l),0,0))}(this,e,n,o),this}deleteRange(e,n){return function(o,i,s){let a=o.doc.resolve(i),l=o.doc.resolve(s),c=Bm(a,l);for(let d=0;d<c.length;d++){let u=c[d],p=d==c.length-1;if(p&&u==0||a.node(u).type.contentMatch.validEnd)return o.delete(a.start(u),l.end(u));if(u>0&&(p||a.node(u-1).canReplace(a.index(u-1),l.indexAfter(u-1))))return o.delete(a.before(u),l.after(u))}for(let d=1;d<=a.depth&&d<=l.depth;d++)if(i-a.start(d)==a.depth-d&&s>a.end(d)&&l.end(d)-s!=l.depth-d&&a.start(d-1)==l.start(d-1)&&a.node(d-1).canReplace(a.index(d-1),l.index(d-1)))return o.delete(a.before(d),s);o.delete(i,s)}(this,e,n),this}lift(e,n){return function(o,i,s){let{$from:a,$to:l,depth:c}=i,d=a.before(c+1),u=l.after(c+1),p=d,h=u,f=H.empty,m=0;for(let b=c,y=!1;b>s;b--)y||a.index(b)>0?(y=!0,f=H.from(a.node(b).copy(f)),m++):p--;let g=H.empty,v=0;for(let b=c,y=!1;b>s;b--)y||l.after(b+1)<l.end(b)?(y=!0,g=H.from(l.node(b).copy(g)),v++):h++;o.step(new Ke(p,h,d,u,new Q(f.append(g),m,v),f.size-m,!0))}(this,e,n),this}join(e,n=1){return function(o,i,s){let a=null,{linebreakReplacement:l}=o.doc.type.schema,c=o.doc.resolve(i-s),d=c.node().type;if(l&&d.inlineContent){let f=d.whitespace=="pre",m=!!d.contentMatch.matchType(l);f&&!m?a=!1:!f&&m&&(a=!0)}let u=o.steps.length;if(a===!1){let f=o.doc.resolve(i+s);xm(o,f.node(),f.before(),u)}d.inlineContent&&ac(o,i+s-1,d,c.node().contentMatchAt(c.index()),a==null);let p=o.mapping.slice(u),h=p.map(i-s);if(o.step(new We(h,p.map(i+s,-1),Q.empty,!0)),a===!0){let f=o.doc.resolve(h);wm(o,f.node(),f.before(),o.steps.length)}}(this,e,n),this}wrap(e,n){return function(o,i,s){let a=H.empty;for(let d=s.length-1;d>=0;d--){if(a.size){let u=s[d].type.contentMatch.matchFragment(a);if(!u||!u.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}a=H.from(s[d].type.create(s[d].attrs,a))}let l=i.start,c=i.end;o.step(new Ke(l,c,l,c,new Q(a,0,0),s.length,!0))}(this,e,n),this}setBlockType(e,n=e,o,i=null){return function(s,a,l,c,d){if(!c.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let u=s.steps.length;s.doc.nodesBetween(a,l,(p,h)=>{let f=typeof d=="function"?d(p):d;if(p.isTextblock&&!p.hasMarkup(c,f)&&function(m,g,v){let b=m.resolve(g),y=b.index();return b.parent.canReplaceWith(y,y+1,v)}(s.doc,s.mapping.slice(u).map(h),c)){let m=null;if(c.schema.linebreakReplacement){let y=c.whitespace=="pre",k=!!c.contentMatch.matchType(c.schema.linebreakReplacement);y&&!k?m=!1:!y&&k&&(m=!0)}m===!1&&xm(s,p,h,u),ac(s,s.mapping.slice(u).map(h,1),c,void 0,m===null);let g=s.mapping.slice(u),v=g.map(h,1),b=g.map(h+p.nodeSize,1);return s.step(new Ke(v,b,v+1,b-1,new Q(H.from(c.create(f,null,p.marks)),0,0),1,!0)),m===!0&&wm(s,p,h,u),!1}})}(this,e,n,o,i),this}setNodeMarkup(e,n,o=null,i){return function(s,a,l,c,d){let u=s.doc.nodeAt(a);if(!u)throw new RangeError("No node at given position");l||(l=u.type);let p=l.create(c,null,d||u.marks);if(u.isLeaf)return s.replaceWith(a,a+u.nodeSize,p);if(!l.validContent(u.content))throw new RangeError("Invalid content for node type "+l.name);s.step(new Ke(a,a+u.nodeSize,a+1,a+u.nodeSize-1,new Q(H.from(p),0,0),1,!0))}(this,e,n,o,i),this}setNodeAttribute(e,n,o){return this.step(new Qo(e,n,o)),this}setDocAttribute(e,n){return this.step(new Kr(e,n)),this}addNodeMark(e,n){return this.step(new Mn(e,n)),this}removeNodeMark(e,n){let o=this.doc.nodeAt(e);if(!o)throw new RangeError("No node at position "+e);if(n instanceof xe)n.isInSet(o.marks)&&this.step(new lo(e,n));else{let i,s=o.marks,a=[];for(;i=n.isInSet(s);)a.push(new lo(e,i)),s=i.removeFromSet(s);for(let l=a.length-1;l>=0;l--)this.step(a[l])}return this}split(e,n=1,o){return function(i,s,a=1,l){let c=i.doc.resolve(s),d=H.empty,u=H.empty;for(let p=c.depth,h=c.depth-a,f=a-1;p>h;p--,f--){d=H.from(c.node(p).copy(d));let m=l&&l[f];u=H.from(m?m.type.create(m.attrs,u):c.node(p).copy(u))}i.step(new We(s,s,new Q(d.append(u),a,a),!0))}(this,e,n,o),this}addMark(e,n,o){return function(i,s,a,l){let c,d,u=[],p=[];i.doc.nodesBetween(s,a,(h,f,m)=>{if(!h.isInline)return;let g=h.marks;if(!l.isInSet(g)&&m.type.allowsMarkType(l.type)){let v=Math.max(f,s),b=Math.min(f+h.nodeSize,a),y=l.addToSet(g);for(let k=0;k<g.length;k++)g[k].isInSet(y)||(c&&c.to==v&&c.mark.eq(g[k])?c.to=b:u.push(c=new Lt(v,b,g[k])));d&&d.to==v?d.to=b:p.push(d=new En(v,b,l))}}),u.forEach(h=>i.step(h)),p.forEach(h=>i.step(h))}(this,e,n,o),this}removeMark(e,n,o){return function(i,s,a,l){let c=[],d=0;i.doc.nodesBetween(s,a,(u,p)=>{if(!u.isInline)return;d++;let h=null;if(l instanceof ks){let f,m=u.marks;for(;f=l.isInSet(m);)(h||(h=[])).push(f),m=f.removeFromSet(m)}else l?l.isInSet(u.marks)&&(h=[l]):h=u.marks;if(h&&h.length){let f=Math.min(p+u.nodeSize,a);for(let m=0;m<h.length;m++){let g,v=h[m];for(let b=0;b<c.length;b++){let y=c[b];y.step==d-1&&v.eq(c[b].style)&&(g=y)}g?(g.to=f,g.step=d):c.push({style:v,from:Math.max(p,s),to:f,step:d})}}}),c.forEach(u=>i.step(new Lt(u.from,u.to,u.style)))}(this,e,n,o),this}clearIncompatible(e,n,o){return ac(this,e,n,o),this}}const uc=Object.create(null);class he{constructor(e,n,o){this.$anchor=e,this.$head=n,this.ranges=o||[new Hx(e.min(n),e.max(n))]}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 n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=Q.empty){let o=n.content.lastChild,i=null;for(let l=0;l<n.openEnd;l++)i=o,o=o.lastChild;let s=e.steps.length,a=this.ranges;for(let l=0;l<a.length;l++){let{$from:c,$to:d}=a[l],u=e.mapping.slice(s);e.replaceRange(u.map(c.pos),u.map(d.pos),l?Q.empty:n),l==0&&Vm(e,s,(o?o.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let o=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:l}=i[s],c=e.mapping.slice(o),d=c.map(a.pos),u=c.map(l.pos);s?e.deleteRange(d,u):(e.replaceRangeWith(d,u,n),Vm(e,o,n.isInline?-1:1))}}static findFrom(e,n,o=!1){let i=e.parent.inlineContent?new le(e):Zo(e.node(0),e.parent,e.pos,e.index(),n,o);if(i)return i;for(let s=e.depth-1;s>=0;s--){let a=n<0?Zo(e.node(0),e.node(s),e.before(s+1),e.index(s),n,o):Zo(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,o);if(a)return a}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new kt(e.node(0))}static atStart(e){return Zo(e,e,0,0,1)||new kt(e)}static atEnd(e){return Zo(e,e,e.content.size,e.childCount,-1)||new kt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let o=uc[n.type];if(!o)throw new RangeError(`No selection type ${n.type} defined`);return o.fromJSON(e,n)}static jsonID(e,n){if(e in uc)throw new RangeError("Duplicate use of selection JSON ID "+e);return uc[e]=n,n.prototype.jsonID=e,n}getBookmark(){return le.between(this.$anchor,this.$head).getBookmark()}}he.prototype.visible=!0;class Hx{constructor(e,n){this.$from=e,this.$to=n}}let Om=!1;function _m(t){Om||t.parent.inlineContent||(Om=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class le extends he{constructor(e,n=e){_m(e),_m(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let o=e.resolve(n.map(this.head));if(!o.parent.inlineContent)return he.near(o);let i=e.resolve(n.map(this.anchor));return new le(i.parent.inlineContent?i:o,o)}replace(e,n=Q.empty){if(super.replace(e,n),n==Q.empty){let o=this.$from.marksAcross(this.$to);o&&e.ensureMarks(o)}}eq(e){return e instanceof le&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ss(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new le(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,o=n){let i=e.resolve(n);return new this(i,o==n?i:e.resolve(o))}static between(e,n,o){let i=e.pos-n.pos;if(o&&!i||(o=i>=0?1:-1),!n.parent.inlineContent){let s=he.findFrom(n,o,!0)||he.findFrom(n,-o,!0);if(!s)return he.near(n,o);n=s.$head}return e.parent.inlineContent||(i==0||(e=(he.findFrom(e,-o,!0)||he.findFrom(e,o,!0)).$anchor).pos<n.pos!=i<0)&&(e=n),new le(e,n)}}he.jsonID("text",le);class Ss{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Ss(e.map(this.anchor),e.map(this.head))}resolve(e){return le.between(e.resolve(this.anchor),e.resolve(this.head))}}class re extends he{constructor(e){let n=e.nodeAfter,o=e.node(0).resolve(e.pos+n.nodeSize);super(e,o),this.node=n}map(e,n){let{deleted:o,pos:i}=n.mapResult(this.anchor),s=e.resolve(i);return o?he.near(s):new re(s)}content(){return new Q(H.from(this.node),0,0)}eq(e){return e instanceof re&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new pc(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new re(e.resolve(n.anchor))}static create(e,n){return new re(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}re.prototype.visible=!1,he.jsonID("node",re);class pc{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:o}=e.mapResult(this.anchor);return n?new Ss(o,o):new pc(o)}resolve(e){let n=e.resolve(this.anchor),o=n.nodeAfter;return o&&re.isSelectable(o)?new re(n):he.near(n)}}class kt extends he{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=Q.empty){if(n==Q.empty){e.delete(0,e.doc.content.size);let o=he.atStart(e.doc);o.eq(e.selection)||e.setSelection(o)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new kt(e)}map(e){return new kt(e)}eq(e){return e instanceof kt}getBookmark(){return Wx}}he.jsonID("all",kt);const Wx={map(){return this},resolve:t=>new kt(t)};function Zo(t,e,n,o,i,s=!1){if(e.inlineContent)return le.create(t,n);for(let a=o-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){let l=e.child(a);if(l.isAtom){if(!s&&re.isSelectable(l))return re.create(t,n-(i<0?l.nodeSize:0))}else{let c=Zo(t,l,n+i,i<0?l.childCount:0,i,s);if(c)return c}n+=l.nodeSize*i}return null}function Vm(t,e,n){let o=t.steps.length-1;if(o<e)return;let i,s=t.steps[o];(s instanceof We||s instanceof Ke)&&(t.mapping.maps[o].forEach((a,l,c,d)=>{i==null&&(i=d)}),t.setSelection(he.near(t.doc.resolve(i),n)))}class Kx extends Tm{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.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return xe.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,n){super.addStep(e,n),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,n=!0){let o=this.selection;return n&&(e=e.mark(this.storedMarks||(o.empty?o.$from.marks():o.$from.marksAcross(o.$to)||xe.none))),o.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,o){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(o==null&&(o=n),o=o??n,!e)return this.deleteRange(n,o);let s=this.storedMarks;if(!s){let a=this.doc.resolve(n);s=o==n?a.marks():a.marksAcross(this.doc.resolve(o))}return this.replaceRangeWith(n,o,i.text(e,s)),this.selection.empty||this.setSelection(he.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?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 Dm(t,e){return e&&t?t.bind(e):t}class qr{constructor(e,n,o){this.name=e,this.init=Dm(n.init,o),this.apply=Dm(n.apply,o)}}const Ux=[new qr("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new qr("selection",{init:(t,e)=>t.selection||he.atStart(e.doc),apply:t=>t.selection}),new qr("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,n,o)=>o.selection.$cursor?t.storedMarks:null}),new qr("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})];class hc{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Ux.slice(),n&&n.forEach(o=>{if(this.pluginsByKey[o.key])throw new RangeError("Adding different instances of a keyed plugin ("+o.key+")");this.plugins.push(o),this.pluginsByKey[o.key]=o,o.spec.state&&this.fields.push(new qr(o.key,o.spec.state,o))})}}class er{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,n=-1){for(let o=0;o<this.config.plugins.length;o++)if(o!=n){let i=this.config.plugins[o];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],o=this.applyInner(e),i=null;for(;;){let s=!1;for(let a=0;a<this.config.plugins.length;a++){let l=this.config.plugins[a];if(l.spec.appendTransaction){let c=i?i[a].n:0,d=i?i[a].state:this,u=c<n.length&&l.spec.appendTransaction.call(l,c?n.slice(c):n,d,o);if(u&&o.filterTransaction(u,a)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(let p=0;p<this.config.plugins.length;p++)i.push(p<a?{state:o,n:n.length}:{state:this,n:0})}n.push(u),o=o.applyInner(u),s=!0}i&&(i[a]={state:o,n:n.length})}}if(!s)return{state:o,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new er(this.config),o=this.config.fields;for(let i=0;i<o.length;i++){let s=o[i];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new Kx(this)}static create(e){let n=new hc(e.doc?e.doc.type.schema:e.schema,e.plugins),o=new er(n);for(let i=0;i<n.fields.length;i++)o[n.fields[i].name]=n.fields[i].init(e,o);return o}reconfigure(e){let n=new hc(this.schema,e.plugins),o=n.fields,i=new er(n);for(let s=0;s<o.length;s++){let a=o[s].name;i[a]=this.hasOwnProperty(a)?this[a]:o[s].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(o=>o.toJSON())),e&&typeof e=="object")for(let o in e){if(o=="doc"||o=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[o],s=i.spec.state;s&&s.toJSON&&(n[o]=s.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,o){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new hc(e.schema,e.plugins),s=new er(i);return i.fields.forEach(a=>{if(a.name=="doc")s.doc=Cn.fromJSON(e.schema,n.doc);else if(a.name=="selection")s.selection=he.fromJSON(s.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(o)for(let l in o){let c=o[l],d=c.spec.state;if(c.key==a.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,l))return void(s[a.name]=d.fromJSON.call(c,e,n[l],s))}s[a.name]=a.init(e,s)}}),s}}function Am(t,e,n){for(let o in t){let i=t[o];i instanceof Function?i=i.bind(e):o=="handleDOMEvents"&&(i=Am(i,e,{})),n[o]=i}return n}class Ve{constructor(e){this.spec=e,this.props={},e.props&&Am(e.props,this,this.props),this.key=e.key?e.key.key:Im("plugin")}getState(e){return e[this.key]}}const fc=Object.create(null);function Im(t){return t in fc?t+"$"+ ++fc[t]:(fc[t]=0,t+"$")}class Ue{constructor(e="key"){this.key=Im(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const mc=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Rm(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const Lm=(t,e,n)=>{let o=Rm(t,n);if(!o)return!1;let i=gc(o);if(!i){let a=o.blockRange(),l=a&&Xo(a);return l!=null&&(e&&e(t.tr.lift(a,l).scrollIntoView()),!0)}let s=i.nodeBefore;if(Um(t,i,e,-1))return!0;if(o.parent.content.size==0&&(tr(s,"end")||re.isSelectable(s)))for(let a=o.depth;;a--){let l=Cs(t.doc,o.before(a),o.after(a),Q.empty);if(l&&l.slice.size<l.to-l.from){if(e){let c=t.tr.step(l);c.setSelection(tr(s,"end")?he.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):re.create(c.doc,i.pos-s.nodeSize)),e(c.scrollIntoView())}return!0}if(a==1||o.node(a-1).childCount>1)break}return!(!s.isAtom||i.depth!=o.depth-1||(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),0))};function $m(t,e,n){let o=e.nodeBefore,i=e.pos-1;for(;!o.isTextblock;i--){if(o.type.spec.isolating)return!1;let c=o.lastChild;if(!c)return!1;o=c}let s=e.nodeAfter,a=e.pos+1;for(;!s.isTextblock;a++){if(s.type.spec.isolating)return!1;let c=s.firstChild;if(!c)return!1;s=c}let l=Cs(t.doc,i,a,Q.empty);if(!l||l.from!=i||l instanceof We&&l.slice.size>=a-i)return!1;if(n){let c=t.tr.step(l);c.setSelection(le.create(c.doc,i)),n(c.scrollIntoView())}return!0}function tr(t,e,n=!1){for(let o=t;o;o=e=="start"?o.firstChild:o.lastChild){if(o.isTextblock)return!0;if(n&&o.childCount!=1)return!1}return!1}const Pm=(t,e,n)=>{let{$head:o,empty:i}=t.selection,s=o;if(!i)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):o.parentOffset>0)return!1;s=gc(o)}let a=s&&s.nodeBefore;return!(!a||!re.isSelectable(a)||(e&&e(t.tr.setSelection(re.create(t.doc,s.pos-a.nodeSize)).scrollIntoView()),0))};function gc(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function zm(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const Fm=(t,e,n)=>{let o=zm(t,n);if(!o)return!1;let i=vc(o);if(!i)return!1;let s=i.nodeAfter;if(Um(t,i,e,1))return!0;if(o.parent.content.size==0&&(tr(s,"start")||re.isSelectable(s))){let a=Cs(t.doc,o.before(),o.after(),Q.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(tr(s,"start")?he.findFrom(l.doc.resolve(l.mapping.map(i.pos)),1):re.create(l.doc,l.mapping.map(i.pos))),e(l.scrollIntoView())}return!0}}return!(!s.isAtom||i.depth!=o.depth-1||(e&&e(t.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),0))},jm=(t,e,n)=>{let{$head:o,empty:i}=t.selection,s=o;if(!i)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):o.parentOffset<o.parent.content.size)return!1;s=vc(o)}let a=s&&s.nodeAfter;return!(!a||!re.isSelectable(a)||(e&&e(t.tr.setSelection(re.create(t.doc,s.pos)).scrollIntoView()),0))};function vc(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const Hm=(t,e)=>{let{$head:n,$anchor:o}=t.selection;return!(!n.parent.type.spec.code||!n.sameParent(o)||(e&&e(t.tr.insertText(`
41
+ `).scrollIntoView()),0))};function yc(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const Wm=(t,e)=>{let n=t.selection,{$from:o,$to:i}=n;if(n instanceof kt||o.parent.inlineContent||i.parent.inlineContent)return!1;let s=yc(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let a=(!o.parentOffset&&i.index()<i.parent.childCount?o:i).pos,l=t.tr.insert(a,s.createAndFill());l.setSelection(le.create(l.doc,a+1)),e(l.scrollIntoView())}return!0},Km=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(rn(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let o=n.blockRange(),i=o&&Xo(o);return i!=null&&(e&&e(t.tr.lift(o,i).scrollIntoView()),!0)};function Um(t,e,n,o){let i,s,a=e.nodeBefore,l=e.nodeAfter,c=a.type.spec.isolating||l.type.spec.isolating;if(!c&&function(f,m,g){let v=m.nodeBefore,b=m.nodeAfter,y=m.index();return!(!(v&&b&&v.type.compatibleContent(b.type))||(!v.content.size&&m.parent.canReplace(y-1,y)?(g&&g(f.tr.delete(m.pos-v.nodeSize,m.pos).scrollIntoView()),0):!m.parent.canReplace(y,y+1)||!b.isTextblock&&!Nn(f.doc,m.pos)||(g&&g(f.tr.join(m.pos).scrollIntoView()),0)))}(t,e,n))return!0;let d=!c&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(i=(s=a.contentMatchAt(a.childCount)).findWrapping(l.type))&&s.matchType(i[0]||l.type).validEnd){if(n){let f=e.pos+l.nodeSize,m=H.empty;for(let b=i.length-1;b>=0;b--)m=H.from(i[b].create(null,m));m=H.from(a.copy(m));let g=t.tr.step(new Ke(e.pos-1,f,e.pos,f,new Q(m,1,0),i.length,!0)),v=g.doc.resolve(f+2*i.length);v.nodeAfter&&v.nodeAfter.type==a.type&&Nn(g.doc,v.pos)&&g.join(v.pos),n(g.scrollIntoView())}return!0}let u=l.type.spec.isolating||o>0&&c?null:he.findFrom(e,1),p=u&&u.$from.blockRange(u.$to),h=p&&Xo(p);if(h!=null&&h>=e.depth)return n&&n(t.tr.lift(p,h).scrollIntoView()),!0;if(d&&tr(l,"start",!0)&&tr(a,"end")){let f=a,m=[];for(;m.push(f),!f.isTextblock;)f=f.lastChild;let g=l,v=1;for(;!g.isTextblock;g=g.firstChild)v++;if(f.canReplace(f.childCount,f.childCount,g.content)){if(n){let b=H.empty;for(let y=m.length-1;y>=0;y--)b=H.from(m[y].copy(b));n(t.tr.step(new Ke(e.pos-m.length,e.pos+l.nodeSize,e.pos+v,e.pos+l.nodeSize-v,new Q(b,m.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function qm(t){return function(e,n){let o=e.selection,i=t<0?o.$from:o.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return!!i.node(s).isTextblock&&(n&&n(e.tr.setSelection(le.create(e.doc,t<0?i.start(s):i.end(s)))),!0)}}const qx=qm(-1),Jx=qm(1);function Jm(t,e=null){return function(n,o){let i=!1;for(let s=0;s<n.selection.ranges.length&&!i;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];n.doc.nodesBetween(a,l,(c,d)=>{if(i)return!1;if(c.isTextblock&&!c.hasMarkup(t,e))if(c.type==t)i=!0;else{let u=n.doc.resolve(d),p=u.index();i=u.parent.canReplaceWith(p,p+1,t)}})}if(!i)return!1;if(o){let s=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:l},$to:{pos:c}}=n.selection.ranges[a];s.setBlockType(l,c,t,e)}o(s.scrollIntoView())}return!0}}function bc(...t){return function(e,n,o){for(let i=0;i<t.length;i++)if(t[i](e,n,o))return!0;return!1}}bc(mc,Lm,Pm),bc(mc,Fm,jm),bc(Hm,Wm,Km,(t,e)=>{let{$from:n,$to:o}=t.selection;if(t.selection instanceof re&&t.selection.node.isBlock)return!(!n.parentOffset||!rn(t.doc,n.pos)||(e&&e(t.tr.split(n.pos).scrollIntoView()),0));if(!n.depth)return!1;let i,s,a=[],l=!1,c=!1;for(let h=n.depth;;h--){if(n.node(h).isBlock){l=n.end(h)==n.pos+(n.depth-h),c=n.start(h)==n.pos-(n.depth-h),s=yc(n.node(h-1).contentMatchAt(n.indexAfter(h-1))),a.unshift(l&&s?{type:s}:null),i=h;break}if(h==1)return!1;a.unshift(null)}let d=t.tr;(t.selection instanceof le||t.selection instanceof kt)&&d.deleteSelection();let u=d.mapping.map(n.pos),p=rn(d.doc,u,a.length,a);if(p||(a[0]=s?{type:s}:null,p=rn(d.doc,u,a.length,a)),!p)return!1;if(d.split(u,a.length,a),!l&&c&&n.node(i).type!=s){let h=d.mapping.map(n.before(i)),f=d.doc.resolve(h);s&&n.node(i-1).canReplaceWith(f.index(),f.index()+1,s)&&d.setNodeMarkup(d.mapping.map(n.before(i)),s)}return e&&e(d.scrollIntoView()),!0}),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform();const Ge=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},nr=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let kc=null;const sn=function(t,e,n){let o=kc||(kc=document.createRange());return o.setEnd(t,n??t.nodeValue.length),o.setStart(t,e||0),o},co=function(t,e,n,o){return n&&(Gm(t,e,n,o,-1)||Gm(t,e,n,o,1))},Gx=/^(img|br|input|textarea|hr)$/i;function Gm(t,e,n,o,i){for(var s;;){if(t==n&&e==o)return!0;if(e==(i<0?0:Bt(t))){let a=t.parentNode;if(!a||a.nodeType!=1||Jr(t)||Gx.test(t.nodeName)||t.contentEditable=="false")return!1;e=Ge(t)+(i<0?0:1),t=a}else{if(t.nodeType!=1)return!1;{let a=t.childNodes[e+(i<0?-1:0)];if(a.nodeType==1&&a.contentEditable=="false"){if(!(!((s=a.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection))return!1;e+=i}else t=a,e=i<0?Bt(t):0}}}}function Bt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Jr(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Es=function(t){return t.focusNode&&co(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function uo(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}const Jt=typeof navigator<"u"?navigator:null,Ym=typeof document<"u"?document:null,Bn=Jt&&Jt.userAgent||"",wc=/Edge\/(\d+)/.exec(Bn),Xm=/MSIE \d/.exec(Bn),xc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Bn),dt=!!(Xm||xc||wc),Tn=Xm?document.documentMode:xc?+xc[1]:wc?+wc[1]:0,Tt=!dt&&/gecko\/(\d+)/i.test(Bn);Tt&&(/Firefox\/(\d+)/.exec(Bn)||[0,0])[1];const Cc=!dt&&/Chrome\/(\d+)/.exec(Bn),Ze=!!Cc,Qm=Cc?+Cc[1]:0,ot=!dt&&!!Jt&&/Apple Computer/.test(Jt.vendor),or=ot&&(/Mobile\/\w+/.test(Bn)||!!Jt&&Jt.maxTouchPoints>2),Ot=or||!!Jt&&/Mac/.test(Jt.platform),Yx=!!Jt&&/Win/.test(Jt.platform),an=/Android \d/.test(Bn),Gr=!!Ym&&"webkitFontSmoothing"in Ym.documentElement.style,Xx=Gr?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Qx(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function ln(t,e){return typeof t=="number"?t:t[e]}function Zx(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,o=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*o}}function Zm(t,e,n){let o=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let a=n||t.dom;a;){if(a.nodeType!=1){a=nr(a);continue}let l=a,c=l==s.body,d=c?Qx(s):Zx(l),u=0,p=0;if(e.top<d.top+ln(o,"top")?p=-(d.top-e.top+ln(i,"top")):e.bottom>d.bottom-ln(o,"bottom")&&(p=e.bottom-e.top>d.bottom-d.top?e.top+ln(i,"top")-d.top:e.bottom-d.bottom+ln(i,"bottom")),e.left<d.left+ln(o,"left")?u=-(d.left-e.left+ln(i,"left")):e.right>d.right-ln(o,"right")&&(u=e.right-d.right+ln(i,"right")),u||p)if(c)s.defaultView.scrollBy(u,p);else{let f=l.scrollLeft,m=l.scrollTop;p&&(l.scrollTop+=p),u&&(l.scrollLeft+=u);let g=l.scrollLeft-f,v=l.scrollTop-m;e={left:e.left-g,top:e.top-v,right:e.right-g,bottom:e.bottom-v}}let h=c?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(h))break;a=h=="absolute"?a.offsetParent:nr(a)}}function eg(t){let e=[],n=t.ownerDocument;for(let o=t;o&&(e.push({dom:o,top:o.scrollTop,left:o.scrollLeft}),t!=n);o=nr(o));return e}function tg(t,e){for(let n=0;n<t.length;n++){let{dom:o,top:i,left:s}=t[n];o.scrollTop!=i+e&&(o.scrollTop=i+e),o.scrollLeft!=s&&(o.scrollLeft=s)}}let rr=null;function ng(t,e){let n,o,i,s,a=2e8,l=0,c=e.top,d=e.top;for(let u=t.firstChild,p=0;u;u=u.nextSibling,p++){let h;if(u.nodeType==1)h=u.getClientRects();else{if(u.nodeType!=3)continue;h=sn(u).getClientRects()}for(let f=0;f<h.length;f++){let m=h[f];if(m.top<=c&&m.bottom>=d){c=Math.max(m.bottom,c),d=Math.min(m.top,d);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<a){n=u,a=g,o=g&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&g&&(l=p+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!i&&m.left<=e.left&&m.right>=e.left&&(i=u,s={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(l=p+1)}}return!n&&i&&(n=i,o=s,a=0),n&&n.nodeType==3?function(u,p){let h=u.nodeValue.length,f=document.createRange();for(let m=0;m<h;m++){f.setEnd(u,m+1),f.setStart(u,m);let g=On(f,1);if(g.top!=g.bottom&&Sc(p,g))return{node:u,offset:m+(p.left>=(g.left+g.right)/2?1:0)}}return{node:u,offset:0}}(n,o):!n||a&&n.nodeType==1?{node:t,offset:l}:ng(n,o)}function Sc(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function og(t,e,n){let o=t.childNodes.length;if(o&&n.top<n.bottom)for(let i=Math.max(0,Math.min(o-1,Math.floor(o*(e.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let a=t.childNodes[s];if(a.nodeType==1){let l=a.getClientRects();for(let c=0;c<l.length;c++){let d=l[c];if(Sc(e,d))return og(a,e,d)}}if((s=(s+1)%o)==i)break}return t}function eC(t,e){let n,o=t.dom.ownerDocument,i=0,s=function(d,u,p){if(d.caretPositionFromPoint)try{let h=d.caretPositionFromPoint(u,p);if(h)return{node:h.offsetNode,offset:Math.min(Bt(h.offsetNode),h.offset)}}catch{}if(d.caretRangeFromPoint){let h=d.caretRangeFromPoint(u,p);if(h)return{node:h.startContainer,offset:Math.min(Bt(h.startContainer),h.startOffset)}}}(o,e.left,e.top);s&&({node:n,offset:i}=s);let a,l=(t.root.elementFromPoint?t.root:o).elementFromPoint(e.left,e.top);if(!l||!t.dom.contains(l.nodeType!=1?l.parentNode:l)){let d=t.dom.getBoundingClientRect();if(!Sc(e,d)||(l=og(t.dom,e,d),!l))return null}if(ot)for(let d=l;n&&d;d=nr(d))d.draggable&&(n=void 0);if(l=function(d,u){let p=d.parentNode;return p&&/^li$/i.test(p.nodeName)&&u.left<d.getBoundingClientRect().left?p:d}(l,e),n){if(Tt&&n.nodeType==1&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let u,p=n.childNodes[i];p.nodeName=="IMG"&&(u=p.getBoundingClientRect()).right<=e.left&&u.bottom>e.top&&i++}let d;Gr&&i&&n.nodeType==1&&(d=n.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,n==t.dom&&i==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:i!=0&&n.nodeType==1&&n.childNodes[i-1].nodeName=="BR"||(a=function(u,p,h,f){let m=-1;for(let g=p,v=!1;g!=u.dom;){let b,y=u.docView.nearestDesc(g,!0);if(!y)return null;if(y.dom.nodeType==1&&(y.node.isBlock&&y.parent||!y.contentDOM)&&((b=y.dom.getBoundingClientRect()).width||b.height)&&(y.node.isBlock&&y.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(y.dom.nodeName)&&(!v&&b.left>f.left||b.top>f.top?m=y.posBefore:(!v&&b.right<f.left||b.bottom<f.top)&&(m=y.posAfter),v=!0),!y.contentDOM&&m<0&&!y.node.isText))return(y.node.isBlock?f.top<(b.top+b.bottom)/2:f.left<(b.left+b.right)/2)?y.posBefore:y.posAfter;g=y.dom.parentNode}return m>-1?m:u.docView.posFromDOM(p,h,-1)}(t,n,i,e))}a==null&&(a=function(d,u,p){let{node:h,offset:f}=ng(u,p),m=-1;if(h.nodeType==1&&!h.firstChild){let g=h.getBoundingClientRect();m=g.left!=g.right&&p.left>(g.left+g.right)/2?1:-1}return d.docView.posFromDOM(h,f,m)}(t,l,e));let c=t.docView.nearestDesc(l,!0);return{pos:a,inside:c?c.posAtStart-c.border:-1}}function rg(t){return t.top<t.bottom||t.left<t.right}function On(t,e){let n=t.getClientRects();if(n.length){let o=n[e<0?0:n.length-1];if(rg(o))return o}return Array.prototype.find.call(n,rg)||t.getBoundingClientRect()}const tC=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function ig(t,e,n){let{node:o,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),a=Gr||Tt;if(o.nodeType==3){if(!a||!tC.test(o.nodeValue)&&(n<0?i:i!=o.nodeValue.length)){let l=i,c=i,d=n<0?1:-1;return n<0&&!i?(c++,d=-1):n>=0&&i==o.nodeValue.length?(l--,d=1):n<0?l--:c++,Yr(On(sn(o,l,c),d),d<0)}{let l=On(sn(o,i,i),n);if(Tt&&i&&/\s/.test(o.nodeValue[i-1])&&i<o.nodeValue.length){let c=On(sn(o,i-1,i-1),-1);if(c.top==l.top){let d=On(sn(o,i,i+1),-1);if(d.top!=l.top)return Yr(d,d.left<c.left)}}return l}}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==Bt(o))){let l=o.childNodes[i-1];if(l.nodeType==1)return Ec(l.getBoundingClientRect(),!1)}if(s==null&&i<Bt(o)){let l=o.childNodes[i];if(l.nodeType==1)return Ec(l.getBoundingClientRect(),!0)}return Ec(o.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==Bt(o))){let l=o.childNodes[i-1],c=l.nodeType==3?sn(l,Bt(l)-(a?0:1)):l.nodeType!=1||l.nodeName=="BR"&&l.nextSibling?null:l;if(c)return Yr(On(c,1),!1)}if(s==null&&i<Bt(o)){let l=o.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?sn(l,0,a?0:1):l.nodeType==1?l:null:null;if(c)return Yr(On(c,-1),!0)}return Yr(On(o.nodeType==3?sn(o):o,-n),n>=0)}function Yr(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Ec(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function sg(t,e,n){let o=t.state,i=t.root.activeElement;o!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{o!=e&&t.updateState(o),i!=t.dom&&i&&i.focus()}}const nC=/[\u0590-\u08ac]/;let ag=null,lg=null,cg=!1;class Xr{constructor(e,n,o,i){this.parent=e,this.children=n,this.dom=o,this.contentDOM=i,this.dirty=0,o.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,o){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,o=this.posAtStart;;n++){let i=this.children[n];if(i==e)return o;o+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,o){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode)){if(o<0){let s,a;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&(!(a=s.pmViewDesc)||a.parent!=this);)s=s.previousSibling;return s?this.posBeforeChild(a)+a.size:this.posAtStart}{let s,a;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&(!(a=s.pmViewDesc)||a.parent!=this);)s=s.nextSibling;return s?this.posBeforeChild(a):this.posAtEnd}}let i;if(e==this.dom&&this.contentDOM)i=n>Ge(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??o>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let o=!0,i=e;i;i=i.parentNode){let s,a=this.getDesc(i);if(a&&(!n||a.node)){if(!o||!(s=a.nodeDOM)||(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))return a;o=!1}}}getDesc(e){let n=e.pmViewDesc;for(let o=n;o;o=o.parent)if(o==this)return n}posFromDOM(e,n,o){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,n,o)}return-1}descAt(e){for(let n=0,o=0;n<this.children.length;n++){let i=this.children[n],s=o+i.size;if(o==e&&s!=o){for(;!i.border&&i.children.length;)for(let a=0;a<i.children.length;a++){let l=i.children[a];if(l.size){i=l;break}}return i}if(e<s)return i.descAt(e-o-i.border);o=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let o=0,i=0;for(let s=0;o<this.children.length;o++){let a=this.children[o],l=s+a.size;if(l>e||a instanceof pg){i=e-s;break}s=l}if(i)return this.children[o].domFromPos(i-this.children[o].border,n);for(let s;o&&!(s=this.children[o-1]).size&&s instanceof dg&&s.side>=0;o--);if(n<=0){let s,a=!0;for(;s=o?this.children[o-1]:null,s&&s.dom.parentNode!=this.contentDOM;o--,a=!1);return s&&n&&a&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?Ge(s.dom)+1:0}}{let s,a=!0;for(;s=o<this.children.length?this.children[o]:null,s&&s.dom.parentNode!=this.contentDOM;o++,a=!1);return s&&a&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?Ge(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,o=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let a=o,l=0;;l++){let c=this.children[l],d=a+c.size;if(i==-1&&e<=d){let u=a+c.border;if(e>=u&&n<=d-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,n,u);e=a;for(let p=l;p>0;p--){let h=this.children[p-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=Ge(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(d>n||l==this.children.length-1)){n=d;for(let u=l+1;u<this.children.length;u++){let p=this.children[u];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(-1)){s=Ge(p.dom);break}n+=p.size}s==-1&&(s=this.contentDOM.childNodes.length);break}a=d}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:o}=this.domFromPos(e,0);if(n.nodeType!=1||o==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[o]}setSelection(e,n,o,i=!1){let s=Math.min(e,n),a=Math.max(e,n);for(let f=0,m=0;f<this.children.length;f++){let g=this.children[f],v=m+g.size;if(s>m&&a<v)return g.setSelection(e-m-g.border,n-m-g.border,o,i);m=v}let l=this.domFromPos(e,e?-1:1),c=n==e?l:this.domFromPos(n,n?-1:1),d=o.root.getSelection(),u=o.domSelectionRange(),p=!1;if((Tt||ot)&&e==n){let{node:f,offset:m}=l;if(f.nodeType==3){if(p=!(!m||f.nodeValue[m-1]!=`
42
+ `),p&&m==f.nodeValue.length)for(let g,v=f;v;v=v.parentNode){if(g=v.nextSibling){g.nodeName=="BR"&&(l=c={node:g.parentNode,offset:Ge(g)+1});break}let b=v.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let g=f.childNodes[m-1];p=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(Tt&&u.focusNode&&u.focusNode!=c.node&&u.focusNode.nodeType==1){let f=u.focusNode.childNodes[u.focusOffset];f&&f.contentEditable=="false"&&(i=!0)}if(!(i||p&&ot)&&co(l.node,l.offset,u.anchorNode,u.anchorOffset)&&co(c.node,c.offset,u.focusNode,u.focusOffset))return;let h=!1;if((d.extend||e==n)&&(!p||!Tt)){d.collapse(l.node,l.offset);try{e!=n&&d.extend(c.node,c.offset),h=!0}catch{}}if(!h){if(e>n){let m=l;l=c,c=m}let f=document.createRange();f.setEnd(c.node,c.offset),f.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let o=0,i=0;i<this.children.length;i++){let s=this.children[i],a=o+s.size;if(o==a?e<=a&&n>=o:e<a&&n>o){let l=o+s.border,c=a-s.border;if(e>=l&&n<=c)return this.dirty=e==o||n==a?2:1,void(e!=l||n!=c||!s.contentLost&&s.dom.parentNode==this.contentDOM?s.markDirty(e-l,n-l):s.dirty=3);s.dirty=s.dom!=s.contentDOM||s.dom.parentNode!=this.contentDOM||s.children.length?3:2}o=a}this.dirty=2}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let o=e==1?2:1;n.dirty<o&&(n.dirty=o)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class dg extends Xr{constructor(e,n,o,i){let s,a=n.type.toDOM;if(typeof a=="function"&&(a=a(o,()=>s?s.parent?s.parent.posBeforeChild(s):void 0:i)),!n.type.spec.raw){if(a.nodeType!=1){let l=document.createElement("span");l.appendChild(a),a=l}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(e,[],a,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==0&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return!!n&&n(e)}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class oC extends Xr{constructor(e,n,o,i){super(e,[],n,null),this.textDOM=o,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class po extends Xr{constructor(e,n,o,i,s){super(e,[],o,i),this.mark=n,this.spec=s}static create(e,n,o,i){let s=i.nodeViews[n.type.name],a=s&&s(n,i,o);return a&&a.dom||(a=ao.renderSpec(document,n.type.spec.toDOM(n,o),null,n.attrs)),new po(e,n,a.dom,a.contentDOM||a.dom,a)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=3&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=0){let o=this.parent;for(;!o.node;)o=o.parent;o.dirty<this.dirty&&(o.dirty=this.dirty),this.dirty=0}}slice(e,n,o){let i=po.create(this.parent,this.mark,!0,o),s=this.children,a=this.size;n<a&&(s=Nc(s,n,a,o)),e>0&&(s=Nc(s,0,e,o));for(let l=0;l<s.length;l++)s[l].parent=i;return i.children=s,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class _n extends Xr{constructor(e,n,o,i,s,a,l,c,d){super(e,[],s,a),this.node=n,this.outerDeco=o,this.innerDeco=i,this.nodeDOM=l}static create(e,n,o,i,s,a){let l,c=s.nodeViews[n.type.name],d=c&&c(n,s,()=>l?l.parent?l.parent.posBeforeChild(l):void 0:a,o,i),u=d&&d.dom,p=d&&d.contentDOM;if(n.isText)if(u){if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u=document.createTextNode(n.text);else u||({dom:u,contentDOM:p}=ao.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));p||n.isText||u.nodeName=="BR"||(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let h=u;return u=mg(u,o,n),d?l=new rC(e,n,o,i,u,p||null,h,d,s,a+1):n.isText?new Ms(e,n,o,i,u,h,s):new _n(e,n,o,i,u,p||null,h,s,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let n=this.children.length-1;n>=0;n--){let o=this.children[n];if(this.dom.contains(o.dom.parentNode)){e.contentElement=o.dom.parentNode;break}}e.contentElement||(e.getContent=()=>H.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,n,o){return this.dirty==0&&e.eq(this.node)&&Ns(n,this.outerDeco)&&o.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let o=this.node.inlineContent,i=n,s=e.composing?this.localCompositionInfo(e,n):null,a=s&&s.pos>-1?s:null,l=s&&s.pos<0,c=new sC(this,a&&a.node,e);(function(d,u,p,h){let f=u.locals(d),m=0;if(f.length==0){for(let y=0;y<d.childCount;y++){let k=d.child(y);h(k,f,u.forChild(m,k),y),m+=k.nodeSize}return}let g=0,v=[],b=null;for(let y=0;;){let k,x,w,C;for(;g<f.length&&f[g].to==m;){let E=f[g++];E.widget&&(k?(x||(x=[k])).push(E):k=E)}if(k)if(x){x.sort(aC);for(let E=0;E<x.length;E++)p(x[E],y,!!b)}else p(k,y,!!b);if(b)C=-1,w=b,b=null;else{if(!(y<d.childCount))break;C=y,w=d.child(y++)}for(let E=0;E<v.length;E++)v[E].to<=m&&v.splice(E--,1);for(;g<f.length&&f[g].from<=m&&f[g].to>m;)v.push(f[g++]);let S=m+w.nodeSize;if(w.isText){let E=S;g<f.length&&f[g].from<E&&(E=f[g].from);for(let M=0;M<v.length;M++)v[M].to<E&&(E=v[M].to);E<S&&(b=w.cut(E-m),w=w.cut(0,E-m),S=E,C=-1)}else for(;g<f.length&&f[g].to<S;)g++;h(w,w.isInline&&!w.isLeaf?v.filter(E=>!E.inline):v.slice(),u.forChild(m,w),C),m=S}})(this.node,this.innerDeco,(d,u,p)=>{d.spec.marks?c.syncToMarks(d.spec.marks,o,e):d.type.side>=0&&!p&&c.syncToMarks(u==this.node.childCount?xe.none:this.node.child(u).marks,o,e),c.placeWidget(d,e,i)},(d,u,p,h)=>{let f;c.syncToMarks(d.marks,o,e),c.findNodeMatch(d,u,p,h)||l&&e.state.selection.from>i&&e.state.selection.to<i+d.nodeSize&&(f=c.findIndexWithChild(s.node))>-1&&c.updateNodeAt(d,u,p,f,e)||c.updateNextNode(d,u,p,e,h,i)||c.addNode(d,u,p,e,i),i+=d.nodeSize}),c.syncToMarks([],o,e),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==2)&&(a&&this.protectLocalComposition(e,a),hg(this.contentDOM,this.children,e),or&&function(d){if(d.nodeName=="UL"||d.nodeName=="OL"){let u=d.style.cssText;d.style.cssText=u+"; list-style: square !important",window.getComputedStyle(d).listStyle,d.style.cssText=u}}(this.dom))}localCompositionInfo(e,n){let{from:o,to:i}=e.state.selection;if(!(e.state.selection instanceof le)||o<n||i>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,l=function(c,d,u,p){for(let h=0,f=0;h<c.childCount&&f<=p;){let m=c.child(h++),g=f;if(f+=m.nodeSize,!m.isText)continue;let v=m.text;for(;h<c.childCount;){let b=c.child(h++);if(f+=b.nodeSize,!b.isText)break;v+=b.text}if(f>=u){if(f>=p&&v.slice(p-d.length-g,p-g)==d)return p-d.length;let b=g<p?v.lastIndexOf(d,p-g-1):-1;if(b>=0&&b+d.length+g>=u)return g+b;if(u==p&&v.length>=p+d.length-g&&v.slice(p-g,p-g+d.length)==d)return p}}return-1}(this.node.content,a,o-n,i-n);return l<0?null:{node:s,pos:l,text:a}}return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:o,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let a=new oC(this,s,n,i);e.input.compositionNodes.push(a),this.children=Nc(this.children,o,o+i.length,e,a)}update(e,n,o,i){return!(this.dirty==3||!e.sameMarkup(this.node)||(this.updateInner(e,n,o,i),0))}updateInner(e,n,o,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=o,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(Ns(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,o=this.dom;this.dom=fg(this.dom,this.nodeDOM,Mc(this.outerDeco,this.node,n),Mc(e,this.node,n)),this.dom!=o&&(o.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function ug(t,e,n,o,i){mg(o,e,t);let s=new _n(void 0,t,e,n,o,o,o,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class Ms extends _n{constructor(e,n,o,i,s,a,l){super(e,n,o,i,s,null,a,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,o,i){return!(this.dirty==3||this.dirty!=0&&!this.inParent()||!e.sameMarkup(this.node)||(this.updateOuterDeco(n),this.dirty==0&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=0,0))}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,o){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,o)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,o){let i=this.node.cut(e,n),s=document.createTextNode(i.text);return new Ms(this.parent,i,this.outerDeco,this.innerDeco,s,s,o)}markDirty(e,n){super.markDirty(e,n),this.dom==this.nodeDOM||e!=0&&n!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class pg extends Xr{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==0&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class rC extends _n{constructor(e,n,o,i,s,a,l,c,d,u){super(e,n,o,i,s,a,l,d,u),this.spec=c}update(e,n,o,i){if(this.dirty==3)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,o);return s&&this.updateInner(e,n,o,i),s}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,n,o,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,o,i){this.spec.setSelection?this.spec.setSelection(e,n,o.root):super.setSelection(e,n,o,i)}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 hg(t,e,n){let o=t.firstChild,i=!1;for(let s=0;s<e.length;s++){let a=e[s],l=a.dom;if(l.parentNode==t){for(;l!=o;)o=gg(o),i=!0;o=o.nextSibling}else i=!0,t.insertBefore(l,o);if(a instanceof po){let c=o?o.previousSibling:t.lastChild;hg(a.contentDOM,a.children,n),o=c?c.nextSibling:t.firstChild}}for(;o;)o=gg(o),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const Qr=function(t){t&&(this.nodeName=t)};Qr.prototype=Object.create(null);const ho=[new Qr];function Mc(t,e,n){if(t.length==0)return ho;let o=n?ho[0]:new Qr,i=[o];for(let s=0;s<t.length;s++){let a=t[s].type.attrs;if(a){a.nodeName&&i.push(o=new Qr(a.nodeName));for(let l in a){let c=a[l];c!=null&&(n&&i.length==1&&i.push(o=new Qr(e.isInline?"span":"div")),l=="class"?o.class=(o.class?o.class+" ":"")+c:l=="style"?o.style=(o.style?o.style+";":"")+c:l!="nodeName"&&(o[l]=c))}}}return i}function fg(t,e,n,o){if(n==ho&&o==ho)return e;let i=e;for(let s=0;s<o.length;s++){let a=o[s],l=n[s];if(s){let c;l&&l.nodeName==a.nodeName&&i!=t&&(c=i.parentNode)&&c.nodeName.toLowerCase()==a.nodeName||(c=document.createElement(a.nodeName),c.pmIsDeco=!0,c.appendChild(i),l=ho[0]),i=c}iC(i,l||ho[0],a)}return i}function iC(t,e,n){for(let o in e)o=="class"||o=="style"||o=="nodeName"||o in n||t.removeAttribute(o);for(let o in n)o!="class"&&o!="style"&&o!="nodeName"&&n[o]!=e[o]&&t.setAttribute(o,n[o]);if(e.class!=n.class){let o=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<o.length;s++)i.indexOf(o[s])==-1&&t.classList.remove(o[s]);for(let s=0;s<i.length;s++)o.indexOf(i[s])==-1&&t.classList.add(i[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let o,i=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;o=i.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function mg(t,e,n){return fg(t,t,ho,Mc(e,n,t.nodeType!=1))}function Ns(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function gg(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class sC{constructor(e,n,o){this.lock=n,this.view=o,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(i,s){let a=s,l=a.children.length,c=i.childCount,d=new Map,u=[];e:for(;c>0;){let p;for(;;)if(l){let f=a.children[l-1];if(!(f instanceof po)){p=f,l--;break}a=f,l=f.children.length}else{if(a==s)break e;l=a.parent.children.indexOf(a),a=a.parent}let h=p.node;if(h){if(h!=i.child(c-1))break;--c,d.set(p,c),u.push(p)}}return{index:c,matched:d,matches:u.reverse()}}(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let o=e;o<n;o++)this.top.children[o].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,o){let i=0,s=this.stack.length>>1,a=Math.min(s,e.length);for(;i<a&&(i==s-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<s;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let l=-1;for(let c=this.index;c<Math.min(this.index+3,this.top.children.length);c++){let d=this.top.children[c];if(d.matchesMark(e[s])&&!this.isLocked(d.dom)){l=c;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let c=po.create(this.top,e[s],n,o);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,s++}}findNodeMatch(e,n,o,i){let s,a=-1;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,o))a=this.top.children.indexOf(s,this.index);else for(let l=this.index,c=Math.min(this.top.children.length,l+5);l<c;l++){let d=this.top.children[l];if(d.matchesNode(e,n,o)&&!this.preMatch.matched.has(d)){a=l;break}}return!(a<0||(this.destroyBetween(this.index,a),this.index++,0))}updateNodeAt(e,n,o,i,s){let a=this.top.children[i];return a.dirty==3&&a.dom==a.contentDOM&&(a.dirty=2),!!a.update(e,n,o,s)&&(this.destroyBetween(this.index,i),this.index++,!0)}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let o=e.pmViewDesc;if(o){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==o)return i}return-1}e=n}}updateNextNode(e,n,o,i,s,a){for(let l=this.index;l<this.top.children.length;l++){let c=this.top.children[l];if(c instanceof _n){let d=this.preMatch.matched.get(c);if(d!=null&&d!=s)return!1;let u,p=c.dom,h=this.isLocked(p)&&!(e.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==e.text&&c.dirty!=3&&Ns(n,c.outerDeco));if(!h&&c.update(e,n,o,i))return this.destroyBetween(this.index,l),c.dom!=p&&(this.changed=!0),this.index++,!0;if(!h&&(u=this.recreateWrapper(c,e,n,o,i,a)))return this.destroyBetween(this.index,l),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=2,u.updateChildren(i,a+1),u.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,o,i,s,a){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!Ns(o,e.outerDeco)||!i.eq(e.innerDeco))return null;let l=_n.create(this.top,n,o,i,s,a);if(l.contentDOM){l.children=e.children,e.children=[];for(let c of l.children)c.parent=l}return e.destroy(),l}addNode(e,n,o,i,s){let a=_n.create(this.top,e,n,o,i,s);a.contentDOM&&a.updateChildren(i,s+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,n,o){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(!i||!i.matchesWidget(e)||e!=i.widget&&i.widget.type.toDOM.parentNode){let s=new dg(this.top,e,n,o);this.top.children.splice(this.index++,0,s),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof po;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Ms)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((ot||Ze)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let o=document.createElement(e);e=="IMG"&&(o.className="ProseMirror-separator",o.alt=""),e=="BR"&&(o.className="ProseMirror-trailingBreak");let i=new pg(this.top,[],o,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function aC(t,e){return t.type.side-e.type.side}function Nc(t,e,n,o,i){let s=[];for(let a=0,l=0;a<t.length;a++){let c=t[a],d=l,u=l+=c.size;d>=n||u<=e?s.push(c):(d<e&&s.push(c.slice(0,e-d,o)),i&&(s.push(i),i=void 0),u>n&&s.push(c.slice(n-d,c.size,o)))}return s}function Bc(t,e=null){let n=t.domSelectionRange(),o=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),s=i&&i.size==0,a=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let l,c,d=o.resolve(a);if(Es(n)){for(l=a;i&&!i.node;)i=i.parent;let p=i.node;if(i&&p.isAtom&&re.isSelectable(p)&&i.parent&&(!p.isInline||!function(h,f,m){for(let g=f==0,v=f==Bt(h);g||v;){if(h==m)return!0;let b=Ge(h);if(!(h=h.parentNode))return!1;g=g&&b==0,v=v&&b==Bt(h)}}(n.focusNode,n.focusOffset,i.dom))){let h=i.posBefore;c=new re(a==h?d:o.resolve(h))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let p=a,h=a;for(let f=0;f<n.rangeCount;f++){let m=n.getRangeAt(f);p=Math.min(p,t.docView.posFromDOM(m.startContainer,m.startOffset,1)),h=Math.max(h,t.docView.posFromDOM(m.endContainer,m.endOffset,-1))}if(p<0)return null;[l,a]=h==t.state.selection.anchor?[h,p]:[p,h],d=o.resolve(a)}else l=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let u=o.resolve(l);return c||(c=Oc(t,u,d,e=="pointer"||t.state.selection.head<d.pos&&!s?1:-1)),c}function vg(t){return t.editable?t.hasFocus():Sg(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function cn(t,e=!1){let n=t.state.selection;if(wg(t,n),vg(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Ze){let o=t.domSelectionRange(),i=t.domObserver.currentSelection;if(o.anchorNode&&i.anchorNode&&co(o.anchorNode,o.anchorOffset,i.anchorNode,i.anchorOffset))return t.input.mouseDown.delayedSelectionSync=!0,void t.domObserver.setCurSelection()}if(t.domObserver.disconnectSelection(),t.cursorWrapper)(function(o){let i=o.domSelection();if(!i)return;let s=o.cursorWrapper.dom,a=s.nodeName=="IMG";a?i.collapse(s.parentNode,Ge(s)+1):i.collapse(s,0),!a&&!o.state.selection.visible&&dt&&Tn<=11&&(s.disabled=!0,s.disabled=!1)})(t);else{let o,i,{anchor:s,head:a}=n;!yg||n instanceof le||(n.$from.parent.inlineContent||(o=bg(t,n.from)),n.empty||n.$from.parent.inlineContent||(i=bg(t,n.to))),t.docView.setSelection(s,a,t,e),yg&&(o&&kg(o),i&&kg(i)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(l){let c=l.dom.ownerDocument;c.removeEventListener("selectionchange",l.input.hideSelectionGuard);let d=l.domSelectionRange(),u=d.anchorNode,p=d.anchorOffset;c.addEventListener("selectionchange",l.input.hideSelectionGuard=()=>{d.anchorNode==u&&d.anchorOffset==p||(c.removeEventListener("selectionchange",l.input.hideSelectionGuard),setTimeout(()=>{vg(l)&&!l.state.selection.visible||l.dom.classList.remove("ProseMirror-hideselection")},20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const yg=ot||Ze&&Qm<63;function bg(t,e){let{node:n,offset:o}=t.docView.domFromPos(e,0),i=o<n.childNodes.length?n.childNodes[o]:null,s=o?n.childNodes[o-1]:null;if(ot&&i&&i.contentEditable=="false")return Tc(i);if(!(i&&i.contentEditable!="false"||s&&s.contentEditable!="false")){if(i)return Tc(i);if(s)return Tc(s)}}function Tc(t){return t.contentEditable="true",ot&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function kg(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function wg(t,e){if(e instanceof re){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(xg(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else xg(t)}function xg(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function Oc(t,e,n,o){return t.someProp("createSelectionBetween",i=>i(t,e,n))||le.between(e,n,o)}function Cg(t){return!(t.editable&&!t.hasFocus())&&Sg(t)}function Sg(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function _c(t,e){let{$anchor:n,$head:o}=t.selection,i=e>0?n.max(o):n.min(o),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&he.findFrom(s,e)}function Vn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Eg(t,e,n){let o=t.state.selection;if(!(o instanceof le)){if(o instanceof re&&o.node.isInline)return Vn(t,new le(e>0?o.$to:o.$from));{let i=_c(t.state,e);return!!i&&Vn(t,i)}}if(n.indexOf("s")>-1){let{$head:i}=o,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let a=t.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return Vn(t,new le(o.$anchor,a))}if(!o.empty)return!1;if(t.endOfTextblock(e>0?"forward":"backward")){let i=_c(t.state,e);return!!(i&&i instanceof re)&&Vn(t,i)}if(!(Ot&&n.indexOf("m")>-1)){let i,s=o.$head,a=s.textOffset?null:e<0?s.nodeBefore:s.nodeAfter;if(!a||a.isText)return!1;let l=e<0?s.pos-a.nodeSize:s.pos;return!!(a.isAtom||(i=t.docView.descAt(l))&&!i.contentDOM)&&(re.isSelectable(a)?Vn(t,new re(e<0?t.state.doc.resolve(s.pos-a.nodeSize):s)):!!Gr&&Vn(t,new le(t.state.doc.resolve(e<0?l:l+a.nodeSize))))}}function Bs(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Zr(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function ir(t,e){return e<0?function(n){let o=n.domSelectionRange(),i=o.focusNode,s=o.focusOffset;if(!i)return;let a,l,c=!1;for(Tt&&i.nodeType==1&&s<Bs(i)&&Zr(i.childNodes[s],-1)&&(c=!0);;)if(s>0){if(i.nodeType!=1)break;{let d=i.childNodes[s-1];if(Zr(d,-1))a=i,l=--s;else{if(d.nodeType!=3)break;i=d,s=i.nodeValue.length}}}else{if(Mg(i))break;{let d=i.previousSibling;for(;d&&Zr(d,-1);)a=i.parentNode,l=Ge(d),d=d.previousSibling;if(d)i=d,s=Bs(i);else{if(i=i.parentNode,i==n.dom)break;s=0}}}c?Vc(n,i,s):a&&Vc(n,a,l)}(t):function(n){let o=n.domSelectionRange(),i=o.focusNode,s=o.focusOffset;if(!i)return;let a,l,c=Bs(i);for(;;)if(s<c){if(i.nodeType!=1||!Zr(i.childNodes[s],1))break;a=i,l=++s}else{if(Mg(i))break;{let d=i.nextSibling;for(;d&&Zr(d,1);)a=d.parentNode,l=Ge(d)+1,d=d.nextSibling;if(d)i=d,s=0,c=Bs(i);else{if(i=i.parentNode,i==n.dom)break;s=c=0}}}a&&Vc(n,a,l)}(t)}function Mg(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Vc(t,e,n){if(e.nodeType!=3){let s,a;(a=function(l,c){for(;l&&c==l.childNodes.length&&!Jr(l);)c=Ge(l)+1,l=l.parentNode;for(;l&&c<l.childNodes.length;){let d=l.childNodes[c];if(d.nodeType==3)return d;if(d.nodeType==1&&d.contentEditable=="false")break;l=d,c=0}}(e,n))?(e=a,n=0):(s=function(l,c){for(;l&&!c&&!Jr(l);)c=Ge(l),l=l.parentNode;for(;l&&c;){let d=l.childNodes[c-1];if(d.nodeType==3)return d;if(d.nodeType==1&&d.contentEditable=="false")break;c=(l=d).childNodes.length}}(e,n))&&(e=s,n=s.nodeValue.length)}let o=t.domSelection();if(!o)return;if(Es(o)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),o.removeAllRanges(),o.addRange(s)}else o.extend&&o.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&cn(t)},50)}function Ng(t,e){let n=t.state.doc.resolve(e);if(!Ze&&!Yx&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let i=t.coordsAtPos(e-1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left<o.left?"ltr":"rtl"}if(e<n.end()){let i=t.coordsAtPos(e+1),s=(i.top+i.bottom)/2;if(s>o.top&&s<o.bottom&&Math.abs(i.left-o.left)>1)return i.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Bg(t,e,n){let o=t.state.selection;if(o instanceof le&&!o.empty||n.indexOf("s")>-1||Ot&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=o;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let a=_c(t.state,e);if(a&&a instanceof re)return Vn(t,a)}if(!i.parent.inlineContent){let a=e<0?i:s,l=o instanceof kt?he.near(a,e):he.findFrom(a,e);return!!l&&Vn(t,l)}return!1}function Tg(t,e){if(!(t.state.selection instanceof le))return!0;let{$head:n,$anchor:o,empty:i}=t.state.selection;if(!n.sameParent(o))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let a=t.state.tr;return e<0?a.delete(n.pos-s.nodeSize,n.pos):a.delete(n.pos,n.pos+s.nodeSize),t.dispatch(a),!0}return!1}function Og(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Dc(t,e){t.someProp("transformCopied",h=>{e=h(e,t)});let n=[],{content:o,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&o.childCount==1&&o.firstChild.childCount==1;){i--,s--;let h=o.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),o=h.content}let a=t.someProp("clipboardSerializer")||ao.fromSchema(t.state.schema),l=$g(),c=l.createElement("div");c.appendChild(a.serializeFragment(o,{document:l}));let d,u=c.firstChild,p=0;for(;u&&u.nodeType==1&&(d=Rg[u.nodeName.toLowerCase()]);){for(let h=d.length-1;h>=0;h--){let f=l.createElement(d[h]);for(;c.firstChild;)f.appendChild(c.firstChild);c.appendChild(f),p++}u=c.firstChild}return u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${s}${p?` -${p}`:""} ${JSON.stringify(n)}`),{dom:c,text:t.someProp("clipboardTextSerializer",h=>h(e,t))||e.content.textBetween(0,e.content.size,`
43
43
 
44
44
  `),slice:e}}function _g(t,e,n,o,i){let s,a,l=i.parent.type.spec.code;if(!n&&!e)return null;let c=!!e&&(o||l||!n);if(c){if(t.someProp("transformPastedText",h=>{e=h(e,l||o,t)}),l)return a=new Q(H.from(t.state.schema.text(e.replace(/\r\n?/g,`
45
- `))),0,0),t.someProp("transformPasted",h=>{a=h(a,t,!0)}),a;let p=t.someProp("clipboardTextParser",h=>h(e,i,o,t));if(p)a=p;else{let h=i.marks(),{schema:f}=t.state,m=ao.fromSchema(f);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let v=s.appendChild(document.createElement("p"));g&&v.appendChild(m.serializeNode(f.text(g,h)))})}}else t.someProp("transformPastedHTML",p=>{n=p(n,t)}),s=function(p){let h=/^(\s*<meta [^>]*>)*/.exec(p);h&&(p=p.slice(h[0].length));let f,m=$g().createElement("div"),g=/<([a-z][^>\s]+)/i.exec(p);if((f=g&&Rg[g[1].toLowerCase()])&&(p=f.map(v=>"<"+v+">").join("")+p+f.map(v=>"</"+v+">").reverse().join("")),m.innerHTML=function(v){let b=window.trustedTypes;return b?(Ic||(Ic=b.defaultPolicy||b.createPolicy("ProseMirrorClipboard",{createHTML:y=>y})),Ic.createHTML(v)):v}(p),f)for(let v=0;v<f.length;v++)m=m.querySelector(f[v])||m;return m}(n),Gr&&function(p){let h=p.querySelectorAll(Ze?"span:not([class]):not([style])":"span.Apple-converted-space");for(let f=0;f<h.length;f++){let m=h[f];m.childNodes.length==1&&m.textContent==" "&&m.parentNode&&m.parentNode.replaceChild(p.ownerDocument.createTextNode(" "),m)}}(s);let d=s&&s.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let p=+u[3];p>0;p--){let h=s.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;s=h}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Sn.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!(!c&&!u),context:i,ruleFromNode:h=>h.nodeName!="BR"||h.nextSibling||!h.parentNode||aC.test(h.parentNode.nodeName)?null:{ignore:!0}})),u)a=function(p,h){if(!p.size)return p;let f,m=p.content.firstChild.type.schema;try{f=JSON.parse(h)}catch{return p}let{content:g,openStart:v,openEnd:b}=p;for(let y=f.length-2;y>=0;y-=2){let k=m.nodes[f[y]];if(!k||k.hasRequiredAttrs())break;g=H.from(k.create(f[y+1],g)),v++,b++}return new Q(g,v,b)}(Ig(a,+u[1],+u[2]),u[4]);else if(a=Q.maxOpen(function(p,h){if(p.childCount<2)return p;for(let f=h.depth;f>=0;f--){let m,g=h.node(f).contentMatchAt(h.index(f)),v=[];if(p.forEach(b=>{if(!v)return;let y,k=g.findWrapping(b.type);if(!k)return v=null;if(y=v.length&&m.length&&Ag(k,m,b,v[v.length-1],0))v[v.length-1]=y;else{v.length&&(v[v.length-1]=Dg(v[v.length-1],m.length));let x=Vg(b,k);v.push(x),g=g.matchType(x.type),m=k}}),v)return H.from(v)}return p}(a.content,i),!0),a.openStart||a.openEnd){let p=0,h=0;for(let f=a.content.firstChild;p<a.openStart&&!f.type.spec.isolating;p++,f=f.firstChild);for(let f=a.content.lastChild;h<a.openEnd&&!f.type.spec.isolating;h++,f=f.lastChild);a=Ig(a,p,h)}return t.someProp("transformPasted",p=>{a=p(a,t,c)}),a}const aC=/^(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 Vg(t,e,n=0){for(let o=e.length-1;o>=n;o--)t=e[o].create(null,H.from(t));return t}function Ag(t,e,n,o,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=Ag(t,e,n,o.lastChild,i+1);if(s)return o.copy(o.content.replaceChild(o.childCount-1,s));if(o.contentMatchAt(o.childCount).matchType(i==t.length-1?n.type:t[i+1]))return o.copy(o.content.append(H.from(Vg(n,t,i+1))))}}function Dg(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Dg(t.lastChild,e-1)),o=t.contentMatchAt(t.childCount).fillBefore(H.empty,!0);return t.copy(n.append(o))}function Dc(t,e,n,o,i,s){let a=e<0?t.firstChild:t.lastChild,l=a.content;return t.childCount>1&&(s=0),i<o-1&&(l=Dc(l,e,n,o,i+1,s)),i>=n&&(l=e<0?a.contentMatchAt(0).fillBefore(l,s<=i).append(l):l.append(a.contentMatchAt(a.childCount).fillBefore(H.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(l))}function Ig(t,e,n){return e<t.openStart&&(t=new Q(Dc(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new Q(Dc(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Rg={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Lg=null;function $g(){return Lg||(Lg=document.implementation.createHTMLDocument("title"))}let Ic=null;const rt={},it={},lC={touchstart:!0,touchmove:!0};class cC{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function An(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function Rc(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=o=>Lc(t,o))})}function Lc(t,e){return t.someProp("handleDOMEvents",n=>{let o=n[e.type];return!!o&&(o(t,e)||e.defaultPrevented)})}function dC(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function Ts(t){return{left:t.clientX,top:t.clientY}}function $c(t,e,n,o,i){if(o==-1)return!1;let s=t.state.doc.resolve(o);for(let a=s.depth+1;a>0;a--)if(t.someProp(e,l=>a>s.depth?l(t,n,s.nodeAfter,s.before(a),i,!0):l(t,n,s.node(a),s.before(a),i,!1)))return!0;return!1}function sr(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let o=t.state.tr.setSelection(e);o.setMeta("pointer",!0),t.dispatch(o)}function uC(t,e,n,o){return $c(t,"handleDoubleClickOn",e,n,o)||t.someProp("handleDoubleClick",i=>i(t,e,o))}function pC(t,e,n,o){return $c(t,"handleTripleClickOn",e,n,o)||t.someProp("handleTripleClick",i=>i(t,e,o))||function(i,s,a){if(a.button!=0)return!1;let l=i.state.doc;if(s==-1)return!!l.inlineContent&&(sr(i,le.create(l,0,l.content.size)),!0);let c=l.resolve(s);for(let d=c.depth+1;d>0;d--){let u=d>c.depth?c.nodeAfter:c.node(d),p=c.before(d);if(u.inlineContent)sr(i,le.create(l,p+1,p+1+u.content.size));else{if(!re.isSelectable(u))continue;sr(i,re.create(l,p))}return!0}}(t,n,o)}function Pc(t){return Os(t)}it.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!zg(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!an||!Ze||n.keyCode!=13))if(n.keyCode!=229&&t.domObserver.forceFlush(),!or||n.keyCode!=13||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",o=>o(t,n))||function(o,i){let s=i.keyCode,a=function(l){let c="";return l.ctrlKey&&(c+="c"),l.metaKey&&(c+="m"),l.altKey&&(c+="a"),l.shiftKey&&(c+="s"),c}(i);if(s==8||Ot&&s==72&&a=="c")return Tg(o,-1)||ir(o,-1);if(s==46&&!i.shiftKey||Ot&&s==68&&a=="c")return Tg(o,1)||ir(o,1);if(s==13||s==27)return!0;if(s==37||Ot&&s==66&&a=="c"){let l=s==37?Ng(o,o.state.selection.from)=="ltr"?-1:1:-1;return Eg(o,l,a)||ir(o,l)}if(s==39||Ot&&s==70&&a=="c"){let l=s==39?Ng(o,o.state.selection.from)=="ltr"?1:-1:1;return Eg(o,l,a)||ir(o,l)}return s==38||Ot&&s==80&&a=="c"?Bg(o,-1,a)||ir(o,-1):s==40||Ot&&s==78&&a=="c"?function(l){if(!ot||l.state.selection.$head.parentOffset>0)return!1;let{focusNode:c,focusOffset:d}=l.domSelectionRange();if(c&&c.nodeType==1&&d==0&&c.firstChild&&c.firstChild.contentEditable=="false"){let u=c.firstChild;Og(l,u,"true"),setTimeout(()=>Og(l,u,"false"),20)}return!1}(o)||Bg(o,1,a)||ir(o,1):a==(Ot?"m":"c")&&(s==66||s==73||s==89||s==90)}(t,n)?n.preventDefault():An(t,"key");else{let o=Date.now();t.input.lastIOSEnter=o,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==o&&(t.someProp("handleKeyDown",i=>i(t,uo(13,"Enter"))),t.input.lastIOSEnter=0)},200)}},it.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},it.keypress=(t,e)=>{let n=e;if(zg(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Ot&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n)))return void n.preventDefault();let o=t.state.selection;if(!(o instanceof le&&o.$from.sameParent(o.$to))){let i=String.fromCharCode(n.charCode),s=()=>t.state.tr.insertText(i).scrollIntoView();/[\r\n]/.test(i)||t.someProp("handleTextInput",a=>a(t,o.$from.pos,o.$to.pos,i,s))||t.dispatch(s()),n.preventDefault()}};const Pg=Ot?"metaKey":"ctrlKey";rt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let o=Pc(t),i=Date.now(),s="singleClick";i-t.input.lastClick.time<500&&function(l,c){let d=c.x-l.clientX,u=c.y-l.clientY;return d*d+u*u<100}(n,t.input.lastClick)&&!n[Pg]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s,button:n.button};let a=t.posAtCoords(Ts(n));a&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new hC(t,a,n,!!o)):(s=="doubleClick"?uC:pC)(t,a.pos,a.inside,n)?n.preventDefault():An(t,"pointer"))};class hC{constructor(e,n,o,i){let s,a;if(this.view=e,this.pos=n,this.event=o,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!o[Pg],this.allowDefault=o.shiftKey,n.inside>-1)s=e.state.doc.nodeAt(n.inside),a=n.inside;else{let u=e.state.doc.resolve(n.pos);s=u.parent,a=u.depth?u.before():0}const l=i?null:o.target,c=l?e.docView.nearestDesc(l,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:d}=e.state;(o.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||d instanceof re&&d.from<=a&&d.to>a)&&(this.mightDrag={node:s,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Tt||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)),An(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(()=>cn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Ts(e))),this.updateAllowDefault(e),this.allowDefault||!n?An(this.view,"pointer"):function(o,i,s,a,l){return $c(o,"handleClickOn",i,s,a)||o.someProp("handleClick",c=>c(o,i,a))||(l?function(c,d){if(d==-1)return!1;let u,p,h=c.state.selection;h instanceof re&&(u=h.node);let f=c.state.doc.resolve(d);for(let m=f.depth+1;m>0;m--){let g=m>f.depth?f.nodeAfter:f.node(m);if(re.isSelectable(g)){p=u&&h.$from.depth>0&&m>=h.$from.depth&&f.before(h.$from.depth+1)==h.$from.pos?f.before(h.$from.depth):f.before(m);break}}return p!=null&&(sr(c,re.create(c.state.doc,p)),!0)}(o,s):function(c,d){if(d==-1)return!1;let u=c.state.doc.resolve(d),p=u.nodeAfter;return!!(p&&p.isAtom&&re.isSelectable(p))&&(sr(c,new re(u)),!0)}(o,s))}(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||ot&&this.mightDrag&&!this.mightDrag.node.isAtom||Ze&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(sr(this.view,he.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):An(this.view,"pointer")}move(e){this.updateAllowDefault(e),An(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function zg(t,e){return!!t.composing||!!(ot&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}rt.touchstart=t=>{t.input.lastTouch=Date.now(),Pc(t),An(t,"pointer")},rt.touchmove=t=>{t.input.lastTouch=Date.now(),An(t,"pointer")},rt.contextmenu=t=>Pc(t);const fC=an?5e3:-1;function Fg(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Os(t),e))}function jg(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Os(t,e=!1){if(!(an&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),jg(t),e||t.docView&&t.docView.dirty){let n=Bc(t),o=t.state.selection;return n&&!n.eq(o)?t.dispatch(t.state.tr.setSelection(n)):!t.markCursor&&!e||o.$from.node(o.$from.sharedDepth(o.to)).inlineContent?t.updateState(t.state):t.dispatch(t.state.tr.deleteSelection()),!0}return!1}}it.compositionstart=it.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof le&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(o=>o.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Os(t,!0),t.markCursor=null;else if(Os(t,!e.selection.empty),Tt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let o=t.domSelectionRange();for(let i=o.focusNode,s=o.focusOffset;i&&i.nodeType==1&&s!=0;){let a=s<0?i.lastChild:i.childNodes[s-1];if(!a)break;if(a.nodeType==3){let l=t.domSelection();l&&l.collapse(a,a.nodeValue.length);break}i=a,s=-1}}t.input.composing=!0}Fg(t,fC)},it.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Fg(t,20))};const ei=dt&&Tn<15||or&&Yx<604;function ti(t,e,n,o,i){let s=_g(t,e,n,o,t.state.selection.$from);if(t.someProp("handlePaste",c=>c(t,i,s||Q.empty)))return!0;if(!s)return!1;let a=function(c){return c.openStart==0&&c.openEnd==0&&c.content.childCount==1?c.content.firstChild:null}(s),l=a?t.state.tr.replaceSelectionWith(a,o):t.state.tr.replaceSelection(s);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Hg(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}rt.copy=it.cut=(t,e)=>{let n=e,o=t.state.selection,i=n.type=="cut";if(o.empty)return;let s=ei?null:n.clipboardData,a=o.content(),{dom:l,text:c}=Ac(t,a);s?(n.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",c)):function(d,u){if(!d.dom.parentNode)return;let p=d.dom.parentNode.appendChild(document.createElement("div"));p.appendChild(u),p.style.cssText="position: fixed; left: -10000px; top: 10px";let h=getSelection(),f=document.createRange();f.selectNodeContents(u),d.dom.blur(),h.removeAllRanges(),h.addRange(f),setTimeout(()=>{p.parentNode&&p.parentNode.removeChild(p),d.focus()},50)}(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},it.paste=(t,e)=>{let n=e;if(t.composing&&!an)return;let o=ei?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;o&&ti(t,Hg(o),o.getData("text/html"),i,n)?n.preventDefault():function(s,a){if(!s.dom.parentNode)return;let l=s.input.shiftKey||s.state.selection.$from.parent.type.spec.code,c=s.dom.parentNode.appendChild(document.createElement(l?"textarea":"div"));l||(c.contentEditable="true"),c.style.cssText="position: fixed; left: -10000px; top: 10px",c.focus();let d=s.input.shiftKey&&s.input.lastKeyCode!=45;setTimeout(()=>{s.focus(),c.parentNode&&c.parentNode.removeChild(c),l?ti(s,c.value,null,d,a):ti(s,c.textContent,c.innerHTML,d,a)},50)}(t,n)};class Wg{constructor(e,n,o){this.slice=e,this.move=n,this.node=o}}const mC=Ot?"altKey":"ctrlKey";function Kg(t,e){let n=t.someProp("dragCopies",o=>!o(e));return n??!e[mC]}rt.dragstart=(t,e)=>{let n=e,o=t.input.mouseDown;if(o&&o.done(),!n.dataTransfer)return;let i,s=t.state.selection,a=s.empty?null:t.posAtCoords(Ts(n));if(!(a&&a.pos>=s.from&&a.pos<=(s instanceof re?s.to-1:s.to))){if(o&&o.mightDrag)i=re.create(t.state.doc,o.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let p=t.docView.nearestDesc(n.target,!0);p&&p.node.type.spec.draggable&&p!=t.docView&&(i=re.create(t.state.doc,p.posBefore))}}let l=(i||t.state.selection).content(),{dom:c,text:d,slice:u}=Ac(t,l);(!n.dataTransfer.files.length||!Ze||Qm>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ei?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",ei||n.dataTransfer.setData("text/plain",d),t.dragging=new Wg(u,Kg(t,n),i)},rt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},it.dragover=it.dragenter=(t,e)=>e.preventDefault(),it.drop=(t,e)=>{let n=e,o=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Ts(n));if(!i)return;let s=t.state.doc.resolve(i.pos),a=o&&o.slice;a?t.someProp("transformPasted",m=>{a=m(a,t,!1)}):a=_g(t,Hg(n.dataTransfer),ei?null:n.dataTransfer.getData("text/html"),!1,s);let l=!(!o||!Kg(t,n));if(t.someProp("handleDrop",m=>m(t,n,a||Q.empty,l)))return void n.preventDefault();if(!a)return;n.preventDefault();let c=a?Sm(t.state.doc,s.pos,a):s.pos;c==null&&(c=s.pos);let d=t.state.tr;if(l){let{node:m}=o;m?m.replace(d):d.deleteSelection()}let u=d.mapping.map(c),p=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,h=d.doc;if(p?d.replaceRangeWith(u,u,a.content.firstChild):d.replaceRange(u,u,a),d.doc.eq(h))return;let f=d.doc.resolve(u);if(p&&re.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))d.setSelection(new re(f));else{let m=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((g,v,b,y)=>m=y),d.setSelection(Oc(t,f,d.doc.resolve(m)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))},rt.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&cn(t)},20))},rt.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},rt.beforeinput=(t,e)=>{if(Ze&&an&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,uo(8,"Backspace")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let t in it)rt[t]=it[t];function ni(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class _s{constructor(e,n){this.toDOM=e,this.spec=n||fo,this.side=this.spec.side||0}map(e,n,o,i){let{pos:s,deleted:a}=e.mapResult(n.from+i,this.side<0?-1:1);return a?null:new st(s-o,s-o,this)}valid(){return!0}eq(e){return this==e||e instanceof _s&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ni(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Dn{constructor(e,n){this.attrs=e,this.spec=n||fo}map(e,n,o,i){let s=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-o,a=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-o;return s>=a?null:new st(s,a,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Dn&&ni(this.attrs,e.attrs)&&ni(this.spec,e.spec)}static is(e){return e.type instanceof Dn}destroy(){}}class zc{constructor(e,n){this.attrs=e,this.spec=n||fo}map(e,n,o,i){let s=e.mapResult(n.from+i,1);if(s.deleted)return null;let a=e.mapResult(n.to+i,-1);return a.deleted||a.pos<=s.pos?null:new st(s.pos-o,a.pos-o,this)}valid(e,n){let o,{index:i,offset:s}=e.content.findIndex(n.from);return s==n.from&&!(o=e.child(i)).isText&&s+o.nodeSize==n.to}eq(e){return this==e||e instanceof zc&&ni(this.attrs,e.attrs)&&ni(this.spec,e.spec)}destroy(){}}class st{constructor(e,n,o){this.from=e,this.to=n,this.type=o}copy(e,n){return new st(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,o){return this.type.map(e,this,n,o)}static widget(e,n,o){return new st(e,e,new _s(n,o))}static inline(e,n,o,i){return new st(e,n,new Dn(o,i))}static node(e,n,o,i){return new st(e,n,new zc(o,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Dn}get widget(){return this.type instanceof _s}}const ar=[],fo={};class Te{constructor(e,n){this.local=e.length?e:ar,this.children=n.length?n:ar}static create(e,n){return n.length?Vs(n,e,0,fo):et}find(e,n,o){let i=[];return this.findInner(e??0,n??1e9,i,0,o),i}findInner(e,n,o,i,s){for(let a=0;a<this.local.length;a++){let l=this.local[a];l.from<=n&&l.to>=e&&(!s||s(l.spec))&&o.push(l.copy(l.from+i,l.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>e){let l=this.children[a]+1;this.children[a+2].findInner(e-l,n-l,o,i+l,s)}}map(e,n,o){return this==et||e.maps.length==0?this:this.mapInner(e,n,0,0,o||fo)}mapInner(e,n,o,i,s){let a;for(let l=0;l<this.local.length;l++){let c=this.local[l].map(e,o,i);c&&c.type.valid(n,c)?(a||(a=[])).push(c):s.onRemove&&s.onRemove(this.local[l].spec)}return this.children.length?function(l,c,d,u,p,h,f){let m=l.slice();for(let v=0,b=h;v<d.maps.length;v++){let y=0;d.maps[v].forEach((k,x,w,C)=>{let S=C-w-(x-k);for(let E=0;E<m.length;E+=3){let M=m[E+1];if(M<0||k>M+b-y)continue;let N=m[E]+b-y;x>=N?m[E+1]=k<=N?-2:-1:k>=b&&S&&(m[E]+=S,m[E+1]+=S)}y+=S}),b=d.maps[v].map(b,-1)}let g=!1;for(let v=0;v<m.length;v+=3)if(m[v+1]<0){if(m[v+1]==-2){g=!0,m[v+1]=-1;continue}let b=d.map(l[v]+h),y=b-p;if(y<0||y>=u.content.size){g=!0;continue}let k=d.map(l[v+1]+h,-1)-p,{index:x,offset:w}=u.content.findIndex(y),C=u.maybeChild(x);if(C&&w==y&&w+C.nodeSize==k){let S=m[v+2].mapInner(d,C,b+1,l[v]+h+1,f);S!=et?(m[v]=y,m[v+1]=k,m[v+2]=S):(m[v+1]=-2,g=!0)}else g=!0}if(g){let v=function(y,k,x,w,C,S,E){function M(N,T){for(let D=0;D<N.local.length;D++){let $=N.local[D].map(w,C,T);$?x.push($):E.onRemove&&E.onRemove(N.local[D].spec)}for(let D=0;D<N.children.length;D+=3)M(N.children[D+2],N.children[D]+T+1)}for(let N=0;N<y.length;N+=3)y[N+1]==-1&&M(y[N+2],k[N]+S+1);return x}(m,l,c,d,p,h,f),b=Vs(v,u,0,f);c=b.local;for(let y=0;y<m.length;y+=3)m[y+1]<0&&(m.splice(y,3),y-=3);for(let y=0,k=0;y<b.children.length;y+=3){let x=b.children[y];for(;k<m.length&&m[k]<x;)k+=3;m.splice(k,0,b.children[y],b.children[y+1],b.children[y+2])}}return new Te(c.sort(mo),m)}(this.children,a||[],e,n,o,i,s):a?new Te(a.sort(mo),ar):et}add(e,n){return n.length?this==et?Te.create(e,n):this.addInner(e,n,0):this}addInner(e,n,o){let i,s=0;e.forEach((l,c)=>{let d,u=c+o;if(d=qg(n,l,u)){for(i||(i=this.children.slice());s<i.length&&i[s]<c;)s+=3;i[s]==c?i[s+2]=i[s+2].addInner(l,d,u+1):i.splice(s,0,c,c+l.nodeSize,Vs(d,l,u+1,fo)),s+=3}});let a=Ug(s?Jg(n):n,-o);for(let l=0;l<a.length;l++)a[l].type.valid(e,a[l])||a.splice(l--,1);return new Te(a.length?this.local.concat(a).sort(mo):this.local,i||this.children)}remove(e){return e.length==0||this==et?this:this.removeInner(e,0)}removeInner(e,n){let o=this.children,i=this.local;for(let s=0;s<o.length;s+=3){let a,l=o[s]+n,c=o[s+1]+n;for(let u,p=0;p<e.length;p++)(u=e[p])&&u.from>l&&u.to<c&&(e[p]=null,(a||(a=[])).push(u));if(!a)continue;o==this.children&&(o=this.children.slice());let d=o[s+2].removeInner(a,l+1);d!=et?o[s+2]=d:(o.splice(s,3),s-=3)}if(i.length){for(let s,a=0;a<e.length;a++)if(s=e[a])for(let l=0;l<i.length;l++)i[l].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(l--,1))}return o==this.children&&i==this.local?this:i.length||o.length?new Te(i,o):et}forChild(e,n){if(this==et)return this;if(n.isLeaf)return Te.empty;let o,i;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(o=this.children[l+2]);break}let s=e+1,a=s+n.content.size;for(let l=0;l<this.local.length;l++){let c=this.local[l];if(c.from<a&&c.to>s&&c.type instanceof Dn){let d=Math.max(s,c.from)-s,u=Math.min(a,c.to)-s;d<u&&(i||(i=[])).push(c.copy(d,u))}}if(i){let l=new Te(i.sort(mo),ar);return o?new In([l,o]):l}return o||et}eq(e){if(this==e)return!0;if(!(e instanceof Te)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Fc(this.localsInner(e))}localsInner(e){if(this==et)return ar;if(e.inlineContent||!this.local.some(Dn.is))return this.local;let n=[];for(let o=0;o<this.local.length;o++)this.local[o].type instanceof Dn||n.push(this.local[o]);return n}forEachSet(e){e(this)}}Te.empty=new Te([],[]),Te.removeOverlap=Fc;const et=Te.empty;class In{constructor(e){this.members=e}map(e,n){const o=this.members.map(i=>i.map(e,n,fo));return In.from(o)}forChild(e,n){if(n.isLeaf)return Te.empty;let o=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,n);s!=et&&(s instanceof In?o=o.concat(s.members):o.push(s))}return In.from(o)}eq(e){if(!(e instanceof In)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,o=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(n){o&&(n=n.slice(),o=!1);for(let a=0;a<s.length;a++)n.push(s[a])}else n=s}return n?Fc(o?n:n.sort(mo)):ar}static from(e){switch(e.length){case 0:return et;case 1:return e[0];default:return new In(e.every(n=>n instanceof Te)?e:e.reduce((n,o)=>n.concat(o instanceof Te?o:o.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function Ug(t,e){if(!e||!t.length)return t;let n=[];for(let o=0;o<t.length;o++){let i=t[o];n.push(new st(i.from+e,i.to+e,i.type))}return n}function qg(t,e,n){if(e.isLeaf)return null;let o=n+e.nodeSize,i=null;for(let s,a=0;a<t.length;a++)(s=t[a])&&s.from>n&&s.to<o&&((i||(i=[])).push(s),t[a]=null);return i}function Jg(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Vs(t,e,n,o){let i=[],s=!1;e.forEach((l,c)=>{let d=qg(t,l,c+n);if(d){s=!0;let u=Vs(d,l,n+c+1,o);u!=et&&i.push(c,c+l.nodeSize,u)}});let a=Ug(s?Jg(t):t,-n).sort(mo);for(let l=0;l<a.length;l++)a[l].type.valid(e,a[l])||(o.onRemove&&o.onRemove(a[l].spec),a.splice(l--,1));return a.length||i.length?new Te(a,i):et}function mo(t,e){return t.from-e.from||t.to-e.to}function Fc(t){let e=t;for(let n=0;n<e.length-1;n++){let o=e[n];if(o.from!=o.to)for(let i=n+1;i<e.length;i++){let s=e[i];if(s.from!=o.from){s.from<o.to&&(e==t&&(e=t.slice()),e[n]=o.copy(o.from,s.from),Gg(e,i,o.copy(s.from,o.to)));break}s.to!=o.to&&(e==t&&(e=t.slice()),e[i]=s.copy(s.from,o.to),Gg(e,i+1,s.copy(o.to,s.to)))}}return e}function Gg(t,e,n){for(;e<t.length&&mo(n,t[e])>0;)e++;t.splice(e,0,n)}function jc(t){let e=[];return t.someProp("decorations",n=>{let o=n(t.state);o&&o!=et&&e.push(o)}),t.cursorWrapper&&e.push(Te.create(t.state.doc,[t.cursorWrapper.deco])),In.from(e)}const gC={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},vC=dt&&Tn<=11;class yC{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 bC{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new yC,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(o=>{for(let i=0;i<o.length;i++)this.queue.push(o[i]);dt&&Tn<=11&&o.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),vC&&(this.onCharData=o=>{this.queue.push({target:o.target,type:"characterData",oldValue:o.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.takeRecords(),this.observer.observe(this.view.dom,gC)),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 n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.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(Cg(this.view)){if(this.suppressingSelectionUpdates)return cn(this.view);if(dt&&Tn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&co(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n,o=new Set;for(let s=e.focusNode;s;s=nr(s))o.add(s);for(let s=e.anchorNode;s;s=nr(s))if(o.has(s)){n=s;break}let i=n&&this.view.docView.nearestDesc(n);return i&&i.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let o=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(o)&&Cg(e)&&!this.ignoreSelectionChange(o),s=-1,a=-1,l=!1,c=[];if(e.editable)for(let u=0;u<n.length;u++){let p=this.registerMutation(n[u],c);p&&(s=s<0?p.from:Math.min(p.from,s),a=a<0?p.to:Math.max(p.to,a),p.typeOver&&(l=!0))}if(Tt&&c.length){let u=c.filter(p=>p.nodeName=="BR");if(u.length==2){let[p,h]=u;p.parentNode&&p.parentNode.parentNode==h.parentNode?h.remove():p.remove()}else{let{focusNode:p}=this.currentSelection;for(let h of u){let f=h.parentNode;!f||f.nodeName!="LI"||p&&kC(e,p)==f||h.remove()}}}let d=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Es(o)&&(d=Bc(e))&&d.eq(he.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,cn(e),this.currentSelection.set(o),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,a),function(u){if(!Yg.has(u)&&(Yg.set(u,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(u.dom).whiteSpace)!==-1)){if(u.requiresGeckoHackNode=Tt,Xg)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Xg=!0}}(e)),this.handleDOMChange(s,a,l,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(o)||cn(e),this.currentSelection.set(o))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let o=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(o==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!o||o.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;d<e.addedNodes.length;d++){let u=e.addedNodes[d];n.push(u),u.nodeType==3&&(this.lastChangedTextNode=u)}if(o.contentDOM&&o.contentDOM!=o.dom&&!o.contentDOM.contains(e.target))return{from:o.posBefore,to:o.posAfter};let i=e.previousSibling,s=e.nextSibling;if(dt&&Tn<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:u,nextSibling:p}=e.addedNodes[d];(!u||Array.prototype.indexOf.call(e.addedNodes,u)<0)&&(i=u),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(s=p)}let a=i&&i.parentNode==e.target?Ge(i)+1:0,l=o.localPosFromDOM(e.target,a,-1),c=s&&s.parentNode==e.target?Ge(s):e.target.childNodes.length;return{from:l,to:o.localPosFromDOM(e.target,c,1)}}return e.type=="attributes"?{from:o.posAtStart-o.border,to:o.posAtEnd+o.border}:(this.lastChangedTextNode=e.target,{from:o.posAtStart,to:o.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Yg=new WeakMap,Xg=!1;function Qg(t,e){let n=e.startContainer,o=e.startOffset,i=e.endContainer,s=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return co(a.node,a.offset,i,s)&&([n,o,i,s]=[i,s,n,o]),{anchorNode:n,anchorOffset:o,focusNode:i,focusOffset:s}}function kC(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let o=t.docView.nearestDesc(n,!0);if(o&&o.node.isBlock)return n}return null}function wC(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(ot&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(t.parentNode.lastChild==t||ot&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const xC=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Zg(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Oc(t,e.resolve(n.anchor),e.resolve(n.head))}function Hc(t,e,n){let o=t.depth,i=e?t.end():t.pos;for(;o>0&&(e||t.indexAfter(o)==t.node(o).childCount);)o--,i++,e=!1;if(n){let s=t.node(o).maybeChild(t.indexAfter(o));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function ev(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class tv{constructor(e,n){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 cC,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(sv),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=rv(this),ov(this),this.nodeViews=iv(this),this.docView=ug(this.state.doc,nv(this),jc(this),this.dom,this),this.domObserver=new bC(this,(o,i,s,a)=>function(l,c,d,u,p){let h=l.input.compositionPendingChanges||(l.composing?l.input.compositionID:0);if(l.input.compositionPendingChanges=0,c<0){let B=l.input.lastSelectionTime>Date.now()-50?l.input.lastSelectionOrigin:null,V=Bc(l,B);if(V&&!l.state.selection.eq(V)){if(Ze&&an&&l.input.lastKeyCode===13&&Date.now()-100<l.input.lastKeyCodeTime&&l.someProp("handleKeyDown",A=>A(l,uo(13,"Enter"))))return;let O=l.state.tr.setSelection(V);B=="pointer"?O.setMeta("pointer",!0):B=="key"&&O.scrollIntoView(),h&&O.setMeta("composition",h),l.dispatch(O)}return}let f=l.state.doc.resolve(c),m=f.sharedDepth(d);c=f.before(m+1),d=l.state.doc.resolve(d).after(m+1);let g,v,b=l.state.selection,y=function(B,V,O){let A,{node:F,fromOffset:R,toOffset:L,from:I,to:P}=B.docView.parseRange(V,O),W=B.domSelectionRange(),z=W.anchorNode;if(z&&B.dom.contains(z.nodeType==1?z:z.parentNode)&&(A=[{node:z,offset:W.anchorOffset}],Es(W)||A.push({node:W.focusNode,offset:W.focusOffset})),Ze&&B.input.lastKeyCode===8)for(let Y=L;Y>R;Y--){let te=F.childNodes[Y-1],pe=te.pmViewDesc;if(te.nodeName=="BR"&&!pe){L=Y;break}if(!pe||pe.size)break}let j=B.state.doc,K=B.someProp("domParser")||Sn.fromSchema(B.state.schema),G=j.resolve(I),Z=null,J=K.parse(F,{topNode:G.parent,topMatch:G.parent.contentMatchAt(G.index()),topOpen:!0,from:R,to:L,preserveWhitespace:G.parent.type.whitespace!="pre"||"full",findPositions:A,ruleFromNode:wC,context:G});if(A&&A[0].pos!=null){let Y=A[0].pos,te=A[1]&&A[1].pos;te==null&&(te=Y),Z={anchor:Y+I,head:te+I}}return{doc:J,sel:Z,from:I,to:P}}(l,c,d),k=l.state.doc,x=k.slice(y.from,y.to);l.input.lastKeyCode===8&&Date.now()-100<l.input.lastKeyCodeTime?(g=l.state.selection.to,v="end"):(g=l.state.selection.from,v="start"),l.input.lastKeyCode=null;let w=function(B,V,O,A,F){let R=B.findDiffStart(V,O);if(R==null)return null;let{a:L,b:I}=B.findDiffEnd(V,O+B.size,O+V.size);if(F=="end"&&(A-=L+Math.max(0,R-Math.min(L,I))-R),L<R&&B.size<V.size){let P=A<=R&&A>=L?R-A:0;R-=P,R&&R<V.size&&ev(V.textBetween(R-1,R+1))&&(R+=P?1:-1),I=R+(I-L),L=R}else if(I<R){let P=A<=R&&A>=I?R-A:0;R-=P,R&&R<B.size&&ev(B.textBetween(R-1,R+1))&&(R+=P?1:-1),L=R+(L-I),I=R}return{start:R,endA:L,endB:I}}(x.content,y.doc.content,y.from,g,v);if(w&&l.input.domChangeCount++,(or&&l.input.lastIOSEnter>Date.now()-225||an)&&p.some(B=>B.nodeType==1&&!xC.test(B.nodeName))&&(!w||w.endA>=w.endB)&&l.someProp("handleKeyDown",B=>B(l,uo(13,"Enter"))))return void(l.input.lastIOSEnter=0);if(!w){if(!(u&&b instanceof le&&!b.empty&&b.$head.sameParent(b.$anchor))||l.composing||y.sel&&y.sel.anchor!=y.sel.head){if(y.sel){let B=Zg(l,l.state.doc,y.sel);if(B&&!B.eq(l.state.selection)){let V=l.state.tr.setSelection(B);h&&V.setMeta("composition",h),l.dispatch(V)}}return}w={start:b.from,endA:b.to,endB:b.to}}l.state.selection.from<l.state.selection.to&&w.start==w.endB&&l.state.selection instanceof le&&(w.start>l.state.selection.from&&w.start<=l.state.selection.from+2&&l.state.selection.from>=y.from?w.start=l.state.selection.from:w.endA<l.state.selection.to&&w.endA>=l.state.selection.to-2&&l.state.selection.to<=y.to&&(w.endB+=l.state.selection.to-w.endA,w.endA=l.state.selection.to)),dt&&Tn<=11&&w.endB==w.start+1&&w.endA==w.start&&w.start>y.from&&y.doc.textBetween(w.start-y.from-1,w.start-y.from+1)=="  "&&(w.start--,w.endA--,w.endB--);let C=y.doc.resolveNoCache(w.start-y.from),S=y.doc.resolveNoCache(w.endB-y.from),E=k.resolve(w.start),M=C.sameParent(S)&&C.parent.inlineContent&&E.end()>=w.endA;if((or&&l.input.lastIOSEnter>Date.now()-225&&(!M||p.some(B=>B.nodeName=="DIV"||B.nodeName=="P"))||!M&&C.pos<y.doc.content.size&&(!C.sameParent(S)||!C.parent.inlineContent)&&C.pos<S.pos&&!/\S/.test(y.doc.textBetween(C.pos,S.pos,"","")))&&l.someProp("handleKeyDown",B=>B(l,uo(13,"Enter"))))return void(l.input.lastIOSEnter=0);if(l.state.selection.anchor>w.start&&function(B,V,O,A,F){if(O-V<=F.pos-A.pos||Hc(A,!0,!1)<F.pos)return!1;let R=B.resolve(V);if(!A.parent.isTextblock){let I=R.nodeAfter;return I!=null&&O==V+I.nodeSize}if(R.parentOffset<R.parent.content.size||!R.parent.isTextblock)return!1;let L=B.resolve(Hc(R,!0,!0));return!(!L.parent.isTextblock||L.pos>O||Hc(L,!0,!1)<O)&&A.parent.content.cut(A.parentOffset).eq(L.parent.content)}(k,w.start,w.endA,C,S)&&l.someProp("handleKeyDown",B=>B(l,uo(8,"Backspace"))))return void(an&&Ze&&l.domObserver.suppressSelectionUpdates());Ze&&w.endB==w.start&&(l.input.lastChromeDelete=Date.now()),an&&!M&&C.start()!=S.start()&&S.parentOffset==0&&C.depth==S.depth&&y.sel&&y.sel.anchor==y.sel.head&&y.sel.head==w.endA&&(w.endB-=2,S=y.doc.resolveNoCache(w.endB-y.from),setTimeout(()=>{l.someProp("handleKeyDown",function(B){return B(l,uo(13,"Enter"))})},20));let N,T=w.start,D=w.endA,$=B=>{let V=B||l.state.tr.replace(T,D,y.doc.slice(w.start-y.from,w.endB-y.from));if(y.sel){let O=Zg(l,V.doc,y.sel);O&&!(Ze&&l.composing&&O.empty&&(w.start!=w.endB||l.input.lastChromeDelete<Date.now()-100)&&(O.head==T||O.head==V.mapping.map(D)-1)||dt&&O.empty&&O.head==T)&&V.setSelection(O)}return h&&V.setMeta("composition",h),V.scrollIntoView()};if(M)if(C.pos==S.pos){dt&&Tn<=11&&C.parentOffset==0&&(l.domObserver.suppressSelectionUpdates(),setTimeout(()=>cn(l),20));let B=$(l.state.tr.delete(T,D)),V=k.resolve(w.start).marksAcross(k.resolve(w.endA));V&&B.ensureMarks(V),l.dispatch(B)}else if(w.endA==w.endB&&(N=function(B,V){let O,A,F,R=B.firstChild.marks,L=V.firstChild.marks,I=R,P=L;for(let z=0;z<L.length;z++)I=L[z].removeFromSet(I);for(let z=0;z<R.length;z++)P=R[z].removeFromSet(P);if(I.length==1&&P.length==0)A=I[0],O="add",F=z=>z.mark(A.addToSet(z.marks));else{if(I.length!=0||P.length!=1)return null;A=P[0],O="remove",F=z=>z.mark(A.removeFromSet(z.marks))}let W=[];for(let z=0;z<V.childCount;z++)W.push(F(V.child(z)));if(H.from(W).eq(B))return{mark:A,type:O}}(C.parent.content.cut(C.parentOffset,S.parentOffset),E.parent.content.cut(E.parentOffset,w.endA-E.start())))){let B=$(l.state.tr);N.type=="add"?B.addMark(T,D,N.mark):B.removeMark(T,D,N.mark),l.dispatch(B)}else if(C.parent.child(C.index()).isText&&C.index()==S.index()-(S.textOffset?0:1)){let B=C.parent.textBetween(C.parentOffset,S.parentOffset),V=()=>$(l.state.tr.insertText(B,T,D));l.someProp("handleTextInput",O=>O(l,T,D,B,V))||l.dispatch(V())}else l.dispatch($());else l.dispatch($())}(this,o,i,s,a)),this.domObserver.start(),function(o){for(let i in rt){let s=rt[i];o.dom.addEventListener(i,o.input.eventHandlers[i]=a=>{!dC(o,a)||Lc(o,a)||!o.editable&&a.type in it||s(o,a)},lC[i]?{passive:!0}:void 0)}ot&&o.dom.addEventListener("input",()=>null),Rc(o)}(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 n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Rc(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(sv),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let o in this._props)n[o]=this._props[o];n.state=this.state;for(let o in e)n[o]=e[o];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var o;let i=this.state,s=!1,a=!1;e.storedMarks&&this.composing&&(jg(this),a=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let f=iv(this);(function(m,g){let v=0,b=0;for(let y in m){if(m[y]!=g[y])return!0;v++}for(let y in g)b++;return v!=b})(f,this.nodeViews)&&(this.nodeViews=f,s=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&Rc(this),this.editable=rv(this),ov(this);let c=jc(this),d=nv(this),u=i.plugins==e.plugins||i.doc.eq(e.doc)?e.scrollToSelection>i.scrollToSelection?"to selection":"preserve":"reset",p=s||!this.docView.matchesNode(e.doc,d,c);!p&&e.selection.eq(i.selection)||(a=!0);let h=u=="preserve"&&a&&this.dom.style.overflowAnchor==null&&function(f){let m,g,v=f.dom.getBoundingClientRect(),b=Math.max(0,v.top);for(let y=(v.left+v.right)/2,k=b+1;k<Math.min(innerHeight,v.bottom);k+=5){let x=f.root.elementFromPoint(y,k);if(!x||x==f.dom||!f.dom.contains(x))continue;let w=x.getBoundingClientRect();if(w.top>=b-20){m=x,g=w.top;break}}return{refDOM:m,refTop:g,stack:eg(f.dom)}}(this);if(a){this.domObserver.stop();let f=p&&(dt||Ze)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&function(m,g){let v=Math.min(m.$anchor.sharedDepth(m.head),g.$anchor.sharedDepth(g.head));return m.$anchor.start(v)!=g.$anchor.start(v)}(i.selection,e.selection);if(p){let m=Ze?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(g){let v=g.domSelectionRange();if(!v.focusNode)return null;let b=function(k,x){for(;;){if(k.nodeType==3&&x)return k;if(k.nodeType==1&&x>0){if(k.contentEditable=="false")return null;x=Bt(k=k.childNodes[x-1])}else{if(!k.parentNode||Jr(k))return null;x=Ge(k),k=k.parentNode}}}(v.focusNode,v.focusOffset),y=function(k,x){for(;;){if(k.nodeType==3&&x<k.nodeValue.length)return k;if(k.nodeType==1&&x<k.childNodes.length){if(k.contentEditable=="false")return null;k=k.childNodes[x],x=0}else{if(!k.parentNode||Jr(k))return null;x=Ge(k)+1,k=k.parentNode}}}(v.focusNode,v.focusOffset);if(b&&y&&b!=y){let k=y.pmViewDesc,x=g.domObserver.lastChangedTextNode;if(b==x||y==x)return x;if(!k||!k.isText(y.nodeValue))return y;if(g.input.compositionNode==y){let w=b.pmViewDesc;if(w&&w.isText(b.nodeValue))return y}}return b||y}(this)),!s&&this.docView.update(e.doc,d,c,this)||(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=ug(e.doc,d,c,this.dom,this)),m&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(m){let g=m.docView.domFromPos(m.state.selection.anchor,0),v=m.domSelectionRange();return co(g.node,g.offset,v.anchorNode,v.anchorOffset)}(this))?cn(this,f):(wg(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((o=this.dragging)===null||o===void 0)&&o.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():h&&function({refDOM:f,refTop:m,stack:g}){let v=f?f.getBoundingClientRect().top:0;tg(g,v==0?0:v-m)}(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(e.nodeType==1?e:e.parentNode)&&!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof re){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Zm(this,n.getBoundingClientRect(),e)}else Zm(this,this.coordsAtPos(this.state.selection.head,1),e)}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 n=0;n<this.pluginViews.length;n++){let o=this.pluginViews[n];o.update&&o.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let o=this.directPlugins[n];o.spec.view&&this.pluginViews.push(o.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let o=this.state.plugins[n];o.spec.view&&this.pluginViews.push(o.spec.view(this))}}}updateDraggedNode(e,n){let o=e.node,i=-1;if(this.state.doc.nodeAt(o.from)==o.node)i=o.from;else{let s=o.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&this.state.doc.nodeAt(s))==o.node&&(i=s)}this.dragging=new Wg(e.slice,e.move,i<0?void 0:re.create(this.state.doc,i))}someProp(e,n){let o,i=this._props&&this._props[e];if(i!=null&&(o=n?n(i):i))return o;for(let a=0;a<this.directPlugins.length;a++){let l=this.directPlugins[a].props[e];if(l!=null&&(o=n?n(l):l))return o}let s=this.state.plugins;if(s)for(let a=0;a<s.length;a++){let l=s[a].props[e];if(l!=null&&(o=n?n(l):l))return o}}hasFocus(){if(dt){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(rr)return e.focus(rr);let n=eg(e);e.focus(rr==null?{get preventScroll(){return rr={preventScroll:!0},!0}}:void 0),rr||(rr=!1,tg(n,0))}(this.dom),cn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Zx(this,e)}coordsAtPos(e,n=1){return ig(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,o=-1){let i=this.docView.posFromDOM(e,n,o);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return function(o,i,s){return ag==i&&lg==s?cg:(ag=i,lg=s,cg=s=="up"||s=="down"?function(a,l,c){let d=l.selection,u=c=="up"?d.$from:d.$to;return sg(a,l,()=>{let{node:p}=a.docView.domFromPos(u.pos,c=="up"?-1:1);for(;;){let f=a.docView.nearestDesc(p,!0);if(!f)break;if(f.node.isBlock){p=f.contentDOM||f.dom;break}p=f.dom.parentNode}let h=ig(a,u.pos,1);for(let f=p.firstChild;f;f=f.nextSibling){let m;if(f.nodeType==1)m=f.getClientRects();else{if(f.nodeType!=3)continue;m=sn(f,0,f.nodeValue.length).getClientRects()}for(let g=0;g<m.length;g++){let v=m[g];if(v.bottom>v.top+1&&(c=="up"?h.top-v.top>2*(v.bottom-h.top):v.bottom-h.bottom>2*(h.bottom-v.top)))return!1}}return!0})}(o,i,s):function(a,l,c){let{$head:d}=l.selection;if(!d.parent.isTextblock)return!1;let u=d.parentOffset,p=!u,h=u==d.parent.content.size,f=a.domSelection();return f?tC.test(d.parent.textContent)&&f.modify?sg(a,l,()=>{let{focusNode:m,focusOffset:g,anchorNode:v,anchorOffset:b}=a.domSelectionRange(),y=f.caretBidiLevel;f.modify("move",c,"character");let k=d.depth?a.docView.domAfterPos(d.before()):a.dom,{focusNode:x,focusOffset:w}=a.domSelectionRange(),C=x&&!k.contains(x.nodeType==1?x:x.parentNode)||m==x&&g==w;try{f.collapse(v,b),m&&(m!=v||g!=b)&&f.extend&&f.extend(m,g)}catch{}return y!=null&&(f.caretBidiLevel=y),C}):c=="left"||c=="backward"?p:h:d.pos==d.start()||d.pos==d.end()}(o,i,s))}(this,n||this.state,e)}pasteHTML(e,n){return ti(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ti(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Ac(this,e)}destroy(){this.docView&&(function(e){e.domObserver.stop();for(let n in e.input.eventHandlers)e.dom.removeEventListener(n,e.input.eventHandlers[n]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],jc(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,kc=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return function(n,o){Lc(n,o)||!rt[o.type]||!n.editable&&o.type in it||rt[o.type](n,o)}(this,e)}domSelectionRange(){let e=this.domSelection();return e?ot&&this.root.nodeType===11&&function(n){let o=n.activeElement;for(;o&&o.shadowRoot;)o=o.shadowRoot.activeElement;return o}(this.dom.ownerDocument)==this.dom&&function(n,o){if(o.getComposedRanges){let a=o.getComposedRanges(n.root)[0];if(a)return Qg(n,a)}let i;function s(a){a.preventDefault(),a.stopImmediatePropagation(),i=a.getTargetRanges()[0]}return n.dom.addEventListener("beforeinput",s,!0),document.execCommand("indent"),n.dom.removeEventListener("beforeinput",s,!0),i?Qg(n,i):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function nv(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let o in n)o=="class"?e.class+=" "+n[o]:o=="style"?e.style=(e.style?e.style+";":"")+n[o]:e[o]||o=="contenteditable"||o=="nodeName"||(e[o]=String(n[o]))}),e.translate||(e.translate="no"),[st.node(0,t.state.doc.content.size,e)]}function ov(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:st.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function rv(t){return!t.someProp("editable",e=>e(t.state)===!1)}function iv(t){let e=Object.create(null);function n(o){for(let i in o)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=o[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function sv(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}tv.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};for(var Rn={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:"'"},As={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},CC=typeof navigator<"u"&&/Mac/.test(navigator.platform),SC=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Ye=0;Ye<10;Ye++)Rn[48+Ye]=Rn[96+Ye]=String(Ye);for(Ye=1;Ye<=24;Ye++)Rn[Ye+111]="F"+Ye;for(Ye=65;Ye<=90;Ye++)Rn[Ye]=String.fromCharCode(Ye+32),As[Ye]=String.fromCharCode(Ye);for(var Wc in Rn)As.hasOwnProperty(Wc)||(As[Wc]=Rn[Wc]);const EC=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),MC=typeof navigator<"u"&&/Win/.test(navigator.platform);function NC(t){let e,n,o,i,s=t.split(/-(?!$)/),a=s[s.length-1];a=="Space"&&(a=" ");for(let l=0;l<s.length-1;l++){let c=s[l];if(/^(cmd|meta|m)$/i.test(c))i=!0;else if(/^a(lt)?$/i.test(c))e=!0;else if(/^(c|ctrl|control)$/i.test(c))n=!0;else if(/^s(hift)?$/i.test(c))o=!0;else{if(!/^mod$/i.test(c))throw new Error("Unrecognized modifier name: "+c);EC?i=!0:n=!0}}return e&&(a="Alt-"+a),n&&(a="Ctrl-"+a),i&&(a="Meta-"+a),o&&(a="Shift-"+a),a}function Kc(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function av(t){let e=function(n){let o=Object.create(null);for(let i in n)o[NC(i)]=n[i];return o}(t);return function(n,o){let i,s=function(l){var c=!(CC&&l.metaKey&&l.shiftKey&&!l.ctrlKey&&!l.altKey||SC&&l.shiftKey&&l.key&&l.key.length==1||l.key=="Unidentified")&&l.key||(l.shiftKey?As:Rn)[l.keyCode]||l.key||"Unidentified";return c=="Esc"&&(c="Escape"),c=="Del"&&(c="Delete"),c=="Left"&&(c="ArrowLeft"),c=="Up"&&(c="ArrowUp"),c=="Right"&&(c="ArrowRight"),c=="Down"&&(c="ArrowDown"),c}(o),a=e[Kc(s,o)];if(a&&a(n.state,n.dispatch,n))return!0;if(s.length==1&&s!=" "){if(o.shiftKey){let l=e[Kc(s,o,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((o.altKey||o.metaKey||o.ctrlKey)&&!(MC&&o.ctrlKey&&o.altKey)&&(i=Rn[o.keyCode])&&i!=s){let l=e[Kc(i,o)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var BC=Object.defineProperty,Uc=(t,e)=>{for(var n in e)BC(t,n,{get:e[n],enumerable:!0})};function Ds(t){const{state:e,transaction:n}=t;let{selection:o}=n,{doc:i}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return o},get doc(){return i},get tr(){return o=n.selection,i=n.doc,s=n.storedMarks,n}}}var Is=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:o}=e,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([a,l])=>[a,(...c)=>{const d=l(...c)(s);return i.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(i),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:o,state:i}=this,{view:s}=o,a=[],l=!!t,c=t||i.tr,d={...Object.fromEntries(Object.entries(n).map(([u,p])=>[u,(...h)=>{const f=this.buildProps(c,e),m=p(...h)(f);return a.push(m),d}])),run:()=>(l||!e||c.getMeta("preventDispatch")||this.hasCustomState||s.dispatch(c),a.every(u=>u===!0))};return d}createCan(t){const{rawCommands:e,state:n}=this,o=!1,i=t||n.tr,s=this.buildProps(i,o);return{...Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...c)=>l(...c)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,o)}}buildProps(t,e=!0){const{rawCommands:n,editor:o,state:i}=this,{view:s}=o,a={tr:t,editor:o,view:s,state:Ds({state:i,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...d)=>c(...d)(a)]))}};return a}},lv={};Uc(lv,{blur:()=>TC,clearContent:()=>OC,clearNodes:()=>_C,command:()=>VC,createParagraphNear:()=>AC,cut:()=>DC,deleteCurrentNode:()=>IC,deleteNode:()=>RC,deleteRange:()=>LC,deleteSelection:()=>$C,enter:()=>PC,exitCode:()=>zC,extendMarkRange:()=>FC,first:()=>jC,focus:()=>HC,forEach:()=>WC,insertContent:()=>KC,insertContentAt:()=>UC,joinBackward:()=>GC,joinDown:()=>JC,joinForward:()=>YC,joinItemBackward:()=>XC,joinItemForward:()=>QC,joinTextblockBackward:()=>ZC,joinTextblockForward:()=>eS,joinUp:()=>qC,keyboardShortcut:()=>tS,lift:()=>nS,liftEmptyBlock:()=>oS,liftListItem:()=>rS,newlineInCode:()=>iS,resetAttributes:()=>sS,scrollIntoView:()=>aS,selectAll:()=>lS,selectNodeBackward:()=>cS,selectNodeForward:()=>dS,selectParentNode:()=>uS,selectTextblockEnd:()=>pS,selectTextblockStart:()=>hS,setContent:()=>fS,setMark:()=>mS,setMeta:()=>gS,setNode:()=>vS,setNodeSelection:()=>yS,setTextSelection:()=>bS,sinkListItem:()=>kS,splitBlock:()=>wS,splitListItem:()=>xS,toggleList:()=>CS,toggleMark:()=>SS,toggleNode:()=>ES,toggleWrap:()=>MS,undoInputRule:()=>NS,unsetAllMarks:()=>BS,unsetMark:()=>TS,updateAttributes:()=>OS,wrapIn:()=>_S,wrapInList:()=>VS});var TC=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),OC=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),_C=()=>({state:t,tr:e,dispatch:n})=>{const{selection:o}=e,{ranges:i}=o;return!n||(i.forEach(({$from:s,$to:a})=>{t.doc.nodesBetween(s.pos,a.pos,(l,c)=>{if(l.type.isText)return;const{doc:d,mapping:u}=e,p=d.resolve(u.map(c)),h=d.resolve(u.map(c+l.nodeSize)),f=p.blockRange(h);if(!f)return;const m=Xo(f);if(l.type.isTextblock){const{defaultType:g}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(f.start,g)}(m||m===0)&&e.lift(f,m)})}),!0)},VC=t=>e=>t(e),AC=()=>({state:t,dispatch:e})=>Wm(t,e),DC=(t,e)=>({editor:n,tr:o})=>{const{state:i}=n,s=i.doc.slice(t.from,t.to);o.deleteRange(t.from,t.to);const a=o.mapping.map(e);return o.insert(a,s.content),o.setSelection(new le(o.doc.resolve(Math.max(a-1,0)))),!0},IC=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,o=n.$anchor.node();if(o.content.size>0)return!1;const i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===o.type){if(e){const a=i.before(s),l=i.after(s);t.delete(a,l).scrollIntoView()}return!0}return!1};function Pe(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var RC=t=>({tr:e,state:n,dispatch:o})=>{const i=Pe(t,n.schema),s=e.selection.$anchor;for(let a=s.depth;a>0;a-=1)if(s.node(a).type===i){if(o){const l=s.before(a),c=s.after(a);e.delete(l,c).scrollIntoView()}return!0}return!1},LC=t=>({tr:e,dispatch:n})=>{const{from:o,to:i}=t;return n&&e.delete(o,i),!0},$C=()=>({state:t,dispatch:e})=>mc(t,e),PC=()=>({commands:t})=>t.keyboardShortcut("Enter"),zC=()=>({state:t,dispatch:e})=>((n,o)=>{let{$head:i,$anchor:s}=n.selection;if(!i.parent.type.spec.code||!i.sameParent(s))return!1;let a=i.node(-1),l=i.indexAfter(-1),c=yc(a.contentMatchAt(l));if(!c||!a.canReplaceWith(l,l,c))return!1;if(o){let d=i.after(),u=n.tr.replaceWith(d,d,c.createAndFill());u.setSelection(he.near(u.doc.resolve(d),1)),o(u.scrollIntoView())}return!0})(t,e);function qc(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Rs(t,e,n={strict:!0}){const o=Object.keys(e);return!o.length||o.every(i=>n.strict?e[i]===t[i]:qc(e[i])?e[i].test(t[i]):e[i]===t[i])}function cv(t,e,n={}){return t.find(o=>o.type===e&&Rs(Object.fromEntries(Object.keys(n).map(i=>[i,o.attrs[i]])),n))}function dv(t,e,n={}){return!!cv(t,e,n)}function Jc(t,e,n){var o;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if(i.node&&i.node.marks.some(d=>d.type===e)||(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(d=>d.type===e)||(n=n||((o=i.node.marks[0])==null?void 0:o.attrs),!cv([...i.node.marks],e,n)))return;let s=i.index,a=t.start()+i.offset,l=s+1,c=a+i.node.nodeSize;for(;s>0&&dv([...t.parent.child(s-1).marks],e,n);)s-=1,a-=t.parent.child(s).nodeSize;for(;l<t.parent.childCount&&dv([...t.parent.child(l).marks],e,n);)c+=t.parent.child(l).nodeSize,l+=1;return{from:a,to:c}}function dn(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var FC=(t,e={})=>({tr:n,state:o,dispatch:i})=>{const s=dn(t,o.schema),{doc:a,selection:l}=n,{$from:c,from:d,to:u}=l;if(i){const p=Jc(c,s,e);if(p&&p.from<=d&&p.to>=u){const h=le.create(a,p.from,p.to);n.setSelection(h)}}return!0},jC=t=>e=>{const n=typeof t=="function"?t(e):t;for(let o=0;o<n.length;o+=1)if(n[o](e))return!0;return!1};function uv(t){return t instanceof le}function go(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function pv(t,e=null){if(!e)return null;const n=he.atStart(t),o=he.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return o;const i=n.from,s=o.to;return e==="all"?le.create(t,go(0,i,s),go(t.content.size,i,s)):le.create(t,go(e,i,s),go(e,i,s))}function Gc(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var HC=(t=null,e={})=>({editor:n,view:o,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const a=()=>{(Gc()||navigator.platform==="Android"||/android/i.test(navigator.userAgent))&&o.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(o.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(o.hasFocus()&&t===null||t===!1)return!0;if(s&&t===null&&!uv(n.state.selection))return a(),!0;const l=pv(i.doc,t)||n.state.selection,c=n.state.selection.eq(l);return s&&(c||i.setSelection(l),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},WC=(t,e)=>n=>t.every((o,i)=>e(o,{...n,index:i})),KC=(t,e)=>({tr:n,commands:o})=>o.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),hv=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const o=e[n];o.nodeType===3&&o.nodeValue&&/^(\n\s\s|\n)$/.test(o.nodeValue)?t.removeChild(o):o.nodeType===1&&hv(o)}return t};function Ls(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return hv(n)}function oi(t,e,n){if(t instanceof Cn||t instanceof H)return t;n={slice:!0,parseOptions:{},...n};const o=typeof t=="string";if(typeof t=="object"&&t!==null)try{if(Array.isArray(t)&&t.length>0)return H.fromArray(t.map(s=>e.nodeFromJSON(s)));const i=e.nodeFromJSON(t);return n.errorOnInvalidContent&&i.check(),i}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),oi("",e,n)}if(o){if(n.errorOnInvalidContent){let s=!1,a="";const l=new lm({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?Sn.fromSchema(l).parseSlice(Ls(t),n.parseOptions):Sn.fromSchema(l).parse(Ls(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=Sn.fromSchema(e);return n.slice?i.parseSlice(Ls(t),n.parseOptions).content:i.parse(Ls(t),n.parseOptions)}return oi("",e,n)}var UC=(t,e,n)=>({tr:o,dispatch:i,editor:s})=>{var a;if(i){let l;const c=g=>{s.emit("contentError",{editor:s,error:g,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},d={preserveWhitespace:"full",...(n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n}).parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{oi(e,s.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(g){c(g)}try{l=oi(e,s.schema,{parseOptions:d,errorOnInvalidContent:(a=n.errorOnInvalidContent)!=null?a:s.options.enableContentCheck})}catch(g){return c(g),!1}let u,{from:p,to:h}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,m=!0;if(("type"in l?[l]:l).forEach(g=>{g.check(),f=!!f&&g.isText&&g.marks.length===0,m=!!m&&g.isBlock}),p===h&&m){const{parent:g}=o.doc.resolve(p);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(p-=1,h+=1)}if(f){if(Array.isArray(e))u=e.map(g=>g.text||"").join("");else if(e instanceof H){let g="";e.forEach(v=>{v.text&&(g+=v.text)}),u=g}else u=typeof e=="object"&&e&&e.text?e.text:e;o.insertText(u,p,h)}else{u=l;const g=o.doc.resolve(p),v=g.node(),b=g.parentOffset===0,y=v.isText||v.isTextblock,k=v.content.size>0;b&&y&&k&&(p=Math.max(0,p-1)),o.replaceWith(p,h,u)}n.updateSelection&&function(g,v){const b=g.steps.length-1;if(b<v)return;const y=g.steps[b];if(!(y instanceof We||y instanceof Ke))return;const k=g.mapping.maps[b];let x=0;k.forEach((w,C,S,E)=>{x===0&&(x=E)}),g.setSelection(he.near(g.doc.resolve(x),-1))}(o,o.steps.length-1),n.applyInputRules&&o.setMeta("applyInputRules",{from:p,text:u}),n.applyPasteRules&&o.setMeta("applyPasteRules",{from:p,text:u})}return!0},qC=()=>({state:t,dispatch:e})=>((n,o)=>{let i,s=n.selection,a=s instanceof re;if(a){if(s.node.isTextblock||!Nn(n.doc,s.from))return!1;i=s.from}else if(i=xs(n.doc,s.from,-1),i==null)return!1;if(o){let l=n.tr.join(i);a&&l.setSelection(re.create(l.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),o(l.scrollIntoView())}return!0})(t,e),JC=()=>({state:t,dispatch:e})=>((n,o)=>{let i,s=n.selection;if(s instanceof re){if(s.node.isTextblock||!Nn(n.doc,s.to))return!1;i=s.to}else if(i=xs(n.doc,s.to,1),i==null)return!1;return o&&o(n.tr.join(i).scrollIntoView()),!0})(t,e),GC=()=>({state:t,dispatch:e})=>Lm(t,e),YC=()=>({state:t,dispatch:e})=>Fm(t,e),XC=()=>({state:t,dispatch:e,tr:n})=>{try{const o=xs(t.doc,t.selection.$from.pos,-1);return o!=null&&(n.join(o,2),e&&e(n),!0)}catch{return!1}},QC=()=>({state:t,dispatch:e,tr:n})=>{try{const o=xs(t.doc,t.selection.$from.pos,1);return o!=null&&(n.join(o,2),e&&e(n),!0)}catch{return!1}},ZC=()=>({state:t,dispatch:e})=>((n,o)=>{let i=Rm(n,void 0);if(!i)return!1;let s=gc(i);return!!s&&$m(n,s,o)})(t,e),eS=()=>({state:t,dispatch:e})=>((n,o)=>{let i=zm(n,void 0);if(!i)return!1;let s=vc(i);return!!s&&$m(n,s,o)})(t,e);function fv(){return typeof navigator<"u"&&/Mac/.test(navigator.platform)}var tS=t=>({editor:e,view:n,tr:o,dispatch:i})=>{const s=function(d){const u=d.split(/-(?!$)/);let p,h,f,m,g=u[u.length-1];g==="Space"&&(g=" ");for(let v=0;v<u.length-1;v+=1){const b=u[v];if(/^(cmd|meta|m)$/i.test(b))m=!0;else if(/^a(lt)?$/i.test(b))p=!0;else if(/^(c|ctrl|control)$/i.test(b))h=!0;else if(/^s(hift)?$/i.test(b))f=!0;else{if(!/^mod$/i.test(b))throw new Error(`Unrecognized modifier name: ${b}`);Gc()||fv()?m=!0:h=!0}}return p&&(g=`Alt-${g}`),h&&(g=`Ctrl-${g}`),m&&(g=`Meta-${g}`),f&&(g=`Shift-${g}`),g}(t).split(/-(?!$)/),a=s.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,l))});return c==null||c.steps.forEach(d=>{const u=d.map(o.mapping);u&&i&&o.maybeStep(u)}),!0};function Ln(t,e,n={}){const{from:o,to:i,empty:s}=t.selection,a=e?Pe(e,t.schema):null,l=[];t.doc.nodesBetween(o,i,(u,p)=>{if(u.isText)return;const h=Math.max(o,p),f=Math.min(i,p+u.nodeSize);l.push({node:u,from:h,to:f})});const c=i-o,d=l.filter(u=>!a||a.name===u.node.type.name).filter(u=>Rs(u.node.attrs,n,{strict:!1}));return s?!!d.length:d.reduce((u,p)=>u+p.to-p.from,0)>=c}var nS=(t,e={})=>({state:n,dispatch:o})=>!!Ln(n,Pe(t,n.schema),e)&&((i,s)=>{let{$from:a,$to:l}=i.selection,c=a.blockRange(l),d=c&&Xo(c);return d!=null&&(s&&s(i.tr.lift(c,d).scrollIntoView()),!0)})(n,o),oS=()=>({state:t,dispatch:e})=>Km(t,e),rS=t=>({state:e,dispatch:n})=>{return(o=Pe(t,e.schema),function(i,s){let{$from:a,$to:l}=i.selection,c=a.blockRange(l,d=>d.childCount>0&&d.firstChild.type==o);return!!c&&(!s||(a.node(c.depth-1).type==o?function(d,u,p,h){let f=d.tr,m=h.end,g=h.$to.end(h.depth);m<g&&(f.step(new Ke(m-1,g,m,g,new Q(H.from(p.create(null,h.parent.copy())),1,0),1,!0)),h=new ys(f.doc.resolve(h.$from.pos),f.doc.resolve(g),h.depth));const v=Xo(h);if(v==null)return!1;f.lift(h,v);let b=f.doc.resolve(f.mapping.map(m,-1)-1);return Nn(f.doc,b.pos)&&b.nodeBefore.type==b.nodeAfter.type&&f.join(b.pos),u(f.scrollIntoView()),!0}(i,s,o,c):function(d,u,p){let h=d.tr,f=p.parent;for(let C=p.end,S=p.endIndex-1,E=p.startIndex;S>E;S--)C-=f.child(S).nodeSize,h.delete(C-1,C+1);let m=h.doc.resolve(p.start),g=m.nodeAfter;if(h.mapping.map(p.end)!=p.start+m.nodeAfter.nodeSize)return!1;let v=p.startIndex==0,b=p.endIndex==f.childCount,y=m.node(-1),k=m.index(-1);if(!y.canReplace(k+(v?0:1),k+1,g.content.append(b?H.empty:H.from(f))))return!1;let x=m.pos,w=x+g.nodeSize;return h.step(new Ke(x-(v?1:0),w+(b?1:0),x+1,w-1,new Q((v?H.empty:H.from(f.copy(H.empty))).append(b?H.empty:H.from(f.copy(H.empty))),v?0:1,b?0:1),v?0:1)),u(h.scrollIntoView()),!0}(i,s,c)))})(e,n);var o},iS=()=>({state:t,dispatch:e})=>Hm(t,e);function $s(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function mv(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((o,i)=>(n.includes(i)||(o[i]=t[i]),o),{})}var sS=(t,e)=>({tr:n,state:o,dispatch:i})=>{let s=null,a=null;const l=$s(typeof t=="string"?t:t.name,o.schema);return!!l&&(l==="node"&&(s=Pe(t,o.schema)),l==="mark"&&(a=dn(t,o.schema)),i&&n.selection.ranges.forEach(c=>{o.doc.nodesBetween(c.$from.pos,c.$to.pos,(d,u)=>{s&&s===d.type&&n.setNodeMarkup(u,void 0,mv(d.attrs,e)),a&&d.marks.length&&d.marks.forEach(p=>{a===p.type&&n.addMark(u,u+d.nodeSize,a.create(mv(p.attrs,e)))})})}),!0)},aS=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),lS=()=>({tr:t,dispatch:e})=>{if(e){const n=new kt(t.doc);t.setSelection(n)}return!0},cS=()=>({state:t,dispatch:e})=>Pm(t,e),dS=()=>({state:t,dispatch:e})=>jm(t,e),uS=()=>({state:t,dispatch:e})=>((n,o)=>{let i,{$from:s,to:a}=n.selection,l=s.sharedDepth(a);return l!=0&&(i=s.before(l),o&&o(n.tr.setSelection(re.create(n.doc,i))),!0)})(t,e),pS=()=>({state:t,dispatch:e})=>qx(t,e),hS=()=>({state:t,dispatch:e})=>Ux(t,e);function Yc(t,e,n={},o={}){return oi(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:o.errorOnInvalidContent})}var fS=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:o={}}={})=>({editor:i,tr:s,dispatch:a,commands:l})=>{const{doc:c}=s;if(o.preserveWhitespace!=="full"){const d=Yc(t,i.schema,o,{errorOnInvalidContent:e??i.options.enableContentCheck});return a&&s.replaceWith(0,c.content.size,d).setMeta("preventUpdate",!n),!0}return a&&s.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:c.content.size},t,{parseOptions:o,errorOnInvalidContent:e??i.options.enableContentCheck})};function gv(t,e){const n=dn(e,t.schema),{from:o,to:i,empty:s}=t.selection,a=[];s?(t.storedMarks&&a.push(...t.storedMarks),a.push(...t.selection.$head.marks())):t.doc.nodesBetween(o,i,c=>{a.push(...c.marks)});const l=a.find(c=>c.type.name===n.name);return l?{...l.attrs}:{}}function vv(t,e){const n=new Tm(t);return e.forEach(o=>{o.steps.forEach(i=>{n.step(i)})}),n}function Ps(t){return e=>function(n,o){for(let i=n.depth;i>0;i-=1){const s=n.node(i);if(o(s))return{pos:i>0?n.before(i):0,start:n.start(i),depth:i,node:s}}}(e.$from,t)}function ne(t,e,n){return t.config[e]===void 0&&t.parent?ne(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?ne(t.parent,e,n):null}):t.config[e]}function Xc(t){return t.map(e=>{const n=ne(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return n?[e,...Xc(n())]:e}).flat(10)}function Qc(t,e){const n=ao.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function yv(t){return typeof t=="function"}function ve(t,e=void 0,...n){return yv(t)?e?t.bind(e)(...n):t(...n):t}function ri(t){return{baseExtensions:t.filter(e=>e.type==="extension"),nodeExtensions:t.filter(e=>e.type==="node"),markExtensions:t.filter(e=>e.type==="mark")}}function bv(t){const e=[],{nodeExtensions:n,markExtensions:o}=ri(t),i=[...n,...o],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(a=>{const l=ne(a,"addGlobalAttributes",{name:a.name,options:a.options,storage:a.storage,extensions:i});l&&l().forEach(c=>{c.types.forEach(d=>{Object.entries(c.attributes).forEach(([u,p])=>{e.push({type:d,name:u,attribute:{...s,...p}})})})})}),i.forEach(a=>{const l={name:a.name,options:a.options,storage:a.storage},c=ne(a,"addAttributes",l);if(!c)return;const d=c();Object.entries(d).forEach(([u,p])=>{const h={...s,...p};typeof(h==null?void 0:h.default)=="function"&&(h.default=h.default()),h!=null&&h.isRequired&&(h==null?void 0:h.default)===void 0&&delete h.default,e.push({type:a.name,name:u,attribute:h})})}),e}function Re(...t){return t.filter(e=>!!e).reduce((e,n)=>{const o={...e};return Object.entries(n).forEach(([i,s])=>{if(o[i])if(i==="class"){const a=s?String(s).split(" "):[],l=o[i]?o[i].split(" "):[],c=a.filter(d=>!l.includes(d));o[i]=[...l,...c].join(" ")}else if(i==="style"){const a=s?s.split(";").map(d=>d.trim()).filter(Boolean):[],l=o[i]?o[i].split(";").map(d=>d.trim()).filter(Boolean):[],c=new Map;l.forEach(d=>{const[u,p]=d.split(":").map(h=>h.trim());c.set(u,p)}),a.forEach(d=>{const[u,p]=d.split(":").map(h=>h.trim());c.set(u,p)}),o[i]=Array.from(c.entries()).map(([d,u])=>`${d}: ${u}`).join("; ")}else o[i]=s;else o[i]=s}),o},{})}function zs(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,o)=>Re(n,o),{})}function kv(t,e){return"style"in t?t:{...t,getAttrs:n=>{const o=t.getAttrs?t.getAttrs(n):t.attrs;if(o===!1)return!1;const i=e.reduce((s,a)=>{const l=a.attribute.parseHTML?a.attribute.parseHTML(n):function(c){return typeof c!="string"?c:c.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(c):c==="true"||c!=="false"&&c}(n.getAttribute(a.name));return l==null?s:{...s,[a.name]:l}},{});return{...o,...i}}}}function wv(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>(e!=="attrs"||!function(o={}){return Object.keys(o).length===0&&o.constructor===Object}(n))&&n!=null))}function Zc(t){return t.sort((e,n)=>{const o=ne(e,"priority")||100,i=ne(n,"priority")||100;return o>i?-1:o<i?1:0})}function xv(t){const e=Zc(Xc(t)),n=function(o){const i=o.filter((s,a)=>o.indexOf(s)!==a);return Array.from(new Set(i))}(e.map(o=>o.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),e}function Cv(t,e,n){const{from:o,to:i}=e,{blockSeparator:s=`
45
+ `))),0,0),t.someProp("transformPasted",h=>{a=h(a,t,!0)}),a;let p=t.someProp("clipboardTextParser",h=>h(e,i,o,t));if(p)a=p;else{let h=i.marks(),{schema:f}=t.state,m=ao.fromSchema(f);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let v=s.appendChild(document.createElement("p"));g&&v.appendChild(m.serializeNode(f.text(g,h)))})}}else t.someProp("transformPastedHTML",p=>{n=p(n,t)}),s=function(p){let h=/^(\s*<meta [^>]*>)*/.exec(p);h&&(p=p.slice(h[0].length));let f,m=$g().createElement("div"),g=/<([a-z][^>\s]+)/i.exec(p);if((f=g&&Rg[g[1].toLowerCase()])&&(p=f.map(v=>"<"+v+">").join("")+p+f.map(v=>"</"+v+">").reverse().join("")),m.innerHTML=function(v){let b=window.trustedTypes;return b?(Ic||(Ic=b.defaultPolicy||b.createPolicy("ProseMirrorClipboard",{createHTML:y=>y})),Ic.createHTML(v)):v}(p),f)for(let v=0;v<f.length;v++)m=m.querySelector(f[v])||m;return m}(n),Gr&&function(p){let h=p.querySelectorAll(Ze?"span:not([class]):not([style])":"span.Apple-converted-space");for(let f=0;f<h.length;f++){let m=h[f];m.childNodes.length==1&&m.textContent==" "&&m.parentNode&&m.parentNode.replaceChild(p.ownerDocument.createTextNode(" "),m)}}(s);let d=s&&s.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let p=+u[3];p>0;p--){let h=s.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;s=h}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Sn.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!(!c&&!u),context:i,ruleFromNode:h=>h.nodeName!="BR"||h.nextSibling||!h.parentNode||lC.test(h.parentNode.nodeName)?null:{ignore:!0}})),u)a=function(p,h){if(!p.size)return p;let f,m=p.content.firstChild.type.schema;try{f=JSON.parse(h)}catch{return p}let{content:g,openStart:v,openEnd:b}=p;for(let y=f.length-2;y>=0;y-=2){let k=m.nodes[f[y]];if(!k||k.hasRequiredAttrs())break;g=H.from(k.create(f[y+1],g)),v++,b++}return new Q(g,v,b)}(Ig(a,+u[1],+u[2]),u[4]);else if(a=Q.maxOpen(function(p,h){if(p.childCount<2)return p;for(let f=h.depth;f>=0;f--){let m,g=h.node(f).contentMatchAt(h.index(f)),v=[];if(p.forEach(b=>{if(!v)return;let y,k=g.findWrapping(b.type);if(!k)return v=null;if(y=v.length&&m.length&&Dg(k,m,b,v[v.length-1],0))v[v.length-1]=y;else{v.length&&(v[v.length-1]=Ag(v[v.length-1],m.length));let x=Vg(b,k);v.push(x),g=g.matchType(x.type),m=k}}),v)return H.from(v)}return p}(a.content,i),!0),a.openStart||a.openEnd){let p=0,h=0;for(let f=a.content.firstChild;p<a.openStart&&!f.type.spec.isolating;p++,f=f.firstChild);for(let f=a.content.lastChild;h<a.openEnd&&!f.type.spec.isolating;h++,f=f.lastChild);a=Ig(a,p,h)}return t.someProp("transformPasted",p=>{a=p(a,t,c)}),a}const lC=/^(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 Vg(t,e,n=0){for(let o=e.length-1;o>=n;o--)t=e[o].create(null,H.from(t));return t}function Dg(t,e,n,o,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=Dg(t,e,n,o.lastChild,i+1);if(s)return o.copy(o.content.replaceChild(o.childCount-1,s));if(o.contentMatchAt(o.childCount).matchType(i==t.length-1?n.type:t[i+1]))return o.copy(o.content.append(H.from(Vg(n,t,i+1))))}}function Ag(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Ag(t.lastChild,e-1)),o=t.contentMatchAt(t.childCount).fillBefore(H.empty,!0);return t.copy(n.append(o))}function Ac(t,e,n,o,i,s){let a=e<0?t.firstChild:t.lastChild,l=a.content;return t.childCount>1&&(s=0),i<o-1&&(l=Ac(l,e,n,o,i+1,s)),i>=n&&(l=e<0?a.contentMatchAt(0).fillBefore(l,s<=i).append(l):l.append(a.contentMatchAt(a.childCount).fillBefore(H.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(l))}function Ig(t,e,n){return e<t.openStart&&(t=new Q(Ac(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new Q(Ac(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Rg={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let Lg=null;function $g(){return Lg||(Lg=document.implementation.createHTMLDocument("title"))}let Ic=null;const rt={},it={},cC={touchstart:!0,touchmove:!0};class dC{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Dn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function Rc(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=o=>Lc(t,o))})}function Lc(t,e){return t.someProp("handleDOMEvents",n=>{let o=n[e.type];return!!o&&(o(t,e)||e.defaultPrevented)})}function uC(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function Ts(t){return{left:t.clientX,top:t.clientY}}function $c(t,e,n,o,i){if(o==-1)return!1;let s=t.state.doc.resolve(o);for(let a=s.depth+1;a>0;a--)if(t.someProp(e,l=>a>s.depth?l(t,n,s.nodeAfter,s.before(a),i,!0):l(t,n,s.node(a),s.before(a),i,!1)))return!0;return!1}function sr(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let o=t.state.tr.setSelection(e);o.setMeta("pointer",!0),t.dispatch(o)}function pC(t,e,n,o){return $c(t,"handleDoubleClickOn",e,n,o)||t.someProp("handleDoubleClick",i=>i(t,e,o))}function hC(t,e,n,o){return $c(t,"handleTripleClickOn",e,n,o)||t.someProp("handleTripleClick",i=>i(t,e,o))||function(i,s,a){if(a.button!=0)return!1;let l=i.state.doc;if(s==-1)return!!l.inlineContent&&(sr(i,le.create(l,0,l.content.size)),!0);let c=l.resolve(s);for(let d=c.depth+1;d>0;d--){let u=d>c.depth?c.nodeAfter:c.node(d),p=c.before(d);if(u.inlineContent)sr(i,le.create(l,p+1,p+1+u.content.size));else{if(!re.isSelectable(u))continue;sr(i,re.create(l,p))}return!0}}(t,n,o)}function Pc(t){return Os(t)}it.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!zg(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!an||!Ze||n.keyCode!=13))if(n.keyCode!=229&&t.domObserver.forceFlush(),!or||n.keyCode!=13||n.ctrlKey||n.altKey||n.metaKey)t.someProp("handleKeyDown",o=>o(t,n))||function(o,i){let s=i.keyCode,a=function(l){let c="";return l.ctrlKey&&(c+="c"),l.metaKey&&(c+="m"),l.altKey&&(c+="a"),l.shiftKey&&(c+="s"),c}(i);if(s==8||Ot&&s==72&&a=="c")return Tg(o,-1)||ir(o,-1);if(s==46&&!i.shiftKey||Ot&&s==68&&a=="c")return Tg(o,1)||ir(o,1);if(s==13||s==27)return!0;if(s==37||Ot&&s==66&&a=="c"){let l=s==37?Ng(o,o.state.selection.from)=="ltr"?-1:1:-1;return Eg(o,l,a)||ir(o,l)}if(s==39||Ot&&s==70&&a=="c"){let l=s==39?Ng(o,o.state.selection.from)=="ltr"?1:-1:1;return Eg(o,l,a)||ir(o,l)}return s==38||Ot&&s==80&&a=="c"?Bg(o,-1,a)||ir(o,-1):s==40||Ot&&s==78&&a=="c"?function(l){if(!ot||l.state.selection.$head.parentOffset>0)return!1;let{focusNode:c,focusOffset:d}=l.domSelectionRange();if(c&&c.nodeType==1&&d==0&&c.firstChild&&c.firstChild.contentEditable=="false"){let u=c.firstChild;Og(l,u,"true"),setTimeout(()=>Og(l,u,"false"),20)}return!1}(o)||Bg(o,1,a)||ir(o,1):a==(Ot?"m":"c")&&(s==66||s==73||s==89||s==90)}(t,n)?n.preventDefault():Dn(t,"key");else{let o=Date.now();t.input.lastIOSEnter=o,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==o&&(t.someProp("handleKeyDown",i=>i(t,uo(13,"Enter"))),t.input.lastIOSEnter=0)},200)}},it.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},it.keypress=(t,e)=>{let n=e;if(zg(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Ot&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n)))return void n.preventDefault();let o=t.state.selection;if(!(o instanceof le&&o.$from.sameParent(o.$to))){let i=String.fromCharCode(n.charCode),s=()=>t.state.tr.insertText(i).scrollIntoView();/[\r\n]/.test(i)||t.someProp("handleTextInput",a=>a(t,o.$from.pos,o.$to.pos,i,s))||t.dispatch(s()),n.preventDefault()}};const Pg=Ot?"metaKey":"ctrlKey";rt.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let o=Pc(t),i=Date.now(),s="singleClick";i-t.input.lastClick.time<500&&function(l,c){let d=c.x-l.clientX,u=c.y-l.clientY;return d*d+u*u<100}(n,t.input.lastClick)&&!n[Pg]&&t.input.lastClick.button==n.button&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s,button:n.button};let a=t.posAtCoords(Ts(n));a&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new fC(t,a,n,!!o)):(s=="doubleClick"?pC:hC)(t,a.pos,a.inside,n)?n.preventDefault():Dn(t,"pointer"))};class fC{constructor(e,n,o,i){let s,a;if(this.view=e,this.pos=n,this.event=o,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!o[Pg],this.allowDefault=o.shiftKey,n.inside>-1)s=e.state.doc.nodeAt(n.inside),a=n.inside;else{let u=e.state.doc.resolve(n.pos);s=u.parent,a=u.depth?u.before():0}const l=i?null:o.target,c=l?e.docView.nearestDesc(l,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:d}=e.state;(o.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||d instanceof re&&d.from<=a&&d.to>a)&&(this.mightDrag={node:s,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Tt||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)),Dn(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(()=>cn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Ts(e))),this.updateAllowDefault(e),this.allowDefault||!n?Dn(this.view,"pointer"):function(o,i,s,a,l){return $c(o,"handleClickOn",i,s,a)||o.someProp("handleClick",c=>c(o,i,a))||(l?function(c,d){if(d==-1)return!1;let u,p,h=c.state.selection;h instanceof re&&(u=h.node);let f=c.state.doc.resolve(d);for(let m=f.depth+1;m>0;m--){let g=m>f.depth?f.nodeAfter:f.node(m);if(re.isSelectable(g)){p=u&&h.$from.depth>0&&m>=h.$from.depth&&f.before(h.$from.depth+1)==h.$from.pos?f.before(h.$from.depth):f.before(m);break}}return p!=null&&(sr(c,re.create(c.state.doc,p)),!0)}(o,s):function(c,d){if(d==-1)return!1;let u=c.state.doc.resolve(d),p=u.nodeAfter;return!!(p&&p.isAtom&&re.isSelectable(p))&&(sr(c,new re(u)),!0)}(o,s))}(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||ot&&this.mightDrag&&!this.mightDrag.node.isAtom||Ze&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(sr(this.view,he.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Dn(this.view,"pointer")}move(e){this.updateAllowDefault(e),Dn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function zg(t,e){return!!t.composing||!!(ot&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}rt.touchstart=t=>{t.input.lastTouch=Date.now(),Pc(t),Dn(t,"pointer")},rt.touchmove=t=>{t.input.lastTouch=Date.now(),Dn(t,"pointer")},rt.contextmenu=t=>Pc(t);const mC=an?5e3:-1;function Fg(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Os(t),e))}function jg(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Os(t,e=!1){if(!(an&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),jg(t),e||t.docView&&t.docView.dirty){let n=Bc(t),o=t.state.selection;return n&&!n.eq(o)?t.dispatch(t.state.tr.setSelection(n)):!t.markCursor&&!e||o.$from.node(o.$from.sharedDepth(o.to)).inlineContent?t.updateState(t.state):t.dispatch(t.state.tr.deleteSelection()),!0}return!1}}it.compositionstart=it.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof le&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(o=>o.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Os(t,!0),t.markCursor=null;else if(Os(t,!e.selection.empty),Tt&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let o=t.domSelectionRange();for(let i=o.focusNode,s=o.focusOffset;i&&i.nodeType==1&&s!=0;){let a=s<0?i.lastChild:i.childNodes[s-1];if(!a)break;if(a.nodeType==3){let l=t.domSelection();l&&l.collapse(a,a.nodeValue.length);break}i=a,s=-1}}t.input.composing=!0}Fg(t,mC)},it.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Fg(t,20))};const ei=dt&&Tn<15||or&&Xx<604;function ti(t,e,n,o,i){let s=_g(t,e,n,o,t.state.selection.$from);if(t.someProp("handlePaste",c=>c(t,i,s||Q.empty)))return!0;if(!s)return!1;let a=function(c){return c.openStart==0&&c.openEnd==0&&c.content.childCount==1?c.content.firstChild:null}(s),l=a?t.state.tr.replaceSelectionWith(a,o):t.state.tr.replaceSelection(s);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Hg(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}rt.copy=it.cut=(t,e)=>{let n=e,o=t.state.selection,i=n.type=="cut";if(o.empty)return;let s=ei?null:n.clipboardData,a=o.content(),{dom:l,text:c}=Dc(t,a);s?(n.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",c)):function(d,u){if(!d.dom.parentNode)return;let p=d.dom.parentNode.appendChild(document.createElement("div"));p.appendChild(u),p.style.cssText="position: fixed; left: -10000px; top: 10px";let h=getSelection(),f=document.createRange();f.selectNodeContents(u),d.dom.blur(),h.removeAllRanges(),h.addRange(f),setTimeout(()=>{p.parentNode&&p.parentNode.removeChild(p),d.focus()},50)}(t,l),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},it.paste=(t,e)=>{let n=e;if(t.composing&&!an)return;let o=ei?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;o&&ti(t,Hg(o),o.getData("text/html"),i,n)?n.preventDefault():function(s,a){if(!s.dom.parentNode)return;let l=s.input.shiftKey||s.state.selection.$from.parent.type.spec.code,c=s.dom.parentNode.appendChild(document.createElement(l?"textarea":"div"));l||(c.contentEditable="true"),c.style.cssText="position: fixed; left: -10000px; top: 10px",c.focus();let d=s.input.shiftKey&&s.input.lastKeyCode!=45;setTimeout(()=>{s.focus(),c.parentNode&&c.parentNode.removeChild(c),l?ti(s,c.value,null,d,a):ti(s,c.textContent,c.innerHTML,d,a)},50)}(t,n)};class Wg{constructor(e,n,o){this.slice=e,this.move=n,this.node=o}}const gC=Ot?"altKey":"ctrlKey";function Kg(t,e){let n=t.someProp("dragCopies",o=>!o(e));return n??!e[gC]}rt.dragstart=(t,e)=>{let n=e,o=t.input.mouseDown;if(o&&o.done(),!n.dataTransfer)return;let i,s=t.state.selection,a=s.empty?null:t.posAtCoords(Ts(n));if(!(a&&a.pos>=s.from&&a.pos<=(s instanceof re?s.to-1:s.to))){if(o&&o.mightDrag)i=re.create(t.state.doc,o.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let p=t.docView.nearestDesc(n.target,!0);p&&p.node.type.spec.draggable&&p!=t.docView&&(i=re.create(t.state.doc,p.posBefore))}}let l=(i||t.state.selection).content(),{dom:c,text:d,slice:u}=Dc(t,l);(!n.dataTransfer.files.length||!Ze||Qm>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(ei?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",ei||n.dataTransfer.setData("text/plain",d),t.dragging=new Wg(u,Kg(t,n),i)},rt.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},it.dragover=it.dragenter=(t,e)=>e.preventDefault(),it.drop=(t,e)=>{let n=e,o=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Ts(n));if(!i)return;let s=t.state.doc.resolve(i.pos),a=o&&o.slice;a?t.someProp("transformPasted",m=>{a=m(a,t,!1)}):a=_g(t,Hg(n.dataTransfer),ei?null:n.dataTransfer.getData("text/html"),!1,s);let l=!(!o||!Kg(t,n));if(t.someProp("handleDrop",m=>m(t,n,a||Q.empty,l)))return void n.preventDefault();if(!a)return;n.preventDefault();let c=a?Sm(t.state.doc,s.pos,a):s.pos;c==null&&(c=s.pos);let d=t.state.tr;if(l){let{node:m}=o;m?m.replace(d):d.deleteSelection()}let u=d.mapping.map(c),p=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,h=d.doc;if(p?d.replaceRangeWith(u,u,a.content.firstChild):d.replaceRange(u,u,a),d.doc.eq(h))return;let f=d.doc.resolve(u);if(p&&re.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))d.setSelection(new re(f));else{let m=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((g,v,b,y)=>m=y),d.setSelection(Oc(t,f,d.doc.resolve(m)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))},rt.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&cn(t)},20))},rt.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},rt.beforeinput=(t,e)=>{if(Ze&&an&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,uo(8,"Backspace")))))return;let{$cursor:o}=t.state.selection;o&&o.pos>0&&t.dispatch(t.state.tr.delete(o.pos-1,o.pos).scrollIntoView())},50)}};for(let t in it)rt[t]=it[t];function ni(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class _s{constructor(e,n){this.toDOM=e,this.spec=n||fo,this.side=this.spec.side||0}map(e,n,o,i){let{pos:s,deleted:a}=e.mapResult(n.from+i,this.side<0?-1:1);return a?null:new st(s-o,s-o,this)}valid(){return!0}eq(e){return this==e||e instanceof _s&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ni(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class An{constructor(e,n){this.attrs=e,this.spec=n||fo}map(e,n,o,i){let s=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-o,a=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-o;return s>=a?null:new st(s,a,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof An&&ni(this.attrs,e.attrs)&&ni(this.spec,e.spec)}static is(e){return e.type instanceof An}destroy(){}}class zc{constructor(e,n){this.attrs=e,this.spec=n||fo}map(e,n,o,i){let s=e.mapResult(n.from+i,1);if(s.deleted)return null;let a=e.mapResult(n.to+i,-1);return a.deleted||a.pos<=s.pos?null:new st(s.pos-o,a.pos-o,this)}valid(e,n){let o,{index:i,offset:s}=e.content.findIndex(n.from);return s==n.from&&!(o=e.child(i)).isText&&s+o.nodeSize==n.to}eq(e){return this==e||e instanceof zc&&ni(this.attrs,e.attrs)&&ni(this.spec,e.spec)}destroy(){}}class st{constructor(e,n,o){this.from=e,this.to=n,this.type=o}copy(e,n){return new st(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,o){return this.type.map(e,this,n,o)}static widget(e,n,o){return new st(e,e,new _s(n,o))}static inline(e,n,o,i){return new st(e,n,new An(o,i))}static node(e,n,o,i){return new st(e,n,new zc(o,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof An}get widget(){return this.type instanceof _s}}const ar=[],fo={};class Te{constructor(e,n){this.local=e.length?e:ar,this.children=n.length?n:ar}static create(e,n){return n.length?Vs(n,e,0,fo):et}find(e,n,o){let i=[];return this.findInner(e??0,n??1e9,i,0,o),i}findInner(e,n,o,i,s){for(let a=0;a<this.local.length;a++){let l=this.local[a];l.from<=n&&l.to>=e&&(!s||s(l.spec))&&o.push(l.copy(l.from+i,l.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<n&&this.children[a+1]>e){let l=this.children[a]+1;this.children[a+2].findInner(e-l,n-l,o,i+l,s)}}map(e,n,o){return this==et||e.maps.length==0?this:this.mapInner(e,n,0,0,o||fo)}mapInner(e,n,o,i,s){let a;for(let l=0;l<this.local.length;l++){let c=this.local[l].map(e,o,i);c&&c.type.valid(n,c)?(a||(a=[])).push(c):s.onRemove&&s.onRemove(this.local[l].spec)}return this.children.length?function(l,c,d,u,p,h,f){let m=l.slice();for(let v=0,b=h;v<d.maps.length;v++){let y=0;d.maps[v].forEach((k,x,w,C)=>{let S=C-w-(x-k);for(let E=0;E<m.length;E+=3){let M=m[E+1];if(M<0||k>M+b-y)continue;let N=m[E]+b-y;x>=N?m[E+1]=k<=N?-2:-1:k>=b&&S&&(m[E]+=S,m[E+1]+=S)}y+=S}),b=d.maps[v].map(b,-1)}let g=!1;for(let v=0;v<m.length;v+=3)if(m[v+1]<0){if(m[v+1]==-2){g=!0,m[v+1]=-1;continue}let b=d.map(l[v]+h),y=b-p;if(y<0||y>=u.content.size){g=!0;continue}let k=d.map(l[v+1]+h,-1)-p,{index:x,offset:w}=u.content.findIndex(y),C=u.maybeChild(x);if(C&&w==y&&w+C.nodeSize==k){let S=m[v+2].mapInner(d,C,b+1,l[v]+h+1,f);S!=et?(m[v]=y,m[v+1]=k,m[v+2]=S):(m[v+1]=-2,g=!0)}else g=!0}if(g){let v=function(y,k,x,w,C,S,E){function M(N,T){for(let A=0;A<N.local.length;A++){let $=N.local[A].map(w,C,T);$?x.push($):E.onRemove&&E.onRemove(N.local[A].spec)}for(let A=0;A<N.children.length;A+=3)M(N.children[A+2],N.children[A]+T+1)}for(let N=0;N<y.length;N+=3)y[N+1]==-1&&M(y[N+2],k[N]+S+1);return x}(m,l,c,d,p,h,f),b=Vs(v,u,0,f);c=b.local;for(let y=0;y<m.length;y+=3)m[y+1]<0&&(m.splice(y,3),y-=3);for(let y=0,k=0;y<b.children.length;y+=3){let x=b.children[y];for(;k<m.length&&m[k]<x;)k+=3;m.splice(k,0,b.children[y],b.children[y+1],b.children[y+2])}}return new Te(c.sort(mo),m)}(this.children,a||[],e,n,o,i,s):a?new Te(a.sort(mo),ar):et}add(e,n){return n.length?this==et?Te.create(e,n):this.addInner(e,n,0):this}addInner(e,n,o){let i,s=0;e.forEach((l,c)=>{let d,u=c+o;if(d=qg(n,l,u)){for(i||(i=this.children.slice());s<i.length&&i[s]<c;)s+=3;i[s]==c?i[s+2]=i[s+2].addInner(l,d,u+1):i.splice(s,0,c,c+l.nodeSize,Vs(d,l,u+1,fo)),s+=3}});let a=Ug(s?Jg(n):n,-o);for(let l=0;l<a.length;l++)a[l].type.valid(e,a[l])||a.splice(l--,1);return new Te(a.length?this.local.concat(a).sort(mo):this.local,i||this.children)}remove(e){return e.length==0||this==et?this:this.removeInner(e,0)}removeInner(e,n){let o=this.children,i=this.local;for(let s=0;s<o.length;s+=3){let a,l=o[s]+n,c=o[s+1]+n;for(let u,p=0;p<e.length;p++)(u=e[p])&&u.from>l&&u.to<c&&(e[p]=null,(a||(a=[])).push(u));if(!a)continue;o==this.children&&(o=this.children.slice());let d=o[s+2].removeInner(a,l+1);d!=et?o[s+2]=d:(o.splice(s,3),s-=3)}if(i.length){for(let s,a=0;a<e.length;a++)if(s=e[a])for(let l=0;l<i.length;l++)i[l].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(l--,1))}return o==this.children&&i==this.local?this:i.length||o.length?new Te(i,o):et}forChild(e,n){if(this==et)return this;if(n.isLeaf)return Te.empty;let o,i;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(o=this.children[l+2]);break}let s=e+1,a=s+n.content.size;for(let l=0;l<this.local.length;l++){let c=this.local[l];if(c.from<a&&c.to>s&&c.type instanceof An){let d=Math.max(s,c.from)-s,u=Math.min(a,c.to)-s;d<u&&(i||(i=[])).push(c.copy(d,u))}}if(i){let l=new Te(i.sort(mo),ar);return o?new In([l,o]):l}return o||et}eq(e){if(this==e)return!0;if(!(e instanceof Te)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Fc(this.localsInner(e))}localsInner(e){if(this==et)return ar;if(e.inlineContent||!this.local.some(An.is))return this.local;let n=[];for(let o=0;o<this.local.length;o++)this.local[o].type instanceof An||n.push(this.local[o]);return n}forEachSet(e){e(this)}}Te.empty=new Te([],[]),Te.removeOverlap=Fc;const et=Te.empty;class In{constructor(e){this.members=e}map(e,n){const o=this.members.map(i=>i.map(e,n,fo));return In.from(o)}forChild(e,n){if(n.isLeaf)return Te.empty;let o=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,n);s!=et&&(s instanceof In?o=o.concat(s.members):o.push(s))}return In.from(o)}eq(e){if(!(e instanceof In)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,o=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(n){o&&(n=n.slice(),o=!1);for(let a=0;a<s.length;a++)n.push(s[a])}else n=s}return n?Fc(o?n:n.sort(mo)):ar}static from(e){switch(e.length){case 0:return et;case 1:return e[0];default:return new In(e.every(n=>n instanceof Te)?e:e.reduce((n,o)=>n.concat(o instanceof Te?o:o.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function Ug(t,e){if(!e||!t.length)return t;let n=[];for(let o=0;o<t.length;o++){let i=t[o];n.push(new st(i.from+e,i.to+e,i.type))}return n}function qg(t,e,n){if(e.isLeaf)return null;let o=n+e.nodeSize,i=null;for(let s,a=0;a<t.length;a++)(s=t[a])&&s.from>n&&s.to<o&&((i||(i=[])).push(s),t[a]=null);return i}function Jg(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Vs(t,e,n,o){let i=[],s=!1;e.forEach((l,c)=>{let d=qg(t,l,c+n);if(d){s=!0;let u=Vs(d,l,n+c+1,o);u!=et&&i.push(c,c+l.nodeSize,u)}});let a=Ug(s?Jg(t):t,-n).sort(mo);for(let l=0;l<a.length;l++)a[l].type.valid(e,a[l])||(o.onRemove&&o.onRemove(a[l].spec),a.splice(l--,1));return a.length||i.length?new Te(a,i):et}function mo(t,e){return t.from-e.from||t.to-e.to}function Fc(t){let e=t;for(let n=0;n<e.length-1;n++){let o=e[n];if(o.from!=o.to)for(let i=n+1;i<e.length;i++){let s=e[i];if(s.from!=o.from){s.from<o.to&&(e==t&&(e=t.slice()),e[n]=o.copy(o.from,s.from),Gg(e,i,o.copy(s.from,o.to)));break}s.to!=o.to&&(e==t&&(e=t.slice()),e[i]=s.copy(s.from,o.to),Gg(e,i+1,s.copy(o.to,s.to)))}}return e}function Gg(t,e,n){for(;e<t.length&&mo(n,t[e])>0;)e++;t.splice(e,0,n)}function jc(t){let e=[];return t.someProp("decorations",n=>{let o=n(t.state);o&&o!=et&&e.push(o)}),t.cursorWrapper&&e.push(Te.create(t.state.doc,[t.cursorWrapper.deco])),In.from(e)}const vC={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},yC=dt&&Tn<=11;class bC{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 kC{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new bC,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(o=>{for(let i=0;i<o.length;i++)this.queue.push(o[i]);dt&&Tn<=11&&o.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),yC&&(this.onCharData=o=>{this.queue.push({target:o.target,type:"characterData",oldValue:o.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.takeRecords(),this.observer.observe(this.view.dom,vC)),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 n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.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(Cg(this.view)){if(this.suppressingSelectionUpdates)return cn(this.view);if(dt&&Tn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&co(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n,o=new Set;for(let s=e.focusNode;s;s=nr(s))o.add(s);for(let s=e.anchorNode;s;s=nr(s))if(o.has(s)){n=s;break}let i=n&&this.view.docView.nearestDesc(n);return i&&i.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let o=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(o)&&Cg(e)&&!this.ignoreSelectionChange(o),s=-1,a=-1,l=!1,c=[];if(e.editable)for(let u=0;u<n.length;u++){let p=this.registerMutation(n[u],c);p&&(s=s<0?p.from:Math.min(p.from,s),a=a<0?p.to:Math.max(p.to,a),p.typeOver&&(l=!0))}if(Tt&&c.length){let u=c.filter(p=>p.nodeName=="BR");if(u.length==2){let[p,h]=u;p.parentNode&&p.parentNode.parentNode==h.parentNode?h.remove():p.remove()}else{let{focusNode:p}=this.currentSelection;for(let h of u){let f=h.parentNode;!f||f.nodeName!="LI"||p&&wC(e,p)==f||h.remove()}}}let d=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Es(o)&&(d=Bc(e))&&d.eq(he.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,cn(e),this.currentSelection.set(o),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,a),function(u){if(!Yg.has(u)&&(Yg.set(u,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(u.dom).whiteSpace)!==-1)){if(u.requiresGeckoHackNode=Tt,Xg)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Xg=!0}}(e)),this.handleDOMChange(s,a,l,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(o)||cn(e),this.currentSelection.set(o))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let o=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(o==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!o||o.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;d<e.addedNodes.length;d++){let u=e.addedNodes[d];n.push(u),u.nodeType==3&&(this.lastChangedTextNode=u)}if(o.contentDOM&&o.contentDOM!=o.dom&&!o.contentDOM.contains(e.target))return{from:o.posBefore,to:o.posAfter};let i=e.previousSibling,s=e.nextSibling;if(dt&&Tn<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:u,nextSibling:p}=e.addedNodes[d];(!u||Array.prototype.indexOf.call(e.addedNodes,u)<0)&&(i=u),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(s=p)}let a=i&&i.parentNode==e.target?Ge(i)+1:0,l=o.localPosFromDOM(e.target,a,-1),c=s&&s.parentNode==e.target?Ge(s):e.target.childNodes.length;return{from:l,to:o.localPosFromDOM(e.target,c,1)}}return e.type=="attributes"?{from:o.posAtStart-o.border,to:o.posAtEnd+o.border}:(this.lastChangedTextNode=e.target,{from:o.posAtStart,to:o.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Yg=new WeakMap,Xg=!1;function Qg(t,e){let n=e.startContainer,o=e.startOffset,i=e.endContainer,s=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return co(a.node,a.offset,i,s)&&([n,o,i,s]=[i,s,n,o]),{anchorNode:n,anchorOffset:o,focusNode:i,focusOffset:s}}function wC(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let o=t.docView.nearestDesc(n,!0);if(o&&o.node.isBlock)return n}return null}function xC(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(ot&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}if(t.parentNode.lastChild==t||ot&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const CC=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Zg(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:Oc(t,e.resolve(n.anchor),e.resolve(n.head))}function Hc(t,e,n){let o=t.depth,i=e?t.end():t.pos;for(;o>0&&(e||t.indexAfter(o)==t.node(o).childCount);)o--,i++,e=!1;if(n){let s=t.node(o).maybeChild(t.indexAfter(o));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function ev(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class tv{constructor(e,n){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 dC,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(sv),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=rv(this),ov(this),this.nodeViews=iv(this),this.docView=ug(this.state.doc,nv(this),jc(this),this.dom,this),this.domObserver=new kC(this,(o,i,s,a)=>function(l,c,d,u,p){let h=l.input.compositionPendingChanges||(l.composing?l.input.compositionID:0);if(l.input.compositionPendingChanges=0,c<0){let B=l.input.lastSelectionTime>Date.now()-50?l.input.lastSelectionOrigin:null,V=Bc(l,B);if(V&&!l.state.selection.eq(V)){if(Ze&&an&&l.input.lastKeyCode===13&&Date.now()-100<l.input.lastKeyCodeTime&&l.someProp("handleKeyDown",D=>D(l,uo(13,"Enter"))))return;let O=l.state.tr.setSelection(V);B=="pointer"?O.setMeta("pointer",!0):B=="key"&&O.scrollIntoView(),h&&O.setMeta("composition",h),l.dispatch(O)}return}let f=l.state.doc.resolve(c),m=f.sharedDepth(d);c=f.before(m+1),d=l.state.doc.resolve(d).after(m+1);let g,v,b=l.state.selection,y=function(B,V,O){let D,{node:F,fromOffset:R,toOffset:L,from:I,to:P}=B.docView.parseRange(V,O),W=B.domSelectionRange(),z=W.anchorNode;if(z&&B.dom.contains(z.nodeType==1?z:z.parentNode)&&(D=[{node:z,offset:W.anchorOffset}],Es(W)||D.push({node:W.focusNode,offset:W.focusOffset})),Ze&&B.input.lastKeyCode===8)for(let Y=L;Y>R;Y--){let te=F.childNodes[Y-1],pe=te.pmViewDesc;if(te.nodeName=="BR"&&!pe){L=Y;break}if(!pe||pe.size)break}let j=B.state.doc,K=B.someProp("domParser")||Sn.fromSchema(B.state.schema),G=j.resolve(I),Z=null,J=K.parse(F,{topNode:G.parent,topMatch:G.parent.contentMatchAt(G.index()),topOpen:!0,from:R,to:L,preserveWhitespace:G.parent.type.whitespace!="pre"||"full",findPositions:D,ruleFromNode:xC,context:G});if(D&&D[0].pos!=null){let Y=D[0].pos,te=D[1]&&D[1].pos;te==null&&(te=Y),Z={anchor:Y+I,head:te+I}}return{doc:J,sel:Z,from:I,to:P}}(l,c,d),k=l.state.doc,x=k.slice(y.from,y.to);l.input.lastKeyCode===8&&Date.now()-100<l.input.lastKeyCodeTime?(g=l.state.selection.to,v="end"):(g=l.state.selection.from,v="start"),l.input.lastKeyCode=null;let w=function(B,V,O,D,F){let R=B.findDiffStart(V,O);if(R==null)return null;let{a:L,b:I}=B.findDiffEnd(V,O+B.size,O+V.size);if(F=="end"&&(D-=L+Math.max(0,R-Math.min(L,I))-R),L<R&&B.size<V.size){let P=D<=R&&D>=L?R-D:0;R-=P,R&&R<V.size&&ev(V.textBetween(R-1,R+1))&&(R+=P?1:-1),I=R+(I-L),L=R}else if(I<R){let P=D<=R&&D>=I?R-D:0;R-=P,R&&R<B.size&&ev(B.textBetween(R-1,R+1))&&(R+=P?1:-1),L=R+(L-I),I=R}return{start:R,endA:L,endB:I}}(x.content,y.doc.content,y.from,g,v);if(w&&l.input.domChangeCount++,(or&&l.input.lastIOSEnter>Date.now()-225||an)&&p.some(B=>B.nodeType==1&&!CC.test(B.nodeName))&&(!w||w.endA>=w.endB)&&l.someProp("handleKeyDown",B=>B(l,uo(13,"Enter"))))return void(l.input.lastIOSEnter=0);if(!w){if(!(u&&b instanceof le&&!b.empty&&b.$head.sameParent(b.$anchor))||l.composing||y.sel&&y.sel.anchor!=y.sel.head){if(y.sel){let B=Zg(l,l.state.doc,y.sel);if(B&&!B.eq(l.state.selection)){let V=l.state.tr.setSelection(B);h&&V.setMeta("composition",h),l.dispatch(V)}}return}w={start:b.from,endA:b.to,endB:b.to}}l.state.selection.from<l.state.selection.to&&w.start==w.endB&&l.state.selection instanceof le&&(w.start>l.state.selection.from&&w.start<=l.state.selection.from+2&&l.state.selection.from>=y.from?w.start=l.state.selection.from:w.endA<l.state.selection.to&&w.endA>=l.state.selection.to-2&&l.state.selection.to<=y.to&&(w.endB+=l.state.selection.to-w.endA,w.endA=l.state.selection.to)),dt&&Tn<=11&&w.endB==w.start+1&&w.endA==w.start&&w.start>y.from&&y.doc.textBetween(w.start-y.from-1,w.start-y.from+1)=="  "&&(w.start--,w.endA--,w.endB--);let C=y.doc.resolveNoCache(w.start-y.from),S=y.doc.resolveNoCache(w.endB-y.from),E=k.resolve(w.start),M=C.sameParent(S)&&C.parent.inlineContent&&E.end()>=w.endA;if((or&&l.input.lastIOSEnter>Date.now()-225&&(!M||p.some(B=>B.nodeName=="DIV"||B.nodeName=="P"))||!M&&C.pos<y.doc.content.size&&(!C.sameParent(S)||!C.parent.inlineContent)&&C.pos<S.pos&&!/\S/.test(y.doc.textBetween(C.pos,S.pos,"","")))&&l.someProp("handleKeyDown",B=>B(l,uo(13,"Enter"))))return void(l.input.lastIOSEnter=0);if(l.state.selection.anchor>w.start&&function(B,V,O,D,F){if(O-V<=F.pos-D.pos||Hc(D,!0,!1)<F.pos)return!1;let R=B.resolve(V);if(!D.parent.isTextblock){let I=R.nodeAfter;return I!=null&&O==V+I.nodeSize}if(R.parentOffset<R.parent.content.size||!R.parent.isTextblock)return!1;let L=B.resolve(Hc(R,!0,!0));return!(!L.parent.isTextblock||L.pos>O||Hc(L,!0,!1)<O)&&D.parent.content.cut(D.parentOffset).eq(L.parent.content)}(k,w.start,w.endA,C,S)&&l.someProp("handleKeyDown",B=>B(l,uo(8,"Backspace"))))return void(an&&Ze&&l.domObserver.suppressSelectionUpdates());Ze&&w.endB==w.start&&(l.input.lastChromeDelete=Date.now()),an&&!M&&C.start()!=S.start()&&S.parentOffset==0&&C.depth==S.depth&&y.sel&&y.sel.anchor==y.sel.head&&y.sel.head==w.endA&&(w.endB-=2,S=y.doc.resolveNoCache(w.endB-y.from),setTimeout(()=>{l.someProp("handleKeyDown",function(B){return B(l,uo(13,"Enter"))})},20));let N,T=w.start,A=w.endA,$=B=>{let V=B||l.state.tr.replace(T,A,y.doc.slice(w.start-y.from,w.endB-y.from));if(y.sel){let O=Zg(l,V.doc,y.sel);O&&!(Ze&&l.composing&&O.empty&&(w.start!=w.endB||l.input.lastChromeDelete<Date.now()-100)&&(O.head==T||O.head==V.mapping.map(A)-1)||dt&&O.empty&&O.head==T)&&V.setSelection(O)}return h&&V.setMeta("composition",h),V.scrollIntoView()};if(M)if(C.pos==S.pos){dt&&Tn<=11&&C.parentOffset==0&&(l.domObserver.suppressSelectionUpdates(),setTimeout(()=>cn(l),20));let B=$(l.state.tr.delete(T,A)),V=k.resolve(w.start).marksAcross(k.resolve(w.endA));V&&B.ensureMarks(V),l.dispatch(B)}else if(w.endA==w.endB&&(N=function(B,V){let O,D,F,R=B.firstChild.marks,L=V.firstChild.marks,I=R,P=L;for(let z=0;z<L.length;z++)I=L[z].removeFromSet(I);for(let z=0;z<R.length;z++)P=R[z].removeFromSet(P);if(I.length==1&&P.length==0)D=I[0],O="add",F=z=>z.mark(D.addToSet(z.marks));else{if(I.length!=0||P.length!=1)return null;D=P[0],O="remove",F=z=>z.mark(D.removeFromSet(z.marks))}let W=[];for(let z=0;z<V.childCount;z++)W.push(F(V.child(z)));if(H.from(W).eq(B))return{mark:D,type:O}}(C.parent.content.cut(C.parentOffset,S.parentOffset),E.parent.content.cut(E.parentOffset,w.endA-E.start())))){let B=$(l.state.tr);N.type=="add"?B.addMark(T,A,N.mark):B.removeMark(T,A,N.mark),l.dispatch(B)}else if(C.parent.child(C.index()).isText&&C.index()==S.index()-(S.textOffset?0:1)){let B=C.parent.textBetween(C.parentOffset,S.parentOffset),V=()=>$(l.state.tr.insertText(B,T,A));l.someProp("handleTextInput",O=>O(l,T,A,B,V))||l.dispatch(V())}else l.dispatch($());else l.dispatch($())}(this,o,i,s,a)),this.domObserver.start(),function(o){for(let i in rt){let s=rt[i];o.dom.addEventListener(i,o.input.eventHandlers[i]=a=>{!uC(o,a)||Lc(o,a)||!o.editable&&a.type in it||s(o,a)},cC[i]?{passive:!0}:void 0)}ot&&o.dom.addEventListener("input",()=>null),Rc(o)}(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 n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Rc(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(sv),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let o in this._props)n[o]=this._props[o];n.state=this.state;for(let o in e)n[o]=e[o];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var o;let i=this.state,s=!1,a=!1;e.storedMarks&&this.composing&&(jg(this),a=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let f=iv(this);(function(m,g){let v=0,b=0;for(let y in m){if(m[y]!=g[y])return!0;v++}for(let y in g)b++;return v!=b})(f,this.nodeViews)&&(this.nodeViews=f,s=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&Rc(this),this.editable=rv(this),ov(this);let c=jc(this),d=nv(this),u=i.plugins==e.plugins||i.doc.eq(e.doc)?e.scrollToSelection>i.scrollToSelection?"to selection":"preserve":"reset",p=s||!this.docView.matchesNode(e.doc,d,c);!p&&e.selection.eq(i.selection)||(a=!0);let h=u=="preserve"&&a&&this.dom.style.overflowAnchor==null&&function(f){let m,g,v=f.dom.getBoundingClientRect(),b=Math.max(0,v.top);for(let y=(v.left+v.right)/2,k=b+1;k<Math.min(innerHeight,v.bottom);k+=5){let x=f.root.elementFromPoint(y,k);if(!x||x==f.dom||!f.dom.contains(x))continue;let w=x.getBoundingClientRect();if(w.top>=b-20){m=x,g=w.top;break}}return{refDOM:m,refTop:g,stack:eg(f.dom)}}(this);if(a){this.domObserver.stop();let f=p&&(dt||Ze)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&function(m,g){let v=Math.min(m.$anchor.sharedDepth(m.head),g.$anchor.sharedDepth(g.head));return m.$anchor.start(v)!=g.$anchor.start(v)}(i.selection,e.selection);if(p){let m=Ze?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(g){let v=g.domSelectionRange();if(!v.focusNode)return null;let b=function(k,x){for(;;){if(k.nodeType==3&&x)return k;if(k.nodeType==1&&x>0){if(k.contentEditable=="false")return null;x=Bt(k=k.childNodes[x-1])}else{if(!k.parentNode||Jr(k))return null;x=Ge(k),k=k.parentNode}}}(v.focusNode,v.focusOffset),y=function(k,x){for(;;){if(k.nodeType==3&&x<k.nodeValue.length)return k;if(k.nodeType==1&&x<k.childNodes.length){if(k.contentEditable=="false")return null;k=k.childNodes[x],x=0}else{if(!k.parentNode||Jr(k))return null;x=Ge(k)+1,k=k.parentNode}}}(v.focusNode,v.focusOffset);if(b&&y&&b!=y){let k=y.pmViewDesc,x=g.domObserver.lastChangedTextNode;if(b==x||y==x)return x;if(!k||!k.isText(y.nodeValue))return y;if(g.input.compositionNode==y){let w=b.pmViewDesc;if(w&&w.isText(b.nodeValue))return y}}return b||y}(this)),!s&&this.docView.update(e.doc,d,c,this)||(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=ug(e.doc,d,c,this.dom,this)),m&&!this.trackWrites&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(m){let g=m.docView.domFromPos(m.state.selection.anchor,0),v=m.domSelectionRange();return co(g.node,g.offset,v.anchorNode,v.anchorOffset)}(this))?cn(this,f):(wg(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((o=this.dragging)===null||o===void 0)&&o.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():h&&function({refDOM:f,refTop:m,stack:g}){let v=f?f.getBoundingClientRect().top:0;tg(g,v==0?0:v-m)}(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(e.nodeType==1?e:e.parentNode)&&!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof re){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Zm(this,n.getBoundingClientRect(),e)}else Zm(this,this.coordsAtPos(this.state.selection.head,1),e)}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 n=0;n<this.pluginViews.length;n++){let o=this.pluginViews[n];o.update&&o.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let o=this.directPlugins[n];o.spec.view&&this.pluginViews.push(o.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let o=this.state.plugins[n];o.spec.view&&this.pluginViews.push(o.spec.view(this))}}}updateDraggedNode(e,n){let o=e.node,i=-1;if(this.state.doc.nodeAt(o.from)==o.node)i=o.from;else{let s=o.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&this.state.doc.nodeAt(s))==o.node&&(i=s)}this.dragging=new Wg(e.slice,e.move,i<0?void 0:re.create(this.state.doc,i))}someProp(e,n){let o,i=this._props&&this._props[e];if(i!=null&&(o=n?n(i):i))return o;for(let a=0;a<this.directPlugins.length;a++){let l=this.directPlugins[a].props[e];if(l!=null&&(o=n?n(l):l))return o}let s=this.state.plugins;if(s)for(let a=0;a<s.length;a++){let l=s[a].props[e];if(l!=null&&(o=n?n(l):l))return o}}hasFocus(){if(dt){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(rr)return e.focus(rr);let n=eg(e);e.focus(rr==null?{get preventScroll(){return rr={preventScroll:!0},!0}}:void 0),rr||(rr=!1,tg(n,0))}(this.dom),cn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return eC(this,e)}coordsAtPos(e,n=1){return ig(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,o=-1){let i=this.docView.posFromDOM(e,n,o);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return function(o,i,s){return ag==i&&lg==s?cg:(ag=i,lg=s,cg=s=="up"||s=="down"?function(a,l,c){let d=l.selection,u=c=="up"?d.$from:d.$to;return sg(a,l,()=>{let{node:p}=a.docView.domFromPos(u.pos,c=="up"?-1:1);for(;;){let f=a.docView.nearestDesc(p,!0);if(!f)break;if(f.node.isBlock){p=f.contentDOM||f.dom;break}p=f.dom.parentNode}let h=ig(a,u.pos,1);for(let f=p.firstChild;f;f=f.nextSibling){let m;if(f.nodeType==1)m=f.getClientRects();else{if(f.nodeType!=3)continue;m=sn(f,0,f.nodeValue.length).getClientRects()}for(let g=0;g<m.length;g++){let v=m[g];if(v.bottom>v.top+1&&(c=="up"?h.top-v.top>2*(v.bottom-h.top):v.bottom-h.bottom>2*(h.bottom-v.top)))return!1}}return!0})}(o,i,s):function(a,l,c){let{$head:d}=l.selection;if(!d.parent.isTextblock)return!1;let u=d.parentOffset,p=!u,h=u==d.parent.content.size,f=a.domSelection();return f?nC.test(d.parent.textContent)&&f.modify?sg(a,l,()=>{let{focusNode:m,focusOffset:g,anchorNode:v,anchorOffset:b}=a.domSelectionRange(),y=f.caretBidiLevel;f.modify("move",c,"character");let k=d.depth?a.docView.domAfterPos(d.before()):a.dom,{focusNode:x,focusOffset:w}=a.domSelectionRange(),C=x&&!k.contains(x.nodeType==1?x:x.parentNode)||m==x&&g==w;try{f.collapse(v,b),m&&(m!=v||g!=b)&&f.extend&&f.extend(m,g)}catch{}return y!=null&&(f.caretBidiLevel=y),C}):c=="left"||c=="backward"?p:h:d.pos==d.start()||d.pos==d.end()}(o,i,s))}(this,n||this.state,e)}pasteHTML(e,n){return ti(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ti(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return Dc(this,e)}destroy(){this.docView&&(function(e){e.domObserver.stop();for(let n in e.input.eventHandlers)e.dom.removeEventListener(n,e.input.eventHandlers[n]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],jc(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,kc=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return function(n,o){Lc(n,o)||!rt[o.type]||!n.editable&&o.type in it||rt[o.type](n,o)}(this,e)}domSelectionRange(){let e=this.domSelection();return e?ot&&this.root.nodeType===11&&function(n){let o=n.activeElement;for(;o&&o.shadowRoot;)o=o.shadowRoot.activeElement;return o}(this.dom.ownerDocument)==this.dom&&function(n,o){if(o.getComposedRanges){let a=o.getComposedRanges(n.root)[0];if(a)return Qg(n,a)}let i;function s(a){a.preventDefault(),a.stopImmediatePropagation(),i=a.getTargetRanges()[0]}return n.dom.addEventListener("beforeinput",s,!0),document.execCommand("indent"),n.dom.removeEventListener("beforeinput",s,!0),i?Qg(n,i):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function nv(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let o in n)o=="class"?e.class+=" "+n[o]:o=="style"?e.style=(e.style?e.style+";":"")+n[o]:e[o]||o=="contenteditable"||o=="nodeName"||(e[o]=String(n[o]))}),e.translate||(e.translate="no"),[st.node(0,t.state.doc.content.size,e)]}function ov(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:st.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function rv(t){return!t.someProp("editable",e=>e(t.state)===!1)}function iv(t){let e=Object.create(null);function n(o){for(let i in o)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=o[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function sv(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}tv.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};for(var Rn={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:"'"},Ds={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},SC=typeof navigator<"u"&&/Mac/.test(navigator.platform),EC=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Ye=0;Ye<10;Ye++)Rn[48+Ye]=Rn[96+Ye]=String(Ye);for(Ye=1;Ye<=24;Ye++)Rn[Ye+111]="F"+Ye;for(Ye=65;Ye<=90;Ye++)Rn[Ye]=String.fromCharCode(Ye+32),Ds[Ye]=String.fromCharCode(Ye);for(var Wc in Rn)Ds.hasOwnProperty(Wc)||(Ds[Wc]=Rn[Wc]);const MC=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),NC=typeof navigator<"u"&&/Win/.test(navigator.platform);function BC(t){let e,n,o,i,s=t.split(/-(?!$)/),a=s[s.length-1];a=="Space"&&(a=" ");for(let l=0;l<s.length-1;l++){let c=s[l];if(/^(cmd|meta|m)$/i.test(c))i=!0;else if(/^a(lt)?$/i.test(c))e=!0;else if(/^(c|ctrl|control)$/i.test(c))n=!0;else if(/^s(hift)?$/i.test(c))o=!0;else{if(!/^mod$/i.test(c))throw new Error("Unrecognized modifier name: "+c);MC?i=!0:n=!0}}return e&&(a="Alt-"+a),n&&(a="Ctrl-"+a),i&&(a="Meta-"+a),o&&(a="Shift-"+a),a}function Kc(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function av(t){let e=function(n){let o=Object.create(null);for(let i in n)o[BC(i)]=n[i];return o}(t);return function(n,o){let i,s=function(l){var c=!(SC&&l.metaKey&&l.shiftKey&&!l.ctrlKey&&!l.altKey||EC&&l.shiftKey&&l.key&&l.key.length==1||l.key=="Unidentified")&&l.key||(l.shiftKey?Ds:Rn)[l.keyCode]||l.key||"Unidentified";return c=="Esc"&&(c="Escape"),c=="Del"&&(c="Delete"),c=="Left"&&(c="ArrowLeft"),c=="Up"&&(c="ArrowUp"),c=="Right"&&(c="ArrowRight"),c=="Down"&&(c="ArrowDown"),c}(o),a=e[Kc(s,o)];if(a&&a(n.state,n.dispatch,n))return!0;if(s.length==1&&s!=" "){if(o.shiftKey){let l=e[Kc(s,o,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((o.altKey||o.metaKey||o.ctrlKey)&&!(NC&&o.ctrlKey&&o.altKey)&&(i=Rn[o.keyCode])&&i!=s){let l=e[Kc(i,o)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var TC=Object.defineProperty,Uc=(t,e)=>{for(var n in e)TC(t,n,{get:e[n],enumerable:!0})};function As(t){const{state:e,transaction:n}=t;let{selection:o}=n,{doc:i}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return o},get doc(){return i},get tr(){return o=n.selection,i=n.doc,s=n.storedMarks,n}}}var Is=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:n}=this,{view:o}=e,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([a,l])=>[a,(...c)=>{const d=l(...c)(s);return i.getMeta("preventDispatch")||this.hasCustomState||o.dispatch(i),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:n,editor:o,state:i}=this,{view:s}=o,a=[],l=!!t,c=t||i.tr,d={...Object.fromEntries(Object.entries(n).map(([u,p])=>[u,(...h)=>{const f=this.buildProps(c,e),m=p(...h)(f);return a.push(m),d}])),run:()=>(l||!e||c.getMeta("preventDispatch")||this.hasCustomState||s.dispatch(c),a.every(u=>u===!0))};return d}createCan(t){const{rawCommands:e,state:n}=this,o=!1,i=t||n.tr,s=this.buildProps(i,o);return{...Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...c)=>l(...c)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,o)}}buildProps(t,e=!0){const{rawCommands:n,editor:o,state:i}=this,{view:s}=o,a={tr:t,editor:o,view:s,state:As({state:i,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...d)=>c(...d)(a)]))}};return a}},lv={};Uc(lv,{blur:()=>OC,clearContent:()=>_C,clearNodes:()=>VC,command:()=>DC,createParagraphNear:()=>AC,cut:()=>IC,deleteCurrentNode:()=>RC,deleteNode:()=>LC,deleteRange:()=>$C,deleteSelection:()=>PC,enter:()=>zC,exitCode:()=>FC,extendMarkRange:()=>jC,first:()=>HC,focus:()=>WC,forEach:()=>KC,insertContent:()=>UC,insertContentAt:()=>qC,joinBackward:()=>YC,joinDown:()=>GC,joinForward:()=>XC,joinItemBackward:()=>QC,joinItemForward:()=>ZC,joinTextblockBackward:()=>eS,joinTextblockForward:()=>tS,joinUp:()=>JC,keyboardShortcut:()=>nS,lift:()=>oS,liftEmptyBlock:()=>rS,liftListItem:()=>iS,newlineInCode:()=>sS,resetAttributes:()=>aS,scrollIntoView:()=>lS,selectAll:()=>cS,selectNodeBackward:()=>dS,selectNodeForward:()=>uS,selectParentNode:()=>pS,selectTextblockEnd:()=>hS,selectTextblockStart:()=>fS,setContent:()=>mS,setMark:()=>gS,setMeta:()=>vS,setNode:()=>yS,setNodeSelection:()=>bS,setTextSelection:()=>kS,sinkListItem:()=>wS,splitBlock:()=>xS,splitListItem:()=>CS,toggleList:()=>SS,toggleMark:()=>ES,toggleNode:()=>MS,toggleWrap:()=>NS,undoInputRule:()=>BS,unsetAllMarks:()=>TS,unsetMark:()=>OS,updateAttributes:()=>_S,wrapIn:()=>VS,wrapInList:()=>DS});var OC=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),_C=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),VC=()=>({state:t,tr:e,dispatch:n})=>{const{selection:o}=e,{ranges:i}=o;return!n||(i.forEach(({$from:s,$to:a})=>{t.doc.nodesBetween(s.pos,a.pos,(l,c)=>{if(l.type.isText)return;const{doc:d,mapping:u}=e,p=d.resolve(u.map(c)),h=d.resolve(u.map(c+l.nodeSize)),f=p.blockRange(h);if(!f)return;const m=Xo(f);if(l.type.isTextblock){const{defaultType:g}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(f.start,g)}(m||m===0)&&e.lift(f,m)})}),!0)},DC=t=>e=>t(e),AC=()=>({state:t,dispatch:e})=>Wm(t,e),IC=(t,e)=>({editor:n,tr:o})=>{const{state:i}=n,s=i.doc.slice(t.from,t.to);o.deleteRange(t.from,t.to);const a=o.mapping.map(e);return o.insert(a,s.content),o.setSelection(new le(o.doc.resolve(Math.max(a-1,0)))),!0},RC=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,o=n.$anchor.node();if(o.content.size>0)return!1;const i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===o.type){if(e){const a=i.before(s),l=i.after(s);t.delete(a,l).scrollIntoView()}return!0}return!1};function Pe(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var LC=t=>({tr:e,state:n,dispatch:o})=>{const i=Pe(t,n.schema),s=e.selection.$anchor;for(let a=s.depth;a>0;a-=1)if(s.node(a).type===i){if(o){const l=s.before(a),c=s.after(a);e.delete(l,c).scrollIntoView()}return!0}return!1},$C=t=>({tr:e,dispatch:n})=>{const{from:o,to:i}=t;return n&&e.delete(o,i),!0},PC=()=>({state:t,dispatch:e})=>mc(t,e),zC=()=>({commands:t})=>t.keyboardShortcut("Enter"),FC=()=>({state:t,dispatch:e})=>((n,o)=>{let{$head:i,$anchor:s}=n.selection;if(!i.parent.type.spec.code||!i.sameParent(s))return!1;let a=i.node(-1),l=i.indexAfter(-1),c=yc(a.contentMatchAt(l));if(!c||!a.canReplaceWith(l,l,c))return!1;if(o){let d=i.after(),u=n.tr.replaceWith(d,d,c.createAndFill());u.setSelection(he.near(u.doc.resolve(d),1)),o(u.scrollIntoView())}return!0})(t,e);function qc(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Rs(t,e,n={strict:!0}){const o=Object.keys(e);return!o.length||o.every(i=>n.strict?e[i]===t[i]:qc(e[i])?e[i].test(t[i]):e[i]===t[i])}function cv(t,e,n={}){return t.find(o=>o.type===e&&Rs(Object.fromEntries(Object.keys(n).map(i=>[i,o.attrs[i]])),n))}function dv(t,e,n={}){return!!cv(t,e,n)}function Jc(t,e,n){var o;if(!t||!e)return;let i=t.parent.childAfter(t.parentOffset);if(i.node&&i.node.marks.some(d=>d.type===e)||(i=t.parent.childBefore(t.parentOffset)),!i.node||!i.node.marks.some(d=>d.type===e)||(n=n||((o=i.node.marks[0])==null?void 0:o.attrs),!cv([...i.node.marks],e,n)))return;let s=i.index,a=t.start()+i.offset,l=s+1,c=a+i.node.nodeSize;for(;s>0&&dv([...t.parent.child(s-1).marks],e,n);)s-=1,a-=t.parent.child(s).nodeSize;for(;l<t.parent.childCount&&dv([...t.parent.child(l).marks],e,n);)c+=t.parent.child(l).nodeSize,l+=1;return{from:a,to:c}}function dn(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var jC=(t,e={})=>({tr:n,state:o,dispatch:i})=>{const s=dn(t,o.schema),{doc:a,selection:l}=n,{$from:c,from:d,to:u}=l;if(i){const p=Jc(c,s,e);if(p&&p.from<=d&&p.to>=u){const h=le.create(a,p.from,p.to);n.setSelection(h)}}return!0},HC=t=>e=>{const n=typeof t=="function"?t(e):t;for(let o=0;o<n.length;o+=1)if(n[o](e))return!0;return!1};function uv(t){return t instanceof le}function go(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function pv(t,e=null){if(!e)return null;const n=he.atStart(t),o=he.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return o;const i=n.from,s=o.to;return e==="all"?le.create(t,go(0,i,s),go(t.content.size,i,s)):le.create(t,go(e,i,s),go(e,i,s))}function Gc(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var WC=(t=null,e={})=>({editor:n,view:o,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const a=()=>{(Gc()||navigator.platform==="Android"||/android/i.test(navigator.userAgent))&&o.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(o.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(o.hasFocus()&&t===null||t===!1)return!0;if(s&&t===null&&!uv(n.state.selection))return a(),!0;const l=pv(i.doc,t)||n.state.selection,c=n.state.selection.eq(l);return s&&(c||i.setSelection(l),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},KC=(t,e)=>n=>t.every((o,i)=>e(o,{...n,index:i})),UC=(t,e)=>({tr:n,commands:o})=>o.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),hv=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const o=e[n];o.nodeType===3&&o.nodeValue&&/^(\n\s\s|\n)$/.test(o.nodeValue)?t.removeChild(o):o.nodeType===1&&hv(o)}return t};function Ls(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return hv(n)}function oi(t,e,n){if(t instanceof Cn||t instanceof H)return t;n={slice:!0,parseOptions:{},...n};const o=typeof t=="string";if(typeof t=="object"&&t!==null)try{if(Array.isArray(t)&&t.length>0)return H.fromArray(t.map(s=>e.nodeFromJSON(s)));const i=e.nodeFromJSON(t);return n.errorOnInvalidContent&&i.check(),i}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),oi("",e,n)}if(o){if(n.errorOnInvalidContent){let s=!1,a="";const l=new lm({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?Sn.fromSchema(l).parseSlice(Ls(t),n.parseOptions):Sn.fromSchema(l).parse(Ls(t),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=Sn.fromSchema(e);return n.slice?i.parseSlice(Ls(t),n.parseOptions).content:i.parse(Ls(t),n.parseOptions)}return oi("",e,n)}var qC=(t,e,n)=>({tr:o,dispatch:i,editor:s})=>{var a;if(i){let l;const c=g=>{s.emit("contentError",{editor:s,error:g,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},d={preserveWhitespace:"full",...(n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n}).parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{oi(e,s.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(g){c(g)}try{l=oi(e,s.schema,{parseOptions:d,errorOnInvalidContent:(a=n.errorOnInvalidContent)!=null?a:s.options.enableContentCheck})}catch(g){return c(g),!1}let u,{from:p,to:h}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,m=!0;if(("type"in l?[l]:l).forEach(g=>{g.check(),f=!!f&&g.isText&&g.marks.length===0,m=!!m&&g.isBlock}),p===h&&m){const{parent:g}=o.doc.resolve(p);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(p-=1,h+=1)}if(f){if(Array.isArray(e))u=e.map(g=>g.text||"").join("");else if(e instanceof H){let g="";e.forEach(v=>{v.text&&(g+=v.text)}),u=g}else u=typeof e=="object"&&e&&e.text?e.text:e;o.insertText(u,p,h)}else{u=l;const g=o.doc.resolve(p),v=g.node(),b=g.parentOffset===0,y=v.isText||v.isTextblock,k=v.content.size>0;b&&y&&k&&(p=Math.max(0,p-1)),o.replaceWith(p,h,u)}n.updateSelection&&function(g,v){const b=g.steps.length-1;if(b<v)return;const y=g.steps[b];if(!(y instanceof We||y instanceof Ke))return;const k=g.mapping.maps[b];let x=0;k.forEach((w,C,S,E)=>{x===0&&(x=E)}),g.setSelection(he.near(g.doc.resolve(x),-1))}(o,o.steps.length-1),n.applyInputRules&&o.setMeta("applyInputRules",{from:p,text:u}),n.applyPasteRules&&o.setMeta("applyPasteRules",{from:p,text:u})}return!0},JC=()=>({state:t,dispatch:e})=>((n,o)=>{let i,s=n.selection,a=s instanceof re;if(a){if(s.node.isTextblock||!Nn(n.doc,s.from))return!1;i=s.from}else if(i=xs(n.doc,s.from,-1),i==null)return!1;if(o){let l=n.tr.join(i);a&&l.setSelection(re.create(l.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),o(l.scrollIntoView())}return!0})(t,e),GC=()=>({state:t,dispatch:e})=>((n,o)=>{let i,s=n.selection;if(s instanceof re){if(s.node.isTextblock||!Nn(n.doc,s.to))return!1;i=s.to}else if(i=xs(n.doc,s.to,1),i==null)return!1;return o&&o(n.tr.join(i).scrollIntoView()),!0})(t,e),YC=()=>({state:t,dispatch:e})=>Lm(t,e),XC=()=>({state:t,dispatch:e})=>Fm(t,e),QC=()=>({state:t,dispatch:e,tr:n})=>{try{const o=xs(t.doc,t.selection.$from.pos,-1);return o!=null&&(n.join(o,2),e&&e(n),!0)}catch{return!1}},ZC=()=>({state:t,dispatch:e,tr:n})=>{try{const o=xs(t.doc,t.selection.$from.pos,1);return o!=null&&(n.join(o,2),e&&e(n),!0)}catch{return!1}},eS=()=>({state:t,dispatch:e})=>((n,o)=>{let i=Rm(n,void 0);if(!i)return!1;let s=gc(i);return!!s&&$m(n,s,o)})(t,e),tS=()=>({state:t,dispatch:e})=>((n,o)=>{let i=zm(n,void 0);if(!i)return!1;let s=vc(i);return!!s&&$m(n,s,o)})(t,e);function fv(){return typeof navigator<"u"&&/Mac/.test(navigator.platform)}var nS=t=>({editor:e,view:n,tr:o,dispatch:i})=>{const s=function(d){const u=d.split(/-(?!$)/);let p,h,f,m,g=u[u.length-1];g==="Space"&&(g=" ");for(let v=0;v<u.length-1;v+=1){const b=u[v];if(/^(cmd|meta|m)$/i.test(b))m=!0;else if(/^a(lt)?$/i.test(b))p=!0;else if(/^(c|ctrl|control)$/i.test(b))h=!0;else if(/^s(hift)?$/i.test(b))f=!0;else{if(!/^mod$/i.test(b))throw new Error(`Unrecognized modifier name: ${b}`);Gc()||fv()?m=!0:h=!0}}return p&&(g=`Alt-${g}`),h&&(g=`Ctrl-${g}`),m&&(g=`Meta-${g}`),f&&(g=`Shift-${g}`),g}(t).split(/-(?!$)/),a=s.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,l))});return c==null||c.steps.forEach(d=>{const u=d.map(o.mapping);u&&i&&o.maybeStep(u)}),!0};function Ln(t,e,n={}){const{from:o,to:i,empty:s}=t.selection,a=e?Pe(e,t.schema):null,l=[];t.doc.nodesBetween(o,i,(u,p)=>{if(u.isText)return;const h=Math.max(o,p),f=Math.min(i,p+u.nodeSize);l.push({node:u,from:h,to:f})});const c=i-o,d=l.filter(u=>!a||a.name===u.node.type.name).filter(u=>Rs(u.node.attrs,n,{strict:!1}));return s?!!d.length:d.reduce((u,p)=>u+p.to-p.from,0)>=c}var oS=(t,e={})=>({state:n,dispatch:o})=>!!Ln(n,Pe(t,n.schema),e)&&((i,s)=>{let{$from:a,$to:l}=i.selection,c=a.blockRange(l),d=c&&Xo(c);return d!=null&&(s&&s(i.tr.lift(c,d).scrollIntoView()),!0)})(n,o),rS=()=>({state:t,dispatch:e})=>Km(t,e),iS=t=>({state:e,dispatch:n})=>{return(o=Pe(t,e.schema),function(i,s){let{$from:a,$to:l}=i.selection,c=a.blockRange(l,d=>d.childCount>0&&d.firstChild.type==o);return!!c&&(!s||(a.node(c.depth-1).type==o?function(d,u,p,h){let f=d.tr,m=h.end,g=h.$to.end(h.depth);m<g&&(f.step(new Ke(m-1,g,m,g,new Q(H.from(p.create(null,h.parent.copy())),1,0),1,!0)),h=new ys(f.doc.resolve(h.$from.pos),f.doc.resolve(g),h.depth));const v=Xo(h);if(v==null)return!1;f.lift(h,v);let b=f.doc.resolve(f.mapping.map(m,-1)-1);return Nn(f.doc,b.pos)&&b.nodeBefore.type==b.nodeAfter.type&&f.join(b.pos),u(f.scrollIntoView()),!0}(i,s,o,c):function(d,u,p){let h=d.tr,f=p.parent;for(let C=p.end,S=p.endIndex-1,E=p.startIndex;S>E;S--)C-=f.child(S).nodeSize,h.delete(C-1,C+1);let m=h.doc.resolve(p.start),g=m.nodeAfter;if(h.mapping.map(p.end)!=p.start+m.nodeAfter.nodeSize)return!1;let v=p.startIndex==0,b=p.endIndex==f.childCount,y=m.node(-1),k=m.index(-1);if(!y.canReplace(k+(v?0:1),k+1,g.content.append(b?H.empty:H.from(f))))return!1;let x=m.pos,w=x+g.nodeSize;return h.step(new Ke(x-(v?1:0),w+(b?1:0),x+1,w-1,new Q((v?H.empty:H.from(f.copy(H.empty))).append(b?H.empty:H.from(f.copy(H.empty))),v?0:1,b?0:1),v?0:1)),u(h.scrollIntoView()),!0}(i,s,c)))})(e,n);var o},sS=()=>({state:t,dispatch:e})=>Hm(t,e);function $s(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function mv(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((o,i)=>(n.includes(i)||(o[i]=t[i]),o),{})}var aS=(t,e)=>({tr:n,state:o,dispatch:i})=>{let s=null,a=null;const l=$s(typeof t=="string"?t:t.name,o.schema);return!!l&&(l==="node"&&(s=Pe(t,o.schema)),l==="mark"&&(a=dn(t,o.schema)),i&&n.selection.ranges.forEach(c=>{o.doc.nodesBetween(c.$from.pos,c.$to.pos,(d,u)=>{s&&s===d.type&&n.setNodeMarkup(u,void 0,mv(d.attrs,e)),a&&d.marks.length&&d.marks.forEach(p=>{a===p.type&&n.addMark(u,u+d.nodeSize,a.create(mv(p.attrs,e)))})})}),!0)},lS=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),cS=()=>({tr:t,dispatch:e})=>{if(e){const n=new kt(t.doc);t.setSelection(n)}return!0},dS=()=>({state:t,dispatch:e})=>Pm(t,e),uS=()=>({state:t,dispatch:e})=>jm(t,e),pS=()=>({state:t,dispatch:e})=>((n,o)=>{let i,{$from:s,to:a}=n.selection,l=s.sharedDepth(a);return l!=0&&(i=s.before(l),o&&o(n.tr.setSelection(re.create(n.doc,i))),!0)})(t,e),hS=()=>({state:t,dispatch:e})=>Jx(t,e),fS=()=>({state:t,dispatch:e})=>qx(t,e);function Yc(t,e,n={},o={}){return oi(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:o.errorOnInvalidContent})}var mS=(t,{errorOnInvalidContent:e,emitUpdate:n=!0,parseOptions:o={}}={})=>({editor:i,tr:s,dispatch:a,commands:l})=>{const{doc:c}=s;if(o.preserveWhitespace!=="full"){const d=Yc(t,i.schema,o,{errorOnInvalidContent:e??i.options.enableContentCheck});return a&&s.replaceWith(0,c.content.size,d).setMeta("preventUpdate",!n),!0}return a&&s.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:c.content.size},t,{parseOptions:o,errorOnInvalidContent:e??i.options.enableContentCheck})};function gv(t,e){const n=dn(e,t.schema),{from:o,to:i,empty:s}=t.selection,a=[];s?(t.storedMarks&&a.push(...t.storedMarks),a.push(...t.selection.$head.marks())):t.doc.nodesBetween(o,i,c=>{a.push(...c.marks)});const l=a.find(c=>c.type.name===n.name);return l?{...l.attrs}:{}}function vv(t,e){const n=new Tm(t);return e.forEach(o=>{o.steps.forEach(i=>{n.step(i)})}),n}function Ps(t){return e=>function(n,o){for(let i=n.depth;i>0;i-=1){const s=n.node(i);if(o(s))return{pos:i>0?n.before(i):0,start:n.start(i),depth:i,node:s}}}(e.$from,t)}function ne(t,e,n){return t.config[e]===void 0&&t.parent?ne(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?ne(t.parent,e,n):null}):t.config[e]}function Xc(t){return t.map(e=>{const n=ne(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return n?[e,...Xc(n())]:e}).flat(10)}function Qc(t,e){const n=ao.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function yv(t){return typeof t=="function"}function ve(t,e=void 0,...n){return yv(t)?e?t.bind(e)(...n):t(...n):t}function ri(t){return{baseExtensions:t.filter(e=>e.type==="extension"),nodeExtensions:t.filter(e=>e.type==="node"),markExtensions:t.filter(e=>e.type==="mark")}}function bv(t){const e=[],{nodeExtensions:n,markExtensions:o}=ri(t),i=[...n,...o],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(a=>{const l=ne(a,"addGlobalAttributes",{name:a.name,options:a.options,storage:a.storage,extensions:i});l&&l().forEach(c=>{c.types.forEach(d=>{Object.entries(c.attributes).forEach(([u,p])=>{e.push({type:d,name:u,attribute:{...s,...p}})})})})}),i.forEach(a=>{const l={name:a.name,options:a.options,storage:a.storage},c=ne(a,"addAttributes",l);if(!c)return;const d=c();Object.entries(d).forEach(([u,p])=>{const h={...s,...p};typeof(h==null?void 0:h.default)=="function"&&(h.default=h.default()),h!=null&&h.isRequired&&(h==null?void 0:h.default)===void 0&&delete h.default,e.push({type:a.name,name:u,attribute:h})})}),e}function Re(...t){return t.filter(e=>!!e).reduce((e,n)=>{const o={...e};return Object.entries(n).forEach(([i,s])=>{if(o[i])if(i==="class"){const a=s?String(s).split(" "):[],l=o[i]?o[i].split(" "):[],c=a.filter(d=>!l.includes(d));o[i]=[...l,...c].join(" ")}else if(i==="style"){const a=s?s.split(";").map(d=>d.trim()).filter(Boolean):[],l=o[i]?o[i].split(";").map(d=>d.trim()).filter(Boolean):[],c=new Map;l.forEach(d=>{const[u,p]=d.split(":").map(h=>h.trim());c.set(u,p)}),a.forEach(d=>{const[u,p]=d.split(":").map(h=>h.trim());c.set(u,p)}),o[i]=Array.from(c.entries()).map(([d,u])=>`${d}: ${u}`).join("; ")}else o[i]=s;else o[i]=s}),o},{})}function zs(t,e){return e.filter(n=>n.type===t.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,o)=>Re(n,o),{})}function kv(t,e){return"style"in t?t:{...t,getAttrs:n=>{const o=t.getAttrs?t.getAttrs(n):t.attrs;if(o===!1)return!1;const i=e.reduce((s,a)=>{const l=a.attribute.parseHTML?a.attribute.parseHTML(n):function(c){return typeof c!="string"?c:c.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(c):c==="true"||c!=="false"&&c}(n.getAttribute(a.name));return l==null?s:{...s,[a.name]:l}},{});return{...o,...i}}}}function wv(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>(e!=="attrs"||!function(o={}){return Object.keys(o).length===0&&o.constructor===Object}(n))&&n!=null))}function Zc(t){return t.sort((e,n)=>{const o=ne(e,"priority")||100,i=ne(n,"priority")||100;return o>i?-1:o<i?1:0})}function xv(t){const e=Zc(Xc(t)),n=function(o){const i=o.filter((s,a)=>o.indexOf(s)!==a);return Array.from(new Set(i))}(e.map(o=>o.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),e}function Cv(t,e,n){const{from:o,to:i}=e,{blockSeparator:s=`
46
46
 
47
- `,textSerializers:a={}}=n||{};let l="";return t.nodesBetween(o,i,(c,d,u,p)=>{var h;c.isBlock&&d>o&&(l+=s);const f=a==null?void 0:a[c.type.name];if(f)return u&&(l+=f({node:c,pos:d,parent:u,index:p,range:e})),!1;c.isText&&(l+=(h=c==null?void 0:c.text)==null?void 0:h.slice(Math.max(o,d)-d,i-d))}),l}function Sv(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function Ev(t,e){const n=$s(typeof e=="string"?e:e.name,t.schema);return n==="node"?function(o,i){const s=Pe(i,o.schema),{from:a,to:l}=o.selection,c=[];o.doc.nodesBetween(a,l,u=>{c.push(u)});const d=c.reverse().find(u=>u.type.name===s.name);return d?{...d.attrs}:{}}(t,e):n==="mark"?gv(t,e):{}}function Mv(t){const{mapping:e,steps:n}=t,o=[];return e.maps.forEach((i,s)=>{const a=[];if(i.ranges.length)i.forEach((l,c)=>{a.push({from:l,to:c})});else{const{from:l,to:c}=n[s];if(l===void 0||c===void 0)return;a.push({from:l,to:c})}a.forEach(({from:l,to:c})=>{const d=e.slice(s).map(l,-1),u=e.slice(s).map(c),p=e.invert().map(d,-1),h=e.invert().map(u);o.push({oldRange:{from:p,to:h},newRange:{from:d,to:u}})})}),function(i){const s=function(a,l=JSON.stringify){const c={};return a.filter(d=>{const u=l(d);return!Object.prototype.hasOwnProperty.call(c,u)&&(c[u]=!0)})}(i);return s.length===1?s:s.filter((a,l)=>!s.filter((d,u)=>u!==l).some(d=>a.oldRange.from>=d.oldRange.from&&a.oldRange.to<=d.oldRange.to&&a.newRange.from>=d.newRange.from&&a.newRange.to<=d.newRange.to))}(o)}function ed(t,e,n){const o=[];return t===e?n.resolve(t).marks().forEach(i=>{const s=Jc(n.resolve(t),i.type);s&&o.push({mark:i,...s})}):n.nodesBetween(t,e,(i,s)=>{i&&(i==null?void 0:i.nodeSize)!==void 0&&o.push(...i.marks.map(a=>({from:s,to:s+i.nodeSize,mark:a})))}),o}function td(t,e){return e.nodes[t]||e.marks[t]||null}function Fs(t,e,n){return Object.fromEntries(Object.entries(n).filter(([o])=>{const i=t.find(s=>s.type===e&&s.name===o);return!!i&&i.attribute.keepOnSplit}))}function nd(t,e,n={}){const{empty:o,ranges:i}=t.selection,s=e?dn(e,t.schema):null;if(o)return!!(t.storedMarks||t.selection.$from.marks()).filter(u=>!s||s.name===u.type.name).find(u=>Rs(u.attrs,n,{strict:!1}));let a=0;const l=[];if(i.forEach(({$from:u,$to:p})=>{const h=u.pos,f=p.pos;t.doc.nodesBetween(h,f,(m,g)=>{if(!m.isText&&!m.marks.length)return;const v=Math.max(h,g),b=Math.min(f,g+m.nodeSize);a+=b-v,l.push(...m.marks.map(y=>({mark:y,from:v,to:b})))})}),a===0)return!1;const c=l.filter(u=>!s||s.name===u.mark.type.name).filter(u=>Rs(u.mark.attrs,n,{strict:!1})).reduce((u,p)=>u+p.to-p.from,0),d=l.filter(u=>!s||u.mark.type!==s&&u.mark.type.excludes(s)).reduce((u,p)=>u+p.to-p.from,0);return(c>0?c+d:c)>=a}function Nv(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Bv(t,e){const{nodeExtensions:n}=ri(e),o=n.find(s=>s.name===t);if(!o)return!1;const i=ve(ne(o,"group",{name:o.name,options:o.options,storage:o.storage}));return typeof i=="string"&&i.split(" ").includes("list")}function js(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var o;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((o=t.text)!=null?o:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(s=>{i!==!1&&(js(s,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function Tv(t){return t instanceof re}var mS=(t,e={})=>({tr:n,state:o,dispatch:i})=>{const{selection:s}=n,{empty:a,ranges:l}=s,c=dn(t,o.schema);if(i)if(a){const d=gv(o,c);n.addStoredMark(c.create({...d,...e}))}else l.forEach(d=>{const u=d.$from.pos,p=d.$to.pos;o.doc.nodesBetween(u,p,(h,f)=>{const m=Math.max(f,u),g=Math.min(f+h.nodeSize,p);h.marks.find(v=>v.type===c)?h.marks.forEach(v=>{c===v.type&&n.addMark(m,g,c.create({...v.attrs,...e}))}):n.addMark(m,g,c.create(e))})});return function(d,u,p){var h;const{selection:f}=u;let m=null;if(uv(f)&&(m=f.$cursor),m){const v=(h=d.storedMarks)!=null?h:m.marks();return m.parent.type.allowsMarkType(p)&&(!!p.isInSet(v)||!v.some(b=>b.type.excludes(p)))}const{ranges:g}=f;return g.some(({$from:v,$to:b})=>{let y=v.depth===0&&d.doc.inlineContent&&d.doc.type.allowsMarkType(p);return d.doc.nodesBetween(v.pos,b.pos,(k,x,w)=>{if(y)return!1;if(k.isInline){const C=!w||w.type.allowsMarkType(p),S=!!p.isInSet(k.marks)||!k.marks.some(E=>E.type.excludes(p));y=C&&S}return!y}),y})}(o,n,c)},gS=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),vS=(t,e={})=>({state:n,dispatch:o,chain:i})=>{const s=Pe(t,n.schema);let a;return n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:l})=>!!Jm(s,{...a,...e})(n)||l.clearNodes()).command(({state:l})=>Jm(s,{...a,...e})(l,o)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},yS=t=>({tr:e,dispatch:n})=>{if(n){const{doc:o}=e,i=go(t,0,o.content.size),s=re.create(o,i);e.setSelection(s)}return!0},bS=t=>({tr:e,dispatch:n})=>{if(n){const{doc:o}=e,{from:i,to:s}=typeof t=="number"?{from:t,to:t}:t,a=le.atStart(o).from,l=le.atEnd(o).to,c=go(i,a,l),d=go(s,a,l),u=le.create(o,c,d);e.setSelection(u)}return!0},kS=t=>({state:e,dispatch:n})=>{return(i=Pe(t,e.schema),function(s,a){let{$from:l,$to:c}=s.selection,d=l.blockRange(c,f=>f.childCount>0&&f.firstChild.type==i);if(!d)return!1;let u=d.startIndex;if(u==0)return!1;let p=d.parent,h=p.child(u-1);if(h.type!=i)return!1;if(a){let f=h.lastChild&&h.lastChild.type==p.type,m=H.from(f?i.create():null),g=new Q(H.from(i.create(null,H.from(p.type.create(null,m)))),f?3:1,0),v=d.start,b=d.end;a(s.tr.step(new Ke(v-(f?3:1),b,v,b,g,1,!0)).scrollIntoView())}return!0})(e,n);var i};function Ov(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const o=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(o)}}var wS=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:o,editor:i})=>{const{selection:s,doc:a}=e,{$from:l,$to:c}=s,d=Fs(i.extensionManager.attributes,l.node().type.name,l.node().attrs);if(s instanceof re&&s.node.isBlock)return!(!l.parentOffset||!rn(a,l.pos)||(o&&(t&&Ov(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),0));if(!l.parent.isBlock)return!1;const u=c.parentOffset===c.parent.content.size,p=l.depth===0?void 0:function(m){for(let g=0;g<m.edgeCount;g+=1){const{type:v}=m.edge(g);if(v.isTextblock&&!v.hasRequiredAttrs())return v}return null}(l.node(-1).contentMatchAt(l.indexAfter(-1)));let h=u&&p?[{type:p,attrs:d}]:void 0,f=rn(e.doc,e.mapping.map(l.pos),1,h);if(h||f||!rn(e.doc,e.mapping.map(l.pos),1,p?[{type:p}]:void 0)||(f=!0,h=p?[{type:p,attrs:d}]:void 0),o){if(f&&(s instanceof le&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,h),p&&!u&&!l.parentOffset&&l.parent.type!==p)){const m=e.mapping.map(l.before()),g=e.doc.resolve(m);l.node(-1).canReplaceWith(g.index(),g.index()+1,p)&&e.setNodeMarkup(e.mapping.map(l.before()),p)}t&&Ov(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return f},xS=(t,e={})=>({tr:n,state:o,dispatch:i,editor:s})=>{var a;const l=Pe(t,o.schema),{$from:c,$to:d}=o.selection,u=o.selection.node;if(u&&u.isBlock||c.depth<2||!c.sameParent(d))return!1;const p=c.node(-1);if(p.type!==l)return!1;const h=s.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==l||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){let b=H.empty;const y=c.index(-1)?1:c.index(-2)?2:3;for(let E=c.depth-y;E>=c.depth-3;E-=1)b=H.from(c.node(E).copy(b));const k=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,x={...Fs(h,c.node().type.name,c.node().attrs),...e},w=((a=l.contentMatch.defaultType)==null?void 0:a.createAndFill(x))||void 0;b=b.append(H.from(l.createAndFill(null,w)||void 0));const C=c.before(c.depth-(y-1));n.replace(C,c.after(-k),new Q(b,4-y,0));let S=-1;n.doc.nodesBetween(C,n.doc.content.size,(E,M)=>{if(S>-1)return!1;E.isTextblock&&E.content.size===0&&(S=M+1)}),S>-1&&n.setSelection(le.near(n.doc.resolve(S))),n.scrollIntoView()}return!0}const f=d.pos===c.end()?p.contentMatchAt(0).defaultType:null,m={...Fs(h,p.type.name,p.attrs),...e},g={...Fs(h,c.node().type.name,c.node().attrs),...e};n.delete(c.pos,d.pos);const v=f?[{type:l,attrs:m},{type:f,attrs:g}]:[{type:l,attrs:m}];if(!rn(n.doc,c.pos,2))return!1;if(i){const{selection:b,storedMarks:y}=o,{splittableMarks:k}=s.extensionManager,x=y||b.$to.parentOffset&&b.$from.marks();if(n.split(c.pos,2,v).scrollIntoView(),!x||!i)return!0;const w=x.filter(C=>k.includes(C.type.name));n.ensureMarks(w)}return!0},od=(t,e)=>{const n=Ps(s=>s.type===e)(t.selection);if(!n)return!0;const o=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(o===void 0)return!0;const i=t.doc.nodeAt(o);return n.node.type!==(i==null?void 0:i.type)||!Nn(t.doc,n.pos)||(t.join(n.pos),!0)},rd=(t,e)=>{const n=Ps(s=>s.type===e)(t.selection);if(!n)return!0;const o=t.doc.resolve(n.start).after(n.depth);if(o===void 0)return!0;const i=t.doc.nodeAt(o);return n.node.type!==(i==null?void 0:i.type)||!Nn(t.doc,o)||(t.join(o),!0)},CS=(t,e,n,o={})=>({editor:i,tr:s,state:a,dispatch:l,chain:c,commands:d,can:u})=>{const{extensions:p,splittableMarks:h}=i.extensionManager,f=Pe(t,a.schema),m=Pe(e,a.schema),{selection:g,storedMarks:v}=a,{$from:b,$to:y}=g,k=b.blockRange(y),x=v||g.$to.parentOffset&&g.$from.marks();if(!k)return!1;const w=Ps(C=>Bv(C.type.name,p))(g);if(k.depth>=1&&w&&k.depth-w.depth<=1){if(w.node.type===f)return d.liftListItem(m);if(Bv(w.node.type.name,p)&&f.validContent(w.node.content)&&l)return c().command(()=>(s.setNodeMarkup(w.pos,f),!0)).command(()=>od(s,f)).command(()=>rd(s,f)).run()}return n&&x&&l?c().command(()=>{const C=u().wrapInList(f,o),S=x.filter(E=>h.includes(E.type.name));return s.ensureMarks(S),!!C||d.clearNodes()}).wrapInList(f,o).command(()=>od(s,f)).command(()=>rd(s,f)).run():c().command(()=>!!u().wrapInList(f,o)||d.clearNodes()).wrapInList(f,o).command(()=>od(s,f)).command(()=>rd(s,f)).run()},SS=(t,e={},n={})=>({state:o,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,a=dn(t,o.schema);return nd(o,a,e)?i.unsetMark(a,{extendEmptyMarkRange:s}):i.setMark(a,e)},ES=(t,e,n={})=>({state:o,commands:i})=>{const s=Pe(t,o.schema),a=Pe(e,o.schema),l=Ln(o,s,n);let c;return o.selection.$anchor.sameParent(o.selection.$head)&&(c=o.selection.$anchor.parent.attrs),l?i.setNode(a,c):i.setNode(s,{...c,...n})},MS=(t,e={})=>({state:n,commands:o})=>{const i=Pe(t,n.schema);return Ln(n,i,e)?o.lift(i):o.wrapIn(i,e)},NS=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let o=0;o<n.length;o+=1){const i=n[o];let s;if(i.spec.isInputRules&&(s=i.getState(t))){if(e){const a=t.tr,l=s.transform;for(let c=l.steps.length-1;c>=0;c-=1)a.step(l.steps[c].invert(l.docs[c]));if(s.text){const c=a.doc.resolve(s.from).marks();a.replaceWith(s.from,s.to,t.schema.text(s.text,c))}else a.delete(s.from,s.to)}return!0}}return!1},BS=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:o,ranges:i}=n;return o||e&&i.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},TS=(t,e={})=>({tr:n,state:o,dispatch:i})=>{var s;const{extendEmptyMarkRange:a=!1}=e,{selection:l}=n,c=dn(t,o.schema),{$from:d,empty:u,ranges:p}=l;if(!i)return!0;if(u&&a){let{from:h,to:f}=l;const m=(s=d.marks().find(v=>v.type===c))==null?void 0:s.attrs,g=Jc(d,c,m);g&&(h=g.from,f=g.to),n.removeMark(h,f,c)}else p.forEach(h=>{n.removeMark(h.$from.pos,h.$to.pos,c)});return n.removeStoredMark(c),!0},OS=(t,e={})=>({tr:n,state:o,dispatch:i})=>{let s=null,a=null;const l=$s(typeof t=="string"?t:t.name,o.schema);return!!l&&(l==="node"&&(s=Pe(t,o.schema)),l==="mark"&&(a=dn(t,o.schema)),i&&n.selection.ranges.forEach(c=>{const d=c.$from.pos,u=c.$to.pos;let p,h,f,m;n.selection.empty?o.doc.nodesBetween(d,u,(g,v)=>{s&&s===g.type&&(f=Math.max(v,d),m=Math.min(v+g.nodeSize,u),p=v,h=g)}):o.doc.nodesBetween(d,u,(g,v)=>{v<d&&s&&s===g.type&&(f=Math.max(v,d),m=Math.min(v+g.nodeSize,u),p=v,h=g),v>=d&&v<=u&&(s&&s===g.type&&n.setNodeMarkup(v,void 0,{...g.attrs,...e}),a&&g.marks.length&&g.marks.forEach(b=>{if(a===b.type){const y=Math.max(v,d),k=Math.min(v+g.nodeSize,u);n.addMark(y,k,a.create({...b.attrs,...e}))}}))}),h&&(p!==void 0&&n.setNodeMarkup(p,void 0,{...h.attrs,...e}),a&&h.marks.length&&h.marks.forEach(g=>{a===g.type&&n.addMark(f,m,a.create({...g.attrs,...e}))}))}),!0)},_S=(t,e={})=>({state:n,dispatch:o})=>function(i,s=null){return function(a,l){let{$from:c,$to:d}=a.selection,u=c.blockRange(d),p=u&&lc(u,i,s);return!!p&&(l&&l(a.tr.wrap(u,p).scrollIntoView()),!0)}}(Pe(t,n.schema),e)(n,o),VS=(t,e={})=>({state:n,dispatch:o})=>function(i,s=null){return function(a,l){let{$from:c,$to:d}=a.selection,u=c.blockRange(d);if(!u)return!1;let p=l?a.tr:null;return!!function(h,f,m,g=null){let v=!1,b=f,y=f.$from.doc;if(f.depth>=2&&f.$from.node(f.depth-1).type.compatibleContent(m)&&f.startIndex==0){if(f.$from.index(f.depth-1)==0)return!1;let x=y.resolve(f.start-2);b=new ys(x,x,f.depth),f.endIndex<f.parent.childCount&&(f=new ys(f.$from,y.resolve(f.$to.end(f.depth)),f.depth)),v=!0}let k=lc(b,m,g,f);return!!k&&(h&&function(x,w,C,S,E){let M=H.empty;for(let B=C.length-1;B>=0;B--)M=H.from(C[B].type.create(C[B].attrs,M));x.step(new Ke(w.start-(S?2:0),w.end,w.start,w.end,new Q(M,0,0),C.length,!0));let N=0;for(let B=0;B<C.length;B++)C[B].type==E&&(N=B+1);let T=C.length-N,D=w.start+C.length-(S?2:0),$=w.parent;for(let B=w.startIndex,V=w.endIndex,O=!0;B<V;B++,O=!1)!O&&rn(x.doc,D,T)&&(x.split(D,T),D+=2*T),D+=$.child(B).nodeSize}(h,f,k,v,m),!0)}(p,u,i,s)&&(l&&l(p.scrollIntoView()),!0)}}(Pe(t,n.schema),e)(n,o),AS=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(o=>o.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(o=>o!==e):delete this.callbacks[t]),this}once(t,e){const n=(...o)=>{this.off(t,n),e.apply(this,o)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}},Hs=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)==null||e}};function Ws(t){var e;const{editor:n,from:o,to:i,text:s,rules:a,plugin:l}=t,{view:c}=n;if(c.composing)return!1;const d=c.state.doc.resolve(o);if(d.parent.type.spec.code||(e=d.nodeBefore||d.nodeAfter)!=null&&e.marks.find(h=>h.type.spec.code))return!1;let u=!1;const p=((h,f=500)=>{let m="";const g=h.parentOffset;return h.parent.nodesBetween(Math.max(0,g-f),g,(v,b,y,k)=>{var x,w;const C=((w=(x=v.type.spec).toText)==null?void 0:w.call(x,{node:v,pos:b,parent:y,index:k}))||v.textContent||"%leaf%";m+=v.isAtom&&!v.isText?C:C.slice(0,Math.max(0,g-b))}),m})(d)+s;return a.forEach(h=>{if(u)return;const f=((x,w)=>{if(qc(w))return w.exec(x);const C=w(x);if(!C)return null;const S=[C.text];return S.index=C.index,S.input=x,S.data=C.data,C.replaceWith&&(C.text.includes(C.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),S.push(C.replaceWith)),S})(p,h.find);if(!f)return;const m=c.state.tr,g=Ds({state:c.state,transaction:m}),v={from:o-(f[0].length-s.length),to:i},{commands:b,chain:y,can:k}=new Is({editor:n,state:g});h.handler({state:g,range:v,match:f,commands:b,chain:y,can:k})!==null&&m.steps.length&&(h.undoable&&m.setMeta(l,{transform:m,from:o,to:i,text:s}),c.dispatch(m),u=!0)}),u}function Ks(t){return function(e){return Object.prototype.toString.call(e).slice(8,-1)}(t)==="Object"&&t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function _v(t,e){const n={...t};return Ks(t)&&Ks(e)&&Object.keys(e).forEach(o=>{Ks(e[o])&&Ks(t[o])?n[o]=_v(t[o],e[o]):n[o]=e[o]}),n}var id=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...ve(ne(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...ve(ne(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>_v(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},$n=class I0 extends id{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new I0(n)}static handleExit({editor:e,mark:n}){const{tr:o}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const l=s.find(c=>(c==null?void 0:c.type.name)===n.name);return l&&o.removeStoredMark(l),o.insertText(" ",i.pos),e.view.dispatch(o),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},DS=class{constructor(t){this.find=t.find,this.handler=t.handler}},Us=null,qs=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=xv(t),this.schema=function(n,o){var i;const s=bv(n),{nodeExtensions:a,markExtensions:l}=ri(n),c=(i=a.find(p=>ne(p,"topNode")))==null?void 0:i.name,d=Object.fromEntries(a.map(p=>{const h=s.filter(y=>y.type===p.name),f={name:p.name,options:p.options,storage:p.storage,editor:o},m=wv({...n.reduce((y,k)=>{const x=ne(k,"extendNodeSchema",f);return{...y,...x?x(p):{}}},{}),content:ve(ne(p,"content",f)),marks:ve(ne(p,"marks",f)),group:ve(ne(p,"group",f)),inline:ve(ne(p,"inline",f)),atom:ve(ne(p,"atom",f)),selectable:ve(ne(p,"selectable",f)),draggable:ve(ne(p,"draggable",f)),code:ve(ne(p,"code",f)),whitespace:ve(ne(p,"whitespace",f)),linebreakReplacement:ve(ne(p,"linebreakReplacement",f)),defining:ve(ne(p,"defining",f)),isolating:ve(ne(p,"isolating",f)),attrs:Object.fromEntries(h.map(y=>{var k,x;return[y.name,{default:(k=y==null?void 0:y.attribute)==null?void 0:k.default,validate:(x=y==null?void 0:y.attribute)==null?void 0:x.validate}]}))}),g=ve(ne(p,"parseHTML",f));g&&(m.parseDOM=g.map(y=>kv(y,h)));const v=ne(p,"renderHTML",f);v&&(m.toDOM=y=>v({node:y,HTMLAttributes:zs(y,h)}));const b=ne(p,"renderText",f);return b&&(m.toText=b),[p.name,m]})),u=Object.fromEntries(l.map(p=>{const h=s.filter(b=>b.type===p.name),f={name:p.name,options:p.options,storage:p.storage,editor:o},m=wv({...n.reduce((b,y)=>{const k=ne(y,"extendMarkSchema",f);return{...b,...k?k(p):{}}},{}),inclusive:ve(ne(p,"inclusive",f)),excludes:ve(ne(p,"excludes",f)),group:ve(ne(p,"group",f)),spanning:ve(ne(p,"spanning",f)),code:ve(ne(p,"code",f)),attrs:Object.fromEntries(h.map(b=>{var y,k;return[b.name,{default:(y=b==null?void 0:b.attribute)==null?void 0:y.default,validate:(k=b==null?void 0:b.attribute)==null?void 0:k.validate}]}))}),g=ve(ne(p,"parseHTML",f));g&&(m.parseDOM=g.map(b=>kv(b,h)));const v=ne(p,"renderHTML",f);return v&&(m.toDOM=b=>v({mark:b,HTMLAttributes:zs(b,h)})),[p.name,m]}));return new lm({topNode:c,nodes:d,marks:u})}(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n=ne(e,"addCommands",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:td(e.name,this.schema)});return n?{...t,...n()}:t},{})}get plugins(){const{editor:t}=this;return Zc([...this.extensions].reverse()).flatMap(n=>{const o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:td(n.name,this.schema)},i=[],s=ne(n,"addKeyboardShortcuts",o);let a={};if(n.type==="mark"&&ne(n,"exitable",o)&&(a.ArrowRight=()=>$n.handleExit({editor:t,mark:n})),s){const p=Object.fromEntries(Object.entries(s()).map(([h,f])=>[h,()=>f({editor:t})]));a={...a,...p}}const l=new Ve({props:{handleKeyDown:av(a)}});i.push(l);const c=ne(n,"addInputRules",o);if(Nv(n,t.options.enableInputRules)&&c){const p=c();if(p&&p.length){const h=function(m){const{editor:g,rules:v}=m,b=new Ve({state:{init:()=>null,apply(y,k,x){const w=y.getMeta(b);if(w)return w;const C=y.getMeta("applyInputRules");return C&&setTimeout(()=>{let{text:S}=C;typeof S=="string"||(S=Qc(H.from(S),x.schema));const{from:E}=C,M=E+S.length;Ws({editor:g,from:E,to:M,text:S,rules:v,plugin:b})}),y.selectionSet||y.docChanged?null:k}},props:{handleTextInput:(y,k,x,w)=>Ws({editor:g,from:k,to:x,text:w,rules:v,plugin:b}),handleDOMEvents:{compositionend:y=>(setTimeout(()=>{const{$cursor:k}=y.state.selection;k&&Ws({editor:g,from:k.pos,to:k.pos,text:"",rules:v,plugin:b})}),!1)},handleKeyDown(y,k){if(k.key!=="Enter")return!1;const{$cursor:x}=y.state.selection;return!!x&&Ws({editor:g,from:x.pos,to:x.pos,text:`
48
- `,rules:v,plugin:b})}},isInputRules:!0});return b}({editor:t,rules:p}),f=Array.isArray(h)?h:[h];i.push(...f)}}const d=ne(n,"addPasteRules",o);if(Nv(n,t.options.enablePasteRules)&&d){const p=d();if(p&&p.length){const h=function(f){const{editor:m,rules:g}=f;let v,b=null,y=!1,k=!1,x=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null;try{v=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{v=null}const w=({state:C,from:S,to:E,rule:M,pasteEvt:N})=>{const T=C.tr,D=Ds({state:C,transaction:T});if(function($){const{editor:B,state:V,from:O,to:A,rule:F,pasteEvent:R,dropEvent:L}=$,{commands:I,chain:P,can:W}=new Is({editor:B,state:V}),z=[];return V.doc.nodesBetween(O,A,(j,K)=>{var G,Z,J,Y,te;if((Z=(G=j.type)==null?void 0:G.spec)!=null&&Z.code||!(j.isText||j.isTextblock||j.isInline))return;const pe=(te=(Y=(J=j.content)==null?void 0:J.size)!=null?Y:j.nodeSize)!=null?te:0,X=Math.max(O,K),oe=Math.min(A,K+pe);if(X>=oe)return;((se,be,Fe)=>{if(qc(be))return[...se.matchAll(be)];const Me=be(se,Fe);return Me?Me.map(Ne=>{const de=[Ne.text];return de.index=Ne.index,de.input=se,de.data=Ne.data,Ne.replaceWith&&(Ne.text.includes(Ne.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),de.push(Ne.replaceWith)),de}):[]})(j.isText?j.text||"":j.textBetween(X-K,oe-K,void 0,""),F.find,R).forEach(se=>{if(se.index===void 0)return;const be=X+se.index+1,Fe=be+se[0].length,Me={from:V.tr.mapping.map(be),to:V.tr.mapping.map(Fe)},Ne=F.handler({state:V,range:Me,match:se,commands:I,chain:P,can:W,pasteEvent:R,dropEvent:L});z.push(Ne)})}),z.every(j=>j!==null)}({editor:m,state:D,from:Math.max(S-1,0),to:E.b-1,rule:M,pasteEvent:N,dropEvent:v})&&T.steps.length){try{v=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{v=null}return x=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,T}};return g.map(C=>new Ve({view(S){const E=N=>{var T;b=(T=S.dom.parentElement)!=null&&T.contains(N.target)?S.dom.parentElement:null,b&&(Us=m)},M=()=>{Us&&(Us=null)};return window.addEventListener("dragstart",E),window.addEventListener("dragend",M),{destroy(){window.removeEventListener("dragstart",E),window.removeEventListener("dragend",M)}}},props:{handleDOMEvents:{drop:(S,E)=>{if(k=b===S.dom.parentElement,v=E,!k){const M=Us;M!=null&&M.isEditable&&setTimeout(()=>{const N=M.state.selection;N&&M.commands.deleteRange({from:N.from,to:N.to})},10)}return!1},paste:(S,E)=>{var M;const N=(M=E.clipboardData)==null?void 0:M.getData("text/html");return x=E,y=!!(N!=null&&N.includes("data-pm-slice")),!1}}},appendTransaction:(S,E,M)=>{const N=S[0],T=N.getMeta("uiEvent")==="paste"&&!y,D=N.getMeta("uiEvent")==="drop"&&!k,$=N.getMeta("applyPasteRules"),B=!!$;if(!T&&!D&&!B)return;if(B){let{text:A}=$;typeof A=="string"||(A=Qc(H.from(A),M.schema));const{from:F}=$,R=F+A.length,L=(I=>{var P;const W=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(P=W.clipboardData)==null||P.setData("text/html",I),W})(A);return w({rule:C,state:M,from:F,to:{b:R},pasteEvt:L})}const V=E.doc.content.findDiffStart(M.doc.content),O=E.doc.content.findDiffEnd(M.doc.content);return typeof V=="number"&&O&&V!==O.b?w({rule:C,state:M,from:V,to:O,pasteEvt:x}):void 0}}))}({editor:t,rules:p});i.push(...h)}}const u=ne(n,"addProseMirrorPlugins",o);if(u){const p=u();i.push(...p)}return i})}get attributes(){return bv(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=ri(this.extensions);return Object.fromEntries(e.filter(n=>!!ne(n,"addNodeView")).map(n=>{const o=this.attributes.filter(a=>a.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Pe(n.name,this.schema)},s=ne(n,"addNodeView",i);return s?[n.name,(a,l,c,d,u)=>{const p=zs(a,o);return s()({node:a,view:l,getPos:c,decorations:d,innerDecorations:u,editor:t,extension:n,HTMLAttributes:p})}]:[]}))}get markViews(){const{editor:t}=this,{markExtensions:e}=ri(this.extensions);return Object.fromEntries(e.filter(n=>!!ne(n,"addMarkView")).map(n=>{const o=this.attributes.filter(a=>a.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:dn(n.name,this.schema)},s=ne(n,"addMarkView",i);return s?[n.name,(a,l,c)=>{const d=zs(a,o);return s()({mark:a,view:l,inline:c,editor:t,extension:n,HTMLAttributes:d,updateAttributes:u=>{(function(p,h,f={}){const{state:m}=h,{doc:g,tr:v}=m,b=p;g.descendants((y,k)=>{const x=v.mapping.map(k),w=v.mapping.map(k)+y.nodeSize;let C=null;if(y.marks.forEach(E=>{if(E!==b)return!1;C=E}),!C)return;let S=!1;if(Object.keys(f).forEach(E=>{f[E]!==C.attrs[E]&&(S=!0)}),S){const E=p.type.create({...p.attrs,...f});v.removeMark(x,w,p.type),v.addMark(x,w,E)}}),v.docChanged&&h.view.dispatch(v)})(a,t,u)}})}]:[]}))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;const o={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:td(e.name,this.schema)};e.type==="mark"&&((n=ve(ne(e,"keepOnSplit",o)))==null||n)&&this.splittableMarks.push(e.name);const i=ne(e,"onBeforeCreate",o),s=ne(e,"onCreate",o),a=ne(e,"onUpdate",o),l=ne(e,"onSelectionUpdate",o),c=ne(e,"onTransaction",o),d=ne(e,"onFocus",o),u=ne(e,"onBlur",o),p=ne(e,"onDestroy",o);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),a&&this.editor.on("update",a),l&&this.editor.on("selectionUpdate",l),c&&this.editor.on("transaction",c),d&&this.editor.on("focus",d),u&&this.editor.on("blur",u),p&&this.editor.on("destroy",p)})}};qs.resolve=xv,qs.sort=Zc,qs.flatten=Xc,Uc({},{ClipboardTextSerializer:()=>Vv,Commands:()=>Av,Delete:()=>Dv,Drop:()=>Iv,Editable:()=>Rv,FocusEvents:()=>$v,Keymap:()=>Pv,Paste:()=>zv,Tabindex:()=>Fv,focusEventsPluginKey:()=>Lv});var ze=class R0 extends id{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new R0(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},Vv=ze.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new Ve({key:new Ue("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:o,selection:i}=e,{ranges:s}=i,a=Math.min(...s.map(d=>d.$from.pos)),l=Math.max(...s.map(d=>d.$to.pos)),c=Sv(n);return Cv(o,{from:a,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),Av=ze.create({name:"commands",addCommands:()=>({...lv})}),Dv=ze.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,o,i;const s=()=>{var a,l,c,d;if((d=(c=(l=(a=this.editor.options.coreExtensionOptions)==null?void 0:a.delete)==null?void 0:l.filterTransaction)==null?void 0:c.call(l,t))!=null?d:t.getMeta("y-sync$"))return;const u=vv(t.before,[t,...e]);Mv(u).forEach(h=>{u.mapping.mapResult(h.oldRange.from).deletedAfter&&u.mapping.mapResult(h.oldRange.to).deletedBefore&&u.before.nodesBetween(h.oldRange.from,h.oldRange.to,(f,m)=>{const g=m+f.nodeSize-2,v=h.oldRange.from<=m&&g<=h.oldRange.to;this.editor.emit("delete",{type:"node",node:f,from:m,to:g,newFrom:u.mapping.map(m),newTo:u.mapping.map(g),deletedRange:h.oldRange,newRange:h.newRange,partial:!v,editor:this.editor,transaction:t,combinedTransform:u})})});const p=u.mapping;u.steps.forEach((h,f)=>{var m,g;if(h instanceof Lt){const v=p.slice(f).map(h.from,-1),b=p.slice(f).map(h.to),y=p.invert().map(v,-1),k=p.invert().map(b),x=(m=u.doc.nodeAt(v-1))==null?void 0:m.marks.some(C=>C.eq(h.mark)),w=(g=u.doc.nodeAt(b))==null?void 0:g.marks.some(C=>C.eq(h.mark));this.editor.emit("delete",{type:"mark",mark:h.mark,from:h.from,to:h.to,deletedRange:{from:y,to:k},newRange:{from:v,to:b},partial:!!(w||x),editor:this.editor,transaction:t,combinedTransform:u})}})};(i=(o=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:o.async)==null||i?setTimeout(s,0):s()}}),Iv=ze.create({name:"drop",addProseMirrorPlugins(){return[new Ve({key:new Ue("tiptapDrop"),props:{handleDrop:(t,e,n,o)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:o})}}})]}}),Rv=ze.create({name:"editable",addProseMirrorPlugins(){return[new Ve({key:new Ue("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Lv=new Ue("focusEvents"),$v=ze.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Ve({key:Lv,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const o=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(o),!1},blur:(e,n)=>{t.isFocused=!1;const o=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(o),!1}}}})]}}),Pv=ze.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:d,$anchor:u}=l,{pos:p,parent:h}=u,f=u.parent.isTextblock&&p>0?a.doc.resolve(p-1):u,m=f.parent.type.spec.isolating,g=u.pos-u.parentOffset,v=m&&f.parent.childCount===1?g===u.pos:he.atStart(c).from===p;return!(!d||!h.type.isTextblock||h.textContent.length||!v||v&&u.parent.type.name==="paragraph")&&s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...n},i={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Gc()||fv()?i:o},addProseMirrorPlugins(){return[new Ve({key:new Ue("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(f=>f.getMeta("composition")))return;const o=t.some(f=>f.docChanged)&&!e.doc.eq(n.doc),i=t.some(f=>f.getMeta("preventClearDocument"));if(!o||i)return;const{empty:s,from:a,to:l}=e.selection,c=he.atStart(e.doc).from,d=he.atEnd(e.doc).to;if(s||a!==c||l!==d||!js(n.doc))return;const u=n.tr,p=Ds({state:n,transaction:u}),{commands:h}=new Is({editor:this.editor,state:p});return h.clearNodes(),u.steps.length?u:void 0}})]}}),zv=ze.create({name:"paste",addProseMirrorPlugins(){return[new Ve({key:new Ue("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),Fv=ze.create({name:"tabindex",addProseMirrorPlugins(){return[new Ve({key:new Ue("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),IS=class hr{constructor(e,n,o=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=o,this.resolvedPos=e,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,o=this.to;if(this.isBlock){if(this.content.size===0)return void console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);n=this.from+1,o=this.to-1}this.editor.commands.insertContentAt({from:n,to:o},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new hr(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new hr(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new hr(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,o)=>{const i=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,a=this.pos+o+(s?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(a);if(!i&&l.depth<=this.depth)return;const c=new hr(l,this.editor,i,i?n:null);i&&(c.actualDepth=this.depth+1),e.push(new hr(l,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let o=null,i=this.parent;for(;i&&!o;){if(i.node.type.name===e)if(Object.keys(n).length>0){const s=i.node.attrs,a=Object.keys(n);for(let l=0;l<a.length;l+=1){const c=a[l];if(s[c]!==n[c])break}}else o=i;i=i.parent}return o}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},o=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(n);return this.children.forEach(a=>{o&&i.length>0||(a.node.type.name===e&&s.every(l=>n[l]===a.node.attrs[l])&&i.push(a),o&&i.length>0||(i=i.concat(a.querySelectorAll(e,n,o))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},RS=class extends AS{constructor(t={}){super(),this.css=null,this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:o})=>{throw o},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:o,slice:i,moved:s})=>this.options.onDrop(o,i,s)),this.on("paste",({event:o,slice:i})=>this.options.onPaste(o,i)),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=pv(e,this.options.autofocus);this.editorState=er.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=function(t,e){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute("data-tiptap-style",""),o.innerHTML=`.ProseMirror {
47
+ `,textSerializers:a={}}=n||{};let l="";return t.nodesBetween(o,i,(c,d,u,p)=>{var h;c.isBlock&&d>o&&(l+=s);const f=a==null?void 0:a[c.type.name];if(f)return u&&(l+=f({node:c,pos:d,parent:u,index:p,range:e})),!1;c.isText&&(l+=(h=c==null?void 0:c.text)==null?void 0:h.slice(Math.max(o,d)-d,i-d))}),l}function Sv(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}function Ev(t,e){const n=$s(typeof e=="string"?e:e.name,t.schema);return n==="node"?function(o,i){const s=Pe(i,o.schema),{from:a,to:l}=o.selection,c=[];o.doc.nodesBetween(a,l,u=>{c.push(u)});const d=c.reverse().find(u=>u.type.name===s.name);return d?{...d.attrs}:{}}(t,e):n==="mark"?gv(t,e):{}}function Mv(t){const{mapping:e,steps:n}=t,o=[];return e.maps.forEach((i,s)=>{const a=[];if(i.ranges.length)i.forEach((l,c)=>{a.push({from:l,to:c})});else{const{from:l,to:c}=n[s];if(l===void 0||c===void 0)return;a.push({from:l,to:c})}a.forEach(({from:l,to:c})=>{const d=e.slice(s).map(l,-1),u=e.slice(s).map(c),p=e.invert().map(d,-1),h=e.invert().map(u);o.push({oldRange:{from:p,to:h},newRange:{from:d,to:u}})})}),function(i){const s=function(a,l=JSON.stringify){const c={};return a.filter(d=>{const u=l(d);return!Object.prototype.hasOwnProperty.call(c,u)&&(c[u]=!0)})}(i);return s.length===1?s:s.filter((a,l)=>!s.filter((d,u)=>u!==l).some(d=>a.oldRange.from>=d.oldRange.from&&a.oldRange.to<=d.oldRange.to&&a.newRange.from>=d.newRange.from&&a.newRange.to<=d.newRange.to))}(o)}function ed(t,e,n){const o=[];return t===e?n.resolve(t).marks().forEach(i=>{const s=Jc(n.resolve(t),i.type);s&&o.push({mark:i,...s})}):n.nodesBetween(t,e,(i,s)=>{i&&(i==null?void 0:i.nodeSize)!==void 0&&o.push(...i.marks.map(a=>({from:s,to:s+i.nodeSize,mark:a})))}),o}function td(t,e){return e.nodes[t]||e.marks[t]||null}function Fs(t,e,n){return Object.fromEntries(Object.entries(n).filter(([o])=>{const i=t.find(s=>s.type===e&&s.name===o);return!!i&&i.attribute.keepOnSplit}))}function nd(t,e,n={}){const{empty:o,ranges:i}=t.selection,s=e?dn(e,t.schema):null;if(o)return!!(t.storedMarks||t.selection.$from.marks()).filter(u=>!s||s.name===u.type.name).find(u=>Rs(u.attrs,n,{strict:!1}));let a=0;const l=[];if(i.forEach(({$from:u,$to:p})=>{const h=u.pos,f=p.pos;t.doc.nodesBetween(h,f,(m,g)=>{if(!m.isText&&!m.marks.length)return;const v=Math.max(h,g),b=Math.min(f,g+m.nodeSize);a+=b-v,l.push(...m.marks.map(y=>({mark:y,from:v,to:b})))})}),a===0)return!1;const c=l.filter(u=>!s||s.name===u.mark.type.name).filter(u=>Rs(u.mark.attrs,n,{strict:!1})).reduce((u,p)=>u+p.to-p.from,0),d=l.filter(u=>!s||u.mark.type!==s&&u.mark.type.excludes(s)).reduce((u,p)=>u+p.to-p.from,0);return(c>0?c+d:c)>=a}function Nv(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Bv(t,e){const{nodeExtensions:n}=ri(e),o=n.find(s=>s.name===t);if(!o)return!1;const i=ve(ne(o,"group",{name:o.name,options:o.options,storage:o.storage}));return typeof i=="string"&&i.split(" ").includes("list")}function js(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var o;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((o=t.text)!=null?o:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let i=!0;return t.content.forEach(s=>{i!==!1&&(js(s,{ignoreWhitespace:n,checkChildren:e})||(i=!1))}),i}return!1}function Tv(t){return t instanceof re}var gS=(t,e={})=>({tr:n,state:o,dispatch:i})=>{const{selection:s}=n,{empty:a,ranges:l}=s,c=dn(t,o.schema);if(i)if(a){const d=gv(o,c);n.addStoredMark(c.create({...d,...e}))}else l.forEach(d=>{const u=d.$from.pos,p=d.$to.pos;o.doc.nodesBetween(u,p,(h,f)=>{const m=Math.max(f,u),g=Math.min(f+h.nodeSize,p);h.marks.find(v=>v.type===c)?h.marks.forEach(v=>{c===v.type&&n.addMark(m,g,c.create({...v.attrs,...e}))}):n.addMark(m,g,c.create(e))})});return function(d,u,p){var h;const{selection:f}=u;let m=null;if(uv(f)&&(m=f.$cursor),m){const v=(h=d.storedMarks)!=null?h:m.marks();return m.parent.type.allowsMarkType(p)&&(!!p.isInSet(v)||!v.some(b=>b.type.excludes(p)))}const{ranges:g}=f;return g.some(({$from:v,$to:b})=>{let y=v.depth===0&&d.doc.inlineContent&&d.doc.type.allowsMarkType(p);return d.doc.nodesBetween(v.pos,b.pos,(k,x,w)=>{if(y)return!1;if(k.isInline){const C=!w||w.type.allowsMarkType(p),S=!!p.isInSet(k.marks)||!k.marks.some(E=>E.type.excludes(p));y=C&&S}return!y}),y})}(o,n,c)},vS=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),yS=(t,e={})=>({state:n,dispatch:o,chain:i})=>{const s=Pe(t,n.schema);let a;return n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:l})=>!!Jm(s,{...a,...e})(n)||l.clearNodes()).command(({state:l})=>Jm(s,{...a,...e})(l,o)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},bS=t=>({tr:e,dispatch:n})=>{if(n){const{doc:o}=e,i=go(t,0,o.content.size),s=re.create(o,i);e.setSelection(s)}return!0},kS=t=>({tr:e,dispatch:n})=>{if(n){const{doc:o}=e,{from:i,to:s}=typeof t=="number"?{from:t,to:t}:t,a=le.atStart(o).from,l=le.atEnd(o).to,c=go(i,a,l),d=go(s,a,l),u=le.create(o,c,d);e.setSelection(u)}return!0},wS=t=>({state:e,dispatch:n})=>{return(i=Pe(t,e.schema),function(s,a){let{$from:l,$to:c}=s.selection,d=l.blockRange(c,f=>f.childCount>0&&f.firstChild.type==i);if(!d)return!1;let u=d.startIndex;if(u==0)return!1;let p=d.parent,h=p.child(u-1);if(h.type!=i)return!1;if(a){let f=h.lastChild&&h.lastChild.type==p.type,m=H.from(f?i.create():null),g=new Q(H.from(i.create(null,H.from(p.type.create(null,m)))),f?3:1,0),v=d.start,b=d.end;a(s.tr.step(new Ke(v-(f?3:1),b,v,b,g,1,!0)).scrollIntoView())}return!0})(e,n);var i};function Ov(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const o=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(o)}}var xS=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:o,editor:i})=>{const{selection:s,doc:a}=e,{$from:l,$to:c}=s,d=Fs(i.extensionManager.attributes,l.node().type.name,l.node().attrs);if(s instanceof re&&s.node.isBlock)return!(!l.parentOffset||!rn(a,l.pos)||(o&&(t&&Ov(n,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),0));if(!l.parent.isBlock)return!1;const u=c.parentOffset===c.parent.content.size,p=l.depth===0?void 0:function(m){for(let g=0;g<m.edgeCount;g+=1){const{type:v}=m.edge(g);if(v.isTextblock&&!v.hasRequiredAttrs())return v}return null}(l.node(-1).contentMatchAt(l.indexAfter(-1)));let h=u&&p?[{type:p,attrs:d}]:void 0,f=rn(e.doc,e.mapping.map(l.pos),1,h);if(h||f||!rn(e.doc,e.mapping.map(l.pos),1,p?[{type:p}]:void 0)||(f=!0,h=p?[{type:p,attrs:d}]:void 0),o){if(f&&(s instanceof le&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,h),p&&!u&&!l.parentOffset&&l.parent.type!==p)){const m=e.mapping.map(l.before()),g=e.doc.resolve(m);l.node(-1).canReplaceWith(g.index(),g.index()+1,p)&&e.setNodeMarkup(e.mapping.map(l.before()),p)}t&&Ov(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return f},CS=(t,e={})=>({tr:n,state:o,dispatch:i,editor:s})=>{var a;const l=Pe(t,o.schema),{$from:c,$to:d}=o.selection,u=o.selection.node;if(u&&u.isBlock||c.depth<2||!c.sameParent(d))return!1;const p=c.node(-1);if(p.type!==l)return!1;const h=s.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==l||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){let b=H.empty;const y=c.index(-1)?1:c.index(-2)?2:3;for(let E=c.depth-y;E>=c.depth-3;E-=1)b=H.from(c.node(E).copy(b));const k=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,x={...Fs(h,c.node().type.name,c.node().attrs),...e},w=((a=l.contentMatch.defaultType)==null?void 0:a.createAndFill(x))||void 0;b=b.append(H.from(l.createAndFill(null,w)||void 0));const C=c.before(c.depth-(y-1));n.replace(C,c.after(-k),new Q(b,4-y,0));let S=-1;n.doc.nodesBetween(C,n.doc.content.size,(E,M)=>{if(S>-1)return!1;E.isTextblock&&E.content.size===0&&(S=M+1)}),S>-1&&n.setSelection(le.near(n.doc.resolve(S))),n.scrollIntoView()}return!0}const f=d.pos===c.end()?p.contentMatchAt(0).defaultType:null,m={...Fs(h,p.type.name,p.attrs),...e},g={...Fs(h,c.node().type.name,c.node().attrs),...e};n.delete(c.pos,d.pos);const v=f?[{type:l,attrs:m},{type:f,attrs:g}]:[{type:l,attrs:m}];if(!rn(n.doc,c.pos,2))return!1;if(i){const{selection:b,storedMarks:y}=o,{splittableMarks:k}=s.extensionManager,x=y||b.$to.parentOffset&&b.$from.marks();if(n.split(c.pos,2,v).scrollIntoView(),!x||!i)return!0;const w=x.filter(C=>k.includes(C.type.name));n.ensureMarks(w)}return!0},od=(t,e)=>{const n=Ps(s=>s.type===e)(t.selection);if(!n)return!0;const o=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(o===void 0)return!0;const i=t.doc.nodeAt(o);return n.node.type!==(i==null?void 0:i.type)||!Nn(t.doc,n.pos)||(t.join(n.pos),!0)},rd=(t,e)=>{const n=Ps(s=>s.type===e)(t.selection);if(!n)return!0;const o=t.doc.resolve(n.start).after(n.depth);if(o===void 0)return!0;const i=t.doc.nodeAt(o);return n.node.type!==(i==null?void 0:i.type)||!Nn(t.doc,o)||(t.join(o),!0)},SS=(t,e,n,o={})=>({editor:i,tr:s,state:a,dispatch:l,chain:c,commands:d,can:u})=>{const{extensions:p,splittableMarks:h}=i.extensionManager,f=Pe(t,a.schema),m=Pe(e,a.schema),{selection:g,storedMarks:v}=a,{$from:b,$to:y}=g,k=b.blockRange(y),x=v||g.$to.parentOffset&&g.$from.marks();if(!k)return!1;const w=Ps(C=>Bv(C.type.name,p))(g);if(k.depth>=1&&w&&k.depth-w.depth<=1){if(w.node.type===f)return d.liftListItem(m);if(Bv(w.node.type.name,p)&&f.validContent(w.node.content)&&l)return c().command(()=>(s.setNodeMarkup(w.pos,f),!0)).command(()=>od(s,f)).command(()=>rd(s,f)).run()}return n&&x&&l?c().command(()=>{const C=u().wrapInList(f,o),S=x.filter(E=>h.includes(E.type.name));return s.ensureMarks(S),!!C||d.clearNodes()}).wrapInList(f,o).command(()=>od(s,f)).command(()=>rd(s,f)).run():c().command(()=>!!u().wrapInList(f,o)||d.clearNodes()).wrapInList(f,o).command(()=>od(s,f)).command(()=>rd(s,f)).run()},ES=(t,e={},n={})=>({state:o,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,a=dn(t,o.schema);return nd(o,a,e)?i.unsetMark(a,{extendEmptyMarkRange:s}):i.setMark(a,e)},MS=(t,e,n={})=>({state:o,commands:i})=>{const s=Pe(t,o.schema),a=Pe(e,o.schema),l=Ln(o,s,n);let c;return o.selection.$anchor.sameParent(o.selection.$head)&&(c=o.selection.$anchor.parent.attrs),l?i.setNode(a,c):i.setNode(s,{...c,...n})},NS=(t,e={})=>({state:n,commands:o})=>{const i=Pe(t,n.schema);return Ln(n,i,e)?o.lift(i):o.wrapIn(i,e)},BS=()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let o=0;o<n.length;o+=1){const i=n[o];let s;if(i.spec.isInputRules&&(s=i.getState(t))){if(e){const a=t.tr,l=s.transform;for(let c=l.steps.length-1;c>=0;c-=1)a.step(l.steps[c].invert(l.docs[c]));if(s.text){const c=a.doc.resolve(s.from).marks();a.replaceWith(s.from,s.to,t.schema.text(s.text,c))}else a.delete(s.from,s.to)}return!0}}return!1},TS=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:o,ranges:i}=n;return o||e&&i.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},OS=(t,e={})=>({tr:n,state:o,dispatch:i})=>{var s;const{extendEmptyMarkRange:a=!1}=e,{selection:l}=n,c=dn(t,o.schema),{$from:d,empty:u,ranges:p}=l;if(!i)return!0;if(u&&a){let{from:h,to:f}=l;const m=(s=d.marks().find(v=>v.type===c))==null?void 0:s.attrs,g=Jc(d,c,m);g&&(h=g.from,f=g.to),n.removeMark(h,f,c)}else p.forEach(h=>{n.removeMark(h.$from.pos,h.$to.pos,c)});return n.removeStoredMark(c),!0},_S=(t,e={})=>({tr:n,state:o,dispatch:i})=>{let s=null,a=null;const l=$s(typeof t=="string"?t:t.name,o.schema);return!!l&&(l==="node"&&(s=Pe(t,o.schema)),l==="mark"&&(a=dn(t,o.schema)),i&&n.selection.ranges.forEach(c=>{const d=c.$from.pos,u=c.$to.pos;let p,h,f,m;n.selection.empty?o.doc.nodesBetween(d,u,(g,v)=>{s&&s===g.type&&(f=Math.max(v,d),m=Math.min(v+g.nodeSize,u),p=v,h=g)}):o.doc.nodesBetween(d,u,(g,v)=>{v<d&&s&&s===g.type&&(f=Math.max(v,d),m=Math.min(v+g.nodeSize,u),p=v,h=g),v>=d&&v<=u&&(s&&s===g.type&&n.setNodeMarkup(v,void 0,{...g.attrs,...e}),a&&g.marks.length&&g.marks.forEach(b=>{if(a===b.type){const y=Math.max(v,d),k=Math.min(v+g.nodeSize,u);n.addMark(y,k,a.create({...b.attrs,...e}))}}))}),h&&(p!==void 0&&n.setNodeMarkup(p,void 0,{...h.attrs,...e}),a&&h.marks.length&&h.marks.forEach(g=>{a===g.type&&n.addMark(f,m,a.create({...g.attrs,...e}))}))}),!0)},VS=(t,e={})=>({state:n,dispatch:o})=>function(i,s=null){return function(a,l){let{$from:c,$to:d}=a.selection,u=c.blockRange(d),p=u&&lc(u,i,s);return!!p&&(l&&l(a.tr.wrap(u,p).scrollIntoView()),!0)}}(Pe(t,n.schema),e)(n,o),DS=(t,e={})=>({state:n,dispatch:o})=>function(i,s=null){return function(a,l){let{$from:c,$to:d}=a.selection,u=c.blockRange(d);if(!u)return!1;let p=l?a.tr:null;return!!function(h,f,m,g=null){let v=!1,b=f,y=f.$from.doc;if(f.depth>=2&&f.$from.node(f.depth-1).type.compatibleContent(m)&&f.startIndex==0){if(f.$from.index(f.depth-1)==0)return!1;let x=y.resolve(f.start-2);b=new ys(x,x,f.depth),f.endIndex<f.parent.childCount&&(f=new ys(f.$from,y.resolve(f.$to.end(f.depth)),f.depth)),v=!0}let k=lc(b,m,g,f);return!!k&&(h&&function(x,w,C,S,E){let M=H.empty;for(let B=C.length-1;B>=0;B--)M=H.from(C[B].type.create(C[B].attrs,M));x.step(new Ke(w.start-(S?2:0),w.end,w.start,w.end,new Q(M,0,0),C.length,!0));let N=0;for(let B=0;B<C.length;B++)C[B].type==E&&(N=B+1);let T=C.length-N,A=w.start+C.length-(S?2:0),$=w.parent;for(let B=w.startIndex,V=w.endIndex,O=!0;B<V;B++,O=!1)!O&&rn(x.doc,A,T)&&(x.split(A,T),A+=2*T),A+=$.child(B).nodeSize}(h,f,k,v,m),!0)}(p,u,i,s)&&(l&&l(p.scrollIntoView()),!0)}}(Pe(t,n.schema),e)(n,o),AS=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const n=this.callbacks[t];return n&&n.forEach(o=>o.apply(this,e)),this}off(t,e){const n=this.callbacks[t];return n&&(e?this.callbacks[t]=n.filter(o=>o!==e):delete this.callbacks[t]),this}once(t,e){const n=(...o)=>{this.off(t,n),e.apply(this,o)};return this.on(t,n)}removeAllListeners(){this.callbacks={}}},Hs=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)==null||e}};function Ws(t){var e;const{editor:n,from:o,to:i,text:s,rules:a,plugin:l}=t,{view:c}=n;if(c.composing)return!1;const d=c.state.doc.resolve(o);if(d.parent.type.spec.code||(e=d.nodeBefore||d.nodeAfter)!=null&&e.marks.find(h=>h.type.spec.code))return!1;let u=!1;const p=((h,f=500)=>{let m="";const g=h.parentOffset;return h.parent.nodesBetween(Math.max(0,g-f),g,(v,b,y,k)=>{var x,w;const C=((w=(x=v.type.spec).toText)==null?void 0:w.call(x,{node:v,pos:b,parent:y,index:k}))||v.textContent||"%leaf%";m+=v.isAtom&&!v.isText?C:C.slice(0,Math.max(0,g-b))}),m})(d)+s;return a.forEach(h=>{if(u)return;const f=((x,w)=>{if(qc(w))return w.exec(x);const C=w(x);if(!C)return null;const S=[C.text];return S.index=C.index,S.input=x,S.data=C.data,C.replaceWith&&(C.text.includes(C.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),S.push(C.replaceWith)),S})(p,h.find);if(!f)return;const m=c.state.tr,g=As({state:c.state,transaction:m}),v={from:o-(f[0].length-s.length),to:i},{commands:b,chain:y,can:k}=new Is({editor:n,state:g});h.handler({state:g,range:v,match:f,commands:b,chain:y,can:k})!==null&&m.steps.length&&(h.undoable&&m.setMeta(l,{transform:m,from:o,to:i,text:s}),c.dispatch(m),u=!0)}),u}function Ks(t){return function(e){return Object.prototype.toString.call(e).slice(8,-1)}(t)==="Object"&&t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function _v(t,e){const n={...t};return Ks(t)&&Ks(e)&&Object.keys(e).forEach(o=>{Ks(e[o])&&Ks(t[o])?n[o]=_v(t[o],e[o]):n[o]=e[o]}),n}var id=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...ve(ne(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...ve(ne(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>_v(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},$n=class I0 extends id{constructor(){super(...arguments),this.type="mark"}static create(e={}){const n=typeof e=="function"?e():e;return new I0(n)}static handleExit({editor:e,mark:n}){const{tr:o}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!s.find(l=>(l==null?void 0:l.type.name)===n.name))return!1;const a=s.find(l=>(l==null?void 0:l.type.name)===n.name);return a&&o.removeStoredMark(a),o.insertText(" ",i.pos),e.view.dispatch(o),!0}return!1}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},IS=class{constructor(t){this.find=t.find,this.handler=t.handler}},Us=null,qs=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=xv(t),this.schema=function(n,o){var i;const s=bv(n),{nodeExtensions:a,markExtensions:l}=ri(n),c=(i=a.find(p=>ne(p,"topNode")))==null?void 0:i.name,d=Object.fromEntries(a.map(p=>{const h=s.filter(y=>y.type===p.name),f={name:p.name,options:p.options,storage:p.storage,editor:o},m=wv({...n.reduce((y,k)=>{const x=ne(k,"extendNodeSchema",f);return{...y,...x?x(p):{}}},{}),content:ve(ne(p,"content",f)),marks:ve(ne(p,"marks",f)),group:ve(ne(p,"group",f)),inline:ve(ne(p,"inline",f)),atom:ve(ne(p,"atom",f)),selectable:ve(ne(p,"selectable",f)),draggable:ve(ne(p,"draggable",f)),code:ve(ne(p,"code",f)),whitespace:ve(ne(p,"whitespace",f)),linebreakReplacement:ve(ne(p,"linebreakReplacement",f)),defining:ve(ne(p,"defining",f)),isolating:ve(ne(p,"isolating",f)),attrs:Object.fromEntries(h.map(y=>{var k,x;return[y.name,{default:(k=y==null?void 0:y.attribute)==null?void 0:k.default,validate:(x=y==null?void 0:y.attribute)==null?void 0:x.validate}]}))}),g=ve(ne(p,"parseHTML",f));g&&(m.parseDOM=g.map(y=>kv(y,h)));const v=ne(p,"renderHTML",f);v&&(m.toDOM=y=>v({node:y,HTMLAttributes:zs(y,h)}));const b=ne(p,"renderText",f);return b&&(m.toText=b),[p.name,m]})),u=Object.fromEntries(l.map(p=>{const h=s.filter(b=>b.type===p.name),f={name:p.name,options:p.options,storage:p.storage,editor:o},m=wv({...n.reduce((b,y)=>{const k=ne(y,"extendMarkSchema",f);return{...b,...k?k(p):{}}},{}),inclusive:ve(ne(p,"inclusive",f)),excludes:ve(ne(p,"excludes",f)),group:ve(ne(p,"group",f)),spanning:ve(ne(p,"spanning",f)),code:ve(ne(p,"code",f)),attrs:Object.fromEntries(h.map(b=>{var y,k;return[b.name,{default:(y=b==null?void 0:b.attribute)==null?void 0:y.default,validate:(k=b==null?void 0:b.attribute)==null?void 0:k.validate}]}))}),g=ve(ne(p,"parseHTML",f));g&&(m.parseDOM=g.map(b=>kv(b,h)));const v=ne(p,"renderHTML",f);return v&&(m.toDOM=b=>v({mark:b,HTMLAttributes:zs(b,h)})),[p.name,m]}));return new lm({topNode:c,nodes:d,marks:u})}(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const n=ne(e,"addCommands",{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:td(e.name,this.schema)});return n?{...t,...n()}:t},{})}get plugins(){const{editor:t}=this;return Zc([...this.extensions].reverse()).flatMap(n=>{const o={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:td(n.name,this.schema)},i=[],s=ne(n,"addKeyboardShortcuts",o);let a={};if(n.type==="mark"&&ne(n,"exitable",o)&&(a.ArrowRight=()=>$n.handleExit({editor:t,mark:n})),s){const p=Object.fromEntries(Object.entries(s()).map(([h,f])=>[h,()=>f({editor:t})]));a={...a,...p}}const l=new Ve({props:{handleKeyDown:av(a)}});i.push(l);const c=ne(n,"addInputRules",o);if(Nv(n,t.options.enableInputRules)&&c){const p=c();if(p&&p.length){const h=function(m){const{editor:g,rules:v}=m,b=new Ve({state:{init:()=>null,apply(y,k,x){const w=y.getMeta(b);if(w)return w;const C=y.getMeta("applyInputRules");return C&&setTimeout(()=>{let{text:S}=C;typeof S=="string"||(S=Qc(H.from(S),x.schema));const{from:E}=C,M=E+S.length;Ws({editor:g,from:E,to:M,text:S,rules:v,plugin:b})}),y.selectionSet||y.docChanged?null:k}},props:{handleTextInput:(y,k,x,w)=>Ws({editor:g,from:k,to:x,text:w,rules:v,plugin:b}),handleDOMEvents:{compositionend:y=>(setTimeout(()=>{const{$cursor:k}=y.state.selection;k&&Ws({editor:g,from:k.pos,to:k.pos,text:"",rules:v,plugin:b})}),!1)},handleKeyDown(y,k){if(k.key!=="Enter")return!1;const{$cursor:x}=y.state.selection;return!!x&&Ws({editor:g,from:x.pos,to:x.pos,text:`
48
+ `,rules:v,plugin:b})}},isInputRules:!0});return b}({editor:t,rules:p}),f=Array.isArray(h)?h:[h];i.push(...f)}}const d=ne(n,"addPasteRules",o);if(Nv(n,t.options.enablePasteRules)&&d){const p=d();if(p&&p.length){const h=function(f){const{editor:m,rules:g}=f;let v,b=null,y=!1,k=!1,x=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null;try{v=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{v=null}const w=({state:C,from:S,to:E,rule:M,pasteEvt:N})=>{const T=C.tr,A=As({state:C,transaction:T});if(function($){const{editor:B,state:V,from:O,to:D,rule:F,pasteEvent:R,dropEvent:L}=$,{commands:I,chain:P,can:W}=new Is({editor:B,state:V}),z=[];return V.doc.nodesBetween(O,D,(j,K)=>{var G,Z,J,Y,te;if((Z=(G=j.type)==null?void 0:G.spec)!=null&&Z.code||!(j.isText||j.isTextblock||j.isInline))return;const pe=(te=(Y=(J=j.content)==null?void 0:J.size)!=null?Y:j.nodeSize)!=null?te:0,X=Math.max(O,K),oe=Math.min(D,K+pe);if(X>=oe)return;((se,be,Fe)=>{if(qc(be))return[...se.matchAll(be)];const Me=be(se,Fe);return Me?Me.map(Ne=>{const de=[Ne.text];return de.index=Ne.index,de.input=se,de.data=Ne.data,Ne.replaceWith&&(Ne.text.includes(Ne.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),de.push(Ne.replaceWith)),de}):[]})(j.isText?j.text||"":j.textBetween(X-K,oe-K,void 0,""),F.find,R).forEach(se=>{if(se.index===void 0)return;const be=X+se.index+1,Fe=be+se[0].length,Me={from:V.tr.mapping.map(be),to:V.tr.mapping.map(Fe)},Ne=F.handler({state:V,range:Me,match:se,commands:I,chain:P,can:W,pasteEvent:R,dropEvent:L});z.push(Ne)})}),z.every(j=>j!==null)}({editor:m,state:A,from:Math.max(S-1,0),to:E.b-1,rule:M,pasteEvent:N,dropEvent:v})&&T.steps.length){try{v=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{v=null}return x=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,T}};return g.map(C=>new Ve({view(S){const E=N=>{var T;b=(T=S.dom.parentElement)!=null&&T.contains(N.target)?S.dom.parentElement:null,b&&(Us=m)},M=()=>{Us&&(Us=null)};return window.addEventListener("dragstart",E),window.addEventListener("dragend",M),{destroy(){window.removeEventListener("dragstart",E),window.removeEventListener("dragend",M)}}},props:{handleDOMEvents:{drop:(S,E)=>{if(k=b===S.dom.parentElement,v=E,!k){const M=Us;M!=null&&M.isEditable&&setTimeout(()=>{const N=M.state.selection;N&&M.commands.deleteRange({from:N.from,to:N.to})},10)}return!1},paste:(S,E)=>{var M;const N=(M=E.clipboardData)==null?void 0:M.getData("text/html");return x=E,y=!!(N!=null&&N.includes("data-pm-slice")),!1}}},appendTransaction:(S,E,M)=>{const N=S[0],T=N.getMeta("uiEvent")==="paste"&&!y,A=N.getMeta("uiEvent")==="drop"&&!k,$=N.getMeta("applyPasteRules"),B=!!$;if(!T&&!A&&!B)return;if(B){let{text:D}=$;typeof D=="string"||(D=Qc(H.from(D),M.schema));const{from:F}=$,R=F+D.length,L=(I=>{var P;const W=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(P=W.clipboardData)==null||P.setData("text/html",I),W})(D);return w({rule:C,state:M,from:F,to:{b:R},pasteEvt:L})}const V=E.doc.content.findDiffStart(M.doc.content),O=E.doc.content.findDiffEnd(M.doc.content);return typeof V=="number"&&O&&V!==O.b?w({rule:C,state:M,from:V,to:O,pasteEvt:x}):void 0}}))}({editor:t,rules:p});i.push(...h)}}const u=ne(n,"addProseMirrorPlugins",o);if(u){const p=u();i.push(...p)}return i})}get attributes(){return bv(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=ri(this.extensions);return Object.fromEntries(e.filter(n=>!!ne(n,"addNodeView")).map(n=>{const o=this.attributes.filter(a=>a.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Pe(n.name,this.schema)},s=ne(n,"addNodeView",i);return s?[n.name,(a,l,c,d,u)=>{const p=zs(a,o);return s()({node:a,view:l,getPos:c,decorations:d,innerDecorations:u,editor:t,extension:n,HTMLAttributes:p})}]:[]}))}get markViews(){const{editor:t}=this,{markExtensions:e}=ri(this.extensions);return Object.fromEntries(e.filter(n=>!!ne(n,"addMarkView")).map(n=>{const o=this.attributes.filter(a=>a.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:dn(n.name,this.schema)},s=ne(n,"addMarkView",i);return s?[n.name,(a,l,c)=>{const d=zs(a,o);return s()({mark:a,view:l,inline:c,editor:t,extension:n,HTMLAttributes:d,updateAttributes:u=>{(function(p,h,f={}){const{state:m}=h,{doc:g,tr:v}=m,b=p;g.descendants((y,k)=>{const x=v.mapping.map(k),w=v.mapping.map(k)+y.nodeSize;let C=null;if(y.marks.forEach(E=>{if(E!==b)return!1;C=E}),!C)return;let S=!1;if(Object.keys(f).forEach(E=>{f[E]!==C.attrs[E]&&(S=!0)}),S){const E=p.type.create({...p.attrs,...f});v.removeMark(x,w,p.type),v.addMark(x,w,E)}}),v.docChanged&&h.view.dispatch(v)})(a,t,u)}})}]:[]}))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var n;const o={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:td(e.name,this.schema)};e.type==="mark"&&((n=ve(ne(e,"keepOnSplit",o)))==null||n)&&this.splittableMarks.push(e.name);const i=ne(e,"onBeforeCreate",o),s=ne(e,"onCreate",o),a=ne(e,"onUpdate",o),l=ne(e,"onSelectionUpdate",o),c=ne(e,"onTransaction",o),d=ne(e,"onFocus",o),u=ne(e,"onBlur",o),p=ne(e,"onDestroy",o);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),a&&this.editor.on("update",a),l&&this.editor.on("selectionUpdate",l),c&&this.editor.on("transaction",c),d&&this.editor.on("focus",d),u&&this.editor.on("blur",u),p&&this.editor.on("destroy",p)})}};qs.resolve=xv,qs.sort=Zc,qs.flatten=Xc,Uc({},{ClipboardTextSerializer:()=>Vv,Commands:()=>Dv,Delete:()=>Av,Drop:()=>Iv,Editable:()=>Rv,FocusEvents:()=>$v,Keymap:()=>Pv,Paste:()=>zv,Tabindex:()=>Fv,focusEventsPluginKey:()=>Lv});var ze=class R0 extends id{constructor(){super(...arguments),this.type="extension"}static create(e={}){const n=typeof e=="function"?e():e;return new R0(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}},Vv=ze.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new Ve({key:new Ue("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:o,selection:i}=e,{ranges:s}=i,a=Math.min(...s.map(d=>d.$from.pos)),l=Math.max(...s.map(d=>d.$to.pos)),c=Sv(n);return Cv(o,{from:a,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),Dv=ze.create({name:"commands",addCommands:()=>({...lv})}),Av=ze.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var n,o,i;const s=()=>{var a,l,c,d;if((d=(c=(l=(a=this.editor.options.coreExtensionOptions)==null?void 0:a.delete)==null?void 0:l.filterTransaction)==null?void 0:c.call(l,t))!=null?d:t.getMeta("y-sync$"))return;const u=vv(t.before,[t,...e]);Mv(u).forEach(h=>{u.mapping.mapResult(h.oldRange.from).deletedAfter&&u.mapping.mapResult(h.oldRange.to).deletedBefore&&u.before.nodesBetween(h.oldRange.from,h.oldRange.to,(f,m)=>{const g=m+f.nodeSize-2,v=h.oldRange.from<=m&&g<=h.oldRange.to;this.editor.emit("delete",{type:"node",node:f,from:m,to:g,newFrom:u.mapping.map(m),newTo:u.mapping.map(g),deletedRange:h.oldRange,newRange:h.newRange,partial:!v,editor:this.editor,transaction:t,combinedTransform:u})})});const p=u.mapping;u.steps.forEach((h,f)=>{var m,g;if(h instanceof Lt){const v=p.slice(f).map(h.from,-1),b=p.slice(f).map(h.to),y=p.invert().map(v,-1),k=p.invert().map(b),x=(m=u.doc.nodeAt(v-1))==null?void 0:m.marks.some(C=>C.eq(h.mark)),w=(g=u.doc.nodeAt(b))==null?void 0:g.marks.some(C=>C.eq(h.mark));this.editor.emit("delete",{type:"mark",mark:h.mark,from:h.from,to:h.to,deletedRange:{from:y,to:k},newRange:{from:v,to:b},partial:!!(w||x),editor:this.editor,transaction:t,combinedTransform:u})}})};(i=(o=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:o.async)==null||i?setTimeout(s,0):s()}}),Iv=ze.create({name:"drop",addProseMirrorPlugins(){return[new Ve({key:new Ue("tiptapDrop"),props:{handleDrop:(t,e,n,o)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:o})}}})]}}),Rv=ze.create({name:"editable",addProseMirrorPlugins(){return[new Ve({key:new Ue("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Lv=new Ue("focusEvents"),$v=ze.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Ve({key:Lv,props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const o=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(o),!1},blur:(e,n)=>{t.isFocused=!1;const o=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(o),!1}}}})]}}),Pv=ze.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:d,$anchor:u}=l,{pos:p,parent:h}=u,f=u.parent.isTextblock&&p>0?a.doc.resolve(p-1):u,m=f.parent.type.spec.isolating,g=u.pos-u.parentOffset,v=m&&f.parent.childCount===1?g===u.pos:he.atStart(c).from===p;return!(!d||!h.type.isTextblock||h.textContent.length||!v||v&&u.parent.type.name==="paragraph")&&s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},o={...n},i={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Gc()||fv()?i:o},addProseMirrorPlugins(){return[new Ve({key:new Ue("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(f=>f.getMeta("composition")))return;const o=t.some(f=>f.docChanged)&&!e.doc.eq(n.doc),i=t.some(f=>f.getMeta("preventClearDocument"));if(!o||i)return;const{empty:s,from:a,to:l}=e.selection,c=he.atStart(e.doc).from,d=he.atEnd(e.doc).to;if(s||a!==c||l!==d||!js(n.doc))return;const u=n.tr,p=As({state:n,transaction:u}),{commands:h}=new Is({editor:this.editor,state:p});return h.clearNodes(),u.steps.length?u:void 0}})]}}),zv=ze.create({name:"paste",addProseMirrorPlugins(){return[new Ve({key:new Ue("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),Fv=ze.create({name:"tabindex",addProseMirrorPlugins(){return[new Ve({key:new Ue("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),RS=class hr{constructor(e,n,o=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=o,this.resolvedPos=e,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,o=this.to;if(this.isBlock){if(this.content.size===0)return void console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);n=this.from+1,o=this.to-1}this.editor.commands.insertContentAt({from:n,to:o},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new hr(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new hr(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new hr(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,o)=>{const i=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,a=this.pos+o+(s?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(a);if(!i&&l.depth<=this.depth)return;const c=new hr(l,this.editor,i,i?n:null);i&&(c.actualDepth=this.depth+1),e.push(new hr(l,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let o=null,i=this.parent;for(;i&&!o;){if(i.node.type.name===e)if(Object.keys(n).length>0){const s=i.node.attrs,a=Object.keys(n);for(let l=0;l<a.length;l+=1){const c=a[l];if(s[c]!==n[c])break}}else o=i;i=i.parent}return o}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},o=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(n);return this.children.forEach(a=>{o&&i.length>0||(a.node.type.name===e&&s.every(l=>n[l]===a.node.attrs[l])&&i.push(a),o&&i.length>0||(i=i.concat(a.querySelectorAll(e,n,o))))}),i}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}},LS=class extends AS{constructor(t={}){super(),this.css=null,this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:o})=>{throw o},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:o,slice:i,moved:s})=>this.options.onDrop(o,i,s)),this.on("paste",({event:o,slice:i})=>this.options.onPaste(o,i)),this.on("delete",this.options.onDelete);const e=this.createDoc(),n=pv(e,this.options.autofocus);this.editorState=er.create({doc:e,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=function(t,e){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const o=document.createElement("style");return e&&o.setAttribute("nonce",e),o.setAttribute("data-tiptap-style",""),o.innerHTML=`.ProseMirror {
49
49
  position: relative;
50
50
  }
51
51
 
@@ -115,15 +115,15 @@ img.ProseMirror-separator {
115
115
 
116
116
  .ProseMirror-focused .ProseMirror-gapcursor {
117
117
  display: block;
118
- }`,document.getElementsByTagName("head")[0].appendChild(o),o}(0,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=yv(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],o=this.state.reconfigure({plugins:n});return this.view.updateState(o),o}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;n=n.filter(a=>!a.key.startsWith(s))}),e.length===n.length)return;const o=this.state.reconfigure({plugins:n});return this.view.updateState(o),o}createExtensionManager(){var t,e;const n=[...this.options.enableCoreExtensions?[Rv,Vv.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),Av,$v,Pv,Fv,Iv,zv,Dv].filter(o=>typeof this.options.enableCoreExtensions!="object"||this.options.enableCoreExtensions[o.name]!==!1):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new qs(n,this)}createCommandManager(){this.commandManager=new Is({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=Yc(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error&&["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message)))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),t=Yc(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){var e;this.editorView=new tv(t,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)==null?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.prependClass(),this.injectCSS(),this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void t.steps.forEach(d=>{var u;return(u=this.capturedTransaction)==null?void 0:u.step(d)}):void(this.capturedTransaction=t);const{state:e,transactions:n}=this.state.applyTransaction(t),o=!this.state.selection.eq(e.selection),i=n.includes(t),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!i)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),o&&this.emit("selectionUpdate",{editor:this,transaction:t});const a=n.findLast(d=>d.getMeta("focus")||d.getMeta("blur")),l=a==null?void 0:a.getMeta("focus"),c=a==null?void 0:a.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:a}),c&&this.emit("blur",{editor:this,event:c.event,transaction:a}),t.getMeta("preventUpdate")||!n.some(d=>d.docChanged)||s.doc.eq(e.doc)||this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return Ev(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,o=typeof t=="string"?e:t;return function(i,s,a={}){if(!s)return Ln(i,null,a)||nd(i,null,a);const l=$s(s,i.schema);return l==="node"?Ln(i,s,a):l==="mark"&&nd(i,s,a)}(this.state,n,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Qc(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
118
+ }`,document.getElementsByTagName("head")[0].appendChild(o),o}(0,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const n=yv(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],o=this.state.reconfigure({plugins:n});return this.view.updateState(o),o}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let n=e;if([].concat(t).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;n=n.filter(a=>!a.key.startsWith(s))}),e.length===n.length)return;const o=this.state.reconfigure({plugins:n});return this.view.updateState(o),o}createExtensionManager(){var t,e;const n=[...this.options.enableCoreExtensions?[Rv,Vv.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),Dv,$v,Pv,Fv,Iv,zv,Av].filter(o=>typeof this.options.enableCoreExtensions!="object"||this.options.enableCoreExtensions[o.name]!==!1):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new qs(n,this)}createCommandManager(){this.commandManager=new Is({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=Yc(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error&&["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message)))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),t=Yc(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){var e;this.editorView=new tv(t,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)==null?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.prependClass(),this.injectCSS(),this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void t.steps.forEach(d=>{var u;return(u=this.capturedTransaction)==null?void 0:u.step(d)}):void(this.capturedTransaction=t);const{state:e,transactions:n}=this.state.applyTransaction(t),o=!this.state.selection.eq(e.selection),i=n.includes(t),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!i)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:n.slice(1)}),o&&this.emit("selectionUpdate",{editor:this,transaction:t});const a=n.findLast(d=>d.getMeta("focus")||d.getMeta("blur")),l=a==null?void 0:a.getMeta("focus"),c=a==null?void 0:a.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:a}),c&&this.emit("blur",{editor:this,event:c.event,transaction:a}),t.getMeta("preventUpdate")||!n.some(d=>d.docChanged)||s.doc.eq(e.doc)||this.emit("update",{editor:this,transaction:t,appendedTransactions:n.slice(1)})}getAttributes(t){return Ev(this.state,t)}isActive(t,e){const n=typeof t=="string"?t:null,o=typeof t=="string"?e:t;return function(i,s,a={}){if(!s)return Ln(i,null,a)||nd(i,null,a);const l=$s(s,i.schema);return l==="node"?Ln(i,s,a):l==="mark"&&nd(i,s,a)}(this.state,n,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Qc(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=`
119
119
 
120
- `,textSerializers:n={}}=t||{};return function(o,i){return Cv(o,{from:0,to:o.content.size},i)}(this.state.doc,{blockSeparator:e,textSerializers:{...Sv(this.schema),...n}})}get isEmpty(){return js(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)==null||e}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new IS(e,this)}get $doc(){return this.$pos(0)}};function lr(t){return new Hs({find:t.find,handler:({state:e,range:n,match:o})=>{const i=ve(t.getAttributes,void 0,o);if(i===!1||i===null)return null;const{tr:s}=e,a=o[o.length-1],l=o[0];if(a){const c=l.search(/\S/),d=n.from+l.indexOf(a),u=d+a.length;if(ed(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(m=>m===t.type&&m!==f.mark.type)).filter(f=>f.to>d).length)return null;u<n.to&&s.delete(u,n.to),d>n.from&&s.delete(n.from+c,d);const h=n.from+c+a.length;s.addMark(n.from+c,h,t.type.create(i||{})),s.removeStoredMark(t.type)}},undoable:t.undoable})}function jv(t){return new Hs({find:t.find,handler:({state:e,range:n,match:o})=>{const i=ve(t.getAttributes,void 0,o)||{},{tr:s}=e,a=n.from;let l=n.to;const c=t.type.create(i);if(o[1]){let d=a+o[0].lastIndexOf(o[1]);d>l?d=l:l=d+o[1].length;const u=o[0][o[0].length-1];s.insertText(u,a+o[0].length-1),s.replaceWith(d,l,c)}else if(o[0]){const d=t.type.isInline?a:a-1;s.insert(d,t.type.create(i)).delete(s.mapping.map(a),s.mapping.map(l))}s.scrollIntoView()},undoable:t.undoable})}function sd(t){return new Hs({find:t.find,handler:({state:e,range:n,match:o})=>{const i=e.doc.resolve(n.from),s=ve(t.getAttributes,void 0,o)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)},undoable:t.undoable})}function cr(t){return new Hs({find:t.find,handler:({state:e,range:n,match:o,chain:i})=>{const s=ve(t.getAttributes,void 0,o)||{},a=e.tr.delete(n.from,n.to),l=a.doc.resolve(n.from).blockRange(),c=l&&lc(l,t.type,s);if(!c)return null;if(a.wrap(l,c),t.keepMarks&&t.editor){const{selection:u,storedMarks:p}=e,{splittableMarks:h}=t.editor.extensionManager,f=p||u.$to.parentOffset&&u.$from.marks();if(f){const m=f.filter(g=>h.includes(g.type.name));a.ensureMarks(m)}}if(t.keepAttributes){const u=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(u,s).run()}const d=a.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&Nn(a.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(o,d))&&a.join(n.from-1)},undoable:t.undoable})}function ad(t){if(!(t!=null&&t.trim()))return{};const e={},n=[],o=t.replace(/["']([^"']*)["']/g,l=>(n.push(l),`__QUOTED_${n.length-1}__`)),i=o.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const l=i.map(c=>c.trim().slice(1));e.class=l.join(" ")}const s=o.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(e.id=s[1]),Array.from(o.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,l,c])=>{var d;const u=parseInt(((d=c.match(/__QUOTED_(\d+)__/))==null?void 0:d[1])||"0",10),p=n[u];p&&(e[l]=p.slice(1,-1))});const a=o.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return a&&a.split(/\s+/).filter(Boolean).forEach(l=>{l.match(/^[a-zA-Z][\w-]*$/)&&(e[l]=!0)}),e}function ld(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(n=>e.push(`.${n}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,o])=>{n!=="class"&&n!=="id"&&(o===!0?e.push(n):o!==!1&&o!=null&&e.push(`${n}="${String(o)}"`))}),e.join(" ")}function LS(t){const{nodeName:e,name:n,parseAttributes:o=ad,serializeAttributes:i=ld,defaultAttributes:s={},requiredAttributes:a=[],allowedAttributes:l}=t,c=n||e;return{parseMarkdown:(d,u)=>{const p={...s,...d.attributes};return u.createNode(e,p,[])},markdownTokenizer:{name:e,level:"block",start(d){var u;const p=new RegExp(`^:::${c}(?:\\s|$)`,"m"),h=(u=d.match(p))==null?void 0:u.index;return h!==void 0?h:-1},tokenize(d,u,p){const h=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),f=d.match(h);if(!f)return;const m=f[1]||"",g=o(m);return a.find(v=>!(v in g))?void 0:{type:e,raw:f[0],attributes:g}}},renderMarkdown:d=>{const u=(h=>{if(!l)return h;const f={};return l.forEach(m=>{m in h&&(f[m]=h[m])}),f})(d.attrs||{}),p=i(u);return`:::${c}${p?` {${p}}`:""} :::`}}}function $S(t){const{nodeName:e,name:n,getContent:o,parseAttributes:i=ad,serializeAttributes:s=ld,defaultAttributes:a={},content:l="block",allowedAttributes:c}=t,d=n||e;return{parseMarkdown:(u,p)=>{let h;if(o){const m=o(u);h=typeof m=="string"?[{type:"text",text:m}]:m}else h=l==="block"?p.parseChildren(u.tokens||[]):p.parseInline(u.tokens||[]);const f={...a,...u.attributes};return p.createNode(e,f,h)},markdownTokenizer:{name:e,level:"block",start(u){var p;const h=new RegExp(`^:::${d}`,"m"),f=(p=u.match(h))==null?void 0:p.index;return f!==void 0?f:-1},tokenize(u,p,h){var f;const m=new RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),g=u.match(m);if(!g)return;const[v,b=""]=g,y=i(b);let k=1;const x=v.length;let w="";const C=/^:::([\w-]*)(\s.*)?/gm,S=u.slice(x);for(C.lastIndex=0;;){const E=C.exec(S);if(E===null)break;const M=E.index,N=E[1];if(!((f=E[2])!=null&&f.endsWith(":::"))){if(N)k+=1;else if(k-=1,k===0){const T=S.slice(0,M);w=T.trim();const D=u.slice(0,x+M+E[0].length);let $=[];if(w)if(l==="block")for($=h.blockTokens(T),$.forEach(B=>{!B.text||B.tokens&&B.tokens.length!==0||(B.tokens=h.inlineTokens(B.text))});$.length>0;){const B=$[$.length-1];if(B.type!=="paragraph"||B.text&&B.text.trim()!=="")break;$.pop()}else $=h.inlineTokens(w);return{type:e,raw:D,attributes:y,content:w,tokens:$}}}}}},renderMarkdown:(u,p)=>{const h=(v=>{if(!c)return v;const b={};return c.forEach(y=>{y in v&&(b[y]=v[y])}),b})(u.attrs||{}),f=s(h),m=f?` {${f}}`:"",g=p.renderChildren(u.content||[],`
120
+ `,textSerializers:n={}}=t||{};return function(o,i){return Cv(o,{from:0,to:o.content.size},i)}(this.state.doc,{blockSeparator:e,textSerializers:{...Sv(this.schema),...n}})}get isEmpty(){return js(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)==null||e}$node(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelector(t,e))||null}$nodes(t,e){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new RS(e,this)}get $doc(){return this.$pos(0)}};function lr(t){return new Hs({find:t.find,handler:({state:e,range:n,match:o})=>{const i=ve(t.getAttributes,void 0,o);if(i===!1||i===null)return null;const{tr:s}=e,a=o[o.length-1],l=o[0];if(a){const c=l.search(/\S/),d=n.from+l.indexOf(a),u=d+a.length;if(ed(n.from,n.to,e.doc).filter(f=>f.mark.type.excluded.find(m=>m===t.type&&m!==f.mark.type)).filter(f=>f.to>d).length)return null;u<n.to&&s.delete(u,n.to),d>n.from&&s.delete(n.from+c,d);const h=n.from+c+a.length;s.addMark(n.from+c,h,t.type.create(i||{})),s.removeStoredMark(t.type)}},undoable:t.undoable})}function jv(t){return new Hs({find:t.find,handler:({state:e,range:n,match:o})=>{const i=ve(t.getAttributes,void 0,o)||{},{tr:s}=e,a=n.from;let l=n.to;const c=t.type.create(i);if(o[1]){let d=a+o[0].lastIndexOf(o[1]);d>l?d=l:l=d+o[1].length;const u=o[0][o[0].length-1];s.insertText(u,a+o[0].length-1),s.replaceWith(d,l,c)}else if(o[0]){const d=t.type.isInline?a:a-1;s.insert(d,t.type.create(i)).delete(s.mapping.map(a),s.mapping.map(l))}s.scrollIntoView()},undoable:t.undoable})}function sd(t){return new Hs({find:t.find,handler:({state:e,range:n,match:o})=>{const i=e.doc.resolve(n.from),s=ve(t.getAttributes,void 0,o)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)},undoable:t.undoable})}function cr(t){return new Hs({find:t.find,handler:({state:e,range:n,match:o,chain:i})=>{const s=ve(t.getAttributes,void 0,o)||{},a=e.tr.delete(n.from,n.to),l=a.doc.resolve(n.from).blockRange(),c=l&&lc(l,t.type,s);if(!c)return null;if(a.wrap(l,c),t.keepMarks&&t.editor){const{selection:u,storedMarks:p}=e,{splittableMarks:h}=t.editor.extensionManager,f=p||u.$to.parentOffset&&u.$from.marks();if(f){const m=f.filter(g=>h.includes(g.type.name));a.ensureMarks(m)}}if(t.keepAttributes){const u=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(u,s).run()}const d=a.doc.resolve(n.from-1).nodeBefore;d&&d.type===t.type&&Nn(a.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(o,d))&&a.join(n.from-1)},undoable:t.undoable})}function ad(t){if(!(t!=null&&t.trim()))return{};const e={},n=[],o=t.replace(/["']([^"']*)["']/g,l=>(n.push(l),`__QUOTED_${n.length-1}__`)),i=o.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const l=i.map(c=>c.trim().slice(1));e.class=l.join(" ")}const s=o.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(e.id=s[1]),Array.from(o.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,l,c])=>{var d;const u=parseInt(((d=c.match(/__QUOTED_(\d+)__/))==null?void 0:d[1])||"0",10),p=n[u];p&&(e[l]=p.slice(1,-1))});const a=o.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return a&&a.split(/\s+/).filter(Boolean).forEach(l=>{l.match(/^[a-zA-Z][\w-]*$/)&&(e[l]=!0)}),e}function ld(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(n=>e.push(`.${n}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([n,o])=>{n!=="class"&&n!=="id"&&(o===!0?e.push(n):o!==!1&&o!=null&&e.push(`${n}="${String(o)}"`))}),e.join(" ")}function $S(t){const{nodeName:e,name:n,parseAttributes:o=ad,serializeAttributes:i=ld,defaultAttributes:s={},requiredAttributes:a=[],allowedAttributes:l}=t,c=n||e;return{parseMarkdown:(d,u)=>{const p={...s,...d.attributes};return u.createNode(e,p,[])},markdownTokenizer:{name:e,level:"block",start(d){var u;const p=new RegExp(`^:::${c}(?:\\s|$)`,"m"),h=(u=d.match(p))==null?void 0:u.index;return h!==void 0?h:-1},tokenize(d,u,p){const h=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),f=d.match(h);if(!f)return;const m=f[1]||"",g=o(m);return a.find(v=>!(v in g))?void 0:{type:e,raw:f[0],attributes:g}}},renderMarkdown:d=>{const u=(h=>{if(!l)return h;const f={};return l.forEach(m=>{m in h&&(f[m]=h[m])}),f})(d.attrs||{}),p=i(u);return`:::${c}${p?` {${p}}`:""} :::`}}}function PS(t){const{nodeName:e,name:n,getContent:o,parseAttributes:i=ad,serializeAttributes:s=ld,defaultAttributes:a={},content:l="block",allowedAttributes:c}=t,d=n||e;return{parseMarkdown:(u,p)=>{let h;if(o){const m=o(u);h=typeof m=="string"?[{type:"text",text:m}]:m}else h=l==="block"?p.parseChildren(u.tokens||[]):p.parseInline(u.tokens||[]);const f={...a,...u.attributes};return p.createNode(e,f,h)},markdownTokenizer:{name:e,level:"block",start(u){var p;const h=new RegExp(`^:::${d}`,"m"),f=(p=u.match(h))==null?void 0:p.index;return f!==void 0?f:-1},tokenize(u,p,h){var f;const m=new RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),g=u.match(m);if(!g)return;const[v,b=""]=g,y=i(b);let k=1;const x=v.length;let w="";const C=/^:::([\w-]*)(\s.*)?/gm,S=u.slice(x);for(C.lastIndex=0;;){const E=C.exec(S);if(E===null)break;const M=E.index,N=E[1];if(!((f=E[2])!=null&&f.endsWith(":::"))){if(N)k+=1;else if(k-=1,k===0){const T=S.slice(0,M);w=T.trim();const A=u.slice(0,x+M+E[0].length);let $=[];if(w)if(l==="block")for($=h.blockTokens(T),$.forEach(B=>{!B.text||B.tokens&&B.tokens.length!==0||(B.tokens=h.inlineTokens(B.text))});$.length>0;){const B=$[$.length-1];if(B.type!=="paragraph"||B.text&&B.text.trim()!=="")break;$.pop()}else $=h.inlineTokens(w);return{type:e,raw:A,attributes:y,content:w,tokens:$}}}}}},renderMarkdown:(u,p)=>{const h=(v=>{if(!c)return v;const b={};return c.forEach(y=>{y in v&&(b[y]=v[y])}),b})(u.attrs||{}),f=s(h),m=f?` {${f}}`:"",g=p.renderChildren(u.content||[],`
121
121
 
122
122
  `);return`:::${d}${m}
123
123
 
124
124
  ${g}
125
125
 
126
- :::`}}}function PS(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let o=n.exec(t);for(;o!==null;){const[,i,s,a]=o;e[i]=s||a,o=n.exec(t)}return e}function zS(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function FS(t){const{nodeName:e,name:n,getContent:o,parseAttributes:i=PS,serializeAttributes:s=zS,defaultAttributes:a={},selfClosing:l=!1,allowedAttributes:c}=t,d=n||e,u=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(p,h)=>{const f={...a,...p.attributes};if(l)return h.createNode(e,f);const m=o?o(p):p.content||"";return m?h.createNode(e,f,[h.createTextNode(m)]):h.createNode(e,f,[])},markdownTokenizer:{name:e,level:"inline",start(p){const h=l?new RegExp(`\\[${u}\\s*[^\\]]*\\]`):new RegExp(`\\[${u}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${u}\\]`),f=p.match(h),m=f==null?void 0:f.index;return m!==void 0?m:-1},tokenize(p,h,f){const m=l?new RegExp(`^\\[${u}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${u}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${u}\\]`),g=p.match(m);if(!g)return;let v="",b="";if(l){const[,k]=g;b=k}else{const[,k,x]=g;b=k,v=x||""}const y=i(b.trim());return{type:e,raw:g[0],content:v.trim(),attributes:y}}},renderMarkdown:p=>{let h="";o?h=o(p):p.content&&p.content.length>0&&(h=p.content.filter(v=>v.type==="text").map(v=>v.text).join(""));const f=(v=>{if(!c)return v;const b={};return c.forEach(y=>{y in v&&(b[y]=v[y])}),b})(p.attrs||{}),m=s(f),g=m?` ${m}`:"";return l?`[${d}${g}]`:`[${d}${g}]${h}[/${d}]`}}}function cd(t,e,n){var o,i,s,a;const l=t.split(`
126
+ :::`}}}function zS(t){if(!t.trim())return{};const e={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let o=n.exec(t);for(;o!==null;){const[,i,s,a]=o;e[i]=s||a,o=n.exec(t)}return e}function FS(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,n])=>`${e}="${n}"`).join(" ")}function jS(t){const{nodeName:e,name:n,getContent:o,parseAttributes:i=zS,serializeAttributes:s=FS,defaultAttributes:a={},selfClosing:l=!1,allowedAttributes:c}=t,d=n||e,u=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(p,h)=>{const f={...a,...p.attributes};if(l)return h.createNode(e,f);const m=o?o(p):p.content||"";return m?h.createNode(e,f,[h.createTextNode(m)]):h.createNode(e,f,[])},markdownTokenizer:{name:e,level:"inline",start(p){const h=l?new RegExp(`\\[${u}\\s*[^\\]]*\\]`):new RegExp(`\\[${u}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${u}\\]`),f=p.match(h),m=f==null?void 0:f.index;return m!==void 0?m:-1},tokenize(p,h,f){const m=l?new RegExp(`^\\[${u}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${u}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${u}\\]`),g=p.match(m);if(!g)return;let v="",b="";if(l){const[,k]=g;b=k}else{const[,k,x]=g;b=k,v=x||""}const y=i(b.trim());return{type:e,raw:g[0],content:v.trim(),attributes:y}}},renderMarkdown:p=>{let h="";o?h=o(p):p.content&&p.content.length>0&&(h=p.content.filter(v=>v.type==="text").map(v=>v.text).join(""));const f=(v=>{if(!c)return v;const b={};return c.forEach(y=>{y in v&&(b[y]=v[y])}),b})(p.attrs||{}),m=s(f),g=m?` ${m}`:"";return l?`[${d}${g}]`:`[${d}${g}]${h}[/${d}]`}}}function cd(t,e,n){var o,i,s,a;const l=t.split(`
127
127
  `),c=[];let d="",u=0;const p=e.baseIndentSize||2;for(;u<l.length;){const h=l[u],f=h.match(e.itemPattern);if(!f){if(c.length>0)break;if(h.trim()===""){u+=1;continue}return}const m=e.extractItemData(f),{indentLevel:g,mainContent:v}=m;d=`${d}${h}
128
128
  `;const b=[v];for(u+=1;u<l.length;){const w=l[u];if(w.trim()===""){const C=l.slice(u+1).findIndex(S=>S.trim()!=="");if(C===-1)break;if((((i=(o=l[u+1+C].match(/^(\s*)/))==null?void 0:o[1])==null?void 0:i.length)||0)>g){b.push(w),d=`${d}${w}
129
129
  `,u+=1;continue}break}if(!((((a=(s=w.match(/^(\s*)/))==null?void 0:s[1])==null?void 0:a.length)||0)>g))break;b.push(w),d=`${d}${w}
@@ -131,10 +131,10 @@ ${g}
131
131
  `);w.trim()&&(y=e.customNestedParser?e.customNestedParser(w):n.blockTokens(w))}const x=e.createToken(m,y);c.push(x)}if(c.length!==0)return{items:c,raw:d.trim()}}function dd(t,e,n,o){if(!t||!Array.isArray(t.content))return"";const i=typeof n=="function"?n(o):n,[s,...a]=t.content,l=[`${i}${e.renderChildren([s])}`];return a&&a.length>0&&a.forEach(c=>{const d=e.renderChildren([c]);if(d){const u=d.split(`
132
132
  `).map(p=>p?e.indent(p):"").join(`
133
133
  `);l.push(u)}}),l.join(`
134
- `)}Uc({},{createAtomBlockMarkdownSpec:()=>LS,createBlockMarkdownSpec:()=>$S,createInlineMarkdownSpec:()=>FS,parseAttributes:()=>ad,parseIndentedBlocks:()=>cd,renderNestedMarkdownContent:()=>dd,serializeAttributes:()=>ld});var ut=class L0 extends id{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new L0(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function vo(t){return new DS({find:t.find,handler:({state:e,range:n,match:o,pasteEvent:i})=>{const s=ve(t.getAttributes,void 0,o,i);if(s===!1||s===null)return null;const{tr:a}=e,l=o[o.length-1],c=o[0];let d=n.to;if(l){const u=c.search(/\S/),p=n.from+c.indexOf(l),h=p+l.length;if(ed(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(g=>g===t.type&&g!==m.mark.type)).filter(m=>m.to>p).length)return null;h<n.to&&a.delete(h,n.to),p>n.from&&a.delete(n.from+u,p),d=n.from+u+l.length,a.addMark(n.from+u,d,t.type.create(s||{})),a.removeStoredMark(t.type)}}})}function Hv(t){return r.customRef((e,n)=>({get:()=>(e(),t),set(o){t=o,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}var jS=class extends RS{constructor(t={}){return super(t),this.contentComponent=null,this.appContext=null,this.reactiveState=Hv(this.view.state),this.reactiveExtensionStorage=Hv(this.extensionStorage),this.on("beforeTransaction",({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),r.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(t,e){const n=super.registerPlugin(t,e);return this.reactiveState&&(this.reactiveState.value=n),n}unregisterPlugin(t){const e=super.unregisterPlugin(t);return this.reactiveState&&e&&(this.reactiveState.value=e),e}},HS=r.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=r.ref(),n=r.getCurrentInstance();return r.watchEffect(()=>{const o=t.editor;o&&o.options.element&&e.value&&r.nextTick(()=>{var i;if(!e.value||!((i=o.view.dom)!=null&&i.firstChild))return;const s=r.unref(e.value);e.value.append(o.view.dom),o.contentComponent=n.ctx._,n&&(o.appContext={...n.appContext,provides:n.provides}),o.setOptions({element:s}),o.createNodeViews()})}),r.onBeforeUnmount(()=>{const o=t.editor;o&&(o.contentComponent=null,o.appContext=null)}),{rootEl:e}},render(){return r.h("div",{ref:t=>{this.rootEl=t}})}});r.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return r.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),r.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return r.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)==null?void 0:e.call(t))}}),r.defineComponent({name:"MarkViewContent",props:{as:{type:String,default:"span"}},render(){return r.h(this.as,{style:{whiteSpace:"inherit"},"data-mark-view-content":""})}});var Js=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...o}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,o,n]},WS=/^\s*>\s$/,KS=ut.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:t}){return Js("blockquote",{...Re(this.options.HTMLAttributes,t),children:Js("slot",{})})},parseMarkdown:(t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),renderMarkdown:(t,e)=>{if(!t.content)return"";const n=[];return t.content.forEach(o=>{const i=e.renderChildren(o).split(`
134
+ `)}Uc({},{createAtomBlockMarkdownSpec:()=>$S,createBlockMarkdownSpec:()=>PS,createInlineMarkdownSpec:()=>jS,parseAttributes:()=>ad,parseIndentedBlocks:()=>cd,renderNestedMarkdownContent:()=>dd,serializeAttributes:()=>ld});var ut=class L0 extends id{constructor(){super(...arguments),this.type="node"}static create(e={}){const n=typeof e=="function"?e():e;return new L0(n)}configure(e){return super.configure(e)}extend(e){const n=typeof e=="function"?e():e;return super.extend(n)}};function vo(t){return new IS({find:t.find,handler:({state:e,range:n,match:o,pasteEvent:i})=>{const s=ve(t.getAttributes,void 0,o,i);if(s===!1||s===null)return null;const{tr:a}=e,l=o[o.length-1],c=o[0];let d=n.to;if(l){const u=c.search(/\S/),p=n.from+c.indexOf(l),h=p+l.length;if(ed(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(g=>g===t.type&&g!==m.mark.type)).filter(m=>m.to>p).length)return null;h<n.to&&a.delete(h,n.to),p>n.from&&a.delete(n.from+u,p),d=n.from+u+l.length,a.addMark(n.from+u,d,t.type.create(s||{})),a.removeStoredMark(t.type)}}})}function Hv(t){return r.customRef((e,n)=>({get:()=>(e(),t),set(o){t=o,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}var HS=class extends LS{constructor(t={}){return super(t),this.contentComponent=null,this.appContext=null,this.reactiveState=Hv(this.view.state),this.reactiveExtensionStorage=Hv(this.extensionStorage),this.on("beforeTransaction",({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),r.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(t,e){const n=super.registerPlugin(t,e);return this.reactiveState&&(this.reactiveState.value=n),n}unregisterPlugin(t){const e=super.unregisterPlugin(t);return this.reactiveState&&e&&(this.reactiveState.value=e),e}},WS=r.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=r.ref(),n=r.getCurrentInstance();return r.watchEffect(()=>{const o=t.editor;o&&o.options.element&&e.value&&r.nextTick(()=>{var i;if(!e.value||!((i=o.view.dom)!=null&&i.firstChild))return;const s=r.unref(e.value);e.value.append(o.view.dom),o.contentComponent=n.ctx._,n&&(o.appContext={...n.appContext,provides:n.provides}),o.setOptions({element:s}),o.createNodeViews()})}),r.onBeforeUnmount(()=>{const o=t.editor;o&&(o.contentComponent=null,o.appContext=null)}),{rootEl:e}},render(){return r.h("div",{ref:t=>{this.rootEl=t}})}});r.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return r.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),r.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return r.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)==null?void 0:e.call(t))}}),r.defineComponent({name:"MarkViewContent",props:{as:{type:String,default:"span"}},render(){return r.h(this.as,{style:{whiteSpace:"inherit"},"data-mark-view-content":""})}});var Js=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:n,...o}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,o,n]},KS=/^\s*>\s$/,US=ut.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:t}){return Js("blockquote",{...Re(this.options.HTMLAttributes,t),children:Js("slot",{})})},parseMarkdown:(t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),renderMarkdown:(t,e)=>{if(!t.content)return"";const n=[];return t.content.forEach(o=>{const i=e.renderChildren(o).split(`
135
135
  `).map(s=>`> ${s}`).join(`
136
136
  `);n.push(i)}),n.flatMap(o=>[o,"> "]).slice(0,-1).join(`
137
- `)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[cr({find:WS,type:this.type})]}}),US=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,qS=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,JS=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,GS=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,YS=$n.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return Js("strong",{...Re(this.options.HTMLAttributes,t),children:Js("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[lr({find:US,type:this.type}),lr({find:JS,type:this.type})]},addPasteRules(){return[vo({find:qS,type:this.type}),vo({find:GS,type:this.type})]}}),XS=/(^|[^`])`([^`]+)`(?!`)$/,QS=/(^|[^`])`([^`]+)`(?!`)/g,ZS=$n.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:t}){return["code",Re(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[lr({find:XS,type:this.type})]},addPasteRules(){return[vo({find:QS,type:this.type})]}}),eE=/^```([a-z]+)?[\s\n]$/,tE=/^~~~([a-z]+)?[\s\n]$/,nE=ut.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;return n&&[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0]||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:t,HTMLAttributes:e}){return["pre",Re(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n;return((n=t.raw)==null?void 0:n.startsWith("```"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let o="";const i=((n=t.attrs)==null?void 0:n.language)||"";return o=t.content?[`\`\`\`${i}`,e.renderChildren(t.content),"```"].join(`
137
+ `)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[cr({find:KS,type:this.type})]}}),qS=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,JS=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,GS=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,YS=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,XS=$n.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return Js("strong",{...Re(this.options.HTMLAttributes,t),children:Js("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[lr({find:qS,type:this.type}),lr({find:GS,type:this.type})]},addPasteRules(){return[vo({find:JS,type:this.type}),vo({find:YS,type:this.type})]}}),QS=/(^|[^`])`([^`]+)`(?!`)$/,ZS=/(^|[^`])`([^`]+)`(?!`)/g,eE=$n.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:t}){return["code",Re(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[lr({find:QS,type:this.type})]},addPasteRules(){return[vo({find:ZS,type:this.type})]}}),tE=/^```([a-z]+)?[\s\n]$/,nE=/^~~~([a-z]+)?[\s\n]$/,oE=ut.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options;return n&&[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0]||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:t,HTMLAttributes:e}){return["pre",Re(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var n;return((n=t.raw)==null?void 0:n.startsWith("```"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var n;let o="";const i=((n=t.attrs)==null?void 0:n.language)||"";return o=t.content?[`\`\`\`${i}`,e.renderChildren(t.content),"```"].join(`
138
138
  `):`\`\`\`${i}
139
139
 
140
140
  \`\`\``,o},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!(!t||e.parent.type.name!==this.name)&&!(!n&&e.parent.textContent.length)&&this.editor.commands.clearNodes()},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const n=(e=this.options.tabSize)!=null?e:4,{state:o}=t,{selection:i}=o,{$from:s,empty:a}=i;if(s.parent.type!==this.type)return!1;const l=" ".repeat(n);return a?t.commands.insertContent(l):t.commands.command(({tr:c})=>{const{from:d,to:u}=i,p=o.doc.textBetween(d,u,`
@@ -150,26 +150,26 @@ ${g}
150
150
  `).map(p=>{var h;const f=((h=p.match(/^ */))==null?void 0:h[0])||"",m=Math.min(f.length,n);return p.slice(m)}).join(`
151
151
  `);return l.replaceWith(c,d,o.schema.text(u)),!0}))},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type)return!1;const s=o.parentOffset===o.parent.nodeSize-2,a=o.parent.textContent.endsWith(`
152
152
 
153
- `);return!(!s||!a)&&t.chain().command(({tr:l})=>(l.delete(o.pos-2,o.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:o}=e,{$from:i,empty:s}=n;if(!s||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;const a=i.after();return a!==void 0&&(o.nodeAt(a)?t.commands.command(({tr:l})=>(l.setSelection(he.near(o.resolve(a))),!0)):t.commands.exitCode())}}},addInputRules(){return[sd({find:eE,type:this.type,getAttributes:t=>({language:t[1]})}),sd({find:tE,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Ve({key:new Ue("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),o=e.clipboardData.getData("vscode-editor-data"),i=o?JSON.parse(o):void 0,s=i==null?void 0:i.mode;if(!n||!s)return!1;const{tr:a,schema:l}=t.state,c=l.text(n.replace(/\r\n?/g,`
154
- `));return a.replaceSelectionWith(this.type.create({language:s},c)),a.selection.$from.parent.type!==this.type&&a.setSelection(le.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta("paste",!0),t.dispatch(a),!0}}})]}}),oE=ut.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
153
+ `);return!(!s||!a)&&t.chain().command(({tr:l})=>(l.delete(o.pos-2,o.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:o}=e,{$from:i,empty:s}=n;if(!s||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;const a=i.after();return a!==void 0&&(o.nodeAt(a)?t.commands.command(({tr:l})=>(l.setSelection(he.near(o.resolve(a))),!0)):t.commands.exitCode())}}},addInputRules(){return[sd({find:tE,type:this.type,getAttributes:t=>({language:t[1]})}),sd({find:nE,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Ve({key:new Ue("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),o=e.clipboardData.getData("vscode-editor-data"),i=o?JSON.parse(o):void 0,s=i==null?void 0:i.mode;if(!n||!s)return!1;const{tr:a,schema:l}=t.state,c=l.text(n.replace(/\r\n?/g,`
154
+ `));return a.replaceSelectionWith(this.type.create({language:s},c)),a.selection.$from.parent.type!==this.type&&a.setSelection(le.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta("paste",!0),t.dispatch(a),!0}}})]}}),rE=ut.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
155
155
 
156
- `):""}),rE=ut.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:t}){return["br",Re(this.options.HTMLAttributes,t)]},renderText:()=>`
156
+ `):""}),iE=ut.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:t}){return["br",Re(this.options.HTMLAttributes,t)]},renderText:()=>`
157
157
  `,renderMarkdown:(t,e)=>e.indent(`
158
- `),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:o})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:l}=o.extensionManager,c=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&c&&a){const p=c.filter(h=>l.includes(h.type.name));d.ensureMarks(p)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),iE=ut.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Re(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const o=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,i="#".repeat(o);return t.content?`${i} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.setNode(this.name,t),toggleHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>sd({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),sE=ut.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{},nextNodeType:"paragraph"}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:t}){return["hr",Re(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!function(s,a){const{selection:l}=s,{$from:c}=l;if(l instanceof re){const u=c.index();return c.parent.canReplaceWith(u,u+1,a)}let d=c.depth;for(;d>=0;){const u=c.index(d);if(c.node(d).contentMatchAt(u).matchType(a))return!0;d-=1}return!1}(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:o}=n,i=t();return Tv(n)?i.insertContentAt(o.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:s,tr:a,dispatch:l})=>{if(l){const{$to:c}=a.selection,d=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?a.setSelection(le.create(a.doc,c.pos+1)):c.nodeAfter.isBlock?a.setSelection(re.create(a.doc,c.pos)):a.setSelection(le.create(a.doc,c.pos));else{const u=s.schema.nodes[this.options.nextNodeType]||c.parent.type.contentMatch.defaultType,p=u==null?void 0:u.create();p&&(a.insert(d,p),a.setSelection(le.create(a.doc,d+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[jv({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),aE=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,lE=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,cE=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,dE=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,uE=$n.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Re(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[lr({find:aE,type:this.type}),lr({find:cE,type:this.type})]},addPasteRules(){return[vo({find:lE,type:this.type}),vo({find:dE,type:this.type})]}});const ud="numeric",pd="ascii",hd="alpha",ii="asciinumeric",si="alphanumeric",fd="domain",Wv="emoji",pE="scheme",hE="slashscheme",md="whitespace";function fE(t,e){return t in e||(e[t]=[]),e[t]}function yo(t,e,n){e[ud]&&(e[ii]=!0,e[si]=!0),e[pd]&&(e[ii]=!0,e[hd]=!0),e[ii]&&(e[si]=!0),e[hd]&&(e[si]=!0),e[si]&&(e[fd]=!0),e[Wv]&&(e[fd]=!0);for(const o in e){const i=fE(o,n);i.indexOf(t)<0&&i.push(t)}}function pt(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}pt.groups={},pt.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let o=0;o<e.jr.length;o++){const i=e.jr[o][0],s=e.jr[o][1];if(s&&i.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,o){for(let i=0;i<t.length;i++)this.tt(t[i],e,n,o)},tr(t,e,n,o){let i;return o=o||pt.groups,e&&e.j?i=e:(i=new pt(e),n&&o&&yo(e,n,o)),this.jr.push([t,i]),i},ts(t,e,n,o){let i=this;const s=t.length;if(!s)return i;for(let a=0;a<s-1;a++)i=i.tt(t[a]);return i.tt(t[s-1],e,n,o)},tt(t,e,n,o){o=o||pt.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const s=e;let a,l=i.go(t);if(l?(a=new pt,Object.assign(a.j,l.j),a.jr.push.apply(a.jr,l.jr),a.jd=l.jd,a.t=l.t):a=new pt,s){if(o)if(a.t&&typeof a.t=="string"){const c=Object.assign(function(d,u){const p={};for(const h in u)u[h].indexOf(d)>=0&&(p[h]=!0);return p}(a.t,o),n);yo(s,c,o)}else n&&yo(s,n,o);a.t=s}return i.j[t]=a,a}};const fe=(t,e,n,o,i)=>t.ta(e,n,o,i),Ae=(t,e,n,o,i)=>t.tr(e,n,o,i),Kv=(t,e,n,o,i)=>t.ts(e,n,o,i),U=(t,e,n,o,i)=>t.tt(e,n,o,i),un="WORD",gd="UWORD",Uv="ASCIINUMERICAL",qv="ALPHANUMERICAL",ai="LOCALHOST",vd="TLD",yd="UTLD",Gs="SCHEME",dr="SLASH_SCHEME",bd="NUM",kd="WS",wd="NL",li="OPENBRACE",ci="CLOSEBRACE",Ys="OPENBRACKET",Xs="CLOSEBRACKET",Qs="OPENPAREN",Zs="CLOSEPAREN",ea="OPENANGLEBRACKET",ta="CLOSEANGLEBRACKET",na="FULLWIDTHLEFTPAREN",oa="FULLWIDTHRIGHTPAREN",ra="LEFTCORNERBRACKET",ia="RIGHTCORNERBRACKET",sa="LEFTWHITECORNERBRACKET",aa="RIGHTWHITECORNERBRACKET",la="FULLWIDTHLESSTHAN",ca="FULLWIDTHGREATERTHAN",da="AMPERSAND",ua="APOSTROPHE",pa="ASTERISK",Pn="AT",ha="BACKSLASH",fa="BACKTICK",ma="CARET",zn="COLON",xd="COMMA",ga="DOLLAR",Gt="DOT",va="EQUALS",Cd="EXCLAMATION",_t="HYPHEN",di="PERCENT",ya="PIPE",ba="PLUS",ka="POUND",ui="QUERY",Sd="QUOTE",Jv="FULLWIDTHMIDDLEDOT",Ed="SEMI",Yt="SLASH",pi="TILDE",wa="UNDERSCORE",Gv="EMOJI",xa="SYM";var Yv=Object.freeze({__proto__:null,ALPHANUMERICAL:qv,AMPERSAND:da,APOSTROPHE:ua,ASCIINUMERICAL:Uv,ASTERISK:pa,AT:Pn,BACKSLASH:ha,BACKTICK:fa,CARET:ma,CLOSEANGLEBRACKET:ta,CLOSEBRACE:ci,CLOSEBRACKET:Xs,CLOSEPAREN:Zs,COLON:zn,COMMA:xd,DOLLAR:ga,DOT:Gt,EMOJI:Gv,EQUALS:va,EXCLAMATION:Cd,FULLWIDTHGREATERTHAN:ca,FULLWIDTHLEFTPAREN:na,FULLWIDTHLESSTHAN:la,FULLWIDTHMIDDLEDOT:Jv,FULLWIDTHRIGHTPAREN:oa,HYPHEN:_t,LEFTCORNERBRACKET:ra,LEFTWHITECORNERBRACKET:sa,LOCALHOST:ai,NL:wd,NUM:bd,OPENANGLEBRACKET:ea,OPENBRACE:li,OPENBRACKET:Ys,OPENPAREN:Qs,PERCENT:di,PIPE:ya,PLUS:ba,POUND:ka,QUERY:ui,QUOTE:Sd,RIGHTCORNERBRACKET:ia,RIGHTWHITECORNERBRACKET:aa,SCHEME:Gs,SEMI:Ed,SLASH:Yt,SLASH_SCHEME:dr,SYM:xa,TILDE:pi,TLD:vd,UNDERSCORE:wa,UTLD:yd,UWORD:gd,WORD:un,WS:kd});const pn=/[a-z]/,hi=new RegExp("\\p{L}","u"),Md=new RegExp("\\p{Emoji}","u"),hn=/\d/,Nd=/\s/;let Ca=null,Sa=null;function Xv(t,e){const n=function(l){const c=[],d=l.length;let u=0;for(;u<d;){let p,h=l.charCodeAt(u),f=h<55296||h>56319||u+1===d||(p=l.charCodeAt(u+1))<56320||p>57343?l[u]:l.slice(u,u+2);c.push(f),u+=f.length}return c}(e.replace(/[A-Z]/g,l=>l.toLowerCase())),o=n.length,i=[];let s=0,a=0;for(;a<o;){let l=t,c=null,d=0,u=null,p=-1,h=-1;for(;a<o&&(c=l.go(n[a]));)l=c,l.accepts()?(p=0,h=0,u=l):p>=0&&(p+=n[a].length,h++),d+=n[a].length,s+=n[a].length,a++;s-=p,a-=h,d-=p,i.push({t:u.t,v:e.slice(s-d,s),s:s-d,e:s})}return i}function Fn(t,e,n,o,i){let s;const a=e.length;for(let l=0;l<a-1;l++){const c=e[l];t.j[c]?s=t.j[c]:(s=new pt(o),s.jr=i.slice(),t.j[c]=s),t=s}return s=new pt(n),s.jr=i.slice(),t.j[e[a-1]]=s,s}function Qv(t){const e=[],n=[];let o=0;for(;o<t.length;){let i=0;for(;"0123456789".indexOf(t[o+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let s=parseInt(t.substring(o,o+i),10);s>0;s--)n.pop();o+=i}else n.push(t[o]),o++}return e}const fi={defaultProtocol:"http",events:null,format:Zv,formatHref:Zv,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Bd(t,e=null){let n=Object.assign({},fi);t&&(n=Object.assign(n,t instanceof Bd?t.o:t));const o=n.ignoreTags,i=[];for(let s=0;s<o.length;s++)i.push(o[s].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}function Zv(t){return t}function ey(t,e){this.t="token",this.v=t,this.tk=e}function Ea(t,e){class n extends ey{constructor(i,s){super(i,s),this.t=t}}for(const o in e)n.prototype[o]=e[o];return n.t=t,n}Bd.prototype={o:fi,ignoreTags:[],defaultRender:t=>t,check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const o=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:fi[t],typeof i=="function"&&o&&(i=i(e,n))):typeof i=="function"&&o&&(i=i(e,n.t,n)),i)},getObj(t,e,n){let o=this.o[t];return typeof o=="function"&&e!=null&&(o=o(e,n.t,n)),o},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}},ey.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),o=t.get("format",e,this);return n&&o.length>n?o.substring(0,n)+"…":o},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=fi.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),o=t.get("formatHref",n,this),i=t.get("tagName",n,e),s=this.toFormattedString(t),a={},l=t.get("className",n,e),c=t.get("target",n,e),d=t.get("rel",n,e),u=t.getObj("attributes",n,e),p=t.getObj("events",n,e);return a.href=o,l&&(a.class=l),c&&(a.target=c),d&&(a.rel=d),u&&Object.assign(a,u),{tagName:i,attributes:a,content:s,eventListeners:p}}};const ty=Ea("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),ny=Ea("text"),mE=Ea("nl"),Ma=Ea("url",{isLink:!0,toHref(t=fi.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==ai&&t[1].t===zn}}),Vt=t=>new pt(t);function Td(t,e,n){const o=n[0].s,i=n[n.length-1].e;return new t(e.slice(o,i),n)}const gE=typeof console<"u"&&console&&console.warn||(()=>{}),Oe={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function oy(t,e=!1){if(Oe.initialized&&gE(`linkifyjs: already initialized - will not register custom scheme "${t}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
158
+ `),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:o})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:l}=o.extensionManager,c=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&c&&a){const p=c.filter(h=>l.includes(h.type.name));d.ensureMarks(p)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),sE=ut.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Re(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var n;const o=(n=t.attrs)!=null&&n.level?parseInt(t.attrs.level,10):1,i="#".repeat(o);return t.content?`${i} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.setNode(this.name,t),toggleHeading:t=>({commands:e})=>!!this.options.levels.includes(t.level)&&e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>sd({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}}),aE=ut.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{},nextNodeType:"paragraph"}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:t}){return["hr",Re(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!function(s,a){const{selection:l}=s,{$from:c}=l;if(l instanceof re){const u=c.index();return c.parent.canReplaceWith(u,u+1,a)}let d=c.depth;for(;d>=0;){const u=c.index(d);if(c.node(d).contentMatchAt(u).matchType(a))return!0;d-=1}return!1}(e,e.schema.nodes[this.name]))return!1;const{selection:n}=e,{$to:o}=n,i=t();return Tv(n)?i.insertContentAt(o.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:s,tr:a,dispatch:l})=>{if(l){const{$to:c}=a.selection,d=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?a.setSelection(le.create(a.doc,c.pos+1)):c.nodeAfter.isBlock?a.setSelection(re.create(a.doc,c.pos)):a.setSelection(le.create(a.doc,c.pos));else{const u=s.schema.nodes[this.options.nextNodeType]||c.parent.type.contentMatch.defaultType,p=u==null?void 0:u.create();p&&(a.insert(d,p),a.setSelection(le.create(a.doc,d+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[jv({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),lE=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,cE=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,dE=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,uE=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,pE=$n.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Re(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[lr({find:lE,type:this.type}),lr({find:dE,type:this.type})]},addPasteRules(){return[vo({find:cE,type:this.type}),vo({find:uE,type:this.type})]}});const ud="numeric",pd="ascii",hd="alpha",ii="asciinumeric",si="alphanumeric",fd="domain",Wv="emoji",hE="scheme",fE="slashscheme",md="whitespace";function mE(t,e){return t in e||(e[t]=[]),e[t]}function yo(t,e,n){e[ud]&&(e[ii]=!0,e[si]=!0),e[pd]&&(e[ii]=!0,e[hd]=!0),e[ii]&&(e[si]=!0),e[hd]&&(e[si]=!0),e[si]&&(e[fd]=!0),e[Wv]&&(e[fd]=!0);for(const o in e){const i=mE(o,n);i.indexOf(t)<0&&i.push(t)}}function pt(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}pt.groups={},pt.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let o=0;o<e.jr.length;o++){const i=e.jr[o][0],s=e.jr[o][1];if(s&&i.test(t))return s}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,o){for(let i=0;i<t.length;i++)this.tt(t[i],e,n,o)},tr(t,e,n,o){let i;return o=o||pt.groups,e&&e.j?i=e:(i=new pt(e),n&&o&&yo(e,n,o)),this.jr.push([t,i]),i},ts(t,e,n,o){let i=this;const s=t.length;if(!s)return i;for(let a=0;a<s-1;a++)i=i.tt(t[a]);return i.tt(t[s-1],e,n,o)},tt(t,e,n,o){o=o||pt.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const s=e;let a,l=i.go(t);if(l?(a=new pt,Object.assign(a.j,l.j),a.jr.push.apply(a.jr,l.jr),a.jd=l.jd,a.t=l.t):a=new pt,s){if(o)if(a.t&&typeof a.t=="string"){const c=Object.assign(function(d,u){const p={};for(const h in u)u[h].indexOf(d)>=0&&(p[h]=!0);return p}(a.t,o),n);yo(s,c,o)}else n&&yo(s,n,o);a.t=s}return i.j[t]=a,a}};const fe=(t,e,n,o,i)=>t.ta(e,n,o,i),De=(t,e,n,o,i)=>t.tr(e,n,o,i),Kv=(t,e,n,o,i)=>t.ts(e,n,o,i),U=(t,e,n,o,i)=>t.tt(e,n,o,i),un="WORD",gd="UWORD",Uv="ASCIINUMERICAL",qv="ALPHANUMERICAL",ai="LOCALHOST",vd="TLD",yd="UTLD",Gs="SCHEME",dr="SLASH_SCHEME",bd="NUM",kd="WS",wd="NL",li="OPENBRACE",ci="CLOSEBRACE",Ys="OPENBRACKET",Xs="CLOSEBRACKET",Qs="OPENPAREN",Zs="CLOSEPAREN",ea="OPENANGLEBRACKET",ta="CLOSEANGLEBRACKET",na="FULLWIDTHLEFTPAREN",oa="FULLWIDTHRIGHTPAREN",ra="LEFTCORNERBRACKET",ia="RIGHTCORNERBRACKET",sa="LEFTWHITECORNERBRACKET",aa="RIGHTWHITECORNERBRACKET",la="FULLWIDTHLESSTHAN",ca="FULLWIDTHGREATERTHAN",da="AMPERSAND",ua="APOSTROPHE",pa="ASTERISK",Pn="AT",ha="BACKSLASH",fa="BACKTICK",ma="CARET",zn="COLON",xd="COMMA",ga="DOLLAR",Gt="DOT",va="EQUALS",Cd="EXCLAMATION",_t="HYPHEN",di="PERCENT",ya="PIPE",ba="PLUS",ka="POUND",ui="QUERY",Sd="QUOTE",Jv="FULLWIDTHMIDDLEDOT",Ed="SEMI",Yt="SLASH",pi="TILDE",wa="UNDERSCORE",Gv="EMOJI",xa="SYM";var Yv=Object.freeze({__proto__:null,ALPHANUMERICAL:qv,AMPERSAND:da,APOSTROPHE:ua,ASCIINUMERICAL:Uv,ASTERISK:pa,AT:Pn,BACKSLASH:ha,BACKTICK:fa,CARET:ma,CLOSEANGLEBRACKET:ta,CLOSEBRACE:ci,CLOSEBRACKET:Xs,CLOSEPAREN:Zs,COLON:zn,COMMA:xd,DOLLAR:ga,DOT:Gt,EMOJI:Gv,EQUALS:va,EXCLAMATION:Cd,FULLWIDTHGREATERTHAN:ca,FULLWIDTHLEFTPAREN:na,FULLWIDTHLESSTHAN:la,FULLWIDTHMIDDLEDOT:Jv,FULLWIDTHRIGHTPAREN:oa,HYPHEN:_t,LEFTCORNERBRACKET:ra,LEFTWHITECORNERBRACKET:sa,LOCALHOST:ai,NL:wd,NUM:bd,OPENANGLEBRACKET:ea,OPENBRACE:li,OPENBRACKET:Ys,OPENPAREN:Qs,PERCENT:di,PIPE:ya,PLUS:ba,POUND:ka,QUERY:ui,QUOTE:Sd,RIGHTCORNERBRACKET:ia,RIGHTWHITECORNERBRACKET:aa,SCHEME:Gs,SEMI:Ed,SLASH:Yt,SLASH_SCHEME:dr,SYM:xa,TILDE:pi,TLD:vd,UNDERSCORE:wa,UTLD:yd,UWORD:gd,WORD:un,WS:kd});const pn=/[a-z]/,hi=new RegExp("\\p{L}","u"),Md=new RegExp("\\p{Emoji}","u"),hn=/\d/,Nd=/\s/;let Ca=null,Sa=null;function Xv(t,e){const n=function(l){const c=[],d=l.length;let u=0;for(;u<d;){let p,h=l.charCodeAt(u),f=h<55296||h>56319||u+1===d||(p=l.charCodeAt(u+1))<56320||p>57343?l[u]:l.slice(u,u+2);c.push(f),u+=f.length}return c}(e.replace(/[A-Z]/g,l=>l.toLowerCase())),o=n.length,i=[];let s=0,a=0;for(;a<o;){let l=t,c=null,d=0,u=null,p=-1,h=-1;for(;a<o&&(c=l.go(n[a]));)l=c,l.accepts()?(p=0,h=0,u=l):p>=0&&(p+=n[a].length,h++),d+=n[a].length,s+=n[a].length,a++;s-=p,a-=h,d-=p,i.push({t:u.t,v:e.slice(s-d,s),s:s-d,e:s})}return i}function Fn(t,e,n,o,i){let s;const a=e.length;for(let l=0;l<a-1;l++){const c=e[l];t.j[c]?s=t.j[c]:(s=new pt(o),s.jr=i.slice(),t.j[c]=s),t=s}return s=new pt(n),s.jr=i.slice(),t.j[e[a-1]]=s,s}function Qv(t){const e=[],n=[];let o=0;for(;o<t.length;){let i=0;for(;"0123456789".indexOf(t[o+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let s=parseInt(t.substring(o,o+i),10);s>0;s--)n.pop();o+=i}else n.push(t[o]),o++}return e}const fi={defaultProtocol:"http",events:null,format:Zv,formatHref:Zv,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Bd(t,e=null){let n=Object.assign({},fi);t&&(n=Object.assign(n,t instanceof Bd?t.o:t));const o=n.ignoreTags,i=[];for(let s=0;s<o.length;s++)i.push(o[s].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}function Zv(t){return t}function ey(t,e){this.t="token",this.v=t,this.tk=e}function Ea(t,e){class n extends ey{constructor(i,s){super(i,s),this.t=t}}for(const o in e)n.prototype[o]=e[o];return n.t=t,n}Bd.prototype={o:fi,ignoreTags:[],defaultRender:t=>t,check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const o=e!=null;let i=this.o[t];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:fi[t],typeof i=="function"&&o&&(i=i(e,n))):typeof i=="function"&&o&&(i=i(e,n.t,n)),i)},getObj(t,e,n){let o=this.o[t];return typeof o=="function"&&e!=null&&(o=o(e,n.t,n)),o},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}},ey.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),o=t.get("format",e,this);return n&&o.length>n?o.substring(0,n)+"…":o},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=fi.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),o=t.get("formatHref",n,this),i=t.get("tagName",n,e),s=this.toFormattedString(t),a={},l=t.get("className",n,e),c=t.get("target",n,e),d=t.get("rel",n,e),u=t.getObj("attributes",n,e),p=t.getObj("events",n,e);return a.href=o,l&&(a.class=l),c&&(a.target=c),d&&(a.rel=d),u&&Object.assign(a,u),{tagName:i,attributes:a,content:s,eventListeners:p}}};const ty=Ea("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),ny=Ea("text"),gE=Ea("nl"),Ma=Ea("url",{isLink:!0,toHref(t=fi.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==ai&&t[1].t===zn}}),Vt=t=>new pt(t);function Td(t,e,n){const o=n[0].s,i=n[n.length-1].e;return new t(e.slice(o,i),n)}const vE=typeof console<"u"&&console&&console.warn||(()=>{}),Oe={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function oy(t,e=!1){if(Oe.initialized&&vE(`linkifyjs: already initialized - will not register custom scheme "${t}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
159
159
  1. Must only contain digits, lowercase ASCII letters or "-"
160
160
  2. Cannot start or end with "-"
161
- 3. "-" cannot repeat`);Oe.customSchemes.push([t,e])}function Od(t){return Oe.initialized||function(){Oe.scanner=function(e=[]){const n={};pt.groups=n;const o=new pt;Ca==null&&(Ca=Qv("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),Sa==null&&(Sa=Qv("ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2")),U(o,"'",ua),U(o,"{",li),U(o,"}",ci),U(o,"[",Ys),U(o,"]",Xs),U(o,"(",Qs),U(o,")",Zs),U(o,"<",ea),U(o,">",ta),U(o,"(",na),U(o,")",oa),U(o,"「",ra),U(o,"」",ia),U(o,"『",sa),U(o,"』",aa),U(o,"<",la),U(o,">",ca),U(o,"&",da),U(o,"*",pa),U(o,"@",Pn),U(o,"`",fa),U(o,"^",ma),U(o,":",zn),U(o,",",xd),U(o,"$",ga),U(o,".",Gt),U(o,"=",va),U(o,"!",Cd),U(o,"-",_t),U(o,"%",di),U(o,"|",ya),U(o,"+",ba),U(o,"#",ka),U(o,"?",ui),U(o,'"',Sd),U(o,"/",Yt),U(o,";",Ed),U(o,"~",pi),U(o,"_",wa),U(o,"\\",ha),U(o,"・",Jv);const i=Ae(o,hn,bd,{[ud]:!0});Ae(i,hn,i);const s=Ae(i,pn,Uv,{[ii]:!0}),a=Ae(i,hi,qv,{[si]:!0}),l=Ae(o,pn,un,{[pd]:!0});Ae(l,hn,s),Ae(l,pn,l),Ae(s,hn,s),Ae(s,pn,s);const c=Ae(o,hi,gd,{[hd]:!0});Ae(c,pn),Ae(c,hn,a),Ae(c,hi,c),Ae(a,hn,a),Ae(a,pn),Ae(a,hi,a);const d=U(o,`
162
- `,wd,{[md]:!0}),u=U(o,"\r",kd,{[md]:!0}),p=Ae(o,Nd,kd,{[md]:!0});U(o,"",p),U(u,`
163
- `,d),U(u,"",p),Ae(u,Nd,p),U(p,"\r"),U(p,`
164
- `),Ae(p,Nd,p),U(p,"",p);const h=Ae(o,Md,Gv,{[Wv]:!0});U(h,"#"),Ae(h,Md,h),U(h,"️",h);const f=U(h,"‍");U(f,"#"),Ae(f,Md,h);const m=[[pn,l],[hn,s]],g=[[pn,null],[hi,c],[hn,a]];for(let v=0;v<Ca.length;v++)Fn(o,Ca[v],vd,un,m);for(let v=0;v<Sa.length;v++)Fn(o,Sa[v],yd,gd,g);yo(vd,{tld:!0,ascii:!0},n),yo(yd,{utld:!0,alpha:!0},n),Fn(o,"file",Gs,un,m),Fn(o,"mailto",Gs,un,m),Fn(o,"http",dr,un,m),Fn(o,"https",dr,un,m),Fn(o,"ftp",dr,un,m),Fn(o,"ftps",dr,un,m),yo(Gs,{scheme:!0,ascii:!0},n),yo(dr,{slashscheme:!0,ascii:!0},n),e=e.sort((v,b)=>v[0]>b[0]?1:-1);for(let v=0;v<e.length;v++){const b=e[v][0],y=e[v][1]?{[pE]:!0}:{[hE]:!0};b.indexOf("-")>=0?y[fd]=!0:pn.test(b)?hn.test(b)?y[ii]=!0:y[pd]=!0:y[ud]=!0,Kv(o,b,b,y)}return Kv(o,"localhost",ai,{ascii:!0}),o.jd=new pt(xa),{start:o,tokens:Object.assign({groups:n},Yv)}}(Oe.customSchemes);for(let e=0;e<Oe.tokenQueue.length;e++)Oe.tokenQueue[e][1]({scanner:Oe.scanner});Oe.parser=function({groups:e}){const n=e.domain.concat([da,pa,Pn,ha,fa,ma,ga,va,_t,bd,di,ya,ba,ka,Yt,xa,pi,wa]),o=[ua,zn,xd,Gt,Cd,di,ui,Sd,Ed,ea,ta,li,ci,Xs,Ys,Qs,Zs,na,oa,ra,ia,sa,aa,la,ca],i=[da,ua,pa,ha,fa,ma,ga,va,_t,li,ci,di,ya,ba,ka,ui,Yt,xa,pi,wa],s=Vt(),a=U(s,pi);fe(a,i,a),fe(a,e.domain,a);const l=Vt(),c=Vt(),d=Vt();fe(s,e.domain,l),fe(s,e.scheme,c),fe(s,e.slashscheme,d),fe(l,i,a),fe(l,e.domain,l);const u=U(l,Pn);U(a,Pn,u),U(c,Pn,u),U(d,Pn,u);const p=U(a,Gt);fe(p,i,a),fe(p,e.domain,a);const h=Vt();fe(u,e.domain,h),fe(h,e.domain,h);const f=U(h,Gt);fe(f,e.domain,h);const m=Vt(ty);fe(f,e.tld,m),fe(f,e.utld,m),U(u,ai,m);const g=U(h,_t);U(g,_t,g),fe(g,e.domain,h),fe(m,e.domain,h),U(m,Gt,f),U(m,_t,g);const v=U(m,zn);fe(v,e.numeric,ty);const b=U(l,_t),y=U(l,Gt);U(b,_t,b),fe(b,e.domain,l),fe(y,i,a),fe(y,e.domain,l);const k=Vt(Ma);fe(y,e.tld,k),fe(y,e.utld,k),fe(k,e.domain,l),fe(k,i,a),U(k,Gt,y),U(k,_t,b),U(k,Pn,u);const x=U(k,zn),w=Vt(Ma);fe(x,e.numeric,w);const C=Vt(Ma),S=Vt();fe(C,n,C),fe(C,o,S),fe(S,n,C),fe(S,o,S),U(k,Yt,C),U(w,Yt,C);const E=U(c,zn),M=U(d,zn),N=U(M,Yt),T=U(N,Yt);fe(c,e.domain,l),U(c,Gt,y),U(c,_t,b),fe(d,e.domain,l),U(d,Gt,y),U(d,_t,b),fe(E,e.domain,C),U(E,Yt,C),U(E,ui,C),fe(T,e.domain,C),fe(T,n,C),U(T,Yt,C);const D=[[li,ci],[Ys,Xs],[Qs,Zs],[ea,ta],[na,oa],[ra,ia],[sa,aa],[la,ca]];for(let $=0;$<D.length;$++){const[B,V]=D[$],O=U(C,B);U(S,B,O),U(O,V,C);const A=Vt(Ma);fe(O,n,A);const F=Vt();fe(O,o),fe(A,n,A),fe(A,o,F),fe(F,n,A),fe(F,o,F),U(A,V,C),U(F,V,C)}return U(s,ai,k),U(s,wd,mE),{start:s,tokens:Yv}}(Oe.scanner.tokens);for(let e=0;e<Oe.pluginQueue.length;e++)Oe.pluginQueue[e][1]({scanner:Oe.scanner,parser:Oe.parser});Oe.initialized=!0}(),function(e,n,o){let i=o.length,s=0,a=[],l=[];for(;s<i;){let c=e,d=null,u=null,p=0,h=null,f=-1;for(;s<i&&!(d=c.go(o[s].t));)l.push(o[s++]);for(;s<i&&(u=d||c.go(o[s].t));)d=null,c=u,c.accepts()?(f=0,h=c):f>=0&&f++,s++,p++;if(f<0)s-=p,s<i&&(l.push(o[s]),s++);else{l.length>0&&(a.push(Td(ny,n,l)),l=[]),s-=f,p-=f;const m=h.t,g=o.slice(s-p,s);a.push(Td(m,n,g))}}return l.length>0&&a.push(Td(ny,n,l)),a}(Oe.parser.start,t,Xv(Oe.scanner.start,t))}function ry(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const o=new Bd(n),i=Od(t),s=[];for(let a=0;a<i.length;a++){const l=i[a];!l.isLink||e&&l.t!==e||!o.check(l)||s.push(l.toFormattedObject(o))}return s}Od.scan=Xv;var _d="[\0-   ᠎ -\u2029  ]",vE=new RegExp(_d),yE=new RegExp(`${_d}$`),bE=new RegExp(_d,"g");function bo(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(o=>{const i=typeof o=="string"?o:o.scheme;i&&n.push(i)}),!t||t.replace(bE,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var kE=$n.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{typeof t!="string"?oy(t.scheme,t.optionalSlashes):oy(t)})},onDestroy(){pt.groups={},Oe.scanner=null,Oe.parser=null,Oe.tokenQueue=[],Oe.pluginQueue=[],Oe.customSchemes=[],Oe.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!bo(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}),addAttributes(){return{href:{default:null,parseHTML:t=>t.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!(!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!bo(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!bo(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Re(this.options.HTMLAttributes,t),0]:["a",Re(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n;const o=((n=t.attrs)==null?void 0:n.href)||"";return`[${e.renderChildren(t)}](${o})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return!!this.options.isAllowedUri(n,{defaultValidate:o=>!!bo(o,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&e().setMark(this.name,t).setMeta("preventAutolink",!0).run()},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return!(n&&!this.options.isAllowedUri(n,{defaultValidate:o=>!!bo(o,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[vo({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:o}=this.options,i=ry(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!bo(a,n),protocols:n,defaultProtocol:o}));i.length&&i.forEach(s=>{this.options.shouldAutoLink(s.value)&&e.push({text:s.value,data:{href:s.href},index:s.start})})}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;var o;return this.options.autolink&&t.push((o={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:i=>this.options.isAllowedUri(i,{defaultValidate:s=>!!bo(s,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink},new Ve({key:new Ue("autolink"),appendTransaction:(i,s,a)=>{const l=i.some(u=>u.docChanged)&&!s.doc.eq(a.doc),c=i.some(u=>u.getMeta("preventAutolink"));if(!l||c)return;const{tr:d}=a;return Mv(vv(s.doc,[...i])).forEach(({newRange:u})=>{const p=function(g,v){const b=[];return g.nodesBetween(v.from,v.to,(y,k)=>{(x=>x.isTextblock)(y)&&b.push({node:y,pos:k})}),b}(a.doc,u);let h,f;if(p.length>1)h=p[0],f=a.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(p.length){const g=a.doc.textBetween(u.from,u.to," "," ");if(!yE.test(g))return;h=p[0],f=a.doc.textBetween(h.pos,u.to,void 0," ")}if(h&&f){const g=f.split(vE).filter(Boolean);if(g.length<=0)return!1;const v=g[g.length-1],b=h.pos+f.lastIndexOf(v);if(!v)return!1;const y=Od(v).map(k=>k.toObject(o.defaultProtocol));if(!((m=y).length===1?m[0].isLink:m.length===3&&m[1].isLink&&["()","[]"].includes(m[0].value+m[2].value)))return!1;y.filter(k=>k.isLink).map(k=>({...k,from:b+k.start+1,to:b+k.end+1})).filter(k=>!a.schema.marks.code||!a.doc.rangeHasMark(k.from,k.to,a.schema.marks.code)).filter(k=>o.validate(k.value)).filter(k=>o.shouldAutoLink(k.value)).forEach(k=>{ed(k.from,k.to,a.doc).some(x=>x.mark.type===o.type)||d.addMark(k.from,k.to,o.type.create({href:k.href}))})}var m}),d.steps.length?d:void 0}}))),this.options.openOnClick===!0&&t.push(function(i){return new Ve({key:new Ue("handleClickLink"),props:{handleClick:(s,a,l)=>{var c,d;if(l.button!==0||!s.editable)return!1;let u=null;if(l.target instanceof HTMLAnchorElement)u=l.target;else{let m=l.target;const g=[];for(;m.nodeName!=="DIV";)g.push(m),m=m.parentNode;u=g.find(v=>v.nodeName==="A")}if(!u)return!1;const p=Ev(s.state,i.type.name),h=(c=u==null?void 0:u.href)!=null?c:p.href,f=(d=u==null?void 0:u.target)!=null?d:p.target;return i.enableClickSelection&&i.editor.commands.extendMarkRange(i.type.name),!(!u||!h||(window.open(h,f),0))}}})}({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(function(i){return new Ve({key:new Ue("handlePasteLink"),props:{handlePaste:(s,a,l)=>{const{shouldAutoLink:c}=i,{state:d}=s,{selection:u}=d,{empty:p}=u;if(p)return!1;let h="";l.content.forEach(m=>{h+=m.textContent});const f=ry(h,{defaultProtocol:i.defaultProtocol}).find(m=>m.isLink&&m.value===h);return!(!h||!f||c!==void 0&&!c(f.href))&&i.editor.commands.setMark(i.type,{href:f.href})}}})}({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),wE=Object.defineProperty,iy="textStyle",sy=/^\s*([-+*])\s$/,ay=ut.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",Re(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
165
- `):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(iy)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=cr({find:sy,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=cr({find:sy,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(iy),editor:this.editor})),[t]}}),ly=ut.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",Re(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{if(t.type!=="list_item")return[];let n=[];if(t.tokens&&t.tokens.length>0)if(t.tokens.some(o=>o.type==="paragraph"))n=e.parseChildren(t.tokens);else{const o=t.tokens[0];if(o&&o.type==="text"&&o.tokens&&o.tokens.length>0){if(n=[{type:"paragraph",content:e.parseInline(o.tokens)}],t.tokens.length>1){const i=t.tokens.slice(1),s=e.parseChildren(i);n.push(...s)}}else n=e.parseChildren(t.tokens)}return n.length===0&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},renderMarkdown:(t,e,n)=>dd(t,e,o=>o.parentType==="bulletList"?"- ":o.parentType==="orderedList"?`${o.index+1}. `:"- ",n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});((t,e)=>{for(var n in e)wE(t,n,{get:e[n],enumerable:!0})})({},{findListItemPos:()=>mi,getNextListDepth:()=>Vd,handleBackspace:()=>Ad,handleDelete:()=>Dd,hasListBefore:()=>cy,hasListItemAfter:()=>xE,hasListItemBefore:()=>dy,listItemHasSubList:()=>uy,nextListIsDeeper:()=>py,nextListIsHigher:()=>hy});var mi=(t,e)=>{const{$from:n}=e.selection,o=Pe(t,e.schema);let i=null,s=n.depth,a=n.pos,l=null;for(;s>0&&l===null;)i=n.node(s),i.type===o?l=s:(s-=1,a-=1);return l===null?null:{$pos:e.doc.resolve(a),depth:l}},Vd=(t,e)=>{const n=mi(t,e);if(!n)return!1;const[,o]=((i,s,a,l=20)=>{const c=i.doc.resolve(a);let d=l,u=null;for(;d>0&&u===null;){const p=c.node(d);(p==null?void 0:p.type.name)===s?u=p:d-=1}return[u,d]})(e,t,n.$pos.pos+4);return o},cy=(t,e,n)=>{const{$anchor:o}=t.selection,i=Math.max(0,o.pos-2),s=t.doc.resolve(i).node();return!(!s||!n.includes(s.type.name))},dy=(t,e)=>{var n;const{$anchor:o}=e.selection,i=e.doc.resolve(o.pos-2);return i.index()!==0&&((n=i.nodeBefore)==null?void 0:n.type.name)===t},uy=(t,e,n)=>{if(!n)return!1;const o=Pe(t,e.schema);let i=!1;return n.descendants(s=>{s.type===o&&(i=!0)}),i},Ad=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Ln(t.state,e)&&cy(t.state,e,n)){const{$anchor:a}=t.state.selection,l=t.state.doc.resolve(a.before()-1),c=[];l.node().descendants((p,h)=>{p.type.name===e&&c.push({node:p,pos:h})});const d=c.at(-1);if(!d)return!1;const u=t.state.doc.resolve(l.start()+d.pos+1);return t.chain().cut({from:a.start()-1,to:a.end()+1},u.end()).joinForward().run()}if(!Ln(t.state,e)||!(a=>{const{$from:l,$to:c}=a.selection;return!(l.parentOffset>0||l.pos!==c.pos)})(t.state))return!1;const o=mi(e,t.state);if(!o)return!1;const i=t.state.doc.resolve(o.$pos.pos-2).node(o.depth),s=uy(e,t.state,i);return dy(e,t.state)&&!s?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},py=(t,e)=>{const n=Vd(t,e),o=mi(t,e);return!(!o||!n)&&n>o.depth},hy=(t,e)=>{const n=Vd(t,e),o=mi(t,e);return!(!o||!n)&&n<o.depth},Dd=(t,e)=>{if(!Ln(t.state,e)||!((s,a)=>{const{$from:l,$to:c,$anchor:d}=s.selection;if(a){const u=Ps(h=>h.type.name===a)(s.selection);if(!u)return!1;const p=s.doc.resolve(u.pos+1);return d.pos+1===p.end()}return!(c.parentOffset<c.parent.nodeSize-2||l.pos!==c.pos)})(t.state,e))return!1;const{selection:n}=t.state,{$from:o,$to:i}=n;return!(!n.empty&&o.sameParent(i))&&(py(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():hy(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward())},xE=(t,e)=>{var n;const{$anchor:o}=e.selection,i=e.doc.resolve(o.pos-o.parentOffset-2);return i.index()!==i.parent.childCount-1&&((n=i.nodeAfter)==null?void 0:n.type.name)===t},fy=ze.create({name:"listKeymap",addOptions:()=>({listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}),addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&Dd(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&Dd(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:o})=>{t.state.schema.nodes[n]!==void 0&&Ad(t,n,o)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:o})=>{t.state.schema.nodes[n]!==void 0&&Ad(t,n,o)&&(e=!0)}),e}}}}),my=/^(\s*)(\d+)\.\s+(.*)$/,CE=/^\s/;function gy(t,e,n){var o;const i=[];let s=0;for(;s<t.length;){const a=t[s];if(a.indent===e){const l=a.content.split(`
161
+ 3. "-" cannot repeat`);Oe.customSchemes.push([t,e])}function Od(t){return Oe.initialized||function(){Oe.scanner=function(e=[]){const n={};pt.groups=n;const o=new pt;Ca==null&&(Ca=Qv("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),Sa==null&&(Sa=Qv("ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2")),U(o,"'",ua),U(o,"{",li),U(o,"}",ci),U(o,"[",Ys),U(o,"]",Xs),U(o,"(",Qs),U(o,")",Zs),U(o,"<",ea),U(o,">",ta),U(o,"(",na),U(o,")",oa),U(o,"「",ra),U(o,"」",ia),U(o,"『",sa),U(o,"』",aa),U(o,"<",la),U(o,">",ca),U(o,"&",da),U(o,"*",pa),U(o,"@",Pn),U(o,"`",fa),U(o,"^",ma),U(o,":",zn),U(o,",",xd),U(o,"$",ga),U(o,".",Gt),U(o,"=",va),U(o,"!",Cd),U(o,"-",_t),U(o,"%",di),U(o,"|",ya),U(o,"+",ba),U(o,"#",ka),U(o,"?",ui),U(o,'"',Sd),U(o,"/",Yt),U(o,";",Ed),U(o,"~",pi),U(o,"_",wa),U(o,"\\",ha),U(o,"・",Jv);const i=De(o,hn,bd,{[ud]:!0});De(i,hn,i);const s=De(i,pn,Uv,{[ii]:!0}),a=De(i,hi,qv,{[si]:!0}),l=De(o,pn,un,{[pd]:!0});De(l,hn,s),De(l,pn,l),De(s,hn,s),De(s,pn,s);const c=De(o,hi,gd,{[hd]:!0});De(c,pn),De(c,hn,a),De(c,hi,c),De(a,hn,a),De(a,pn),De(a,hi,a);const d=U(o,`
162
+ `,wd,{[md]:!0}),u=U(o,"\r",kd,{[md]:!0}),p=De(o,Nd,kd,{[md]:!0});U(o,"",p),U(u,`
163
+ `,d),U(u,"",p),De(u,Nd,p),U(p,"\r"),U(p,`
164
+ `),De(p,Nd,p),U(p,"",p);const h=De(o,Md,Gv,{[Wv]:!0});U(h,"#"),De(h,Md,h),U(h,"️",h);const f=U(h,"‍");U(f,"#"),De(f,Md,h);const m=[[pn,l],[hn,s]],g=[[pn,null],[hi,c],[hn,a]];for(let v=0;v<Ca.length;v++)Fn(o,Ca[v],vd,un,m);for(let v=0;v<Sa.length;v++)Fn(o,Sa[v],yd,gd,g);yo(vd,{tld:!0,ascii:!0},n),yo(yd,{utld:!0,alpha:!0},n),Fn(o,"file",Gs,un,m),Fn(o,"mailto",Gs,un,m),Fn(o,"http",dr,un,m),Fn(o,"https",dr,un,m),Fn(o,"ftp",dr,un,m),Fn(o,"ftps",dr,un,m),yo(Gs,{scheme:!0,ascii:!0},n),yo(dr,{slashscheme:!0,ascii:!0},n),e=e.sort((v,b)=>v[0]>b[0]?1:-1);for(let v=0;v<e.length;v++){const b=e[v][0],y=e[v][1]?{[hE]:!0}:{[fE]:!0};b.indexOf("-")>=0?y[fd]=!0:pn.test(b)?hn.test(b)?y[ii]=!0:y[pd]=!0:y[ud]=!0,Kv(o,b,b,y)}return Kv(o,"localhost",ai,{ascii:!0}),o.jd=new pt(xa),{start:o,tokens:Object.assign({groups:n},Yv)}}(Oe.customSchemes);for(let e=0;e<Oe.tokenQueue.length;e++)Oe.tokenQueue[e][1]({scanner:Oe.scanner});Oe.parser=function({groups:e}){const n=e.domain.concat([da,pa,Pn,ha,fa,ma,ga,va,_t,bd,di,ya,ba,ka,Yt,xa,pi,wa]),o=[ua,zn,xd,Gt,Cd,di,ui,Sd,Ed,ea,ta,li,ci,Xs,Ys,Qs,Zs,na,oa,ra,ia,sa,aa,la,ca],i=[da,ua,pa,ha,fa,ma,ga,va,_t,li,ci,di,ya,ba,ka,ui,Yt,xa,pi,wa],s=Vt(),a=U(s,pi);fe(a,i,a),fe(a,e.domain,a);const l=Vt(),c=Vt(),d=Vt();fe(s,e.domain,l),fe(s,e.scheme,c),fe(s,e.slashscheme,d),fe(l,i,a),fe(l,e.domain,l);const u=U(l,Pn);U(a,Pn,u),U(c,Pn,u),U(d,Pn,u);const p=U(a,Gt);fe(p,i,a),fe(p,e.domain,a);const h=Vt();fe(u,e.domain,h),fe(h,e.domain,h);const f=U(h,Gt);fe(f,e.domain,h);const m=Vt(ty);fe(f,e.tld,m),fe(f,e.utld,m),U(u,ai,m);const g=U(h,_t);U(g,_t,g),fe(g,e.domain,h),fe(m,e.domain,h),U(m,Gt,f),U(m,_t,g);const v=U(m,zn);fe(v,e.numeric,ty);const b=U(l,_t),y=U(l,Gt);U(b,_t,b),fe(b,e.domain,l),fe(y,i,a),fe(y,e.domain,l);const k=Vt(Ma);fe(y,e.tld,k),fe(y,e.utld,k),fe(k,e.domain,l),fe(k,i,a),U(k,Gt,y),U(k,_t,b),U(k,Pn,u);const x=U(k,zn),w=Vt(Ma);fe(x,e.numeric,w);const C=Vt(Ma),S=Vt();fe(C,n,C),fe(C,o,S),fe(S,n,C),fe(S,o,S),U(k,Yt,C),U(w,Yt,C);const E=U(c,zn),M=U(d,zn),N=U(M,Yt),T=U(N,Yt);fe(c,e.domain,l),U(c,Gt,y),U(c,_t,b),fe(d,e.domain,l),U(d,Gt,y),U(d,_t,b),fe(E,e.domain,C),U(E,Yt,C),U(E,ui,C),fe(T,e.domain,C),fe(T,n,C),U(T,Yt,C);const A=[[li,ci],[Ys,Xs],[Qs,Zs],[ea,ta],[na,oa],[ra,ia],[sa,aa],[la,ca]];for(let $=0;$<A.length;$++){const[B,V]=A[$],O=U(C,B);U(S,B,O),U(O,V,C);const D=Vt(Ma);fe(O,n,D);const F=Vt();fe(O,o),fe(D,n,D),fe(D,o,F),fe(F,n,D),fe(F,o,F),U(D,V,C),U(F,V,C)}return U(s,ai,k),U(s,wd,gE),{start:s,tokens:Yv}}(Oe.scanner.tokens);for(let e=0;e<Oe.pluginQueue.length;e++)Oe.pluginQueue[e][1]({scanner:Oe.scanner,parser:Oe.parser});Oe.initialized=!0}(),function(e,n,o){let i=o.length,s=0,a=[],l=[];for(;s<i;){let c=e,d=null,u=null,p=0,h=null,f=-1;for(;s<i&&!(d=c.go(o[s].t));)l.push(o[s++]);for(;s<i&&(u=d||c.go(o[s].t));)d=null,c=u,c.accepts()?(f=0,h=c):f>=0&&f++,s++,p++;if(f<0)s-=p,s<i&&(l.push(o[s]),s++);else{l.length>0&&(a.push(Td(ny,n,l)),l=[]),s-=f,p-=f;const m=h.t,g=o.slice(s-p,s);a.push(Td(m,n,g))}}return l.length>0&&a.push(Td(ny,n,l)),a}(Oe.parser.start,t,Xv(Oe.scanner.start,t))}function ry(t,e=null,n=null){if(e&&typeof e=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const o=new Bd(n),i=Od(t),s=[];for(let a=0;a<i.length;a++){const l=i[a];!l.isLink||e&&l.t!==e||!o.check(l)||s.push(l.toFormattedObject(o))}return s}Od.scan=Xv;var _d="[\0-   ᠎ -\u2029  ]",yE=new RegExp(_d),bE=new RegExp(`${_d}$`),kE=new RegExp(_d,"g");function bo(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(o=>{const i=typeof o=="string"?o:o.scheme;i&&n.push(i)}),!t||t.replace(kE,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var wE=$n.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{typeof t!="string"?oy(t.scheme,t.optionalSlashes):oy(t)})},onDestroy(){pt.groups={},Oe.scanner=null,Oe.parser=null,Oe.tokenQueue=[],Oe.pluginQueue=[],Oe.customSchemes=[],Oe.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!bo(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}),addAttributes(){return{href:{default:null,parseHTML:t=>t.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!(!e||!this.options.isAllowedUri(e,{defaultValidate:n=>!!bo(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!bo(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Re(this.options.HTMLAttributes,t),0]:["a",Re(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var n;const o=((n=t.attrs)==null?void 0:n.href)||"";return`[${e.renderChildren(t)}](${o})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return!!this.options.isAllowedUri(n,{defaultValidate:o=>!!bo(o,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&e().setMark(this.name,t).setMeta("preventAutolink",!0).run()},toggleLink:t=>({chain:e})=>{const{href:n}=t||{};return!(n&&!this.options.isAllowedUri(n,{defaultValidate:o=>!!bo(o,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[vo({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:o}=this.options,i=ry(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!bo(a,n),protocols:n,defaultProtocol:o}));i.length&&i.forEach(s=>{this.options.shouldAutoLink(s.value)&&e.push({text:s.value,data:{href:s.href},index:s.start})})}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;var o;return this.options.autolink&&t.push((o={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:i=>this.options.isAllowedUri(i,{defaultValidate:s=>!!bo(s,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink},new Ve({key:new Ue("autolink"),appendTransaction:(i,s,a)=>{const l=i.some(u=>u.docChanged)&&!s.doc.eq(a.doc),c=i.some(u=>u.getMeta("preventAutolink"));if(!l||c)return;const{tr:d}=a;return Mv(vv(s.doc,[...i])).forEach(({newRange:u})=>{const p=function(g,v){const b=[];return g.nodesBetween(v.from,v.to,(y,k)=>{(x=>x.isTextblock)(y)&&b.push({node:y,pos:k})}),b}(a.doc,u);let h,f;if(p.length>1)h=p[0],f=a.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(p.length){const g=a.doc.textBetween(u.from,u.to," "," ");if(!bE.test(g))return;h=p[0],f=a.doc.textBetween(h.pos,u.to,void 0," ")}if(h&&f){const g=f.split(yE).filter(Boolean);if(g.length<=0)return!1;const v=g[g.length-1],b=h.pos+f.lastIndexOf(v);if(!v)return!1;const y=Od(v).map(k=>k.toObject(o.defaultProtocol));if(!((m=y).length===1?m[0].isLink:m.length===3&&m[1].isLink&&["()","[]"].includes(m[0].value+m[2].value)))return!1;y.filter(k=>k.isLink).map(k=>({...k,from:b+k.start+1,to:b+k.end+1})).filter(k=>!a.schema.marks.code||!a.doc.rangeHasMark(k.from,k.to,a.schema.marks.code)).filter(k=>o.validate(k.value)).filter(k=>o.shouldAutoLink(k.value)).forEach(k=>{ed(k.from,k.to,a.doc).some(x=>x.mark.type===o.type)||d.addMark(k.from,k.to,o.type.create({href:k.href}))})}var m}),d.steps.length?d:void 0}}))),this.options.openOnClick===!0&&t.push(function(i){return new Ve({key:new Ue("handleClickLink"),props:{handleClick:(s,a,l)=>{var c,d;if(l.button!==0||!s.editable)return!1;let u=null;if(l.target instanceof HTMLAnchorElement)u=l.target;else{let m=l.target;const g=[];for(;m.nodeName!=="DIV";)g.push(m),m=m.parentNode;u=g.find(v=>v.nodeName==="A")}if(!u)return!1;const p=Ev(s.state,i.type.name),h=(c=u==null?void 0:u.href)!=null?c:p.href,f=(d=u==null?void 0:u.target)!=null?d:p.target;return i.enableClickSelection&&i.editor.commands.extendMarkRange(i.type.name),!(!u||!h||(window.open(h,f),0))}}})}({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(function(i){return new Ve({key:new Ue("handlePasteLink"),props:{handlePaste:(s,a,l)=>{const{shouldAutoLink:c}=i,{state:d}=s,{selection:u}=d,{empty:p}=u;if(p)return!1;let h="";l.content.forEach(m=>{h+=m.textContent});const f=ry(h,{defaultProtocol:i.defaultProtocol}).find(m=>m.isLink&&m.value===h);return!(!h||!f||c!==void 0&&!c(f.href))&&i.editor.commands.setMark(i.type,{href:f.href})}}})}({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),xE=Object.defineProperty,iy="textStyle",sy=/^\s*([-+*])\s$/,ay=ut.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:t}){return["ul",Re(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
165
+ `):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(iy)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=cr({find:sy,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=cr({find:sy,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(iy),editor:this.editor})),[t]}}),ly=ut.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",Re(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{if(t.type!=="list_item")return[];let n=[];if(t.tokens&&t.tokens.length>0)if(t.tokens.some(o=>o.type==="paragraph"))n=e.parseChildren(t.tokens);else{const o=t.tokens[0];if(o&&o.type==="text"&&o.tokens&&o.tokens.length>0){if(n=[{type:"paragraph",content:e.parseInline(o.tokens)}],t.tokens.length>1){const i=t.tokens.slice(1),s=e.parseChildren(i);n.push(...s)}}else n=e.parseChildren(t.tokens)}return n.length===0&&(n=[{type:"paragraph",content:[]}]),{type:"listItem",content:n}},renderMarkdown:(t,e,n)=>dd(t,e,o=>o.parentType==="bulletList"?"- ":o.parentType==="orderedList"?`${o.index+1}. `:"- ",n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});((t,e)=>{for(var n in e)xE(t,n,{get:e[n],enumerable:!0})})({},{findListItemPos:()=>mi,getNextListDepth:()=>Vd,handleBackspace:()=>Dd,handleDelete:()=>Ad,hasListBefore:()=>cy,hasListItemAfter:()=>CE,hasListItemBefore:()=>dy,listItemHasSubList:()=>uy,nextListIsDeeper:()=>py,nextListIsHigher:()=>hy});var mi=(t,e)=>{const{$from:n}=e.selection,o=Pe(t,e.schema);let i=null,s=n.depth,a=n.pos,l=null;for(;s>0&&l===null;)i=n.node(s),i.type===o?l=s:(s-=1,a-=1);return l===null?null:{$pos:e.doc.resolve(a),depth:l}},Vd=(t,e)=>{const n=mi(t,e);if(!n)return!1;const[,o]=((i,s,a,l=20)=>{const c=i.doc.resolve(a);let d=l,u=null;for(;d>0&&u===null;){const p=c.node(d);(p==null?void 0:p.type.name)===s?u=p:d-=1}return[u,d]})(e,t,n.$pos.pos+4);return o},cy=(t,e,n)=>{const{$anchor:o}=t.selection,i=Math.max(0,o.pos-2),s=t.doc.resolve(i).node();return!(!s||!n.includes(s.type.name))},dy=(t,e)=>{var n;const{$anchor:o}=e.selection,i=e.doc.resolve(o.pos-2);return i.index()!==0&&((n=i.nodeBefore)==null?void 0:n.type.name)===t},uy=(t,e,n)=>{if(!n)return!1;const o=Pe(t,e.schema);let i=!1;return n.descendants(s=>{s.type===o&&(i=!0)}),i},Dd=(t,e,n)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!Ln(t.state,e)&&cy(t.state,e,n)){const{$anchor:a}=t.state.selection,l=t.state.doc.resolve(a.before()-1),c=[];l.node().descendants((p,h)=>{p.type.name===e&&c.push({node:p,pos:h})});const d=c.at(-1);if(!d)return!1;const u=t.state.doc.resolve(l.start()+d.pos+1);return t.chain().cut({from:a.start()-1,to:a.end()+1},u.end()).joinForward().run()}if(!Ln(t.state,e)||!(a=>{const{$from:l,$to:c}=a.selection;return!(l.parentOffset>0||l.pos!==c.pos)})(t.state))return!1;const o=mi(e,t.state);if(!o)return!1;const i=t.state.doc.resolve(o.$pos.pos-2).node(o.depth),s=uy(e,t.state,i);return dy(e,t.state)&&!s?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},py=(t,e)=>{const n=Vd(t,e),o=mi(t,e);return!(!o||!n)&&n>o.depth},hy=(t,e)=>{const n=Vd(t,e),o=mi(t,e);return!(!o||!n)&&n<o.depth},Ad=(t,e)=>{if(!Ln(t.state,e)||!((s,a)=>{const{$from:l,$to:c,$anchor:d}=s.selection;if(a){const u=Ps(h=>h.type.name===a)(s.selection);if(!u)return!1;const p=s.doc.resolve(u.pos+1);return d.pos+1===p.end()}return!(c.parentOffset<c.parent.nodeSize-2||l.pos!==c.pos)})(t.state,e))return!1;const{selection:n}=t.state,{$from:o,$to:i}=n;return!(!n.empty&&o.sameParent(i))&&(py(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():hy(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward())},CE=(t,e)=>{var n;const{$anchor:o}=e.selection,i=e.doc.resolve(o.pos-o.parentOffset-2);return i.index()!==i.parent.childCount-1&&((n=i.nodeAfter)==null?void 0:n.type.name)===t},fy=ze.create({name:"listKeymap",addOptions:()=>({listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}),addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&Ad(t,n)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n})=>{t.state.schema.nodes[n]!==void 0&&Ad(t,n)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:o})=>{t.state.schema.nodes[n]!==void 0&&Dd(t,n,o)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:o})=>{t.state.schema.nodes[n]!==void 0&&Dd(t,n,o)&&(e=!0)}),e}}}}),my=/^(\s*)(\d+)\.\s+(.*)$/,SE=/^\s/;function gy(t,e,n){var o;const i=[];let s=0;for(;s<t.length;){const a=t[s];if(a.indent===e){const l=a.content.split(`
166
166
  `),c=((o=l[0])==null?void 0:o.trim())||"",d=[];c&&d.push({type:"paragraph",raw:c,tokens:n.inlineTokens(c)});const u=l.slice(1).join(`
167
167
  `).trim();if(u){const f=n.blockTokens(u);d.push(...f)}let p=s+1;const h=[];for(;p<t.length&&t[p].indent>e;)h.push(t[p]),p+=1;if(h.length>0){const f=Math.min(...h.map(g=>g.indent)),m=gy(h,f,n);d.push({type:"list",ordered:!0,start:h[0].number,items:m,raw:h.map(g=>g.raw).join(`
168
168
  `)})}i.push({type:"list_item",raw:a.raw,tokens:d}),s=p}else s+=1}return i}var vy="textStyle",yy=/^(\d+)\.\s$/,by=ut.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",Re(this.options.HTMLAttributes,n),0]:["ol",Re(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const n=t.start||1,o=t.items?function(i,s){return i.map(a=>{if(a.type!=="list_item")return s.parseChildren([a])[0];const l=[];return a.tokens&&a.tokens.length>0&&a.tokens.forEach(c=>{if(c.type==="paragraph"||c.type==="list"||c.type==="blockquote"||c.type==="code")l.push(...s.parseChildren([c]));else if(c.type==="text"&&c.tokens){const d=s.parseChildren([c]);l.push({type:"paragraph",content:d})}else{const d=s.parseChildren([c]);d.length>0&&l.push(...d)}}),{type:"listItem",content:l}})}(t.items,e):[];return n!==1?{type:"orderedList",attrs:{start:n},content:o}:{type:"orderedList",content:o}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
169
169
  `):"",markdownTokenizer:{name:"orderedList",level:"block",start:t=>{const e=t.match(/^(\s*)(\d+)\.\s+/),n=e==null?void 0:e.index;return n!==void 0?n:-1},tokenize:(t,e,n)=>{var o;const i=t.split(`
170
170
  `),[s,a]=function(c){const d=[];let u=0,p=0;for(;u<c.length;){const h=c[u],f=h.match(my);if(!f)break;const[,m,g,v]=f,b=m.length;let y=v,k=u+1;const x=[h];for(;k<c.length;){const w=c[k];if(w.match(my))break;if(w.trim()==="")x.push(w),y+=`
171
- `,k+=1;else{if(!w.match(CE))break;x.push(w),y+=`
171
+ `,k+=1;else{if(!w.match(SE))break;x.push(w),y+=`
172
172
  ${w.slice(b+2)}`,k+=1}}d.push({indent:b,number:parseInt(g,10),content:y.trim(),raw:x.join(`
173
173
  `)}),p=k,u=k}return[d,p]}(i);if(s.length===0)return;const l=gy(s,0,n);return l.length!==0?{type:"list",ordered:!0,start:((o=s[0])==null?void 0:o.number)||1,items:l,raw:i.slice(0,a).join(`
174
- `)}:void 0}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(vy)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=cr({find:yy,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=cr({find:yy,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(vy)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),SE=/^\s*(\[([( |x])?\])\s$/,EE=ut.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",Re(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const o=e.parseChildren(t.nestedTokens);n.push(...o)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;return dd(t,e,`- [${(n=t.attrs)!=null&&n.checked?"x":" "}] `)},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:o})=>{const i=document.createElement("li"),s=document.createElement("label"),a=document.createElement("span"),l=document.createElement("input"),c=document.createElement("div"),d=u=>{var p,h;l.ariaLabel=((h=(p=this.options.a11y)==null?void 0:p.checkboxLabel)==null?void 0:h.call(p,u,l.checked))||`Task item checkbox for ${u.textContent||"empty task item"}`};return d(t),s.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",u=>u.preventDefault()),l.addEventListener("change",u=>{if(!o.isEditable&&!this.options.onReadOnlyChecked)return void(l.checked=!l.checked);const{checked:p}=u.target;o.isEditable&&typeof n=="function"&&o.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{const f=n();if(typeof f!="number")return!1;const m=h.doc.nodeAt(f);return h.setNodeMarkup(f,void 0,{...m==null?void 0:m.attrs,checked:p}),!0}).run(),!o.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,p)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([u,p])=>{i.setAttribute(u,p)}),i.dataset.checked=t.attrs.checked,l.checked=t.attrs.checked,s.append(l,a),i.append(s,c),Object.entries(e).forEach(([u,p])=>{i.setAttribute(u,p)}),{dom:i,contentDOM:c,update:u=>u.type===this.type&&(i.dataset.checked=u.attrs.checked,l.checked=u.attrs.checked,d(u),!0)}}},addInputRules(){return[cr({find:SE,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),ME=ut.create({name:"taskList",addOptions:()=>({itemTypeName:"taskItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",Re(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
175
- `):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const o=s=>{const a=cd(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,c)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:c}),customNestedParser:o},n);return a?[{type:"taskList",raw:a.raw,items:a.items}]:n.blockTokens(s)},i=cd(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,a)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:n.inlineTokens(s.mainContent),nestedTokens:a}),customNestedParser:o},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});ze.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(ay.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(ly.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(fy.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(by.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(EE.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(ME.configure(this.options.taskList)),t}});var NE=ut.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",Re(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];return n.length===1&&n[0].type==="image"?e.parseChildren([n[0]]):e.createNode("paragraph",void 0,e.parseInline(n))},renderMarkdown:(t,e)=>t&&Array.isArray(t.content)?e.renderChildren(t.content):"",addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),BE=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,TE=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,OE=$n.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("line-through")&&{}}],renderHTML({HTMLAttributes:t}){return["s",Re(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[lr({find:BE,type:this.type})]},addPasteRules(){return[vo({find:TE,type:this.type})]}}),_E=ut.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),VE=$n.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("underline")&&{}}],renderHTML({HTMLAttributes:t}){return["u",Re(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown:(t,e)=>`++${e.renderChildren(t)}++`,markdownTokenizer:{name:"underline",level:"inline",start:t=>t.indexOf("++"),tokenize(t,e,n){const o=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!o)return;const i=o[2].trim();return{type:"underline",raw:o[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function AE(t={}){return new Ve({view:e=>new DE(e,t)})}class DE{constructor(e,n){var o;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(o=n.width)!==null&&o!==void 0?o:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=a=>{this[i](a)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,n=this.editorView.state.doc.resolve(this.cursorPos),o=!n.parent.inlineContent,i=this.editorView.dom,s=i.getBoundingClientRect(),a=s.width/i.offsetWidth,l=s.height/i.offsetHeight;if(o){let p=n.nodeBefore,h=n.nodeAfter;if(p||h){let f=this.editorView.nodeDOM(this.cursorPos-(p?p.nodeSize:0));if(f){let m=f.getBoundingClientRect(),g=p?m.bottom:m.top;p&&h&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let v=this.width/2*l;e={left:m.left,right:m.right,top:g-v,bottom:g+v}}}}if(!e){let p=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*a;e={left:p.left-h,right:p.left+h,top:p.top,bottom:p.bottom}}let c,d,u=this.editorView.dom.offsetParent;if(this.element||(this.element=u.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",o),this.element.classList.toggle("prosemirror-dropcursor-inline",!o),!u||u==document.body&&getComputedStyle(u).position=="static")c=-pageXOffset,d=-pageYOffset;else{let p=u.getBoundingClientRect(),h=p.width/u.offsetWidth,f=p.height/u.offsetHeight;c=p.left-u.scrollLeft*h,d=p.top-u.scrollTop*f}this.element.style.left=(e.left-c)/a+"px",this.element.style.top=(e.top-d)/l+"px",this.element.style.width=(e.right-e.left)/a+"px",this.element.style.height=(e.bottom-e.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),o=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=o&&o.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!s){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Sm(this.editorView.state.doc,a,this.editorView.dragging.slice);l!=null&&(a=l)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class De extends he{constructor(e){super(e,e)}map(e,n){let o=e.resolve(n.map(this.head));return De.valid(o)?new De(o):he.near(o)}content(){return Q.empty}eq(e){return e instanceof De&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new De(e.resolve(n.pos))}getBookmark(){return new Id(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!function(s){for(let a=s.depth;a>=0;a--){let l=s.index(a),c=s.node(a);if(l!=0)for(let d=c.child(l-1);;d=d.lastChild){if(d.childCount==0&&!d.inlineContent||ky(d.type))return!0;if(d.inlineContent)return!1}else if(c.type.spec.isolating)return!0}return!0}(e)||!function(s){for(let a=s.depth;a>=0;a--){let l=s.indexAfter(a),c=s.node(a);if(l!=c.childCount)for(let d=c.child(l);;d=d.firstChild){if(d.childCount==0&&!d.inlineContent||ky(d.type))return!0;if(d.inlineContent)return!1}else if(c.type.spec.isolating)return!0}return!0}(e))return!1;let o=n.type.spec.allowGapCursor;if(o!=null)return o;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,o=!1){e:for(;;){if(!o&&De.valid(e))return e;let i=e.pos,s=null;for(let a=e.depth;;a--){let l=e.node(a);if(n>0?e.indexAfter(a)<l.childCount:e.index(a)>0){s=l.child(n>0?e.indexAfter(a):e.index(a)-1);break}if(a==0)return null;i+=n;let c=e.doc.resolve(i);if(De.valid(c))return c}for(;;){let a=n>0?s.firstChild:s.lastChild;if(!a){if(s.isAtom&&!s.isText&&!re.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),o=!1;continue e}break}s=a,i+=n;let l=e.doc.resolve(i);if(De.valid(l))return l}return null}}}De.prototype.visible=!1,De.findFrom=De.findGapCursorFrom,he.jsonID("gapcursor",De);class Id{constructor(e){this.pos=e}map(e){return new Id(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return De.valid(n)?new De(n):he.near(n)}}function ky(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}const IE=av({ArrowLeft:Na("horiz",-1),ArrowRight:Na("horiz",1),ArrowUp:Na("vert",-1),ArrowDown:Na("vert",1)});function Na(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(o,i,s){let a=o.selection,l=e>0?a.$to:a.$from,c=a.empty;if(a instanceof le){if(!s.endOfTextblock(n)||l.depth==0)return!1;c=!1,l=o.doc.resolve(e>0?l.after():l.before())}let d=De.findGapCursorFrom(l,e,c);return!!d&&(i&&i(o.tr.setSelection(new De(d))),!0)}}function RE(t,e,n){if(!t||!t.editable)return!1;let o=t.state.doc.resolve(e);if(!De.valid(o))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&re.isSelectable(t.state.doc.nodeAt(i.inside))||(t.dispatch(t.state.tr.setSelection(new De(o))),0))}function LE(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof De))return!1;let{$from:n}=t.state.selection,o=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!o)return!1;let i=H.empty;for(let a=o.length-1;a>=0;a--)i=H.from(o[a].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new Q(i,0,0));return s.setSelection(le.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function $E(t){if(!(t.selection instanceof De))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Te.create(t.doc,[st.widget(t.selection.head,e,{key:"gapcursor"})])}var Ba=200,qe=function(){};qe.prototype.append=function(t){return t.length?(t=qe.from(t),!this.length&&t||t.length<Ba&&this.leafAppend(t)||this.length<Ba&&t.leafPrepend(this)||this.appendInner(t)):this},qe.prototype.prepend=function(t){return t.length?qe.from(t).append(this):this},qe.prototype.appendInner=function(t){return new PE(this,t)},qe.prototype.slice=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.length),t>=e?qe.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},qe.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},qe.prototype.forEach=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},qe.prototype.map=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length);var o=[];return this.forEach(function(i,s){return o.push(t(i,s))},e,n),o},qe.from=function(t){return t instanceof qe?t:t&&t.length?new wy(t):qe.empty};var wy=function(t){function e(o){t.call(this),this.values=o}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new e(this.values.slice(o,i))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,i,s,a){for(var l=i;l<s;l++)if(o(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(o,i,s,a){for(var l=i-1;l>=s;l--)if(o(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=Ba)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=Ba)return new e(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(qe);qe.empty=new wy([]);var PE=function(t){function e(n,o){t.call(this),this.left=n,this.right=o,this.length=n.length+o.length,this.depth=Math.max(n.depth,o.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,o,i,s){var a=this.left.length;return!(o<a&&this.left.forEachInner(n,o,Math.min(i,a),s)===!1)&&!(i>a&&this.right.forEachInner(n,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)&&void 0},e.prototype.forEachInvertedInner=function(n,o,i,s){var a=this.left.length;return!(o>a&&this.right.forEachInvertedInner(n,o-a,Math.max(i,a)-a,s+a)===!1)&&!(i<a&&this.left.forEachInvertedInner(n,Math.min(o,a),i,s)===!1)&&void 0},e.prototype.sliceInner=function(n,o){if(n==0&&o==this.length)return this;var i=this.left.length;return o<=i?this.left.slice(n,o):n>=i?this.right.slice(n-i,o-i):this.left.slice(n,i).append(this.right.slice(0,o-i))},e.prototype.leafAppend=function(n){var o=this.right.leafAppend(n);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(n){var o=this.left.leafPrepend(n);if(o)return new e(o,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e}(qe);class $t{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let o,i,s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}n&&(o=this.remapping(s,this.items.length),i=o.maps.length);let a,l,c=e.tr,d=[],u=[];return this.items.forEach((p,h)=>{if(!p.step)return o||(o=this.remapping(s,h+1),i=o.maps.length),i--,void u.push(p);if(o){u.push(new Xt(p.map));let f,m=p.step.map(o.slice(i));m&&c.maybeStep(m).doc&&(f=c.mapping.maps[c.mapping.maps.length-1],d.push(new Xt(f,void 0,void 0,d.length+u.length))),i--,f&&o.appendMap(f,i)}else c.maybeStep(p.step);return p.selection?(a=o?p.selection.map(o.slice(i)):p.selection,l=new $t(this.items.slice(0,s).append(u.reverse().concat(d)),this.eventCount-1),!1):void 0},this.items.length,0),{remaining:l,transform:c,selection:a}}addTransform(e,n,o,i){let s=[],a=this.eventCount,l=this.items,c=!i&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let p,h=e.steps[u].invert(e.docs[u]),f=new Xt(e.mapping.maps[u],h,n);(p=c&&c.merge(f))&&(f=p,u?s.pop():l=l.slice(0,l.length-1)),s.push(f),n&&(a++,n=void 0),i||(c=f)}let d=a-o.depth;return d>zE&&(l=function(u,p){let h;return u.forEach((f,m)=>{if(f.selection&&p--==0)return h=m,!1}),u.slice(h)}(l,d),a-=d),new $t(l.append(s),a)}remapping(e,n){let o=new jr;return this.items.forEach((i,s)=>{let a=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?o.maps.length-i.mirrorOffset:void 0;o.appendMap(i.map,a)},e,n),o}addMaps(e){return this.eventCount==0?this:new $t(this.items.append(e.map(n=>new Xt(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let o=[],i=Math.max(0,this.items.length-n),s=e.mapping,a=e.steps.length,l=this.eventCount;this.items.forEach(h=>{h.selection&&l--},i);let c=n;this.items.forEach(h=>{let f=s.getMirror(--c);if(f==null)return;a=Math.min(a,f);let m=s.maps[f];if(h.step){let g=e.steps[f].invert(e.docs[f]),v=h.selection&&h.selection.map(s.slice(c+1,f));v&&l++,o.push(new Xt(m,g,v))}else o.push(new Xt(m))},i);let d=[];for(let h=n;h<a;h++)d.push(new Xt(s.maps[h]));let u=this.items.slice(0,i).append(d).append(o),p=new $t(u,l);return p.emptyItemCount()>500&&(p=p.compress(this.items.length-o.length)),p}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),o=n.maps.length,i=[],s=0;return this.items.forEach((a,l)=>{if(l>=e)i.push(a),a.selection&&s++;else if(a.step){let c=a.step.map(n.slice(o)),d=c&&c.getMap();if(o--,d&&n.appendMap(d,o),c){let u=a.selection&&a.selection.map(n.slice(o));u&&s++;let p,h=new Xt(d.invert(),c,u),f=i.length-1;(p=i.length&&i[f].merge(h))?i[f]=p:i.push(h)}}else a.map&&o--},this.items.length,0),new $t(qe.from(i.reverse()),s)}}$t.empty=new $t(qe.empty,0);class Xt{constructor(e,n,o,i){this.map=e,this.step=n,this.selection=o,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Xt(n.getMap().invert(),n,this.selection)}}}class jn{constructor(e,n,o,i,s){this.done=e,this.undone=n,this.prevRanges=o,this.prevTime=i,this.prevComposition=s}}const zE=20;function xy(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((o,i,s,a)=>e.push(s,a));return e}function Rd(t,e){if(!t)return null;let n=[];for(let o=0;o<t.length;o+=2){let i=e.map(t[o],1),s=e.map(t[o+1],-1);i<=s&&n.push(i,s)}return n}let Ld=!1,Cy=null;function Ta(t){let e=t.plugins;if(Cy!=e){Ld=!1,Cy=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Ld=!0;break}}return Ld}const ko=new Ue("history"),FE=new Ue("closeHistory");function jE(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ve({key:ko,state:{init:()=>new jn($t.empty,$t.empty,null,0,-1),apply:(e,n,o)=>function(i,s,a,l){let c,d=a.getMeta(ko);if(d)return d.historyState;a.getMeta(FE)&&(i=new jn(i.done,i.undone,null,0,-1));let u=a.getMeta("appendedTransaction");if(a.steps.length==0)return i;if(u&&u.getMeta(ko))return u.getMeta(ko).redo?new jn(i.done.addTransform(a,void 0,l,Ta(s)),i.undone,xy(a.mapping.maps),i.prevTime,i.prevComposition):new jn(i.done,i.undone.addTransform(a,void 0,l,Ta(s)),null,i.prevTime,i.prevComposition);if(a.getMeta("addToHistory")===!1||u&&u.getMeta("addToHistory")===!1)return(c=a.getMeta("rebased"))?new jn(i.done.rebased(a,c),i.undone.rebased(a,c),Rd(i.prevRanges,a.mapping),i.prevTime,i.prevComposition):new jn(i.done.addMaps(a.mapping.maps),i.undone.addMaps(a.mapping.maps),Rd(i.prevRanges,a.mapping),i.prevTime,i.prevComposition);{let p=a.getMeta("composition"),h=i.prevTime==0||!u&&i.prevComposition!=p&&(i.prevTime<(a.time||0)-l.newGroupDelay||!function(m,g){if(!g)return!1;if(!m.docChanged)return!0;let v=!1;return m.mapping.maps[0].forEach((b,y)=>{for(let k=0;k<g.length;k+=2)b<=g[k+1]&&y>=g[k]&&(v=!0)}),v}(a,i.prevRanges)),f=u?Rd(i.prevRanges,a.mapping):xy(a.mapping.maps);return new jn(i.done.addTransform(a,h?s.selection.getBookmark():void 0,l,Ta(s)),$t.empty,f,a.time,p??i.prevComposition)}}(n,o,e,t)},config:t,props:{handleDOMEvents:{beforeinput(e,n){let o=n.inputType,i=o=="historyUndo"?Ey:o=="historyRedo"?My:null;return!!i&&(n.preventDefault(),i(e.state,e.dispatch))}}}})}function Sy(t,e){return(n,o)=>{let i=ko.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(o){let s=function(a,l,c){let d=Ta(l),u=ko.get(l).spec.config,p=(c?a.undone:a.done).popEvent(l,d);if(!p)return null;let h=p.selection.resolve(p.transform.doc),f=(c?a.done:a.undone).addTransform(p.transform,l.selection.getBookmark(),u,d),m=new jn(c?f:p.remaining,c?p.remaining:f,null,0,-1);return p.transform.setSelection(h).setMeta(ko,{redo:c,historyState:m})}(i,n,t);s&&o(e?s.scrollIntoView():s)}return!0}}const Ey=Sy(!1,!0),My=Sy(!0,!0);ze.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new Ve({key:new Ue("characterCount"),appendTransaction:(e,n,o)=>{if(t)return;const i=this.options.limit;if(i==null||i===0)return void(t=!0);const s=this.storage.characters({node:o.doc});if(s>i){const l=s-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const c=o.tr.deleteRange(0,l);return t=!0,c}t=!0},filterTransaction:(e,n)=>{const o=this.options.limit;if(!e.docChanged||o===0||o==null)return!0;const i=this.storage.characters({node:n.doc}),s=this.storage.characters({node:e.doc});if(s<=o||i>o&&s>o&&s<=i)return!0;if(i>o&&s>o&&s>i||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,l=a-(s-o),c=a;return e.deleteRange(l,c),!(this.storage.characters({node:e.doc})>o)}})]}});var HE=ze.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[AE(this.options)]}});ze.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new Ve({key:new Ue("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:o}=this.editor,{anchor:i}=e,s=[];if(!n||!o)return Te.create(t,[]);let a=0;this.options.mode==="deepest"&&t.descendants((c,d)=>{if(!c.isText)return i>=d&&i<=d+c.nodeSize-1&&void(a+=1)});let l=0;return t.descendants((c,d)=>!c.isText&&i>=d&&i<=d+c.nodeSize-1&&(l+=1,this.options.mode==="deepest"&&a-l>0||this.options.mode==="shallowest"&&l>1?this.options.mode==="deepest":void s.push(st.node(d,d+c.nodeSize,{class:this.options.className})))),Te.create(t,s)}}})]}});var WE=ze.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Ve({props:{decorations:$E,createSelectionBetween:(t,e,n)=>e.pos==n.pos&&De.valid(n)?new De(n):null,handleClick:RE,handleKeyDown:IE,handleDOMEvents:{beforeinput:LE}}})],extendNodeSchema(t){var e;return{allowGapCursor:(e=ve(ne(t,"allowGapCursor",{name:t.name,options:t.options,storage:t.storage})))!=null?e:null}}});function Ny({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}ze.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new Ve({key:new Ue("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:o}=e,i=[];if(!n)return null;const s=this.editor.isEmpty;return t.descendants((a,l)=>{const c=o>=l&&o<=l+a.nodeSize,d=!a.isLeaf&&js(a);if((c||!this.options.showOnlyCurrent)&&d){const u=[this.options.emptyNodeClass];s&&u.push(this.options.emptyEditorClass);const p=st.node(l,l+a.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:l,hasAnchor:c}):this.options.placeholder});i.push(p)}return this.options.includeChildren}),Te.create(t,i)}}})]}}),ze.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new Ve({key:new Ue("selection"),props:{decorations:n=>n.selection.empty||t.isFocused||!t.isEditable||Tv(n.selection)||t.view.dragging?null:Te.create(n.doc,[st.inline(n.selection.from,n.selection.to,{class:e.className})])}})]}});var KE=ze.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var t;const e=new Ue(this.name),n=((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||this.options.node||"paragraph",o=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(n).includes(i.name));return[new Ve({key:e,appendTransaction:(i,s,a)=>{const{doc:l,tr:c,schema:d}=a,u=e.getState(a),p=l.content.size,h=d.nodes[n];if(u)return c.insert(p,h.create())},state:{init:(i,s)=>!Ny({node:s.tr.doc.lastChild,types:o}),apply:(i,s)=>i.docChanged?!Ny({node:i.doc.lastChild,types:o}):s}})]}}),UE=ze.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:e})=>Ey(t,e),redo:()=>({state:t,dispatch:e})=>My(t,e)}),addProseMirrorPlugins(){return[jE(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),qE=ze.create({name:"starterKit",addExtensions(){var t,e,n,o;const i=[];return this.options.bold!==!1&&i.push(YS.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(KS.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(ay.configure(this.options.bulletList)),this.options.code!==!1&&i.push(ZS.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(nE.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(oE.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(HE.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(WE.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(rE.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(iE.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(UE.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(sE.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(uE.configure(this.options.italic)),this.options.listItem!==!1&&i.push(ly.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(fy.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&i.push(kE.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(by.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(NE.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(OE.configure(this.options.strike)),this.options.text!==!1&&i.push(_E.configure(this.options.text)),this.options.underline!==!1&&i.push(VE.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(KE.configure((o=this.options)==null?void 0:o.trailingNode)),i}}),JE=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,GE=ut.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",Re(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,n,o,i,s,a;const l=(n=(e=t.attrs)==null?void 0:e.src)!=null?n:"",c=(i=(o=t.attrs)==null?void 0:o.alt)!=null?i:"",d=(a=(s=t.attrs)==null?void 0:s.title)!=null?a:"";return d?`![${c}](${l} "${d}")`:`![${c}](${l})`},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[jv({find:JE,type:this.type,getAttributes:t=>{const[,,e,n,o]=t;return{src:n,alt:e,title:o}}})]}});const By=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&WorkerGlobalScope;const YE=Object.prototype.toString,ur=()=>{},XE=QE();function QE(){var t,e;return By&&((t=window==null?void 0:window.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function $d(t){return Array.isArray(t)?t:[t]}const Ty=By?window:void 0;function gi(t){var e;const n=r.toValue(t);return(e=n==null?void 0:n.$el)!=null?e:n}function Pd(...t){const e=[],n=()=>{e.forEach(d=>d()),e.length=0},o=r.computed(()=>{const d=$d(r.toValue(t[0])).filter(u=>u!=null);return d.every(u=>typeof u!="string")?d:void 0}),i=(s=()=>{var d,u;return[(u=(d=o.value)==null?void 0:d.map(p=>gi(p)))!=null?u:[Ty].filter(p=>p!=null),$d(r.toValue(o.value?t[1]:t[0])),$d(r.unref(o.value?t[2]:t[1])),r.toValue(o.value?t[3]:t[2])]},a=([d,u,p,h])=>{if(n(),!(d!=null&&d.length)||!(u!=null&&u.length)||!(p!=null&&p.length))return;const f=(m=h,YE.call(m)==="[object Object]"?{...h}:h);var m;e.push(...d.flatMap(g=>u.flatMap(v=>p.map(b=>((y,k,x,w)=>(y.addEventListener(k,x,w),()=>y.removeEventListener(k,x,w)))(g,v,b,f)))))},l={flush:"post"},r.watch(s,a,{...l,immediate:!0}));var s,a,l,c;return c=n,r.getCurrentScope()&&r.onScopeDispose(c),()=>{i(),n()}}let Oy=!1;const fn=Symbol("mc-select-plus-context"),_y="mc-select-plus",ZE={key:1},eM=q(r.defineComponent({name:"mc-select-selected-content",__name:"index",setup(t){const{selectedOptions:e,isDisabled:n}=r.inject(fn),o=r.computed(()=>Be(e.value)?void 0:e.value[0]),i=r.computed(()=>{var a,l;return Be(o.value)?void 0:o.value.label??((l=(a=o.value)==null?void 0:a.value)==null?void 0:l.toString())}),s=r.computed(()=>Be(o.value)?void 0:o.value.context);return(a,l)=>{var c;return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-select-selected-content",{"is-disabled":r.unref(n)}])},[s.value||a.$slots.default?r.renderSlot(a.$slots,"default",{key:0,selectedOption:(c=o.value)==null?void 0:c.value,selectedOptionLabel:i.value,isDisabled:r.unref(n)},()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(s.value)))],!0):(r.openBlock(),r.createElementBlock("span",ZE,r.toDisplayString(i.value),1))],2)}}}),[["__scopeId","data-v-2417c622"]]),Vy="mc-tag",tM={class:"mc-tag-content"},nM=r.defineComponent({name:Vy,__name:"mc-tag",props:{width:{},height:{},size:{default:"small"},type:{default:"basic"},emphasis:{default:"bold"},disabled:{type:Boolean,default:!1},deletable:{type:Boolean,default:!0},leftIcon:{},rightIcon:{},content:{}},emits:["delete","click"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref(),a=()=>{o.deletable||i("click")},l=r.computed(()=>o.type==="selectable"&&o.deletable),c=()=>{o.disabled||i("delete")};return e({ref:s}),(d,u)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-tag",[`mc-tag-${t.size}`,`mc-tag-${t.type}`,`mc-tag-${t.emphasis}`,{"mc-tag-disabled":t.disabled}]]),ref_key:"_ref",ref:s,style:r.normalizeStyle({width:t.width,height:t.height}),onClick:a},[t.leftIcon?(r.openBlock(),r.createBlock(r.unref(ge),{key:0,name:t.leftIcon,class:"mc-tag-left-icon",size:16},null,8,["name"])):r.createCommentVNode("",!0),r.createElementVNode("div",tM,[r.renderSlot(d.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0)]),t.rightIcon?(r.openBlock(),r.createBlock(r.unref(ge),{key:1,name:t.rightIcon,class:"mc-tag-right-icon",size:16},null,8,["name"])):r.createCommentVNode("",!0),l.value?(r.openBlock(),r.createBlock(r.unref(ge),{key:2,name:"Cross",class:"mc-tag-delete-icon",size:16,onClick:r.withModifiers(c,["stop"])})):r.createCommentVNode("",!0)],6))}}),zd=ee(q(nM,[["__scopeId","data-v-f5c2d2d8"]])),oM={class:"mc-select-selected-content-multi"},rM=q(r.defineComponent({name:"mc-select-selected-content-multi",__name:"index",props:{isFocused:{type:Boolean,default:!1},isHovering:{type:Boolean,default:!1},maxTags:{default:void 0}},setup(t){const{isMulti:e,selectedOptions:n,isDisabled:o,deleteTag:i}=r.inject(fn),s=t,a=r.computed(()=>{const c=s.maxTags,d=n.value;if(Sr(c)){const u=d.length-c,p=[];for(let h=0;h<c&&h<d.length;h++){const f=d[h];p.push({label:`${f.label??f.value}`,item:f.value,selectable:!0})}return u>0&&p.push({label:`+${u}`,item:"rest",selectable:!1}),p}return bn(d,u=>({label:`${u.label??u.value}`,item:u.value,selectable:!0}))}),l=r.computed(()=>s.isFocused||s.isHovering?"minimal":"bold");return(c,d)=>(r.openBlock(),r.createElementBlock("ul",oM,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,u=>(r.openBlock(),r.createElementBlock("li",{key:`${u.item}`,class:"mc-select-selected-tag"},[r.createVNode(r.unref(zd),{size:"x-small",type:"selectable",deletable:u.selectable,emphasis:l.value,disabled:r.unref(o),onDelete:p=>{return h=u.item,void(e.value&&i(h));var h}},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(u.label),1)]),_:2},1032,["deletable","emphasis","disabled","onDelete"])]))),128))]))}}),[["__scopeId","data-v-aac507b5"]]),iM=["value","placeholder","disabled","readonly","onKeydown"],sM={class:"mc-select-placeholder"},aM={class:"mc-select-trigger-toolbar"},lM=r.defineComponent({name:"mc-select-trigger",__name:"index",props:{search:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},placeholder:{default:"Please select"},searchValue:{default:void 0},isExpanded:{type:Boolean,default:!1},maxTags:{default:void 0},hideValidationIcon:{type:Boolean}},emits:["update:searchValue","update:isExpanded","press:arrow","search","focus","blur","clear"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(),{wrapperRef:s,isFocused:a,handleFocus:l,handleBlur:c}=Xn(i),{isHovering:d}=ul(s),{selectedOptions:u,isMulti:p,isDisabled:h,validateStatus:f,isTopPlacement:m}=r.inject(fn),g=r.computed(()=>ce(u.value)?u.value.length>0:!!u.value),v=M=>{const{value:N}=M.target;o("update:searchValue",N),o("search")},b=()=>{h.value||o("update:isExpanded",!n.isExpanded)},{showClearIcon:y,mouseOverIcon:k}=(()=>{const M=r.ref(!1),N=ue("clearable"),T=ue("isDisabled");return{showClearIcon:r.computed(()=>!!N.value&&M.value&&!T.value),mouseOverIcon:D=>{M.value=D}}})(),x=r.computed(()=>g.value&&y.value&&!h.value),w=()=>{o("clear")},C=r.computed(()=>h.value?"not-allowed":n.search?"text":"pointer"),S=()=>{h.value||o("update:isExpanded",!n.isExpanded)},E=M=>{h.value||o("press:arrow",M)};return(M,N)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"triggerRef",ref:s,class:r.normalizeClass(["mc-select-trigger",{"is-hovering":r.unref(d),"is-focused":r.unref(a),"is-expanded":t.isExpanded,"is-disabled":r.unref(h),"is-error":r.unref(f)==="error","is-success":r.unref(f)==="success","is-top-placement":r.unref(m)}]),onClick:b},[r.createElementVNode("div",{class:"mc-select-trigger-selected-content",style:r.normalizeStyle({cursor:C.value})},[r.createElementVNode("div",{class:"mc-select-trigger-input-wrapper",style:r.normalizeStyle({width:t.searchValue||!g.value?"100%":"1em"})},[r.createElementVNode("input",{value:t.searchValue,ref_key:"inputRef",ref:i,class:"mc-select-input",placeholder:t.placeholder,disabled:r.unref(h),readonly:!t.search||r.unref(h),onInput:v,onFocus:N[0]||(N[0]=(...T)=>r.unref(l)&&r.unref(l)(...T)),onBlur:N[1]||(N[1]=(...T)=>r.unref(c)&&r.unref(c)(...T)),onKeydown:[r.withKeys(r.withModifiers(S,["stop","prevent"]),["enter"]),r.withKeys(r.withModifiers(E,["stop","prevent"]),["arrow-down"]),r.withKeys(r.withModifiers(E,["stop","prevent"]),["arrow-up"])]},null,40,iM),r.withDirectives(r.createElementVNode("div",sM,[r.renderSlot(M.$slots,"placeholder",{placeholder:t.placeholder,isDisabled:r.unref(h)},()=>[r.createElementVNode("span",null,r.toDisplayString(t.placeholder),1)],!0)],512),[[r.vShow,!t.searchValue&&!g.value]])],4),r.unref(p)?r.withDirectives((r.openBlock(),r.createBlock(rM,{key:0,"max-tags":t.maxTags,"is-focused":r.unref(a),"is-hovering":r.unref(d)},null,8,["max-tags","is-focused","is-hovering"])),[[r.vShow,g.value&&!t.searchValue]]):r.withDirectives((r.openBlock(),r.createBlock(eM,{key:1},r.createSlots({_:2},[M.$slots["selected-content"]?{name:"default",fn:r.withCtx(({selectedOption:T,selectedOptionLabel:D,isDisabled:$})=>[r.renderSlot(M.$slots,"selected-content",{selectedOption:T,selectedOptionLabel:D,isDisabled:$},void 0,!0)]),key:"0"}:void 0]),1536)),[[r.vShow,g.value&&!t.searchValue]])],4),r.createElementVNode("div",aM,[r.withDirectives(r.createVNode(r.unref(Ee),{class:"mc-select-status-icon",name:r.unref(f)==="error"?"reject-fail-rev":"accept-success-rev",size:24},null,8,["name"]),[[r.vShow,r.unref(f)!=="init"&&!t.hideValidationIcon]]),r.createElementVNode("div",{class:"mc-select-icon-wrapper",onMouseenter:N[3]||(N[3]=T=>r.unref(k)(!0)),onMouseleave:N[4]||(N[4]=T=>r.unref(k)(!1))},[r.withDirectives(r.createVNode(r.unref(Ee),{class:"mc-select-chevron-icon",name:"down-chevron",size:24,cursor:r.unref(h)?"not-allowed":"pointer"},null,8,["cursor"]),[[r.vShow,!x.value]]),r.withDirectives(r.createElementVNode("div",{onClick:N[2]||(N[2]=r.withModifiers(()=>{},["stop"]))},[r.createVNode(r.unref(Ee),{class:"mc-select-clear-icon",name:"rejectfail",size:16,cursor:"pointer",onClick:w})],512),[[r.vShow,x.value]])],32)])],2))}}),cM=q(lM,[["__scopeId","data-v-61e04dfa"]]),dM={class:"mc-select-list-wrapper"},uM={key:0,class:"mc-select-list-header"},pM={key:0,class:"mc-select-list-header-content"},hM={class:"mc-select-list-content"},fM={key:0,class:"mc-select-list-empty"},mM={key:1,class:"mc-select-list-footer"},gM=r.defineComponent({name:"mc-select-list",__name:"index",props:{showFooter:{type:Boolean},showHeader:{type:Boolean}},setup(t){const{filteredOptions:e,isMulti:n,isTopPlacement:o}=r.inject(fn),i=r.computed(()=>!Be(e.value)),{isSelectAll:s,isSelectPartial:a,selectAll:l}=(()=>{const{isMulti:c,selectedOptions:d,selectOptions:u,selectAll:p}=r.inject(fn),h=r.ref(!1),f=r.ref(!1);return r.watchEffect(()=>{var g,v;if(!c.value)return;const m=d.value;m!=null&&m.length&&((g=u.value)!=null&&g.length)&&(m==null?void 0:m.length)===((v=u.value)==null?void 0:v.length)?(h.value=!0,f.value=!1):(m==null?void 0:m.length)>0?(h.value=!1,f.value=!0):(h.value=!1,f.value=!1)}),{isSelectAll:h,isSelectPartial:f,selectAll:p}})();return(c,d)=>(r.openBlock(),r.createElementBlock("div",dM,[r.createElementVNode("ul",{class:r.normalizeClass(["mc-select-list",{"is-top-placement":r.unref(o)}])},[t.showHeader?(r.openBlock(),r.createElementBlock("li",uM,[r.renderSlot(c.$slots,"header",{isEmpty:!i.value},()=>[r.unref(n)?(r.openBlock(),r.createElementBlock("div",pM,[r.createVNode(r.unref(Wo),{"model-value":r.unref(s),partial:r.unref(a),content:"Select All","disable-validation":"","onUpdate:modelValue":r.unref(l)},null,8,["model-value","partial","onUpdate:modelValue"])])):r.createCommentVNode("",!0)],!0)])):r.createCommentVNode("",!0),r.createElementVNode("ul",hM,[r.renderSlot(c.$slots,"default",{},void 0,!0),i.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("li",fM,[r.renderSlot(c.$slots,"empty",{},()=>[d[0]||(d[0]=r.createElementVNode("p",{class:"mc-select-list-empty-text"},"No results found",-1))],!0)]))]),t.showFooter?(r.openBlock(),r.createElementBlock("li",mM,[r.renderSlot(c.$slots,"footer",{isEmpty:!i.value},void 0,!0)])):r.createCommentVNode("",!0)],2)]))}}),vM=q(gM,[["__scopeId","data-v-359e20b8"]]),Ay="mc-select-multi-option",yM={class:"mc-select-multi-option"},Fd=ee(r.defineComponent({name:Ay,__name:"mc-select-multi-option",props:{modelValue:{type:Boolean,default:!1},label:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=i=>{n("update:modelValue",i)};return(i,s)=>(r.openBlock(),r.createElementBlock("div",yM,[r.createVNode(r.unref(Wo),{"model-value":t.modelValue,content:t.label,"disable-validation":"",disabled:t.disabled,"onUpdate:modelValue":o},null,8,["model-value","content","disabled"])]))}})),jd="mc-select-option-plus",bM=["aria-selected"],kM={key:1,class:"mc-select-option-label"},vi=ee(q(r.defineComponent({name:jd,__name:"mc-select-option-plus",props:{label:{},value:{type:[String,Number,Boolean]},height:{default:40},width:{default:"100%"},disabled:{type:Boolean}},setup(t){const e=t,{height:n,width:o}=lt(),{isMulti:i,selectedOptions:s,filteredOptions:a,hoverOption:l,select:c,hover:d}=r.inject(fn),u=r.computed(()=>!!zi(a.value,b=>b.value===e.value)),p=r.computed(()=>al(s.value,b=>b.value===e.value)),h=r.ref(!1),f=r.computed(()=>e.label),m=()=>{d(e.value)},g=r.computed(()=>l.value===e.value),v=()=>{e.disabled||c(e.value)};return(b,y)=>r.withDirectives((r.openBlock(),r.createElementBlock("li",{role:"option",class:r.normalizeClass(["mc-select-option",{"mc-select-option-actived":p.value&&!r.unref(i),"mc-select-option-hover":g.value,"mc-select-option-disabled":t.disabled}]),style:r.normalizeStyle({height:r.unref(n),width:r.unref(o)}),"aria-selected":h.value,onMouseenter:m,onClick:v},[r.renderSlot(b.$slots,"default",{isActived:p.value,isDisabled:t.disabled},()=>[r.unref(i)?(r.openBlock(),r.createBlock(r.unref(Fd),{key:0,"model-value":p.value,label:f.value,disabled:t.disabled},null,8,["model-value","label","disabled"])):(r.openBlock(),r.createElementBlock("span",kM,r.toDisplayString(f.value),1))],!0)],46,bM)),[[r.vShow,u.value]])}}),[["__scopeId","data-v-77d81b1d"]])),Hd="mc-select-group-plus",wM={class:"mc-select-group"},xM={class:"mc-select-option-list"},Dy=ee(q(r.defineComponent({name:Hd,__name:"mc-select-group-plus",props:{label:{},height:{default:40},width:{default:"100%"}},setup(t){const e=t,{filteredGroups:n}=r.inject(fn),{height:o,width:i}=lt(),s=r.computed(()=>Ct(n.value,e.label));return(a,l)=>r.withDirectives((r.openBlock(),r.createElementBlock("ul",wM,[r.createElementVNode("li",{class:"mc-select-group-label",style:r.normalizeStyle({height:r.unref(o),width:r.unref(i)})},r.toDisplayString(t.label),5),r.createElementVNode("li",null,[r.createElementVNode("ul",xM,[r.renderSlot(a.$slots,"default",{},void 0,!0)])])],512)),[[r.vShow,s.value]])}}),[["__scopeId","data-v-fad05d30"]])),Iy=()=>{const t=r.ref("bottom-start"),e=r.computed(()=>t.value==="top-start");return{placement:t,isTopPlacement:e}},CM=["id"],SM=r.defineComponent({name:_y,__name:"mc-select-plus",props:{width:{default:320},height:{default:40},placeholder:{default:"Please select"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},maxTags:{},search:{type:Boolean,default:!1},options:{},showHeader:{type:Boolean,default:!1},showFooter:{type:Boolean,default:!1},modelValue:{type:[String,Number,Boolean,Array]},inputGroupPosition:{},disableValidation:{type:Boolean,default:!1},hideValidationIcon:{type:Boolean,default:!1},validateProp:{},positionStrategy:{default:"absolute"},teleportTo:{}},emits:["update:modelValue","change","focus","blur","expand"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(!1);r.watch(i,B=>{o("expand",B)});const{selectOptions:s}=(()=>{let B=[];const V=r.ref([]),O=r.getCurrentInstance().proxy;return r.watchEffect(()=>{var F,R;V.value=[];const A=(R=(F=O.$slots).default)==null?void 0:R.call(F);if(A.length){const L=(I=>{const P=[],W=(z,j)=>{ce(z)&&z.forEach(K=>{var Z,J,Y,te,pe,X,oe,ae;const G=(Z=(K==null?void 0:K.type)||{})==null?void 0:Z.name;if(G===Hd){const se=Do(K.children)||ce(K.children)||!He((J=K.children)==null?void 0:J.default)?K.children:(Y=K.children)==null?void 0:Y.default();W(se,(te=K.props)==null?void 0:te.label)}else G===jd?P.push({label:(pe=K.props)==null?void 0:pe.label,value:(X=K.props)==null?void 0:X.value,disabled:(oe=K.props)==null?void 0:oe.disabled,group:j,context:(ae=K.children)==null?void 0:ae.default}):Array.isArray(K.children)&&W(K.children,j)})};return W(I),P})(A);V.value=[...L]}((L,I)=>{if(L.length!==I.length)return!1;for(const[P]of L.entries())if(L[P]!=I[P])return!1;return!0})(V.value,B)||(B=V.value)}),{selectOptions:V}})(),{selectedOptions:a}=(B=>{const V=ue("modelValue"),O=ue("multiple");return{selectedOptions:r.computed(()=>{if(ye(V.value))return[];if(O.value&&ce(V.value))return B.value.filter(A=>Ct(V.value,A.value));{const A=B.value.find(F=>F.value===V.value);return A?[A]:[]}})}})(s),{searchValue:l,isSearch:c,filteredOptions:d,filteredGroups:u,clearSearchValue:p}=(B=>{const V=r.ref(""),O=ue("search"),A=r.computed(()=>!!O.value),F=r.computed(()=>B!=null&&B.value.length?bn(Cr(B.value,L=>Ct(ll(L.label),ll(V.value))),L=>({value:L.value,group:L.group})):[]),R=r.computed(()=>{return F.value.length?bn((L=F.value)&&L.length?function(I,P){var W=-1,z=Ia,j=I.length,K=!0,G=[],Z=G;if(j>=200){var J=P?null:fk(I);if(J)return tl(J);K=!1,z=el,Z=new Vo}else Z=P?[]:G;e:for(;++W<j;){var Y=I[W],te=P?P(Y):Y;if(Y=Y!==0?Y:0,K&&te==te){for(var pe=Z.length;pe--;)if(Z[pe]===te)continue e;P&&Z.push(te),G.push(Y)}else z(Z,te,void 0)||(Z!==G&&Z.push(te),G.push(Y))}return G}(L,yn("group")):[],I=>I.group):[];var L});return{searchValue:V,isSearch:A,filteredOptions:F,filteredGroups:R,clearSearchValue:()=>{V.value=""}}})(s),h=async()=>{n.search&&(i.value||(i.value=!0))},f=r.ref();(function(B,V,O={}){const{window:A=Ty,ignore:F=[],capture:R=!0,detectIframe:L=!1,controls:I=!1}=O;if(!A)return I?{stop:ur,cancel:ur,trigger:ur}:ur;if(XE&&!Oy){Oy=!0;const j={passive:!0};Array.from(A.document.body.children).forEach(K=>K.addEventListener("click",ur,j)),A.document.documentElement.addEventListener("click",ur,j)}let P=!0;const W=j=>r.toValue(F).some(K=>{if(typeof K=="string")return Array.from(A.document.querySelectorAll(K)).some(G=>G===j.target||j.composedPath().includes(G));{const G=gi(K);return G&&(j.target===G||j.composedPath().includes(G))}});let z=!1;[Pd(A,"click",j=>{z||(z=!0,setTimeout(()=>{z=!1},0),(K=>{const G=gi(B);K.target!=null&&(G instanceof Element||!function(Z){const J=r.toValue(Z);return J&&J.$.subTree.shapeFlag===16}(B)||!function(Z,J){const Y=r.toValue(Z),te=Y.$.subTree&&Y.$.subTree.children;return!(te==null||!Array.isArray(te))&&te.some(pe=>pe.el===J.target||J.composedPath().includes(pe.el))}(B,K))&&G&&G!==K.target&&!K.composedPath().includes(G)&&("detail"in K&&K.detail===0&&(P=!W(K)),P?V(K):P=!0)})(j))},{passive:!0,capture:R}),Pd(A,"pointerdown",j=>{const K=gi(B);P=!W(j)&&!(!K||j.composedPath().includes(K))},{passive:!0}),L&&Pd(A,"blur",j=>{setTimeout(()=>{var K;const G=gi(B);((K=A.document.activeElement)==null?void 0:K.tagName)!=="IFRAME"||G!=null&&G.contains(A.document.activeElement)||V(j)},0)},{passive:!0})].filter(Boolean)})(f,()=>{p(),i.value=!1});const m=()=>{i.value=!1,p(),T(n.multiple?[]:void 0)},{hoverOption:g,setHoverOption:v,handlePressArrow:b}=(B=>{const V=r.ref(),O=()=>{V.value=void 0};return{hoverOption:V,setHoverOption:A=>{V.value=A},handlePressArrow:A=>{var R,L,I,P,W;if(!(B!=null&&B.value.length))return void O();if(!V.value)return void(V.value=(R=B.value[0])==null?void 0:R.value);const F=Ao(B==null?void 0:B.value,z=>z.value===V.value);A.key==="ArrowDown"?V.value=((L=B.value[F+1])==null?void 0:L.value)||((I=B.value[0])==null?void 0:I.value):A.key==="ArrowUp"&&(V.value=((P=B.value[F-1])==null?void 0:P.value)||((W=B.value[B.value.length-1])==null?void 0:W.value))},clearHoverOption:O}})(d),{width:y,height:k}=lt(),x=r.inject(Rr,void 0),{formId:w,formDisabled:C,validateStatus:S,validateByTrigger:E}=Nt({externalDisabled:r.computed(()=>!!(x!=null&&x.disabled.value))});r.watch(C,B=>{B&&(i.value=!1,p())}),r.watch(S,B=>{x&&x.setValidateStatus(B)});const M=()=>{o("focus")},N=()=>{E("blur"),o("blur")},T=B=>{o("update:modelValue",B),o("change",B)},{placement:D,isTopPlacement:$}=Iy();return r.provide(fn,{isMulti:r.computed(()=>n.multiple),isDisabled:r.computed(()=>C.value),validateStatus:S,selectOptions:s,selectedOptions:a,filteredOptions:d,filteredGroups:u,hoverOption:g,isTopPlacement:$,deleteTag:async B=>{if(!n.multiple)return;const V=bn(a.value,A=>A.value),O=Cp(V,[B]);T(O)},select:async B=>{if(p(),n.multiple){const V=n.modelValue;if(ce(V)&&!Be(V))if(Ct(V,B)){const O=Cp([...V],[B]);T(O)}else T([...V,B]);else T([B])}else i.value=!1,T(B)},selectAll:async B=>{if(!n.multiple)return;p();const V=B?s.value.map(O=>O.value):[];T(V)},hover:v}),(B,V)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"selectRef",ref:f,id:r.unref(w),class:"mc-select",style:r.normalizeStyle({width:r.unref(y)})},[r.createVNode(r.unref(ps),{"is-show":i.value,placement:r.unref(D),"onUpdate:placement":V[2]||(V[2]=O=>r.isRef(D)?D.value=O:null),strategy:t.positionStrategy,"teleport-to":t.teleportTo},{content:r.withCtx(()=>[r.createVNode(vM,{"show-header":t.showHeader,"show-footer":t.showFooter},r.createSlots({default:r.withCtx(()=>[r.renderSlot(B.$slots,"default",{},void 0,!0)]),_:2},[B.$slots["option-header"]?{name:"header",fn:r.withCtx(({isEmpty:O})=>[r.renderSlot(B.$slots,"option-header",{isEmpty:O},void 0,!0)]),key:"0"}:void 0,B.$slots["option-footer"]?{name:"footer",fn:r.withCtx(({isEmpty:O})=>[r.renderSlot(B.$slots,"option-footer",{isEmpty:O},void 0,!0)]),key:"1"}:void 0,B.$slots.empty?{name:"empty",fn:r.withCtx(()=>[r.renderSlot(B.$slots,"empty",{},void 0,!0)]),key:"2"}:void 0]),1032,["show-header","show-footer"])]),default:r.withCtx(()=>[r.createVNode(cM,{"search-value":r.unref(l),"onUpdate:searchValue":V[0]||(V[0]=O=>r.isRef(l)?l.value=O:null),"is-expanded":i.value,"onUpdate:isExpanded":V[1]||(V[1]=O=>i.value=O),search:r.unref(c),clearable:t.clearable,placeholder:t.placeholder,"max-tags":t.maxTags,"hide-validation-icon":t.hideValidationIcon,onSearch:h,onClear:m,"onPress:arrow":r.unref(b),onFocus:M,onBlur:N,style:r.normalizeStyle({height:r.unref(k)})},r.createSlots({_:2},[B.$slots.placeholder?{name:"placeholder",fn:r.withCtx(({placeholder:O,isDisabled:A})=>[r.renderSlot(B.$slots,"placeholder",{placeholder:O,isDisabled:A},void 0,!0)]),key:"0"}:void 0,B.$slots["selected-content"]?{name:"selected-content",fn:r.withCtx(({selectedOption:O,selectedOptionLabel:A,isDisabled:F})=>[r.renderSlot(B.$slots,"selected-content",{selectedOption:O,selectedOptionLabel:A,isDisabled:F},void 0,!0)]),key:"1"}:void 0]),1032,["search-value","is-expanded","search","clearable","placeholder","max-tags","hide-validation-icon","onPress:arrow","style"])]),_:3},8,["is-show","placement","strategy","teleport-to"])],12,CM))}}),Wd=ee(q(SM,[["__scopeId","data-v-2425910a"]])),Ry="McRichtext",Ly="McRichtextTool";var Ce=(t=>(t.NORMAL="normal",t.SMALL="small",t.FOOTNOTE="footnote",t.BOLD="bold",t.ITALIC="italic",t.LIST="list",t.ORDERED_LIST="numbering",t.LINK="link",t.IMAGE="document-image",t.CLEAR="input-reset",t))(Ce||{}),wo=(t=>(t.NORMAL="mc-richtext-normal-text",t.SMALL="mc-richtext-small-text",t.FOOTNOTE="mc-richtext-footnote",t))(wo||{});const xo=q(r.defineComponent({name:Ly,__name:"mc-richtext-tool",props:{icon:{},isActive:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:e}){const n=e;return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-richtext-tool",{"mc-richtext-tool-icon-actived":t.isActive}])},[r.renderSlot(o.$slots,"default",{isActive:t.isActive},()=>[(r.openBlock(),r.createBlock(xh,{class:"mc-richtext-tool-icon",key:t.icon,name:t.icon,size:24,cursor:"pointer",onClick:i[0]||(i[0]=s=>{return a=t.icon,void n("click",a);var a})},null,8,["name"]))],!0)],2))}}),[["__scopeId","data-v-ca9eaab3"]]),EM=$n.create({name:"custom-font",addAttributes:()=>({class:{default:null,parseHTML:t=>t.getAttribute("class"),renderHTML:t=>t.class?{class:t.class}:{}}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("class")&&null}],renderHTML:({HTMLAttributes:t})=>["span",t,0]}),MM={class:"mc-richtext-toolbar"},NM={class:"mc-richtext-font-selector"},BM={class:"mc-richtext-tool-group"},TM={class:"mc-richtext-tool-group"},OM={class:"mc-richtext-tool-group"},_M={class:"mc-richtext-attach-link"},VM=r.defineComponent({name:Ry,__name:"mc-richtext",props:{modelValue:{default:""},width:{default:"100%"},height:{}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref(),{width:a,height:l}=lt(),c=((M={})=>{const N=r.shallowRef();return r.onMounted(()=>{N.value=new jS(M)}),r.onBeforeUnmount(()=>{var T,D,$;const B=(T=N.value)==null?void 0:T.view.dom,V=B==null?void 0:B.cloneNode(!0);(D=B==null?void 0:B.parentNode)==null||D.replaceChild(V,B),($=N.value)==null||$.destroy()}),N})({content:`${o.modelValue}`,extensions:[qE,GE.configure({inline:!0,allowBase64:!0}),EM],onUpdate:({editor:M})=>{i("update:modelValue",M.getHTML())}});r.watch(()=>o.modelValue,M=>{const N=c.value,T=N==null?void 0:N.getHTML();N&&T!==M&&N.commands.setContent(M)});const d=r.ref(Ce.NORMAL),u=M=>{M===Ce.NORMAL?p():M===Ce.SMALL?h():M===Ce.FOOTNOTE?f():M===Ce.BOLD?m():M===Ce.ITALIC?g():M===Ce.LIST?v():M===Ce.ORDERED_LIST?b():M===Ce.LINK?w():M===Ce.IMAGE?C():M===Ce.CLEAR&&E()},p=()=>{var M;(M=c.value)==null||M.commands.setMark("custom-font",{class:wo.NORMAL})},h=()=>{var M;(M=c.value)==null||M.commands.setMark("custom-font",{class:wo.SMALL})},f=()=>{var M;(M=c.value)==null||M.commands.setMark("custom-font",{class:wo.FOOTNOTE})},m=()=>{var M;(M=c.value)==null||M.commands.toggleBold()},g=()=>{var M;(M=c.value)==null||M.commands.toggleItalic()},v=()=>{var M;(M=c.value)==null||M.commands.toggleList("bulletList","listItem")},b=()=>{var M;(M=c.value)==null||M.commands.toggleList("orderedList","listItem")};r.watchEffect(()=>{const M=c.value;if(!M)return;const N=M.getAttributes("custom-font").class;N===wo.SMALL?d.value=Ce.SMALL:N===wo.FOOTNOTE?d.value=Ce.FOOTNOTE:d.value=Ce.NORMAL});const y=r.ref(),k=r.ref(""),x=()=>{var M;k.value=((M=c.value)==null?void 0:M.getAttributes("link").href)||""},w=()=>{var N,T,D;const M=k.value;M?((N=c.value)==null||N.commands.setLink({href:M}),k.value=""):((T=c.value)==null||T.commands.unsetLink(),k.value=""),(D=y.value)==null||D.hide()},C=()=>{var M;(M=s.value)==null||M.click()},S=M=>{var $;const N=M.target,T=($=N.files)==null?void 0:$[0];if(!T||!T.type.startsWith("image/"))return;const D=new FileReader;D.onload=B=>{var O,A;const V=(O=B.target)==null?void 0:O.result;V&&((A=c.value)==null||A.commands.setImage({src:V}))},D.onerror=()=>{console.error("mc-richtext: error:read:image:",T.name)},D.readAsDataURL(T),N.value=""},E=()=>{var M;(M=c.value)==null||M.chain().focus().unsetAllMarks().clearNodes().run()};return e({editor:c.value,getText:()=>{var M;return(M=c.value)==null?void 0:M.getText()}}),(M,N)=>{var T,D,$,B,V,O;return r.openBlock(),r.createElementBlock("div",{class:"mc-richtext",style:r.normalizeStyle({width:r.unref(a),height:r.unref(l)})},[r.createElementVNode("section",MM,[r.createElementVNode("div",NM,[r.createVNode(r.unref(Wd),{modelValue:d.value,"onUpdate:modelValue":N[0]||(N[0]=A=>d.value=A),width:148,height:32,"disable-validation":"",onChange:N[1]||(N[1]=A=>u(A))},{"selected-content":r.withCtx(({selectedOptionLabel:A})=>[r.createElementVNode("span",{class:r.normalizeClass(["mc-richtext-font-selected",`mc-richtext-font-${d.value}`])},r.toDisplayString(A),3)]),default:r.withCtx(()=>[r.createVNode(r.unref(vi),{value:r.unref(Ce).NORMAL,label:"Normal text"},{default:r.withCtx(()=>[...N[4]||(N[4]=[r.createElementVNode("span",{class:"mc-richtext-font-normal"},"Normal text",-1)])]),_:1},8,["value"]),r.createVNode(r.unref(vi),{value:r.unref(Ce).SMALL,label:"Small text"},{default:r.withCtx(()=>[...N[5]||(N[5]=[r.createElementVNode("span",{class:"mc-richtext-font-small"},"Small text",-1)])]),_:1},8,["value"]),r.createVNode(r.unref(vi),{value:r.unref(Ce).FOOTNOTE,label:"Footnote"},{default:r.withCtx(()=>[...N[6]||(N[6]=[r.createElementVNode("span",{class:"mc-richtext-font-footnote"},"Footnote",-1)])]),_:1},8,["value"])]),_:1},8,["modelValue"])]),r.createElementVNode("div",BM,[r.createVNode(xo,{icon:r.unref(Ce).BOLD,"is-active":!!((T=r.unref(c))!=null&&T.isActive("bold")),onClick:u},null,8,["icon","is-active"]),r.createVNode(xo,{icon:r.unref(Ce).ITALIC,"is-active":!!((D=r.unref(c))!=null&&D.isActive("italic")),onClick:u},null,8,["icon","is-active"])]),r.createElementVNode("div",TM,[r.createVNode(xo,{icon:r.unref(Ce).LIST,"is-active":!!(($=r.unref(c))!=null&&$.isActive("bulletList")),onClick:u},null,8,["icon","is-active"]),r.createVNode(xo,{icon:r.unref(Ce).ORDERED_LIST,"is-active":!!((B=r.unref(c))!=null&&B.isActive("orderedList")),onClick:u},null,8,["icon","is-active"])]),r.createElementVNode("div",OM,[r.createVNode(xo,{icon:r.unref(Ce).LINK,"is-active":!!((V=r.unref(c))!=null&&V.isActive("link"))},{default:r.withCtx(()=>[r.createVNode(r.unref(Ho),{placement:"bottom-start",trigger:"click",ref_key:"linkTooltipRef",ref:y},{content:r.withCtx(()=>[r.createElementVNode("div",_M,[r.createVNode(r.unref($l),{modelValue:k.value,"onUpdate:modelValue":N[2]||(N[2]=A=>k.value=A),placeholder:"Please enter the URL"},null,8,["modelValue"]),r.createVNode(r.unref(Wi),{width:"180px",onClick:N[3]||(N[3]=A=>u("link"))},{default:r.withCtx(()=>[...N[7]||(N[7]=[r.createTextVNode(" Attach ",-1)])]),_:1})])]),default:r.withCtx(()=>[r.createVNode(r.unref(Ee),{name:"link",cursor:"pointer",class:"mc-richtext-tool-icon-link",onClick:x})]),_:1},512)]),_:1},8,["icon","is-active"]),r.createVNode(xo,{icon:r.unref(Ce).IMAGE,"is-active":!!((O=r.unref(c))!=null&&O.isActive("image")),onClick:u},null,8,["icon","is-active"])]),r.createVNode(xo,{icon:r.unref(Ce).CLEAR,onClick:u},null,8,["icon"])]),r.createVNode(r.unref(HS),{editor:r.unref(c),class:"mc-richtext-content"},null,8,["editor"]),r.createElementVNode("input",{ref_key:"fileInputRef",ref:s,type:"file",accept:"image/*",style:{display:"none"},"aria-hidden":"true",onChange:S},null,544)],4)}}}),$y=ee(q(VM,[["__scopeId","data-v-ac411452"]])),Py="mc-secondary-menu",AM={class:"mc-secondary-menu"},DM=["onClick"],IM={class:"mc-secondary-menu-item-content"},RM=r.defineComponent({name:Py,__name:"mc-secondary-menu",props:{modelValue:{},options:{default:()=>[]}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(),s=r.ref(),a=r.computed(()=>{const c=[];return n.options.forEach(d=>{c.push(d),d.children&&d.children.forEach(u=>{c.push({...u,parent:d.name})})}),c});r.onMounted(()=>{n.modelValue&&l(n.modelValue),setTimeout(()=>{s.value&&(s.value.style.transition="top 0.3s ease-in-out")})}),r.watch(()=>n.modelValue,()=>{n.modelValue&&l(n.modelValue)});const l=c=>{const d=Ao(a.value,{name:c});if(d<0||!s.value||!i.value)return;const u=Array.from(i.value.children),{top:p}=i.value.getBoundingClientRect(),{top:h}=u[d].getBoundingClientRect();s.value.style.top=h-p+"px"};return(c,d)=>(r.openBlock(),r.createElementBlock("div",AM,[r.createElementVNode("div",{class:"mc-secondary-menu-wrapper",ref_key:"wrapperRef",ref:i},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,u=>{var p;return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-secondary-menu-item",{"mc-secondary-menu-item-actived":t.modelValue===u.name,"mc-secondary-menu-item-parent":!!((p=u.children)!=null&&p.length),"mc-secondary-menu-item-child":!!u.parent}]),key:u.name,onClick:h=>{var m;return f=u,void(((m=f.children)==null?void 0:m.length)||(o("update:modelValue",f.name),o("change",f.name)));var f}},[r.createElementVNode("div",IM,r.toDisplayString(u.label),1)],10,DM)}),128)),r.createElementVNode("div",{class:"mc-secondary-menu-success-line",ref_key:"successLineRef",ref:s},null,512)],512)]))}}),zy=ee(q(RM,[["__scopeId","data-v-a052ad92"]])),yi=Symbol("mc-select-context"),Fy="mc-select",LM=["value","placeholder","disabled","readonly","onKeydown"],$M={class:"mc-select-selected-label"},PM={class:"mc-select-trigger-toolbar"},zM=r.defineComponent({name:"mc-select-trigger-virtual",__name:"index",props:{search:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},placeholder:{default:"Please select"},searchValue:{default:void 0},isExpanded:{type:Boolean,default:!1},hideValidationIcon:{type:Boolean,default:!1}},emits:["update:searchValue","update:isExpanded","press:arrow","search","focus","blur","clear"],setup(t,{emit:e}){const n=t,o=e,{selectedValue:i,selectOptions:s,isDisabled:a,validateStatus:l,isTopPlacement:c}=r.inject(yi),d=r.computed(()=>{if(i.value)return s.value.find(M=>M.value===i.value)}),u=r.ref(),{wrapperRef:p,isFocused:h,handleFocus:f,handleBlur:m}=Xn(u),{isHovering:g}=ul(p),v=r.computed(()=>a.value?"not-allowed":n.search?"text":"pointer"),b=r.computed(()=>{var M;return(M=d.value)!=null&&M.label?"":n.placeholder}),y=()=>{a.value||o("update:isExpanded",!n.isExpanded)},k=M=>{const{value:N}=M.target;o("update:searchValue",N),o("search")},{showClearIcon:x,mouseOverIcon:w}=(()=>{const M=r.ref(!1),N=ue("clearable");return{showClearIcon:r.computed(()=>!!N.value&&M.value),mouseOverIcon:T=>{N.value&&(M.value=T)}}})(),C=r.computed(()=>!!d.value&&x.value&&!a.value),S=()=>{a.value||o("update:isExpanded",!n.isExpanded)},E=()=>{o("clear")};return(M,N)=>{var T;return r.openBlock(),r.createElementBlock("div",{ref_key:"triggerRef",ref:p,class:r.normalizeClass(["mc-select-trigger-virtual",{"is-hovering":r.unref(g),"is-focused":r.unref(h),"is-expanded":t.isExpanded,"is-disabled":r.unref(a),"is-error":r.unref(l)==="error","is-success":r.unref(l)==="success","is-top-placement":r.unref(c)}]),onClick:y},[r.createElementVNode("div",{class:"mc-select-selected-content",style:r.normalizeStyle({cursor:v.value})},[r.createElementVNode("div",{class:"mc-select-input-wrapper",style:r.normalizeStyle({width:t.searchValue||!d.value?"100%":"1em"})},[r.createElementVNode("input",{ref_key:"inputRef",ref:u,value:t.searchValue,class:"mc-select-input",placeholder:b.value,disabled:r.unref(a),readonly:!t.search||r.unref(a),onInput:k,onFocus:N[0]||(N[0]=(...D)=>r.unref(f)&&r.unref(f)(...D)),onBlur:N[1]||(N[1]=(...D)=>r.unref(m)&&r.unref(m)(...D)),onKeydown:r.withKeys(r.withModifiers(S,["stop","prevent"]),["enter"])},null,40,LM)],4),r.withDirectives(r.createElementVNode("div",$M,[r.renderSlot(M.$slots,"selected-content",{selectedOption:d.value,selectedOptionLabel:(T=d.value)==null?void 0:T.label,isDisabled:r.unref(a)},()=>{var D;return[r.createElementVNode("span",null,r.toDisplayString((D=d.value)==null?void 0:D.label),1)]},!0)],512),[[r.vShow,d.value&&!t.searchValue]])],4),r.createElementVNode("div",PM,[r.withDirectives(r.createVNode(r.unref(Ee),{class:"mc-select-status-icon",name:r.unref(l)==="error"?"reject-fail-rev":"accept-success-rev",size:24},null,8,["name"]),[[r.vShow,r.unref(l)!=="init"&&!t.hideValidationIcon]]),r.createElementVNode("div",{class:"mc-select-icon-wrapper",onMouseenter:N[3]||(N[3]=D=>r.unref(w)(!0)),onMouseleave:N[4]||(N[4]=D=>r.unref(w)(!1))},[r.withDirectives(r.createVNode(r.unref(Ee),{class:"mc-select-chevron-icon",name:"down-chevron",size:24,cursor:r.unref(a)?"not-allowed":"pointer"},null,8,["cursor"]),[[r.vShow,!C.value]]),r.withDirectives(r.createElementVNode("div",{onClick:N[2]||(N[2]=r.withModifiers(()=>{},["stop"]))},[r.createVNode(r.unref(Ee),{class:"mc-select-clear-icon",name:"rejectfail",size:16,cursor:"pointer",onClick:E})],512),[[r.vShow,C.value]])],32)])],2)}}}),FM=q(zM,[["__scopeId","data-v-ffd1e933"]]),jM=["data-value","title"],HM=["data-value"],WM={key:1,class:"mc-select-list-empty"},KM=r.defineComponent({name:"mc-select-list-virtual",__name:"index",setup(t){const{selectedValue:e,isTopPlacement:n,select:o}=r.inject(yi),{selectOptions:i,totalHeight:s,offsetY:a,visibleItems:l,setScrollTop:c}=(()=>{const{filteredOptions:h}=r.inject(yi),f=r.computed(()=>h.value.length),m=r.computed(()=>40*f.value),g=r.computed(()=>Math.ceil(8)+6),v=r.ref(0),b=r.computed(()=>{const w=Math.floor(v.value/40)-3;return Math.max(0,w)}),y=r.computed(()=>{const w=b.value+g.value;return Math.min(f.value,w)}),k=r.computed(()=>40*b.value),x=r.computed(()=>h.value.slice(b.value,y.value));return{selectOptions:h,totalHeight:m,offsetY:k,visibleItems:x,setScrollTop:w=>{v.value=w}}})(),d=r.computed(()=>!Be(i.value)),u=h=>{const f=h.target.scrollTop;c(f)},p=h=>{const f=h.target.dataset.value;o(f)};return(h,f)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-select-list-virtual",{"is-top-placement":r.unref(n)}]),onScroll:u,onClick:p},[d.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-select-list-container",style:r.normalizeStyle({height:r.unref(s)+"px"})},[r.createElementVNode("ul",{class:"mc-select-list",style:r.normalizeStyle({transform:`translateY(${r.unref(a)}px)`})},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(l),m=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-select-item",{"is-actived":m.value===r.unref(e)}]),key:m.value,"data-value":m.value,title:m.label},[r.renderSlot(h.$slots,"default",{optionValue:m.value,optionLabel:m.label},()=>[r.createElementVNode("span",{"data-value":m.value},r.toDisplayString(m.label),9,HM)],!0)],10,jM))),128))],4)],4)):(r.openBlock(),r.createElementBlock("div",WM,[r.renderSlot(h.$slots,"empty",{},()=>[f[0]||(f[0]=r.createElementVNode("p",{class:"mc-select-list-empty-text"},"No results found",-1))],!0)]))],34))}}),UM=q(KM,[["__scopeId","data-v-65ab53fa"]]),qM=["id"],jy=ee(q(r.defineComponent({name:Fy,__name:"mc-select",props:{modelValue:{},placeholder:{default:"Please select"},disabled:{type:Boolean,default:!1},width:{default:320},height:{default:40},search:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},options:{},disableValidation:{type:Boolean,default:!1},hideValidationIcon:{type:Boolean,default:!1},validateProp:{},positionStrategy:{default:"absolute"},teleportTo:{}},emits:["update:modelValue","change","blur","focus","expand"],setup(t,{emit:e}){const n=t,o=e,{width:i,height:s}=lt(),a=r.ref(!1);r.watch(a,E=>{o("expand",E)});const{placement:l,isTopPlacement:c}=Iy(),{selectOptions:d,filteredOptions:u,searchValue:p,clearSearchValue:h}=(()=>{const E=ue("options"),M=r.ref(""),N=r.computed(()=>{var T;return(T=E.value)!=null&&T.length?Be(M.value)?E.value:Cr(E.value,D=>Ct(ll(D.label??D.value),M.value)):[]});return{selectOptions:E,searchValue:M,filteredOptions:N,clearSearchValue:()=>{M.value=""}}})(),f=r.ref();Hi(f,()=>{h(),a.value=!1});const m=()=>{n.search&&(a.value=!0)},g=()=>{a.value=!1,h(),S(void 0)},v=r.inject(Rr,void 0),{formId:b,formDisabled:y,validateStatus:k,validateByTrigger:x}=Nt({externalDisabled:r.computed(()=>!!(v!=null&&v.disabled.value))});r.watch(y,E=>{E&&(a.value=!1,h())}),r.watch(k,E=>{v&&v.setValidateStatus(E)});const w=()=>{o("focus")},C=()=>{x("blur"),o("blur")},S=E=>{o("update:modelValue",E),o("change",E)};return r.provide(yi,{isDisabled:r.computed(()=>y.value),selectOptions:d,selectedValue:r.computed(()=>n.modelValue),validateStatus:k,filteredOptions:u,isTopPlacement:c,select:E=>{h(),a.value=!1,S(E)}}),(E,M)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"selectRef",ref:f,id:r.unref(b),class:"mc-select",style:r.normalizeStyle({width:r.unref(i)})},[r.createVNode(r.unref(ps),{placement:r.unref(l),"onUpdate:placement":M[2]||(M[2]=N=>r.isRef(l)?l.value=N:null),"is-show":a.value,strategy:t.positionStrategy,"teleport-to":t.teleportTo},{content:r.withCtx(()=>[r.createVNode(UM,null,r.createSlots({_:2},[E.$slots["option-item"]?{name:"default",fn:r.withCtx(({optionValue:N,optionLabel:T})=>[r.renderSlot(E.$slots,"option-item",{optionValue:N,optionLabel:T},void 0,!0)]),key:"0"}:void 0,E.$slots.empty?{name:"empty",fn:r.withCtx(()=>[r.renderSlot(E.$slots,"empty",{},void 0,!0)]),key:"1"}:void 0]),1024)]),default:r.withCtx(()=>[r.createVNode(FM,{"is-expanded":a.value,"onUpdate:isExpanded":M[0]||(M[0]=N=>a.value=N),"search-value":r.unref(p),"onUpdate:searchValue":M[1]||(M[1]=N=>r.isRef(p)?p.value=N:null),search:t.search,placeholder:t.placeholder,clearable:t.clearable,"hide-validation-icon":t.hideValidationIcon,onSearch:m,onClear:g,onFocus:w,onBlur:C,style:r.normalizeStyle({height:r.unref(s)})},r.createSlots({_:2},[E.$slots["selected-content"]?{name:"selected-content",fn:r.withCtx(({selectedOption:N,selectedOptionLabel:T,isDisabled:D})=>[r.renderSlot(E.$slots,"selected-content",{selectedOption:N,selectedOptionLabel:T,isDisabled:D},void 0,!0)]),key:"0"}:void 0]),1032,["is-expanded","search-value","search","placeholder","clearable","hide-validation-icon","style"])]),_:3},8,["placement","is-show","strategy","teleport-to"])],12,qM))}}),[["__scopeId","data-v-e2be8d95"]])),Hy="mc-status",JM={class:"mc-status-icon"},GM={class:"mc-status-content"},Wy=ee(q(r.defineComponent({name:Hy,__name:"mc-status",props:{type:{default:"info"}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-status",[`mc-status-${t.type}`]])},[r.createElementVNode("div",JM,[r.createVNode(r.unref(ge),{name:"Indicator",size:12})]),r.createElementVNode("p",GM,[r.renderSlot(e.$slots,"default",{},void 0,!0)])],2))}),[["__scopeId","data-v-cdd41d46"]])),Ky="mc-step",YM={class:"mc-step-number-container"},XM={class:"mc-step-item-number"},QM={key:0,class:"mc-step-item-number-text"},ZM={class:"mc-step-item-content"},eN={key:0,class:"mc-step-item-content-title"},tN={class:"mc-step-item-label"},nN={class:"mc-step-item-desc"},oN={key:1,class:"mc-step-item-component"},rN={key:0,class:"mc-step-item-component"},iN=r.defineComponent({name:Ky,__name:"mc-step",props:{modelValue:{},steps:{},type:{default:"vertical"}},emits:["change","success"],setup(t,{expose:e,emit:n}){const o=t,i=r.computed(()=>o.type==="vertical"),s=n,a=r.ref(),l=r.ref(),c=r.ref(),d=r.ref(),u=r.computed(()=>Ao(o.steps,w=>w.key===o.modelValue)),p=r.computed(()=>{var w;return(w=o.steps[u.value-1])==null?void 0:w.key});r.watch(()=>o.modelValue,w=>{f(),s("change",w)},{flush:"post"});const h=r.ref(),f=(w=p.value)=>{h.value=w,s("success",w)},m=r.computed(()=>Ao(o.steps,w=>w.key===h.value));r.onMounted(()=>{i.value?g():(v(),b()),f()});const g=async()=>{await r.nextTick();const w=m.value,C=d.value;if(w<0)return void(C.style.height="0");const S=l.value,E=S.querySelectorAll(".mc-step-item");if(w+1>E.length-1)return void(C.style.height="100%");const M=E==null?void 0:E[w+1],N=S.getBoundingClientRect(),T=(M.getBoundingClientRect().top-N.top)/(N.height-24);C.style.height=100*T+"%"},v=()=>{var $,B;const w=l.value,C=c.value,S=w.querySelectorAll(".mc-step-item"),E=($=S==null?void 0:S[0])==null?void 0:$.querySelector(".mc-step-item-number"),M=(B=S==null?void 0:S[S.length-1])==null?void 0:B.querySelector(".mc-step-item-number");if(!E||!M)return void(C.style.width="0px");const N=w.getBoundingClientRect(),T=E.getBoundingClientRect(),D=M.getBoundingClientRect();C.style.width=D.left-T.left-T.width+"px",C.style.left=`${T.left-N.left+T.width}px`},b=()=>{const w=d.value,C=m.value;if(C<0)return void(w.style.width="0");const S=(C+1)/(o.steps.length-1),E=S>1?1:S;w.style.width=100*E+"%"},y=w=>i.value&&w.component&&w.key===o.modelValue,k=r.computed(()=>{var w;return!i.value&&((w=zi(o.steps,C=>C.key===o.modelValue))==null?void 0:w.component)});var x;return r.watch(()=>h.value,()=>{i.value?g():b()}),x=Io(()=>{i.value?g():(v(),b())},50),r.onMounted(()=>{window.addEventListener("resize",x)}),r.onUnmounted(()=>{window.removeEventListener("resize",x)}),e({ref:a,setSuccessStep:f}),(w,C)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-step",`mc-step-${t.type}`]),ref_key:"_ref",ref:a},[r.createElementVNode("ul",{class:"mc-step-item-container",ref_key:"stepContainerRef",ref:l},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.steps,(S,E)=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-step-item",{"mc-step-item-active":t.modelValue===S.key,"mc-step-item-disabled":S.disabled,"mc-step-item-success":E<=m.value}]),key:S.key},[r.createElementVNode("div",YM,[r.createElementVNode("div",XM,[E>m.value||S.disabled?(r.openBlock(),r.createElementBlock("span",QM,r.toDisplayString(E+1),1)):(r.openBlock(),r.createBlock(r.unref(Yo),{key:1}))])]),r.createElementVNode("div",ZM,[S.label||S.desc?(r.openBlock(),r.createElementBlock("div",eN,[r.createElementVNode("h3",tN,r.toDisplayString(S.label),1),r.createElementVNode("p",nN,r.toDisplayString(S.desc),1)])):r.createCommentVNode("",!0),y(S)?(r.openBlock(),r.createElementBlock("div",oN,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(S.component)))])):r.createCommentVNode("",!0)])],2))),128)),r.createElementVNode("div",{ref_key:"unsuccessLineRef",ref:c,class:"mc-step-line mc-step-unsuccess-line"},[r.createElementVNode("div",{ref_key:"successLineRef",ref:d,class:"mc-step-success-line"},null,512)],512)],512),k.value?(r.openBlock(),r.createElementBlock("div",rN,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(k.value)))])):r.createCommentVNode("",!0)],2))}}),Uy=ee(q(iN,[["__scopeId","data-v-e0327154"]])),qy="mc-step-plus",Kd="mc-step-item-plus",sN={class:"mc-step-item-plus"},Jy=ee(r.defineComponent({name:Kd,__name:"mc-step-item-plus",props:{icon:{},key:{},label:{},desc:{},showContent:{type:Boolean},success:{type:Boolean}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",sN))})),Ud="mc-step-child-item-plus",aN={class:"mc-step-child-item-plus"},Gy=ee(r.defineComponent({name:Ud,__name:"mc-step-child-item-plus",props:{key:{},label:{},desc:{},showContent:{type:Boolean},success:{type:Boolean}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",aN))})),lN={class:"mc-step-plus"},cN={class:"mc-step-container"},dN=["onClick"],uN={class:"mc-step-item-icon"},pN={key:0,class:"mc-step-item-icon-number"},hN={key:1,class:"mc-step-item-icon-point"},fN={class:"mc-step-item-content"},mN={class:"mc-step-item-content-title"},gN={class:"mc-step-item-label"},vN={key:1,class:"mc-step-item-label-title"},yN={class:"mc-step-item-desc"},bN={key:1,class:"mc-step-item-desc-title"},kN={key:0,class:"mc-step-item-content-display"},Yy=ee(q(r.defineComponent({name:qy,__name:"mc-step-plus",props:{modelValue:{default:void 0},successSteps:{},successBehavior:{default:"manual"},previousBehavior:{default:"last-child"}},emits:["update:modelValue","update:successSteps","change","click:step"],setup(t,{expose:e,emit:n}){const o=t,i=n,{stepItems:s,activedStep:a,isActivedStep:l,showStep:c,isSuccessStep:d,showContent:u}=(()=>{const f=r.ref([]),m=r.useSlots();r.watchEffect(()=>{var k;f.value=(x=>{const w=[];let C=0,S=0;const E=(M,N)=>{ce(M)&&M.forEach(T=>{var $,B,V,O,A,F,R,L,I,P,W,z,j,K,G,Z;const D=($=(T==null?void 0:T.type)||{})==null?void 0:$.name;if(D===Kd){const J=Do(T.children)||ce(T.children)||!He((B=T.children)==null?void 0:B.default)?T.children:(V=T.children)==null?void 0:V.default(),Y=T.children,te={parentIndex:C++,index:S++,step:((O=T.props)==null?void 0:O.step)||S,label:(A=T.props)==null?void 0:A.label,desc:(F=T.props)==null?void 0:F.desc,icon:(R=T.props)==null?void 0:R.icon,showContent:((L=T.props)==null?void 0:L.showContent)||((I=T.props)==null?void 0:I["show-content"]),success:(P=T.props)==null?void 0:P.success,content:Y==null?void 0:Y.default,labelContent:Y==null?void 0:Y.label,descContent:Y==null?void 0:Y.desc};w.push(te),E(J,te)}else if(D===Ud){const J=T.children,Y={index:S++,step:(W=T.props)==null?void 0:W.step,label:(z=T.props)==null?void 0:z.label,desc:(j=T.props)==null?void 0:j.desc,parentStep:N,isChild:!0,showContent:((K=T.props)==null?void 0:K.showContent)||((G=T.props)==null?void 0:G["show-content"]),success:(Z=T.props)==null?void 0:Z.success,content:J==null?void 0:J.default,labelContent:J==null?void 0:J.label,descContent:J==null?void 0:J.desc};N&&(N.content=void 0,N.hasChildren=!0,N.children||(N.children=[]),Y.childIndex=N.children.length,N.children.push(Y),N.childrenSteps||(N.childrenSteps=[]),N.childrenSteps.push(Y.step)),w.push(Y)}else Array.isArray(T.children)&&E(T.children,N)})};return E(x),w})((k=m.default)==null?void 0:k.call(m))});const g=ue("modelValue"),v=r.computed(()=>f.value.find(k=>k.step===g.value)),b=ue("successSteps"),y=ue("successBehavior");return{stepItems:f,activedStep:v,isActivedStep:k=>{var x,w;return!ye(k.index)&&!ye((x=v.value)==null?void 0:x.index)&&k.index<=((w=v.value)==null?void 0:w.index)},showStep:k=>{var x,w;return!k.isChild||!!((x=k.parentStep)!=null&&x.showContent)||!!k.parentStep&&v.value===k.parentStep||Ct((w=k.parentStep)==null?void 0:w.childrenSteps,g.value)},isSuccessStep:k=>{var x,w,C,S,E,M;return!(!k.success&&!((x=k.parentStep)!=null&&x.success))||(y.value==="auto"?k.hasChildren?!ye(k.index)&&k.index+(((w=k.children)==null?void 0:w.length)??0)<(((C=v.value)==null?void 0:C.index)??-1):!ye(k.index)&&k.index<(((S=v.value)==null?void 0:S.index)??-1):!!((E=b.value)!=null&&E.length)&&(Ct(b.value,k.step)||Ct(b.value,(M=k.parentStep)==null?void 0:M.step)))},showContent:k=>!(!k.content||k.step!==g.value&&!k.showContent)}})(),p=()=>{var m;const f=((m=a.value)==null?void 0:m.index)||-1;if(f<s.value.length-1){let g=f+1,v=s.value[g];v.hasChildren&&(v=s.value[g+1]),v!=null&&v.step&&h(v.step)}},h=f=>{i("update:modelValue",f),i("change",f)};return e({goStep:f=>{f?h(f):p()},goNextStep:p,goPreviousStep:()=>{var m,g,v;const f=((m=a.value)==null?void 0:m.index)||-1;if(f>0){let b=f-1,y=s.value[b];(g=a.value)!=null&&g.isChild&&a.value.parentStep===y&&(y=s.value[b-1]),o.previousBehavior==="first-child"&&(y!=null&&y.isChild)&&!ye((v=y.parentStep)==null?void 0:v.index)&&(b=y.parentStep.index+1,y=s.value[b]),y!=null&&y.step&&h(y.step)}}}),(f,m)=>(r.openBlock(),r.createElementBlock("div",lN,[r.createElementVNode("div",cN,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(s),g=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:g.step},[r.unref(c)(g)?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["mc-step-item",{"mc-step-item-child":g.isChild,"mc-step-item-actived":r.unref(l)(g),"mc-step-item-success":r.unref(d)(g)}])},[r.createElementVNode("div",{class:"mc-step-item-indicator",onClick:v=>(b=>{i("click:step",b.step)})(g)},[r.createElementVNode("div",uN,[g.isChild||r.unref(ye)(g.parentIndex)?(r.openBlock(),r.createElementBlock("div",hN)):(r.openBlock(),r.createElementBlock("div",pN,[r.unref(d)(g)?(r.openBlock(),r.createBlock(r.unref(Yo),{key:0})):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[g.iconContent?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(g.iconContent),{key:g.step,step:g.step,isSuccess:r.unref(d)(g),isActived:r.unref(l)(g)},null,8,["step","isSuccess","isActived"])):g.icon?(r.openBlock(),r.createBlock(r.unref(ge),{key:1,name:g.icon},null,8,["name"])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:2},[r.createTextVNode(r.toDisplayString(g.parentIndex+1),1)],64))],64))]))])],8,dN),r.createElementVNode("div",fN,[r.createElementVNode("div",mN,[r.createElementVNode("div",gN,[g.labelContent?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(g.labelContent),{key:g.step,step:g.step,label:g.label,isSuccess:r.unref(d)(g),isActived:r.unref(l)(g)},null,8,["step","label","isSuccess","isActived"])):(r.openBlock(),r.createElementBlock("div",vN,r.toDisplayString(g.label),1))]),r.createElementVNode("div",yN,[g.descContent?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(g.descContent),{key:g.step,step:g.step,desc:g.desc,isSuccess:r.unref(d)(g),isActived:r.unref(l)(g)},null,8,["step","desc","isSuccess","isActived"])):(r.openBlock(),r.createElementBlock("div",bN,r.toDisplayString(g.desc),1))])]),r.unref(u)(g)?(r.openBlock(),r.createElementBlock("div",kN,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(g.content),{key:g.step,step:g.step,isSuccess:r.unref(d)(g),isActived:r.unref(l)(g)},null,8,["step","isSuccess","isActived"]))])):r.createCommentVNode("",!0)])],2)):r.createCommentVNode("",!0)],64))),128))])]))}}),[["__scopeId","data-v-c058c992"]])),Xy="mc-switch",Qy="mc-switch-label",wN={class:"mc-switch-label-wrapper"},xN={class:"mc-switch-label"},CN={class:"mc-switch-help"},Zy=q(r.defineComponent({name:Qy,__name:"mc-switch-label",props:{label:{},helpText:{},helpIcon:{default:"Info"}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",wN,[t.label||e.$slots.label?r.renderSlot(e.$slots,"label",{key:0},()=>[r.createElementVNode("span",xN,r.toDisplayString(t.label),1)],!0):r.createCommentVNode("",!0),t.helpText||e.$slots.help?r.renderSlot(e.$slots,"help",{key:1},()=>[r.createElementVNode("div",CN,[r.createVNode(r.unref(Ho),{"icon-name":t.helpIcon,content:t.helpText,"icon-size":22},null,8,["icon-name","content"])])],!0):r.createCommentVNode("",!0)]))}),[["__scopeId","data-v-e1ce5008"]]),SN={class:"mc-switch"},EN=["id","disabled","value","onKeypress"],MN={class:"mc-switch-inner"},NN={class:"mc-switch-inner-text"},BN={class:"mc-switch-inner-text"},TN=r.defineComponent({name:Xy,__name:"mc-switch",props:{modelValue:{type:Boolean,default:!1},width:{},height:{},activeText:{},inactiveText:{},disabled:{type:Boolean,default:!1},size:{default:"medium"},label:{},labelPosition:{default:"right"},helpIcon:{default:"Info"},helpText:{},disableValidation:{type:Boolean},hideValidationIcon:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,i=r.useSlots(),{formId:s,formDisabled:a,validateStyle:l,validateByTrigger:c}=Nt(),d=r.computed(()=>n.modelValue),u=async()=>{a.value||(o("update:modelValue",!n.modelValue),o("change",!n.modelValue),c("input"))},p=r.computed(()=>i.label||n.label||i.help||n.helpText?n.labelPosition:void 0),h=r.computed(()=>p.value==="left"),f=r.computed(()=>p.value==="right");return(m,g)=>(r.openBlock(),r.createElementBlock("div",SN,[h.value?(r.openBlock(),r.createBlock(Zy,{key:0,label:t.label,"help-text":t.helpText,"help-icon":t.helpIcon},r.createSlots({_:2},[m.$slots.label?{name:"label",fn:r.withCtx(()=>[r.renderSlot(m.$slots,"label",{},void 0,!0)]),key:"0"}:void 0,m.$slots.help?{name:"help",fn:r.withCtx(()=>[r.renderSlot(m.$slots,"help",{},void 0,!0)]),key:"1"}:void 0]),1032,["label","help-text","help-icon"])):r.createCommentVNode("",!0),r.createElementVNode("label",{class:r.normalizeClass(["mc-switch-wrapper",[d.value?"mc-switch-actived":"mc-switch-inactive",{"mc-switch-disabled":r.unref(a)},`mc-switch-${t.size}`,r.unref(l)]]),style:r.normalizeStyle({width:t.width,height:t.height})},[r.createElementVNode("input",{id:r.unref(s),type:"checkbox",class:"mc-switch-input",disabled:t.disabled,value:t.modelValue,onChange:u,onKeypress:r.withKeys(r.withModifiers(u,["prevent","stop"]),["enter"])},null,40,EN),r.createElementVNode("div",MN,[d.value?r.renderSlot(m.$slots,"active",{key:0},()=>[r.createElementVNode("span",NN,r.toDisplayString(t.activeText),1)],!0):r.renderSlot(m.$slots,"inactive",{key:1},()=>[r.createElementVNode("span",BN,r.toDisplayString(t.inactiveText),1)],!0)])],6),f.value?(r.openBlock(),r.createBlock(Zy,{key:1,label:t.label,"help-text":t.helpText,"help-icon":t.helpIcon},r.createSlots({_:2},[m.$slots.label?{name:"label",fn:r.withCtx(()=>[r.renderSlot(m.$slots,"label",{},void 0,!0)]),key:"0"}:void 0,m.$slots.help?{name:"help",fn:r.withCtx(()=>[r.renderSlot(m.$slots,"help",{},void 0,!0)]),key:"1"}:void 0]),1032,["label","help-text","help-icon"])):r.createCommentVNode("",!0)]))}}),e0=ee(q(TN,[["__scopeId","data-v-57841683"]])),qd="mc-tab-item",ON={class:"mc-tab-item"},t0=ee(r.defineComponent({name:qd,__name:"mc-tab-item",props:{name:{},label:{},disabled:{type:Boolean},count:{}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",ON,[r.renderSlot(e.$slots,"default")]))})),n0="mc-tab",_N=["onClick"],VN={key:0,class:"mc-tab-nav-item-count"},AN={class:"mc-tab-actived-component-wrapper"},o0=ee(q(r.defineComponent({name:n0,__name:"mc-tab",props:{modelValue:{},type:{default:"plain"},wrapperPadding:{default:"0"}},emits:["update:modelValue","change"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref(),a=r.ref(),l=r.ref(),c=r.ref([]),d=r.useSlots();r.watchEffect(()=>{if(!d.default)return void(c.value=[]);let v=d.default();v.length&&v[0].type===r.Fragment&&(v=[...Array.from(v[0].children)]),c.value=bn(Cr(v,b=>b.type.name===qd),b=>{var k,x,w;const y=b.props;return{_vnode:r.h("div",(w=(x=(k=b.children)==null?void 0:k.default)==null?void 0:x.call(k))==null?void 0:w[0]),...y}})});const u=r.computed(()=>zi(c.value,v=>v.name===o.modelValue)),p=r.computed(()=>o.type==="plain");r.onMounted(async()=>{h(o.modelValue),setTimeout(()=>{f()})}),r.onUnmounted(()=>{f(!1)});const h=v=>{if(!p.value)return;const b=l.value,y=a.value,k=Ao(c.value,E=>E.name===v);if(k<0)return void(b.style.width="0");const x=Array.from(y.children)[k],{x:w,width:C}=x.getBoundingClientRect(),{x:S}=y.getBoundingClientRect();b.style.width=`${C}px`,b.style.transform=`translateX(${w-S}px)`},f=(v=!0)=>{const b=l.value;p.value&&b&&(b.style.transition=v?"transform 0.3s ease-in-out":"")};r.watch(()=>o.modelValue,v=>{h(v)});const m=r.computed(()=>{var v;return typeof o.wrapperPadding=="string"?o.wrapperPadding:((v=o.wrapperPadding)==null?void 0:v.left)??"0"}),g=r.computed(()=>{var v;return typeof o.wrapperPadding=="string"?o.wrapperPadding:((v=o.wrapperPadding)==null?void 0:v.right)??"0"});return e({ref:s}),(v,b)=>{var y;return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-tab",`mc-tab-${t.type}`]),ref_key:"_ref",ref:s},[r.createElementVNode("div",{class:"mc-tab-nav",style:r.normalizeStyle({paddingLeft:m.value,paddingRight:g.value})},[r.createElementVNode("div",{class:"mc-tab-nav-wrapper",ref_key:"tabNavRef",ref:a},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,k=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-tab-nav-item",{"mc-tab-nav-item-active":k.name===t.modelValue,"mc-tab-nav-item-disabled":k.disabled}]),key:k.name,onClick:x=>(w=>{w.disabled||(i("update:modelValue",w.name),i("change",w.name))})(k)},[r.createElementVNode("span",null,r.toDisplayString(k.label),1),k.count?(r.openBlock(),r.createElementBlock("span",VN,r.toDisplayString(k.count),1)):r.createCommentVNode("",!0)],10,_N))),128))],512),p.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-tab-line",ref_key:"tabLineRef",ref:l},null,512)):r.createCommentVNode("",!0)],4),(y=u.value)!=null&&y._vnode?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-tab-actived-component",style:r.normalizeStyle({paddingLeft:m.value,paddingRight:g.value})},[r.createElementVNode("div",AN,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(u.value._vnode),{key:u.value.name}))])],4)):r.createCommentVNode("",!0)],2)}}}),[["__scopeId","data-v-e15262e7"]])),DN=["rowspan","colspan"],IN=q(r.defineComponent({__name:"mc-table-cell",props:{row:{},column:{},rowIndex:{},columnIndex:{},pagination:{},spanMethod:{type:Function}},setup(t){const e=t,n=r.computed(()=>e.row[e.column.prop]),o=r.computed(()=>{const u=[e.column.className];if(e.column.align&&u.push(`is-${e.column.align}`),e.column.fixed){const h=typeof e.column.fixed=="boolean"?"left":e.column.fixed;u.push(`is-fixed-${h}`)}const p=c.value===0?"none":"table-cell";return u.push(`is-display-${p}`),u}),i=()=>{var u,p;return(u=e.pagination)!=null&&u.currentPage&&((p=e.pagination)!=null&&p.pageSize)?(e.pagination.currentPage-1)*e.pagination.pageSize+e.rowIndex:e.rowIndex},s=()=>{if(!e.spanMethod)return null;const u=i();return e.spanMethod({row:e.row,column:e.column,rowIndex:u,columnIndex:e.columnIndex})},a=(u,p)=>{var g,v;if(!((g=e.pagination)!=null&&g.currentPage)||!((v=e.pagination)!=null&&v.pageSize)||p<=1)return!0;const h=(e.pagination.currentPage-1)*e.pagination.pageSize,f=h+e.pagination.pageSize-1,m=u;return!(u+p-1<h||m>f)&&Math.max(m,h)===u},l=r.computed(()=>{const u=s();if(u){const p=i();let h;return h=Array.isArray(u)?u[0]:u.rowspan||1,h>1?a(p,h)?((f,m)=>{var x,w;if(!((x=e.pagination)!=null&&x.currentPage)||!((w=e.pagination)!=null&&w.pageSize)||m<=1)return m;const g=(e.pagination.currentPage-1)*e.pagination.pageSize,v=g+e.pagination.pageSize-1,b=f,y=f+m-1,k=Math.max(b,g);return Math.min(y,v)-k+1})(p,h):0:h}if(e.column.rowSpan)return typeof e.column.rowSpan=="function"?e.column.rowSpan(e.row,e.column,e.rowIndex):e.column.rowSpan}),c=r.computed(()=>{const u=s();return u?Array.isArray(u)?u[1]:u.colspan:e.column.colSpan?typeof e.column.colSpan=="function"?e.column.colSpan(e.row,e.column,e.rowIndex):e.column.colSpan:void 0}),d=r.computed(()=>{const u=s();if(u){const p=i();let h,f;return Array.isArray(u)?(h=u[0],f=u[1]):(h=u.rowspan||1,f=u.colspan||1),!(h>1&&!a(p,h)||h===0||f===0)}return!0});return(u,p)=>d.value?(r.openBlock(),r.createElementBlock("td",{key:0,class:r.normalizeClass(o.value),rowspan:l.value,colspan:c.value},[r.renderSlot(u.$slots,"cell",{row:t.row,column:t.column,index:t.rowIndex,value:n.value,prop:t.column.prop},()=>[r.renderSlot(u.$slots,t.column.slot||t.column.prop,{row:t.row,column:t.column,index:t.rowIndex,value:n.value},()=>[t.column.formatter?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createTextVNode(r.toDisplayString(t.column.formatter(t.row,t.column,n.value,t.rowIndex)),1)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(n.value),1)],64))],!0)],!0)],10,DN)):r.createCommentVNode("",!0)}}),[["__scopeId","data-v-75c1c38a"]]),RN={class:"mc-table__body",cellspacing:"0",cellpadding:"0",border:"0"},LN={key:0,width:"50"},$N=["width"],PN=["onClick"],zN={key:0,class:"mc-table__selection-column"},FN={class:"mc-table__cell"},jN={key:1},HN=["colspan"],WN={key:1},KN=q(r.defineComponent({__name:"mc-table-body",props:{data:{},columns:{},rowKey:{},emptyText:{},height:{},maxHeight:{},pagination:{},spanMethod:{},getRowClass:{},selectable:{type:Boolean,default:!1},selectedRows:{},selectOnRowClick:{type:Boolean,default:!1}},emits:["row-click","select"],setup(t,{expose:e,emit:n}){const o=t,i=r.useSlots(),s=n,a=r.ref(),l=r.computed(()=>Object.keys(i)),c=r.computed(()=>{const f={};return o.height&&(f.height=typeof o.height=="number"?`${o.height}px`:o.height),o.maxHeight&&(f.maxHeight=typeof o.maxHeight=="number"?`${o.maxHeight}px`:o.maxHeight),f}),d=r.computed(()=>o.pagination),u=(f,m)=>o.rowKey?f[o.rowKey]:m,p=(f,m)=>o.getRowClass?o.getRowClass(f,m):[],h=f=>!!o.selectedRows&&o.selectedRows.some(m=>o.rowKey?m[o.rowKey]===f[o.rowKey]:m===f);return e({bodyWrapper:a}),(f,m)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-table__body-wrapper",ref_key:"bodyWrapper",ref:a,style:r.normalizeStyle(c.value)},[r.createElementVNode("table",RN,[r.createElementVNode("colgroup",null,[t.selectable?(r.openBlock(),r.createElementBlock("col",LN)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.columns,(g,v)=>(r.openBlock(),r.createElementBlock("col",{key:v,width:g.width},null,8,$N))),128))]),r.createElementVNode("tbody",null,[t.data&&t.data.length>0?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(t.data,(g,v)=>(r.openBlock(),r.createElementBlock("tr",{key:u(g,v),class:r.normalizeClass(p(g,v)),onClick:b=>((y,k)=>{s("row-click",y,k)})(g,v)},[t.selectable?(r.openBlock(),r.createElementBlock("td",zN,[r.createElementVNode("div",FN,[r.createVNode(r.unref(Wo),{"model-value":h(g),onChange:b=>((y,k)=>{s("select",y,k)})(g,b)},null,8,["model-value","onChange"])])])):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.columns,(b,y)=>(r.openBlock(),r.createBlock(IN,{key:y,row:g,column:b,"row-index":v,"column-index":y,"span-method":t.spanMethod,pagination:d.value},r.createSlots({_:2},[r.renderList(l.value,k=>({name:k,fn:r.withCtx(x=>[r.renderSlot(f.$slots,k,r.mergeProps({ref_for:!0},x),void 0,!0)])}))]),1032,["row","column","row-index","column-index","span-method","pagination"]))),128))],10,PN))),128)):(r.openBlock(),r.createElementBlock("tr",jN,[r.createElementVNode("td",{colspan:o.selectable?o.columns.length+1:o.columns.length,class:"mc-table__empty-cell"},[r.unref(i).empty?r.renderSlot(f.$slots,"empty",{key:0},void 0,!0):(r.openBlock(),r.createElementBlock("div",WN,r.toDisplayString(t.emptyText),1))],8,HN)]))])])],4))}}),[["__scopeId","data-v-322ee242"]]),UN={class:"mc-table__header",cellspacing:"0",cellpadding:"0",border:"0"},qN={key:0,width:"50"},JN=["width"],GN={key:0,class:"mc-table__selection-column"},YN={class:"mc-table__header-cell"},XN=["onClick"],QN={class:"mc-table__header-label"},ZN={key:0,class:"mc-table__sort-caret"},eB=r.defineComponent({__name:"mc-table-header",props:{columns:{},showHeader:{type:Boolean,default:!0},getSortOrder:{type:Function,default:()=>null},selectable:{type:Boolean,default:!1},isAllSelected:{type:Boolean,default:!1},isIndeterminate:{type:Boolean,default:!1}},emits:["header-click","sort-change","select-all"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref(),a=d=>{const u=[];if(d.headerClassName&&u.push(d.headerClassName),d.align&&u.push(`is-${d.align}`),d.fixed){const h=typeof d.fixed=="boolean"?"left":d.fixed;u.push(`is-fixed-${h}`)}d.sortable&&u.push("is-sortable");const p=l(d.prop);return p&&u.push(p),u},l=d=>{const u=o.getSortOrder(d);return u==="asc"?"is-sort-asc":u==="desc"?"is-sort-desc":""},c=d=>{i("select-all",d)};return e({headerWrapper:s}),(d,u)=>t.showHeader?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-table__header-wrapper",ref_key:"headerWrapper",ref:s},[r.createElementVNode("table",UN,[r.createElementVNode("colgroup",null,[t.selectable?(r.openBlock(),r.createElementBlock("col",qN)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.columns,(p,h)=>(r.openBlock(),r.createElementBlock("col",{key:h,width:p.width},null,8,JN))),128))]),r.createElementVNode("thead",null,[r.createElementVNode("tr",null,[t.selectable?(r.openBlock(),r.createElementBlock("th",GN,[r.createElementVNode("div",YN,[r.createVNode(r.unref(Wo),{"model-value":t.isAllSelected,partial:t.isIndeterminate,onChange:c},null,8,["model-value","partial"])])])):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.columns,(p,h)=>(r.openBlock(),r.createElementBlock("th",{key:h,class:r.normalizeClass(a(p)),onClick:f=>((m,g)=>{m.sortable&&i("sort-change",m),i("header-click",m,g)})(p,f)},[r.createElementVNode("div",{class:r.normalizeClass(["mc-table__header-cell",`mc-table__header-cell-${p.align}`])},[r.createElementVNode("span",QN,[r.renderSlot(d.$slots,`header-${p.slot||p.prop}`,{column:p,index:h},()=>[r.createTextVNode(r.toDisplayString(p.label),1)],!0)]),p.sortable?(r.openBlock(),r.createElementBlock("span",ZN,[t.getSortOrder(p.prop)==="asc"?(r.openBlock(),r.createBlock(Yn,{key:0,name:"Up-Chevron02",class:r.normalizeClass(["mc-table__sort-icon",{"is-active":t.getSortOrder(p.prop)==="asc"}])},null,8,["class"])):(r.openBlock(),r.createBlock(Yn,{key:1,name:"Down-Chevron02",class:r.normalizeClass(["mc-table__sort-icon",{"is-active":t.getSortOrder(p.prop)==="desc"}])},null,8,["class"]))])):r.createCommentVNode("",!0)],2)],10,XN))),128))])])])],512)):r.createCommentVNode("",!0)}}),tB=q(eB,[["__scopeId","data-v-e1129792"]]),nB={class:"mc-table__loading-content"},oB={class:"mc-table__loading-spinner"},rB={key:0,class:"mc-table__spinner mc-table__spinner--default"},iB={key:1,class:"mc-table__spinner mc-table__spinner--circle"},sB={key:2,class:"mc-table__spinner mc-table__spinner--pulse"},aB=["innerHTML"],lB={key:0,class:"mc-table__loading-text"},cB=q(r.defineComponent({__name:"mc-table-loading",props:{loading:{type:Boolean,default:!1},loadingText:{default:"Loading..."},loadingConfig:{default:()=>({spinner:"default"})}},setup(t){const e=t,n=r.computed(()=>{var i;return((i=e.loadingConfig)==null?void 0:i.text)||e.loadingText}),o=r.computed(()=>{var s;const i={};return(s=e.loadingConfig)!=null&&s.background&&(i.backgroundColor=e.loadingConfig.background),i});return(i,s)=>{var a;return t.loading?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["mc-table__loading-wrapper",["mc-table__loading-wrapper",(a=t.loadingConfig)==null?void 0:a.customClass]]),style:r.normalizeStyle(o.value)},[r.createElementVNode("div",nB,[r.renderSlot(i.$slots,"loading",{loading:t.loading,text:n.value},()=>{var l;return[r.createElementVNode("div",oB,[(l=t.loadingConfig)!=null&&l.spinner&&t.loadingConfig.spinner!=="default"?t.loadingConfig.spinner==="circle"?(r.openBlock(),r.createElementBlock("div",iB)):t.loadingConfig.spinner==="pulse"?(r.openBlock(),r.createElementBlock("div",sB)):(r.openBlock(),r.createElementBlock("div",{key:3,class:"mc-table__spinner mc-table__spinner--custom",innerHTML:t.loadingConfig.spinner},null,8,aB)):(r.openBlock(),r.createElementBlock("div",rB,[...s[0]||(s[0]=[r.createElementVNode("div",{class:"mc-table__spinner-dot"},null,-1),r.createElementVNode("div",{class:"mc-table__spinner-dot"},null,-1),r.createElementVNode("div",{class:"mc-table__spinner-dot"},null,-1),r.createElementVNode("div",{class:"mc-table__spinner-dot"},null,-1)])]))]),n.value?(r.openBlock(),r.createElementBlock("div",lB,r.toDisplayString(n.value),1)):r.createCommentVNode("",!0)]},!0)])],6)):r.createCommentVNode("",!0)}}}),[["__scopeId","data-v-82478d6d"]]),dB={key:0,class:"mc-table__pagination"},uB={class:"mc-table__pagination-info"},pB={class:"mc-table__pagination-info-number"},hB={class:"mc-table__pagination-info-number"},fB={class:"mc-table__pagination-controls"},mB=["onClick"],gB={key:1,class:"mc-table__pagination-ellipsis"},vB={class:"mc-table__pagination-size"},yB={class:"mc-table-pagination-size-group"},bB=["onClick"],kB=r.defineComponent({__name:"mc-table-pagination",props:{pagination:{}},emits:["page-change"],setup(t,{emit:e}){var h,f,m;const n=t,o=e,i=r.ref(((h=n.pagination)==null?void 0:h.currentPage)||1),s=r.ref(((f=n.pagination)==null?void 0:f.pageSize)||50),a=r.ref(((m=n.pagination)==null?void 0:m.pageSizes)||[25,50,75,100]);r.watch(()=>{var g;return(g=n.pagination)==null?void 0:g.currentPage},g=>{g!==void 0&&(i.value=g)}),r.watch(()=>{var g;return(g=n.pagination)==null?void 0:g.pageSize},g=>{g!==void 0&&(s.value=g)});const l=r.computed(()=>n.pagination?Math.ceil(n.pagination.total/s.value):1),c=r.computed(()=>n.pagination&&n.pagination.total!==0?(i.value-1)*s.value+1:0),d=r.computed(()=>{if(!n.pagination)return 0;const g=i.value*s.value;return Math.min(g,n.pagination.total)}),u=r.computed(()=>{const g=l.value,v=i.value,b=[];if(g<=7)for(let y=1;y<=g;y++)b.push(y);else if(b.push(1),v<=4){for(let y=2;y<=5;y++)b.push(y);b.push("..."),b.push(g)}else if(v>=g-3){b.push("...");for(let y=g-4;y<=g;y++)b.push(y)}else{b.push("...");for(let y=v-1;y<=v+1;y++)b.push(y);b.push("..."),b.push(g)}return b}),p=(g,v)=>{g<1||g>l.value||v||(i.value=g,o("page-change",{pageSize:s.value,pageNum:g}))};return(g,v)=>t.pagination?(r.openBlock(),r.createElementBlock("div",dB,[r.createElementVNode("div",uB,[v[4]||(v[4]=r.createTextVNode(" Showing ",-1)),r.createElementVNode("span",pB,r.toDisplayString(c.value)+"-"+r.toDisplayString(d.value),1),v[5]||(v[5]=r.createTextVNode(" of ",-1)),r.createElementVNode("span",hB,r.toDisplayString(t.pagination.total),1)]),r.createElementVNode("div",fB,[r.createVNode(Yn,{name:"First",class:r.normalizeClass({"mc-table__icon":!0,"is-disabled":i.value<=1}),size:24,onClick:v[0]||(v[0]=b=>p(1,i.value<=1))},null,8,["class"]),r.createVNode(Yn,{name:"Left-Chevron",class:r.normalizeClass({"mc-table__icon":!0,"is-disabled":i.value<=1}),size:24,onClick:v[1]||(v[1]=b=>p(i.value-1,i.value<=1))},null,8,["class"]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.value,b=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:b},[b!=="..."?(r.openBlock(),r.createElementBlock("button",{key:0,class:r.normalizeClass(["mc-table__pagination-button mc-table__pagination-button--page",{"is-active":b===i.value}]),onClick:y=>typeof b=="number"?p(b,!1):void 0},r.toDisplayString(b),11,mB)):(r.openBlock(),r.createElementBlock("span",gB,"..."))],64))),128)),r.createVNode(Yn,{name:"Right-Chevron",class:r.normalizeClass({"mc-table__icon":!0,"is-disabled":i.value>=l.value}),size:24,onClick:v[2]||(v[2]=b=>p(i.value+1,i.value>=l.value))},null,8,["class"]),r.createVNode(Yn,{name:"Last",class:r.normalizeClass({"mc-table__icon":!0,"is-disabled":i.value>=l.value}),size:24,onClick:v[3]||(v[3]=b=>p(l.value,i.value>=l.value))},null,8,["class"])]),r.createElementVNode("div",vB,[v[6]||(v[6]=r.createElementVNode("label",{class:"mc-table__pagination-size-label"},"View per page",-1)),r.createElementVNode("div",yB,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,b=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-table-pagination-size-group-item",{"is-active":b===s.value}]),key:b,onClick:y=>(k=>{s.value=k,i.value=1,o("page-change",{pageSize:s.value,pageNum:1})})(b)},r.toDisplayString(b),11,bB))),128))])])])):r.createCommentVNode("",!0)}}),wB=q(kB,[["__scopeId","data-v-0ef67136"]]);function r0(t,e,n){var l,c;const o=r.ref(((l=e.value)==null?void 0:l.currentPage)||1),i=r.ref(((c=e.value)==null?void 0:c.pageSize)||50);r.watch(()=>{var d;return(d=e.value)==null?void 0:d.currentPage},d=>{d!==void 0&&(o.value=d)}),r.watch(()=>{var d;return(d=e.value)==null?void 0:d.pageSize},d=>{d!==void 0&&(i.value=d)});const s=r.computed(()=>{if(!e.value)return t.value;const d=(o.value-1)*i.value,u=d+i.value;return n.value?t.value.slice(d,u):t.value}),a=r.computed(()=>{if(!e.value)return{currentPage:1,pageSize:t.value.length,total:t.value.length,totalPages:1};const d=e.value.total,u=Math.ceil(d/i.value);return{currentPage:o.value,pageSize:i.value,total:d,totalPages:u}});return{currentPage:o,pageSize:i,paginatedData:s,paginationInfo:a,updatePagination:function(d){o.value=d.pageNum,i.value=d.pageSize}}}function i0(t,e,n){const o=r.ref(!1),i=r.ref(null),s=r.computed(()=>o.value?t.value:t.value.map(d=>({...d,fixed:void 0})));function a(){i.value&&(o.value=i.value.scrollWidth>i.value.clientWidth)}function l(){var d,u;(d=e.value)!=null&&d.headerWrapper&&((u=n.value)!=null&&u.bodyWrapper)&&(e.value.headerWrapper.scrollLeft=n.value.bodyWrapper.scrollLeft)}function c(){r.nextTick(()=>{var d;(d=n.value)!=null&&d.bodyWrapper&&(i.value=n.value.bodyWrapper,a(),new ResizeObserver(()=>{a()}).observe(n.value.bodyWrapper),window.addEventListener("resize",a),n.value.bodyWrapper.addEventListener("scroll",l))})}return r.onMounted(()=>{c()}),{hasHorizontalScroll:o,columnsWithFixed:s,checkHorizontalScroll:a,syncHeaderScroll:l,initScrollSync:c}}function s0(t,e,n){const o=r.ref(n||null);return{sortedData:r.computed(()=>{if(!o.value||!o.value.order)return t.value;const{prop:s,order:a}=o.value,l=e.value.find(d=>d.prop===s);if(!l)return t.value;const c=[...t.value];return c.sort((d,u)=>{let p=d[s],h=u[s];if(l.sortMethod){const f=l.sortMethod(p,h);return a==="desc"?-f:f}return p==null&&(p=""),h==null&&(h=""),typeof p=="string"&&typeof h=="string"&&(p=p.toLowerCase(),h=h.toLowerCase()),p<h?a==="asc"?-1:1:p>h?a==="asc"?1:-1:0}),c}),currentSort:o,handleSort:function(s){if(!s.sortable)return;const{prop:a}=s;let l="asc";return o.value&&o.value.prop===a&&(l=o.value.order==="asc"?"desc":o.value.order==="desc"?null:"asc"),o.value=l===null?null:{prop:a,order:l},o.value},getSortOrder:function(s){return o.value&&o.value.prop===s?o.value.order:null}}}const a0=ee(q(r.defineComponent({name:"McTable",__name:"mc-table",props:{data:{},columns:{},showHeader:{type:Boolean,default:!0},height:{},maxHeight:{},rowKey:{},emptyText:{default:"No Data"},pagination:{},loading:{type:Boolean,default:!1},loadingText:{default:"Loading..."},loadingConfig:{},highlightCurrentRow:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},selectedRows:{},selectOnRowClick:{type:Boolean,default:!1},spanMethod:{},isInitTableData:{type:Boolean,default:!0},initTableData:{},isFrontPagination:{type:Boolean,default:!1},defaultSort:{}},emits:["row-click","header-click","page-change","sort-change","current-change","selection-change","select","select-all","update:selectedRows"],setup(t,{expose:e,emit:n}){const o=t,{data:i,columns:s,pagination:a,spanMethod:l,loading:c,loadingText:d,loadingConfig:u,defaultSort:p,highlightCurrentRow:h,rowKey:f,selectable:m,selectedRows:g,selectOnRowClick:v,isFrontPagination:b}=r.toRefs(o),y=r.useSlots(),k=r.computed(()=>Object.keys(y)),x=r.ref(i.value),w=n,C=r.ref(),S=r.ref(),E=r.ref(),{columnsWithFixed:M}=i0(s,S,E),{sortedData:N,handleSort:T,getSortOrder:D}=s0(x,M,p==null?void 0:p.value),{paginatedData:$,updatePagination:B}=r0(N,a,b),V=r.computed(()=>$.value),{internalSelectedRows:O,isAllSelected:A,isIndeterminate:F,toggleRowSelection:R,toggleAllSelection:L,clearSelection:I,getSelectedRows:P}=function(X,oe,ae){const se=r.ref((ae==null?void 0:ae.value)||[]);r.watch(ae,de=>{de&&(se.value=[...de])},{deep:!0,immediate:!0});const be=de=>se.value.some(me=>oe.value?me[oe.value]===de[oe.value]:me===de),Fe=()=>X.value.filter(de=>be(de)).length,Me=r.computed(()=>!!X.value.length&&X.value.every(de=>be(de))),Ne=r.computed(()=>{if(!X.value.length)return!1;const de=Fe();return de>0&&de<X.value.length});return{internalSelectedRows:se,isRowSelected:be,isAllSelected:Me,isIndeterminate:Ne,toggleRowSelection:(de,me)=>{const at=me!==void 0?me:!be(de);if(at)be(de)||se.value.push(de);else{const Le=se.value.findIndex(_e=>oe.value?_e[oe.value]===de[oe.value]:_e===de);Le>-1&&se.value.splice(Le,1)}return at},toggleAllSelection:de=>{de?X.value.forEach(me=>{be(me)||se.value.push(me)}):X.value.forEach(me=>{const at=se.value.findIndex(Le=>oe.value?Le[oe.value]===me[oe.value]:Le===me);at>-1&&se.value.splice(at,1)})},clearSelection:()=>{se.value=[]},getSelectedRows:()=>[...se.value],getCurrentPageSelectionInfo:()=>{const de=X.value.length,me=Fe();return{totalCount:de,selectedCount:me,isAllSelected:de>0&&me===de,isIndeterminate:me>0&&me<de}}}}(V,f,g),{setCurrentRow:W,getRowClass:z}=function(X){const oe=r.ref(null);return{currentRow:oe,setCurrentRow:ae=>(oe.value=ae,oe.value),getRowClass:ae=>{const se=[];return X.value&&oe.value===ae&&se.push("is-current"),se},clearCurrentRow:()=>{oe.value=null}}}(h);r.watch(()=>i.value,X=>{x.value=X},{deep:!0,immediate:!0});const j=(X,oe)=>{if(h.value){const ae=W(X);w("current-change",ae)}if(m.value&&v.value){const ae=R(X);te(X,ae)}w("row-click",X,oe)},K=(X,oe)=>{w("header-click",X,oe)},G=X=>{const oe=T(X);oe&&w("sort-change",oe)},Z=(X,oe)=>{const ae=R(X,oe);te(X,ae)},J=X=>{L(X),te(null,X)},Y=async X=>{B(X),r.nextTick(()=>{var oe;(oe=E.value)!=null&&oe.bodyWrapper&&(E.value.bodyWrapper.scrollTop=0)}),w("page-change",X),await pe()},te=(X,oe)=>{w("update:selectedRows",[...O.value]),w("selection-change",[...O.value]),X?w("select",X,oe):w("select-all",oe)},pe=async()=>{if(o.isInitTableData&&o.initTableData&&typeof o.initTableData=="function"){const{data:X,total:oe}=await o.initTableData({pageSize:a.value.pageSize||10,pageNum:a.value.currentPage||1});x.value=X,a.value.total=oe}};return r.onMounted(()=>{pe()}),e({ref:C,clearSort:()=>{s.value.forEach(X=>{X.sortable&&(X.sortOrder=null)})},toggleRowSelection:(X,oe)=>{const ae=R(X,oe);te(X,ae)},refresh:async()=>{a.value.currentPage=1,await pe()},toggleAllSelection:X=>{L(X),te(null,X)},clearSelection:()=>{I(),w("update:selectedRows",[]),w("selection-change",[])},getSelectedRows:P}),(X,oe)=>{var ae;return r.openBlock(),r.createElementBlock("div",{ref_key:"_ref",ref:C,class:r.normalizeClass(["mc-table",{"mc-table--loading":r.unref(c)}])},[r.createVNode(tB,{ref_key:"headerRef",ref:S,columns:r.unref(M),"show-header":t.showHeader,"get-sort-order":r.unref(D),selectable:r.unref(m),"is-all-selected":r.unref(A),"is-indeterminate":r.unref(F),onHeaderClick:K,onSortChange:G,onSelectAll:J},r.createSlots({_:2},[r.renderList(k.value,se=>({name:se,fn:r.withCtx(be=>[r.renderSlot(X.$slots,se,r.normalizeProps(r.guardReactiveProps(be)),void 0,!0)])}))]),1032,["columns","show-header","get-sort-order","selectable","is-all-selected","is-indeterminate"]),r.createVNode(KN,{ref_key:"bodyRef",ref:E,data:V.value,columns:r.unref(M),"row-key":r.unref(f),"empty-text":t.emptyText,height:t.height,"max-height":t.maxHeight,"span-method":r.unref(l),pagination:r.unref(a),"get-row-class":r.unref(z),selectable:r.unref(m),"selected-rows":r.unref(O),"select-on-row-click":r.unref(v),onRowClick:j,onSelect:Z},r.createSlots({_:2},[r.renderList(k.value,se=>({name:se,fn:r.withCtx(be=>[r.renderSlot(X.$slots,se,r.normalizeProps(r.guardReactiveProps(be)),void 0,!0)])}))]),1032,["data","columns","row-key","empty-text","height","max-height","span-method","pagination","get-row-class","selectable","selected-rows","select-on-row-click"]),r.unref(a)&&((ae=r.unref(a))==null?void 0:ae.total)>0?(r.openBlock(),r.createBlock(wB,{key:0,pagination:r.unref(a),onPageChange:Y},null,8,["pagination"])):r.createCommentVNode("",!0),r.createVNode(cB,{class:"mc-table__loading",loading:r.unref(c),"loading-text":r.unref(d),"loading-config":r.unref(u)},{loading:r.withCtx(se=>[r.renderSlot(X.$slots,"loading",r.normalizeProps(r.guardReactiveProps(se)),void 0,!0)]),_:3},8,["loading","loading-text","loading-config"])],2)}}}),[["__scopeId","data-v-6db2a64d"]])),l0="mc-table-plus",c0="mc-table-header",d0="mc-table-sort",u0="mc-table-body",p0="mc-table-row",h0="mc-table-cell",f0="mc-table-empty",m0="mc-table-loading",g0="mc-table-scroll",v0="mc-table-footer",y0="mc-table-total",b0="mc-page-size",k0="mc-table-pagination",w0="mc-table-pagination-item",x0="mc-table-ellipsis",pr={fixed:"none",sortable:!1,columnAlign:"left",rowAlign:"center",sortType:"string"},Jd=Symbol("mc-table-context"),Hn=()=>{const t=r.inject(Jd,void 0);return{tableCtx:t,data:t.data,tableWidth:t.tableWidth,isLoading:r.computed(()=>!!t.isLoading.value),columnWidth:t.columnWidth,leftColumns:t.leftColumns,rightColumns:t.rightColumns,centerColumns:t.centerColumns,scroll:t.scroll,setScroll:t.setScroll,pagination:t.pagination,handlePagination:t.handlePagination,doSort:t.handleSort,isExpanded:t.isExpanded,getExpandData:t.getExpandData,setExpandData:t.setExpandData,removeExpandData:t.removeExpandData,getCurrentSort:t.getCurrentSort,expandCondition:t.expandCondition,fetchExpandData:t.fetchExpandData,leftWidth:t.leftWidth,rightWidth:t.rightWidth,centerWidth:t.centerWidth,viewWidth:t.viewWidth}},Gd={pageNum:1,pageSize:25,total:1,pageSizes:[25,50,75,100]},Yd="mc-table-column-plus",xB={class:"mc-table-column"},C0=ee(r.defineComponent({name:Yd,__name:"mc-table-column-plus",props:{prop:{},label:{},desc:{},width:{},fixed:{},sortable:{type:Boolean},columnAlign:{},rowAlign:{},sortType:{type:[String,Function]},defaultValue:{type:[String,Number,Boolean]}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",xB))})),CB=(t=nt)=>{switch(t){case"left":return"flex-start";case"center":return"center";case"right":return"flex-end"}},SB={key:0,class:"mc-table-row-tr mc-table-row-left"},EB={class:"mc-table-row-center-content"},MB={key:3,class:"mc-table-row-tr mc-table-row-right"},NB=r.defineComponent({name:p0,__name:"mc-table-row",props:{type:{default:"body"},leftColumns:{default:()=>[]},rightColumns:{default:()=>[]},centerColumns:{default:()=>[]}},setup(t){const e=t,n=r.ref(),{scroll:o,setScroll:i,leftWidth:s,rightWidth:a,centerWidth:l,viewWidth:c}=Hn();r.onMounted(()=>{p(o.value)}),r.watch(()=>o.value,h=>{p(h)});const d=r.computed(()=>e.rightColumns.length>0&&o.value>0),u=r.computed(()=>{const h=Fi(c.value)+Fi(o.value)+5<Fi(l.value);return e.leftColumns.length>0&&h}),p=h=>{n.value&&n.value.scrollTo({left:h})};return ji(n,"scroll",h=>{const f=h.target.scrollLeft||0;i(f)}),(h,f)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-table-row",[`mc-table-row-${t.type}`]])},[t.leftColumns.length?(r.openBlock(),r.createElementBlock("tr",SB,[r.renderSlot(h.$slots,"left",{columns:t.leftColumns},void 0,!0)])):r.createCommentVNode("",!0),d.value?(r.openBlock(),r.createElementBlock("div",{key:1,class:"mc-table-border mc-table-row-left-border",style:r.normalizeStyle({left:r.unref(dl)(r.unref(s))})},null,4)):r.createCommentVNode("",!0),r.createElementVNode("div",{ref_key:"rowRef",ref:n,class:"mc-table-row-tr mc-table-row-center"},[r.createElementVNode("div",EB,[r.renderSlot(h.$slots,"default",{columns:t.centerColumns},void 0,!0)])],512),u.value?(r.openBlock(),r.createElementBlock("div",{key:2,class:"mc-table-border mc-table-row-right-border",style:r.normalizeStyle({right:r.unref(dl)(r.unref(a))})},null,4)):r.createCommentVNode("",!0),t.rightColumns.length?(r.openBlock(),r.createElementBlock("tr",MB,[r.renderSlot(h.$slots,"right",{columns:t.rightColumns},void 0,!0)])):r.createCommentVNode("",!0)],2))}}),Xd=q(NB,[["__scopeId","data-v-d6e829ca"]]),BB=q(r.defineComponent({name:d0,__name:"mc-table-sort",props:{sort:{default:"normal"}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-table-sort",`mc-table-sort-${t.sort}`])},[r.createVNode(r.unref(ge),{name:"Up-Chevron02",class:r.normalizeClass({"mc-table-sort-actived":t.sort==="asc"}),style:{height:"8px"}},null,8,["class"]),r.createVNode(r.unref(ge),{name:"Down-Chevron02",class:r.normalizeClass({"mc-table-sort-actived":t.sort==="desc"}),style:{height:"8px"}},null,8,["class"])],2))}),[["__scopeId","data-v-d2a14a84"]]),TB={class:"mc-table-header-cell-title"},OB={class:"mc-table-header-cell-title-text"},_B={key:0,class:"mc-table-header-cell-sort"},VB={class:"mc-table-header-cell-desc"},AB={class:"mc-table-body-cell-value"},mn=q(r.defineComponent({name:h0,__name:"mc-table-cell",props:{column:{},width:{},type:{default:"body"},row:{},rowIndex:{}},setup(t){const e=r.ref(),{isHeader:n,isExpand:o,isExpandIcon:i,cellStyle:s,headerCtx:a,bodyCtx:l,expandIconCtx:c}=(d=>{var $;const{columnWidth:u,doSort:p,isExpanded:h,setExpandData:f,removeExpandData:m,getCurrentSort:g,expandCondition:v,fetchExpandData:b}=Hn(),y=ue("column"),k=ue("type"),x=ue("width"),w=r.computed(()=>k.value==="header"),C=r.computed(()=>k.value==="body"),S=r.computed(()=>k.value==="expand"),E=r.computed(()=>k.value==="expand-icon"),M=r.computed(()=>{var O,A;const B=x.value?`${x.value}px`:u!=null&&u.value?`${u.value}px`:"auto";let V="default";return w.value&&((O=y==null?void 0:y.value)!=null&&O.sortable)&&(V="pointer"),{width:B,cursor:V,alignItems:E.value?"center":CB((A=y==null?void 0:y.value)==null?void 0:A.columnAlign)}});let N={},T={},D={};if(w.value){const B=r.computed(()=>{var V;return He(g)?g(((V=y==null?void 0:y.value)==null?void 0:V.prop)||""):"normal"});if(($=y==null?void 0:y.value)!=null&&$.sortable){const V=Io(()=>{var O;p(((O=y==null?void 0:y.value)==null?void 0:O.prop)||"",(A=>{switch(A){case"normal":return"desc";case"desc":return"asc";default:return"normal"}})(B.value))},500);ji(d,"click",V)}N={currentSort:B}}else if(E.value){const B=ue("row"),V=ue("rowIndex"),O=r.computed(()=>!He(v)||r.unref(v(B==null?void 0:B.value))),A=r.computed(()=>{const R=V==null?void 0:V.value;return!ye(R)&&h(R)}),F=Io(async()=>{if(ye(V==null?void 0:V.value))return;let R=[];He(b)&&!A.value?(R=r.unref(await b(B==null?void 0:B.value)),f(V.value,R)):m(V.value)},500);r.watchEffect(()=>{var R,L;O.value?(R=d.value)==null||R.addEventListener("click",F):(L=d.value)==null||L.removeEventListener("click",F)}),r.onBeforeMount(()=>{var R;(R=d.value)==null||R.removeEventListener("click",F)}),D={allowExpand:O,isExpanded:A}}else if(C.value){const B=ue("row");T={displayValue:r.computed(()=>{var A,F;const V=((A=y==null?void 0:y.value)==null?void 0:A.defaultValue)||"--",O=(F=y==null?void 0:y.value)==null?void 0:F.prop;return ye(O)||ye(B==null?void 0:B.value)||ye(B.value[O])?V:B.value[O]})}}return{isHeader:w,isBody:C,isExpand:S,isExpandIcon:E,cellStyle:M,headerCtx:N,bodyCtx:T,expandIconCtx:D}})(e);return(d,u)=>r.unref(n)?(r.openBlock(),r.createElementBlock("th",{key:0,ref_key:"cellRef",ref:e,class:r.normalizeClass(`mc-table-${t.type}-cell`),style:r.normalizeStyle(r.unref(s))},[r.renderSlot(d.$slots,"header",{},()=>{var p;return[r.createElementVNode("div",TB,[r.createElementVNode("div",OB,[r.renderSlot(d.$slots,"title",{},()=>[r.createTextVNode(r.toDisplayString(t.column.label),1)],!0)]),t.column.sortable?(r.openBlock(),r.createElementBlock("div",_B,[r.createVNode(BB,{sort:(p=r.unref(a).currentSort)==null?void 0:p.value},null,8,["sort"])])):r.createCommentVNode("",!0)]),t.column.desc||d.$slots.desc?r.renderSlot(d.$slots,"desc",{key:0},()=>[r.createElementVNode("div",VB,r.toDisplayString(t.column.desc),1)],!0):r.createCommentVNode("",!0)]},!0)],6)):r.unref(o)?(r.openBlock(),r.createElementBlock("td",{key:1,ref_key:"cellRef",ref:e,class:r.normalizeClass(`mc-table-${t.type}-cell`),style:r.normalizeStyle(r.unref(s))},[r.renderSlot(d.$slots,"default",{},void 0,!0)],6)):r.unref(i)?(r.openBlock(),r.createElementBlock("td",{key:2,ref_key:"cellRef",ref:e,class:r.normalizeClass(`mc-table-${t.type}-cell`),style:r.normalizeStyle(r.unref(s))},[r.renderSlot(d.$slots,"default",{},()=>{var p,h,f;return[(p=r.unref(c).allowExpand)!=null&&p.value?(r.openBlock(),r.createBlock(r.unref(Ee),{key:0,class:r.normalizeClass(["mc-table-expand-icon",{"mc-table-expand-icon-active":(h=r.unref(c).isExpanded)==null?void 0:h.value}]),cursor:(f=r.unref(c).allowExpand)!=null&&f.value?"pointer":"default",name:"down-chevron"},null,8,["class","cursor"])):r.createCommentVNode("",!0)]},!0)],6)):(r.openBlock(),r.createElementBlock("td",{key:3,ref_key:"cellRef",ref:e,class:r.normalizeClass([`mc-table-${t.type}-cell`,`mc-table-${t.type}-cell-row-align-${t.column.rowAlign}`]),style:r.normalizeStyle(r.unref(s))},[r.renderSlot(d.$slots,"default",{},()=>{var p;return[r.createElementVNode("span",AB,r.toDisplayString((p=r.unref(l).displayValue)==null?void 0:p.value),1)]},!0)],6))}}),[["__scopeId","data-v-70b5f5c7"]]),DB={class:"mc-table-header"},IB={class:"mc-table-header-thead"},RB=q(r.defineComponent({name:c0,__name:"mc-table-header",setup(t){const{leftColumns:e,rightColumns:n,centerColumns:o}=Hn();return(i,s)=>(r.openBlock(),r.createElementBlock("table",DB,[r.createElementVNode("thead",IB,[r.createVNode(Xd,{type:"header","left-columns":r.unref(e),"right-columns":r.unref(n),"center-columns":r.unref(o)},{left:r.withCtx(({columns:a})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a,l=>(r.openBlock(),r.createBlock(mn,{key:l.prop,column:l,width:l.width,type:"header"},r.createSlots({_:2},[l.header?{name:"header",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.header)))]),key:"0"}:void 0,l.headerTitle?{name:"title",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerTitle)))]),key:"1"}:void 0,l.headerDesc?{name:"desc",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerDesc)))]),key:"2"}:void 0]),1032,["column","width"]))),128))]),default:r.withCtx(({columns:a})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a,l=>(r.openBlock(),r.createBlock(mn,{key:l.prop,column:l,width:l.width,type:"header"},r.createSlots({_:2},[l.header?{name:"header",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.header)))]),key:"0"}:void 0,l.headerTitle?{name:"title",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerTitle)))]),key:"1"}:void 0,l.headerDesc?{name:"desc",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerDesc)))]),key:"2"}:void 0]),1032,["column","width"]))),128))]),right:r.withCtx(({columns:a})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a,l=>(r.openBlock(),r.createBlock(mn,{key:l.prop,column:l,width:l.width,type:"header"},r.createSlots({_:2},[l.header?{name:"header",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.header)))]),key:"0"}:void 0,l.headerTitle?{name:"title",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerTitle)))]),key:"1"}:void 0,l.headerDesc?{name:"desc",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerDesc)))]),key:"2"}:void 0]),1032,["column","width"]))),128))]),_:1},8,["left-columns","right-columns","center-columns"])])]))}}),[["__scopeId","data-v-d527354e"]]),LB={key:0,class:"mc-table-total"},$B={class:"mc-table-total-number"},PB={class:"mc-table-total-number"},zB=q(r.defineComponent({name:y0,__name:"mc-table-total",setup(t){const{pagination:e}=Hn(),n=r.computed(()=>{if(!e)return;const{pageNum:o,pageSize:i,total:s}=e;return{range:`${(o-1)*i+1}-${Math.min(o*i,s)}`,total:s}});return(o,i)=>n.value?(r.openBlock(),r.createElementBlock("div",LB,[i[0]||(i[0]=r.createElementVNode("span",null,"Showing",-1)),r.createElementVNode("span",$B,r.toDisplayString(n.value.range),1),i[1]||(i[1]=r.createElementVNode("span",null,"of",-1)),r.createElementVNode("span",PB,r.toDisplayString(n.value.total),1)])):r.createCommentVNode("",!0)}}),[["__scopeId","data-v-c15a3cd2"]]),FB={class:"mc-table-ellipsis"},jB=q(r.defineComponent({name:x0,__name:"mc-table-ellipsis",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",FB,[...n[0]||(n[0]=[r.createElementVNode("i",{class:"mc-table-ellipsis-dot"},null,-1),r.createElementVNode("i",{class:"mc-table-ellipsis-dot"},null,-1),r.createElementVNode("i",{class:"mc-table-ellipsis-dot"},null,-1)])]))}),[["__scopeId","data-v-ba28fc7a"]]),gn=q(r.defineComponent({name:w0,__name:"mc-table-pagination-item",props:{type:{default:"page"},value:{default:1},isActive:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>{switch(e.type){case"page":return"mc-table-pagination-item-page";case"prev":return"mc-table-pagination-item-prev";case"next":return"mc-table-pagination-item-next";case"first":return"mc-table-pagination-item-first";case"last":return"mc-table-pagination-item-last";case"ellipsis":return"mc-table-pagination-item-ellipsis";default:return"mc-table-pagination-item"}});return(o,i)=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-table-pagination-item",[{"mc-table-pagination-item-active":t.isActive,"mc-table-pagination-item-disabled":t.isDisabled},n.value]])},[t.type==="page"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createTextVNode(r.toDisplayString(t.value),1)],64)):t.type==="prev"?(r.openBlock(),r.createBlock(r.unref(ge),{key:1,name:"Left-Chevron"})):t.type==="next"?(r.openBlock(),r.createBlock(r.unref(ge),{key:2,name:"Right-Chevron"})):t.type==="first"?(r.openBlock(),r.createBlock(r.unref(ge),{key:3,name:"First"})):t.type==="last"?(r.openBlock(),r.createBlock(r.unref(ge),{key:4,name:"Last"})):t.type==="ellipsis"?(r.openBlock(),r.createBlock(jB,{key:5})):r.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-29751a1d"]]),HB={key:0,class:"mc-table-pagination"},WB=r.defineComponent({name:k0,__name:"mc-table-pagination",setup(t){const{pagination:e,isLoading:n,handlePagination:o}=Hn(),i=r.computed(()=>e?Math.ceil(e.total/e.pageSize):0),s=r.computed(()=>{if(!e||i.value<=1)return[];const h=[];if(i.value<=5)for(let f=2;f<i.value;f++)h.push(f);else e.pageNum<=2?h.push(2,3,4,5):e.pageNum>=i.value-1?h.push(i.value-4,i.value-3,i.value-2,i.value-1):h.push(e.pageNum-1,e.pageNum,e.pageNum+1);return h}),a=r.computed(()=>!e||e.pageNum<=1),l=r.computed(()=>!e||e.pageNum>=i.value),c=r.computed(()=>!e||i.value<=1),d=r.computed(()=>!!e&&i.value>5&&e.pageNum>2),u=r.computed(()=>!!e&&i.value>5&&e.pageNum<i.value-1),p=h=>{He(o)&&!n.value&&(h==="first"?a.value||o({pageNum:1}):h==="prev"?e&&e.pageNum>1&&!a.value&&o({pageNum:e.pageNum-1}):h==="next"?e&&e.pageNum<i.value&&!l.value&&o({pageNum:e.pageNum+1}):h==="last"?l.value||o({pageNum:i.value}):h!==(e==null?void 0:e.pageNum)&&o({pageNum:h}))};return(h,f)=>{var m,g;return c.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("ul",HB,[r.createVNode(gn,{type:"first","is-disabled":a.value,onClick:f[0]||(f[0]=v=>p("first"))},null,8,["is-disabled"]),r.createVNode(gn,{type:"prev","is-disabled":a.value,onClick:f[1]||(f[1]=v=>p("prev"))},null,8,["is-disabled"]),r.createVNode(gn,{value:1,"is-active":((m=r.unref(e))==null?void 0:m.pageNum)===1,onClick:f[2]||(f[2]=v=>p(1))},null,8,["is-active"]),d.value?(r.openBlock(),r.createBlock(gn,{key:0,type:"ellipsis"})):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,v=>{var b;return r.openBlock(),r.createBlock(gn,{key:v,value:v,"is-active":((b=r.unref(e))==null?void 0:b.pageNum)===v,onClick:y=>p(v)},null,8,["value","is-active","onClick"])}),128)),u.value?(r.openBlock(),r.createBlock(gn,{key:1,type:"ellipsis"})):r.createCommentVNode("",!0),r.createVNode(gn,{value:i.value,"is-active":((g=r.unref(e))==null?void 0:g.pageNum)===i.value,onClick:f[3]||(f[3]=v=>p(i.value))},null,8,["value","is-active"]),r.createVNode(gn,{type:"next","is-disabled":l.value,onClick:f[4]||(f[4]=v=>p("next"))},null,8,["is-disabled"]),r.createVNode(gn,{type:"last","is-disabled":l.value,onClick:f[5]||(f[5]=v=>p("last"))},null,8,["is-disabled"])]))}}}),KB=q(WB,[["__scopeId","data-v-834130e0"]]),UB={class:"mc-table-page-size"},qB={class:"mc-table-page-size-group"},JB=["onClick"],GB=q(r.defineComponent({name:b0,__name:"mc-table-page-size",setup(t){const{pagination:e,isLoading:n,handlePagination:o}=Hn();return(i,s)=>{var a;return r.openBlock(),r.createElementBlock("div",UB,[s[0]||(s[0]=r.createElementVNode("span",{class:"mc-table-page-size-text"},"View per page",-1)),r.createElementVNode("ul",qB,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList((a=r.unref(e))==null?void 0:a.pageSizes,l=>{var c;return r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-table-page-size-group-item",{"mc-table-page-size-group-item-active":l===((c=r.unref(e))==null?void 0:c.pageSize)}]),key:l,onClick:d=>(u=>{He(o)&&!n.value&&o({pageSize:u,pageNum:1})})(l)},r.toDisplayString(l),11,JB)}),128))])])}}}),[["__scopeId","data-v-ff7678cb"]]),YB={class:"mc-table-footer"},XB=q(r.defineComponent({name:v0,__name:"mc-table-footer",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",YB,[r.createVNode(zB),r.createVNode(KB),r.createVNode(GB)]))}),[["__scopeId","data-v-3cb93fac"]]),QB={class:"mc-table-loading"},ZB=q(r.defineComponent({name:m0,__name:"mc-table-loading",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",QB,[r.renderSlot(e.$slots,"default",{},()=>[r.createVNode(r.unref(Pl),{loading:!0,type:"pulse",size:"small"})],!0)]))}),[["__scopeId","data-v-09b278cb"]]),eT={class:"mc-table-body"},tT={class:"mc-table-body-tbody"},nT=q(r.defineComponent({name:u0,__name:"mc-table-body",props:{loading:{type:Boolean,default:!1}},setup(t){const{data:e,leftColumns:n,rightColumns:o,centerColumns:i,isExpanded:s,getExpandData:a}=Hn();return(l,c)=>(r.openBlock(),r.createElementBlock("table",eT,[r.createElementVNode("tbody",tT,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(e),(d,u)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:u},[r.createVNode(Xd,{"left-columns":r.unref(n),"right-columns":r.unref(o),"center-columns":r.unref(i)},{left:r.withCtx(({columns:p})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p,h=>(r.openBlock(),r.createBlock(mn,{key:h.prop,column:h,row:d,rowIndex:u,width:h.width,type:h.isExpand?"expand-icon":"body"},r.createSlots({_:2},[h.tableValue?{name:"default",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(h.tableValue),{value:d==null?void 0:d[h.prop],row:d,rowIndex:u},null,8,["value","row","rowIndex"]))]),key:"0"}:void 0]),1032,["column","row","rowIndex","width","type"]))),128))]),default:r.withCtx(({columns:p})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p,h=>(r.openBlock(),r.createBlock(mn,{key:h.prop,column:h,row:d,rowIndex:u,width:h.width,type:h.isExpand?"expand-icon":"body"},r.createSlots({_:2},[h.tableValue?{name:"default",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(h.tableValue),{value:d==null?void 0:d[h.prop],row:d,rowIndex:u},null,8,["value","row","rowIndex"]))]),key:"0"}:void 0]),1032,["column","row","rowIndex","width","type"]))),128))]),right:r.withCtx(({columns:p})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p,h=>(r.openBlock(),r.createBlock(mn,{key:h.prop,column:h,row:d,rowIndex:u,width:h.width,type:h.isExpand?"expand-icon":"body"},r.createSlots({_:2},[h.tableValue?{name:"default",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(h.tableValue),{value:d==null?void 0:d[h.prop],row:d,rowIndex:u},null,8,["value","row","rowIndex"]))]),key:"0"}:void 0]),1032,["column","row","rowIndex","width","type"]))),128))]),_:2},1032,["left-columns","right-columns","center-columns"]),r.unref(s)(u)?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(a)(u),(p,h)=>(r.openBlock(),r.createBlock(Xd,{key:h,"left-columns":r.unref(n),"right-columns":r.unref(o),"center-columns":r.unref(i),type:"expand"},{left:r.withCtx(({columns:f})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f,m=>(r.openBlock(),r.createBlock(mn,{key:m.prop,column:m,width:m.width,type:"expand"},{default:r.withCtx(()=>[m.expand?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.expand),{key:0,expandRow:p,expandRowIndex:h},null,8,["expandRow","expandRowIndex"])):r.createCommentVNode("",!0)]),_:2},1032,["column","width"]))),128))]),default:r.withCtx(({columns:f})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f,m=>(r.openBlock(),r.createBlock(mn,{key:m.prop,column:m,width:m.width,type:"expand"},{default:r.withCtx(()=>[m.expand?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.expand),{key:0,expandRow:p,expandRowIndex:h},null,8,["expandRow","expandRowIndex"])):r.createCommentVNode("",!0)]),_:2},1032,["column","width"]))),128))]),right:r.withCtx(({columns:f})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f,m=>(r.openBlock(),r.createBlock(mn,{key:m.prop,column:m,width:m.width,type:"expand"},{default:r.withCtx(()=>[m.expand?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.expand),{key:0,expandRow:p,expandRowIndex:h},null,8,["expandRow","expandRowIndex"])):r.createCommentVNode("",!0)]),_:2},1032,["column","width"]))),128))]),_:2},1032,["left-columns","right-columns","center-columns"]))),128)):r.createCommentVNode("",!0)],64))),128))]),t.loading?(r.openBlock(),r.createBlock(ZB,{key:0},{default:r.withCtx(()=>[r.renderSlot(l.$slots,"loading",{},void 0,!0)]),_:3})):r.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-41def2b7"]]),oT={class:"mc-table-empty"},rT=q(r.defineComponent({name:f0,__name:"mc-table-empty",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",oT,[r.renderSlot(e.$slots,"default",{},()=>[n[0]||(n[0]=r.createElementVNode("p",{class:"mc-table-empty-content"},"No available data",-1))],!0)]))}),[["__scopeId","data-v-6e5712f5"]]),iT=r.defineComponent({name:g0,__name:"mc-table-scroll",setup(t){const{scroll:e,centerWidth:n,viewWidth:o,tableWidth:i,setScroll:s}=Hn(),a=r.ref(),l=r.ref(),c=r.computed(()=>Uu(o.value/n.value*100)),d=r.computed(()=>Fi(c.value)<=95),u=r.computed(()=>`${c.value}%`),p=r.ref(0);r.watchEffect(()=>{p.value=n.value?e.value*i.value/n.value:0});let h=0,f=0;const m=y=>{a.value&&(h=y.clientX,f=p.value,window.addEventListener("mousemove",g),window.addEventListener("mouseup",v))},g=y=>{var S,E;let k=y.clientX-h+f;k<0&&(k=0);const x=((E=(S=l.value)==null?void 0:S.getBoundingClientRect())==null?void 0:E.width)||0,w=i.value-x+2;k>w&&(k=w),p.value=k;const C=p.value*n.value/i.value;s(C)},v=()=>{b()},b=()=>{window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",v)};return r.onBeforeUnmount(()=>{b()}),(y,k)=>d.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:a,class:"mc-table-scroll",onMousedown:m},[r.createElementVNode("div",{ref_key:"thumbRef",ref:l,class:"mc-table-scroll-thumb",style:r.normalizeStyle({width:u.value,transform:`translateX(${r.unref(dl)(p.value)})`})},null,4)],544)):r.createCommentVNode("",!0)}}),sT=q(iT,[["__scopeId","data-v-a80497f3"]]),aT=r.defineComponent({name:l0,__name:"mc-table-plus",props:{data:{default:()=>[]},loading:{type:Boolean,default:!1},sortType:{default:"back"},pagination:{},width:{default:"100%"},height:{},expandCondition:{},fetchExpandData:{}},emits:["change:sort","change:pagination","change:expand"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(),{width:s,height:a}=lt(),l=r.ref(n.data),{columns:c,leftColumns:d,centerColumns:u,rightColumns:p,tableWidth:h,columnWidth:f}=(R=>{const L=r.ref([]),I=r.ref([]),P=r.ref([]),W=r.ref([]),z=r.ref(0),j=r.reactive({tableWidth:0,fixedWidth:0,restColumns:0}),K=r.useSlots();r.watch(()=>{var Z;return(Z=K.default)==null?void 0:Z.call(K)},()=>{var X;const{columns:Z,columnWidthInfo:J,leftColumns:Y,centerColumns:te,rightColumns:pe}=(oe=>{const ae=[],se=[],be=[],Fe=[],Me={tableWidth:0,fixedWidth:0,restColumns:0},Ne=de=>{ce(de)&&de.forEach(me=>{var Le;if(((Le=(me==null?void 0:me.type)||{})==null?void 0:Le.name)===Yd){const _e=me.children,ie=me.props,Wn=Do(ie==null?void 0:ie.sortable)&&ie.sortable===""||(ie==null?void 0:ie.sortable)||pr.sortable,Qt={prop:ie==null?void 0:ie.prop,label:ie==null?void 0:ie.label,desc:ie==null?void 0:ie.desc,width:(ie==null?void 0:ie.prop)==="expand"?40:ie==null?void 0:ie.width,fixed:(ie==null?void 0:ie.fixed)||pr.fixed,defaultValue:ie==null?void 0:ie.defaultValue,sortable:Wn,isExpand:(ie==null?void 0:ie.prop)==="expand",sortType:(ie==null?void 0:ie.sortType)||(ie==null?void 0:ie["sort-type"])||pr.sortType,columnAlign:(ie==null?void 0:ie.columnAlign)||(ie==null?void 0:ie["column-align"])||pr.columnAlign,rowAlign:(ie==null?void 0:ie.rowAlign)||(ie==null?void 0:ie["row-align"])||pr.rowAlign,headerTitle:_e==null?void 0:_e["header-title"],headerDesc:_e==null?void 0:_e["header-desc"],header:_e==null?void 0:_e.header,expand:_e==null?void 0:_e.expand,tableValue:_e==null?void 0:_e.default};Qt.width?Me.fixedWidth+=Qt.width:Me.restColumns+=1,Qt.fixed==="left"?se.push(Qt):Qt.fixed==="right"?Fe.push(Qt):be.push(Qt),ae.push(Qt)}else Array.isArray(me.children)&&Ne(me.children)})};return Ne(oe),{columns:ae,columnWidthInfo:Me,leftColumns:se,centerColumns:be,rightColumns:Fe}})((X=K.default)==null?void 0:X.call(K));L.value=Z,j.fixedWidth=J.fixedWidth,j.restColumns=J.restColumns,I.value=Y,P.value=te,W.value=pe},{immediate:!0}),$p(R,({width:Z})=>{let J=Z;I.value.length>0&&(J-=1),W.value.length>0&&(J-=1),z.value=J});const G=r.computed(()=>{const Z=(z.value-j.fixedWidth)/j.restColumns;return Z<=0?240:Z});return{columns:L,leftColumns:I,centerColumns:P,rightColumns:W,tableWidth:z,columnWidth:G}})(i),{scroll:m,setScroll:g,resetScroll:v}=(()=>{const R=r.ref(0);return{scroll:R,setScroll:L=>{R.value=L},resetScroll:()=>{R.value=0}}})(),{setSort:b,resetSort:y,getCurrentSort:k,sortData:x}=(()=>{const R=r.ref({sort:"normal",sortColumn:""}),L=(P,W)=>{R.value={sort:W,sortColumn:P}},I=P=>R.value.sortColumn===P?R.value.sort:"normal";return{sortInfo:R,setSort:L,resetSort:()=>L("","normal"),getCurrentSort:I,sortData:(P,W)=>{let z=[...P];const j=W.prop,K=I(j),G=W.sortType||"string";return K!=="normal"&&(He(G)||(J=G==="number"?te=>Number(te[j]):[j],Y=[K],z=(Z=z)==null?[]:(ce(J)||(J=J==null?[]:[J]),ce(Y)||(Y=Y==null?[]:[Y]),function(te,pe,X){pe=pe.length?So(pe,function(ae){return ce(ae)?function(se){return Ga(se,ae.length===1?ae[0]:ae)}:ae}):[Eo];var oe=-1;return pe=So(pe,Ti(yn)),function(ae){var se=ae.length;for(ae.sort(function(be,Fe){return function(Me,Ne,de){for(var me=-1,at=Me.criteria,Le=Ne.criteria,_e=at.length,ie=de.length;++me<_e;){var Wn=ak(at[me],Le[me]);if(Wn)return me>=ie?Wn:Wn*(de[me]=="desc"?-1:1)}return Me.index-Ne.index}(be,Fe,X)});se--;)ae[se]=ae[se].value;return ae}(Mp(te,function(ae,se,be){return{criteria:So(pe,function(Fe){return Fe(ae)}),index:++oe,value:ae}}))}(Z,J,Y)))),z;var Z,J,Y}}})(),{pagination:w,hasPagination:C,handlePagination:S}=(()=>{const R=ue("pagination"),L=r.reactive({...Gd});r.onMounted(()=>{I(R.value||Gd)});const I=j=>{zu(L,{...j})};r.watch(()=>R.value,j=>{I(j||Gd)},{deep:!0});const P=r.getCurrentInstance(),W=$i(()=>{P==null||P.emit("change:pagination",L)},500),z=r.computed(()=>{var j;return!!((j=R.value)!=null&&j.pageNum)});return{pagination:L,hasPagination:z,handlePagination:j=>{I(j),W()}}})(),{isExpanded:E,getExpandData:M,resetExpandData:N,setExpandData:T,removeExpandData:D}=(()=>{const R=r.reactive(new Map);return{expandData:R,isExpanded:L=>R.has(L),getExpandData:L=>R.get(L)||[],resetExpandData:()=>{R.clear()},setExpandData:(L,I)=>{R.set(L,I)},removeExpandData:L=>{R.delete(L)}}})(),{leftWidth:$,rightWidth:B,centerWidth:V,viewWidth:O}=(R=>{const{leftColumns:L,rightColumns:I,centerColumns:P,tableWidth:W,columnWidth:z}=R,j=Y=>function(te,pe,X){var oe=ce(te)?Ib:pk,ae=arguments.length<3;return oe(te,yn(pe),X,ae,xr)}(Y,(te,pe)=>te+(pe.width||z.value),0),K=r.computed(()=>j(L.value)),G=r.computed(()=>j(I.value)),Z=r.computed(()=>j(P.value)),J=r.computed(()=>W.value-K.value-G.value);return{leftWidth:K,rightWidth:G,centerWidth:Z,viewWidth:J}})({leftColumns:d,rightColumns:p,centerColumns:u,tableWidth:h,columnWidth:f});r.watch(()=>n.data,()=>{l.value=n.data,N(),y(),v()});const A=r.computed(()=>{var R;return!n.loading&&!((R=l.value)!=null&&R.length)}),F=r.computed(()=>C.value&&!A.value);return r.provide(Jd,{data:l,tableWidth:h,isLoading:r.computed(()=>!!n.loading),columns:c,columnWidth:f,leftColumns:d,rightColumns:p,centerColumns:u,scroll:m,setScroll:g,pagination:w,handlePagination:S,handleSort:(R,L)=>{if(N(),b(R,L),n.sortType==="front"){const I=zi(c.value,P=>P.prop===R);I&&(l.value=x(n.data,I))}else o("change:sort",R,L)},getCurrentSort:k,isExpanded:E,getExpandData:M,setExpandData:(R,L)=>{T(R,L),o("change:expand",l.value[R],!0)},removeExpandData:R=>{D(R),o("change:expand",l.value[R],!1)},expandCondition:n.expandCondition,fetchExpandData:n.fetchExpandData,leftWidth:$,rightWidth:B,centerWidth:V,viewWidth:O}),(R,L)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-table-plus",style:r.normalizeStyle({width:r.unref(s),height:r.unref(a)}),ref_key:"tableRef",ref:i},[r.createElementVNode("div",null,[r.createVNode(RB),A.value?(r.openBlock(),r.createBlock(rT,{key:1},{default:r.withCtx(()=>[r.renderSlot(R.$slots,"empty",{},void 0,!0)]),_:3})):(r.openBlock(),r.createBlock(nT,{key:0,loading:t.loading},null,8,["loading"]))]),r.createVNode(sT),F.value?(r.openBlock(),r.createBlock(XB,{key:0})):r.createCommentVNode("",!0)],4))}}),S0=ee(q(aT,[["__scopeId","data-v-17a70a19"]])),E0="mc-textarea",lT=["value","id","disabled","maxlength","placeholder"],cT={class:"mc-textarea-count"},dT=r.defineComponent({name:E0,__name:"mc-textarea",props:{modelValue:{default:""},placeholder:{default:"Please input"},disabled:{type:Boolean,default:!1},showCount:{type:Boolean,default:!0},width:{default:"100%"},height:{default:88},resize:{default:"vertical"},maxLength:{default:255},disableValidation:{type:Boolean},hideValidationIcon:{type:Boolean}},emits:["update:modelValue","change","focus","blur"],setup(t,{emit:e}){const n=t,o=e,{width:i,height:s}=lt(),a=r.ref(),{wrapperRef:l,isFocused:c,handleFocus:d,handleBlur:u}=Xn(a),{formId:p,validateStyle:h,formDisabled:f,validateByTrigger:m}=Nt(),g=async k=>{let x=k.target.value;n.maxLength>0&&x.length>n.maxLength&&(x=x.slice(0,n.maxLength)),o("update:modelValue",x),o("change",x),await r.nextTick(),m("input")},v=r.useSlots(),b=r.computed(()=>!!n.showCount&&n.maxLength>0||!!v.count),y=r.computed(()=>{var k;return((k=n.modelValue)==null?void 0:k.length)??0});return(k,x)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"textareaWrapperRef",ref:l,class:r.normalizeClass(["mc-textarea",{"mc-textarea-disabled":r.unref(f),"mc-textarea-focused":r.unref(c),[r.unref(h)]:r.unref(h)}]),style:r.normalizeStyle({width:r.unref(i)})},[r.createElementVNode("textarea",{ref_key:"textareaRef",ref:a,value:t.modelValue,id:r.unref(p),class:"mc-textarea-input",style:r.normalizeStyle({width:r.unref(i),height:r.unref(s),resize:t.resize}),disabled:r.unref(f),maxlength:t.maxLength,placeholder:t.placeholder,onFocus:x[0]||(x[0]=(...w)=>r.unref(d)&&r.unref(d)(...w)),onBlur:x[1]||(x[1]=(...w)=>r.unref(u)&&r.unref(u)(...w)),onInput:g},null,44,lT),b.value?r.renderSlot(k.$slots,"count",{key:0,maxLength:t.maxLength,currentLength:y.value},()=>[r.createElementVNode("div",cT,[r.createElementVNode("span",null,r.toDisplayString(`${y.value} / ${t.maxLength} characters`),1)])],!0):r.createCommentVNode("",!0)],6))}}),M0=ee(q(dT,[["__scopeId","data-v-045299ac"]])),Qd=t=>parseFloat(t).toString(),Zd=(t,e=2)=>t<1024?`${t} B`:t<1048576?`${Qd((t/1024).toFixed(e))} KB`:t<1073741824?`${Qd((t/1048576).toFixed(e))} MB`:`${Qd((t/1073741824).toFixed(e))} GB`,N0=t=>{if(!t)return"--";const e=new Date(t);return`${e.getFullYear()}/${String(e.getMonth()+1).padStart(2,"0")}/${String(e.getDate()).padStart(2,"0")} ${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`},eu=(t,e,n)=>{const o=t.get(e);t.set(e,{...o,...n})},B0="mc-upload",T0="mc-upload-dropzone",At="[?]",tu=["jpg","jpeg","png","doc","docx","xls","xlsx","pdf"],uT={upload_note:"Click to upload or drag and drop your files here",max_size:"Max file size:",max_count:"No limit on maximum number of documents but recommend that upload then in pdf if more than 5 files are to be upload.",uploaded_by:"Uploaded by",uploaded_on:"Uploaded on",limit_count:`The number of files cannot exceed ${At} .`,limit_size:`The file size cannot exceed ${At} .`,limit_type:`${At} only`,limit_count_reached:`You can only upload ${At} files.`},pT={upload_note:"单击即可上传或将文件拖放到此处",max_size:"最大文件大小:",max_count:"No limit on maximum number of documents but recommend that upload then in pdf if more than 5 files are to be upload.",uploaded_by:"上传用户",uploaded_on:"上传时间",limit_count:`文件数量不能超过 ${At} 。`,limit_size:`最大文件大小:${At} 。`,limit_type:`只接受文件格式:${At}`,limit_count_reached:`您只能上传 ${At} 个文件。`},nu=()=>{const t=ue("lang");return{langMap:r.computed(()=>t.value==="zh"?pT:uT)}},hT={class:"mc-upload-dropzone-area"},fT={class:"mc-upload-dropzone-title"},mT={class:"mc-upload-dropzone-title-text"},gT={key:0,class:"mc-upload-dropzone-desc"},vT={key:0},yT={key:1},bT=r.defineComponent({name:T0,__name:"mc-upload-dropzone",props:{title:{},icon:{default:"Document_Upload"},allowedFileTypes:{default:()=>tu},fileSize:{default:15728640},uploadUser:{default:"--"},lang:{default:"en"},hideDesc:{type:Boolean,default:!1},fileCount:{}},emits:["upload","error:type","error:size"],setup(t,{expose:e,emit:n}){const o=t,i=n,{langMap:s}=nu(),a=r.ref(),l=r.computed(()=>{var m;return(m=o.allowedFileTypes)!=null&&m.length?s.value.limit_type.replace(At,bn(o.allowedFileTypes,g=>g.toUpperCase()).join(", ")):void 0}),{isDragover:c}=((m,g)=>{const v=r.ref(!1),b=C=>{C!==v.value&&(v.value=C)},y=C=>{C.preventDefault(),b(!0),He(g.onDragEnter)&&g.onDragEnter(C)},k=C=>{C.preventDefault(),b(!1),He(g.onDragLeave)&&g.onDragLeave(C)},x=C=>{C.preventDefault(),He(g.onDragover)&&g.onDragover(C)},w=C=>{C.preventDefault(),b(!1),He(g.onDrop)&&g.onDrop(C)};return r.onMounted(()=>{var C,S,E,M;(C=m.value)==null||C.addEventListener("dragenter",y),(S=m.value)==null||S.addEventListener("dragleave",k),(E=m.value)==null||E.addEventListener("dragover",x),(M=m.value)==null||M.addEventListener("drop",w)}),r.onBeforeUnmount(()=>{var C,S,E,M;(C=m.value)==null||C.removeEventListener("dragenter",y),(S=m.value)==null||S.removeEventListener("dragleave",k),(E=m.value)==null||E.removeEventListener("dragover",x),(M=m.value)==null||M.removeEventListener("drop",w)}),{isDragover:v}})(a,{onDrop:m=>{var v;const g=(v=m.dataTransfer)==null?void 0:v.files;g&&f(g)}}),d=r.ref(),u=()=>{d.value&&(d.value.value="")},p=()=>{var m;(m=d.value)==null||m.click()},h=m=>{const g=m.target.files;g&&f(g)},f=async m=>{let g=Array.from(m);const v=new Map;g.forEach(b=>{eu(v,b.name,{name:b.name,size:b.size,status:"loading",uploadBy:o.uploadUser,uploadTime:Date.now(),file:b})}),((b,y)=>{const k=o.fileSize;if(k<=0)return!0;let x=!1;for(let w=0;w<b.length;w++){const C=b[w];C.size>k?(eu(y,C.name,{status:"failed",errorMessage:s.value.limit_size.replace(At,`${Zd(k)}`)}),i("error:size",C.name)):x=!0}})(g,v),((b,y)=>{var C;const k=o.allowedFileTypes;if(!(k!=null&&k.length))return!0;let x=!1;const w=bn(k,S=>S.toUpperCase());for(let S=0;S<b.length;S++)Ct(w,((C=b[S].name.split(".").pop())==null?void 0:C.toUpperCase())??"--")?x=!0:(eu(y,b[S].name,{status:"failed",errorMessage:l.value}),i("error:type",b[S].name))})(g,v),i("upload",v),u()};return e({clearUploadInput:u}),(m,g)=>(r.openBlock(),r.createElementBlock("div",{ref:"wrapperRef",class:r.normalizeClass(["mc-upload-dropzone",{"mc-upload-dropzone-dragover":r.unref(c)}]),onClick:p},[r.createElementVNode("div",hT,[r.renderSlot(m.$slots,"default",{},()=>[r.createElementVNode("div",fT,[r.renderSlot(m.$slots,"title",{},()=>[r.createVNode(r.unref(ge),{name:t.icon},null,8,["name"]),r.createElementVNode("span",mT,r.toDisplayString(t.title||r.unref(s).upload_note),1)],!0)]),t.hideDesc?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",gT,[r.renderSlot(m.$slots,"desc",{},()=>[t.fileSize>0?(r.openBlock(),r.createElementBlock("span",vT,r.toDisplayString(r.unref(s).max_size)+" "+r.toDisplayString(r.unref(Zd)(t.fileSize)),1)):r.createCommentVNode("",!0),l.value?(r.openBlock(),r.createElementBlock("span",yT,r.toDisplayString(l.value),1)):r.createCommentVNode("",!0)],!0)]))],!0)]),r.createElementVNode("input",{ref_key:"uploadInputRef",ref:d,type:"file",multiple:"",style:{display:"none"},onChange:h},null,544),r.createElementVNode("div",{class:"mc-upload-dropzone-cover",ref_key:"coverRef",ref:a},null,512)],2))}}),kT=q(bT,[["__scopeId","data-v-7f887458"]]),O0="mc-file-list",wT={class:"mc-file-list-item-content"},xT={class:"mc-file-list-item-file mc-file-list-item-info"},CT=["onClick"],ST={class:"mc-file-list-item-file-name-text"},ET={class:"mc-file-list-item-file-desc"},MT={class:"mc-file-list-item-file-size-text"},NT={key:0,class:"mc-file-list-item-file-progress-bar"},BT={key:1,class:"mc-file-list-item-file-error"},TT={key:0,class:"mc-file-list-item-info"},OT={class:"mc-file-list-item-info"},_T={class:"mc-file-list-item-label"},VT={class:"mc-file-list-item-value"},AT={class:"mc-file-list-item-info"},DT={class:"mc-file-list-item-label"},IT={class:"mc-file-list-item-value"},RT={key:1,class:"mc-file-list-item-info"},LT={class:"mc-file-list-item-actions"},$T={class:"mc-file-list-item-compact-content"},PT={key:0,class:"mc-file-list-item-info"},zT={class:"mc-file-list-item-info"},FT={class:"mc-file-list-item-label"},jT={class:"mc-file-list-item-value"},HT={class:"mc-file-list-item-info"},WT={class:"mc-file-list-item-label"},KT={class:"mc-file-list-item-value"},UT={key:1,class:"mc-file-list-item-info"},ou=ee(q(r.defineComponent({name:O0,__name:"mc-file-list",props:{modelValue:{default:()=>[]},theme:{default:"light"},lang:{default:"en"},downloadable:{type:Boolean,default:!1},allowCancel:{type:Boolean,default:!1},deletable:{type:Boolean,default:!0}},emits:["update:modelValue","change","delete","download","preview","cancel"],setup(t,{emit:e}){const n=t,o=e,{langMap:i}=nu(),s=r.ref(!1),a=r.ref();$p(a,({width:c})=>{s.value=c<=680});const l=c=>{o("update:modelValue",n.modelValue.filter(d=>d.name!==c.name))};return(c,d)=>(r.openBlock(),r.createElementBlock("ul",{class:r.normalizeClass(["mc-file-list",[`mc-file-list-${t.theme}`,{"mc-file-list-compact":s.value}]]),ref_key:"fileListRef",ref:a},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.modelValue,u=>(r.openBlock(),r.createElementBlock("li",{class:"mc-file-list-item",key:u.name},[r.createElementVNode("div",wT,[r.createElementVNode("div",xT,[r.createElementVNode("div",{class:"mc-file-list-item-file-name",onClick:p=>(h=>{o("preview",h)})(u)},[r.createVNode(r.unref(ge),{name:"Document"}),r.createElementVNode("span",ST,r.toDisplayString(u.name),1)],8,CT),r.createElementVNode("div",ET,[u.status!=="failed"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("span",MT,r.toDisplayString(u.size?r.unref(Zd)(u.size):"--"),1),u.status==="loading"?(r.openBlock(),r.createElementBlock("div",NT,[r.createVNode(r.unref(Gl),{percentage:u.progress,"transition-duration":1e3},null,8,["percentage"])])):r.createCommentVNode("",!0)],64)):(r.openBlock(),r.createElementBlock("span",BT,r.toDisplayString(u.errorMessage||"failed to upload"),1))])]),s.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[c.$slots["extra-prefix"]&&u.status==="successed"?(r.openBlock(),r.createElementBlock("div",TT,[r.renderSlot(c.$slots,"extra-prefix",{isCompact:s.value,file:u},void 0,!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",OT,[r.createElementVNode("span",_T,r.toDisplayString(r.unref(i).uploaded_by),1),r.createElementVNode("span",VT,r.toDisplayString(u.uploadBy||"--"),1)]),r.createElementVNode("div",AT,[r.createElementVNode("span",DT,r.toDisplayString(r.unref(i).uploaded_on),1),r.createElementVNode("span",IT,r.toDisplayString(r.unref(N0)(u.uploadTime)||"--"),1)]),c.$slots.extra&&u.status==="successed"?(r.openBlock(),r.createElementBlock("div",RT,[r.renderSlot(c.$slots,"extra",{isCompact:s.value,file:u},void 0,!0)])):r.createCommentVNode("",!0)],64)),r.createElementVNode("div",LT,[u.status==="loading"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[t.allowCancel?(r.openBlock(),r.createBlock(r.unref(ge),{key:0,name:"Cross",class:"mc-file-list-item-icon",onClick:p=>(h=>{o("cancel",h),l(h)})(u)},null,8,["onClick"])):r.createCommentVNode("",!0)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[t.downloadable?(r.openBlock(),r.createBlock(r.unref(ge),{key:0,name:"Download",class:"mc-file-list-item-icon",onClick:p=>(h=>{o("download",h)})(u)},null,8,["onClick"])):r.createCommentVNode("",!0),t.deletable?(r.openBlock(),r.createBlock(r.unref(ge),{key:1,name:"Trash",class:"mc-file-list-item-icon",onClick:p=>(h=>{o("delete",h),l(h)})(u)},null,8,["onClick"])):r.createCommentVNode("",!0)],64))])]),s.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createVNode(r.unref(Dl)),r.createElementVNode("div",$T,[c.$slots["extra-prefix"]&&u.status==="successed"?(r.openBlock(),r.createElementBlock("div",PT,[r.renderSlot(c.$slots,"extra-prefix",{isCompact:s.value,file:u},void 0,!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",zT,[r.createElementVNode("span",FT,r.toDisplayString(r.unref(i).uploaded_by),1),r.createElementVNode("span",jT,r.toDisplayString(u.uploadBy||"--"),1)]),r.createElementVNode("div",HT,[r.createElementVNode("span",WT,r.toDisplayString(r.unref(i).uploaded_on),1),r.createElementVNode("span",KT,r.toDisplayString(r.unref(N0)(u.uploadTime)||"--"),1)]),c.$slots.extra&&u.status==="successed"?(r.openBlock(),r.createElementBlock("div",UT,[r.renderSlot(c.$slots,"extra",{isCompact:s.value,file:u},void 0,!0)])):r.createCommentVNode("",!0)])],64)):r.createCommentVNode("",!0)]))),128))],2))}}),[["__scopeId","data-v-06f298f6"]])),qT=["id"],JT={key:0,class:"mc-upload-content"},GT={class:"mc-upload-content-icon"},YT={class:"mc-upload-content-text"},XT={class:"mc-upload-component"},QT={key:0,class:"mc-upload-dropzone-wrapper"},ZT={class:"mc-upload-file-list-wrapper"},eO=r.defineComponent({name:B0,__name:"mc-upload",props:{modelValue:{default:()=>[]},downloadable:{type:Boolean,default:!1},allowCancel:{type:Boolean,default:!1},deletable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},theme:{default:"light"},width:{default:"100%"},succeed:{type:Boolean,default:!1},title:{},icon:{default:"Document_Upload"},allowedFileTypes:{default:()=>tu},fileSize:{default:15728640},uploadUser:{default:"--"},lang:{default:"en"},hideDesc:{type:Boolean,default:!1},fileCount:{}},emits:["update:modelValue","download:all","clear","error:type","error:size","upload","change","delete","download","preview","cancel"],setup(t,{expose:e,emit:n}){const o=t,i=n,{formId:s}=Nt(),{width:a}=lt(),l=r.useSlots(),c=r.computed(()=>!!l.content),d=r.ref(),u=r.reactive(new Map),{langMap:p}=nu(),h=E=>(E=(M=>{if(o.fileCount&&M.length>o.fileCount){const N=p.value.limit_count_reached.replace(At,o.fileCount.toString());return Xi.error(N),M.slice(0,o.fileCount)}return M})(E)).length!==0&&(u.clear(),E.forEach(M=>{u.set(M.name,M)}),!0);r.watch(()=>o.modelValue,E=>{h(E)},{immediate:!0});const f=E=>Array.from([...E.values()]),m=E=>{i("update:modelValue",E)},g=E=>{var T;(T=d.value)==null||T.clearUploadInput();const M=f(E);if(!h([...o.modelValue,...M]))return;const N=f(u);i("update:modelValue",N),i("upload",N),i("change",N),C()},v=E=>{console.error("mc-upload: error:type:",E),i("error:type",E)},b=E=>{console.error("mc-upload: error:size:",E),i("error:size",E)},y=E=>{i("preview",E)},k=E=>{i("delete",E)},x=E=>{i("download",E)},w=E=>{i("cancel",E)},C=(E=99,M=100)=>{setTimeout(()=>{o.modelValue.forEach(N=>{N.status==="loading"&&(N.progress=E)})},M)},S=r.computed(()=>o.deletable&&!o.disabled);return e({clearFiles:()=>{u.clear(),i("clear"),i("update:modelValue",[]),i("change",[])},downloadAllFiles:()=>{i("download:all",f(u))}}),(E,M)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-upload",style:r.normalizeStyle({width:r.unref(a)}),id:r.unref(s)},[r.createElementVNode("div",{class:r.normalizeClass([{"mc-upload-wrapper":c.value},`mc-upload-wrapper-${t.theme}`])},[c.value?(r.openBlock(),r.createElementBlock("div",JT,[r.createElementVNode("div",GT,[t.succeed?(r.openBlock(),r.createBlock(r.unref(Yo),{key:1,width:"24px",height:"24px"})):(r.openBlock(),r.createBlock(r.unref(ge),{key:0,name:"Accept"}))]),r.createElementVNode("div",YT,[r.renderSlot(E.$slots,"content",{},void 0,!0)])])):r.createCommentVNode("",!0),r.createElementVNode("div",XT,[t.disabled?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",QT,[r.createVNode(kT,{ref_key:"uploadDropzoneRef",ref:d,"upload-user":t.uploadUser,"allowed-file-types":t.allowedFileTypes,"file-size":t.fileSize,icon:t.icon,lang:t.lang,theme:t.theme,"hide-desc":t.hideDesc,"file-count":t.fileCount,title:t.title,onUpload:g,"onError:type":v,"onError:size":b},{default:r.withCtx(()=>[r.renderSlot(E.$slots,"default",{},void 0,!0)]),title:r.withCtx(()=>[r.renderSlot(E.$slots,"title",{},void 0,!0)]),desc:r.withCtx(()=>[r.renderSlot(E.$slots,"desc",{},void 0,!0)]),_:3},8,["upload-user","allowed-file-types","file-size","icon","lang","theme","hide-desc","file-count","title"])])),r.createElementVNode("div",ZT,[r.createVNode(r.unref(ou),{"model-value":t.modelValue,"allow-cancel":t.allowCancel,downloadable:t.downloadable,lang:t.lang,theme:t.theme,deletable:S.value,"onUpdate:modelValue":m,onPreview:y,onDelete:k,onDownload:x,onCancel:w},r.createSlots({_:2},[E.$slots["file-extra-prefix"]?{name:"extra-prefix",fn:r.withCtx(({file:N,isCompact:T})=>[r.renderSlot(E.$slots,"file-extra-prefix",{file:N,isCompact:T,isDisabled:t.disabled},void 0,!0)]),key:"0"}:void 0,E.$slots["file-extra"]?{name:"extra",fn:r.withCtx(({file:N,isCompact:T})=>[r.renderSlot(E.$slots,"file-extra",{file:N,isCompact:T,isDisabled:t.disabled},void 0,!0)]),key:"1"}:void 0]),1032,["model-value","allow-cancel","downloadable","lang","theme","deletable"])])])],2)],12,qT))}}),_0=ee(q(eO,[["__scopeId","data-v-7e4b79b6"]])),tO=[Lp,Wi,Wo,yh,kh,Sh,Th,_h,Ah,zh,Dl,Yh,es,hh,mh,ge,Ee,$l,Qh,tf,Pl,Zi,sf,lf,Qi,Gi,ps,Gl,Pf,Rf,Lf,Hf,Ff,zl,Il,$y,zy,jy,Dy,Fd,vi,Wd,Wy,Uy,Gy,Jy,Yy,Yo,e0,o0,t0,a0,C0,S0,zd,M0,Ll,Rl,Nh,Ho,ou,_0];console.info("contact us with ayachinenesanobauxichi@gmail.com");const nO=(V0=tO,t=>Pi(V0,e=>t.use(e)));var V0;_.ALLOW_FILE_TYPES=tu,_.CHECKBOX_GROUP_INJECTION_KEY=Ol,_.COLLAPSE_CONTEXT_KEY=_l,_.DAY_SPAN=42,_.FONT_STYLE=wo,_.FORM_CTX_KEY=Ro,_.FORM_ITEM_CTX_KEY=Tl,_.INPUT_GROUP_INJECTION_KEY=Rr,_.MC_ALERT_MESSAGE=Rp,_.MC_BUTTON=Pp,_.MC_CHECKBOX=gh,_.MC_CHECKBOX_GROUP=vh,_.MC_COLLAPSE=bh,_.MC_COLLAPSE_ITEM=Ch,_.MC_COPY=Bh,_.MC_COUNT=Oh,_.MC_CURRENCY_ICON=Vh,_.MC_DATE_PICKER=Dh,_.MC_DATE_PICKER_CONTENT=Lh,_.MC_DATE_PICKER_ITEM=Ih,_.MC_DATE_PICKER_LIST=Rh,_.MC_DATE_PICKER_MONTH=Ko,_.MC_DATE_PICKER_WEEK=$h,_.MC_DIVIDER=Fh,_.MC_DRAWER=Gh,_.MC_FILE_LIST=O0,_.MC_FOOTER=qh,_.MC_FORM=zp,_.MC_FORM_ITEM=fh,_.MC_ICON=Ip,_.MC_ICON_PLUS=wh,_.MC_INPUT_GROUP=Xh,_.MC_INPUT_PLUS=Zh,_.MC_INPUT_PLUS_CURRENCY_DECIMAL_SEPARATOR=Wt,_.MC_INPUT_PLUS_CURRENCY_SEPARATOR=",",_.MC_LIGHTBOX=ef,_.MC_LOADING=nf,_.MC_MODAL_HEADER=Uh,_.MC_MULTI_TAG=rf,_.MC_OTP=af,_.MC_OVERLAY=jh,_.MC_POPPER=uh,_.MC_POPPER_PLUS=Tf,_.MC_PROGRESS_BAR=Of,_.MC_PROGRESS_INDICATOR=Vf,_.MC_PROGRESS_INDICATOR_CHILD_ITEM=Xl,_.MC_PROGRESS_INDICATOR_ITEM=Yl,_.MC_PROGRESS_INDICATOR_STEP=Af,_.MC_PROGRESS_INDICATOR_STEP_NUM=Df,_.MC_RADIO=jf,_.MC_RADIO_GROUP=zf,_.MC_RADIO_GROUP_CTX=Ql,_.MC_REMOVABLE_TAG=of,_.MC_RESET=Hh,_.MC_RICHTEXT=Ry,_.MC_RICHTEXT_TOOL=Ly,_.MC_SECONDARY_MENU=Py,_.MC_SELECT=Fy,_.MC_SELECT_GROUP_PLUS=Hd,_.MC_SELECT_MULTI_OPTION=Ay,_.MC_SELECT_OPTION_PLUS=jd,_.MC_SELECT_PLUS=_y,_.MC_SELECT_PLUS_CTX=fn,_.MC_STATUS=Hy,_.MC_STEP=Ky,_.MC_STEP_CHILD_ITEM_PLUS=Ud,_.MC_STEP_ITEM_PLUS=Kd,_.MC_STEP_PLUS=qy,_.MC_SUCCESS_ICON=_f,_.MC_SWITCH=Xy,_.MC_SWITCH_LABEL=Qy,_.MC_TAB=n0,_.MC_TABLE_BODY=u0,_.MC_TABLE_CELL=h0,_.MC_TABLE_COLUMN_PLUS=Yd,_.MC_TABLE_CTX_KEY=Jd,_.MC_TABLE_DEFAULT_PROPS=pr,_.MC_TABLE_DEFAULT_VALUE="--",_.MC_TABLE_ELLIPSIS=x0,_.MC_TABLE_EMPTY=f0,_.MC_TABLE_FOOTER=v0,_.MC_TABLE_HEADER=c0,_.MC_TABLE_LOADING=m0,_.MC_TABLE_PAGE_SIZE=b0,_.MC_TABLE_PAGINATION=k0,_.MC_TABLE_PAGINATION_ITEM=w0,_.MC_TABLE_PLUS=l0,_.MC_TABLE_ROW=p0,_.MC_TABLE_SCROLL=g0,_.MC_TABLE_SORT=d0,_.MC_TABLE_TOTAL=y0,_.MC_TAB_ITEM=qd,_.MC_TAG=Vy,_.MC_TEXTAREA=E0,_.MC_TITLE=Kh,_.MC_TITLE_TOOL_BAR=Wh,_.MC_TOAST=Eh,_.MC_TOOLTIP=ph,_.MC_UPLOAD=B0,_.MC_UPLOAD_DROPZONE=T0,_.McAlertMessage=Lp,_.McButton=Wi,_.McCheckbox=Wo,_.McCheckboxGroup=yh,_.McCollapse=kh,_.McCollapseItem=Sh,_.McCopy=Th,_.McCount=_h,_.McCurrencyIcon=Ah,_.McDatePicker=zh,_.McDivider=Dl,_.McDrawer=Yh,_.McFileList=ou,_.McFooter=es,_.McForm=hh,_.McFormItem=mh,_.McIcon=ge,_.McIconPlus=Ee,_.McInput=$l,_.McInputGroup=Qh,_.McLightbox=tf,_.McLoading=Pl,_.McModalHeader=Zi,_.McMultiTag=sf,_.McOtp=lf,_.McOverlay=Qi,_.McPopper=Gi,_.McPopperPlus=ps,_.McProgressBar=Gl,_.McProgressIndicator=Pf,_.McProgressIndicatorChildItem=Lf,_.McProgressIndicatorItem=Rf,_.McRadio=Hf,_.McRadioGroup=Ff,_.McRemovableTag=zl,_.McReset=Il,_.McRichtext=$y,_.McSecondaryMenu=zy,_.McSelect=jy,_.McSelectGroupPlus=Dy,_.McSelectMultiOption=Fd,_.McSelectOptionPlus=vi,_.McSelectPlus=Wd,_.McStatus=Wy,_.McStep=Uy,_.McStepChildItemPlus=Gy,_.McStepItemPlus=Jy,_.McStepPlus=Yy,_.McSuccessIcon=Yo,_.McSwitch=e0,_.McTab=o0,_.McTabItem=t0,_.McTable=a0,_.McTableColumnPlus=C0,_.McTablePlus=S0,_.McTag=zd,_.McTextarea=M0,_.McTitle=Ll,_.McTitleToolBar=Rl,_.McToast=Nh,_.McTooltip=Ho,_.McUpload=_0,_.SELECT_INJECTION_KEY=yi,_.TOOL_ICON=Ce,_.WILDCARD=At,_.YEAR_SPAN=21,_.default=nO,_.toast=Xi,_.usePagination=r0,_.useTableScroll=i0,_.useTableSort=s0,Object.defineProperties(_,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
174
+ `)}:void 0}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(vy)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=cr({find:yy,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=cr({find:yy,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(vy)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),EE=/^\s*(\[([( |x])?\])\s$/,ME=ut.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",Re(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const n=[];if(t.tokens&&t.tokens.length>0?n.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?n.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):n.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const o=e.parseChildren(t.nestedTokens);n.push(...o)}return e.createNode("taskItem",{checked:t.checked||!1},n)},renderMarkdown:(t,e)=>{var n;return dd(t,e,`- [${(n=t.attrs)!=null&&n.checked?"x":" "}] `)},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:n,editor:o})=>{const i=document.createElement("li"),s=document.createElement("label"),a=document.createElement("span"),l=document.createElement("input"),c=document.createElement("div"),d=u=>{var p,h;l.ariaLabel=((h=(p=this.options.a11y)==null?void 0:p.checkboxLabel)==null?void 0:h.call(p,u,l.checked))||`Task item checkbox for ${u.textContent||"empty task item"}`};return d(t),s.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",u=>u.preventDefault()),l.addEventListener("change",u=>{if(!o.isEditable&&!this.options.onReadOnlyChecked)return void(l.checked=!l.checked);const{checked:p}=u.target;o.isEditable&&typeof n=="function"&&o.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{const f=n();if(typeof f!="number")return!1;const m=h.doc.nodeAt(f);return h.setNodeMarkup(f,void 0,{...m==null?void 0:m.attrs,checked:p}),!0}).run(),!o.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,p)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([u,p])=>{i.setAttribute(u,p)}),i.dataset.checked=t.attrs.checked,l.checked=t.attrs.checked,s.append(l,a),i.append(s,c),Object.entries(e).forEach(([u,p])=>{i.setAttribute(u,p)}),{dom:i,contentDOM:c,update:u=>u.type===this.type&&(i.dataset.checked=u.attrs.checked,l.checked=u.attrs.checked,d(u),!0)}}},addInputRules(){return[cr({find:EE,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),NE=ut.create({name:"taskList",addOptions:()=>({itemTypeName:"taskItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",Re(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,`
175
+ `):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const n=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return n!==void 0?n:-1},tokenize(t,e,n){const o=s=>{const a=cd(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,c)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:c}),customNestedParser:o},n);return a?[{type:"taskList",raw:a.raw,items:a.items}]:n.blockTokens(s)},i=cd(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,a)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:n.inlineTokens(s.mainContent),nestedTokens:a}),customNestedParser:o},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});ze.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(ay.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(ly.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(fy.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(by.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(ME.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(NE.configure(this.options.taskList)),t}});var BE=ut.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:t}){return["p",Re(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const n=t.tokens||[];return n.length===1&&n[0].type==="image"?e.parseChildren([n[0]]):e.createNode("paragraph",void 0,e.parseInline(n))},renderMarkdown:(t,e)=>t&&Array.isArray(t.content)?e.renderChildren(t.content):"",addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),TE=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,OE=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,_E=$n.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("line-through")&&{}}],renderHTML({HTMLAttributes:t}){return["s",Re(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[lr({find:TE,type:this.type})]},addPasteRules(){return[vo({find:OE,type:this.type})]}}),VE=ut.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),DE=$n.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("underline")&&{}}],renderHTML({HTMLAttributes:t}){return["u",Re(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown:(t,e)=>`++${e.renderChildren(t)}++`,markdownTokenizer:{name:"underline",level:"inline",start:t=>t.indexOf("++"),tokenize(t,e,n){const o=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!o)return;const i=o[2].trim();return{type:"underline",raw:o[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function AE(t={}){return new Ve({view:e=>new IE(e,t)})}class IE{constructor(e,n){var o;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(o=n.width)!==null&&o!==void 0?o:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=a=>{this[i](a)};return e.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,n=this.editorView.state.doc.resolve(this.cursorPos),o=!n.parent.inlineContent,i=this.editorView.dom,s=i.getBoundingClientRect(),a=s.width/i.offsetWidth,l=s.height/i.offsetHeight;if(o){let p=n.nodeBefore,h=n.nodeAfter;if(p||h){let f=this.editorView.nodeDOM(this.cursorPos-(p?p.nodeSize:0));if(f){let m=f.getBoundingClientRect(),g=p?m.bottom:m.top;p&&h&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let v=this.width/2*l;e={left:m.left,right:m.right,top:g-v,bottom:g+v}}}}if(!e){let p=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*a;e={left:p.left-h,right:p.left+h,top:p.top,bottom:p.bottom}}let c,d,u=this.editorView.dom.offsetParent;if(this.element||(this.element=u.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",o),this.element.classList.toggle("prosemirror-dropcursor-inline",!o),!u||u==document.body&&getComputedStyle(u).position=="static")c=-pageXOffset,d=-pageYOffset;else{let p=u.getBoundingClientRect(),h=p.width/u.offsetWidth,f=p.height/u.offsetHeight;c=p.left-u.scrollLeft*h,d=p.top-u.scrollTop*f}this.element.style.left=(e.left-c)/a+"px",this.element.style.top=(e.top-d)/l+"px",this.element.style.width=(e.right-e.left)/a+"px",this.element.style.height=(e.bottom-e.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),o=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=o&&o.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,n,e):i;if(n&&!s){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Sm(this.editorView.state.doc,a,this.editorView.dragging.slice);l!=null&&(a=l)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Ae extends he{constructor(e){super(e,e)}map(e,n){let o=e.resolve(n.map(this.head));return Ae.valid(o)?new Ae(o):he.near(o)}content(){return Q.empty}eq(e){return e instanceof Ae&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ae(e.resolve(n.pos))}getBookmark(){return new Id(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!function(s){for(let a=s.depth;a>=0;a--){let l=s.index(a),c=s.node(a);if(l!=0)for(let d=c.child(l-1);;d=d.lastChild){if(d.childCount==0&&!d.inlineContent||ky(d.type))return!0;if(d.inlineContent)return!1}else if(c.type.spec.isolating)return!0}return!0}(e)||!function(s){for(let a=s.depth;a>=0;a--){let l=s.indexAfter(a),c=s.node(a);if(l!=c.childCount)for(let d=c.child(l);;d=d.firstChild){if(d.childCount==0&&!d.inlineContent||ky(d.type))return!0;if(d.inlineContent)return!1}else if(c.type.spec.isolating)return!0}return!0}(e))return!1;let o=n.type.spec.allowGapCursor;if(o!=null)return o;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,o=!1){e:for(;;){if(!o&&Ae.valid(e))return e;let i=e.pos,s=null;for(let a=e.depth;;a--){let l=e.node(a);if(n>0?e.indexAfter(a)<l.childCount:e.index(a)>0){s=l.child(n>0?e.indexAfter(a):e.index(a)-1);break}if(a==0)return null;i+=n;let c=e.doc.resolve(i);if(Ae.valid(c))return c}for(;;){let a=n>0?s.firstChild:s.lastChild;if(!a){if(s.isAtom&&!s.isText&&!re.isSelectable(s)){e=e.doc.resolve(i+s.nodeSize*n),o=!1;continue e}break}s=a,i+=n;let l=e.doc.resolve(i);if(Ae.valid(l))return l}return null}}}Ae.prototype.visible=!1,Ae.findFrom=Ae.findGapCursorFrom,he.jsonID("gapcursor",Ae);class Id{constructor(e){this.pos=e}map(e){return new Id(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Ae.valid(n)?new Ae(n):he.near(n)}}function ky(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}const RE=av({ArrowLeft:Na("horiz",-1),ArrowRight:Na("horiz",1),ArrowUp:Na("vert",-1),ArrowDown:Na("vert",1)});function Na(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(o,i,s){let a=o.selection,l=e>0?a.$to:a.$from,c=a.empty;if(a instanceof le){if(!s.endOfTextblock(n)||l.depth==0)return!1;c=!1,l=o.doc.resolve(e>0?l.after():l.before())}let d=Ae.findGapCursorFrom(l,e,c);return!!d&&(i&&i(o.tr.setSelection(new Ae(d))),!0)}}function LE(t,e,n){if(!t||!t.editable)return!1;let o=t.state.doc.resolve(e);if(!Ae.valid(o))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&re.isSelectable(t.state.doc.nodeAt(i.inside))||(t.dispatch(t.state.tr.setSelection(new Ae(o))),0))}function $E(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Ae))return!1;let{$from:n}=t.state.selection,o=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!o)return!1;let i=H.empty;for(let a=o.length-1;a>=0;a--)i=H.from(o[a].createAndFill(null,i));let s=t.state.tr.replace(n.pos,n.pos,new Q(i,0,0));return s.setSelection(le.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function PE(t){if(!(t.selection instanceof Ae))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Te.create(t.doc,[st.widget(t.selection.head,e,{key:"gapcursor"})])}var Ba=200,qe=function(){};qe.prototype.append=function(t){return t.length?(t=qe.from(t),!this.length&&t||t.length<Ba&&this.leafAppend(t)||this.length<Ba&&t.leafPrepend(this)||this.appendInner(t)):this},qe.prototype.prepend=function(t){return t.length?qe.from(t).append(this):this},qe.prototype.appendInner=function(t){return new zE(this,t)},qe.prototype.slice=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.length),t>=e?qe.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},qe.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},qe.prototype.forEach=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length),e<=n?this.forEachInner(t,e,n,0):this.forEachInvertedInner(t,e,n,0)},qe.prototype.map=function(t,e,n){e===void 0&&(e=0),n===void 0&&(n=this.length);var o=[];return this.forEach(function(i,s){return o.push(t(i,s))},e,n),o},qe.from=function(t){return t instanceof qe?t:t&&t.length?new wy(t):qe.empty};var wy=function(t){function e(o){t.call(this),this.values=o}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(o,i){return o==0&&i==this.length?this:new e(this.values.slice(o,i))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,i,s,a){for(var l=i;l<s;l++)if(o(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(o,i,s,a){for(var l=i-1;l>=s;l--)if(o(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=Ba)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=Ba)return new e(o.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(qe);qe.empty=new wy([]);var zE=function(t){function e(n,o){t.call(this),this.left=n,this.right=o,this.length=n.length+o.length,this.depth=Math.max(n.depth,o.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,o,i,s){var a=this.left.length;return!(o<a&&this.left.forEachInner(n,o,Math.min(i,a),s)===!1)&&!(i>a&&this.right.forEachInner(n,Math.max(o-a,0),Math.min(this.length,i)-a,s+a)===!1)&&void 0},e.prototype.forEachInvertedInner=function(n,o,i,s){var a=this.left.length;return!(o>a&&this.right.forEachInvertedInner(n,o-a,Math.max(i,a)-a,s+a)===!1)&&!(i<a&&this.left.forEachInvertedInner(n,Math.min(o,a),i,s)===!1)&&void 0},e.prototype.sliceInner=function(n,o){if(n==0&&o==this.length)return this;var i=this.left.length;return o<=i?this.left.slice(n,o):n>=i?this.right.slice(n-i,o-i):this.left.slice(n,i).append(this.right.slice(0,o-i))},e.prototype.leafAppend=function(n){var o=this.right.leafAppend(n);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(n){var o=this.left.leafPrepend(n);if(o)return new e(o,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e}(qe);class $t{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let o,i,s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}n&&(o=this.remapping(s,this.items.length),i=o.maps.length);let a,l,c=e.tr,d=[],u=[];return this.items.forEach((p,h)=>{if(!p.step)return o||(o=this.remapping(s,h+1),i=o.maps.length),i--,void u.push(p);if(o){u.push(new Xt(p.map));let f,m=p.step.map(o.slice(i));m&&c.maybeStep(m).doc&&(f=c.mapping.maps[c.mapping.maps.length-1],d.push(new Xt(f,void 0,void 0,d.length+u.length))),i--,f&&o.appendMap(f,i)}else c.maybeStep(p.step);return p.selection?(a=o?p.selection.map(o.slice(i)):p.selection,l=new $t(this.items.slice(0,s).append(u.reverse().concat(d)),this.eventCount-1),!1):void 0},this.items.length,0),{remaining:l,transform:c,selection:a}}addTransform(e,n,o,i){let s=[],a=this.eventCount,l=this.items,c=!i&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let p,h=e.steps[u].invert(e.docs[u]),f=new Xt(e.mapping.maps[u],h,n);(p=c&&c.merge(f))&&(f=p,u?s.pop():l=l.slice(0,l.length-1)),s.push(f),n&&(a++,n=void 0),i||(c=f)}let d=a-o.depth;return d>FE&&(l=function(u,p){let h;return u.forEach((f,m)=>{if(f.selection&&p--==0)return h=m,!1}),u.slice(h)}(l,d),a-=d),new $t(l.append(s),a)}remapping(e,n){let o=new jr;return this.items.forEach((i,s)=>{let a=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?o.maps.length-i.mirrorOffset:void 0;o.appendMap(i.map,a)},e,n),o}addMaps(e){return this.eventCount==0?this:new $t(this.items.append(e.map(n=>new Xt(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let o=[],i=Math.max(0,this.items.length-n),s=e.mapping,a=e.steps.length,l=this.eventCount;this.items.forEach(h=>{h.selection&&l--},i);let c=n;this.items.forEach(h=>{let f=s.getMirror(--c);if(f==null)return;a=Math.min(a,f);let m=s.maps[f];if(h.step){let g=e.steps[f].invert(e.docs[f]),v=h.selection&&h.selection.map(s.slice(c+1,f));v&&l++,o.push(new Xt(m,g,v))}else o.push(new Xt(m))},i);let d=[];for(let h=n;h<a;h++)d.push(new Xt(s.maps[h]));let u=this.items.slice(0,i).append(d).append(o),p=new $t(u,l);return p.emptyItemCount()>500&&(p=p.compress(this.items.length-o.length)),p}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),o=n.maps.length,i=[],s=0;return this.items.forEach((a,l)=>{if(l>=e)i.push(a),a.selection&&s++;else if(a.step){let c=a.step.map(n.slice(o)),d=c&&c.getMap();if(o--,d&&n.appendMap(d,o),c){let u=a.selection&&a.selection.map(n.slice(o));u&&s++;let p,h=new Xt(d.invert(),c,u),f=i.length-1;(p=i.length&&i[f].merge(h))?i[f]=p:i.push(h)}}else a.map&&o--},this.items.length,0),new $t(qe.from(i.reverse()),s)}}$t.empty=new $t(qe.empty,0);class Xt{constructor(e,n,o,i){this.map=e,this.step=n,this.selection=o,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Xt(n.getMap().invert(),n,this.selection)}}}class jn{constructor(e,n,o,i,s){this.done=e,this.undone=n,this.prevRanges=o,this.prevTime=i,this.prevComposition=s}}const FE=20;function xy(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((o,i,s,a)=>e.push(s,a));return e}function Rd(t,e){if(!t)return null;let n=[];for(let o=0;o<t.length;o+=2){let i=e.map(t[o],1),s=e.map(t[o+1],-1);i<=s&&n.push(i,s)}return n}let Ld=!1,Cy=null;function Ta(t){let e=t.plugins;if(Cy!=e){Ld=!1,Cy=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Ld=!0;break}}return Ld}const ko=new Ue("history"),jE=new Ue("closeHistory");function HE(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ve({key:ko,state:{init:()=>new jn($t.empty,$t.empty,null,0,-1),apply:(e,n,o)=>function(i,s,a,l){let c,d=a.getMeta(ko);if(d)return d.historyState;a.getMeta(jE)&&(i=new jn(i.done,i.undone,null,0,-1));let u=a.getMeta("appendedTransaction");if(a.steps.length==0)return i;if(u&&u.getMeta(ko))return u.getMeta(ko).redo?new jn(i.done.addTransform(a,void 0,l,Ta(s)),i.undone,xy(a.mapping.maps),i.prevTime,i.prevComposition):new jn(i.done,i.undone.addTransform(a,void 0,l,Ta(s)),null,i.prevTime,i.prevComposition);if(a.getMeta("addToHistory")===!1||u&&u.getMeta("addToHistory")===!1)return(c=a.getMeta("rebased"))?new jn(i.done.rebased(a,c),i.undone.rebased(a,c),Rd(i.prevRanges,a.mapping),i.prevTime,i.prevComposition):new jn(i.done.addMaps(a.mapping.maps),i.undone.addMaps(a.mapping.maps),Rd(i.prevRanges,a.mapping),i.prevTime,i.prevComposition);{let p=a.getMeta("composition"),h=i.prevTime==0||!u&&i.prevComposition!=p&&(i.prevTime<(a.time||0)-l.newGroupDelay||!function(m,g){if(!g)return!1;if(!m.docChanged)return!0;let v=!1;return m.mapping.maps[0].forEach((b,y)=>{for(let k=0;k<g.length;k+=2)b<=g[k+1]&&y>=g[k]&&(v=!0)}),v}(a,i.prevRanges)),f=u?Rd(i.prevRanges,a.mapping):xy(a.mapping.maps);return new jn(i.done.addTransform(a,h?s.selection.getBookmark():void 0,l,Ta(s)),$t.empty,f,a.time,p??i.prevComposition)}}(n,o,e,t)},config:t,props:{handleDOMEvents:{beforeinput(e,n){let o=n.inputType,i=o=="historyUndo"?Ey:o=="historyRedo"?My:null;return!!i&&(n.preventDefault(),i(e.state,e.dispatch))}}}})}function Sy(t,e){return(n,o)=>{let i=ko.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(o){let s=function(a,l,c){let d=Ta(l),u=ko.get(l).spec.config,p=(c?a.undone:a.done).popEvent(l,d);if(!p)return null;let h=p.selection.resolve(p.transform.doc),f=(c?a.done:a.undone).addTransform(p.transform,l.selection.getBookmark(),u,d),m=new jn(c?f:p.remaining,c?p.remaining:f,null,0,-1);return p.transform.setSelection(h).setMeta(ko,{redo:c,historyState:m})}(i,n,t);s&&o(e?s.scrollIntoView():s)}return!0}}const Ey=Sy(!1,!0),My=Sy(!0,!0);ze.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,n=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let t=!1;return[new Ve({key:new Ue("characterCount"),appendTransaction:(e,n,o)=>{if(t)return;const i=this.options.limit;if(i==null||i===0)return void(t=!0);const s=this.storage.characters({node:o.doc});if(s>i){const l=s-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const c=o.tr.deleteRange(0,l);return t=!0,c}t=!0},filterTransaction:(e,n)=>{const o=this.options.limit;if(!e.docChanged||o===0||o==null)return!0;const i=this.storage.characters({node:n.doc}),s=this.storage.characters({node:e.doc});if(s<=o||i>o&&s>o&&s<=i)return!0;if(i>o&&s>o&&s>i||!e.getMeta("paste"))return!1;const a=e.selection.$head.pos,l=a-(s-o),c=a;return e.deleteRange(l,c),!(this.storage.characters({node:e.doc})>o)}})]}});var WE=ze.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[AE(this.options)]}});ze.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new Ve({key:new Ue("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:o}=this.editor,{anchor:i}=e,s=[];if(!n||!o)return Te.create(t,[]);let a=0;this.options.mode==="deepest"&&t.descendants((c,d)=>{if(!c.isText)return i>=d&&i<=d+c.nodeSize-1&&void(a+=1)});let l=0;return t.descendants((c,d)=>!c.isText&&i>=d&&i<=d+c.nodeSize-1&&(l+=1,this.options.mode==="deepest"&&a-l>0||this.options.mode==="shallowest"&&l>1?this.options.mode==="deepest":void s.push(st.node(d,d+c.nodeSize,{class:this.options.className})))),Te.create(t,s)}}})]}});var KE=ze.create({name:"gapCursor",addProseMirrorPlugins:()=>[new Ve({props:{decorations:PE,createSelectionBetween:(t,e,n)=>e.pos==n.pos&&Ae.valid(n)?new Ae(n):null,handleClick:LE,handleKeyDown:RE,handleDOMEvents:{beforeinput:$E}}})],extendNodeSchema(t){var e;return{allowGapCursor:(e=ve(ne(t,"allowGapCursor",{name:t.name,options:t.options,storage:t.storage})))!=null?e:null}}});function Ny({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}ze.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new Ve({key:new Ue("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:o}=e,i=[];if(!n)return null;const s=this.editor.isEmpty;return t.descendants((a,l)=>{const c=o>=l&&o<=l+a.nodeSize,d=!a.isLeaf&&js(a);if((c||!this.options.showOnlyCurrent)&&d){const u=[this.options.emptyNodeClass];s&&u.push(this.options.emptyEditorClass);const p=st.node(l,l+a.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:l,hasAnchor:c}):this.options.placeholder});i.push(p)}return this.options.includeChildren}),Te.create(t,i)}}})]}}),ze.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new Ve({key:new Ue("selection"),props:{decorations:n=>n.selection.empty||t.isFocused||!t.isEditable||Tv(n.selection)||t.view.dragging?null:Te.create(n.doc,[st.inline(n.selection.from,n.selection.to,{class:e.className})])}})]}});var UE=ze.create({name:"trailingNode",addOptions:()=>({node:void 0,notAfter:[]}),addProseMirrorPlugins(){var t;const e=new Ue(this.name),n=((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||this.options.node||"paragraph",o=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(n).includes(i.name));return[new Ve({key:e,appendTransaction:(i,s,a)=>{const{doc:l,tr:c,schema:d}=a,u=e.getState(a),p=l.content.size,h=d.nodes[n];if(u)return c.insert(p,h.create())},state:{init:(i,s)=>!Ny({node:s.tr.doc.lastChild,types:o}),apply:(i,s)=>i.docChanged?!Ny({node:i.doc.lastChild,types:o}):s}})]}}),qE=ze.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:t,dispatch:e})=>Ey(t,e),redo:()=>({state:t,dispatch:e})=>My(t,e)}),addProseMirrorPlugins(){return[HE(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),JE=ze.create({name:"starterKit",addExtensions(){var t,e,n,o;const i=[];return this.options.bold!==!1&&i.push(XS.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(US.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(ay.configure(this.options.bulletList)),this.options.code!==!1&&i.push(eE.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(oE.configure(this.options.codeBlock)),this.options.document!==!1&&i.push(rE.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(WE.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(KE.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(iE.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(sE.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(qE.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(aE.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(pE.configure(this.options.italic)),this.options.listItem!==!1&&i.push(ly.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(fy.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&i.push(wE.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&i.push(by.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(BE.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(_E.configure(this.options.strike)),this.options.text!==!1&&i.push(VE.configure(this.options.text)),this.options.underline!==!1&&i.push(DE.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(UE.configure((o=this.options)==null?void 0:o.trailingNode)),i}}),GE=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,YE=ut.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",Re(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,n,o,i,s,a;const l=(n=(e=t.attrs)==null?void 0:e.src)!=null?n:"",c=(i=(o=t.attrs)==null?void 0:o.alt)!=null?i:"",d=(a=(s=t.attrs)==null?void 0:s.title)!=null?a:"";return d?`![${c}](${l} "${d}")`:`![${c}](${l})`},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[jv({find:GE,type:this.type,getAttributes:t=>{const[,,e,n,o]=t;return{src:n,alt:e,title:o}}})]}});const By=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&WorkerGlobalScope;const XE=Object.prototype.toString,ur=()=>{},QE=ZE();function ZE(){var t,e;return By&&((t=window==null?void 0:window.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function $d(t){return Array.isArray(t)?t:[t]}const Ty=By?window:void 0;function gi(t){var e;const n=r.toValue(t);return(e=n==null?void 0:n.$el)!=null?e:n}function Pd(...t){const e=[],n=()=>{e.forEach(d=>d()),e.length=0},o=r.computed(()=>{const d=$d(r.toValue(t[0])).filter(u=>u!=null);return d.every(u=>typeof u!="string")?d:void 0}),i=(s=()=>{var d,u;return[(u=(d=o.value)==null?void 0:d.map(p=>gi(p)))!=null?u:[Ty].filter(p=>p!=null),$d(r.toValue(o.value?t[1]:t[0])),$d(r.unref(o.value?t[2]:t[1])),r.toValue(o.value?t[3]:t[2])]},a=([d,u,p,h])=>{if(n(),!(d!=null&&d.length)||!(u!=null&&u.length)||!(p!=null&&p.length))return;const f=(m=h,XE.call(m)==="[object Object]"?{...h}:h);var m;e.push(...d.flatMap(g=>u.flatMap(v=>p.map(b=>((y,k,x,w)=>(y.addEventListener(k,x,w),()=>y.removeEventListener(k,x,w)))(g,v,b,f)))))},l={flush:"post"},r.watch(s,a,{...l,immediate:!0}));var s,a,l,c;return c=n,r.getCurrentScope()&&r.onScopeDispose(c),()=>{i(),n()}}let Oy=!1;const fn=Symbol("mc-select-plus-context"),_y="mc-select-plus",eM={key:1},tM=q(r.defineComponent({name:"mc-select-selected-content",__name:"index",setup(t){const{selectedOptions:e,isDisabled:n}=r.inject(fn),o=r.computed(()=>Be(e.value)?void 0:e.value[0]),i=r.computed(()=>{var a,l;return Be(o.value)?void 0:o.value.label??((l=(a=o.value)==null?void 0:a.value)==null?void 0:l.toString())}),s=r.computed(()=>Be(o.value)?void 0:o.value.context);return(a,l)=>{var c;return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-select-selected-content",{"is-disabled":r.unref(n)}])},[s.value||a.$slots.default?r.renderSlot(a.$slots,"default",{key:0,selectedOption:(c=o.value)==null?void 0:c.value,selectedOptionLabel:i.value,isDisabled:r.unref(n)},()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(s.value)))],!0):(r.openBlock(),r.createElementBlock("span",eM,r.toDisplayString(i.value),1))],2)}}}),[["__scopeId","data-v-2417c622"]]),Vy="mc-tag",nM={class:"mc-tag-content"},oM=r.defineComponent({name:Vy,__name:"mc-tag",props:{width:{},height:{},size:{default:"small"},type:{default:"basic"},emphasis:{default:"bold"},disabled:{type:Boolean,default:!1},deletable:{type:Boolean,default:!0},leftIcon:{},rightIcon:{},content:{}},emits:["delete","click"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref(),a=()=>{o.deletable||i("click")},l=r.computed(()=>o.type==="selectable"&&o.deletable),c=()=>{o.disabled||i("delete")};return e({ref:s}),(d,u)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-tag",[`mc-tag-${t.size}`,`mc-tag-${t.type}`,`mc-tag-${t.emphasis}`,{"mc-tag-disabled":t.disabled}]]),ref_key:"_ref",ref:s,style:r.normalizeStyle({width:t.width,height:t.height}),onClick:a},[t.leftIcon?(r.openBlock(),r.createBlock(r.unref(ge),{key:0,name:t.leftIcon,class:"mc-tag-left-icon",size:16},null,8,["name"])):r.createCommentVNode("",!0),r.createElementVNode("div",nM,[r.renderSlot(d.$slots,"default",{},()=>[r.createTextVNode(r.toDisplayString(t.content),1)],!0)]),t.rightIcon?(r.openBlock(),r.createBlock(r.unref(ge),{key:1,name:t.rightIcon,class:"mc-tag-right-icon",size:16},null,8,["name"])):r.createCommentVNode("",!0),l.value?(r.openBlock(),r.createBlock(r.unref(ge),{key:2,name:"Cross",class:"mc-tag-delete-icon",size:16,onClick:r.withModifiers(c,["stop"])})):r.createCommentVNode("",!0)],6))}}),zd=ee(q(oM,[["__scopeId","data-v-f5c2d2d8"]])),rM={class:"mc-select-selected-content-multi"},iM=q(r.defineComponent({name:"mc-select-selected-content-multi",__name:"index",props:{isFocused:{type:Boolean,default:!1},isHovering:{type:Boolean,default:!1},maxTags:{default:void 0}},setup(t){const{isMulti:e,selectedOptions:n,isDisabled:o,deleteTag:i}=r.inject(fn),s=t,a=r.computed(()=>{const c=s.maxTags,d=n.value;if(Sr(c)){const u=d.length-c,p=[];for(let h=0;h<c&&h<d.length;h++){const f=d[h];p.push({label:`${f.label??f.value}`,item:f.value,selectable:!0})}return u>0&&p.push({label:`+${u}`,item:"rest",selectable:!1}),p}return bn(d,u=>({label:`${u.label??u.value}`,item:u.value,selectable:!0}))}),l=r.computed(()=>s.isFocused||s.isHovering?"minimal":"bold");return(c,d)=>(r.openBlock(),r.createElementBlock("ul",rM,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,u=>(r.openBlock(),r.createElementBlock("li",{key:`${u.item}`,class:"mc-select-selected-tag"},[r.createVNode(r.unref(zd),{size:"x-small",type:"selectable",deletable:u.selectable,emphasis:l.value,disabled:r.unref(o),onDelete:p=>{return h=u.item,void(e.value&&i(h));var h}},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(u.label),1)]),_:2},1032,["deletable","emphasis","disabled","onDelete"])]))),128))]))}}),[["__scopeId","data-v-aac507b5"]]),sM=["value","placeholder","disabled","readonly","onKeydown"],aM={class:"mc-select-placeholder"},lM={class:"mc-select-trigger-toolbar"},cM=r.defineComponent({name:"mc-select-trigger",__name:"index",props:{search:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},placeholder:{default:"Please select"},searchValue:{default:void 0},isExpanded:{type:Boolean,default:!1},maxTags:{default:void 0},hideValidationIcon:{type:Boolean}},emits:["update:searchValue","update:isExpanded","press:arrow","search","focus","blur","clear"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(),{wrapperRef:s,isFocused:a,handleFocus:l,handleBlur:c}=Xn(i),{isHovering:d}=ul(s),{selectedOptions:u,isMulti:p,isDisabled:h,validateStatus:f,isTopPlacement:m}=r.inject(fn),g=r.computed(()=>ce(u.value)?u.value.length>0:!!u.value),v=M=>{const{value:N}=M.target;o("update:searchValue",N),o("search")},b=()=>{h.value||o("update:isExpanded",!n.isExpanded)},{showClearIcon:y,mouseOverIcon:k}=(()=>{const M=r.ref(!1),N=ue("clearable"),T=ue("isDisabled");return{showClearIcon:r.computed(()=>!!N.value&&M.value&&!T.value),mouseOverIcon:A=>{M.value=A}}})(),x=r.computed(()=>g.value&&y.value&&!h.value),w=()=>{o("clear")},C=r.computed(()=>h.value?"not-allowed":n.search?"text":"pointer"),S=()=>{h.value||o("update:isExpanded",!n.isExpanded)},E=M=>{h.value||o("press:arrow",M)};return(M,N)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"triggerRef",ref:s,class:r.normalizeClass(["mc-select-trigger",{"is-hovering":r.unref(d),"is-focused":r.unref(a),"is-expanded":t.isExpanded,"is-disabled":r.unref(h),"is-error":r.unref(f)==="error","is-success":r.unref(f)==="success","is-top-placement":r.unref(m)}]),onClick:b},[r.createElementVNode("div",{class:"mc-select-trigger-selected-content",style:r.normalizeStyle({cursor:C.value})},[r.createElementVNode("div",{class:"mc-select-trigger-input-wrapper",style:r.normalizeStyle({width:t.searchValue||!g.value?"100%":"1em"})},[r.createElementVNode("input",{value:t.searchValue,ref_key:"inputRef",ref:i,class:"mc-select-input",placeholder:t.placeholder,disabled:r.unref(h),readonly:!t.search||r.unref(h),onInput:v,onFocus:N[0]||(N[0]=(...T)=>r.unref(l)&&r.unref(l)(...T)),onBlur:N[1]||(N[1]=(...T)=>r.unref(c)&&r.unref(c)(...T)),onKeydown:[r.withKeys(r.withModifiers(S,["stop","prevent"]),["enter"]),r.withKeys(r.withModifiers(E,["stop","prevent"]),["arrow-down"]),r.withKeys(r.withModifiers(E,["stop","prevent"]),["arrow-up"])]},null,40,sM),r.withDirectives(r.createElementVNode("div",aM,[r.renderSlot(M.$slots,"placeholder",{placeholder:t.placeholder,isDisabled:r.unref(h)},()=>[r.createElementVNode("span",null,r.toDisplayString(t.placeholder),1)],!0)],512),[[r.vShow,!t.searchValue&&!g.value]])],4),r.unref(p)?r.withDirectives((r.openBlock(),r.createBlock(iM,{key:0,"max-tags":t.maxTags,"is-focused":r.unref(a),"is-hovering":r.unref(d)},null,8,["max-tags","is-focused","is-hovering"])),[[r.vShow,g.value&&!t.searchValue]]):r.withDirectives((r.openBlock(),r.createBlock(tM,{key:1},r.createSlots({_:2},[M.$slots["selected-content"]?{name:"default",fn:r.withCtx(({selectedOption:T,selectedOptionLabel:A,isDisabled:$})=>[r.renderSlot(M.$slots,"selected-content",{selectedOption:T,selectedOptionLabel:A,isDisabled:$},void 0,!0)]),key:"0"}:void 0]),1536)),[[r.vShow,g.value&&!t.searchValue]])],4),r.createElementVNode("div",lM,[r.withDirectives(r.createVNode(r.unref(Ee),{class:"mc-select-status-icon",name:r.unref(f)==="error"?"reject-fail-rev":"accept-success-rev",size:24},null,8,["name"]),[[r.vShow,r.unref(f)!=="init"&&!t.hideValidationIcon]]),r.createElementVNode("div",{class:"mc-select-icon-wrapper",onMouseenter:N[3]||(N[3]=T=>r.unref(k)(!0)),onMouseleave:N[4]||(N[4]=T=>r.unref(k)(!1))},[r.withDirectives(r.createVNode(r.unref(Ee),{class:"mc-select-chevron-icon",name:"down-chevron",size:24,cursor:r.unref(h)?"not-allowed":"pointer"},null,8,["cursor"]),[[r.vShow,!x.value]]),r.withDirectives(r.createElementVNode("div",{onClick:N[2]||(N[2]=r.withModifiers(()=>{},["stop"]))},[r.createVNode(r.unref(Ee),{class:"mc-select-clear-icon",name:"rejectfail",size:16,cursor:"pointer",onClick:w})],512),[[r.vShow,x.value]])],32)])],2))}}),dM=q(cM,[["__scopeId","data-v-61e04dfa"]]),uM={class:"mc-select-list-wrapper"},pM={key:0,class:"mc-select-list-header"},hM={key:0,class:"mc-select-list-header-content"},fM={class:"mc-select-list-content"},mM={key:0,class:"mc-select-list-empty"},gM={key:1,class:"mc-select-list-footer"},vM=r.defineComponent({name:"mc-select-list",__name:"index",props:{showFooter:{type:Boolean},showHeader:{type:Boolean}},setup(t){const{filteredOptions:e,isMulti:n,isTopPlacement:o}=r.inject(fn),i=r.computed(()=>!Be(e.value)),{isSelectAll:s,isSelectPartial:a,selectAll:l}=(()=>{const{isMulti:c,selectedOptions:d,selectOptions:u,selectAll:p}=r.inject(fn),h=r.ref(!1),f=r.ref(!1);return r.watchEffect(()=>{var g,v;if(!c.value)return;const m=d.value;m!=null&&m.length&&((g=u.value)!=null&&g.length)&&(m==null?void 0:m.length)===((v=u.value)==null?void 0:v.length)?(h.value=!0,f.value=!1):(m==null?void 0:m.length)>0?(h.value=!1,f.value=!0):(h.value=!1,f.value=!1)}),{isSelectAll:h,isSelectPartial:f,selectAll:p}})();return(c,d)=>(r.openBlock(),r.createElementBlock("div",uM,[r.createElementVNode("ul",{class:r.normalizeClass(["mc-select-list",{"is-top-placement":r.unref(o)}])},[t.showHeader?(r.openBlock(),r.createElementBlock("li",pM,[r.renderSlot(c.$slots,"header",{isEmpty:!i.value},()=>[r.unref(n)?(r.openBlock(),r.createElementBlock("div",hM,[r.createVNode(r.unref(Wo),{"model-value":r.unref(s),partial:r.unref(a),content:"Select All","disable-validation":"","onUpdate:modelValue":r.unref(l)},null,8,["model-value","partial","onUpdate:modelValue"])])):r.createCommentVNode("",!0)],!0)])):r.createCommentVNode("",!0),r.createElementVNode("ul",fM,[r.renderSlot(c.$slots,"default",{},void 0,!0),i.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("li",mM,[r.renderSlot(c.$slots,"empty",{},()=>[d[0]||(d[0]=r.createElementVNode("p",{class:"mc-select-list-empty-text"},"No results found",-1))],!0)]))]),t.showFooter?(r.openBlock(),r.createElementBlock("li",gM,[r.renderSlot(c.$slots,"footer",{isEmpty:!i.value},void 0,!0)])):r.createCommentVNode("",!0)],2)]))}}),yM=q(vM,[["__scopeId","data-v-359e20b8"]]),Dy="mc-select-multi-option",bM={class:"mc-select-multi-option"},Fd=ee(r.defineComponent({name:Dy,__name:"mc-select-multi-option",props:{modelValue:{type:Boolean,default:!1},label:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,o=i=>{n("update:modelValue",i)};return(i,s)=>(r.openBlock(),r.createElementBlock("div",bM,[r.createVNode(r.unref(Wo),{"model-value":t.modelValue,content:t.label,"disable-validation":"",disabled:t.disabled,"onUpdate:modelValue":o},null,8,["model-value","content","disabled"])]))}})),jd="mc-select-option-plus",kM=["aria-selected"],wM={key:1,class:"mc-select-option-label"},vi=ee(q(r.defineComponent({name:jd,__name:"mc-select-option-plus",props:{label:{},value:{type:[String,Number,Boolean]},height:{default:40},width:{default:"100%"},disabled:{type:Boolean}},setup(t){const e=t,{height:n,width:o}=lt(),{isMulti:i,selectedOptions:s,filteredOptions:a,hoverOption:l,select:c,hover:d}=r.inject(fn),u=r.computed(()=>!!zi(a.value,b=>b.value===e.value)),p=r.computed(()=>al(s.value,b=>b.value===e.value)),h=r.ref(!1),f=r.computed(()=>e.label),m=()=>{d(e.value)},g=r.computed(()=>l.value===e.value),v=()=>{e.disabled||c(e.value)};return(b,y)=>r.withDirectives((r.openBlock(),r.createElementBlock("li",{role:"option",class:r.normalizeClass(["mc-select-option",{"mc-select-option-actived":p.value&&!r.unref(i),"mc-select-option-hover":g.value,"mc-select-option-disabled":t.disabled}]),style:r.normalizeStyle({height:r.unref(n),width:r.unref(o)}),"aria-selected":h.value,onMouseenter:m,onClick:v},[r.renderSlot(b.$slots,"default",{isActived:p.value,isDisabled:t.disabled},()=>[r.unref(i)?(r.openBlock(),r.createBlock(r.unref(Fd),{key:0,"model-value":p.value,label:f.value,disabled:t.disabled},null,8,["model-value","label","disabled"])):(r.openBlock(),r.createElementBlock("span",wM,r.toDisplayString(f.value),1))],!0)],46,kM)),[[r.vShow,u.value]])}}),[["__scopeId","data-v-77d81b1d"]])),Hd="mc-select-group-plus",xM={class:"mc-select-group"},CM={class:"mc-select-option-list"},Ay=ee(q(r.defineComponent({name:Hd,__name:"mc-select-group-plus",props:{label:{},height:{default:40},width:{default:"100%"}},setup(t){const e=t,{filteredGroups:n}=r.inject(fn),{height:o,width:i}=lt(),s=r.computed(()=>Ct(n.value,e.label));return(a,l)=>r.withDirectives((r.openBlock(),r.createElementBlock("ul",xM,[r.createElementVNode("li",{class:"mc-select-group-label",style:r.normalizeStyle({height:r.unref(o),width:r.unref(i)})},r.toDisplayString(t.label),5),r.createElementVNode("li",null,[r.createElementVNode("ul",CM,[r.renderSlot(a.$slots,"default",{},void 0,!0)])])],512)),[[r.vShow,s.value]])}}),[["__scopeId","data-v-fad05d30"]])),Iy=()=>{const t=r.ref("bottom-start"),e=r.computed(()=>t.value==="top-start");return{placement:t,isTopPlacement:e}},SM=["id"],EM=r.defineComponent({name:_y,__name:"mc-select-plus",props:{width:{default:320},height:{default:40},placeholder:{default:"Please select"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},maxTags:{},search:{type:Boolean,default:!1},options:{},showHeader:{type:Boolean,default:!1},showFooter:{type:Boolean,default:!1},modelValue:{type:[String,Number,Boolean,Array]},inputGroupPosition:{},disableValidation:{type:Boolean,default:!1},hideValidationIcon:{type:Boolean,default:!1},validateProp:{},positionStrategy:{default:"absolute"},teleportTo:{}},emits:["update:modelValue","change","focus","blur","expand"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(!1);r.watch(i,B=>{o("expand",B)});const{selectOptions:s}=(()=>{let B=[];const V=r.ref([]),O=r.getCurrentInstance().proxy;return r.watchEffect(()=>{var F,R;V.value=[];const D=(R=(F=O.$slots).default)==null?void 0:R.call(F);if(D.length){const L=(I=>{const P=[],W=(z,j)=>{ce(z)&&z.forEach(K=>{var Z,J,Y,te,pe,X,oe,ae;const G=(Z=(K==null?void 0:K.type)||{})==null?void 0:Z.name;if(G===Hd){const se=Ao(K.children)||ce(K.children)||!He((J=K.children)==null?void 0:J.default)?K.children:(Y=K.children)==null?void 0:Y.default();W(se,(te=K.props)==null?void 0:te.label)}else G===jd?P.push({label:(pe=K.props)==null?void 0:pe.label,value:(X=K.props)==null?void 0:X.value,disabled:(oe=K.props)==null?void 0:oe.disabled,group:j,context:(ae=K.children)==null?void 0:ae.default}):Array.isArray(K.children)&&W(K.children,j)})};return W(I),P})(D);V.value=[...L]}((L,I)=>{if(L.length!==I.length)return!1;for(const[P]of L.entries())if(L[P]!=I[P])return!1;return!0})(V.value,B)||(B=V.value)}),{selectOptions:V}})(),{selectedOptions:a}=(B=>{const V=ue("modelValue"),O=ue("multiple");return{selectedOptions:r.computed(()=>{if(ye(V.value))return[];if(O.value&&ce(V.value))return B.value.filter(D=>Ct(V.value,D.value));{const D=B.value.find(F=>F.value===V.value);return D?[D]:[]}})}})(s),{searchValue:l,isSearch:c,filteredOptions:d,filteredGroups:u,clearSearchValue:p}=(B=>{const V=r.ref(""),O=ue("search"),D=r.computed(()=>!!O.value),F=r.computed(()=>B!=null&&B.value.length?bn(Cr(B.value,L=>Ct(ll(L.label),ll(V.value))),L=>({value:L.value,group:L.group})):[]),R=r.computed(()=>{return F.value.length?bn((L=F.value)&&L.length?function(I,P){var W=-1,z=Ia,j=I.length,K=!0,G=[],Z=G;if(j>=200){var J=P?null:fk(I);if(J)return tl(J);K=!1,z=el,Z=new Vo}else Z=P?[]:G;e:for(;++W<j;){var Y=I[W],te=P?P(Y):Y;if(Y=Y!==0?Y:0,K&&te==te){for(var pe=Z.length;pe--;)if(Z[pe]===te)continue e;P&&Z.push(te),G.push(Y)}else z(Z,te,void 0)||(Z!==G&&Z.push(te),G.push(Y))}return G}(L,yn("group")):[],I=>I.group):[];var L});return{searchValue:V,isSearch:D,filteredOptions:F,filteredGroups:R,clearSearchValue:()=>{V.value=""}}})(s),h=async()=>{n.search&&(i.value||(i.value=!0))},f=r.ref();(function(B,V,O={}){const{window:D=Ty,ignore:F=[],capture:R=!0,detectIframe:L=!1,controls:I=!1}=O;if(!D)return I?{stop:ur,cancel:ur,trigger:ur}:ur;if(QE&&!Oy){Oy=!0;const j={passive:!0};Array.from(D.document.body.children).forEach(K=>K.addEventListener("click",ur,j)),D.document.documentElement.addEventListener("click",ur,j)}let P=!0;const W=j=>r.toValue(F).some(K=>{if(typeof K=="string")return Array.from(D.document.querySelectorAll(K)).some(G=>G===j.target||j.composedPath().includes(G));{const G=gi(K);return G&&(j.target===G||j.composedPath().includes(G))}});let z=!1;[Pd(D,"click",j=>{z||(z=!0,setTimeout(()=>{z=!1},0),(K=>{const G=gi(B);K.target!=null&&(G instanceof Element||!function(Z){const J=r.toValue(Z);return J&&J.$.subTree.shapeFlag===16}(B)||!function(Z,J){const Y=r.toValue(Z),te=Y.$.subTree&&Y.$.subTree.children;return!(te==null||!Array.isArray(te))&&te.some(pe=>pe.el===J.target||J.composedPath().includes(pe.el))}(B,K))&&G&&G!==K.target&&!K.composedPath().includes(G)&&("detail"in K&&K.detail===0&&(P=!W(K)),P?V(K):P=!0)})(j))},{passive:!0,capture:R}),Pd(D,"pointerdown",j=>{const K=gi(B);P=!W(j)&&!(!K||j.composedPath().includes(K))},{passive:!0}),L&&Pd(D,"blur",j=>{setTimeout(()=>{var K;const G=gi(B);((K=D.document.activeElement)==null?void 0:K.tagName)!=="IFRAME"||G!=null&&G.contains(D.document.activeElement)||V(j)},0)},{passive:!0})].filter(Boolean)})(f,()=>{p(),i.value=!1});const m=()=>{i.value=!1,p(),T(n.multiple?[]:void 0)},{hoverOption:g,setHoverOption:v,handlePressArrow:b}=(B=>{const V=r.ref(),O=()=>{V.value=void 0};return{hoverOption:V,setHoverOption:D=>{V.value=D},handlePressArrow:D=>{var R,L,I,P,W;if(!(B!=null&&B.value.length))return void O();if(!V.value)return void(V.value=(R=B.value[0])==null?void 0:R.value);const F=Do(B==null?void 0:B.value,z=>z.value===V.value);D.key==="ArrowDown"?V.value=((L=B.value[F+1])==null?void 0:L.value)||((I=B.value[0])==null?void 0:I.value):D.key==="ArrowUp"&&(V.value=((P=B.value[F-1])==null?void 0:P.value)||((W=B.value[B.value.length-1])==null?void 0:W.value))},clearHoverOption:O}})(d),{width:y,height:k}=lt(),x=r.inject(Rr,void 0),{formId:w,formDisabled:C,validateStatus:S,validateByTrigger:E}=Nt({externalDisabled:r.computed(()=>!!(x!=null&&x.disabled.value))});r.watch(C,B=>{B&&(i.value=!1,p())}),r.watch(S,B=>{x&&x.setValidateStatus(B)});const M=()=>{o("focus")},N=()=>{E("blur"),o("blur")},T=B=>{o("update:modelValue",B),o("change",B)},{placement:A,isTopPlacement:$}=Iy();return r.provide(fn,{isMulti:r.computed(()=>n.multiple),isDisabled:r.computed(()=>C.value),validateStatus:S,selectOptions:s,selectedOptions:a,filteredOptions:d,filteredGroups:u,hoverOption:g,isTopPlacement:$,deleteTag:async B=>{if(!n.multiple)return;const V=bn(a.value,D=>D.value),O=Cp(V,[B]);T(O)},select:async B=>{if(p(),n.multiple){const V=n.modelValue;if(ce(V)&&!Be(V))if(Ct(V,B)){const O=Cp([...V],[B]);T(O)}else T([...V,B]);else T([B])}else i.value=!1,T(B)},selectAll:async B=>{if(!n.multiple)return;p();const V=B?s.value.map(O=>O.value):[];T(V)},hover:v}),(B,V)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"selectRef",ref:f,id:r.unref(w),class:"mc-select",style:r.normalizeStyle({width:r.unref(y)})},[r.createVNode(r.unref(ps),{"is-show":i.value,placement:r.unref(A),"onUpdate:placement":V[2]||(V[2]=O=>r.isRef(A)?A.value=O:null),strategy:t.positionStrategy,"teleport-to":t.teleportTo},{content:r.withCtx(()=>[r.createVNode(yM,{"show-header":t.showHeader,"show-footer":t.showFooter},r.createSlots({default:r.withCtx(()=>[r.renderSlot(B.$slots,"default",{},void 0,!0)]),_:2},[B.$slots["option-header"]?{name:"header",fn:r.withCtx(({isEmpty:O})=>[r.renderSlot(B.$slots,"option-header",{isEmpty:O},void 0,!0)]),key:"0"}:void 0,B.$slots["option-footer"]?{name:"footer",fn:r.withCtx(({isEmpty:O})=>[r.renderSlot(B.$slots,"option-footer",{isEmpty:O},void 0,!0)]),key:"1"}:void 0,B.$slots.empty?{name:"empty",fn:r.withCtx(()=>[r.renderSlot(B.$slots,"empty",{},void 0,!0)]),key:"2"}:void 0]),1032,["show-header","show-footer"])]),default:r.withCtx(()=>[r.createVNode(dM,{"search-value":r.unref(l),"onUpdate:searchValue":V[0]||(V[0]=O=>r.isRef(l)?l.value=O:null),"is-expanded":i.value,"onUpdate:isExpanded":V[1]||(V[1]=O=>i.value=O),search:r.unref(c),clearable:t.clearable,placeholder:t.placeholder,"max-tags":t.maxTags,"hide-validation-icon":t.hideValidationIcon,onSearch:h,onClear:m,"onPress:arrow":r.unref(b),onFocus:M,onBlur:N,style:r.normalizeStyle({height:r.unref(k)})},r.createSlots({_:2},[B.$slots.placeholder?{name:"placeholder",fn:r.withCtx(({placeholder:O,isDisabled:D})=>[r.renderSlot(B.$slots,"placeholder",{placeholder:O,isDisabled:D},void 0,!0)]),key:"0"}:void 0,B.$slots["selected-content"]?{name:"selected-content",fn:r.withCtx(({selectedOption:O,selectedOptionLabel:D,isDisabled:F})=>[r.renderSlot(B.$slots,"selected-content",{selectedOption:O,selectedOptionLabel:D,isDisabled:F},void 0,!0)]),key:"1"}:void 0]),1032,["search-value","is-expanded","search","clearable","placeholder","max-tags","hide-validation-icon","onPress:arrow","style"])]),_:3},8,["is-show","placement","strategy","teleport-to"])],12,SM))}}),Wd=ee(q(EM,[["__scopeId","data-v-2425910a"]])),Ry="McRichtext",Ly="McRichtextTool";var Ce=(t=>(t.NORMAL="normal",t.SMALL="small",t.FOOTNOTE="footnote",t.BOLD="bold",t.ITALIC="italic",t.LIST="list",t.ORDERED_LIST="numbering",t.LINK="link",t.IMAGE="document-image",t.CLEAR="input-reset",t))(Ce||{}),wo=(t=>(t.NORMAL="mc-richtext-normal-text",t.SMALL="mc-richtext-small-text",t.FOOTNOTE="mc-richtext-footnote",t))(wo||{});const xo=q(r.defineComponent({name:Ly,__name:"mc-richtext-tool",props:{icon:{},isActive:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:e}){const n=e;return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-richtext-tool",{"mc-richtext-tool-icon-actived":t.isActive}])},[r.renderSlot(o.$slots,"default",{isActive:t.isActive},()=>[(r.openBlock(),r.createBlock(xh,{class:"mc-richtext-tool-icon",key:t.icon,name:t.icon,size:24,cursor:"pointer",onClick:i[0]||(i[0]=s=>{return a=t.icon,void n("click",a);var a})},null,8,["name"]))],!0)],2))}}),[["__scopeId","data-v-ca9eaab3"]]),MM=$n.create({name:"custom-font",addAttributes:()=>({class:{default:null,parseHTML:t=>t.getAttribute("class"),renderHTML:t=>t.class?{class:t.class}:{}}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("class")&&null}],renderHTML:({HTMLAttributes:t})=>["span",t,0]}),NM={class:"mc-richtext-toolbar"},BM={class:"mc-richtext-font-selector"},TM={class:"mc-richtext-tool-group"},OM={class:"mc-richtext-tool-group"},_M={class:"mc-richtext-tool-group"},VM={class:"mc-richtext-attach-link"},DM=r.defineComponent({name:Ry,__name:"mc-richtext",props:{modelValue:{default:""},width:{default:"100%"},height:{}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref(),{width:a,height:l}=lt(),c=((M={})=>{const N=r.shallowRef();return r.onMounted(()=>{N.value=new HS(M)}),r.onBeforeUnmount(()=>{var T,A,$;const B=(T=N.value)==null?void 0:T.view.dom,V=B==null?void 0:B.cloneNode(!0);(A=B==null?void 0:B.parentNode)==null||A.replaceChild(V,B),($=N.value)==null||$.destroy()}),N})({content:`${o.modelValue}`,extensions:[JE,YE.configure({inline:!0,allowBase64:!0}),MM],onUpdate:({editor:M})=>{i("update:modelValue",M.getHTML())}});r.watch(()=>o.modelValue,M=>{const N=c.value,T=N==null?void 0:N.getHTML();N&&T!==M&&N.commands.setContent(M)});const d=r.ref(Ce.NORMAL),u=M=>{M===Ce.NORMAL?p():M===Ce.SMALL?h():M===Ce.FOOTNOTE?f():M===Ce.BOLD?m():M===Ce.ITALIC?g():M===Ce.LIST?v():M===Ce.ORDERED_LIST?b():M===Ce.LINK?w():M===Ce.IMAGE?C():M===Ce.CLEAR&&E()},p=()=>{var M;(M=c.value)==null||M.commands.setMark("custom-font",{class:wo.NORMAL})},h=()=>{var M;(M=c.value)==null||M.commands.setMark("custom-font",{class:wo.SMALL})},f=()=>{var M;(M=c.value)==null||M.commands.setMark("custom-font",{class:wo.FOOTNOTE})},m=()=>{var M;(M=c.value)==null||M.commands.toggleBold()},g=()=>{var M;(M=c.value)==null||M.commands.toggleItalic()},v=()=>{var M;(M=c.value)==null||M.commands.toggleList("bulletList","listItem")},b=()=>{var M;(M=c.value)==null||M.commands.toggleList("orderedList","listItem")};r.watchEffect(()=>{const M=c.value;if(!M)return;const N=M.getAttributes("custom-font").class;N===wo.SMALL?d.value=Ce.SMALL:N===wo.FOOTNOTE?d.value=Ce.FOOTNOTE:d.value=Ce.NORMAL});const y=r.ref(),k=r.ref(""),x=()=>{var M;k.value=((M=c.value)==null?void 0:M.getAttributes("link").href)||""},w=()=>{var N,T,A;const M=k.value;M?((N=c.value)==null||N.commands.setLink({href:M}),k.value=""):((T=c.value)==null||T.commands.unsetLink(),k.value=""),(A=y.value)==null||A.hide()},C=()=>{var M;(M=s.value)==null||M.click()},S=M=>{var $;const N=M.target,T=($=N.files)==null?void 0:$[0];if(!T||!T.type.startsWith("image/"))return;const A=new FileReader;A.onload=B=>{var O,D;const V=(O=B.target)==null?void 0:O.result;V&&((D=c.value)==null||D.commands.setImage({src:V}))},A.onerror=()=>{console.error("mc-richtext: error:read:image:",T.name)},A.readAsDataURL(T),N.value=""},E=()=>{var M;(M=c.value)==null||M.chain().focus().unsetAllMarks().clearNodes().run()};return e({editor:c.value,getText:()=>{var M;return(M=c.value)==null?void 0:M.getText()}}),(M,N)=>{var T,A,$,B,V,O;return r.openBlock(),r.createElementBlock("div",{class:"mc-richtext",style:r.normalizeStyle({width:r.unref(a),height:r.unref(l)})},[r.createElementVNode("section",NM,[r.createElementVNode("div",BM,[r.createVNode(r.unref(Wd),{modelValue:d.value,"onUpdate:modelValue":N[0]||(N[0]=D=>d.value=D),width:148,height:32,"disable-validation":"",onChange:N[1]||(N[1]=D=>u(D))},{"selected-content":r.withCtx(({selectedOptionLabel:D})=>[r.createElementVNode("span",{class:r.normalizeClass(["mc-richtext-font-selected",`mc-richtext-font-${d.value}`])},r.toDisplayString(D),3)]),default:r.withCtx(()=>[r.createVNode(r.unref(vi),{value:r.unref(Ce).NORMAL,label:"Normal text"},{default:r.withCtx(()=>[...N[4]||(N[4]=[r.createElementVNode("span",{class:"mc-richtext-font-normal"},"Normal text",-1)])]),_:1},8,["value"]),r.createVNode(r.unref(vi),{value:r.unref(Ce).SMALL,label:"Small text"},{default:r.withCtx(()=>[...N[5]||(N[5]=[r.createElementVNode("span",{class:"mc-richtext-font-small"},"Small text",-1)])]),_:1},8,["value"]),r.createVNode(r.unref(vi),{value:r.unref(Ce).FOOTNOTE,label:"Footnote"},{default:r.withCtx(()=>[...N[6]||(N[6]=[r.createElementVNode("span",{class:"mc-richtext-font-footnote"},"Footnote",-1)])]),_:1},8,["value"])]),_:1},8,["modelValue"])]),r.createElementVNode("div",TM,[r.createVNode(xo,{icon:r.unref(Ce).BOLD,"is-active":!!((T=r.unref(c))!=null&&T.isActive("bold")),onClick:u},null,8,["icon","is-active"]),r.createVNode(xo,{icon:r.unref(Ce).ITALIC,"is-active":!!((A=r.unref(c))!=null&&A.isActive("italic")),onClick:u},null,8,["icon","is-active"])]),r.createElementVNode("div",OM,[r.createVNode(xo,{icon:r.unref(Ce).LIST,"is-active":!!(($=r.unref(c))!=null&&$.isActive("bulletList")),onClick:u},null,8,["icon","is-active"]),r.createVNode(xo,{icon:r.unref(Ce).ORDERED_LIST,"is-active":!!((B=r.unref(c))!=null&&B.isActive("orderedList")),onClick:u},null,8,["icon","is-active"])]),r.createElementVNode("div",_M,[r.createVNode(xo,{icon:r.unref(Ce).LINK,"is-active":!!((V=r.unref(c))!=null&&V.isActive("link"))},{default:r.withCtx(()=>[r.createVNode(r.unref(Ho),{placement:"bottom-start",trigger:"click",ref_key:"linkTooltipRef",ref:y},{content:r.withCtx(()=>[r.createElementVNode("div",VM,[r.createVNode(r.unref($l),{modelValue:k.value,"onUpdate:modelValue":N[2]||(N[2]=D=>k.value=D),placeholder:"Please enter the URL"},null,8,["modelValue"]),r.createVNode(r.unref(Wi),{width:"180px",onClick:N[3]||(N[3]=D=>u("link"))},{default:r.withCtx(()=>[...N[7]||(N[7]=[r.createTextVNode(" Attach ",-1)])]),_:1})])]),default:r.withCtx(()=>[r.createVNode(r.unref(Ee),{name:"link",cursor:"pointer",class:"mc-richtext-tool-icon-link",onClick:x})]),_:1},512)]),_:1},8,["icon","is-active"]),r.createVNode(xo,{icon:r.unref(Ce).IMAGE,"is-active":!!((O=r.unref(c))!=null&&O.isActive("image")),onClick:u},null,8,["icon","is-active"])]),r.createVNode(xo,{icon:r.unref(Ce).CLEAR,onClick:u},null,8,["icon"])]),r.createVNode(r.unref(WS),{editor:r.unref(c),class:"mc-richtext-content"},null,8,["editor"]),r.createElementVNode("input",{ref_key:"fileInputRef",ref:s,type:"file",accept:"image/*",style:{display:"none"},"aria-hidden":"true",onChange:S},null,544)],4)}}}),$y=ee(q(DM,[["__scopeId","data-v-ac411452"]])),Py="mc-secondary-menu",AM={class:"mc-secondary-menu"},IM=["onClick"],RM={class:"mc-secondary-menu-item-content"},LM=r.defineComponent({name:Py,__name:"mc-secondary-menu",props:{modelValue:{},options:{default:()=>[]}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(),s=r.ref(),a=r.computed(()=>{const c=[];return n.options.forEach(d=>{c.push(d),d.children&&d.children.forEach(u=>{c.push({...u,parent:d.name})})}),c});r.onMounted(()=>{n.modelValue&&l(n.modelValue),setTimeout(()=>{s.value&&(s.value.style.transition="top 0.3s ease-in-out")})}),r.watch(()=>n.modelValue,()=>{n.modelValue&&l(n.modelValue)});const l=c=>{const d=Do(a.value,{name:c});if(d<0||!s.value||!i.value)return;const u=Array.from(i.value.children),{top:p}=i.value.getBoundingClientRect(),{top:h}=u[d].getBoundingClientRect();s.value.style.top=h-p+"px"};return(c,d)=>(r.openBlock(),r.createElementBlock("div",AM,[r.createElementVNode("div",{class:"mc-secondary-menu-wrapper",ref_key:"wrapperRef",ref:i},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,u=>{var p;return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-secondary-menu-item",{"mc-secondary-menu-item-actived":t.modelValue===u.name,"mc-secondary-menu-item-parent":!!((p=u.children)!=null&&p.length),"mc-secondary-menu-item-child":!!u.parent}]),key:u.name,onClick:h=>{var m;return f=u,void(((m=f.children)==null?void 0:m.length)||(o("update:modelValue",f.name),o("change",f.name)));var f}},[r.createElementVNode("div",RM,r.toDisplayString(u.label),1)],10,IM)}),128)),r.createElementVNode("div",{class:"mc-secondary-menu-success-line",ref_key:"successLineRef",ref:s},null,512)],512)]))}}),zy=ee(q(LM,[["__scopeId","data-v-a052ad92"]])),yi=Symbol("mc-select-context"),Fy="mc-select",$M=["value","placeholder","disabled","readonly","onKeydown"],PM={class:"mc-select-selected-label"},zM={class:"mc-select-trigger-toolbar"},FM=r.defineComponent({name:"mc-select-trigger-virtual",__name:"index",props:{search:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},placeholder:{default:"Please select"},searchValue:{default:void 0},isExpanded:{type:Boolean,default:!1},hideValidationIcon:{type:Boolean,default:!1}},emits:["update:searchValue","update:isExpanded","press:arrow","search","focus","blur","clear"],setup(t,{emit:e}){const n=t,o=e,{selectedValue:i,selectOptions:s,isDisabled:a,validateStatus:l,isTopPlacement:c}=r.inject(yi),d=r.computed(()=>{if(i.value)return s.value.find(M=>M.value===i.value)}),u=r.ref(),{wrapperRef:p,isFocused:h,handleFocus:f,handleBlur:m}=Xn(u),{isHovering:g}=ul(p),v=r.computed(()=>a.value?"not-allowed":n.search?"text":"pointer"),b=r.computed(()=>{var M;return(M=d.value)!=null&&M.label?"":n.placeholder}),y=()=>{a.value||o("update:isExpanded",!n.isExpanded)},k=M=>{const{value:N}=M.target;o("update:searchValue",N),o("search")},{showClearIcon:x,mouseOverIcon:w}=(()=>{const M=r.ref(!1),N=ue("clearable");return{showClearIcon:r.computed(()=>!!N.value&&M.value),mouseOverIcon:T=>{N.value&&(M.value=T)}}})(),C=r.computed(()=>!!d.value&&x.value&&!a.value),S=()=>{a.value||o("update:isExpanded",!n.isExpanded)},E=()=>{o("clear")};return(M,N)=>{var T;return r.openBlock(),r.createElementBlock("div",{ref_key:"triggerRef",ref:p,class:r.normalizeClass(["mc-select-trigger-virtual",{"is-hovering":r.unref(g),"is-focused":r.unref(h),"is-expanded":t.isExpanded,"is-disabled":r.unref(a),"is-error":r.unref(l)==="error","is-success":r.unref(l)==="success","is-top-placement":r.unref(c)}]),onClick:y},[r.createElementVNode("div",{class:"mc-select-selected-content",style:r.normalizeStyle({cursor:v.value})},[r.createElementVNode("div",{class:"mc-select-input-wrapper",style:r.normalizeStyle({width:t.searchValue||!d.value?"100%":"1em"})},[r.createElementVNode("input",{ref_key:"inputRef",ref:u,value:t.searchValue,class:"mc-select-input",placeholder:b.value,disabled:r.unref(a),readonly:!t.search||r.unref(a),onInput:k,onFocus:N[0]||(N[0]=(...A)=>r.unref(f)&&r.unref(f)(...A)),onBlur:N[1]||(N[1]=(...A)=>r.unref(m)&&r.unref(m)(...A)),onKeydown:r.withKeys(r.withModifiers(S,["stop","prevent"]),["enter"])},null,40,$M)],4),r.withDirectives(r.createElementVNode("div",PM,[r.renderSlot(M.$slots,"selected-content",{selectedOption:d.value,selectedOptionLabel:(T=d.value)==null?void 0:T.label,isDisabled:r.unref(a)},()=>{var A;return[r.createElementVNode("span",null,r.toDisplayString((A=d.value)==null?void 0:A.label),1)]},!0)],512),[[r.vShow,d.value&&!t.searchValue]])],4),r.createElementVNode("div",zM,[r.withDirectives(r.createVNode(r.unref(Ee),{class:"mc-select-status-icon",name:r.unref(l)==="error"?"reject-fail-rev":"accept-success-rev",size:24},null,8,["name"]),[[r.vShow,r.unref(l)!=="init"&&!t.hideValidationIcon]]),r.createElementVNode("div",{class:"mc-select-icon-wrapper",onMouseenter:N[3]||(N[3]=A=>r.unref(w)(!0)),onMouseleave:N[4]||(N[4]=A=>r.unref(w)(!1))},[r.withDirectives(r.createVNode(r.unref(Ee),{class:"mc-select-chevron-icon",name:"down-chevron",size:24,cursor:r.unref(a)?"not-allowed":"pointer"},null,8,["cursor"]),[[r.vShow,!C.value]]),r.withDirectives(r.createElementVNode("div",{onClick:N[2]||(N[2]=r.withModifiers(()=>{},["stop"]))},[r.createVNode(r.unref(Ee),{class:"mc-select-clear-icon",name:"rejectfail",size:16,cursor:"pointer",onClick:E})],512),[[r.vShow,C.value]])],32)])],2)}}}),jM=q(FM,[["__scopeId","data-v-ffd1e933"]]),HM=["data-value","title"],WM=["data-value"],KM={key:1,class:"mc-select-list-empty"},UM=r.defineComponent({name:"mc-select-list-virtual",__name:"index",setup(t){const{selectedValue:e,isTopPlacement:n,select:o}=r.inject(yi),{selectOptions:i,totalHeight:s,offsetY:a,visibleItems:l,setScrollTop:c}=(()=>{const{filteredOptions:h}=r.inject(yi),f=r.computed(()=>h.value.length),m=r.computed(()=>40*f.value),g=r.computed(()=>Math.ceil(8)+6),v=r.ref(0),b=r.computed(()=>{const w=Math.floor(v.value/40)-3;return Math.max(0,w)}),y=r.computed(()=>{const w=b.value+g.value;return Math.min(f.value,w)}),k=r.computed(()=>40*b.value),x=r.computed(()=>h.value.slice(b.value,y.value));return{selectOptions:h,totalHeight:m,offsetY:k,visibleItems:x,setScrollTop:w=>{v.value=w}}})(),d=r.computed(()=>!Be(i.value)),u=h=>{const f=h.target.scrollTop;c(f)},p=h=>{const f=h.target.dataset.value;o(f)};return(h,f)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-select-list-virtual",{"is-top-placement":r.unref(n)}]),onScroll:u,onClick:p},[d.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-select-list-container",style:r.normalizeStyle({height:r.unref(s)+"px"})},[r.createElementVNode("ul",{class:"mc-select-list",style:r.normalizeStyle({transform:`translateY(${r.unref(a)}px)`})},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(l),m=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-select-item",{"is-actived":m.value===r.unref(e)}]),key:m.value,"data-value":m.value,title:m.label},[r.renderSlot(h.$slots,"default",{optionValue:m.value,optionLabel:m.label},()=>[r.createElementVNode("span",{"data-value":m.value},r.toDisplayString(m.label),9,WM)],!0)],10,HM))),128))],4)],4)):(r.openBlock(),r.createElementBlock("div",KM,[r.renderSlot(h.$slots,"empty",{},()=>[f[0]||(f[0]=r.createElementVNode("p",{class:"mc-select-list-empty-text"},"No results found",-1))],!0)]))],34))}}),qM=q(UM,[["__scopeId","data-v-65ab53fa"]]),JM=["id"],jy=ee(q(r.defineComponent({name:Fy,__name:"mc-select",props:{modelValue:{},placeholder:{default:"Please select"},disabled:{type:Boolean,default:!1},width:{default:320},height:{default:40},search:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},options:{},disableValidation:{type:Boolean,default:!1},hideValidationIcon:{type:Boolean,default:!1},validateProp:{},positionStrategy:{default:"absolute"},teleportTo:{}},emits:["update:modelValue","change","blur","focus","expand"],setup(t,{emit:e}){const n=t,o=e,{width:i,height:s}=lt(),a=r.ref(!1);r.watch(a,E=>{o("expand",E)});const{placement:l,isTopPlacement:c}=Iy(),{selectOptions:d,filteredOptions:u,searchValue:p,clearSearchValue:h}=(()=>{const E=ue("options"),M=r.ref(""),N=r.computed(()=>{var T;return(T=E.value)!=null&&T.length?Be(M.value)?E.value:Cr(E.value,A=>Ct(ll(A.label??A.value),M.value)):[]});return{selectOptions:E,searchValue:M,filteredOptions:N,clearSearchValue:()=>{M.value=""}}})(),f=r.ref();Hi(f,()=>{h(),a.value=!1});const m=()=>{n.search&&(a.value=!0)},g=()=>{a.value=!1,h(),S(void 0)},v=r.inject(Rr,void 0),{formId:b,formDisabled:y,validateStatus:k,validateByTrigger:x}=Nt({externalDisabled:r.computed(()=>!!(v!=null&&v.disabled.value))});r.watch(y,E=>{E&&(a.value=!1,h())}),r.watch(k,E=>{v&&v.setValidateStatus(E)});const w=()=>{o("focus")},C=()=>{x("blur"),o("blur")},S=E=>{o("update:modelValue",E),o("change",E)};return r.provide(yi,{isDisabled:r.computed(()=>y.value),selectOptions:d,selectedValue:r.computed(()=>n.modelValue),validateStatus:k,filteredOptions:u,isTopPlacement:c,select:E=>{h(),a.value=!1,S(E)}}),(E,M)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"selectRef",ref:f,id:r.unref(b),class:"mc-select",style:r.normalizeStyle({width:r.unref(i)})},[r.createVNode(r.unref(ps),{placement:r.unref(l),"onUpdate:placement":M[2]||(M[2]=N=>r.isRef(l)?l.value=N:null),"is-show":a.value,strategy:t.positionStrategy,"teleport-to":t.teleportTo},{content:r.withCtx(()=>[r.createVNode(qM,null,r.createSlots({_:2},[E.$slots["option-item"]?{name:"default",fn:r.withCtx(({optionValue:N,optionLabel:T})=>[r.renderSlot(E.$slots,"option-item",{optionValue:N,optionLabel:T},void 0,!0)]),key:"0"}:void 0,E.$slots.empty?{name:"empty",fn:r.withCtx(()=>[r.renderSlot(E.$slots,"empty",{},void 0,!0)]),key:"1"}:void 0]),1024)]),default:r.withCtx(()=>[r.createVNode(jM,{"is-expanded":a.value,"onUpdate:isExpanded":M[0]||(M[0]=N=>a.value=N),"search-value":r.unref(p),"onUpdate:searchValue":M[1]||(M[1]=N=>r.isRef(p)?p.value=N:null),search:t.search,placeholder:t.placeholder,clearable:t.clearable,"hide-validation-icon":t.hideValidationIcon,onSearch:m,onClear:g,onFocus:w,onBlur:C,style:r.normalizeStyle({height:r.unref(s)})},r.createSlots({_:2},[E.$slots["selected-content"]?{name:"selected-content",fn:r.withCtx(({selectedOption:N,selectedOptionLabel:T,isDisabled:A})=>[r.renderSlot(E.$slots,"selected-content",{selectedOption:N,selectedOptionLabel:T,isDisabled:A},void 0,!0)]),key:"0"}:void 0]),1032,["is-expanded","search-value","search","placeholder","clearable","hide-validation-icon","style"])]),_:3},8,["placement","is-show","strategy","teleport-to"])],12,JM))}}),[["__scopeId","data-v-e2be8d95"]])),Hy="mc-status",GM={class:"mc-status-icon"},YM={class:"mc-status-content"},Wy=ee(q(r.defineComponent({name:Hy,__name:"mc-status",props:{type:{default:"info"}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-status",[`mc-status-${t.type}`]])},[r.createElementVNode("div",GM,[r.createVNode(r.unref(ge),{name:"Indicator",size:12})]),r.createElementVNode("p",YM,[r.renderSlot(e.$slots,"default",{},void 0,!0)])],2))}),[["__scopeId","data-v-cdd41d46"]])),Ky="mc-step",XM={class:"mc-step-number-container"},QM={class:"mc-step-item-number"},ZM={key:0,class:"mc-step-item-number-text"},eN={class:"mc-step-item-content"},tN={key:0,class:"mc-step-item-content-title"},nN={class:"mc-step-item-label"},oN={class:"mc-step-item-desc"},rN={key:1,class:"mc-step-item-component"},iN={key:0,class:"mc-step-item-component"},sN=r.defineComponent({name:Ky,__name:"mc-step",props:{modelValue:{},steps:{},type:{default:"vertical"}},emits:["change","success"],setup(t,{expose:e,emit:n}){const o=t,i=r.computed(()=>o.type==="vertical"),s=n,a=r.ref(),l=r.ref(),c=r.ref(),d=r.ref(),u=r.computed(()=>Do(o.steps,w=>w.key===o.modelValue)),p=r.computed(()=>{var w;return(w=o.steps[u.value-1])==null?void 0:w.key});r.watch(()=>o.modelValue,w=>{f(),s("change",w)},{flush:"post"});const h=r.ref(),f=(w=p.value)=>{h.value=w,s("success",w)},m=r.computed(()=>Do(o.steps,w=>w.key===h.value));r.onMounted(()=>{i.value?g():(v(),b()),f()});const g=async()=>{await r.nextTick();const w=m.value,C=d.value;if(w<0)return void(C.style.height="0");const S=l.value,E=S.querySelectorAll(".mc-step-item");if(w+1>E.length-1)return void(C.style.height="100%");const M=E==null?void 0:E[w+1],N=S.getBoundingClientRect(),T=(M.getBoundingClientRect().top-N.top)/(N.height-24);C.style.height=100*T+"%"},v=()=>{var $,B;const w=l.value,C=c.value,S=w.querySelectorAll(".mc-step-item"),E=($=S==null?void 0:S[0])==null?void 0:$.querySelector(".mc-step-item-number"),M=(B=S==null?void 0:S[S.length-1])==null?void 0:B.querySelector(".mc-step-item-number");if(!E||!M)return void(C.style.width="0px");const N=w.getBoundingClientRect(),T=E.getBoundingClientRect(),A=M.getBoundingClientRect();C.style.width=A.left-T.left-T.width+"px",C.style.left=`${T.left-N.left+T.width}px`},b=()=>{const w=d.value,C=m.value;if(C<0)return void(w.style.width="0");const S=(C+1)/(o.steps.length-1),E=S>1?1:S;w.style.width=100*E+"%"},y=w=>i.value&&w.component&&w.key===o.modelValue,k=r.computed(()=>{var w;return!i.value&&((w=zi(o.steps,C=>C.key===o.modelValue))==null?void 0:w.component)});var x;return r.watch(()=>h.value,()=>{i.value?g():b()}),x=Io(()=>{i.value?g():(v(),b())},50),r.onMounted(()=>{window.addEventListener("resize",x)}),r.onUnmounted(()=>{window.removeEventListener("resize",x)}),e({ref:a,setSuccessStep:f}),(w,C)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-step",`mc-step-${t.type}`]),ref_key:"_ref",ref:a},[r.createElementVNode("ul",{class:"mc-step-item-container",ref_key:"stepContainerRef",ref:l},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.steps,(S,E)=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-step-item",{"mc-step-item-active":t.modelValue===S.key,"mc-step-item-disabled":S.disabled,"mc-step-item-success":E<=m.value}]),key:S.key},[r.createElementVNode("div",XM,[r.createElementVNode("div",QM,[E>m.value||S.disabled?(r.openBlock(),r.createElementBlock("span",ZM,r.toDisplayString(E+1),1)):(r.openBlock(),r.createBlock(r.unref(Yo),{key:1}))])]),r.createElementVNode("div",eN,[S.label||S.desc?(r.openBlock(),r.createElementBlock("div",tN,[r.createElementVNode("h3",nN,r.toDisplayString(S.label),1),r.createElementVNode("p",oN,r.toDisplayString(S.desc),1)])):r.createCommentVNode("",!0),y(S)?(r.openBlock(),r.createElementBlock("div",rN,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(S.component)))])):r.createCommentVNode("",!0)])],2))),128)),r.createElementVNode("div",{ref_key:"unsuccessLineRef",ref:c,class:"mc-step-line mc-step-unsuccess-line"},[r.createElementVNode("div",{ref_key:"successLineRef",ref:d,class:"mc-step-success-line"},null,512)],512)],512),k.value?(r.openBlock(),r.createElementBlock("div",iN,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(k.value)))])):r.createCommentVNode("",!0)],2))}}),Uy=ee(q(sN,[["__scopeId","data-v-e0327154"]])),qy="mc-step-plus",Kd="mc-step-item-plus",aN={class:"mc-step-item-plus"},Jy=ee(r.defineComponent({name:Kd,__name:"mc-step-item-plus",props:{icon:{},key:{},label:{},desc:{},showContent:{type:Boolean},success:{type:Boolean}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",aN))})),Ud="mc-step-child-item-plus",lN={class:"mc-step-child-item-plus"},Gy=ee(r.defineComponent({name:Ud,__name:"mc-step-child-item-plus",props:{key:{},label:{},desc:{},showContent:{type:Boolean},success:{type:Boolean}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",lN))})),cN={class:"mc-step-plus"},dN={class:"mc-step-container"},uN=["onClick"],pN={class:"mc-step-item-icon"},hN={key:0,class:"mc-step-item-icon-number"},fN={key:1,class:"mc-step-item-icon-point"},mN={class:"mc-step-item-content"},gN={class:"mc-step-item-content-title"},vN={class:"mc-step-item-label"},yN={key:1,class:"mc-step-item-label-title"},bN={class:"mc-step-item-desc"},kN={key:1,class:"mc-step-item-desc-title"},wN={key:0,class:"mc-step-item-content-display"},Yy=ee(q(r.defineComponent({name:qy,__name:"mc-step-plus",props:{modelValue:{default:void 0},successSteps:{},successBehavior:{default:"manual"},previousBehavior:{default:"last-child"}},emits:["update:modelValue","update:successSteps","change","click:step"],setup(t,{expose:e,emit:n}){const o=t,i=n,{stepItems:s,activedStep:a,isActivedStep:l,showStep:c,isSuccessStep:d,showContent:u}=(()=>{const f=r.ref([]),m=r.useSlots();r.watchEffect(()=>{var k;f.value=(x=>{const w=[];let C=0,S=0;const E=(M,N)=>{ce(M)&&M.forEach(T=>{var $,B,V,O,D,F,R,L,I,P,W,z,j,K,G,Z;const A=($=(T==null?void 0:T.type)||{})==null?void 0:$.name;if(A===Kd){const J=Ao(T.children)||ce(T.children)||!He((B=T.children)==null?void 0:B.default)?T.children:(V=T.children)==null?void 0:V.default(),Y=T.children,te={parentIndex:C++,index:S++,step:((O=T.props)==null?void 0:O.step)||S,label:(D=T.props)==null?void 0:D.label,desc:(F=T.props)==null?void 0:F.desc,icon:(R=T.props)==null?void 0:R.icon,showContent:((L=T.props)==null?void 0:L.showContent)||((I=T.props)==null?void 0:I["show-content"]),success:(P=T.props)==null?void 0:P.success,content:Y==null?void 0:Y.default,labelContent:Y==null?void 0:Y.label,descContent:Y==null?void 0:Y.desc};w.push(te),E(J,te)}else if(A===Ud){const J=T.children,Y={index:S++,step:(W=T.props)==null?void 0:W.step,label:(z=T.props)==null?void 0:z.label,desc:(j=T.props)==null?void 0:j.desc,parentStep:N,isChild:!0,showContent:((K=T.props)==null?void 0:K.showContent)||((G=T.props)==null?void 0:G["show-content"]),success:(Z=T.props)==null?void 0:Z.success,content:J==null?void 0:J.default,labelContent:J==null?void 0:J.label,descContent:J==null?void 0:J.desc};N&&(N.content=void 0,N.hasChildren=!0,N.children||(N.children=[]),Y.childIndex=N.children.length,N.children.push(Y),N.childrenSteps||(N.childrenSteps=[]),N.childrenSteps.push(Y.step)),w.push(Y)}else Array.isArray(T.children)&&E(T.children,N)})};return E(x),w})((k=m.default)==null?void 0:k.call(m))});const g=ue("modelValue"),v=r.computed(()=>f.value.find(k=>k.step===g.value)),b=ue("successSteps"),y=ue("successBehavior");return{stepItems:f,activedStep:v,isActivedStep:k=>{var x,w;return!ye(k.index)&&!ye((x=v.value)==null?void 0:x.index)&&k.index<=((w=v.value)==null?void 0:w.index)},showStep:k=>{var x,w;return!k.isChild||!!((x=k.parentStep)!=null&&x.showContent)||!!k.parentStep&&v.value===k.parentStep||Ct((w=k.parentStep)==null?void 0:w.childrenSteps,g.value)},isSuccessStep:k=>{var x,w,C,S,E,M;return!(!k.success&&!((x=k.parentStep)!=null&&x.success))||(y.value==="auto"?k.hasChildren?!ye(k.index)&&k.index+(((w=k.children)==null?void 0:w.length)??0)<(((C=v.value)==null?void 0:C.index)??-1):!ye(k.index)&&k.index<(((S=v.value)==null?void 0:S.index)??-1):!!((E=b.value)!=null&&E.length)&&(Ct(b.value,k.step)||Ct(b.value,(M=k.parentStep)==null?void 0:M.step)))},showContent:k=>!(!k.content||k.step!==g.value&&!k.showContent)}})(),p=()=>{var m;const f=((m=a.value)==null?void 0:m.index)||-1;if(f<s.value.length-1){let g=f+1,v=s.value[g];v.hasChildren&&(v=s.value[g+1]),v!=null&&v.step&&h(v.step)}},h=f=>{i("update:modelValue",f),i("change",f)};return e({goStep:f=>{f?h(f):p()},goNextStep:p,goPreviousStep:()=>{var m,g,v;const f=((m=a.value)==null?void 0:m.index)||-1;if(f>0){let b=f-1,y=s.value[b];(g=a.value)!=null&&g.isChild&&a.value.parentStep===y&&(y=s.value[b-1]),o.previousBehavior==="first-child"&&(y!=null&&y.isChild)&&!ye((v=y.parentStep)==null?void 0:v.index)&&(b=y.parentStep.index+1,y=s.value[b]),y!=null&&y.step&&h(y.step)}}}),(f,m)=>(r.openBlock(),r.createElementBlock("div",cN,[r.createElementVNode("div",dN,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(s),g=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:g.step},[r.unref(c)(g)?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["mc-step-item",{"mc-step-item-child":g.isChild,"mc-step-item-actived":r.unref(l)(g),"mc-step-item-success":r.unref(d)(g)}])},[r.createElementVNode("div",{class:"mc-step-item-indicator",onClick:v=>(b=>{i("click:step",b.step)})(g)},[r.createElementVNode("div",pN,[g.isChild||r.unref(ye)(g.parentIndex)?(r.openBlock(),r.createElementBlock("div",fN)):(r.openBlock(),r.createElementBlock("div",hN,[r.unref(d)(g)?(r.openBlock(),r.createBlock(r.unref(Yo),{key:0})):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[g.iconContent?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(g.iconContent),{key:g.step,step:g.step,isSuccess:r.unref(d)(g),isActived:r.unref(l)(g)},null,8,["step","isSuccess","isActived"])):g.icon?(r.openBlock(),r.createBlock(r.unref(ge),{key:1,name:g.icon},null,8,["name"])):(r.openBlock(),r.createElementBlock(r.Fragment,{key:2},[r.createTextVNode(r.toDisplayString(g.parentIndex+1),1)],64))],64))]))])],8,uN),r.createElementVNode("div",mN,[r.createElementVNode("div",gN,[r.createElementVNode("div",vN,[g.labelContent?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(g.labelContent),{key:g.step,step:g.step,label:g.label,isSuccess:r.unref(d)(g),isActived:r.unref(l)(g)},null,8,["step","label","isSuccess","isActived"])):(r.openBlock(),r.createElementBlock("div",yN,r.toDisplayString(g.label),1))]),r.createElementVNode("div",bN,[g.descContent?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(g.descContent),{key:g.step,step:g.step,desc:g.desc,isSuccess:r.unref(d)(g),isActived:r.unref(l)(g)},null,8,["step","desc","isSuccess","isActived"])):(r.openBlock(),r.createElementBlock("div",kN,r.toDisplayString(g.desc),1))])]),r.unref(u)(g)?(r.openBlock(),r.createElementBlock("div",wN,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(g.content),{key:g.step,step:g.step,isSuccess:r.unref(d)(g),isActived:r.unref(l)(g)},null,8,["step","isSuccess","isActived"]))])):r.createCommentVNode("",!0)])],2)):r.createCommentVNode("",!0)],64))),128))])]))}}),[["__scopeId","data-v-c058c992"]])),Xy="mc-switch",Qy="mc-switch-label",xN={class:"mc-switch-label-wrapper"},CN={class:"mc-switch-label"},SN={class:"mc-switch-help"},Zy=q(r.defineComponent({name:Qy,__name:"mc-switch-label",props:{label:{},helpText:{},helpIcon:{default:"Info"}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",xN,[t.label||e.$slots.label?r.renderSlot(e.$slots,"label",{key:0},()=>[r.createElementVNode("span",CN,r.toDisplayString(t.label),1)],!0):r.createCommentVNode("",!0),t.helpText||e.$slots.help?r.renderSlot(e.$slots,"help",{key:1},()=>[r.createElementVNode("div",SN,[r.createVNode(r.unref(Ho),{"icon-name":t.helpIcon,content:t.helpText,"icon-size":22},null,8,["icon-name","content"])])],!0):r.createCommentVNode("",!0)]))}),[["__scopeId","data-v-e1ce5008"]]),EN={class:"mc-switch"},MN=["id","disabled","value","onKeypress"],NN={class:"mc-switch-inner"},BN={class:"mc-switch-inner-text"},TN={class:"mc-switch-inner-text"},ON=r.defineComponent({name:Xy,__name:"mc-switch",props:{modelValue:{type:Boolean,default:!1},width:{},height:{},activeText:{},inactiveText:{},disabled:{type:Boolean,default:!1},size:{default:"medium"},label:{},labelPosition:{default:"right"},helpIcon:{default:"Info"},helpText:{},disableValidation:{type:Boolean},hideValidationIcon:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:e}){const n=t,o=e,i=r.useSlots(),{formId:s,formDisabled:a,validateStyle:l,validateByTrigger:c}=Nt(),d=r.computed(()=>n.modelValue),u=async()=>{a.value||(o("update:modelValue",!n.modelValue),o("change",!n.modelValue),c("input"))},p=r.computed(()=>i.label||n.label||i.help||n.helpText?n.labelPosition:void 0),h=r.computed(()=>p.value==="left"),f=r.computed(()=>p.value==="right");return(m,g)=>(r.openBlock(),r.createElementBlock("div",EN,[h.value?(r.openBlock(),r.createBlock(Zy,{key:0,label:t.label,"help-text":t.helpText,"help-icon":t.helpIcon},r.createSlots({_:2},[m.$slots.label?{name:"label",fn:r.withCtx(()=>[r.renderSlot(m.$slots,"label",{},void 0,!0)]),key:"0"}:void 0,m.$slots.help?{name:"help",fn:r.withCtx(()=>[r.renderSlot(m.$slots,"help",{},void 0,!0)]),key:"1"}:void 0]),1032,["label","help-text","help-icon"])):r.createCommentVNode("",!0),r.createElementVNode("label",{class:r.normalizeClass(["mc-switch-wrapper",[d.value?"mc-switch-actived":"mc-switch-inactive",{"mc-switch-disabled":r.unref(a)},`mc-switch-${t.size}`,r.unref(l)]]),style:r.normalizeStyle({width:t.width,height:t.height})},[r.createElementVNode("input",{id:r.unref(s),type:"checkbox",class:"mc-switch-input",disabled:t.disabled,value:t.modelValue,onChange:u,onKeypress:r.withKeys(r.withModifiers(u,["prevent","stop"]),["enter"])},null,40,MN),r.createElementVNode("div",NN,[d.value?r.renderSlot(m.$slots,"active",{key:0},()=>[r.createElementVNode("span",BN,r.toDisplayString(t.activeText),1)],!0):r.renderSlot(m.$slots,"inactive",{key:1},()=>[r.createElementVNode("span",TN,r.toDisplayString(t.inactiveText),1)],!0)])],6),f.value?(r.openBlock(),r.createBlock(Zy,{key:1,label:t.label,"help-text":t.helpText,"help-icon":t.helpIcon},r.createSlots({_:2},[m.$slots.label?{name:"label",fn:r.withCtx(()=>[r.renderSlot(m.$slots,"label",{},void 0,!0)]),key:"0"}:void 0,m.$slots.help?{name:"help",fn:r.withCtx(()=>[r.renderSlot(m.$slots,"help",{},void 0,!0)]),key:"1"}:void 0]),1032,["label","help-text","help-icon"])):r.createCommentVNode("",!0)]))}}),e0=ee(q(ON,[["__scopeId","data-v-57841683"]])),qd="mc-tab-item",_N={class:"mc-tab-item"},t0=ee(r.defineComponent({name:qd,__name:"mc-tab-item",props:{name:{},label:{},disabled:{type:Boolean},count:{}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",_N,[r.renderSlot(e.$slots,"default")]))})),n0="mc-tab",VN=["onClick"],DN={key:0,class:"mc-tab-nav-item-count"},AN={class:"mc-tab-actived-component-wrapper"},IN=r.defineComponent({name:n0,__name:"mc-tab",props:{modelValue:{},type:{default:"plain"},wrapperPadding:{default:"0"}},emits:["update:modelValue","change"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref(),a=r.ref(),l=r.ref(),c=r.ref([]),d=r.useSlots();r.watchEffect(()=>{if(!d.default)return void(c.value=[]);let v=d.default();v.length&&v[0].type===r.Fragment&&(v=[...Array.from(v[0].children)]),c.value=bn(Cr(v,b=>b.type.name===qd),b=>{var k,x,w;const y=b.props;return{_vnode:r.h("div",(w=(x=(k=b.children)==null?void 0:k.default)==null?void 0:x.call(k))==null?void 0:w[0]),...y}})});const u=r.computed(()=>zi(c.value,v=>v.name===o.modelValue)),p=r.computed(()=>o.type==="plain");r.onMounted(async()=>{h(o.modelValue),setTimeout(()=>{f()})}),r.onUnmounted(()=>{f(!1)});const h=v=>{if(!p.value)return;const b=l.value,y=a.value,k=Do(c.value,E=>E.name===v);if(k<0)return void(b.style.width="0");const x=Array.from(y.children)[k],{x:w,width:C}=x.getBoundingClientRect(),{x:S}=y.getBoundingClientRect();b.style.width=`${C}px`,b.style.transform=`translateX(${w-S}px)`},f=(v=!0)=>{const b=l.value;p.value&&b&&(b.style.transition=v?"transform 0.3s ease-in-out":"")};r.watch(()=>o.modelValue,v=>{h(v)});const m=r.computed(()=>{var v;return typeof o.wrapperPadding=="string"?o.wrapperPadding:((v=o.wrapperPadding)==null?void 0:v.left)??"0"}),g=r.computed(()=>{var v;return typeof o.wrapperPadding=="string"?o.wrapperPadding:((v=o.wrapperPadding)==null?void 0:v.right)??"0"});return e({ref:s}),(v,b)=>{var y;return r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-tab",`mc-tab-${t.type}`]),ref_key:"_ref",ref:s},[r.createElementVNode("div",{class:"mc-tab-nav",style:r.normalizeStyle({paddingLeft:m.value,paddingRight:g.value})},[r.createElementVNode("div",{class:"mc-tab-nav-wrapper",ref_key:"tabNavRef",ref:a},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,k=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-tab-nav-item",{"mc-tab-nav-item-active":k.name===t.modelValue,"mc-tab-nav-item-disabled":k.disabled}]),key:k.name,onClick:x=>(w=>{w.disabled||(i("update:modelValue",w.name),i("change",w.name))})(k)},[r.createElementVNode("span",null,r.toDisplayString(k.label),1),k.count?(r.openBlock(),r.createElementBlock("span",DN,r.toDisplayString(k.count),1)):r.createCommentVNode("",!0)],10,VN))),128))],512),p.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-tab-line",ref_key:"tabLineRef",ref:l},null,512)):r.createCommentVNode("",!0)],4),(y=u.value)!=null&&y._vnode?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-tab-actived-component",style:r.normalizeStyle({paddingLeft:m.value,paddingRight:g.value})},[r.createElementVNode("div",AN,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(u.value._vnode),{key:u.value.name}))])],4)):r.createCommentVNode("",!0)],2)}}}),o0=ee(q(IN,[["__scopeId","data-v-e15262e7"]])),RN=["rowspan","colspan"],LN=q(r.defineComponent({__name:"mc-table-cell",props:{row:{},column:{},rowIndex:{},columnIndex:{},pagination:{},spanMethod:{type:Function}},setup(t){const e=t,n=r.computed(()=>e.row[e.column.prop]),o=r.computed(()=>{const u=[e.column.className];if(e.column.align&&u.push(`is-${e.column.align}`),e.column.fixed){const h=typeof e.column.fixed=="boolean"?"left":e.column.fixed;u.push(`is-fixed-${h}`)}const p=c.value===0?"none":"table-cell";return u.push(`is-display-${p}`),u}),i=()=>{var u,p;return(u=e.pagination)!=null&&u.currentPage&&((p=e.pagination)!=null&&p.pageSize)?(e.pagination.currentPage-1)*e.pagination.pageSize+e.rowIndex:e.rowIndex},s=()=>{if(!e.spanMethod)return null;const u=i();return e.spanMethod({row:e.row,column:e.column,rowIndex:u,columnIndex:e.columnIndex})},a=(u,p)=>{var g,v;if(!((g=e.pagination)!=null&&g.currentPage)||!((v=e.pagination)!=null&&v.pageSize)||p<=1)return!0;const h=(e.pagination.currentPage-1)*e.pagination.pageSize,f=h+e.pagination.pageSize-1,m=u;return!(u+p-1<h||m>f)&&Math.max(m,h)===u},l=r.computed(()=>{const u=s();if(u){const p=i();let h;return h=Array.isArray(u)?u[0]:u.rowspan||1,h>1?a(p,h)?((f,m)=>{var x,w;if(!((x=e.pagination)!=null&&x.currentPage)||!((w=e.pagination)!=null&&w.pageSize)||m<=1)return m;const g=(e.pagination.currentPage-1)*e.pagination.pageSize,v=g+e.pagination.pageSize-1,b=f,y=f+m-1,k=Math.max(b,g);return Math.min(y,v)-k+1})(p,h):0:h}if(e.column.rowSpan)return typeof e.column.rowSpan=="function"?e.column.rowSpan(e.row,e.column,e.rowIndex):e.column.rowSpan}),c=r.computed(()=>{const u=s();return u?Array.isArray(u)?u[1]:u.colspan:e.column.colSpan?typeof e.column.colSpan=="function"?e.column.colSpan(e.row,e.column,e.rowIndex):e.column.colSpan:void 0}),d=r.computed(()=>{const u=s();if(u){const p=i();let h,f;return Array.isArray(u)?(h=u[0],f=u[1]):(h=u.rowspan||1,f=u.colspan||1),!(h>1&&!a(p,h)||h===0||f===0)}return!0});return(u,p)=>d.value?(r.openBlock(),r.createElementBlock("td",{key:0,class:r.normalizeClass(o.value),rowspan:l.value,colspan:c.value},[r.renderSlot(u.$slots,"cell",{row:t.row,column:t.column,index:t.rowIndex,value:n.value,prop:t.column.prop},()=>[r.renderSlot(u.$slots,t.column.slot||t.column.prop,{row:t.row,column:t.column,index:t.rowIndex,value:n.value},()=>[t.column.formatter?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createTextVNode(r.toDisplayString(t.column.formatter(t.row,t.column,n.value,t.rowIndex)),1)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[r.createTextVNode(r.toDisplayString(n.value),1)],64))],!0)],!0)],10,RN)):r.createCommentVNode("",!0)}}),[["__scopeId","data-v-75c1c38a"]]),$N={class:"mc-table__body",cellspacing:"0",cellpadding:"0",border:"0"},PN={key:0,width:"50"},zN=["width"],FN=["onClick"],jN={key:0,class:"mc-table__selection-column"},HN={class:"mc-table__cell"},WN={key:1},KN=["colspan"],UN={key:1},qN=q(r.defineComponent({__name:"mc-table-body",props:{data:{},columns:{},rowKey:{},emptyText:{},height:{},maxHeight:{},pagination:{},spanMethod:{},getRowClass:{},selectable:{type:Boolean,default:!1},selectedRows:{},selectOnRowClick:{type:Boolean,default:!1}},emits:["row-click","select"],setup(t,{expose:e,emit:n}){const o=t,i=r.useSlots(),s=n,a=r.ref(),l=r.computed(()=>Object.keys(i)),c=r.computed(()=>{const f={};return o.height&&(f.height=typeof o.height=="number"?`${o.height}px`:o.height),o.maxHeight&&(f.maxHeight=typeof o.maxHeight=="number"?`${o.maxHeight}px`:o.maxHeight),f}),d=r.computed(()=>o.pagination),u=(f,m)=>o.rowKey?f[o.rowKey]:m,p=(f,m)=>o.getRowClass?o.getRowClass(f,m):[],h=f=>!!o.selectedRows&&o.selectedRows.some(m=>o.rowKey?m[o.rowKey]===f[o.rowKey]:m===f);return e({bodyWrapper:a}),(f,m)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-table__body-wrapper",ref_key:"bodyWrapper",ref:a,style:r.normalizeStyle(c.value)},[r.createElementVNode("table",$N,[r.createElementVNode("colgroup",null,[t.selectable?(r.openBlock(),r.createElementBlock("col",PN)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.columns,(g,v)=>(r.openBlock(),r.createElementBlock("col",{key:v,width:g.width},null,8,zN))),128))]),r.createElementVNode("tbody",null,[t.data&&t.data.length>0?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(t.data,(g,v)=>(r.openBlock(),r.createElementBlock("tr",{key:u(g,v),class:r.normalizeClass(p(g,v)),onClick:b=>((y,k)=>{s("row-click",y,k)})(g,v)},[t.selectable?(r.openBlock(),r.createElementBlock("td",jN,[r.createElementVNode("div",HN,[r.createVNode(r.unref(Wo),{"model-value":h(g),onChange:b=>((y,k)=>{s("select",y,k)})(g,b)},null,8,["model-value","onChange"])])])):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.columns,(b,y)=>(r.openBlock(),r.createBlock(LN,{key:y,row:g,column:b,"row-index":v,"column-index":y,"span-method":t.spanMethod,pagination:d.value},r.createSlots({_:2},[r.renderList(l.value,k=>({name:k,fn:r.withCtx(x=>[r.renderSlot(f.$slots,k,r.mergeProps({ref_for:!0},x),void 0,!0)])}))]),1032,["row","column","row-index","column-index","span-method","pagination"]))),128))],10,FN))),128)):(r.openBlock(),r.createElementBlock("tr",WN,[r.createElementVNode("td",{colspan:o.selectable?o.columns.length+1:o.columns.length,class:"mc-table__empty-cell"},[r.unref(i).empty?r.renderSlot(f.$slots,"empty",{key:0},void 0,!0):(r.openBlock(),r.createElementBlock("div",UN,r.toDisplayString(t.emptyText),1))],8,KN)]))])])],4))}}),[["__scopeId","data-v-322ee242"]]),JN={class:"mc-table__header",cellspacing:"0",cellpadding:"0",border:"0"},GN={key:0,width:"50"},YN=["width"],XN={key:0,class:"mc-table__selection-column"},QN={class:"mc-table__header-cell"},ZN=["onClick"],eB={class:"mc-table__header-label"},tB={key:0,class:"mc-table__sort-caret"},nB=r.defineComponent({__name:"mc-table-header",props:{columns:{},showHeader:{type:Boolean,default:!0},getSortOrder:{type:Function,default:()=>null},selectable:{type:Boolean,default:!1},isAllSelected:{type:Boolean,default:!1},isIndeterminate:{type:Boolean,default:!1}},emits:["header-click","sort-change","select-all"],setup(t,{expose:e,emit:n}){const o=t,i=n,s=r.ref(),a=d=>{const u=[];if(d.headerClassName&&u.push(d.headerClassName),d.align&&u.push(`is-${d.align}`),d.fixed){const h=typeof d.fixed=="boolean"?"left":d.fixed;u.push(`is-fixed-${h}`)}d.sortable&&u.push("is-sortable");const p=l(d.prop);return p&&u.push(p),u},l=d=>{const u=o.getSortOrder(d);return u==="asc"?"is-sort-asc":u==="desc"?"is-sort-desc":""},c=d=>{i("select-all",d)};return e({headerWrapper:s}),(d,u)=>t.showHeader?(r.openBlock(),r.createElementBlock("div",{key:0,class:"mc-table__header-wrapper",ref_key:"headerWrapper",ref:s},[r.createElementVNode("table",JN,[r.createElementVNode("colgroup",null,[t.selectable?(r.openBlock(),r.createElementBlock("col",GN)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.columns,(p,h)=>(r.openBlock(),r.createElementBlock("col",{key:h,width:p.width},null,8,YN))),128))]),r.createElementVNode("thead",null,[r.createElementVNode("tr",null,[t.selectable?(r.openBlock(),r.createElementBlock("th",XN,[r.createElementVNode("div",QN,[r.createVNode(r.unref(Wo),{"model-value":t.isAllSelected,partial:t.isIndeterminate,onChange:c},null,8,["model-value","partial"])])])):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.columns,(p,h)=>(r.openBlock(),r.createElementBlock("th",{key:h,class:r.normalizeClass(a(p)),onClick:f=>((m,g)=>{m.sortable&&i("sort-change",m),i("header-click",m,g)})(p,f)},[r.createElementVNode("div",{class:r.normalizeClass(["mc-table__header-cell",`mc-table__header-cell-${p.align}`])},[r.createElementVNode("span",eB,[r.renderSlot(d.$slots,`header-${p.slot||p.prop}`,{column:p,index:h},()=>[r.createTextVNode(r.toDisplayString(p.label),1)],!0)]),p.sortable?(r.openBlock(),r.createElementBlock("span",tB,[t.getSortOrder(p.prop)==="asc"?(r.openBlock(),r.createBlock(Yn,{key:0,name:"Up-Chevron02",class:r.normalizeClass(["mc-table__sort-icon",{"is-active":t.getSortOrder(p.prop)==="asc"}])},null,8,["class"])):(r.openBlock(),r.createBlock(Yn,{key:1,name:"Down-Chevron02",class:r.normalizeClass(["mc-table__sort-icon",{"is-active":t.getSortOrder(p.prop)==="desc"}])},null,8,["class"]))])):r.createCommentVNode("",!0)],2)],10,ZN))),128))])])])],512)):r.createCommentVNode("",!0)}}),oB=q(nB,[["__scopeId","data-v-e1129792"]]),rB={class:"mc-table__loading-content"},iB={class:"mc-table__loading-spinner"},sB={key:0,class:"mc-table__spinner mc-table__spinner--default"},aB={key:1,class:"mc-table__spinner mc-table__spinner--circle"},lB={key:2,class:"mc-table__spinner mc-table__spinner--pulse"},cB=["innerHTML"],dB={key:0,class:"mc-table__loading-text"},uB=q(r.defineComponent({__name:"mc-table-loading",props:{loading:{type:Boolean,default:!1},loadingText:{default:"Loading..."},loadingConfig:{default:()=>({spinner:"default"})}},setup(t){const e=t,n=r.computed(()=>{var i;return((i=e.loadingConfig)==null?void 0:i.text)||e.loadingText}),o=r.computed(()=>{var s;const i={};return(s=e.loadingConfig)!=null&&s.background&&(i.backgroundColor=e.loadingConfig.background),i});return(i,s)=>{var a;return t.loading?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["mc-table__loading-wrapper",["mc-table__loading-wrapper",(a=t.loadingConfig)==null?void 0:a.customClass]]),style:r.normalizeStyle(o.value)},[r.createElementVNode("div",rB,[r.renderSlot(i.$slots,"loading",{loading:t.loading,text:n.value},()=>{var l;return[r.createElementVNode("div",iB,[(l=t.loadingConfig)!=null&&l.spinner&&t.loadingConfig.spinner!=="default"?t.loadingConfig.spinner==="circle"?(r.openBlock(),r.createElementBlock("div",aB)):t.loadingConfig.spinner==="pulse"?(r.openBlock(),r.createElementBlock("div",lB)):(r.openBlock(),r.createElementBlock("div",{key:3,class:"mc-table__spinner mc-table__spinner--custom",innerHTML:t.loadingConfig.spinner},null,8,cB)):(r.openBlock(),r.createElementBlock("div",sB,[...s[0]||(s[0]=[r.createElementVNode("div",{class:"mc-table__spinner-dot"},null,-1),r.createElementVNode("div",{class:"mc-table__spinner-dot"},null,-1),r.createElementVNode("div",{class:"mc-table__spinner-dot"},null,-1),r.createElementVNode("div",{class:"mc-table__spinner-dot"},null,-1)])]))]),n.value?(r.openBlock(),r.createElementBlock("div",dB,r.toDisplayString(n.value),1)):r.createCommentVNode("",!0)]},!0)])],6)):r.createCommentVNode("",!0)}}}),[["__scopeId","data-v-82478d6d"]]),pB={key:0,class:"mc-table__pagination"},hB={class:"mc-table__pagination-info"},fB={class:"mc-table__pagination-info-number"},mB={class:"mc-table__pagination-info-number"},gB={class:"mc-table__pagination-controls"},vB=["onClick"],yB={key:1,class:"mc-table__pagination-ellipsis"},bB={class:"mc-table__pagination-size"},kB={class:"mc-table-pagination-size-group"},wB=["onClick"],xB=r.defineComponent({__name:"mc-table-pagination",props:{pagination:{}},emits:["page-change"],setup(t,{emit:e}){var h,f,m;const n=t,o=e,i=r.ref(((h=n.pagination)==null?void 0:h.currentPage)||1),s=r.ref(((f=n.pagination)==null?void 0:f.pageSize)||50),a=r.ref(((m=n.pagination)==null?void 0:m.pageSizes)||[25,50,75,100]);r.watch(()=>{var g;return(g=n.pagination)==null?void 0:g.currentPage},g=>{g!==void 0&&(i.value=g)}),r.watch(()=>{var g;return(g=n.pagination)==null?void 0:g.pageSize},g=>{g!==void 0&&(s.value=g)});const l=r.computed(()=>n.pagination?Math.ceil(n.pagination.total/s.value):1),c=r.computed(()=>n.pagination&&n.pagination.total!==0?(i.value-1)*s.value+1:0),d=r.computed(()=>{if(!n.pagination)return 0;const g=i.value*s.value;return Math.min(g,n.pagination.total)}),u=r.computed(()=>{const g=l.value,v=i.value,b=[];if(g<=7)for(let y=1;y<=g;y++)b.push(y);else if(b.push(1),v<=4){for(let y=2;y<=5;y++)b.push(y);b.push("..."),b.push(g)}else if(v>=g-3){b.push("...");for(let y=g-4;y<=g;y++)b.push(y)}else{b.push("...");for(let y=v-1;y<=v+1;y++)b.push(y);b.push("..."),b.push(g)}return b}),p=(g,v)=>{g<1||g>l.value||v||(i.value=g,o("page-change",{pageSize:s.value,pageNum:g}))};return(g,v)=>t.pagination?(r.openBlock(),r.createElementBlock("div",pB,[r.createElementVNode("div",hB,[v[4]||(v[4]=r.createTextVNode(" Showing ",-1)),r.createElementVNode("span",fB,r.toDisplayString(c.value)+"-"+r.toDisplayString(d.value),1),v[5]||(v[5]=r.createTextVNode(" of ",-1)),r.createElementVNode("span",mB,r.toDisplayString(t.pagination.total),1)]),r.createElementVNode("div",gB,[r.createVNode(Yn,{name:"First",class:r.normalizeClass({"mc-table__icon":!0,"is-disabled":i.value<=1}),size:24,onClick:v[0]||(v[0]=b=>p(1,i.value<=1))},null,8,["class"]),r.createVNode(Yn,{name:"Left-Chevron",class:r.normalizeClass({"mc-table__icon":!0,"is-disabled":i.value<=1}),size:24,onClick:v[1]||(v[1]=b=>p(i.value-1,i.value<=1))},null,8,["class"]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.value,b=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:b},[b!=="..."?(r.openBlock(),r.createElementBlock("button",{key:0,class:r.normalizeClass(["mc-table__pagination-button mc-table__pagination-button--page",{"is-active":b===i.value}]),onClick:y=>typeof b=="number"?p(b,!1):void 0},r.toDisplayString(b),11,vB)):(r.openBlock(),r.createElementBlock("span",yB,"..."))],64))),128)),r.createVNode(Yn,{name:"Right-Chevron",class:r.normalizeClass({"mc-table__icon":!0,"is-disabled":i.value>=l.value}),size:24,onClick:v[2]||(v[2]=b=>p(i.value+1,i.value>=l.value))},null,8,["class"]),r.createVNode(Yn,{name:"Last",class:r.normalizeClass({"mc-table__icon":!0,"is-disabled":i.value>=l.value}),size:24,onClick:v[3]||(v[3]=b=>p(l.value,i.value>=l.value))},null,8,["class"])]),r.createElementVNode("div",bB,[v[6]||(v[6]=r.createElementVNode("label",{class:"mc-table__pagination-size-label"},"View per page",-1)),r.createElementVNode("div",kB,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,b=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-table-pagination-size-group-item",{"is-active":b===s.value}]),key:b,onClick:y=>(k=>{s.value=k,i.value=1,o("page-change",{pageSize:s.value,pageNum:1})})(b)},r.toDisplayString(b),11,wB))),128))])])])):r.createCommentVNode("",!0)}}),CB=q(xB,[["__scopeId","data-v-0ef67136"]]);function r0(t,e,n){var l,c;const o=r.ref(((l=e.value)==null?void 0:l.currentPage)||1),i=r.ref(((c=e.value)==null?void 0:c.pageSize)||50);r.watch(()=>{var d;return(d=e.value)==null?void 0:d.currentPage},d=>{d!==void 0&&(o.value=d)}),r.watch(()=>{var d;return(d=e.value)==null?void 0:d.pageSize},d=>{d!==void 0&&(i.value=d)});const s=r.computed(()=>{if(!e.value)return t.value;const d=(o.value-1)*i.value,u=d+i.value;return n.value?t.value.slice(d,u):t.value}),a=r.computed(()=>{if(!e.value)return{currentPage:1,pageSize:t.value.length,total:t.value.length,totalPages:1};const d=e.value.total,u=Math.ceil(d/i.value);return{currentPage:o.value,pageSize:i.value,total:d,totalPages:u}});return{currentPage:o,pageSize:i,paginatedData:s,paginationInfo:a,updatePagination:function(d){o.value=d.pageNum,i.value=d.pageSize}}}function i0(t,e,n){const o=r.ref(!1),i=r.ref(null),s=r.computed(()=>o.value?t.value:t.value.map(d=>({...d,fixed:void 0})));function a(){i.value&&(o.value=i.value.scrollWidth>i.value.clientWidth)}function l(){var d,u;(d=e.value)!=null&&d.headerWrapper&&((u=n.value)!=null&&u.bodyWrapper)&&(e.value.headerWrapper.scrollLeft=n.value.bodyWrapper.scrollLeft)}function c(){r.nextTick(()=>{var d;(d=n.value)!=null&&d.bodyWrapper&&(i.value=n.value.bodyWrapper,a(),new ResizeObserver(()=>{a()}).observe(n.value.bodyWrapper),window.addEventListener("resize",a),n.value.bodyWrapper.addEventListener("scroll",l))})}return r.onMounted(()=>{c()}),{hasHorizontalScroll:o,columnsWithFixed:s,checkHorizontalScroll:a,syncHeaderScroll:l,initScrollSync:c}}function s0(t,e,n){const o=r.ref(n||null);return{sortedData:r.computed(()=>{if(!o.value||!o.value.order)return t.value;const{prop:s,order:a}=o.value,l=e.value.find(d=>d.prop===s);if(!l)return t.value;const c=[...t.value];return c.sort((d,u)=>{let p=d[s],h=u[s];if(l.sortMethod){const f=l.sortMethod(p,h);return a==="desc"?-f:f}return p==null&&(p=""),h==null&&(h=""),typeof p=="string"&&typeof h=="string"&&(p=p.toLowerCase(),h=h.toLowerCase()),p<h?a==="asc"?-1:1:p>h?a==="asc"?1:-1:0}),c}),currentSort:o,handleSort:function(s){if(!s.sortable)return;const{prop:a}=s;let l="asc";return o.value&&o.value.prop===a&&(l=o.value.order==="asc"?"desc":o.value.order==="desc"?null:"asc"),o.value=l===null?null:{prop:a,order:l},o.value},getSortOrder:function(s){return o.value&&o.value.prop===s?o.value.order:null}}}const a0=ee(q(r.defineComponent({name:"McTable",__name:"mc-table",props:{data:{},columns:{},showHeader:{type:Boolean,default:!0},height:{},maxHeight:{},rowKey:{},emptyText:{default:"No Data"},pagination:{},loading:{type:Boolean,default:!1},loadingText:{default:"Loading..."},loadingConfig:{},highlightCurrentRow:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},selectedRows:{},selectOnRowClick:{type:Boolean,default:!1},spanMethod:{},isInitTableData:{type:Boolean,default:!0},initTableData:{},isFrontPagination:{type:Boolean,default:!1},defaultSort:{}},emits:["row-click","header-click","page-change","sort-change","current-change","selection-change","select","select-all","update:selectedRows"],setup(t,{expose:e,emit:n}){const o=t,{data:i,columns:s,pagination:a,spanMethod:l,loading:c,loadingText:d,loadingConfig:u,defaultSort:p,highlightCurrentRow:h,rowKey:f,selectable:m,selectedRows:g,selectOnRowClick:v,isFrontPagination:b}=r.toRefs(o),y=r.useSlots(),k=r.computed(()=>Object.keys(y)),x=r.ref(i.value),w=n,C=r.ref(),S=r.ref(),E=r.ref(),{columnsWithFixed:M}=i0(s,S,E),{sortedData:N,handleSort:T,getSortOrder:A}=s0(x,M,p==null?void 0:p.value),{paginatedData:$,updatePagination:B}=r0(N,a,b),V=r.computed(()=>$.value),{internalSelectedRows:O,isAllSelected:D,isIndeterminate:F,toggleRowSelection:R,toggleAllSelection:L,clearSelection:I,getSelectedRows:P}=function(X,oe,ae){const se=r.ref((ae==null?void 0:ae.value)||[]);r.watch(ae,de=>{de&&(se.value=[...de])},{deep:!0,immediate:!0});const be=de=>se.value.some(me=>oe.value?me[oe.value]===de[oe.value]:me===de),Fe=()=>X.value.filter(de=>be(de)).length,Me=r.computed(()=>!!X.value.length&&X.value.every(de=>be(de))),Ne=r.computed(()=>{if(!X.value.length)return!1;const de=Fe();return de>0&&de<X.value.length});return{internalSelectedRows:se,isRowSelected:be,isAllSelected:Me,isIndeterminate:Ne,toggleRowSelection:(de,me)=>{const at=me!==void 0?me:!be(de);if(at)be(de)||se.value.push(de);else{const Le=se.value.findIndex(_e=>oe.value?_e[oe.value]===de[oe.value]:_e===de);Le>-1&&se.value.splice(Le,1)}return at},toggleAllSelection:de=>{de?X.value.forEach(me=>{be(me)||se.value.push(me)}):X.value.forEach(me=>{const at=se.value.findIndex(Le=>oe.value?Le[oe.value]===me[oe.value]:Le===me);at>-1&&se.value.splice(at,1)})},clearSelection:()=>{se.value=[]},getSelectedRows:()=>[...se.value],getCurrentPageSelectionInfo:()=>{const de=X.value.length,me=Fe();return{totalCount:de,selectedCount:me,isAllSelected:de>0&&me===de,isIndeterminate:me>0&&me<de}}}}(V,f,g),{setCurrentRow:W,getRowClass:z}=function(X){const oe=r.ref(null);return{currentRow:oe,setCurrentRow:ae=>(oe.value=ae,oe.value),getRowClass:ae=>{const se=[];return X.value&&oe.value===ae&&se.push("is-current"),se},clearCurrentRow:()=>{oe.value=null}}}(h);r.watch(()=>i.value,X=>{x.value=X},{deep:!0,immediate:!0});const j=(X,oe)=>{if(h.value){const ae=W(X);w("current-change",ae)}if(m.value&&v.value){const ae=R(X);te(X,ae)}w("row-click",X,oe)},K=(X,oe)=>{w("header-click",X,oe)},G=X=>{const oe=T(X);oe&&w("sort-change",oe)},Z=(X,oe)=>{const ae=R(X,oe);te(X,ae)},J=X=>{L(X),te(null,X)},Y=async X=>{B(X),r.nextTick(()=>{var oe;(oe=E.value)!=null&&oe.bodyWrapper&&(E.value.bodyWrapper.scrollTop=0)}),w("page-change",X),await pe()},te=(X,oe)=>{w("update:selectedRows",[...O.value]),w("selection-change",[...O.value]),X?w("select",X,oe):w("select-all",oe)},pe=async()=>{if(o.isInitTableData&&o.initTableData&&typeof o.initTableData=="function"){const{data:X,total:oe}=await o.initTableData({pageSize:a.value.pageSize||10,pageNum:a.value.currentPage||1});x.value=X,a.value.total=oe}};return r.onMounted(()=>{pe()}),e({ref:C,clearSort:()=>{s.value.forEach(X=>{X.sortable&&(X.sortOrder=null)})},toggleRowSelection:(X,oe)=>{const ae=R(X,oe);te(X,ae)},refresh:async()=>{a.value.currentPage=1,await pe()},toggleAllSelection:X=>{L(X),te(null,X)},clearSelection:()=>{I(),w("update:selectedRows",[]),w("selection-change",[])},getSelectedRows:P}),(X,oe)=>{var ae;return r.openBlock(),r.createElementBlock("div",{ref_key:"_ref",ref:C,class:r.normalizeClass(["mc-table",{"mc-table--loading":r.unref(c)}])},[r.createVNode(oB,{ref_key:"headerRef",ref:S,columns:r.unref(M),"show-header":t.showHeader,"get-sort-order":r.unref(A),selectable:r.unref(m),"is-all-selected":r.unref(D),"is-indeterminate":r.unref(F),onHeaderClick:K,onSortChange:G,onSelectAll:J},r.createSlots({_:2},[r.renderList(k.value,se=>({name:se,fn:r.withCtx(be=>[r.renderSlot(X.$slots,se,r.normalizeProps(r.guardReactiveProps(be)),void 0,!0)])}))]),1032,["columns","show-header","get-sort-order","selectable","is-all-selected","is-indeterminate"]),r.createVNode(qN,{ref_key:"bodyRef",ref:E,data:V.value,columns:r.unref(M),"row-key":r.unref(f),"empty-text":t.emptyText,height:t.height,"max-height":t.maxHeight,"span-method":r.unref(l),pagination:r.unref(a),"get-row-class":r.unref(z),selectable:r.unref(m),"selected-rows":r.unref(O),"select-on-row-click":r.unref(v),onRowClick:j,onSelect:Z},r.createSlots({_:2},[r.renderList(k.value,se=>({name:se,fn:r.withCtx(be=>[r.renderSlot(X.$slots,se,r.normalizeProps(r.guardReactiveProps(be)),void 0,!0)])}))]),1032,["data","columns","row-key","empty-text","height","max-height","span-method","pagination","get-row-class","selectable","selected-rows","select-on-row-click"]),r.unref(a)&&((ae=r.unref(a))==null?void 0:ae.total)>0?(r.openBlock(),r.createBlock(CB,{key:0,pagination:r.unref(a),onPageChange:Y},null,8,["pagination"])):r.createCommentVNode("",!0),r.createVNode(uB,{class:"mc-table__loading",loading:r.unref(c),"loading-text":r.unref(d),"loading-config":r.unref(u)},{loading:r.withCtx(se=>[r.renderSlot(X.$slots,"loading",r.normalizeProps(r.guardReactiveProps(se)),void 0,!0)]),_:3},8,["loading","loading-text","loading-config"])],2)}}}),[["__scopeId","data-v-6db2a64d"]])),l0="mc-table-plus",c0="mc-table-header",d0="mc-table-sort",u0="mc-table-body",p0="mc-table-row",h0="mc-table-cell",f0="mc-table-empty",m0="mc-table-loading",g0="mc-table-scroll",v0="mc-table-footer",y0="mc-table-total",b0="mc-page-size",k0="mc-table-pagination",w0="mc-table-pagination-item",x0="mc-table-ellipsis",pr={fixed:"none",sortable:!1,columnAlign:"left",rowAlign:"center",sortType:"string"},Jd=Symbol("mc-table-context"),Hn=()=>{const t=r.inject(Jd,void 0);return{tableCtx:t,data:t.data,tableWidth:t.tableWidth,isLoading:r.computed(()=>!!t.isLoading.value),columnWidth:t.columnWidth,leftColumns:t.leftColumns,rightColumns:t.rightColumns,centerColumns:t.centerColumns,scroll:t.scroll,setScroll:t.setScroll,pagination:t.pagination,handlePagination:t.handlePagination,doSort:t.handleSort,isExpanded:t.isExpanded,getExpandData:t.getExpandData,setExpandData:t.setExpandData,removeExpandData:t.removeExpandData,getCurrentSort:t.getCurrentSort,expandCondition:t.expandCondition,fetchExpandData:t.fetchExpandData,leftWidth:t.leftWidth,rightWidth:t.rightWidth,centerWidth:t.centerWidth,viewWidth:t.viewWidth}},Gd={pageNum:1,pageSize:25,total:1,pageSizes:[25,50,75,100]},Yd="mc-table-column-plus",SB={class:"mc-table-column"},C0=ee(r.defineComponent({name:Yd,__name:"mc-table-column-plus",props:{prop:{},label:{},desc:{},width:{},fixed:{},sortable:{type:Boolean},columnAlign:{},rowAlign:{},sortType:{type:[String,Function]},defaultValue:{type:[String,Number,Boolean]}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",SB))})),EB=(t=nt)=>{switch(t){case"left":return"flex-start";case"center":return"center";case"right":return"flex-end"}},MB={key:0,class:"mc-table-row-tr mc-table-row-left"},NB={class:"mc-table-row-center-content"},BB={key:3,class:"mc-table-row-tr mc-table-row-right"},TB=r.defineComponent({name:p0,__name:"mc-table-row",props:{type:{default:"body"},leftColumns:{default:()=>[]},rightColumns:{default:()=>[]},centerColumns:{default:()=>[]}},setup(t){const e=t,n=r.ref(),{scroll:o,setScroll:i,leftWidth:s,rightWidth:a,centerWidth:l,viewWidth:c}=Hn();r.onMounted(()=>{p(o.value)}),r.watch(()=>o.value,h=>{p(h)});const d=r.computed(()=>e.rightColumns.length>0&&o.value>0),u=r.computed(()=>{const h=Fi(c.value)+Fi(o.value)+5<Fi(l.value);return e.leftColumns.length>0&&h}),p=h=>{n.value&&n.value.scrollTo({left:h})};return ji(n,"scroll",h=>{const f=h.target.scrollLeft||0;i(f)}),(h,f)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-table-row",[`mc-table-row-${t.type}`]])},[t.leftColumns.length?(r.openBlock(),r.createElementBlock("tr",MB,[r.renderSlot(h.$slots,"left",{columns:t.leftColumns},void 0,!0)])):r.createCommentVNode("",!0),d.value?(r.openBlock(),r.createElementBlock("div",{key:1,class:"mc-table-border mc-table-row-left-border",style:r.normalizeStyle({left:r.unref(dl)(r.unref(s))})},null,4)):r.createCommentVNode("",!0),r.createElementVNode("div",{ref_key:"rowRef",ref:n,class:"mc-table-row-tr mc-table-row-center"},[r.createElementVNode("div",NB,[r.renderSlot(h.$slots,"default",{columns:t.centerColumns},void 0,!0)])],512),u.value?(r.openBlock(),r.createElementBlock("div",{key:2,class:"mc-table-border mc-table-row-right-border",style:r.normalizeStyle({right:r.unref(dl)(r.unref(a))})},null,4)):r.createCommentVNode("",!0),t.rightColumns.length?(r.openBlock(),r.createElementBlock("tr",BB,[r.renderSlot(h.$slots,"right",{columns:t.rightColumns},void 0,!0)])):r.createCommentVNode("",!0)],2))}}),Xd=q(TB,[["__scopeId","data-v-d6e829ca"]]),OB=q(r.defineComponent({name:d0,__name:"mc-table-sort",props:{sort:{default:"normal"}},setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["mc-table-sort",`mc-table-sort-${t.sort}`])},[r.createVNode(r.unref(ge),{name:"Up-Chevron02",class:r.normalizeClass({"mc-table-sort-actived":t.sort==="asc"}),style:{height:"8px"}},null,8,["class"]),r.createVNode(r.unref(ge),{name:"Down-Chevron02",class:r.normalizeClass({"mc-table-sort-actived":t.sort==="desc"}),style:{height:"8px"}},null,8,["class"])],2))}),[["__scopeId","data-v-d2a14a84"]]),_B={class:"mc-table-header-cell-title"},VB={class:"mc-table-header-cell-title-text"},DB={key:0,class:"mc-table-header-cell-sort"},AB={class:"mc-table-header-cell-desc"},IB={class:"mc-table-body-cell-value"},mn=q(r.defineComponent({name:h0,__name:"mc-table-cell",props:{column:{},width:{},type:{default:"body"},row:{},rowIndex:{}},setup(t){const e=r.ref(),{isHeader:n,isExpand:o,isExpandIcon:i,cellStyle:s,headerCtx:a,bodyCtx:l,expandIconCtx:c}=(d=>{var $;const{columnWidth:u,doSort:p,isExpanded:h,setExpandData:f,removeExpandData:m,getCurrentSort:g,expandCondition:v,fetchExpandData:b}=Hn(),y=ue("column"),k=ue("type"),x=ue("width"),w=r.computed(()=>k.value==="header"),C=r.computed(()=>k.value==="body"),S=r.computed(()=>k.value==="expand"),E=r.computed(()=>k.value==="expand-icon"),M=r.computed(()=>{var O,D;const B=x.value?`${x.value}px`:u!=null&&u.value?`${u.value}px`:"auto";let V="default";return w.value&&((O=y==null?void 0:y.value)!=null&&O.sortable)&&(V="pointer"),{width:B,cursor:V,alignItems:E.value?"center":EB((D=y==null?void 0:y.value)==null?void 0:D.columnAlign)}});let N={},T={},A={};if(w.value){const B=r.computed(()=>{var V;return He(g)?g(((V=y==null?void 0:y.value)==null?void 0:V.prop)||""):"normal"});if(($=y==null?void 0:y.value)!=null&&$.sortable){const V=Io(()=>{var O;p(((O=y==null?void 0:y.value)==null?void 0:O.prop)||"",(D=>{switch(D){case"normal":return"desc";case"desc":return"asc";default:return"normal"}})(B.value))},500);ji(d,"click",V)}N={currentSort:B}}else if(E.value){const B=ue("row"),V=ue("rowIndex"),O=r.computed(()=>!He(v)||r.unref(v(B==null?void 0:B.value))),D=r.computed(()=>{const R=V==null?void 0:V.value;return!ye(R)&&h(R)}),F=Io(async()=>{if(ye(V==null?void 0:V.value))return;let R=[];He(b)&&!D.value?(R=r.unref(await b(B==null?void 0:B.value)),f(V.value,R)):m(V.value)},500);r.watchEffect(()=>{var R,L;O.value?(R=d.value)==null||R.addEventListener("click",F):(L=d.value)==null||L.removeEventListener("click",F)}),r.onBeforeMount(()=>{var R;(R=d.value)==null||R.removeEventListener("click",F)}),A={allowExpand:O,isExpanded:D}}else if(C.value){const B=ue("row");T={displayValue:r.computed(()=>{var D,F;const V=((D=y==null?void 0:y.value)==null?void 0:D.defaultValue)||"--",O=(F=y==null?void 0:y.value)==null?void 0:F.prop;return ye(O)||ye(B==null?void 0:B.value)||ye(B.value[O])?V:B.value[O]})}}return{isHeader:w,isBody:C,isExpand:S,isExpandIcon:E,cellStyle:M,headerCtx:N,bodyCtx:T,expandIconCtx:A}})(e);return(d,u)=>r.unref(n)?(r.openBlock(),r.createElementBlock("th",{key:0,ref_key:"cellRef",ref:e,class:r.normalizeClass(`mc-table-${t.type}-cell`),style:r.normalizeStyle(r.unref(s))},[r.renderSlot(d.$slots,"header",{},()=>{var p;return[r.createElementVNode("div",_B,[r.createElementVNode("div",VB,[r.renderSlot(d.$slots,"title",{},()=>[r.createTextVNode(r.toDisplayString(t.column.label),1)],!0)]),t.column.sortable?(r.openBlock(),r.createElementBlock("div",DB,[r.createVNode(OB,{sort:(p=r.unref(a).currentSort)==null?void 0:p.value},null,8,["sort"])])):r.createCommentVNode("",!0)]),t.column.desc||d.$slots.desc?r.renderSlot(d.$slots,"desc",{key:0},()=>[r.createElementVNode("div",AB,r.toDisplayString(t.column.desc),1)],!0):r.createCommentVNode("",!0)]},!0)],6)):r.unref(o)?(r.openBlock(),r.createElementBlock("td",{key:1,ref_key:"cellRef",ref:e,class:r.normalizeClass(`mc-table-${t.type}-cell`),style:r.normalizeStyle(r.unref(s))},[r.renderSlot(d.$slots,"default",{},void 0,!0)],6)):r.unref(i)?(r.openBlock(),r.createElementBlock("td",{key:2,ref_key:"cellRef",ref:e,class:r.normalizeClass(`mc-table-${t.type}-cell`),style:r.normalizeStyle(r.unref(s))},[r.renderSlot(d.$slots,"default",{},()=>{var p,h,f;return[(p=r.unref(c).allowExpand)!=null&&p.value?(r.openBlock(),r.createBlock(r.unref(Ee),{key:0,class:r.normalizeClass(["mc-table-expand-icon",{"mc-table-expand-icon-active":(h=r.unref(c).isExpanded)==null?void 0:h.value}]),cursor:(f=r.unref(c).allowExpand)!=null&&f.value?"pointer":"default",name:"down-chevron"},null,8,["class","cursor"])):r.createCommentVNode("",!0)]},!0)],6)):(r.openBlock(),r.createElementBlock("td",{key:3,ref_key:"cellRef",ref:e,class:r.normalizeClass([`mc-table-${t.type}-cell`,`mc-table-${t.type}-cell-row-align-${t.column.rowAlign}`]),style:r.normalizeStyle(r.unref(s))},[r.renderSlot(d.$slots,"default",{},()=>{var p;return[r.createElementVNode("span",IB,r.toDisplayString((p=r.unref(l).displayValue)==null?void 0:p.value),1)]},!0)],6))}}),[["__scopeId","data-v-70b5f5c7"]]),RB={class:"mc-table-header"},LB={class:"mc-table-header-thead"},$B=q(r.defineComponent({name:c0,__name:"mc-table-header",setup(t){const{leftColumns:e,rightColumns:n,centerColumns:o}=Hn();return(i,s)=>(r.openBlock(),r.createElementBlock("table",RB,[r.createElementVNode("thead",LB,[r.createVNode(Xd,{type:"header","left-columns":r.unref(e),"right-columns":r.unref(n),"center-columns":r.unref(o)},{left:r.withCtx(({columns:a})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a,l=>(r.openBlock(),r.createBlock(mn,{key:l.prop,column:l,width:l.width,type:"header"},r.createSlots({_:2},[l.header?{name:"header",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.header)))]),key:"0"}:void 0,l.headerTitle?{name:"title",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerTitle)))]),key:"1"}:void 0,l.headerDesc?{name:"desc",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerDesc)))]),key:"2"}:void 0]),1032,["column","width"]))),128))]),default:r.withCtx(({columns:a})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a,l=>(r.openBlock(),r.createBlock(mn,{key:l.prop,column:l,width:l.width,type:"header"},r.createSlots({_:2},[l.header?{name:"header",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.header)))]),key:"0"}:void 0,l.headerTitle?{name:"title",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerTitle)))]),key:"1"}:void 0,l.headerDesc?{name:"desc",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerDesc)))]),key:"2"}:void 0]),1032,["column","width"]))),128))]),right:r.withCtx(({columns:a})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a,l=>(r.openBlock(),r.createBlock(mn,{key:l.prop,column:l,width:l.width,type:"header"},r.createSlots({_:2},[l.header?{name:"header",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.header)))]),key:"0"}:void 0,l.headerTitle?{name:"title",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerTitle)))]),key:"1"}:void 0,l.headerDesc?{name:"desc",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(l.headerDesc)))]),key:"2"}:void 0]),1032,["column","width"]))),128))]),_:1},8,["left-columns","right-columns","center-columns"])])]))}}),[["__scopeId","data-v-d527354e"]]),PB={key:0,class:"mc-table-total"},zB={class:"mc-table-total-number"},FB={class:"mc-table-total-number"},jB=q(r.defineComponent({name:y0,__name:"mc-table-total",setup(t){const{pagination:e}=Hn(),n=r.computed(()=>{if(!e)return;const{pageNum:o,pageSize:i,total:s}=e;return{range:`${(o-1)*i+1}-${Math.min(o*i,s)}`,total:s}});return(o,i)=>n.value?(r.openBlock(),r.createElementBlock("div",PB,[i[0]||(i[0]=r.createElementVNode("span",null,"Showing",-1)),r.createElementVNode("span",zB,r.toDisplayString(n.value.range),1),i[1]||(i[1]=r.createElementVNode("span",null,"of",-1)),r.createElementVNode("span",FB,r.toDisplayString(n.value.total),1)])):r.createCommentVNode("",!0)}}),[["__scopeId","data-v-c15a3cd2"]]),HB={class:"mc-table-ellipsis"},WB=q(r.defineComponent({name:x0,__name:"mc-table-ellipsis",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",HB,[...n[0]||(n[0]=[r.createElementVNode("i",{class:"mc-table-ellipsis-dot"},null,-1),r.createElementVNode("i",{class:"mc-table-ellipsis-dot"},null,-1),r.createElementVNode("i",{class:"mc-table-ellipsis-dot"},null,-1)])]))}),[["__scopeId","data-v-ba28fc7a"]]),gn=q(r.defineComponent({name:w0,__name:"mc-table-pagination-item",props:{type:{default:"page"},value:{default:1},isActive:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1}},setup(t){const e=t,n=r.computed(()=>{switch(e.type){case"page":return"mc-table-pagination-item-page";case"prev":return"mc-table-pagination-item-prev";case"next":return"mc-table-pagination-item-next";case"first":return"mc-table-pagination-item-first";case"last":return"mc-table-pagination-item-last";case"ellipsis":return"mc-table-pagination-item-ellipsis";default:return"mc-table-pagination-item"}});return(o,i)=>(r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-table-pagination-item",[{"mc-table-pagination-item-active":t.isActive,"mc-table-pagination-item-disabled":t.isDisabled},n.value]])},[t.type==="page"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createTextVNode(r.toDisplayString(t.value),1)],64)):t.type==="prev"?(r.openBlock(),r.createBlock(r.unref(ge),{key:1,name:"Left-Chevron"})):t.type==="next"?(r.openBlock(),r.createBlock(r.unref(ge),{key:2,name:"Right-Chevron"})):t.type==="first"?(r.openBlock(),r.createBlock(r.unref(ge),{key:3,name:"First"})):t.type==="last"?(r.openBlock(),r.createBlock(r.unref(ge),{key:4,name:"Last"})):t.type==="ellipsis"?(r.openBlock(),r.createBlock(WB,{key:5})):r.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-29751a1d"]]),KB={key:0,class:"mc-table-pagination"},UB=r.defineComponent({name:k0,__name:"mc-table-pagination",setup(t){const{pagination:e,isLoading:n,handlePagination:o}=Hn(),i=r.computed(()=>e?Math.ceil(e.total/e.pageSize):0),s=r.computed(()=>{if(!e||i.value<=1)return[];const h=[];if(i.value<=5)for(let f=2;f<i.value;f++)h.push(f);else e.pageNum<=2?h.push(2,3,4,5):e.pageNum>=i.value-1?h.push(i.value-4,i.value-3,i.value-2,i.value-1):h.push(e.pageNum-1,e.pageNum,e.pageNum+1);return h}),a=r.computed(()=>!e||e.pageNum<=1),l=r.computed(()=>!e||e.pageNum>=i.value),c=r.computed(()=>!e||i.value<=1),d=r.computed(()=>!!e&&i.value>5&&e.pageNum>2),u=r.computed(()=>!!e&&i.value>5&&e.pageNum<i.value-1),p=h=>{He(o)&&!n.value&&(h==="first"?a.value||o({pageNum:1}):h==="prev"?e&&e.pageNum>1&&!a.value&&o({pageNum:e.pageNum-1}):h==="next"?e&&e.pageNum<i.value&&!l.value&&o({pageNum:e.pageNum+1}):h==="last"?l.value||o({pageNum:i.value}):h!==(e==null?void 0:e.pageNum)&&o({pageNum:h}))};return(h,f)=>{var m,g;return c.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("ul",KB,[r.createVNode(gn,{type:"first","is-disabled":a.value,onClick:f[0]||(f[0]=v=>p("first"))},null,8,["is-disabled"]),r.createVNode(gn,{type:"prev","is-disabled":a.value,onClick:f[1]||(f[1]=v=>p("prev"))},null,8,["is-disabled"]),r.createVNode(gn,{value:1,"is-active":((m=r.unref(e))==null?void 0:m.pageNum)===1,onClick:f[2]||(f[2]=v=>p(1))},null,8,["is-active"]),d.value?(r.openBlock(),r.createBlock(gn,{key:0,type:"ellipsis"})):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,v=>{var b;return r.openBlock(),r.createBlock(gn,{key:v,value:v,"is-active":((b=r.unref(e))==null?void 0:b.pageNum)===v,onClick:y=>p(v)},null,8,["value","is-active","onClick"])}),128)),u.value?(r.openBlock(),r.createBlock(gn,{key:1,type:"ellipsis"})):r.createCommentVNode("",!0),r.createVNode(gn,{value:i.value,"is-active":((g=r.unref(e))==null?void 0:g.pageNum)===i.value,onClick:f[3]||(f[3]=v=>p(i.value))},null,8,["value","is-active"]),r.createVNode(gn,{type:"next","is-disabled":l.value,onClick:f[4]||(f[4]=v=>p("next"))},null,8,["is-disabled"]),r.createVNode(gn,{type:"last","is-disabled":l.value,onClick:f[5]||(f[5]=v=>p("last"))},null,8,["is-disabled"])]))}}}),qB=q(UB,[["__scopeId","data-v-834130e0"]]),JB={class:"mc-table-page-size"},GB={class:"mc-table-page-size-group"},YB=["onClick"],XB=q(r.defineComponent({name:b0,__name:"mc-table-page-size",setup(t){const{pagination:e,isLoading:n,handlePagination:o}=Hn();return(i,s)=>{var a;return r.openBlock(),r.createElementBlock("div",JB,[s[0]||(s[0]=r.createElementVNode("span",{class:"mc-table-page-size-text"},"View per page",-1)),r.createElementVNode("ul",GB,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList((a=r.unref(e))==null?void 0:a.pageSizes,l=>{var c;return r.openBlock(),r.createElementBlock("li",{class:r.normalizeClass(["mc-table-page-size-group-item",{"mc-table-page-size-group-item-active":l===((c=r.unref(e))==null?void 0:c.pageSize)}]),key:l,onClick:d=>(u=>{He(o)&&!n.value&&o({pageSize:u,pageNum:1})})(l)},r.toDisplayString(l),11,YB)}),128))])])}}}),[["__scopeId","data-v-ff7678cb"]]),QB={class:"mc-table-footer"},ZB=q(r.defineComponent({name:v0,__name:"mc-table-footer",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",QB,[r.createVNode(jB),r.createVNode(qB),r.createVNode(XB)]))}),[["__scopeId","data-v-3cb93fac"]]),eT={class:"mc-table-loading"},tT=q(r.defineComponent({name:m0,__name:"mc-table-loading",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",eT,[r.renderSlot(e.$slots,"default",{},()=>[r.createVNode(r.unref(Pl),{loading:!0,type:"pulse",size:"small"})],!0)]))}),[["__scopeId","data-v-09b278cb"]]),nT={class:"mc-table-body"},oT={class:"mc-table-body-tbody"},rT=q(r.defineComponent({name:u0,__name:"mc-table-body",props:{loading:{type:Boolean,default:!1}},setup(t){const{data:e,leftColumns:n,rightColumns:o,centerColumns:i,isExpanded:s,getExpandData:a}=Hn();return(l,c)=>(r.openBlock(),r.createElementBlock("table",nT,[r.createElementVNode("tbody",oT,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(e),(d,u)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:u},[r.createVNode(Xd,{"left-columns":r.unref(n),"right-columns":r.unref(o),"center-columns":r.unref(i)},{left:r.withCtx(({columns:p})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p,h=>(r.openBlock(),r.createBlock(mn,{key:h.prop,column:h,row:d,rowIndex:u,width:h.width,type:h.isExpand?"expand-icon":"body"},r.createSlots({_:2},[h.tableValue?{name:"default",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(h.tableValue),{value:d==null?void 0:d[h.prop],row:d,rowIndex:u},null,8,["value","row","rowIndex"]))]),key:"0"}:void 0]),1032,["column","row","rowIndex","width","type"]))),128))]),default:r.withCtx(({columns:p})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p,h=>(r.openBlock(),r.createBlock(mn,{key:h.prop,column:h,row:d,rowIndex:u,width:h.width,type:h.isExpand?"expand-icon":"body"},r.createSlots({_:2},[h.tableValue?{name:"default",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(h.tableValue),{value:d==null?void 0:d[h.prop],row:d,rowIndex:u},null,8,["value","row","rowIndex"]))]),key:"0"}:void 0]),1032,["column","row","rowIndex","width","type"]))),128))]),right:r.withCtx(({columns:p})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p,h=>(r.openBlock(),r.createBlock(mn,{key:h.prop,column:h,row:d,rowIndex:u,width:h.width,type:h.isExpand?"expand-icon":"body"},r.createSlots({_:2},[h.tableValue?{name:"default",fn:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(h.tableValue),{value:d==null?void 0:d[h.prop],row:d,rowIndex:u},null,8,["value","row","rowIndex"]))]),key:"0"}:void 0]),1032,["column","row","rowIndex","width","type"]))),128))]),_:2},1032,["left-columns","right-columns","center-columns"]),r.unref(s)(u)?(r.openBlock(!0),r.createElementBlock(r.Fragment,{key:0},r.renderList(r.unref(a)(u),(p,h)=>(r.openBlock(),r.createBlock(Xd,{key:h,"left-columns":r.unref(n),"right-columns":r.unref(o),"center-columns":r.unref(i),type:"expand"},{left:r.withCtx(({columns:f})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f,m=>(r.openBlock(),r.createBlock(mn,{key:m.prop,column:m,width:m.width,type:"expand"},{default:r.withCtx(()=>[m.expand?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.expand),{key:0,expandRow:p,expandRowIndex:h},null,8,["expandRow","expandRowIndex"])):r.createCommentVNode("",!0)]),_:2},1032,["column","width"]))),128))]),default:r.withCtx(({columns:f})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f,m=>(r.openBlock(),r.createBlock(mn,{key:m.prop,column:m,width:m.width,type:"expand"},{default:r.withCtx(()=>[m.expand?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.expand),{key:0,expandRow:p,expandRowIndex:h},null,8,["expandRow","expandRowIndex"])):r.createCommentVNode("",!0)]),_:2},1032,["column","width"]))),128))]),right:r.withCtx(({columns:f})=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f,m=>(r.openBlock(),r.createBlock(mn,{key:m.prop,column:m,width:m.width,type:"expand"},{default:r.withCtx(()=>[m.expand?(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.expand),{key:0,expandRow:p,expandRowIndex:h},null,8,["expandRow","expandRowIndex"])):r.createCommentVNode("",!0)]),_:2},1032,["column","width"]))),128))]),_:2},1032,["left-columns","right-columns","center-columns"]))),128)):r.createCommentVNode("",!0)],64))),128))]),t.loading?(r.openBlock(),r.createBlock(tT,{key:0},{default:r.withCtx(()=>[r.renderSlot(l.$slots,"loading",{},void 0,!0)]),_:3})):r.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-41def2b7"]]),iT={class:"mc-table-empty"},sT=q(r.defineComponent({name:f0,__name:"mc-table-empty",setup:t=>(e,n)=>(r.openBlock(),r.createElementBlock("div",iT,[r.renderSlot(e.$slots,"default",{},()=>[n[0]||(n[0]=r.createElementVNode("p",{class:"mc-table-empty-content"},"No available data",-1))],!0)]))}),[["__scopeId","data-v-6e5712f5"]]),aT=r.defineComponent({name:g0,__name:"mc-table-scroll",setup(t){const{scroll:e,centerWidth:n,viewWidth:o,tableWidth:i,setScroll:s}=Hn(),a=r.ref(),l=r.ref(),c=r.computed(()=>Uu(o.value/n.value*100)),d=r.computed(()=>Fi(c.value)<=95),u=r.computed(()=>`${c.value}%`),p=r.ref(0);r.watchEffect(()=>{p.value=n.value?e.value*i.value/n.value:0});let h=0,f=0;const m=y=>{a.value&&(h=y.clientX,f=p.value,window.addEventListener("mousemove",g),window.addEventListener("mouseup",v))},g=y=>{var S,E;let k=y.clientX-h+f;k<0&&(k=0);const x=((E=(S=l.value)==null?void 0:S.getBoundingClientRect())==null?void 0:E.width)||0,w=i.value-x+2;k>w&&(k=w),p.value=k;const C=p.value*n.value/i.value;s(C)},v=()=>{b()},b=()=>{window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",v)};return r.onBeforeUnmount(()=>{b()}),(y,k)=>d.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"scrollRef",ref:a,class:"mc-table-scroll",onMousedown:m},[r.createElementVNode("div",{ref_key:"thumbRef",ref:l,class:"mc-table-scroll-thumb",style:r.normalizeStyle({width:u.value,transform:`translateX(${r.unref(dl)(p.value)})`})},null,4)],544)):r.createCommentVNode("",!0)}}),lT=q(aT,[["__scopeId","data-v-a80497f3"]]),cT=r.defineComponent({name:l0,__name:"mc-table-plus",props:{data:{default:()=>[]},loading:{type:Boolean,default:!1},sortType:{default:"back"},pagination:{},width:{default:"100%"},height:{},expandCondition:{},fetchExpandData:{}},emits:["change:sort","change:pagination","change:expand"],setup(t,{emit:e}){const n=t,o=e,i=r.ref(),{width:s,height:a}=lt(),l=r.ref(n.data),{columns:c,leftColumns:d,centerColumns:u,rightColumns:p,tableWidth:h,columnWidth:f}=(R=>{const L=r.ref([]),I=r.ref([]),P=r.ref([]),W=r.ref([]),z=r.ref(0),j=r.reactive({tableWidth:0,fixedWidth:0,restColumns:0}),K=r.useSlots();r.watch(()=>{var Z;return(Z=K.default)==null?void 0:Z.call(K)},()=>{var X;const{columns:Z,columnWidthInfo:J,leftColumns:Y,centerColumns:te,rightColumns:pe}=(oe=>{const ae=[],se=[],be=[],Fe=[],Me={tableWidth:0,fixedWidth:0,restColumns:0},Ne=de=>{ce(de)&&de.forEach(me=>{var Le;if(((Le=(me==null?void 0:me.type)||{})==null?void 0:Le.name)===Yd){const _e=me.children,ie=me.props,Wn=Ao(ie==null?void 0:ie.sortable)&&ie.sortable===""||(ie==null?void 0:ie.sortable)||pr.sortable,Qt={prop:ie==null?void 0:ie.prop,label:ie==null?void 0:ie.label,desc:ie==null?void 0:ie.desc,width:(ie==null?void 0:ie.prop)==="expand"?40:ie==null?void 0:ie.width,fixed:(ie==null?void 0:ie.fixed)||pr.fixed,defaultValue:ie==null?void 0:ie.defaultValue,sortable:Wn,isExpand:(ie==null?void 0:ie.prop)==="expand",sortType:(ie==null?void 0:ie.sortType)||(ie==null?void 0:ie["sort-type"])||pr.sortType,columnAlign:(ie==null?void 0:ie.columnAlign)||(ie==null?void 0:ie["column-align"])||pr.columnAlign,rowAlign:(ie==null?void 0:ie.rowAlign)||(ie==null?void 0:ie["row-align"])||pr.rowAlign,headerTitle:_e==null?void 0:_e["header-title"],headerDesc:_e==null?void 0:_e["header-desc"],header:_e==null?void 0:_e.header,expand:_e==null?void 0:_e.expand,tableValue:_e==null?void 0:_e.default};Qt.width?Me.fixedWidth+=Qt.width:Me.restColumns+=1,Qt.fixed==="left"?se.push(Qt):Qt.fixed==="right"?Fe.push(Qt):be.push(Qt),ae.push(Qt)}else Array.isArray(me.children)&&Ne(me.children)})};return Ne(oe),{columns:ae,columnWidthInfo:Me,leftColumns:se,centerColumns:be,rightColumns:Fe}})((X=K.default)==null?void 0:X.call(K));L.value=Z,j.fixedWidth=J.fixedWidth,j.restColumns=J.restColumns,I.value=Y,P.value=te,W.value=pe},{immediate:!0}),$p(R,({width:Z})=>{let J=Z;I.value.length>0&&(J-=1),W.value.length>0&&(J-=1),z.value=J});const G=r.computed(()=>{const Z=(z.value-j.fixedWidth)/j.restColumns;return Z<=0?240:Z});return{columns:L,leftColumns:I,centerColumns:P,rightColumns:W,tableWidth:z,columnWidth:G}})(i),{scroll:m,setScroll:g,resetScroll:v}=(()=>{const R=r.ref(0);return{scroll:R,setScroll:L=>{R.value=L},resetScroll:()=>{R.value=0}}})(),{setSort:b,resetSort:y,getCurrentSort:k,sortData:x}=(()=>{const R=r.ref({sort:"normal",sortColumn:""}),L=(P,W)=>{R.value={sort:W,sortColumn:P}},I=P=>R.value.sortColumn===P?R.value.sort:"normal";return{sortInfo:R,setSort:L,resetSort:()=>L("","normal"),getCurrentSort:I,sortData:(P,W)=>{let z=[...P];const j=W.prop,K=I(j),G=W.sortType||"string";return K!=="normal"&&(He(G)||(J=G==="number"?te=>Number(te[j]):[j],Y=[K],z=(Z=z)==null?[]:(ce(J)||(J=J==null?[]:[J]),ce(Y)||(Y=Y==null?[]:[Y]),function(te,pe,X){pe=pe.length?So(pe,function(ae){return ce(ae)?function(se){return Ga(se,ae.length===1?ae[0]:ae)}:ae}):[Eo];var oe=-1;return pe=So(pe,Ti(yn)),function(ae){var se=ae.length;for(ae.sort(function(be,Fe){return function(Me,Ne,de){for(var me=-1,at=Me.criteria,Le=Ne.criteria,_e=at.length,ie=de.length;++me<_e;){var Wn=ak(at[me],Le[me]);if(Wn)return me>=ie?Wn:Wn*(de[me]=="desc"?-1:1)}return Me.index-Ne.index}(be,Fe,X)});se--;)ae[se]=ae[se].value;return ae}(Mp(te,function(ae,se,be){return{criteria:So(pe,function(Fe){return Fe(ae)}),index:++oe,value:ae}}))}(Z,J,Y)))),z;var Z,J,Y}}})(),{pagination:w,hasPagination:C,handlePagination:S}=(()=>{const R=ue("pagination"),L=r.reactive({...Gd});r.onMounted(()=>{I(R.value||Gd)});const I=j=>{zu(L,{...j})};r.watch(()=>R.value,j=>{I(j||Gd)},{deep:!0});const P=r.getCurrentInstance(),W=$i(()=>{P==null||P.emit("change:pagination",L)},500),z=r.computed(()=>{var j;return!!((j=R.value)!=null&&j.pageNum)});return{pagination:L,hasPagination:z,handlePagination:j=>{I(j),W()}}})(),{isExpanded:E,getExpandData:M,resetExpandData:N,setExpandData:T,removeExpandData:A}=(()=>{const R=r.reactive(new Map);return{expandData:R,isExpanded:L=>R.has(L),getExpandData:L=>R.get(L)||[],resetExpandData:()=>{R.clear()},setExpandData:(L,I)=>{R.set(L,I)},removeExpandData:L=>{R.delete(L)}}})(),{leftWidth:$,rightWidth:B,centerWidth:V,viewWidth:O}=(R=>{const{leftColumns:L,rightColumns:I,centerColumns:P,tableWidth:W,columnWidth:z}=R,j=Y=>function(te,pe,X){var oe=ce(te)?Ib:pk,ae=arguments.length<3;return oe(te,yn(pe),X,ae,xr)}(Y,(te,pe)=>te+(pe.width||z.value),0),K=r.computed(()=>j(L.value)),G=r.computed(()=>j(I.value)),Z=r.computed(()=>j(P.value)),J=r.computed(()=>W.value-K.value-G.value);return{leftWidth:K,rightWidth:G,centerWidth:Z,viewWidth:J}})({leftColumns:d,rightColumns:p,centerColumns:u,tableWidth:h,columnWidth:f});r.watch(()=>n.data,()=>{l.value=n.data,N(),y(),v()});const D=r.computed(()=>{var R;return!n.loading&&!((R=l.value)!=null&&R.length)}),F=r.computed(()=>C.value&&!D.value);return r.provide(Jd,{data:l,tableWidth:h,isLoading:r.computed(()=>!!n.loading),columns:c,columnWidth:f,leftColumns:d,rightColumns:p,centerColumns:u,scroll:m,setScroll:g,pagination:w,handlePagination:S,handleSort:(R,L)=>{if(N(),b(R,L),n.sortType==="front"){const I=zi(c.value,P=>P.prop===R);I&&(l.value=x(n.data,I))}else o("change:sort",R,L)},getCurrentSort:k,isExpanded:E,getExpandData:M,setExpandData:(R,L)=>{T(R,L),o("change:expand",l.value[R],!0)},removeExpandData:R=>{A(R),o("change:expand",l.value[R],!1)},expandCondition:n.expandCondition,fetchExpandData:n.fetchExpandData,leftWidth:$,rightWidth:B,centerWidth:V,viewWidth:O}),(R,L)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-table-plus",style:r.normalizeStyle({width:r.unref(s),height:r.unref(a)}),ref_key:"tableRef",ref:i},[r.createElementVNode("div",null,[r.createVNode($B),D.value?(r.openBlock(),r.createBlock(sT,{key:1},{default:r.withCtx(()=>[r.renderSlot(R.$slots,"empty",{},void 0,!0)]),_:3})):(r.openBlock(),r.createBlock(rT,{key:0,loading:t.loading},null,8,["loading"]))]),r.createVNode(lT),F.value?(r.openBlock(),r.createBlock(ZB,{key:0})):r.createCommentVNode("",!0)],4))}}),S0=ee(q(cT,[["__scopeId","data-v-17a70a19"]])),E0="mc-textarea",dT=["value","id","disabled","maxlength","placeholder"],uT={class:"mc-textarea-count"},pT=r.defineComponent({name:E0,__name:"mc-textarea",props:{modelValue:{default:""},placeholder:{default:"Please input"},disabled:{type:Boolean,default:!1},showCount:{type:Boolean,default:!0},width:{default:"100%"},height:{default:88},resize:{default:"vertical"},maxLength:{default:255},disableValidation:{type:Boolean},hideValidationIcon:{type:Boolean}},emits:["update:modelValue","change","focus","blur"],setup(t,{emit:e}){const n=t,o=e,{width:i,height:s}=lt(),a=r.ref(),{wrapperRef:l,isFocused:c,handleFocus:d,handleBlur:u}=Xn(a),{formId:p,validateStyle:h,formDisabled:f,validateByTrigger:m}=Nt(),g=async k=>{let x=k.target.value;n.maxLength>0&&x.length>n.maxLength&&(x=x.slice(0,n.maxLength)),o("update:modelValue",x),o("change",x),await r.nextTick(),m("input")},v=r.useSlots(),b=r.computed(()=>!!n.showCount&&n.maxLength>0||!!v.count),y=r.computed(()=>{var k;return((k=n.modelValue)==null?void 0:k.length)??0});return(k,x)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"textareaWrapperRef",ref:l,class:r.normalizeClass(["mc-textarea",{"mc-textarea-disabled":r.unref(f),"mc-textarea-focused":r.unref(c),[r.unref(h)]:r.unref(h)}]),style:r.normalizeStyle({width:r.unref(i)})},[r.createElementVNode("textarea",{ref_key:"textareaRef",ref:a,value:t.modelValue,id:r.unref(p),class:"mc-textarea-input",style:r.normalizeStyle({width:r.unref(i),height:r.unref(s),resize:t.resize}),disabled:r.unref(f),maxlength:t.maxLength,placeholder:t.placeholder,onFocus:x[0]||(x[0]=(...w)=>r.unref(d)&&r.unref(d)(...w)),onBlur:x[1]||(x[1]=(...w)=>r.unref(u)&&r.unref(u)(...w)),onInput:g},null,44,dT),b.value?r.renderSlot(k.$slots,"count",{key:0,maxLength:t.maxLength,currentLength:y.value},()=>[r.createElementVNode("div",uT,[r.createElementVNode("span",null,r.toDisplayString(`${y.value} / ${t.maxLength} characters`),1)])],!0):r.createCommentVNode("",!0)],6))}}),M0=ee(q(pT,[["__scopeId","data-v-045299ac"]])),Qd=t=>parseFloat(t).toString(),Zd=(t,e=2)=>t<1024?`${t} B`:t<1048576?`${Qd((t/1024).toFixed(e))} KB`:t<1073741824?`${Qd((t/1048576).toFixed(e))} MB`:`${Qd((t/1073741824).toFixed(e))} GB`,N0=t=>{if(!t)return"--";const e=new Date(t);return`${e.getFullYear()}/${String(e.getMonth()+1).padStart(2,"0")}/${String(e.getDate()).padStart(2,"0")} ${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`},eu=(t,e,n)=>{const o=t.get(e);t.set(e,{...o,...n})},B0="mc-upload",T0="mc-upload-dropzone",Dt="[?]",tu=["jpg","jpeg","png","doc","docx","xls","xlsx","pdf"],hT={upload_note:"Click to upload or drag and drop your files here",max_size:"Max file size:",max_count:"No limit on maximum number of documents but recommend that upload then in pdf if more than 5 files are to be upload.",uploaded_by:"Uploaded by",uploaded_on:"Uploaded on",limit_count:`The number of files cannot exceed ${Dt} .`,limit_size:`The file size cannot exceed ${Dt} .`,limit_type:`${Dt} only`,limit_count_reached:`You can only upload ${Dt} files.`},fT={upload_note:"单击即可上传或将文件拖放到此处",max_size:"最大文件大小:",max_count:"No limit on maximum number of documents but recommend that upload then in pdf if more than 5 files are to be upload.",uploaded_by:"上传用户",uploaded_on:"上传时间",limit_count:`文件数量不能超过 ${Dt} 。`,limit_size:`最大文件大小:${Dt} 。`,limit_type:`只接受文件格式:${Dt}`,limit_count_reached:`您只能上传 ${Dt} 个文件。`},nu=()=>{const t=ue("lang");return{langMap:r.computed(()=>t.value==="zh"?fT:hT)}},mT={class:"mc-upload-dropzone-area"},gT={class:"mc-upload-dropzone-title"},vT={class:"mc-upload-dropzone-title-text"},yT={key:0,class:"mc-upload-dropzone-desc"},bT={key:0},kT={key:1},wT=r.defineComponent({name:T0,__name:"mc-upload-dropzone",props:{title:{},icon:{default:"Document_Upload"},allowedFileTypes:{default:()=>tu},fileSize:{default:15728640},uploadUser:{default:"--"},lang:{default:"en"},hideDesc:{type:Boolean,default:!1},fileCount:{}},emits:["upload","error:type","error:size"],setup(t,{expose:e,emit:n}){const o=t,i=n,{langMap:s}=nu(),a=r.ref(),l=r.computed(()=>{var m;return(m=o.allowedFileTypes)!=null&&m.length?s.value.limit_type.replace(Dt,bn(o.allowedFileTypes,g=>g.toUpperCase()).join(", ")):void 0}),{isDragover:c}=((m,g)=>{const v=r.ref(!1),b=C=>{C!==v.value&&(v.value=C)},y=C=>{C.preventDefault(),b(!0),He(g.onDragEnter)&&g.onDragEnter(C)},k=C=>{C.preventDefault(),b(!1),He(g.onDragLeave)&&g.onDragLeave(C)},x=C=>{C.preventDefault(),He(g.onDragover)&&g.onDragover(C)},w=C=>{C.preventDefault(),b(!1),He(g.onDrop)&&g.onDrop(C)};return r.onMounted(()=>{var C,S,E,M;(C=m.value)==null||C.addEventListener("dragenter",y),(S=m.value)==null||S.addEventListener("dragleave",k),(E=m.value)==null||E.addEventListener("dragover",x),(M=m.value)==null||M.addEventListener("drop",w)}),r.onBeforeUnmount(()=>{var C,S,E,M;(C=m.value)==null||C.removeEventListener("dragenter",y),(S=m.value)==null||S.removeEventListener("dragleave",k),(E=m.value)==null||E.removeEventListener("dragover",x),(M=m.value)==null||M.removeEventListener("drop",w)}),{isDragover:v}})(a,{onDrop:m=>{var v;const g=(v=m.dataTransfer)==null?void 0:v.files;g&&f(g)}}),d=r.ref(),u=()=>{d.value&&(d.value.value="")},p=()=>{var m;(m=d.value)==null||m.click()},h=m=>{const g=m.target.files;g&&f(g)},f=async m=>{let g=Array.from(m);const v=new Map;g.forEach(b=>{eu(v,b.name,{name:b.name,size:b.size,status:"loading",uploadBy:o.uploadUser,uploadTime:Date.now(),file:b})}),((b,y)=>{const k=o.fileSize;if(k<=0)return!0;let x=!1;for(let w=0;w<b.length;w++){const C=b[w];C.size>k?(eu(y,C.name,{status:"failed",errorMessage:s.value.limit_size.replace(Dt,`${Zd(k)}`)}),i("error:size",C.name)):x=!0}})(g,v),((b,y)=>{var C;const k=o.allowedFileTypes;if(!(k!=null&&k.length))return!0;let x=!1;const w=bn(k,S=>S.toUpperCase());for(let S=0;S<b.length;S++)Ct(w,((C=b[S].name.split(".").pop())==null?void 0:C.toUpperCase())??"--")?x=!0:(eu(y,b[S].name,{status:"failed",errorMessage:l.value}),i("error:type",b[S].name))})(g,v),i("upload",v),u()};return e({clearUploadInput:u}),(m,g)=>(r.openBlock(),r.createElementBlock("div",{ref:"wrapperRef",class:r.normalizeClass(["mc-upload-dropzone",{"mc-upload-dropzone-dragover":r.unref(c)}]),onClick:p},[r.createElementVNode("div",mT,[r.renderSlot(m.$slots,"default",{},()=>[r.createElementVNode("div",gT,[r.renderSlot(m.$slots,"title",{},()=>[r.createVNode(r.unref(ge),{name:t.icon},null,8,["name"]),r.createElementVNode("span",vT,r.toDisplayString(t.title||r.unref(s).upload_note),1)],!0)]),t.hideDesc?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",yT,[r.renderSlot(m.$slots,"desc",{},()=>[t.fileSize>0?(r.openBlock(),r.createElementBlock("span",bT,r.toDisplayString(r.unref(s).max_size)+" "+r.toDisplayString(r.unref(Zd)(t.fileSize)),1)):r.createCommentVNode("",!0),l.value?(r.openBlock(),r.createElementBlock("span",kT,r.toDisplayString(l.value),1)):r.createCommentVNode("",!0)],!0)]))],!0)]),r.createElementVNode("input",{ref_key:"uploadInputRef",ref:d,type:"file",multiple:"",style:{display:"none"},onChange:h},null,544),r.createElementVNode("div",{class:"mc-upload-dropzone-cover",ref_key:"coverRef",ref:a},null,512)],2))}}),xT=q(wT,[["__scopeId","data-v-7f887458"]]),O0="mc-file-list",CT={class:"mc-file-list-item-content"},ST={class:"mc-file-list-item-file mc-file-list-item-info"},ET=["onClick"],MT={class:"mc-file-list-item-file-name-text"},NT={class:"mc-file-list-item-file-desc"},BT={class:"mc-file-list-item-file-size-text"},TT={key:0,class:"mc-file-list-item-file-progress-bar"},OT={key:1,class:"mc-file-list-item-file-error"},_T={key:0,class:"mc-file-list-item-info"},VT={class:"mc-file-list-item-info"},DT={class:"mc-file-list-item-label"},AT={class:"mc-file-list-item-value"},IT={class:"mc-file-list-item-info"},RT={class:"mc-file-list-item-label"},LT={class:"mc-file-list-item-value"},$T={key:1,class:"mc-file-list-item-info"},PT={class:"mc-file-list-item-actions"},zT={class:"mc-file-list-item-compact-content"},FT={key:0,class:"mc-file-list-item-info"},jT={class:"mc-file-list-item-info"},HT={class:"mc-file-list-item-label"},WT={class:"mc-file-list-item-value"},KT={class:"mc-file-list-item-info"},UT={class:"mc-file-list-item-label"},qT={class:"mc-file-list-item-value"},JT={key:1,class:"mc-file-list-item-info"},ou=ee(q(r.defineComponent({name:O0,__name:"mc-file-list",props:{modelValue:{default:()=>[]},theme:{default:"light"},lang:{default:"en"},downloadable:{type:Boolean,default:!1},allowCancel:{type:Boolean,default:!1},deletable:{type:Boolean,default:!0}},emits:["update:modelValue","change","delete","download","preview","cancel"],setup(t,{emit:e}){const n=t,o=e,{langMap:i}=nu(),s=r.ref(!1),a=r.ref();$p(a,({width:c})=>{s.value=c<=680});const l=c=>{o("update:modelValue",n.modelValue.filter(d=>d.name!==c.name))};return(c,d)=>(r.openBlock(),r.createElementBlock("ul",{class:r.normalizeClass(["mc-file-list",[`mc-file-list-${t.theme}`,{"mc-file-list-compact":s.value}]]),ref_key:"fileListRef",ref:a},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.modelValue,u=>(r.openBlock(),r.createElementBlock("li",{class:"mc-file-list-item",key:u.name},[r.createElementVNode("div",CT,[r.createElementVNode("div",ST,[r.createElementVNode("div",{class:"mc-file-list-item-file-name",onClick:p=>(h=>{o("preview",h)})(u)},[r.createVNode(r.unref(ge),{name:"Document"}),r.createElementVNode("span",MT,r.toDisplayString(u.name),1)],8,ET),r.createElementVNode("div",NT,[u.status!=="failed"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("span",BT,r.toDisplayString(u.size?r.unref(Zd)(u.size):"--"),1),u.status==="loading"?(r.openBlock(),r.createElementBlock("div",TT,[r.createVNode(r.unref(Gl),{percentage:u.progress,"transition-duration":1e3},null,8,["percentage"])])):r.createCommentVNode("",!0)],64)):(r.openBlock(),r.createElementBlock("span",OT,r.toDisplayString(u.errorMessage||"failed to upload"),1))])]),s.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[c.$slots["extra-prefix"]&&u.status==="successed"?(r.openBlock(),r.createElementBlock("div",_T,[r.renderSlot(c.$slots,"extra-prefix",{isCompact:s.value,file:u},void 0,!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",VT,[r.createElementVNode("span",DT,r.toDisplayString(r.unref(i).uploaded_by),1),r.createElementVNode("span",AT,r.toDisplayString(u.uploadBy||"--"),1)]),r.createElementVNode("div",IT,[r.createElementVNode("span",RT,r.toDisplayString(r.unref(i).uploaded_on),1),r.createElementVNode("span",LT,r.toDisplayString(r.unref(N0)(u.uploadTime)||"--"),1)]),c.$slots.extra&&u.status==="successed"?(r.openBlock(),r.createElementBlock("div",$T,[r.renderSlot(c.$slots,"extra",{isCompact:s.value,file:u},void 0,!0)])):r.createCommentVNode("",!0)],64)),r.createElementVNode("div",PT,[u.status==="loading"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[t.allowCancel?(r.openBlock(),r.createBlock(r.unref(ge),{key:0,name:"Cross",class:"mc-file-list-item-icon",onClick:p=>(h=>{o("cancel",h),l(h)})(u)},null,8,["onClick"])):r.createCommentVNode("",!0)],64)):(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[t.downloadable?(r.openBlock(),r.createBlock(r.unref(ge),{key:0,name:"Download",class:"mc-file-list-item-icon",onClick:p=>(h=>{o("download",h)})(u)},null,8,["onClick"])):r.createCommentVNode("",!0),t.deletable?(r.openBlock(),r.createBlock(r.unref(ge),{key:1,name:"Trash",class:"mc-file-list-item-icon",onClick:p=>(h=>{o("delete",h),l(h)})(u)},null,8,["onClick"])):r.createCommentVNode("",!0)],64))])]),s.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createVNode(r.unref(Al)),r.createElementVNode("div",zT,[c.$slots["extra-prefix"]&&u.status==="successed"?(r.openBlock(),r.createElementBlock("div",FT,[r.renderSlot(c.$slots,"extra-prefix",{isCompact:s.value,file:u},void 0,!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",jT,[r.createElementVNode("span",HT,r.toDisplayString(r.unref(i).uploaded_by),1),r.createElementVNode("span",WT,r.toDisplayString(u.uploadBy||"--"),1)]),r.createElementVNode("div",KT,[r.createElementVNode("span",UT,r.toDisplayString(r.unref(i).uploaded_on),1),r.createElementVNode("span",qT,r.toDisplayString(r.unref(N0)(u.uploadTime)||"--"),1)]),c.$slots.extra&&u.status==="successed"?(r.openBlock(),r.createElementBlock("div",JT,[r.renderSlot(c.$slots,"extra",{isCompact:s.value,file:u},void 0,!0)])):r.createCommentVNode("",!0)])],64)):r.createCommentVNode("",!0)]))),128))],2))}}),[["__scopeId","data-v-06f298f6"]])),GT=["id"],YT={key:0,class:"mc-upload-content"},XT={class:"mc-upload-content-icon"},QT={class:"mc-upload-content-text"},ZT={class:"mc-upload-component"},eO={key:0,class:"mc-upload-dropzone-wrapper"},tO={class:"mc-upload-file-list-wrapper"},nO=r.defineComponent({name:B0,__name:"mc-upload",props:{modelValue:{default:()=>[]},downloadable:{type:Boolean,default:!1},allowCancel:{type:Boolean,default:!1},deletable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},theme:{default:"light"},width:{default:"100%"},succeed:{type:Boolean,default:!1},title:{},icon:{default:"Document_Upload"},allowedFileTypes:{default:()=>tu},fileSize:{default:15728640},uploadUser:{default:"--"},lang:{default:"en"},hideDesc:{type:Boolean,default:!1},fileCount:{}},emits:["update:modelValue","download:all","clear","error:type","error:size","upload","change","delete","download","preview","cancel"],setup(t,{expose:e,emit:n}){const o=t,i=n,{formId:s}=Nt(),{width:a}=lt(),l=r.useSlots(),c=r.computed(()=>!!l.content),d=r.ref(),u=r.reactive(new Map),{langMap:p}=nu(),h=E=>(E=(M=>{if(o.fileCount&&M.length>o.fileCount){const N=p.value.limit_count_reached.replace(Dt,o.fileCount.toString());return Xi.error(N),M.slice(0,o.fileCount)}return M})(E)).length!==0&&(u.clear(),E.forEach(M=>{u.set(M.name,M)}),!0);r.watch(()=>o.modelValue,E=>{h(E)},{immediate:!0});const f=E=>Array.from([...E.values()]),m=E=>{i("update:modelValue",E)},g=E=>{var T;(T=d.value)==null||T.clearUploadInput();const M=f(E);if(!h([...o.modelValue,...M]))return;const N=f(u);i("update:modelValue",N),i("upload",N),i("change",N),C()},v=E=>{console.error("mc-upload: error:type:",E),i("error:type",E)},b=E=>{console.error("mc-upload: error:size:",E),i("error:size",E)},y=E=>{i("preview",E)},k=E=>{i("delete",E)},x=E=>{i("download",E)},w=E=>{i("cancel",E)},C=(E=99,M=100)=>{setTimeout(()=>{o.modelValue.forEach(N=>{N.status==="loading"&&(N.progress=E)})},M)},S=r.computed(()=>o.deletable&&!o.disabled);return e({clearFiles:()=>{u.clear(),i("clear"),i("update:modelValue",[]),i("change",[])},downloadAllFiles:()=>{i("download:all",f(u))}}),(E,M)=>(r.openBlock(),r.createElementBlock("div",{class:"mc-upload",style:r.normalizeStyle({width:r.unref(a)}),id:r.unref(s)},[r.createElementVNode("div",{class:r.normalizeClass([{"mc-upload-wrapper":c.value},`mc-upload-wrapper-${t.theme}`])},[c.value?(r.openBlock(),r.createElementBlock("div",YT,[r.createElementVNode("div",XT,[t.succeed?(r.openBlock(),r.createBlock(r.unref(Yo),{key:1,width:"24px",height:"24px"})):(r.openBlock(),r.createBlock(r.unref(ge),{key:0,name:"Accept"}))]),r.createElementVNode("div",QT,[r.renderSlot(E.$slots,"content",{},void 0,!0)])])):r.createCommentVNode("",!0),r.createElementVNode("div",ZT,[t.disabled?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",eO,[r.createVNode(xT,{ref_key:"uploadDropzoneRef",ref:d,"upload-user":t.uploadUser,"allowed-file-types":t.allowedFileTypes,"file-size":t.fileSize,icon:t.icon,lang:t.lang,theme:t.theme,"hide-desc":t.hideDesc,"file-count":t.fileCount,title:t.title,onUpload:g,"onError:type":v,"onError:size":b},{default:r.withCtx(()=>[r.renderSlot(E.$slots,"default",{},void 0,!0)]),title:r.withCtx(()=>[r.renderSlot(E.$slots,"title",{},void 0,!0)]),desc:r.withCtx(()=>[r.renderSlot(E.$slots,"desc",{},void 0,!0)]),_:3},8,["upload-user","allowed-file-types","file-size","icon","lang","theme","hide-desc","file-count","title"])])),r.createElementVNode("div",tO,[r.createVNode(r.unref(ou),{"model-value":t.modelValue,"allow-cancel":t.allowCancel,downloadable:t.downloadable,lang:t.lang,theme:t.theme,deletable:S.value,"onUpdate:modelValue":m,onPreview:y,onDelete:k,onDownload:x,onCancel:w},r.createSlots({_:2},[E.$slots["file-extra-prefix"]?{name:"extra-prefix",fn:r.withCtx(({file:N,isCompact:T})=>[r.renderSlot(E.$slots,"file-extra-prefix",{file:N,isCompact:T,isDisabled:t.disabled},void 0,!0)]),key:"0"}:void 0,E.$slots["file-extra"]?{name:"extra",fn:r.withCtx(({file:N,isCompact:T})=>[r.renderSlot(E.$slots,"file-extra",{file:N,isCompact:T,isDisabled:t.disabled},void 0,!0)]),key:"1"}:void 0]),1032,["model-value","allow-cancel","downloadable","lang","theme","deletable"])])])],2)],12,GT))}}),_0=ee(q(nO,[["__scopeId","data-v-7e4b79b6"]])),oO=[Lp,Wi,Wo,yh,kh,Sh,Th,_h,Dh,zh,Al,Yh,es,hh,mh,ge,Ee,$l,Qh,tf,Pl,Zi,sf,lf,Qi,Gi,ps,Gl,Pf,Rf,Lf,Hf,Ff,zl,Il,$y,zy,jy,Ay,Fd,vi,Wd,Wy,Uy,Gy,Jy,Yy,Yo,e0,o0,t0,a0,C0,S0,zd,M0,Ll,Rl,Nh,Ho,ou,_0];console.info("contact us with ayachinenesanobauxichi@gmail.com");const rO=(V0=oO,t=>Pi(V0,e=>t.use(e)));var V0;_.ALLOW_FILE_TYPES=tu,_.CHECKBOX_GROUP_INJECTION_KEY=Ol,_.COLLAPSE_CONTEXT_KEY=_l,_.DAY_SPAN=42,_.FONT_STYLE=wo,_.FORM_CTX_KEY=Ro,_.FORM_ITEM_CTX_KEY=Tl,_.INPUT_GROUP_INJECTION_KEY=Rr,_.MC_ALERT_MESSAGE=Rp,_.MC_BUTTON=Pp,_.MC_CHECKBOX=gh,_.MC_CHECKBOX_GROUP=vh,_.MC_COLLAPSE=bh,_.MC_COLLAPSE_ITEM=Ch,_.MC_COPY=Bh,_.MC_COUNT=Oh,_.MC_CURRENCY_ICON=Vh,_.MC_DATE_PICKER=Ah,_.MC_DATE_PICKER_CONTENT=Lh,_.MC_DATE_PICKER_ITEM=Ih,_.MC_DATE_PICKER_LIST=Rh,_.MC_DATE_PICKER_MONTH=Ko,_.MC_DATE_PICKER_WEEK=$h,_.MC_DIVIDER=Fh,_.MC_DRAWER=Gh,_.MC_FILE_LIST=O0,_.MC_FOOTER=qh,_.MC_FORM=zp,_.MC_FORM_ITEM=fh,_.MC_ICON=Ip,_.MC_ICON_PLUS=wh,_.MC_INPUT_GROUP=Xh,_.MC_INPUT_PLUS=Zh,_.MC_INPUT_PLUS_CURRENCY_DECIMAL_SEPARATOR=Wt,_.MC_INPUT_PLUS_CURRENCY_SEPARATOR=",",_.MC_LIGHTBOX=ef,_.MC_LOADING=nf,_.MC_MODAL_HEADER=Uh,_.MC_MULTI_TAG=rf,_.MC_OTP=af,_.MC_OVERLAY=jh,_.MC_POPPER=uh,_.MC_POPPER_PLUS=Tf,_.MC_PROGRESS_BAR=Of,_.MC_PROGRESS_INDICATOR=Vf,_.MC_PROGRESS_INDICATOR_CHILD_ITEM=Xl,_.MC_PROGRESS_INDICATOR_ITEM=Yl,_.MC_PROGRESS_INDICATOR_STEP=Df,_.MC_PROGRESS_INDICATOR_STEP_NUM=Af,_.MC_RADIO=jf,_.MC_RADIO_GROUP=zf,_.MC_RADIO_GROUP_CTX=Ql,_.MC_REMOVABLE_TAG=of,_.MC_RESET=Hh,_.MC_RICHTEXT=Ry,_.MC_RICHTEXT_TOOL=Ly,_.MC_SECONDARY_MENU=Py,_.MC_SELECT=Fy,_.MC_SELECT_GROUP_PLUS=Hd,_.MC_SELECT_MULTI_OPTION=Dy,_.MC_SELECT_OPTION_PLUS=jd,_.MC_SELECT_PLUS=_y,_.MC_SELECT_PLUS_CTX=fn,_.MC_STATUS=Hy,_.MC_STEP=Ky,_.MC_STEP_CHILD_ITEM_PLUS=Ud,_.MC_STEP_ITEM_PLUS=Kd,_.MC_STEP_PLUS=qy,_.MC_SUCCESS_ICON=_f,_.MC_SWITCH=Xy,_.MC_SWITCH_LABEL=Qy,_.MC_TAB=n0,_.MC_TABLE_BODY=u0,_.MC_TABLE_CELL=h0,_.MC_TABLE_COLUMN_PLUS=Yd,_.MC_TABLE_CTX_KEY=Jd,_.MC_TABLE_DEFAULT_PROPS=pr,_.MC_TABLE_DEFAULT_VALUE="--",_.MC_TABLE_ELLIPSIS=x0,_.MC_TABLE_EMPTY=f0,_.MC_TABLE_FOOTER=v0,_.MC_TABLE_HEADER=c0,_.MC_TABLE_LOADING=m0,_.MC_TABLE_PAGE_SIZE=b0,_.MC_TABLE_PAGINATION=k0,_.MC_TABLE_PAGINATION_ITEM=w0,_.MC_TABLE_PLUS=l0,_.MC_TABLE_ROW=p0,_.MC_TABLE_SCROLL=g0,_.MC_TABLE_SORT=d0,_.MC_TABLE_TOTAL=y0,_.MC_TAB_ITEM=qd,_.MC_TAG=Vy,_.MC_TEXTAREA=E0,_.MC_TITLE=Kh,_.MC_TITLE_TOOL_BAR=Wh,_.MC_TOAST=Eh,_.MC_TOOLTIP=ph,_.MC_UPLOAD=B0,_.MC_UPLOAD_DROPZONE=T0,_.McAlertMessage=Lp,_.McButton=Wi,_.McCheckbox=Wo,_.McCheckboxGroup=yh,_.McCollapse=kh,_.McCollapseItem=Sh,_.McCopy=Th,_.McCount=_h,_.McCurrencyIcon=Dh,_.McDatePicker=zh,_.McDivider=Al,_.McDrawer=Yh,_.McFileList=ou,_.McFooter=es,_.McForm=hh,_.McFormItem=mh,_.McIcon=ge,_.McIconPlus=Ee,_.McInput=$l,_.McInputGroup=Qh,_.McLightbox=tf,_.McLoading=Pl,_.McModalHeader=Zi,_.McMultiTag=sf,_.McOtp=lf,_.McOverlay=Qi,_.McPopper=Gi,_.McPopperPlus=ps,_.McProgressBar=Gl,_.McProgressIndicator=Pf,_.McProgressIndicatorChildItem=Lf,_.McProgressIndicatorItem=Rf,_.McRadio=Hf,_.McRadioGroup=Ff,_.McRemovableTag=zl,_.McReset=Il,_.McRichtext=$y,_.McSecondaryMenu=zy,_.McSelect=jy,_.McSelectGroupPlus=Ay,_.McSelectMultiOption=Fd,_.McSelectOptionPlus=vi,_.McSelectPlus=Wd,_.McStatus=Wy,_.McStep=Uy,_.McStepChildItemPlus=Gy,_.McStepItemPlus=Jy,_.McStepPlus=Yy,_.McSuccessIcon=Yo,_.McSwitch=e0,_.McTab=o0,_.McTabItem=t0,_.McTable=a0,_.McTableColumnPlus=C0,_.McTablePlus=S0,_.McTag=zd,_.McTextarea=M0,_.McTitle=Ll,_.McTitleToolBar=Rl,_.McToast=Nh,_.McTooltip=Ho,_.McUpload=_0,_.SELECT_INJECTION_KEY=yi,_.TOOL_ICON=Ce,_.WILDCARD=Dt,_.YEAR_SPAN=21,_.default=rO,_.toast=Xi,_.usePagination=r0,_.useTableScroll=i0,_.useTableSort=s0,Object.defineProperties(_,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});