vdc-editor 0.1.95 → 0.1.96

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.
@@ -11,9 +11,9 @@ For more information, see https://www.radix-vue.com/components/${n}`,l=`Warning:
11
11
  * Released under MIT license <https://lodash.com/license>
12
12
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
13
13
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
14
- */ed.exports,function(t,e){(function(){var n,r="4.17.21",o=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",l="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",c=500,f="__lodash_placeholder__",h=1,m=2,g=4,b=1,y=2,w=1,x=2,_=4,S=8,C=16,k=32,A=64,T=128,B=256,L=512,I=30,V="...",q=800,K=16,me=1,z=2,U=3,P=1/0,G=9007199254740991,Z=17976931348623157e292,oe=NaN,ne=4294967295,Ce=ne-1,_e=ne>>>1,Ge=[["ary",T],["bind",w],["bindKey",x],["curry",S],["curryRight",C],["flip",L],["partial",k],["partialRight",A],["rearg",B]],Me="[object Arguments]",ge="[object Array]",W="[object AsyncFunction]",J="[object Boolean]",re="[object Date]",ie="[object DOMException]",fe="[object Error]",Ee="[object Function]",Oe="[object GeneratorFunction]",Y="[object Map]",we="[object Number]",ze="[object Null]",wt="[object Object]",$="[object Promise]",D="[object Proxy]",ae="[object RegExp]",ve="[object Set]",Le="[object String]",tt="[object Symbol]",He="[object Undefined]",N="[object WeakMap]",pe="[object WeakSet]",le="[object ArrayBuffer]",be="[object DataView]",Fe="[object Float32Array]",nt="[object Float64Array]",At="[object Int8Array]",Nt="[object Int16Array]",ii="[object Int32Array]",te="[object Uint8Array]",Re="[object Uint8ClampedArray]",Ue="[object Uint16Array]",Ct="[object Uint32Array]",bt=/\b__p \+= '';/g,kn=/\b(__p \+=) '' \+/g,or=/(__e\(.*?\)|\b__t\)) \+\n'';/g,si=/&(?:amp|lt|gt|quot|#39);/g,uc=/[&<>"']/g,ai=RegExp(si.source),cc=RegExp(uc.source),xl=/<%-([\s\S]+?)%>/g,rs=/<%([\s\S]+?)%>/g,Pp=/<%=([\s\S]+?)%>/g,dc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Cl=/^\w*$/,eZ=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,wb=/[\\^$.*+?()[\]{}|]/g,tZ=RegExp(wb.source),xb=/^\s+/,nZ=/\s/,rZ=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oZ=/\{\n\/\* \[wrapped with (.+)\] \*/,iZ=/,? & /,sZ=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,aZ=/[()=,{}\[\]\/\s]/,lZ=/\\(\\)?/g,uZ=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,RE=/\w*$/,cZ=/^[-+]0x[0-9a-f]+$/i,dZ=/^0b[01]+$/i,fZ=/^\[object .+?Constructor\]$/,pZ=/^0o[0-7]+$/i,hZ=/^(?:0|[1-9]\d*)$/,mZ=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Dp=/($^)/,gZ=/['\n\r\u2028\u2029\\]/g,Fp="\\ud800-\\udfff",bZ="\\u0300-\\u036f",vZ="\\ufe20-\\ufe2f",yZ="\\u20d0-\\u20ff",IE=bZ+vZ+yZ,LE="\\u2700-\\u27bf",PE="a-z\\xdf-\\xf6\\xf8-\\xff",wZ="\\xac\\xb1\\xd7\\xf7",xZ="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",CZ="\\u2000-\\u206f",EZ=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",DE="A-Z\\xc0-\\xd6\\xd8-\\xde",FE="\\ufe0e\\ufe0f",VE=wZ+xZ+CZ+EZ,Cb="['’]",_Z="["+Fp+"]",$E="["+VE+"]",Vp="["+IE+"]",zE="\\d+",SZ="["+LE+"]",HE="["+PE+"]",UE="[^"+Fp+VE+zE+LE+PE+DE+"]",Eb="\\ud83c[\\udffb-\\udfff]",kZ="(?:"+Vp+"|"+Eb+")",WE="[^"+Fp+"]",_b="(?:\\ud83c[\\udde6-\\uddff]){2}",Sb="[\\ud800-\\udbff][\\udc00-\\udfff]",El="["+DE+"]",jE="\\u200d",qE="(?:"+HE+"|"+UE+")",TZ="(?:"+El+"|"+UE+")",KE="(?:"+Cb+"(?:d|ll|m|re|s|t|ve))?",GE="(?:"+Cb+"(?:D|LL|M|RE|S|T|VE))?",XE=kZ+"?",JE="["+FE+"]?",AZ="(?:"+jE+"(?:"+[WE,_b,Sb].join("|")+")"+JE+XE+")*",OZ="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",MZ="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",YE=JE+XE+AZ,BZ="(?:"+[SZ,_b,Sb].join("|")+")"+YE,RZ="(?:"+[WE+Vp+"?",Vp,_b,Sb,_Z].join("|")+")",IZ=RegExp(Cb,"g"),LZ=RegExp(Vp,"g"),kb=RegExp(Eb+"(?="+Eb+")|"+RZ+YE,"g"),PZ=RegExp([El+"?"+HE+"+"+KE+"(?="+[$E,El,"$"].join("|")+")",TZ+"+"+GE+"(?="+[$E,El+qE,"$"].join("|")+")",El+"?"+qE+"+"+KE,El+"+"+GE,MZ,OZ,zE,BZ].join("|"),"g"),DZ=RegExp("["+jE+Fp+IE+FE+"]"),FZ=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,VZ=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],$Z=-1,jt={};jt[Fe]=jt[nt]=jt[At]=jt[Nt]=jt[ii]=jt[te]=jt[Re]=jt[Ue]=jt[Ct]=!0,jt[Me]=jt[ge]=jt[le]=jt[J]=jt[be]=jt[re]=jt[fe]=jt[Ee]=jt[Y]=jt[we]=jt[wt]=jt[ae]=jt[ve]=jt[Le]=jt[N]=!1;var Ht={};Ht[Me]=Ht[ge]=Ht[le]=Ht[be]=Ht[J]=Ht[re]=Ht[Fe]=Ht[nt]=Ht[At]=Ht[Nt]=Ht[ii]=Ht[Y]=Ht[we]=Ht[wt]=Ht[ae]=Ht[ve]=Ht[Le]=Ht[tt]=Ht[te]=Ht[Re]=Ht[Ue]=Ht[Ct]=!0,Ht[fe]=Ht[Ee]=Ht[N]=!1;var zZ={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},HZ={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},UZ={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},WZ={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},jZ=parseFloat,qZ=parseInt,ZE=typeof Ea=="object"&&Ea&&Ea.Object===Object&&Ea,KZ=typeof self=="object"&&self&&self.Object===Object&&self,Tn=ZE||KZ||Function("return this")(),Tb=e&&!e.nodeType&&e,ra=Tb&&!0&&t&&!t.nodeType&&t,QE=ra&&ra.exports===Tb,Ab=QE&&ZE.process,Vr=function(){try{var j=ra&&ra.require&&ra.require("util").types;return j||Ab&&Ab.binding&&Ab.binding("util")}catch{}}(),NE=Vr&&Vr.isArrayBuffer,e_=Vr&&Vr.isDate,t_=Vr&&Vr.isMap,n_=Vr&&Vr.isRegExp,r_=Vr&&Vr.isSet,o_=Vr&&Vr.isTypedArray;function vr(j,se,Q){switch(Q.length){case 0:return j.call(se);case 1:return j.call(se,Q[0]);case 2:return j.call(se,Q[0],Q[1]);case 3:return j.call(se,Q[0],Q[1],Q[2])}return j.apply(se,Q)}function GZ(j,se,Q,Ae){for(var Qe=-1,_t=j==null?0:j.length;++Qe<_t;){var hn=j[Qe];se(Ae,hn,Q(hn),j)}return Ae}function $r(j,se){for(var Q=-1,Ae=j==null?0:j.length;++Q<Ae&&se(j[Q],Q,j)!==!1;);return j}function XZ(j,se){for(var Q=j==null?0:j.length;Q--&&se(j[Q],Q,j)!==!1;);return j}function i_(j,se){for(var Q=-1,Ae=j==null?0:j.length;++Q<Ae;)if(!se(j[Q],Q,j))return!1;return!0}function is(j,se){for(var Q=-1,Ae=j==null?0:j.length,Qe=0,_t=[];++Q<Ae;){var hn=j[Q];se(hn,Q,j)&&(_t[Qe++]=hn)}return _t}function $p(j,se){var Q=j==null?0:j.length;return!!Q&&_l(j,se,0)>-1}function Ob(j,se,Q){for(var Ae=-1,Qe=j==null?0:j.length;++Ae<Qe;)if(Q(se,j[Ae]))return!0;return!1}function Xt(j,se){for(var Q=-1,Ae=j==null?0:j.length,Qe=Array(Ae);++Q<Ae;)Qe[Q]=se(j[Q],Q,j);return Qe}function ss(j,se){for(var Q=-1,Ae=se.length,Qe=j.length;++Q<Ae;)j[Qe+Q]=se[Q];return j}function Mb(j,se,Q,Ae){var Qe=-1,_t=j==null?0:j.length;for(Ae&&_t&&(Q=j[++Qe]);++Qe<_t;)Q=se(Q,j[Qe],Qe,j);return Q}function JZ(j,se,Q,Ae){var Qe=j==null?0:j.length;for(Ae&&Qe&&(Q=j[--Qe]);Qe--;)Q=se(Q,j[Qe],Qe,j);return Q}function Bb(j,se){for(var Q=-1,Ae=j==null?0:j.length;++Q<Ae;)if(se(j[Q],Q,j))return!0;return!1}var YZ=Rb("length");function ZZ(j){return j.split("")}function QZ(j){return j.match(sZ)||[]}function s_(j,se,Q){var Ae;return Q(j,function(Qe,_t,hn){if(se(Qe,_t,hn))return Ae=_t,!1}),Ae}function zp(j,se,Q,Ae){for(var Qe=j.length,_t=Q+(Ae?1:-1);Ae?_t--:++_t<Qe;)if(se(j[_t],_t,j))return _t;return-1}function _l(j,se,Q){return se===se?cQ(j,se,Q):zp(j,a_,Q)}function NZ(j,se,Q,Ae){for(var Qe=Q-1,_t=j.length;++Qe<_t;)if(Ae(j[Qe],se))return Qe;return-1}function a_(j){return j!==j}function l_(j,se){var Q=j==null?0:j.length;return Q?Lb(j,se)/Q:oe}function Rb(j){return function(se){return se==null?n:se[j]}}function Ib(j){return function(se){return j==null?n:j[se]}}function u_(j,se,Q,Ae,Qe){return Qe(j,function(_t,hn,$t){Q=Ae?(Ae=!1,_t):se(Q,_t,hn,$t)}),Q}function eQ(j,se){var Q=j.length;for(j.sort(se);Q--;)j[Q]=j[Q].value;return j}function Lb(j,se){for(var Q,Ae=-1,Qe=j.length;++Ae<Qe;){var _t=se(j[Ae]);_t!==n&&(Q=Q===n?_t:Q+_t)}return Q}function Pb(j,se){for(var Q=-1,Ae=Array(j);++Q<j;)Ae[Q]=se(Q);return Ae}function tQ(j,se){return Xt(se,function(Q){return[Q,j[Q]]})}function c_(j){return j&&j.slice(0,h_(j)+1).replace(xb,"")}function yr(j){return function(se){return j(se)}}function Db(j,se){return Xt(se,function(Q){return j[Q]})}function fc(j,se){return j.has(se)}function d_(j,se){for(var Q=-1,Ae=j.length;++Q<Ae&&_l(se,j[Q],0)>-1;);return Q}function f_(j,se){for(var Q=j.length;Q--&&_l(se,j[Q],0)>-1;);return Q}function nQ(j,se){for(var Q=j.length,Ae=0;Q--;)j[Q]===se&&++Ae;return Ae}var rQ=Ib(zZ),oQ=Ib(HZ);function iQ(j){return"\\"+WZ[j]}function sQ(j,se){return j==null?n:j[se]}function Sl(j){return DZ.test(j)}function aQ(j){return FZ.test(j)}function lQ(j){for(var se,Q=[];!(se=j.next()).done;)Q.push(se.value);return Q}function Fb(j){var se=-1,Q=Array(j.size);return j.forEach(function(Ae,Qe){Q[++se]=[Qe,Ae]}),Q}function p_(j,se){return function(Q){return j(se(Q))}}function as(j,se){for(var Q=-1,Ae=j.length,Qe=0,_t=[];++Q<Ae;){var hn=j[Q];(hn===se||hn===f)&&(j[Q]=f,_t[Qe++]=Q)}return _t}function Hp(j){var se=-1,Q=Array(j.size);return j.forEach(function(Ae){Q[++se]=Ae}),Q}function uQ(j){var se=-1,Q=Array(j.size);return j.forEach(function(Ae){Q[++se]=[Ae,Ae]}),Q}function cQ(j,se,Q){for(var Ae=Q-1,Qe=j.length;++Ae<Qe;)if(j[Ae]===se)return Ae;return-1}function dQ(j,se,Q){for(var Ae=Q+1;Ae--;)if(j[Ae]===se)return Ae;return Ae}function kl(j){return Sl(j)?pQ(j):YZ(j)}function lo(j){return Sl(j)?hQ(j):ZZ(j)}function h_(j){for(var se=j.length;se--&&nZ.test(j.charAt(se)););return se}var fQ=Ib(UZ);function pQ(j){for(var se=kb.lastIndex=0;kb.test(j);)++se;return se}function hQ(j){return j.match(kb)||[]}function mQ(j){return j.match(PZ)||[]}var gQ=function j(se){se=se==null?Tn:Tl.defaults(Tn.Object(),se,Tl.pick(Tn,VZ));var Q=se.Array,Ae=se.Date,Qe=se.Error,_t=se.Function,hn=se.Math,$t=se.Object,Vb=se.RegExp,bQ=se.String,zr=se.TypeError,Up=Q.prototype,vQ=_t.prototype,Al=$t.prototype,Wp=se["__core-js_shared__"],jp=vQ.toString,Ot=Al.hasOwnProperty,yQ=0,m_=function(){var d=/[^.]+$/.exec(Wp&&Wp.keys&&Wp.keys.IE_PROTO||"");return d?"Symbol(src)_1."+d:""}(),qp=Al.toString,wQ=jp.call($t),xQ=Tn._,CQ=Vb("^"+jp.call(Ot).replace(wb,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Kp=QE?se.Buffer:n,ls=se.Symbol,Gp=se.Uint8Array,g_=Kp?Kp.allocUnsafe:n,Xp=p_($t.getPrototypeOf,$t),b_=$t.create,v_=Al.propertyIsEnumerable,Jp=Up.splice,y_=ls?ls.isConcatSpreadable:n,pc=ls?ls.iterator:n,oa=ls?ls.toStringTag:n,Yp=function(){try{var d=ua($t,"defineProperty");return d({},"",{}),d}catch{}}(),EQ=se.clearTimeout!==Tn.clearTimeout&&se.clearTimeout,_Q=Ae&&Ae.now!==Tn.Date.now&&Ae.now,SQ=se.setTimeout!==Tn.setTimeout&&se.setTimeout,Zp=hn.ceil,Qp=hn.floor,$b=$t.getOwnPropertySymbols,kQ=Kp?Kp.isBuffer:n,w_=se.isFinite,TQ=Up.join,AQ=p_($t.keys,$t),mn=hn.max,Fn=hn.min,OQ=Ae.now,MQ=se.parseInt,x_=hn.random,BQ=Up.reverse,zb=ua(se,"DataView"),hc=ua(se,"Map"),Hb=ua(se,"Promise"),Ol=ua(se,"Set"),mc=ua(se,"WeakMap"),gc=ua($t,"create"),Np=mc&&new mc,Ml={},RQ=ca(zb),IQ=ca(hc),LQ=ca(Hb),PQ=ca(Ol),DQ=ca(mc),eh=ls?ls.prototype:n,bc=eh?eh.valueOf:n,C_=eh?eh.toString:n;function M(d){if(on(d)&&!Ne(d)&&!(d instanceof gt)){if(d instanceof Hr)return d;if(Ot.call(d,"__wrapped__"))return ES(d)}return new Hr(d)}var Bl=function(){function d(){}return function(p){if(!en(p))return{};if(b_)return b_(p);d.prototype=p;var v=new d;return d.prototype=n,v}}();function th(){}function Hr(d,p){this.__wrapped__=d,this.__actions__=[],this.__chain__=!!p,this.__index__=0,this.__values__=n}M.templateSettings={escape:xl,evaluate:rs,interpolate:Pp,variable:"",imports:{_:M}},M.prototype=th.prototype,M.prototype.constructor=M,Hr.prototype=Bl(th.prototype),Hr.prototype.constructor=Hr;function gt(d){this.__wrapped__=d,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ne,this.__views__=[]}function FQ(){var d=new gt(this.__wrapped__);return d.__actions__=ir(this.__actions__),d.__dir__=this.__dir__,d.__filtered__=this.__filtered__,d.__iteratees__=ir(this.__iteratees__),d.__takeCount__=this.__takeCount__,d.__views__=ir(this.__views__),d}function VQ(){if(this.__filtered__){var d=new gt(this);d.__dir__=-1,d.__filtered__=!0}else d=this.clone(),d.__dir__*=-1;return d}function $Q(){var d=this.__wrapped__.value(),p=this.__dir__,v=Ne(d),E=p<0,O=v?d.length:0,R=ZN(0,O,this.__views__),F=R.start,H=R.end,X=H-F,ce=E?H:F-1,de=this.__iteratees__,he=de.length,ke=0,De=Fn(X,this.__takeCount__);if(!v||!E&&O==X&&De==X)return K_(d,this.__actions__);var qe=[];e:for(;X--&&ke<De;){ce+=p;for(var ut=-1,Ke=d[ce];++ut<he;){var pt=de[ut],vt=pt.iteratee,Cr=pt.type,Jn=vt(Ke);if(Cr==z)Ke=Jn;else if(!Jn){if(Cr==me)continue e;break e}}qe[ke++]=Ke}return qe}gt.prototype=Bl(th.prototype),gt.prototype.constructor=gt;function ia(d){var p=-1,v=d==null?0:d.length;for(this.clear();++p<v;){var E=d[p];this.set(E[0],E[1])}}function zQ(){this.__data__=gc?gc(null):{},this.size=0}function HQ(d){var p=this.has(d)&&delete this.__data__[d];return this.size-=p?1:0,p}function UQ(d){var p=this.__data__;if(gc){var v=p[d];return v===u?n:v}return Ot.call(p,d)?p[d]:n}function WQ(d){var p=this.__data__;return gc?p[d]!==n:Ot.call(p,d)}function jQ(d,p){var v=this.__data__;return this.size+=this.has(d)?0:1,v[d]=gc&&p===n?u:p,this}ia.prototype.clear=zQ,ia.prototype.delete=HQ,ia.prototype.get=UQ,ia.prototype.has=WQ,ia.prototype.set=jQ;function li(d){var p=-1,v=d==null?0:d.length;for(this.clear();++p<v;){var E=d[p];this.set(E[0],E[1])}}function qQ(){this.__data__=[],this.size=0}function KQ(d){var p=this.__data__,v=nh(p,d);if(v<0)return!1;var E=p.length-1;return v==E?p.pop():Jp.call(p,v,1),--this.size,!0}function GQ(d){var p=this.__data__,v=nh(p,d);return v<0?n:p[v][1]}function XQ(d){return nh(this.__data__,d)>-1}function JQ(d,p){var v=this.__data__,E=nh(v,d);return E<0?(++this.size,v.push([d,p])):v[E][1]=p,this}li.prototype.clear=qQ,li.prototype.delete=KQ,li.prototype.get=GQ,li.prototype.has=XQ,li.prototype.set=JQ;function ui(d){var p=-1,v=d==null?0:d.length;for(this.clear();++p<v;){var E=d[p];this.set(E[0],E[1])}}function YQ(){this.size=0,this.__data__={hash:new ia,map:new(hc||li),string:new ia}}function ZQ(d){var p=hh(this,d).delete(d);return this.size-=p?1:0,p}function QQ(d){return hh(this,d).get(d)}function NQ(d){return hh(this,d).has(d)}function eN(d,p){var v=hh(this,d),E=v.size;return v.set(d,p),this.size+=v.size==E?0:1,this}ui.prototype.clear=YQ,ui.prototype.delete=ZQ,ui.prototype.get=QQ,ui.prototype.has=NQ,ui.prototype.set=eN;function sa(d){var p=-1,v=d==null?0:d.length;for(this.__data__=new ui;++p<v;)this.add(d[p])}function tN(d){return this.__data__.set(d,u),this}function nN(d){return this.__data__.has(d)}sa.prototype.add=sa.prototype.push=tN,sa.prototype.has=nN;function uo(d){var p=this.__data__=new li(d);this.size=p.size}function rN(){this.__data__=new li,this.size=0}function oN(d){var p=this.__data__,v=p.delete(d);return this.size=p.size,v}function iN(d){return this.__data__.get(d)}function sN(d){return this.__data__.has(d)}function aN(d,p){var v=this.__data__;if(v instanceof li){var E=v.__data__;if(!hc||E.length<o-1)return E.push([d,p]),this.size=++v.size,this;v=this.__data__=new ui(E)}return v.set(d,p),this.size=v.size,this}uo.prototype.clear=rN,uo.prototype.delete=oN,uo.prototype.get=iN,uo.prototype.has=sN,uo.prototype.set=aN;function E_(d,p){var v=Ne(d),E=!v&&da(d),O=!v&&!E&&ps(d),R=!v&&!E&&!O&&Pl(d),F=v||E||O||R,H=F?Pb(d.length,bQ):[],X=H.length;for(var ce in d)(p||Ot.call(d,ce))&&!(F&&(ce=="length"||O&&(ce=="offset"||ce=="parent")||R&&(ce=="buffer"||ce=="byteLength"||ce=="byteOffset")||pi(ce,X)))&&H.push(ce);return H}function __(d){var p=d.length;return p?d[Qb(0,p-1)]:n}function lN(d,p){return mh(ir(d),aa(p,0,d.length))}function uN(d){return mh(ir(d))}function Ub(d,p,v){(v!==n&&!co(d[p],v)||v===n&&!(p in d))&&ci(d,p,v)}function vc(d,p,v){var E=d[p];(!(Ot.call(d,p)&&co(E,v))||v===n&&!(p in d))&&ci(d,p,v)}function nh(d,p){for(var v=d.length;v--;)if(co(d[v][0],p))return v;return-1}function cN(d,p,v,E){return us(d,function(O,R,F){p(E,O,v(O),F)}),E}function S_(d,p){return d&&Io(p,wn(p),d)}function dN(d,p){return d&&Io(p,ar(p),d)}function ci(d,p,v){p=="__proto__"&&Yp?Yp(d,p,{configurable:!0,enumerable:!0,value:v,writable:!0}):d[p]=v}function Wb(d,p){for(var v=-1,E=p.length,O=Q(E),R=d==null;++v<E;)O[v]=R?n:E2(d,p[v]);return O}function aa(d,p,v){return d===d&&(v!==n&&(d=d<=v?d:v),p!==n&&(d=d>=p?d:p)),d}function Ur(d,p,v,E,O,R){var F,H=p&h,X=p&m,ce=p&g;if(v&&(F=O?v(d,E,O,R):v(d)),F!==n)return F;if(!en(d))return d;var de=Ne(d);if(de){if(F=NN(d),!H)return ir(d,F)}else{var he=Vn(d),ke=he==Ee||he==Oe;if(ps(d))return J_(d,H);if(he==wt||he==Me||ke&&!O){if(F=X||ke?{}:hS(d),!H)return X?UN(d,dN(F,d)):HN(d,S_(F,d))}else{if(!Ht[he])return O?d:{};F=eee(d,he,H)}}R||(R=new uo);var De=R.get(d);if(De)return De;R.set(d,F),WS(d)?d.forEach(function(Ke){F.add(Ur(Ke,p,v,Ke,d,R))}):HS(d)&&d.forEach(function(Ke,pt){F.set(pt,Ur(Ke,p,v,pt,d,R))});var qe=ce?X?u2:l2:X?ar:wn,ut=de?n:qe(d);return $r(ut||d,function(Ke,pt){ut&&(pt=Ke,Ke=d[pt]),vc(F,pt,Ur(Ke,p,v,pt,d,R))}),F}function fN(d){var p=wn(d);return function(v){return k_(v,d,p)}}function k_(d,p,v){var E=v.length;if(d==null)return!E;for(d=$t(d);E--;){var O=v[E],R=p[O],F=d[O];if(F===n&&!(O in d)||!R(F))return!1}return!0}function T_(d,p,v){if(typeof d!="function")throw new zr(a);return Sc(function(){d.apply(n,v)},p)}function yc(d,p,v,E){var O=-1,R=$p,F=!0,H=d.length,X=[],ce=p.length;if(!H)return X;v&&(p=Xt(p,yr(v))),E?(R=Ob,F=!1):p.length>=o&&(R=fc,F=!1,p=new sa(p));e:for(;++O<H;){var de=d[O],he=v==null?de:v(de);if(de=E||de!==0?de:0,F&&he===he){for(var ke=ce;ke--;)if(p[ke]===he)continue e;X.push(de)}else R(p,he,E)||X.push(de)}return X}var us=eS(Ro),A_=eS(qb,!0);function pN(d,p){var v=!0;return us(d,function(E,O,R){return v=!!p(E,O,R),v}),v}function rh(d,p,v){for(var E=-1,O=d.length;++E<O;){var R=d[E],F=p(R);if(F!=null&&(H===n?F===F&&!xr(F):v(F,H)))var H=F,X=R}return X}function hN(d,p,v,E){var O=d.length;for(v=ot(v),v<0&&(v=-v>O?0:O+v),E=E===n||E>O?O:ot(E),E<0&&(E+=O),E=v>E?0:qS(E);v<E;)d[v++]=p;return d}function O_(d,p){var v=[];return us(d,function(E,O,R){p(E,O,R)&&v.push(E)}),v}function An(d,p,v,E,O){var R=-1,F=d.length;for(v||(v=nee),O||(O=[]);++R<F;){var H=d[R];p>0&&v(H)?p>1?An(H,p-1,v,E,O):ss(O,H):E||(O[O.length]=H)}return O}var jb=tS(),M_=tS(!0);function Ro(d,p){return d&&jb(d,p,wn)}function qb(d,p){return d&&M_(d,p,wn)}function oh(d,p){return is(p,function(v){return hi(d[v])})}function la(d,p){p=ds(p,d);for(var v=0,E=p.length;d!=null&&v<E;)d=d[Lo(p[v++])];return v&&v==E?d:n}function B_(d,p,v){var E=p(d);return Ne(d)?E:ss(E,v(d))}function Gn(d){return d==null?d===n?He:ze:oa&&oa in $t(d)?YN(d):uee(d)}function Kb(d,p){return d>p}function mN(d,p){return d!=null&&Ot.call(d,p)}function gN(d,p){return d!=null&&p in $t(d)}function bN(d,p,v){return d>=Fn(p,v)&&d<mn(p,v)}function Gb(d,p,v){for(var E=v?Ob:$p,O=d[0].length,R=d.length,F=R,H=Q(R),X=1/0,ce=[];F--;){var de=d[F];F&&p&&(de=Xt(de,yr(p))),X=Fn(de.length,X),H[F]=!v&&(p||O>=120&&de.length>=120)?new sa(F&&de):n}de=d[0];var he=-1,ke=H[0];e:for(;++he<O&&ce.length<X;){var De=de[he],qe=p?p(De):De;if(De=v||De!==0?De:0,!(ke?fc(ke,qe):E(ce,qe,v))){for(F=R;--F;){var ut=H[F];if(!(ut?fc(ut,qe):E(d[F],qe,v)))continue e}ke&&ke.push(qe),ce.push(De)}}return ce}function vN(d,p,v,E){return Ro(d,function(O,R,F){p(E,v(O),R,F)}),E}function wc(d,p,v){p=ds(p,d),d=vS(d,p);var E=d==null?d:d[Lo(jr(p))];return E==null?n:vr(E,d,v)}function R_(d){return on(d)&&Gn(d)==Me}function yN(d){return on(d)&&Gn(d)==le}function wN(d){return on(d)&&Gn(d)==re}function xc(d,p,v,E,O){return d===p?!0:d==null||p==null||!on(d)&&!on(p)?d!==d&&p!==p:xN(d,p,v,E,xc,O)}function xN(d,p,v,E,O,R){var F=Ne(d),H=Ne(p),X=F?ge:Vn(d),ce=H?ge:Vn(p);X=X==Me?wt:X,ce=ce==Me?wt:ce;var de=X==wt,he=ce==wt,ke=X==ce;if(ke&&ps(d)){if(!ps(p))return!1;F=!0,de=!1}if(ke&&!de)return R||(R=new uo),F||Pl(d)?dS(d,p,v,E,O,R):XN(d,p,X,v,E,O,R);if(!(v&b)){var De=de&&Ot.call(d,"__wrapped__"),qe=he&&Ot.call(p,"__wrapped__");if(De||qe){var ut=De?d.value():d,Ke=qe?p.value():p;return R||(R=new uo),O(ut,Ke,v,E,R)}}return ke?(R||(R=new uo),JN(d,p,v,E,O,R)):!1}function CN(d){return on(d)&&Vn(d)==Y}function Xb(d,p,v,E){var O=v.length,R=O,F=!E;if(d==null)return!R;for(d=$t(d);O--;){var H=v[O];if(F&&H[2]?H[1]!==d[H[0]]:!(H[0]in d))return!1}for(;++O<R;){H=v[O];var X=H[0],ce=d[X],de=H[1];if(F&&H[2]){if(ce===n&&!(X in d))return!1}else{var he=new uo;if(E)var ke=E(ce,de,X,d,p,he);if(!(ke===n?xc(de,ce,b|y,E,he):ke))return!1}}return!0}function I_(d){if(!en(d)||oee(d))return!1;var p=hi(d)?CQ:fZ;return p.test(ca(d))}function EN(d){return on(d)&&Gn(d)==ae}function _N(d){return on(d)&&Vn(d)==ve}function SN(d){return on(d)&&xh(d.length)&&!!jt[Gn(d)]}function L_(d){return typeof d=="function"?d:d==null?lr:typeof d=="object"?Ne(d)?F_(d[0],d[1]):D_(d):nk(d)}function Jb(d){if(!_c(d))return AQ(d);var p=[];for(var v in $t(d))Ot.call(d,v)&&v!="constructor"&&p.push(v);return p}function kN(d){if(!en(d))return lee(d);var p=_c(d),v=[];for(var E in d)E=="constructor"&&(p||!Ot.call(d,E))||v.push(E);return v}function Yb(d,p){return d<p}function P_(d,p){var v=-1,E=sr(d)?Q(d.length):[];return us(d,function(O,R,F){E[++v]=p(O,R,F)}),E}function D_(d){var p=d2(d);return p.length==1&&p[0][2]?gS(p[0][0],p[0][1]):function(v){return v===d||Xb(v,d,p)}}function F_(d,p){return p2(d)&&mS(p)?gS(Lo(d),p):function(v){var E=E2(v,d);return E===n&&E===p?_2(v,d):xc(p,E,b|y)}}function ih(d,p,v,E,O){d!==p&&jb(p,function(R,F){if(O||(O=new uo),en(R))TN(d,p,F,v,ih,E,O);else{var H=E?E(m2(d,F),R,F+"",d,p,O):n;H===n&&(H=R),Ub(d,F,H)}},ar)}function TN(d,p,v,E,O,R,F){var H=m2(d,v),X=m2(p,v),ce=F.get(X);if(ce){Ub(d,v,ce);return}var de=R?R(H,X,v+"",d,p,F):n,he=de===n;if(he){var ke=Ne(X),De=!ke&&ps(X),qe=!ke&&!De&&Pl(X);de=X,ke||De||qe?Ne(H)?de=H:ln(H)?de=ir(H):De?(he=!1,de=J_(X,!0)):qe?(he=!1,de=Y_(X,!0)):de=[]:kc(X)||da(X)?(de=H,da(H)?de=KS(H):(!en(H)||hi(H))&&(de=hS(X))):he=!1}he&&(F.set(X,de),O(de,X,E,R,F),F.delete(X)),Ub(d,v,de)}function V_(d,p){var v=d.length;if(v)return p+=p<0?v:0,pi(p,v)?d[p]:n}function $_(d,p,v){p.length?p=Xt(p,function(R){return Ne(R)?function(F){return la(F,R.length===1?R[0]:R)}:R}):p=[lr];var E=-1;p=Xt(p,yr(We()));var O=P_(d,function(R,F,H){var X=Xt(p,function(ce){return ce(R)});return{criteria:X,index:++E,value:R}});return eQ(O,function(R,F){return zN(R,F,v)})}function AN(d,p){return z_(d,p,function(v,E){return _2(d,E)})}function z_(d,p,v){for(var E=-1,O=p.length,R={};++E<O;){var F=p[E],H=la(d,F);v(H,F)&&Cc(R,ds(F,d),H)}return R}function ON(d){return function(p){return la(p,d)}}function Zb(d,p,v,E){var O=E?NZ:_l,R=-1,F=p.length,H=d;for(d===p&&(p=ir(p)),v&&(H=Xt(d,yr(v)));++R<F;)for(var X=0,ce=p[R],de=v?v(ce):ce;(X=O(H,de,X,E))>-1;)H!==d&&Jp.call(H,X,1),Jp.call(d,X,1);return d}function H_(d,p){for(var v=d?p.length:0,E=v-1;v--;){var O=p[v];if(v==E||O!==R){var R=O;pi(O)?Jp.call(d,O,1):t2(d,O)}}return d}function Qb(d,p){return d+Qp(x_()*(p-d+1))}function MN(d,p,v,E){for(var O=-1,R=mn(Zp((p-d)/(v||1)),0),F=Q(R);R--;)F[E?R:++O]=d,d+=v;return F}function Nb(d,p){var v="";if(!d||p<1||p>G)return v;do p%2&&(v+=d),p=Qp(p/2),p&&(d+=d);while(p);return v}function ct(d,p){return g2(bS(d,p,lr),d+"")}function BN(d){return __(Dl(d))}function RN(d,p){var v=Dl(d);return mh(v,aa(p,0,v.length))}function Cc(d,p,v,E){if(!en(d))return d;p=ds(p,d);for(var O=-1,R=p.length,F=R-1,H=d;H!=null&&++O<R;){var X=Lo(p[O]),ce=v;if(X==="__proto__"||X==="constructor"||X==="prototype")return d;if(O!=F){var de=H[X];ce=E?E(de,X,H):n,ce===n&&(ce=en(de)?de:pi(p[O+1])?[]:{})}vc(H,X,ce),H=H[X]}return d}var U_=Np?function(d,p){return Np.set(d,p),d}:lr,IN=Yp?function(d,p){return Yp(d,"toString",{configurable:!0,enumerable:!1,value:k2(p),writable:!0})}:lr;function LN(d){return mh(Dl(d))}function Wr(d,p,v){var E=-1,O=d.length;p<0&&(p=-p>O?0:O+p),v=v>O?O:v,v<0&&(v+=O),O=p>v?0:v-p>>>0,p>>>=0;for(var R=Q(O);++E<O;)R[E]=d[E+p];return R}function PN(d,p){var v;return us(d,function(E,O,R){return v=p(E,O,R),!v}),!!v}function sh(d,p,v){var E=0,O=d==null?E:d.length;if(typeof p=="number"&&p===p&&O<=_e){for(;E<O;){var R=E+O>>>1,F=d[R];F!==null&&!xr(F)&&(v?F<=p:F<p)?E=R+1:O=R}return O}return e2(d,p,lr,v)}function e2(d,p,v,E){var O=0,R=d==null?0:d.length;if(R===0)return 0;p=v(p);for(var F=p!==p,H=p===null,X=xr(p),ce=p===n;O<R;){var de=Qp((O+R)/2),he=v(d[de]),ke=he!==n,De=he===null,qe=he===he,ut=xr(he);if(F)var Ke=E||qe;else ce?Ke=qe&&(E||ke):H?Ke=qe&&ke&&(E||!De):X?Ke=qe&&ke&&!De&&(E||!ut):De||ut?Ke=!1:Ke=E?he<=p:he<p;Ke?O=de+1:R=de}return Fn(R,Ce)}function W_(d,p){for(var v=-1,E=d.length,O=0,R=[];++v<E;){var F=d[v],H=p?p(F):F;if(!v||!co(H,X)){var X=H;R[O++]=F===0?0:F}}return R}function j_(d){return typeof d=="number"?d:xr(d)?oe:+d}function wr(d){if(typeof d=="string")return d;if(Ne(d))return Xt(d,wr)+"";if(xr(d))return C_?C_.call(d):"";var p=d+"";return p=="0"&&1/d==-1/0?"-0":p}function cs(d,p,v){var E=-1,O=$p,R=d.length,F=!0,H=[],X=H;if(v)F=!1,O=Ob;else if(R>=o){var ce=p?null:KN(d);if(ce)return Hp(ce);F=!1,O=fc,X=new sa}else X=p?[]:H;e:for(;++E<R;){var de=d[E],he=p?p(de):de;if(de=v||de!==0?de:0,F&&he===he){for(var ke=X.length;ke--;)if(X[ke]===he)continue e;p&&X.push(he),H.push(de)}else O(X,he,v)||(X!==H&&X.push(he),H.push(de))}return H}function t2(d,p){return p=ds(p,d),d=vS(d,p),d==null||delete d[Lo(jr(p))]}function q_(d,p,v,E){return Cc(d,p,v(la(d,p)),E)}function ah(d,p,v,E){for(var O=d.length,R=E?O:-1;(E?R--:++R<O)&&p(d[R],R,d););return v?Wr(d,E?0:R,E?R+1:O):Wr(d,E?R+1:0,E?O:R)}function K_(d,p){var v=d;return v instanceof gt&&(v=v.value()),Mb(p,function(E,O){return O.func.apply(O.thisArg,ss([E],O.args))},v)}function n2(d,p,v){var E=d.length;if(E<2)return E?cs(d[0]):[];for(var O=-1,R=Q(E);++O<E;)for(var F=d[O],H=-1;++H<E;)H!=O&&(R[O]=yc(R[O]||F,d[H],p,v));return cs(An(R,1),p,v)}function G_(d,p,v){for(var E=-1,O=d.length,R=p.length,F={};++E<O;){var H=E<R?p[E]:n;v(F,d[E],H)}return F}function r2(d){return ln(d)?d:[]}function o2(d){return typeof d=="function"?d:lr}function ds(d,p){return Ne(d)?d:p2(d,p)?[d]:CS(Tt(d))}var DN=ct;function fs(d,p,v){var E=d.length;return v=v===n?E:v,!p&&v>=E?d:Wr(d,p,v)}var X_=EQ||function(d){return Tn.clearTimeout(d)};function J_(d,p){if(p)return d.slice();var v=d.length,E=g_?g_(v):new d.constructor(v);return d.copy(E),E}function i2(d){var p=new d.constructor(d.byteLength);return new Gp(p).set(new Gp(d)),p}function FN(d,p){var v=p?i2(d.buffer):d.buffer;return new d.constructor(v,d.byteOffset,d.byteLength)}function VN(d){var p=new d.constructor(d.source,RE.exec(d));return p.lastIndex=d.lastIndex,p}function $N(d){return bc?$t(bc.call(d)):{}}function Y_(d,p){var v=p?i2(d.buffer):d.buffer;return new d.constructor(v,d.byteOffset,d.length)}function Z_(d,p){if(d!==p){var v=d!==n,E=d===null,O=d===d,R=xr(d),F=p!==n,H=p===null,X=p===p,ce=xr(p);if(!H&&!ce&&!R&&d>p||R&&F&&X&&!H&&!ce||E&&F&&X||!v&&X||!O)return 1;if(!E&&!R&&!ce&&d<p||ce&&v&&O&&!E&&!R||H&&v&&O||!F&&O||!X)return-1}return 0}function zN(d,p,v){for(var E=-1,O=d.criteria,R=p.criteria,F=O.length,H=v.length;++E<F;){var X=Z_(O[E],R[E]);if(X){if(E>=H)return X;var ce=v[E];return X*(ce=="desc"?-1:1)}}return d.index-p.index}function Q_(d,p,v,E){for(var O=-1,R=d.length,F=v.length,H=-1,X=p.length,ce=mn(R-F,0),de=Q(X+ce),he=!E;++H<X;)de[H]=p[H];for(;++O<F;)(he||O<R)&&(de[v[O]]=d[O]);for(;ce--;)de[H++]=d[O++];return de}function N_(d,p,v,E){for(var O=-1,R=d.length,F=-1,H=v.length,X=-1,ce=p.length,de=mn(R-H,0),he=Q(de+ce),ke=!E;++O<de;)he[O]=d[O];for(var De=O;++X<ce;)he[De+X]=p[X];for(;++F<H;)(ke||O<R)&&(he[De+v[F]]=d[O++]);return he}function ir(d,p){var v=-1,E=d.length;for(p||(p=Q(E));++v<E;)p[v]=d[v];return p}function Io(d,p,v,E){var O=!v;v||(v={});for(var R=-1,F=p.length;++R<F;){var H=p[R],X=E?E(v[H],d[H],H,v,d):n;X===n&&(X=d[H]),O?ci(v,H,X):vc(v,H,X)}return v}function HN(d,p){return Io(d,f2(d),p)}function UN(d,p){return Io(d,fS(d),p)}function lh(d,p){return function(v,E){var O=Ne(v)?GZ:cN,R=p?p():{};return O(v,d,We(E,2),R)}}function Rl(d){return ct(function(p,v){var E=-1,O=v.length,R=O>1?v[O-1]:n,F=O>2?v[2]:n;for(R=d.length>3&&typeof R=="function"?(O--,R):n,F&&Xn(v[0],v[1],F)&&(R=O<3?n:R,O=1),p=$t(p);++E<O;){var H=v[E];H&&d(p,H,E,R)}return p})}function eS(d,p){return function(v,E){if(v==null)return v;if(!sr(v))return d(v,E);for(var O=v.length,R=p?O:-1,F=$t(v);(p?R--:++R<O)&&E(F[R],R,F)!==!1;);return v}}function tS(d){return function(p,v,E){for(var O=-1,R=$t(p),F=E(p),H=F.length;H--;){var X=F[d?H:++O];if(v(R[X],X,R)===!1)break}return p}}function WN(d,p,v){var E=p&w,O=Ec(d);function R(){var F=this&&this!==Tn&&this instanceof R?O:d;return F.apply(E?v:this,arguments)}return R}function nS(d){return function(p){p=Tt(p);var v=Sl(p)?lo(p):n,E=v?v[0]:p.charAt(0),O=v?fs(v,1).join(""):p.slice(1);return E[d]()+O}}function Il(d){return function(p){return Mb(ek(NS(p).replace(IZ,"")),d,"")}}function Ec(d){return function(){var p=arguments;switch(p.length){case 0:return new d;case 1:return new d(p[0]);case 2:return new d(p[0],p[1]);case 3:return new d(p[0],p[1],p[2]);case 4:return new d(p[0],p[1],p[2],p[3]);case 5:return new d(p[0],p[1],p[2],p[3],p[4]);case 6:return new d(p[0],p[1],p[2],p[3],p[4],p[5]);case 7:return new d(p[0],p[1],p[2],p[3],p[4],p[5],p[6])}var v=Bl(d.prototype),E=d.apply(v,p);return en(E)?E:v}}function jN(d,p,v){var E=Ec(d);function O(){for(var R=arguments.length,F=Q(R),H=R,X=Ll(O);H--;)F[H]=arguments[H];var ce=R<3&&F[0]!==X&&F[R-1]!==X?[]:as(F,X);if(R-=ce.length,R<v)return aS(d,p,uh,O.placeholder,n,F,ce,n,n,v-R);var de=this&&this!==Tn&&this instanceof O?E:d;return vr(de,this,F)}return O}function rS(d){return function(p,v,E){var O=$t(p);if(!sr(p)){var R=We(v,3);p=wn(p),v=function(H){return R(O[H],H,O)}}var F=d(p,v,E);return F>-1?O[R?p[F]:F]:n}}function oS(d){return fi(function(p){var v=p.length,E=v,O=Hr.prototype.thru;for(d&&p.reverse();E--;){var R=p[E];if(typeof R!="function")throw new zr(a);if(O&&!F&&ph(R)=="wrapper")var F=new Hr([],!0)}for(E=F?E:v;++E<v;){R=p[E];var H=ph(R),X=H=="wrapper"?c2(R):n;X&&h2(X[0])&&X[1]==(T|S|k|B)&&!X[4].length&&X[9]==1?F=F[ph(X[0])].apply(F,X[3]):F=R.length==1&&h2(R)?F[H]():F.thru(R)}return function(){var ce=arguments,de=ce[0];if(F&&ce.length==1&&Ne(de))return F.plant(de).value();for(var he=0,ke=v?p[he].apply(this,ce):de;++he<v;)ke=p[he].call(this,ke);return ke}})}function uh(d,p,v,E,O,R,F,H,X,ce){var de=p&T,he=p&w,ke=p&x,De=p&(S|C),qe=p&L,ut=ke?n:Ec(d);function Ke(){for(var pt=arguments.length,vt=Q(pt),Cr=pt;Cr--;)vt[Cr]=arguments[Cr];if(De)var Jn=Ll(Ke),Er=nQ(vt,Jn);if(E&&(vt=Q_(vt,E,O,De)),R&&(vt=N_(vt,R,F,De)),pt-=Er,De&&pt<ce){var un=as(vt,Jn);return aS(d,p,uh,Ke.placeholder,v,vt,un,H,X,ce-pt)}var fo=he?v:this,gi=ke?fo[d]:d;return pt=vt.length,H?vt=cee(vt,H):qe&&pt>1&&vt.reverse(),de&&X<pt&&(vt.length=X),this&&this!==Tn&&this instanceof Ke&&(gi=ut||Ec(gi)),gi.apply(fo,vt)}return Ke}function iS(d,p){return function(v,E){return vN(v,d,p(E),{})}}function ch(d,p){return function(v,E){var O;if(v===n&&E===n)return p;if(v!==n&&(O=v),E!==n){if(O===n)return E;typeof v=="string"||typeof E=="string"?(v=wr(v),E=wr(E)):(v=j_(v),E=j_(E)),O=d(v,E)}return O}}function s2(d){return fi(function(p){return p=Xt(p,yr(We())),ct(function(v){var E=this;return d(p,function(O){return vr(O,E,v)})})})}function dh(d,p){p=p===n?" ":wr(p);var v=p.length;if(v<2)return v?Nb(p,d):p;var E=Nb(p,Zp(d/kl(p)));return Sl(p)?fs(lo(E),0,d).join(""):E.slice(0,d)}function qN(d,p,v,E){var O=p&w,R=Ec(d);function F(){for(var H=-1,X=arguments.length,ce=-1,de=E.length,he=Q(de+X),ke=this&&this!==Tn&&this instanceof F?R:d;++ce<de;)he[ce]=E[ce];for(;X--;)he[ce++]=arguments[++H];return vr(ke,O?v:this,he)}return F}function sS(d){return function(p,v,E){return E&&typeof E!="number"&&Xn(p,v,E)&&(v=E=n),p=mi(p),v===n?(v=p,p=0):v=mi(v),E=E===n?p<v?1:-1:mi(E),MN(p,v,E,d)}}function fh(d){return function(p,v){return typeof p=="string"&&typeof v=="string"||(p=qr(p),v=qr(v)),d(p,v)}}function aS(d,p,v,E,O,R,F,H,X,ce){var de=p&S,he=de?F:n,ke=de?n:F,De=de?R:n,qe=de?n:R;p|=de?k:A,p&=~(de?A:k),p&_||(p&=-4);var ut=[d,p,O,De,he,qe,ke,H,X,ce],Ke=v.apply(n,ut);return h2(d)&&yS(Ke,ut),Ke.placeholder=E,wS(Ke,d,p)}function a2(d){var p=hn[d];return function(v,E){if(v=qr(v),E=E==null?0:Fn(ot(E),292),E&&w_(v)){var O=(Tt(v)+"e").split("e"),R=p(O[0]+"e"+(+O[1]+E));return O=(Tt(R)+"e").split("e"),+(O[0]+"e"+(+O[1]-E))}return p(v)}}var KN=Ol&&1/Hp(new Ol([,-0]))[1]==P?function(d){return new Ol(d)}:O2;function lS(d){return function(p){var v=Vn(p);return v==Y?Fb(p):v==ve?uQ(p):tQ(p,d(p))}}function di(d,p,v,E,O,R,F,H){var X=p&x;if(!X&&typeof d!="function")throw new zr(a);var ce=E?E.length:0;if(ce||(p&=-97,E=O=n),F=F===n?F:mn(ot(F),0),H=H===n?H:ot(H),ce-=O?O.length:0,p&A){var de=E,he=O;E=O=n}var ke=X?n:c2(d),De=[d,p,v,E,O,de,he,R,F,H];if(ke&&aee(De,ke),d=De[0],p=De[1],v=De[2],E=De[3],O=De[4],H=De[9]=De[9]===n?X?0:d.length:mn(De[9]-ce,0),!H&&p&(S|C)&&(p&=-25),!p||p==w)var qe=WN(d,p,v);else p==S||p==C?qe=jN(d,p,H):(p==k||p==(w|k))&&!O.length?qe=qN(d,p,v,E):qe=uh.apply(n,De);var ut=ke?U_:yS;return wS(ut(qe,De),d,p)}function uS(d,p,v,E){return d===n||co(d,Al[v])&&!Ot.call(E,v)?p:d}function cS(d,p,v,E,O,R){return en(d)&&en(p)&&(R.set(p,d),ih(d,p,n,cS,R),R.delete(p)),d}function GN(d){return kc(d)?n:d}function dS(d,p,v,E,O,R){var F=v&b,H=d.length,X=p.length;if(H!=X&&!(F&&X>H))return!1;var ce=R.get(d),de=R.get(p);if(ce&&de)return ce==p&&de==d;var he=-1,ke=!0,De=v&y?new sa:n;for(R.set(d,p),R.set(p,d);++he<H;){var qe=d[he],ut=p[he];if(E)var Ke=F?E(ut,qe,he,p,d,R):E(qe,ut,he,d,p,R);if(Ke!==n){if(Ke)continue;ke=!1;break}if(De){if(!Bb(p,function(pt,vt){if(!fc(De,vt)&&(qe===pt||O(qe,pt,v,E,R)))return De.push(vt)})){ke=!1;break}}else if(!(qe===ut||O(qe,ut,v,E,R))){ke=!1;break}}return R.delete(d),R.delete(p),ke}function XN(d,p,v,E,O,R,F){switch(v){case be:if(d.byteLength!=p.byteLength||d.byteOffset!=p.byteOffset)return!1;d=d.buffer,p=p.buffer;case le:return!(d.byteLength!=p.byteLength||!R(new Gp(d),new Gp(p)));case J:case re:case we:return co(+d,+p);case fe:return d.name==p.name&&d.message==p.message;case ae:case Le:return d==p+"";case Y:var H=Fb;case ve:var X=E&b;if(H||(H=Hp),d.size!=p.size&&!X)return!1;var ce=F.get(d);if(ce)return ce==p;E|=y,F.set(d,p);var de=dS(H(d),H(p),E,O,R,F);return F.delete(d),de;case tt:if(bc)return bc.call(d)==bc.call(p)}return!1}function JN(d,p,v,E,O,R){var F=v&b,H=l2(d),X=H.length,ce=l2(p),de=ce.length;if(X!=de&&!F)return!1;for(var he=X;he--;){var ke=H[he];if(!(F?ke in p:Ot.call(p,ke)))return!1}var De=R.get(d),qe=R.get(p);if(De&&qe)return De==p&&qe==d;var ut=!0;R.set(d,p),R.set(p,d);for(var Ke=F;++he<X;){ke=H[he];var pt=d[ke],vt=p[ke];if(E)var Cr=F?E(vt,pt,ke,p,d,R):E(pt,vt,ke,d,p,R);if(!(Cr===n?pt===vt||O(pt,vt,v,E,R):Cr)){ut=!1;break}Ke||(Ke=ke=="constructor")}if(ut&&!Ke){var Jn=d.constructor,Er=p.constructor;Jn!=Er&&"constructor"in d&&"constructor"in p&&!(typeof Jn=="function"&&Jn instanceof Jn&&typeof Er=="function"&&Er instanceof Er)&&(ut=!1)}return R.delete(d),R.delete(p),ut}function fi(d){return g2(bS(d,n,kS),d+"")}function l2(d){return B_(d,wn,f2)}function u2(d){return B_(d,ar,fS)}var c2=Np?function(d){return Np.get(d)}:O2;function ph(d){for(var p=d.name+"",v=Ml[p],E=Ot.call(Ml,p)?v.length:0;E--;){var O=v[E],R=O.func;if(R==null||R==d)return O.name}return p}function Ll(d){var p=Ot.call(M,"placeholder")?M:d;return p.placeholder}function We(){var d=M.iteratee||T2;return d=d===T2?L_:d,arguments.length?d(arguments[0],arguments[1]):d}function hh(d,p){var v=d.__data__;return ree(p)?v[typeof p=="string"?"string":"hash"]:v.map}function d2(d){for(var p=wn(d),v=p.length;v--;){var E=p[v],O=d[E];p[v]=[E,O,mS(O)]}return p}function ua(d,p){var v=sQ(d,p);return I_(v)?v:n}function YN(d){var p=Ot.call(d,oa),v=d[oa];try{d[oa]=n;var E=!0}catch{}var O=qp.call(d);return E&&(p?d[oa]=v:delete d[oa]),O}var f2=$b?function(d){return d==null?[]:(d=$t(d),is($b(d),function(p){return v_.call(d,p)}))}:M2,fS=$b?function(d){for(var p=[];d;)ss(p,f2(d)),d=Xp(d);return p}:M2,Vn=Gn;(zb&&Vn(new zb(new ArrayBuffer(1)))!=be||hc&&Vn(new hc)!=Y||Hb&&Vn(Hb.resolve())!=$||Ol&&Vn(new Ol)!=ve||mc&&Vn(new mc)!=N)&&(Vn=function(d){var p=Gn(d),v=p==wt?d.constructor:n,E=v?ca(v):"";if(E)switch(E){case RQ:return be;case IQ:return Y;case LQ:return $;case PQ:return ve;case DQ:return N}return p});function ZN(d,p,v){for(var E=-1,O=v.length;++E<O;){var R=v[E],F=R.size;switch(R.type){case"drop":d+=F;break;case"dropRight":p-=F;break;case"take":p=Fn(p,d+F);break;case"takeRight":d=mn(d,p-F);break}}return{start:d,end:p}}function QN(d){var p=d.match(oZ);return p?p[1].split(iZ):[]}function pS(d,p,v){p=ds(p,d);for(var E=-1,O=p.length,R=!1;++E<O;){var F=Lo(p[E]);if(!(R=d!=null&&v(d,F)))break;d=d[F]}return R||++E!=O?R:(O=d==null?0:d.length,!!O&&xh(O)&&pi(F,O)&&(Ne(d)||da(d)))}function NN(d){var p=d.length,v=new d.constructor(p);return p&&typeof d[0]=="string"&&Ot.call(d,"index")&&(v.index=d.index,v.input=d.input),v}function hS(d){return typeof d.constructor=="function"&&!_c(d)?Bl(Xp(d)):{}}function eee(d,p,v){var E=d.constructor;switch(p){case le:return i2(d);case J:case re:return new E(+d);case be:return FN(d,v);case Fe:case nt:case At:case Nt:case ii:case te:case Re:case Ue:case Ct:return Y_(d,v);case Y:return new E;case we:case Le:return new E(d);case ae:return VN(d);case ve:return new E;case tt:return $N(d)}}function tee(d,p){var v=p.length;if(!v)return d;var E=v-1;return p[E]=(v>1?"& ":"")+p[E],p=p.join(v>2?", ":" "),d.replace(rZ,`{
14
+ */ed.exports,function(t,e){(function(){var n,r="4.17.21",o=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",l="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",c=500,f="__lodash_placeholder__",h=1,m=2,g=4,b=1,y=2,w=1,x=2,_=4,S=8,C=16,k=32,A=64,T=128,B=256,L=512,I=30,V="...",q=800,K=16,me=1,z=2,U=3,P=1/0,G=9007199254740991,Z=17976931348623157e292,oe=NaN,ne=4294967295,Ce=ne-1,_e=ne>>>1,Ge=[["ary",T],["bind",w],["bindKey",x],["curry",S],["curryRight",C],["flip",L],["partial",k],["partialRight",A],["rearg",B]],Me="[object Arguments]",ge="[object Array]",W="[object AsyncFunction]",J="[object Boolean]",re="[object Date]",ie="[object DOMException]",fe="[object Error]",Ee="[object Function]",Oe="[object GeneratorFunction]",Y="[object Map]",we="[object Number]",ze="[object Null]",wt="[object Object]",$="[object Promise]",D="[object Proxy]",ae="[object RegExp]",ve="[object Set]",Le="[object String]",tt="[object Symbol]",He="[object Undefined]",N="[object WeakMap]",pe="[object WeakSet]",le="[object ArrayBuffer]",be="[object DataView]",Fe="[object Float32Array]",nt="[object Float64Array]",At="[object Int8Array]",Nt="[object Int16Array]",ii="[object Int32Array]",te="[object Uint8Array]",Re="[object Uint8ClampedArray]",Ue="[object Uint16Array]",Ct="[object Uint32Array]",bt=/\b__p \+= '';/g,kn=/\b(__p \+=) '' \+/g,or=/(__e\(.*?\)|\b__t\)) \+\n'';/g,si=/&(?:amp|lt|gt|quot|#39);/g,uc=/[&<>"']/g,ai=RegExp(si.source),cc=RegExp(uc.source),xl=/<%-([\s\S]+?)%>/g,rs=/<%([\s\S]+?)%>/g,Pp=/<%=([\s\S]+?)%>/g,dc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Cl=/^\w*$/,eZ=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,wb=/[\\^$.*+?()[\]{}|]/g,tZ=RegExp(wb.source),xb=/^\s+/,nZ=/\s/,rZ=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oZ=/\{\n\/\* \[wrapped with (.+)\] \*/,iZ=/,? & /,sZ=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,aZ=/[()=,{}\[\]\/\s]/,lZ=/\\(\\)?/g,uZ=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,RE=/\w*$/,cZ=/^[-+]0x[0-9a-f]+$/i,dZ=/^0b[01]+$/i,fZ=/^\[object .+?Constructor\]$/,pZ=/^0o[0-7]+$/i,hZ=/^(?:0|[1-9]\d*)$/,mZ=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Dp=/($^)/,gZ=/['\n\r\u2028\u2029\\]/g,Fp="\\ud800-\\udfff",bZ="\\u0300-\\u036f",vZ="\\ufe20-\\ufe2f",yZ="\\u20d0-\\u20ff",IE=bZ+vZ+yZ,LE="\\u2700-\\u27bf",PE="a-z\\xdf-\\xf6\\xf8-\\xff",wZ="\\xac\\xb1\\xd7\\xf7",xZ="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",CZ="\\u2000-\\u206f",EZ=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",DE="A-Z\\xc0-\\xd6\\xd8-\\xde",FE="\\ufe0e\\ufe0f",VE=wZ+xZ+CZ+EZ,Cb="['’]",_Z="["+Fp+"]",$E="["+VE+"]",Vp="["+IE+"]",zE="\\d+",SZ="["+LE+"]",HE="["+PE+"]",UE="[^"+Fp+VE+zE+LE+PE+DE+"]",Eb="\\ud83c[\\udffb-\\udfff]",kZ="(?:"+Vp+"|"+Eb+")",WE="[^"+Fp+"]",_b="(?:\\ud83c[\\udde6-\\uddff]){2}",Sb="[\\ud800-\\udbff][\\udc00-\\udfff]",El="["+DE+"]",jE="\\u200d",qE="(?:"+HE+"|"+UE+")",TZ="(?:"+El+"|"+UE+")",KE="(?:"+Cb+"(?:d|ll|m|re|s|t|ve))?",GE="(?:"+Cb+"(?:D|LL|M|RE|S|T|VE))?",XE=kZ+"?",JE="["+FE+"]?",AZ="(?:"+jE+"(?:"+[WE,_b,Sb].join("|")+")"+JE+XE+")*",OZ="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",MZ="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",YE=JE+XE+AZ,BZ="(?:"+[SZ,_b,Sb].join("|")+")"+YE,RZ="(?:"+[WE+Vp+"?",Vp,_b,Sb,_Z].join("|")+")",IZ=RegExp(Cb,"g"),LZ=RegExp(Vp,"g"),kb=RegExp(Eb+"(?="+Eb+")|"+RZ+YE,"g"),PZ=RegExp([El+"?"+HE+"+"+KE+"(?="+[$E,El,"$"].join("|")+")",TZ+"+"+GE+"(?="+[$E,El+qE,"$"].join("|")+")",El+"?"+qE+"+"+KE,El+"+"+GE,MZ,OZ,zE,BZ].join("|"),"g"),DZ=RegExp("["+jE+Fp+IE+FE+"]"),FZ=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,VZ=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],$Z=-1,jt={};jt[Fe]=jt[nt]=jt[At]=jt[Nt]=jt[ii]=jt[te]=jt[Re]=jt[Ue]=jt[Ct]=!0,jt[Me]=jt[ge]=jt[le]=jt[J]=jt[be]=jt[re]=jt[fe]=jt[Ee]=jt[Y]=jt[we]=jt[wt]=jt[ae]=jt[ve]=jt[Le]=jt[N]=!1;var Ht={};Ht[Me]=Ht[ge]=Ht[le]=Ht[be]=Ht[J]=Ht[re]=Ht[Fe]=Ht[nt]=Ht[At]=Ht[Nt]=Ht[ii]=Ht[Y]=Ht[we]=Ht[wt]=Ht[ae]=Ht[ve]=Ht[Le]=Ht[tt]=Ht[te]=Ht[Re]=Ht[Ue]=Ht[Ct]=!0,Ht[fe]=Ht[Ee]=Ht[N]=!1;var zZ={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},HZ={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},UZ={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},WZ={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},jZ=parseFloat,qZ=parseInt,ZE=typeof Ea=="object"&&Ea&&Ea.Object===Object&&Ea,KZ=typeof self=="object"&&self&&self.Object===Object&&self,Tn=ZE||KZ||Function("return this")(),Tb=e&&!e.nodeType&&e,ra=Tb&&!0&&t&&!t.nodeType&&t,QE=ra&&ra.exports===Tb,Ab=QE&&ZE.process,Vr=function(){try{var j=ra&&ra.require&&ra.require("util").types;return j||Ab&&Ab.binding&&Ab.binding("util")}catch{}}(),NE=Vr&&Vr.isArrayBuffer,e_=Vr&&Vr.isDate,t_=Vr&&Vr.isMap,n_=Vr&&Vr.isRegExp,r_=Vr&&Vr.isSet,o_=Vr&&Vr.isTypedArray;function vr(j,se,Q){switch(Q.length){case 0:return j.call(se);case 1:return j.call(se,Q[0]);case 2:return j.call(se,Q[0],Q[1]);case 3:return j.call(se,Q[0],Q[1],Q[2])}return j.apply(se,Q)}function GZ(j,se,Q,Ae){for(var Qe=-1,_t=j==null?0:j.length;++Qe<_t;){var hn=j[Qe];se(Ae,hn,Q(hn),j)}return Ae}function $r(j,se){for(var Q=-1,Ae=j==null?0:j.length;++Q<Ae&&se(j[Q],Q,j)!==!1;);return j}function XZ(j,se){for(var Q=j==null?0:j.length;Q--&&se(j[Q],Q,j)!==!1;);return j}function i_(j,se){for(var Q=-1,Ae=j==null?0:j.length;++Q<Ae;)if(!se(j[Q],Q,j))return!1;return!0}function is(j,se){for(var Q=-1,Ae=j==null?0:j.length,Qe=0,_t=[];++Q<Ae;){var hn=j[Q];se(hn,Q,j)&&(_t[Qe++]=hn)}return _t}function $p(j,se){var Q=j==null?0:j.length;return!!Q&&_l(j,se,0)>-1}function Ob(j,se,Q){for(var Ae=-1,Qe=j==null?0:j.length;++Ae<Qe;)if(Q(se,j[Ae]))return!0;return!1}function Xt(j,se){for(var Q=-1,Ae=j==null?0:j.length,Qe=Array(Ae);++Q<Ae;)Qe[Q]=se(j[Q],Q,j);return Qe}function ss(j,se){for(var Q=-1,Ae=se.length,Qe=j.length;++Q<Ae;)j[Qe+Q]=se[Q];return j}function Mb(j,se,Q,Ae){var Qe=-1,_t=j==null?0:j.length;for(Ae&&_t&&(Q=j[++Qe]);++Qe<_t;)Q=se(Q,j[Qe],Qe,j);return Q}function JZ(j,se,Q,Ae){var Qe=j==null?0:j.length;for(Ae&&Qe&&(Q=j[--Qe]);Qe--;)Q=se(Q,j[Qe],Qe,j);return Q}function Bb(j,se){for(var Q=-1,Ae=j==null?0:j.length;++Q<Ae;)if(se(j[Q],Q,j))return!0;return!1}var YZ=Rb("length");function ZZ(j){return j.split("")}function QZ(j){return j.match(sZ)||[]}function s_(j,se,Q){var Ae;return Q(j,function(Qe,_t,hn){if(se(Qe,_t,hn))return Ae=_t,!1}),Ae}function zp(j,se,Q,Ae){for(var Qe=j.length,_t=Q+(Ae?1:-1);Ae?_t--:++_t<Qe;)if(se(j[_t],_t,j))return _t;return-1}function _l(j,se,Q){return se===se?cQ(j,se,Q):zp(j,a_,Q)}function NZ(j,se,Q,Ae){for(var Qe=Q-1,_t=j.length;++Qe<_t;)if(Ae(j[Qe],se))return Qe;return-1}function a_(j){return j!==j}function l_(j,se){var Q=j==null?0:j.length;return Q?Lb(j,se)/Q:oe}function Rb(j){return function(se){return se==null?n:se[j]}}function Ib(j){return function(se){return j==null?n:j[se]}}function u_(j,se,Q,Ae,Qe){return Qe(j,function(_t,hn,$t){Q=Ae?(Ae=!1,_t):se(Q,_t,hn,$t)}),Q}function eQ(j,se){var Q=j.length;for(j.sort(se);Q--;)j[Q]=j[Q].value;return j}function Lb(j,se){for(var Q,Ae=-1,Qe=j.length;++Ae<Qe;){var _t=se(j[Ae]);_t!==n&&(Q=Q===n?_t:Q+_t)}return Q}function Pb(j,se){for(var Q=-1,Ae=Array(j);++Q<j;)Ae[Q]=se(Q);return Ae}function tQ(j,se){return Xt(se,function(Q){return[Q,j[Q]]})}function c_(j){return j&&j.slice(0,h_(j)+1).replace(xb,"")}function yr(j){return function(se){return j(se)}}function Db(j,se){return Xt(se,function(Q){return j[Q]})}function fc(j,se){return j.has(se)}function d_(j,se){for(var Q=-1,Ae=j.length;++Q<Ae&&_l(se,j[Q],0)>-1;);return Q}function f_(j,se){for(var Q=j.length;Q--&&_l(se,j[Q],0)>-1;);return Q}function nQ(j,se){for(var Q=j.length,Ae=0;Q--;)j[Q]===se&&++Ae;return Ae}var rQ=Ib(zZ),oQ=Ib(HZ);function iQ(j){return"\\"+WZ[j]}function sQ(j,se){return j==null?n:j[se]}function Sl(j){return DZ.test(j)}function aQ(j){return FZ.test(j)}function lQ(j){for(var se,Q=[];!(se=j.next()).done;)Q.push(se.value);return Q}function Fb(j){var se=-1,Q=Array(j.size);return j.forEach(function(Ae,Qe){Q[++se]=[Qe,Ae]}),Q}function p_(j,se){return function(Q){return j(se(Q))}}function as(j,se){for(var Q=-1,Ae=j.length,Qe=0,_t=[];++Q<Ae;){var hn=j[Q];(hn===se||hn===f)&&(j[Q]=f,_t[Qe++]=Q)}return _t}function Hp(j){var se=-1,Q=Array(j.size);return j.forEach(function(Ae){Q[++se]=Ae}),Q}function uQ(j){var se=-1,Q=Array(j.size);return j.forEach(function(Ae){Q[++se]=[Ae,Ae]}),Q}function cQ(j,se,Q){for(var Ae=Q-1,Qe=j.length;++Ae<Qe;)if(j[Ae]===se)return Ae;return-1}function dQ(j,se,Q){for(var Ae=Q+1;Ae--;)if(j[Ae]===se)return Ae;return Ae}function kl(j){return Sl(j)?pQ(j):YZ(j)}function lo(j){return Sl(j)?hQ(j):ZZ(j)}function h_(j){for(var se=j.length;se--&&nZ.test(j.charAt(se)););return se}var fQ=Ib(UZ);function pQ(j){for(var se=kb.lastIndex=0;kb.test(j);)++se;return se}function hQ(j){return j.match(kb)||[]}function mQ(j){return j.match(PZ)||[]}var gQ=function j(se){se=se==null?Tn:Tl.defaults(Tn.Object(),se,Tl.pick(Tn,VZ));var Q=se.Array,Ae=se.Date,Qe=se.Error,_t=se.Function,hn=se.Math,$t=se.Object,Vb=se.RegExp,bQ=se.String,zr=se.TypeError,Up=Q.prototype,vQ=_t.prototype,Al=$t.prototype,Wp=se["__core-js_shared__"],jp=vQ.toString,Ot=Al.hasOwnProperty,yQ=0,m_=function(){var d=/[^.]+$/.exec(Wp&&Wp.keys&&Wp.keys.IE_PROTO||"");return d?"Symbol(src)_1."+d:""}(),qp=Al.toString,wQ=jp.call($t),xQ=Tn._,CQ=Vb("^"+jp.call(Ot).replace(wb,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Kp=QE?se.Buffer:n,ls=se.Symbol,Gp=se.Uint8Array,g_=Kp?Kp.allocUnsafe:n,Xp=p_($t.getPrototypeOf,$t),b_=$t.create,v_=Al.propertyIsEnumerable,Jp=Up.splice,y_=ls?ls.isConcatSpreadable:n,pc=ls?ls.iterator:n,oa=ls?ls.toStringTag:n,Yp=function(){try{var d=ua($t,"defineProperty");return d({},"",{}),d}catch{}}(),EQ=se.clearTimeout!==Tn.clearTimeout&&se.clearTimeout,_Q=Ae&&Ae.now!==Tn.Date.now&&Ae.now,SQ=se.setTimeout!==Tn.setTimeout&&se.setTimeout,Zp=hn.ceil,Qp=hn.floor,$b=$t.getOwnPropertySymbols,kQ=Kp?Kp.isBuffer:n,w_=se.isFinite,TQ=Up.join,AQ=p_($t.keys,$t),mn=hn.max,Fn=hn.min,OQ=Ae.now,MQ=se.parseInt,x_=hn.random,BQ=Up.reverse,zb=ua(se,"DataView"),hc=ua(se,"Map"),Hb=ua(se,"Promise"),Ol=ua(se,"Set"),mc=ua(se,"WeakMap"),gc=ua($t,"create"),Np=mc&&new mc,Ml={},RQ=ca(zb),IQ=ca(hc),LQ=ca(Hb),PQ=ca(Ol),DQ=ca(mc),eh=ls?ls.prototype:n,bc=eh?eh.valueOf:n,C_=eh?eh.toString:n;function M(d){if(on(d)&&!Ne(d)&&!(d instanceof gt)){if(d instanceof Hr)return d;if(Ot.call(d,"__wrapped__"))return ES(d)}return new Hr(d)}var Bl=function(){function d(){}return function(p){if(!en(p))return{};if(b_)return b_(p);d.prototype=p;var v=new d;return d.prototype=n,v}}();function th(){}function Hr(d,p){this.__wrapped__=d,this.__actions__=[],this.__chain__=!!p,this.__index__=0,this.__values__=n}M.templateSettings={escape:xl,evaluate:rs,interpolate:Pp,variable:"",imports:{_:M}},M.prototype=th.prototype,M.prototype.constructor=M,Hr.prototype=Bl(th.prototype),Hr.prototype.constructor=Hr;function gt(d){this.__wrapped__=d,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=ne,this.__views__=[]}function FQ(){var d=new gt(this.__wrapped__);return d.__actions__=ir(this.__actions__),d.__dir__=this.__dir__,d.__filtered__=this.__filtered__,d.__iteratees__=ir(this.__iteratees__),d.__takeCount__=this.__takeCount__,d.__views__=ir(this.__views__),d}function VQ(){if(this.__filtered__){var d=new gt(this);d.__dir__=-1,d.__filtered__=!0}else d=this.clone(),d.__dir__*=-1;return d}function $Q(){var d=this.__wrapped__.value(),p=this.__dir__,v=Ne(d),E=p<0,O=v?d.length:0,R=ZN(0,O,this.__views__),F=R.start,H=R.end,X=H-F,ce=E?H:F-1,de=this.__iteratees__,he=de.length,ke=0,De=Fn(X,this.__takeCount__);if(!v||!E&&O==X&&De==X)return K_(d,this.__actions__);var qe=[];e:for(;X--&&ke<De;){ce+=p;for(var ut=-1,Ke=d[ce];++ut<he;){var pt=de[ut],vt=pt.iteratee,Cr=pt.type,Jn=vt(Ke);if(Cr==z)Ke=Jn;else if(!Jn){if(Cr==me)continue e;break e}}qe[ke++]=Ke}return qe}gt.prototype=Bl(th.prototype),gt.prototype.constructor=gt;function ia(d){var p=-1,v=d==null?0:d.length;for(this.clear();++p<v;){var E=d[p];this.set(E[0],E[1])}}function zQ(){this.__data__=gc?gc(null):{},this.size=0}function HQ(d){var p=this.has(d)&&delete this.__data__[d];return this.size-=p?1:0,p}function UQ(d){var p=this.__data__;if(gc){var v=p[d];return v===u?n:v}return Ot.call(p,d)?p[d]:n}function WQ(d){var p=this.__data__;return gc?p[d]!==n:Ot.call(p,d)}function jQ(d,p){var v=this.__data__;return this.size+=this.has(d)?0:1,v[d]=gc&&p===n?u:p,this}ia.prototype.clear=zQ,ia.prototype.delete=HQ,ia.prototype.get=UQ,ia.prototype.has=WQ,ia.prototype.set=jQ;function li(d){var p=-1,v=d==null?0:d.length;for(this.clear();++p<v;){var E=d[p];this.set(E[0],E[1])}}function qQ(){this.__data__=[],this.size=0}function KQ(d){var p=this.__data__,v=nh(p,d);if(v<0)return!1;var E=p.length-1;return v==E?p.pop():Jp.call(p,v,1),--this.size,!0}function GQ(d){var p=this.__data__,v=nh(p,d);return v<0?n:p[v][1]}function XQ(d){return nh(this.__data__,d)>-1}function JQ(d,p){var v=this.__data__,E=nh(v,d);return E<0?(++this.size,v.push([d,p])):v[E][1]=p,this}li.prototype.clear=qQ,li.prototype.delete=KQ,li.prototype.get=GQ,li.prototype.has=XQ,li.prototype.set=JQ;function ui(d){var p=-1,v=d==null?0:d.length;for(this.clear();++p<v;){var E=d[p];this.set(E[0],E[1])}}function YQ(){this.size=0,this.__data__={hash:new ia,map:new(hc||li),string:new ia}}function ZQ(d){var p=hh(this,d).delete(d);return this.size-=p?1:0,p}function QQ(d){return hh(this,d).get(d)}function NQ(d){return hh(this,d).has(d)}function eN(d,p){var v=hh(this,d),E=v.size;return v.set(d,p),this.size+=v.size==E?0:1,this}ui.prototype.clear=YQ,ui.prototype.delete=ZQ,ui.prototype.get=QQ,ui.prototype.has=NQ,ui.prototype.set=eN;function sa(d){var p=-1,v=d==null?0:d.length;for(this.__data__=new ui;++p<v;)this.add(d[p])}function tN(d){return this.__data__.set(d,u),this}function nN(d){return this.__data__.has(d)}sa.prototype.add=sa.prototype.push=tN,sa.prototype.has=nN;function uo(d){var p=this.__data__=new li(d);this.size=p.size}function rN(){this.__data__=new li,this.size=0}function oN(d){var p=this.__data__,v=p.delete(d);return this.size=p.size,v}function iN(d){return this.__data__.get(d)}function sN(d){return this.__data__.has(d)}function aN(d,p){var v=this.__data__;if(v instanceof li){var E=v.__data__;if(!hc||E.length<o-1)return E.push([d,p]),this.size=++v.size,this;v=this.__data__=new ui(E)}return v.set(d,p),this.size=v.size,this}uo.prototype.clear=rN,uo.prototype.delete=oN,uo.prototype.get=iN,uo.prototype.has=sN,uo.prototype.set=aN;function E_(d,p){var v=Ne(d),E=!v&&da(d),O=!v&&!E&&ps(d),R=!v&&!E&&!O&&Pl(d),F=v||E||O||R,H=F?Pb(d.length,bQ):[],X=H.length;for(var ce in d)(p||Ot.call(d,ce))&&!(F&&(ce=="length"||O&&(ce=="offset"||ce=="parent")||R&&(ce=="buffer"||ce=="byteLength"||ce=="byteOffset")||pi(ce,X)))&&H.push(ce);return H}function __(d){var p=d.length;return p?d[Qb(0,p-1)]:n}function lN(d,p){return mh(ir(d),aa(p,0,d.length))}function uN(d){return mh(ir(d))}function Ub(d,p,v){(v!==n&&!co(d[p],v)||v===n&&!(p in d))&&ci(d,p,v)}function vc(d,p,v){var E=d[p];(!(Ot.call(d,p)&&co(E,v))||v===n&&!(p in d))&&ci(d,p,v)}function nh(d,p){for(var v=d.length;v--;)if(co(d[v][0],p))return v;return-1}function cN(d,p,v,E){return us(d,function(O,R,F){p(E,O,v(O),F)}),E}function S_(d,p){return d&&Io(p,xn(p),d)}function dN(d,p){return d&&Io(p,ar(p),d)}function ci(d,p,v){p=="__proto__"&&Yp?Yp(d,p,{configurable:!0,enumerable:!0,value:v,writable:!0}):d[p]=v}function Wb(d,p){for(var v=-1,E=p.length,O=Q(E),R=d==null;++v<E;)O[v]=R?n:E2(d,p[v]);return O}function aa(d,p,v){return d===d&&(v!==n&&(d=d<=v?d:v),p!==n&&(d=d>=p?d:p)),d}function Ur(d,p,v,E,O,R){var F,H=p&h,X=p&m,ce=p&g;if(v&&(F=O?v(d,E,O,R):v(d)),F!==n)return F;if(!en(d))return d;var de=Ne(d);if(de){if(F=NN(d),!H)return ir(d,F)}else{var he=Vn(d),ke=he==Ee||he==Oe;if(ps(d))return J_(d,H);if(he==wt||he==Me||ke&&!O){if(F=X||ke?{}:hS(d),!H)return X?UN(d,dN(F,d)):HN(d,S_(F,d))}else{if(!Ht[he])return O?d:{};F=eee(d,he,H)}}R||(R=new uo);var De=R.get(d);if(De)return De;R.set(d,F),WS(d)?d.forEach(function(Ke){F.add(Ur(Ke,p,v,Ke,d,R))}):HS(d)&&d.forEach(function(Ke,pt){F.set(pt,Ur(Ke,p,v,pt,d,R))});var qe=ce?X?u2:l2:X?ar:xn,ut=de?n:qe(d);return $r(ut||d,function(Ke,pt){ut&&(pt=Ke,Ke=d[pt]),vc(F,pt,Ur(Ke,p,v,pt,d,R))}),F}function fN(d){var p=xn(d);return function(v){return k_(v,d,p)}}function k_(d,p,v){var E=v.length;if(d==null)return!E;for(d=$t(d);E--;){var O=v[E],R=p[O],F=d[O];if(F===n&&!(O in d)||!R(F))return!1}return!0}function T_(d,p,v){if(typeof d!="function")throw new zr(a);return Sc(function(){d.apply(n,v)},p)}function yc(d,p,v,E){var O=-1,R=$p,F=!0,H=d.length,X=[],ce=p.length;if(!H)return X;v&&(p=Xt(p,yr(v))),E?(R=Ob,F=!1):p.length>=o&&(R=fc,F=!1,p=new sa(p));e:for(;++O<H;){var de=d[O],he=v==null?de:v(de);if(de=E||de!==0?de:0,F&&he===he){for(var ke=ce;ke--;)if(p[ke]===he)continue e;X.push(de)}else R(p,he,E)||X.push(de)}return X}var us=eS(Ro),A_=eS(qb,!0);function pN(d,p){var v=!0;return us(d,function(E,O,R){return v=!!p(E,O,R),v}),v}function rh(d,p,v){for(var E=-1,O=d.length;++E<O;){var R=d[E],F=p(R);if(F!=null&&(H===n?F===F&&!xr(F):v(F,H)))var H=F,X=R}return X}function hN(d,p,v,E){var O=d.length;for(v=ot(v),v<0&&(v=-v>O?0:O+v),E=E===n||E>O?O:ot(E),E<0&&(E+=O),E=v>E?0:qS(E);v<E;)d[v++]=p;return d}function O_(d,p){var v=[];return us(d,function(E,O,R){p(E,O,R)&&v.push(E)}),v}function An(d,p,v,E,O){var R=-1,F=d.length;for(v||(v=nee),O||(O=[]);++R<F;){var H=d[R];p>0&&v(H)?p>1?An(H,p-1,v,E,O):ss(O,H):E||(O[O.length]=H)}return O}var jb=tS(),M_=tS(!0);function Ro(d,p){return d&&jb(d,p,xn)}function qb(d,p){return d&&M_(d,p,xn)}function oh(d,p){return is(p,function(v){return hi(d[v])})}function la(d,p){p=ds(p,d);for(var v=0,E=p.length;d!=null&&v<E;)d=d[Lo(p[v++])];return v&&v==E?d:n}function B_(d,p,v){var E=p(d);return Ne(d)?E:ss(E,v(d))}function Gn(d){return d==null?d===n?He:ze:oa&&oa in $t(d)?YN(d):uee(d)}function Kb(d,p){return d>p}function mN(d,p){return d!=null&&Ot.call(d,p)}function gN(d,p){return d!=null&&p in $t(d)}function bN(d,p,v){return d>=Fn(p,v)&&d<mn(p,v)}function Gb(d,p,v){for(var E=v?Ob:$p,O=d[0].length,R=d.length,F=R,H=Q(R),X=1/0,ce=[];F--;){var de=d[F];F&&p&&(de=Xt(de,yr(p))),X=Fn(de.length,X),H[F]=!v&&(p||O>=120&&de.length>=120)?new sa(F&&de):n}de=d[0];var he=-1,ke=H[0];e:for(;++he<O&&ce.length<X;){var De=de[he],qe=p?p(De):De;if(De=v||De!==0?De:0,!(ke?fc(ke,qe):E(ce,qe,v))){for(F=R;--F;){var ut=H[F];if(!(ut?fc(ut,qe):E(d[F],qe,v)))continue e}ke&&ke.push(qe),ce.push(De)}}return ce}function vN(d,p,v,E){return Ro(d,function(O,R,F){p(E,v(O),R,F)}),E}function wc(d,p,v){p=ds(p,d),d=vS(d,p);var E=d==null?d:d[Lo(jr(p))];return E==null?n:vr(E,d,v)}function R_(d){return on(d)&&Gn(d)==Me}function yN(d){return on(d)&&Gn(d)==le}function wN(d){return on(d)&&Gn(d)==re}function xc(d,p,v,E,O){return d===p?!0:d==null||p==null||!on(d)&&!on(p)?d!==d&&p!==p:xN(d,p,v,E,xc,O)}function xN(d,p,v,E,O,R){var F=Ne(d),H=Ne(p),X=F?ge:Vn(d),ce=H?ge:Vn(p);X=X==Me?wt:X,ce=ce==Me?wt:ce;var de=X==wt,he=ce==wt,ke=X==ce;if(ke&&ps(d)){if(!ps(p))return!1;F=!0,de=!1}if(ke&&!de)return R||(R=new uo),F||Pl(d)?dS(d,p,v,E,O,R):XN(d,p,X,v,E,O,R);if(!(v&b)){var De=de&&Ot.call(d,"__wrapped__"),qe=he&&Ot.call(p,"__wrapped__");if(De||qe){var ut=De?d.value():d,Ke=qe?p.value():p;return R||(R=new uo),O(ut,Ke,v,E,R)}}return ke?(R||(R=new uo),JN(d,p,v,E,O,R)):!1}function CN(d){return on(d)&&Vn(d)==Y}function Xb(d,p,v,E){var O=v.length,R=O,F=!E;if(d==null)return!R;for(d=$t(d);O--;){var H=v[O];if(F&&H[2]?H[1]!==d[H[0]]:!(H[0]in d))return!1}for(;++O<R;){H=v[O];var X=H[0],ce=d[X],de=H[1];if(F&&H[2]){if(ce===n&&!(X in d))return!1}else{var he=new uo;if(E)var ke=E(ce,de,X,d,p,he);if(!(ke===n?xc(de,ce,b|y,E,he):ke))return!1}}return!0}function I_(d){if(!en(d)||oee(d))return!1;var p=hi(d)?CQ:fZ;return p.test(ca(d))}function EN(d){return on(d)&&Gn(d)==ae}function _N(d){return on(d)&&Vn(d)==ve}function SN(d){return on(d)&&xh(d.length)&&!!jt[Gn(d)]}function L_(d){return typeof d=="function"?d:d==null?lr:typeof d=="object"?Ne(d)?F_(d[0],d[1]):D_(d):nk(d)}function Jb(d){if(!_c(d))return AQ(d);var p=[];for(var v in $t(d))Ot.call(d,v)&&v!="constructor"&&p.push(v);return p}function kN(d){if(!en(d))return lee(d);var p=_c(d),v=[];for(var E in d)E=="constructor"&&(p||!Ot.call(d,E))||v.push(E);return v}function Yb(d,p){return d<p}function P_(d,p){var v=-1,E=sr(d)?Q(d.length):[];return us(d,function(O,R,F){E[++v]=p(O,R,F)}),E}function D_(d){var p=d2(d);return p.length==1&&p[0][2]?gS(p[0][0],p[0][1]):function(v){return v===d||Xb(v,d,p)}}function F_(d,p){return p2(d)&&mS(p)?gS(Lo(d),p):function(v){var E=E2(v,d);return E===n&&E===p?_2(v,d):xc(p,E,b|y)}}function ih(d,p,v,E,O){d!==p&&jb(p,function(R,F){if(O||(O=new uo),en(R))TN(d,p,F,v,ih,E,O);else{var H=E?E(m2(d,F),R,F+"",d,p,O):n;H===n&&(H=R),Ub(d,F,H)}},ar)}function TN(d,p,v,E,O,R,F){var H=m2(d,v),X=m2(p,v),ce=F.get(X);if(ce){Ub(d,v,ce);return}var de=R?R(H,X,v+"",d,p,F):n,he=de===n;if(he){var ke=Ne(X),De=!ke&&ps(X),qe=!ke&&!De&&Pl(X);de=X,ke||De||qe?Ne(H)?de=H:ln(H)?de=ir(H):De?(he=!1,de=J_(X,!0)):qe?(he=!1,de=Y_(X,!0)):de=[]:kc(X)||da(X)?(de=H,da(H)?de=KS(H):(!en(H)||hi(H))&&(de=hS(X))):he=!1}he&&(F.set(X,de),O(de,X,E,R,F),F.delete(X)),Ub(d,v,de)}function V_(d,p){var v=d.length;if(v)return p+=p<0?v:0,pi(p,v)?d[p]:n}function $_(d,p,v){p.length?p=Xt(p,function(R){return Ne(R)?function(F){return la(F,R.length===1?R[0]:R)}:R}):p=[lr];var E=-1;p=Xt(p,yr(We()));var O=P_(d,function(R,F,H){var X=Xt(p,function(ce){return ce(R)});return{criteria:X,index:++E,value:R}});return eQ(O,function(R,F){return zN(R,F,v)})}function AN(d,p){return z_(d,p,function(v,E){return _2(d,E)})}function z_(d,p,v){for(var E=-1,O=p.length,R={};++E<O;){var F=p[E],H=la(d,F);v(H,F)&&Cc(R,ds(F,d),H)}return R}function ON(d){return function(p){return la(p,d)}}function Zb(d,p,v,E){var O=E?NZ:_l,R=-1,F=p.length,H=d;for(d===p&&(p=ir(p)),v&&(H=Xt(d,yr(v)));++R<F;)for(var X=0,ce=p[R],de=v?v(ce):ce;(X=O(H,de,X,E))>-1;)H!==d&&Jp.call(H,X,1),Jp.call(d,X,1);return d}function H_(d,p){for(var v=d?p.length:0,E=v-1;v--;){var O=p[v];if(v==E||O!==R){var R=O;pi(O)?Jp.call(d,O,1):t2(d,O)}}return d}function Qb(d,p){return d+Qp(x_()*(p-d+1))}function MN(d,p,v,E){for(var O=-1,R=mn(Zp((p-d)/(v||1)),0),F=Q(R);R--;)F[E?R:++O]=d,d+=v;return F}function Nb(d,p){var v="";if(!d||p<1||p>G)return v;do p%2&&(v+=d),p=Qp(p/2),p&&(d+=d);while(p);return v}function ct(d,p){return g2(bS(d,p,lr),d+"")}function BN(d){return __(Dl(d))}function RN(d,p){var v=Dl(d);return mh(v,aa(p,0,v.length))}function Cc(d,p,v,E){if(!en(d))return d;p=ds(p,d);for(var O=-1,R=p.length,F=R-1,H=d;H!=null&&++O<R;){var X=Lo(p[O]),ce=v;if(X==="__proto__"||X==="constructor"||X==="prototype")return d;if(O!=F){var de=H[X];ce=E?E(de,X,H):n,ce===n&&(ce=en(de)?de:pi(p[O+1])?[]:{})}vc(H,X,ce),H=H[X]}return d}var U_=Np?function(d,p){return Np.set(d,p),d}:lr,IN=Yp?function(d,p){return Yp(d,"toString",{configurable:!0,enumerable:!1,value:k2(p),writable:!0})}:lr;function LN(d){return mh(Dl(d))}function Wr(d,p,v){var E=-1,O=d.length;p<0&&(p=-p>O?0:O+p),v=v>O?O:v,v<0&&(v+=O),O=p>v?0:v-p>>>0,p>>>=0;for(var R=Q(O);++E<O;)R[E]=d[E+p];return R}function PN(d,p){var v;return us(d,function(E,O,R){return v=p(E,O,R),!v}),!!v}function sh(d,p,v){var E=0,O=d==null?E:d.length;if(typeof p=="number"&&p===p&&O<=_e){for(;E<O;){var R=E+O>>>1,F=d[R];F!==null&&!xr(F)&&(v?F<=p:F<p)?E=R+1:O=R}return O}return e2(d,p,lr,v)}function e2(d,p,v,E){var O=0,R=d==null?0:d.length;if(R===0)return 0;p=v(p);for(var F=p!==p,H=p===null,X=xr(p),ce=p===n;O<R;){var de=Qp((O+R)/2),he=v(d[de]),ke=he!==n,De=he===null,qe=he===he,ut=xr(he);if(F)var Ke=E||qe;else ce?Ke=qe&&(E||ke):H?Ke=qe&&ke&&(E||!De):X?Ke=qe&&ke&&!De&&(E||!ut):De||ut?Ke=!1:Ke=E?he<=p:he<p;Ke?O=de+1:R=de}return Fn(R,Ce)}function W_(d,p){for(var v=-1,E=d.length,O=0,R=[];++v<E;){var F=d[v],H=p?p(F):F;if(!v||!co(H,X)){var X=H;R[O++]=F===0?0:F}}return R}function j_(d){return typeof d=="number"?d:xr(d)?oe:+d}function wr(d){if(typeof d=="string")return d;if(Ne(d))return Xt(d,wr)+"";if(xr(d))return C_?C_.call(d):"";var p=d+"";return p=="0"&&1/d==-1/0?"-0":p}function cs(d,p,v){var E=-1,O=$p,R=d.length,F=!0,H=[],X=H;if(v)F=!1,O=Ob;else if(R>=o){var ce=p?null:KN(d);if(ce)return Hp(ce);F=!1,O=fc,X=new sa}else X=p?[]:H;e:for(;++E<R;){var de=d[E],he=p?p(de):de;if(de=v||de!==0?de:0,F&&he===he){for(var ke=X.length;ke--;)if(X[ke]===he)continue e;p&&X.push(he),H.push(de)}else O(X,he,v)||(X!==H&&X.push(he),H.push(de))}return H}function t2(d,p){return p=ds(p,d),d=vS(d,p),d==null||delete d[Lo(jr(p))]}function q_(d,p,v,E){return Cc(d,p,v(la(d,p)),E)}function ah(d,p,v,E){for(var O=d.length,R=E?O:-1;(E?R--:++R<O)&&p(d[R],R,d););return v?Wr(d,E?0:R,E?R+1:O):Wr(d,E?R+1:0,E?O:R)}function K_(d,p){var v=d;return v instanceof gt&&(v=v.value()),Mb(p,function(E,O){return O.func.apply(O.thisArg,ss([E],O.args))},v)}function n2(d,p,v){var E=d.length;if(E<2)return E?cs(d[0]):[];for(var O=-1,R=Q(E);++O<E;)for(var F=d[O],H=-1;++H<E;)H!=O&&(R[O]=yc(R[O]||F,d[H],p,v));return cs(An(R,1),p,v)}function G_(d,p,v){for(var E=-1,O=d.length,R=p.length,F={};++E<O;){var H=E<R?p[E]:n;v(F,d[E],H)}return F}function r2(d){return ln(d)?d:[]}function o2(d){return typeof d=="function"?d:lr}function ds(d,p){return Ne(d)?d:p2(d,p)?[d]:CS(Tt(d))}var DN=ct;function fs(d,p,v){var E=d.length;return v=v===n?E:v,!p&&v>=E?d:Wr(d,p,v)}var X_=EQ||function(d){return Tn.clearTimeout(d)};function J_(d,p){if(p)return d.slice();var v=d.length,E=g_?g_(v):new d.constructor(v);return d.copy(E),E}function i2(d){var p=new d.constructor(d.byteLength);return new Gp(p).set(new Gp(d)),p}function FN(d,p){var v=p?i2(d.buffer):d.buffer;return new d.constructor(v,d.byteOffset,d.byteLength)}function VN(d){var p=new d.constructor(d.source,RE.exec(d));return p.lastIndex=d.lastIndex,p}function $N(d){return bc?$t(bc.call(d)):{}}function Y_(d,p){var v=p?i2(d.buffer):d.buffer;return new d.constructor(v,d.byteOffset,d.length)}function Z_(d,p){if(d!==p){var v=d!==n,E=d===null,O=d===d,R=xr(d),F=p!==n,H=p===null,X=p===p,ce=xr(p);if(!H&&!ce&&!R&&d>p||R&&F&&X&&!H&&!ce||E&&F&&X||!v&&X||!O)return 1;if(!E&&!R&&!ce&&d<p||ce&&v&&O&&!E&&!R||H&&v&&O||!F&&O||!X)return-1}return 0}function zN(d,p,v){for(var E=-1,O=d.criteria,R=p.criteria,F=O.length,H=v.length;++E<F;){var X=Z_(O[E],R[E]);if(X){if(E>=H)return X;var ce=v[E];return X*(ce=="desc"?-1:1)}}return d.index-p.index}function Q_(d,p,v,E){for(var O=-1,R=d.length,F=v.length,H=-1,X=p.length,ce=mn(R-F,0),de=Q(X+ce),he=!E;++H<X;)de[H]=p[H];for(;++O<F;)(he||O<R)&&(de[v[O]]=d[O]);for(;ce--;)de[H++]=d[O++];return de}function N_(d,p,v,E){for(var O=-1,R=d.length,F=-1,H=v.length,X=-1,ce=p.length,de=mn(R-H,0),he=Q(de+ce),ke=!E;++O<de;)he[O]=d[O];for(var De=O;++X<ce;)he[De+X]=p[X];for(;++F<H;)(ke||O<R)&&(he[De+v[F]]=d[O++]);return he}function ir(d,p){var v=-1,E=d.length;for(p||(p=Q(E));++v<E;)p[v]=d[v];return p}function Io(d,p,v,E){var O=!v;v||(v={});for(var R=-1,F=p.length;++R<F;){var H=p[R],X=E?E(v[H],d[H],H,v,d):n;X===n&&(X=d[H]),O?ci(v,H,X):vc(v,H,X)}return v}function HN(d,p){return Io(d,f2(d),p)}function UN(d,p){return Io(d,fS(d),p)}function lh(d,p){return function(v,E){var O=Ne(v)?GZ:cN,R=p?p():{};return O(v,d,We(E,2),R)}}function Rl(d){return ct(function(p,v){var E=-1,O=v.length,R=O>1?v[O-1]:n,F=O>2?v[2]:n;for(R=d.length>3&&typeof R=="function"?(O--,R):n,F&&Xn(v[0],v[1],F)&&(R=O<3?n:R,O=1),p=$t(p);++E<O;){var H=v[E];H&&d(p,H,E,R)}return p})}function eS(d,p){return function(v,E){if(v==null)return v;if(!sr(v))return d(v,E);for(var O=v.length,R=p?O:-1,F=$t(v);(p?R--:++R<O)&&E(F[R],R,F)!==!1;);return v}}function tS(d){return function(p,v,E){for(var O=-1,R=$t(p),F=E(p),H=F.length;H--;){var X=F[d?H:++O];if(v(R[X],X,R)===!1)break}return p}}function WN(d,p,v){var E=p&w,O=Ec(d);function R(){var F=this&&this!==Tn&&this instanceof R?O:d;return F.apply(E?v:this,arguments)}return R}function nS(d){return function(p){p=Tt(p);var v=Sl(p)?lo(p):n,E=v?v[0]:p.charAt(0),O=v?fs(v,1).join(""):p.slice(1);return E[d]()+O}}function Il(d){return function(p){return Mb(ek(NS(p).replace(IZ,"")),d,"")}}function Ec(d){return function(){var p=arguments;switch(p.length){case 0:return new d;case 1:return new d(p[0]);case 2:return new d(p[0],p[1]);case 3:return new d(p[0],p[1],p[2]);case 4:return new d(p[0],p[1],p[2],p[3]);case 5:return new d(p[0],p[1],p[2],p[3],p[4]);case 6:return new d(p[0],p[1],p[2],p[3],p[4],p[5]);case 7:return new d(p[0],p[1],p[2],p[3],p[4],p[5],p[6])}var v=Bl(d.prototype),E=d.apply(v,p);return en(E)?E:v}}function jN(d,p,v){var E=Ec(d);function O(){for(var R=arguments.length,F=Q(R),H=R,X=Ll(O);H--;)F[H]=arguments[H];var ce=R<3&&F[0]!==X&&F[R-1]!==X?[]:as(F,X);if(R-=ce.length,R<v)return aS(d,p,uh,O.placeholder,n,F,ce,n,n,v-R);var de=this&&this!==Tn&&this instanceof O?E:d;return vr(de,this,F)}return O}function rS(d){return function(p,v,E){var O=$t(p);if(!sr(p)){var R=We(v,3);p=xn(p),v=function(H){return R(O[H],H,O)}}var F=d(p,v,E);return F>-1?O[R?p[F]:F]:n}}function oS(d){return fi(function(p){var v=p.length,E=v,O=Hr.prototype.thru;for(d&&p.reverse();E--;){var R=p[E];if(typeof R!="function")throw new zr(a);if(O&&!F&&ph(R)=="wrapper")var F=new Hr([],!0)}for(E=F?E:v;++E<v;){R=p[E];var H=ph(R),X=H=="wrapper"?c2(R):n;X&&h2(X[0])&&X[1]==(T|S|k|B)&&!X[4].length&&X[9]==1?F=F[ph(X[0])].apply(F,X[3]):F=R.length==1&&h2(R)?F[H]():F.thru(R)}return function(){var ce=arguments,de=ce[0];if(F&&ce.length==1&&Ne(de))return F.plant(de).value();for(var he=0,ke=v?p[he].apply(this,ce):de;++he<v;)ke=p[he].call(this,ke);return ke}})}function uh(d,p,v,E,O,R,F,H,X,ce){var de=p&T,he=p&w,ke=p&x,De=p&(S|C),qe=p&L,ut=ke?n:Ec(d);function Ke(){for(var pt=arguments.length,vt=Q(pt),Cr=pt;Cr--;)vt[Cr]=arguments[Cr];if(De)var Jn=Ll(Ke),Er=nQ(vt,Jn);if(E&&(vt=Q_(vt,E,O,De)),R&&(vt=N_(vt,R,F,De)),pt-=Er,De&&pt<ce){var un=as(vt,Jn);return aS(d,p,uh,Ke.placeholder,v,vt,un,H,X,ce-pt)}var fo=he?v:this,gi=ke?fo[d]:d;return pt=vt.length,H?vt=cee(vt,H):qe&&pt>1&&vt.reverse(),de&&X<pt&&(vt.length=X),this&&this!==Tn&&this instanceof Ke&&(gi=ut||Ec(gi)),gi.apply(fo,vt)}return Ke}function iS(d,p){return function(v,E){return vN(v,d,p(E),{})}}function ch(d,p){return function(v,E){var O;if(v===n&&E===n)return p;if(v!==n&&(O=v),E!==n){if(O===n)return E;typeof v=="string"||typeof E=="string"?(v=wr(v),E=wr(E)):(v=j_(v),E=j_(E)),O=d(v,E)}return O}}function s2(d){return fi(function(p){return p=Xt(p,yr(We())),ct(function(v){var E=this;return d(p,function(O){return vr(O,E,v)})})})}function dh(d,p){p=p===n?" ":wr(p);var v=p.length;if(v<2)return v?Nb(p,d):p;var E=Nb(p,Zp(d/kl(p)));return Sl(p)?fs(lo(E),0,d).join(""):E.slice(0,d)}function qN(d,p,v,E){var O=p&w,R=Ec(d);function F(){for(var H=-1,X=arguments.length,ce=-1,de=E.length,he=Q(de+X),ke=this&&this!==Tn&&this instanceof F?R:d;++ce<de;)he[ce]=E[ce];for(;X--;)he[ce++]=arguments[++H];return vr(ke,O?v:this,he)}return F}function sS(d){return function(p,v,E){return E&&typeof E!="number"&&Xn(p,v,E)&&(v=E=n),p=mi(p),v===n?(v=p,p=0):v=mi(v),E=E===n?p<v?1:-1:mi(E),MN(p,v,E,d)}}function fh(d){return function(p,v){return typeof p=="string"&&typeof v=="string"||(p=qr(p),v=qr(v)),d(p,v)}}function aS(d,p,v,E,O,R,F,H,X,ce){var de=p&S,he=de?F:n,ke=de?n:F,De=de?R:n,qe=de?n:R;p|=de?k:A,p&=~(de?A:k),p&_||(p&=-4);var ut=[d,p,O,De,he,qe,ke,H,X,ce],Ke=v.apply(n,ut);return h2(d)&&yS(Ke,ut),Ke.placeholder=E,wS(Ke,d,p)}function a2(d){var p=hn[d];return function(v,E){if(v=qr(v),E=E==null?0:Fn(ot(E),292),E&&w_(v)){var O=(Tt(v)+"e").split("e"),R=p(O[0]+"e"+(+O[1]+E));return O=(Tt(R)+"e").split("e"),+(O[0]+"e"+(+O[1]-E))}return p(v)}}var KN=Ol&&1/Hp(new Ol([,-0]))[1]==P?function(d){return new Ol(d)}:O2;function lS(d){return function(p){var v=Vn(p);return v==Y?Fb(p):v==ve?uQ(p):tQ(p,d(p))}}function di(d,p,v,E,O,R,F,H){var X=p&x;if(!X&&typeof d!="function")throw new zr(a);var ce=E?E.length:0;if(ce||(p&=-97,E=O=n),F=F===n?F:mn(ot(F),0),H=H===n?H:ot(H),ce-=O?O.length:0,p&A){var de=E,he=O;E=O=n}var ke=X?n:c2(d),De=[d,p,v,E,O,de,he,R,F,H];if(ke&&aee(De,ke),d=De[0],p=De[1],v=De[2],E=De[3],O=De[4],H=De[9]=De[9]===n?X?0:d.length:mn(De[9]-ce,0),!H&&p&(S|C)&&(p&=-25),!p||p==w)var qe=WN(d,p,v);else p==S||p==C?qe=jN(d,p,H):(p==k||p==(w|k))&&!O.length?qe=qN(d,p,v,E):qe=uh.apply(n,De);var ut=ke?U_:yS;return wS(ut(qe,De),d,p)}function uS(d,p,v,E){return d===n||co(d,Al[v])&&!Ot.call(E,v)?p:d}function cS(d,p,v,E,O,R){return en(d)&&en(p)&&(R.set(p,d),ih(d,p,n,cS,R),R.delete(p)),d}function GN(d){return kc(d)?n:d}function dS(d,p,v,E,O,R){var F=v&b,H=d.length,X=p.length;if(H!=X&&!(F&&X>H))return!1;var ce=R.get(d),de=R.get(p);if(ce&&de)return ce==p&&de==d;var he=-1,ke=!0,De=v&y?new sa:n;for(R.set(d,p),R.set(p,d);++he<H;){var qe=d[he],ut=p[he];if(E)var Ke=F?E(ut,qe,he,p,d,R):E(qe,ut,he,d,p,R);if(Ke!==n){if(Ke)continue;ke=!1;break}if(De){if(!Bb(p,function(pt,vt){if(!fc(De,vt)&&(qe===pt||O(qe,pt,v,E,R)))return De.push(vt)})){ke=!1;break}}else if(!(qe===ut||O(qe,ut,v,E,R))){ke=!1;break}}return R.delete(d),R.delete(p),ke}function XN(d,p,v,E,O,R,F){switch(v){case be:if(d.byteLength!=p.byteLength||d.byteOffset!=p.byteOffset)return!1;d=d.buffer,p=p.buffer;case le:return!(d.byteLength!=p.byteLength||!R(new Gp(d),new Gp(p)));case J:case re:case we:return co(+d,+p);case fe:return d.name==p.name&&d.message==p.message;case ae:case Le:return d==p+"";case Y:var H=Fb;case ve:var X=E&b;if(H||(H=Hp),d.size!=p.size&&!X)return!1;var ce=F.get(d);if(ce)return ce==p;E|=y,F.set(d,p);var de=dS(H(d),H(p),E,O,R,F);return F.delete(d),de;case tt:if(bc)return bc.call(d)==bc.call(p)}return!1}function JN(d,p,v,E,O,R){var F=v&b,H=l2(d),X=H.length,ce=l2(p),de=ce.length;if(X!=de&&!F)return!1;for(var he=X;he--;){var ke=H[he];if(!(F?ke in p:Ot.call(p,ke)))return!1}var De=R.get(d),qe=R.get(p);if(De&&qe)return De==p&&qe==d;var ut=!0;R.set(d,p),R.set(p,d);for(var Ke=F;++he<X;){ke=H[he];var pt=d[ke],vt=p[ke];if(E)var Cr=F?E(vt,pt,ke,p,d,R):E(pt,vt,ke,d,p,R);if(!(Cr===n?pt===vt||O(pt,vt,v,E,R):Cr)){ut=!1;break}Ke||(Ke=ke=="constructor")}if(ut&&!Ke){var Jn=d.constructor,Er=p.constructor;Jn!=Er&&"constructor"in d&&"constructor"in p&&!(typeof Jn=="function"&&Jn instanceof Jn&&typeof Er=="function"&&Er instanceof Er)&&(ut=!1)}return R.delete(d),R.delete(p),ut}function fi(d){return g2(bS(d,n,kS),d+"")}function l2(d){return B_(d,xn,f2)}function u2(d){return B_(d,ar,fS)}var c2=Np?function(d){return Np.get(d)}:O2;function ph(d){for(var p=d.name+"",v=Ml[p],E=Ot.call(Ml,p)?v.length:0;E--;){var O=v[E],R=O.func;if(R==null||R==d)return O.name}return p}function Ll(d){var p=Ot.call(M,"placeholder")?M:d;return p.placeholder}function We(){var d=M.iteratee||T2;return d=d===T2?L_:d,arguments.length?d(arguments[0],arguments[1]):d}function hh(d,p){var v=d.__data__;return ree(p)?v[typeof p=="string"?"string":"hash"]:v.map}function d2(d){for(var p=xn(d),v=p.length;v--;){var E=p[v],O=d[E];p[v]=[E,O,mS(O)]}return p}function ua(d,p){var v=sQ(d,p);return I_(v)?v:n}function YN(d){var p=Ot.call(d,oa),v=d[oa];try{d[oa]=n;var E=!0}catch{}var O=qp.call(d);return E&&(p?d[oa]=v:delete d[oa]),O}var f2=$b?function(d){return d==null?[]:(d=$t(d),is($b(d),function(p){return v_.call(d,p)}))}:M2,fS=$b?function(d){for(var p=[];d;)ss(p,f2(d)),d=Xp(d);return p}:M2,Vn=Gn;(zb&&Vn(new zb(new ArrayBuffer(1)))!=be||hc&&Vn(new hc)!=Y||Hb&&Vn(Hb.resolve())!=$||Ol&&Vn(new Ol)!=ve||mc&&Vn(new mc)!=N)&&(Vn=function(d){var p=Gn(d),v=p==wt?d.constructor:n,E=v?ca(v):"";if(E)switch(E){case RQ:return be;case IQ:return Y;case LQ:return $;case PQ:return ve;case DQ:return N}return p});function ZN(d,p,v){for(var E=-1,O=v.length;++E<O;){var R=v[E],F=R.size;switch(R.type){case"drop":d+=F;break;case"dropRight":p-=F;break;case"take":p=Fn(p,d+F);break;case"takeRight":d=mn(d,p-F);break}}return{start:d,end:p}}function QN(d){var p=d.match(oZ);return p?p[1].split(iZ):[]}function pS(d,p,v){p=ds(p,d);for(var E=-1,O=p.length,R=!1;++E<O;){var F=Lo(p[E]);if(!(R=d!=null&&v(d,F)))break;d=d[F]}return R||++E!=O?R:(O=d==null?0:d.length,!!O&&xh(O)&&pi(F,O)&&(Ne(d)||da(d)))}function NN(d){var p=d.length,v=new d.constructor(p);return p&&typeof d[0]=="string"&&Ot.call(d,"index")&&(v.index=d.index,v.input=d.input),v}function hS(d){return typeof d.constructor=="function"&&!_c(d)?Bl(Xp(d)):{}}function eee(d,p,v){var E=d.constructor;switch(p){case le:return i2(d);case J:case re:return new E(+d);case be:return FN(d,v);case Fe:case nt:case At:case Nt:case ii:case te:case Re:case Ue:case Ct:return Y_(d,v);case Y:return new E;case we:case Le:return new E(d);case ae:return VN(d);case ve:return new E;case tt:return $N(d)}}function tee(d,p){var v=p.length;if(!v)return d;var E=v-1;return p[E]=(v>1?"& ":"")+p[E],p=p.join(v>2?", ":" "),d.replace(rZ,`{
15
15
  /* [wrapped with `+p+`] */
16
- `)}function nee(d){return Ne(d)||da(d)||!!(y_&&d&&d[y_])}function pi(d,p){var v=typeof d;return p=p??G,!!p&&(v=="number"||v!="symbol"&&hZ.test(d))&&d>-1&&d%1==0&&d<p}function Xn(d,p,v){if(!en(v))return!1;var E=typeof p;return(E=="number"?sr(v)&&pi(p,v.length):E=="string"&&p in v)?co(v[p],d):!1}function p2(d,p){if(Ne(d))return!1;var v=typeof d;return v=="number"||v=="symbol"||v=="boolean"||d==null||xr(d)?!0:Cl.test(d)||!dc.test(d)||p!=null&&d in $t(p)}function ree(d){var p=typeof d;return p=="string"||p=="number"||p=="symbol"||p=="boolean"?d!=="__proto__":d===null}function h2(d){var p=ph(d),v=M[p];if(typeof v!="function"||!(p in gt.prototype))return!1;if(d===v)return!0;var E=c2(v);return!!E&&d===E[0]}function oee(d){return!!m_&&m_ in d}var iee=Wp?hi:B2;function _c(d){var p=d&&d.constructor,v=typeof p=="function"&&p.prototype||Al;return d===v}function mS(d){return d===d&&!en(d)}function gS(d,p){return function(v){return v==null?!1:v[d]===p&&(p!==n||d in $t(v))}}function see(d){var p=yh(d,function(E){return v.size===c&&v.clear(),E}),v=p.cache;return p}function aee(d,p){var v=d[1],E=p[1],O=v|E,R=O<(w|x|T),F=E==T&&v==S||E==T&&v==B&&d[7].length<=p[8]||E==(T|B)&&p[7].length<=p[8]&&v==S;if(!(R||F))return d;E&w&&(d[2]=p[2],O|=v&w?0:_);var H=p[3];if(H){var X=d[3];d[3]=X?Q_(X,H,p[4]):H,d[4]=X?as(d[3],f):p[4]}return H=p[5],H&&(X=d[5],d[5]=X?N_(X,H,p[6]):H,d[6]=X?as(d[5],f):p[6]),H=p[7],H&&(d[7]=H),E&T&&(d[8]=d[8]==null?p[8]:Fn(d[8],p[8])),d[9]==null&&(d[9]=p[9]),d[0]=p[0],d[1]=O,d}function lee(d){var p=[];if(d!=null)for(var v in $t(d))p.push(v);return p}function uee(d){return qp.call(d)}function bS(d,p,v){return p=mn(p===n?d.length-1:p,0),function(){for(var E=arguments,O=-1,R=mn(E.length-p,0),F=Q(R);++O<R;)F[O]=E[p+O];O=-1;for(var H=Q(p+1);++O<p;)H[O]=E[O];return H[p]=v(F),vr(d,this,H)}}function vS(d,p){return p.length<2?d:la(d,Wr(p,0,-1))}function cee(d,p){for(var v=d.length,E=Fn(p.length,v),O=ir(d);E--;){var R=p[E];d[E]=pi(R,v)?O[R]:n}return d}function m2(d,p){if(!(p==="constructor"&&typeof d[p]=="function")&&p!="__proto__")return d[p]}var yS=xS(U_),Sc=SQ||function(d,p){return Tn.setTimeout(d,p)},g2=xS(IN);function wS(d,p,v){var E=p+"";return g2(d,tee(E,dee(QN(E),v)))}function xS(d){var p=0,v=0;return function(){var E=OQ(),O=K-(E-v);if(v=E,O>0){if(++p>=q)return arguments[0]}else p=0;return d.apply(n,arguments)}}function mh(d,p){var v=-1,E=d.length,O=E-1;for(p=p===n?E:p;++v<p;){var R=Qb(v,O),F=d[R];d[R]=d[v],d[v]=F}return d.length=p,d}var CS=see(function(d){var p=[];return d.charCodeAt(0)===46&&p.push(""),d.replace(eZ,function(v,E,O,R){p.push(O?R.replace(lZ,"$1"):E||v)}),p});function Lo(d){if(typeof d=="string"||xr(d))return d;var p=d+"";return p=="0"&&1/d==-1/0?"-0":p}function ca(d){if(d!=null){try{return jp.call(d)}catch{}try{return d+""}catch{}}return""}function dee(d,p){return $r(Ge,function(v){var E="_."+v[0];p&v[1]&&!$p(d,E)&&d.push(E)}),d.sort()}function ES(d){if(d instanceof gt)return d.clone();var p=new Hr(d.__wrapped__,d.__chain__);return p.__actions__=ir(d.__actions__),p.__index__=d.__index__,p.__values__=d.__values__,p}function fee(d,p,v){(v?Xn(d,p,v):p===n)?p=1:p=mn(ot(p),0);var E=d==null?0:d.length;if(!E||p<1)return[];for(var O=0,R=0,F=Q(Zp(E/p));O<E;)F[R++]=Wr(d,O,O+=p);return F}function pee(d){for(var p=-1,v=d==null?0:d.length,E=0,O=[];++p<v;){var R=d[p];R&&(O[E++]=R)}return O}function hee(){var d=arguments.length;if(!d)return[];for(var p=Q(d-1),v=arguments[0],E=d;E--;)p[E-1]=arguments[E];return ss(Ne(v)?ir(v):[v],An(p,1))}var mee=ct(function(d,p){return ln(d)?yc(d,An(p,1,ln,!0)):[]}),gee=ct(function(d,p){var v=jr(p);return ln(v)&&(v=n),ln(d)?yc(d,An(p,1,ln,!0),We(v,2)):[]}),bee=ct(function(d,p){var v=jr(p);return ln(v)&&(v=n),ln(d)?yc(d,An(p,1,ln,!0),n,v):[]});function vee(d,p,v){var E=d==null?0:d.length;return E?(p=v||p===n?1:ot(p),Wr(d,p<0?0:p,E)):[]}function yee(d,p,v){var E=d==null?0:d.length;return E?(p=v||p===n?1:ot(p),p=E-p,Wr(d,0,p<0?0:p)):[]}function wee(d,p){return d&&d.length?ah(d,We(p,3),!0,!0):[]}function xee(d,p){return d&&d.length?ah(d,We(p,3),!0):[]}function Cee(d,p,v,E){var O=d==null?0:d.length;return O?(v&&typeof v!="number"&&Xn(d,p,v)&&(v=0,E=O),hN(d,p,v,E)):[]}function _S(d,p,v){var E=d==null?0:d.length;if(!E)return-1;var O=v==null?0:ot(v);return O<0&&(O=mn(E+O,0)),zp(d,We(p,3),O)}function SS(d,p,v){var E=d==null?0:d.length;if(!E)return-1;var O=E-1;return v!==n&&(O=ot(v),O=v<0?mn(E+O,0):Fn(O,E-1)),zp(d,We(p,3),O,!0)}function kS(d){var p=d==null?0:d.length;return p?An(d,1):[]}function Eee(d){var p=d==null?0:d.length;return p?An(d,P):[]}function _ee(d,p){var v=d==null?0:d.length;return v?(p=p===n?1:ot(p),An(d,p)):[]}function See(d){for(var p=-1,v=d==null?0:d.length,E={};++p<v;){var O=d[p];E[O[0]]=O[1]}return E}function TS(d){return d&&d.length?d[0]:n}function kee(d,p,v){var E=d==null?0:d.length;if(!E)return-1;var O=v==null?0:ot(v);return O<0&&(O=mn(E+O,0)),_l(d,p,O)}function Tee(d){var p=d==null?0:d.length;return p?Wr(d,0,-1):[]}var Aee=ct(function(d){var p=Xt(d,r2);return p.length&&p[0]===d[0]?Gb(p):[]}),Oee=ct(function(d){var p=jr(d),v=Xt(d,r2);return p===jr(v)?p=n:v.pop(),v.length&&v[0]===d[0]?Gb(v,We(p,2)):[]}),Mee=ct(function(d){var p=jr(d),v=Xt(d,r2);return p=typeof p=="function"?p:n,p&&v.pop(),v.length&&v[0]===d[0]?Gb(v,n,p):[]});function Bee(d,p){return d==null?"":TQ.call(d,p)}function jr(d){var p=d==null?0:d.length;return p?d[p-1]:n}function Ree(d,p,v){var E=d==null?0:d.length;if(!E)return-1;var O=E;return v!==n&&(O=ot(v),O=O<0?mn(E+O,0):Fn(O,E-1)),p===p?dQ(d,p,O):zp(d,a_,O,!0)}function Iee(d,p){return d&&d.length?V_(d,ot(p)):n}var Lee=ct(AS);function AS(d,p){return d&&d.length&&p&&p.length?Zb(d,p):d}function Pee(d,p,v){return d&&d.length&&p&&p.length?Zb(d,p,We(v,2)):d}function Dee(d,p,v){return d&&d.length&&p&&p.length?Zb(d,p,n,v):d}var Fee=fi(function(d,p){var v=d==null?0:d.length,E=Wb(d,p);return H_(d,Xt(p,function(O){return pi(O,v)?+O:O}).sort(Z_)),E});function Vee(d,p){var v=[];if(!(d&&d.length))return v;var E=-1,O=[],R=d.length;for(p=We(p,3);++E<R;){var F=d[E];p(F,E,d)&&(v.push(F),O.push(E))}return H_(d,O),v}function b2(d){return d==null?d:BQ.call(d)}function $ee(d,p,v){var E=d==null?0:d.length;return E?(v&&typeof v!="number"&&Xn(d,p,v)?(p=0,v=E):(p=p==null?0:ot(p),v=v===n?E:ot(v)),Wr(d,p,v)):[]}function zee(d,p){return sh(d,p)}function Hee(d,p,v){return e2(d,p,We(v,2))}function Uee(d,p){var v=d==null?0:d.length;if(v){var E=sh(d,p);if(E<v&&co(d[E],p))return E}return-1}function Wee(d,p){return sh(d,p,!0)}function jee(d,p,v){return e2(d,p,We(v,2),!0)}function qee(d,p){var v=d==null?0:d.length;if(v){var E=sh(d,p,!0)-1;if(co(d[E],p))return E}return-1}function Kee(d){return d&&d.length?W_(d):[]}function Gee(d,p){return d&&d.length?W_(d,We(p,2)):[]}function Xee(d){var p=d==null?0:d.length;return p?Wr(d,1,p):[]}function Jee(d,p,v){return d&&d.length?(p=v||p===n?1:ot(p),Wr(d,0,p<0?0:p)):[]}function Yee(d,p,v){var E=d==null?0:d.length;return E?(p=v||p===n?1:ot(p),p=E-p,Wr(d,p<0?0:p,E)):[]}function Zee(d,p){return d&&d.length?ah(d,We(p,3),!1,!0):[]}function Qee(d,p){return d&&d.length?ah(d,We(p,3)):[]}var Nee=ct(function(d){return cs(An(d,1,ln,!0))}),ete=ct(function(d){var p=jr(d);return ln(p)&&(p=n),cs(An(d,1,ln,!0),We(p,2))}),tte=ct(function(d){var p=jr(d);return p=typeof p=="function"?p:n,cs(An(d,1,ln,!0),n,p)});function nte(d){return d&&d.length?cs(d):[]}function rte(d,p){return d&&d.length?cs(d,We(p,2)):[]}function ote(d,p){return p=typeof p=="function"?p:n,d&&d.length?cs(d,n,p):[]}function v2(d){if(!(d&&d.length))return[];var p=0;return d=is(d,function(v){if(ln(v))return p=mn(v.length,p),!0}),Pb(p,function(v){return Xt(d,Rb(v))})}function OS(d,p){if(!(d&&d.length))return[];var v=v2(d);return p==null?v:Xt(v,function(E){return vr(p,n,E)})}var ite=ct(function(d,p){return ln(d)?yc(d,p):[]}),ste=ct(function(d){return n2(is(d,ln))}),ate=ct(function(d){var p=jr(d);return ln(p)&&(p=n),n2(is(d,ln),We(p,2))}),lte=ct(function(d){var p=jr(d);return p=typeof p=="function"?p:n,n2(is(d,ln),n,p)}),ute=ct(v2);function cte(d,p){return G_(d||[],p||[],vc)}function dte(d,p){return G_(d||[],p||[],Cc)}var fte=ct(function(d){var p=d.length,v=p>1?d[p-1]:n;return v=typeof v=="function"?(d.pop(),v):n,OS(d,v)});function MS(d){var p=M(d);return p.__chain__=!0,p}function pte(d,p){return p(d),d}function gh(d,p){return p(d)}var hte=fi(function(d){var p=d.length,v=p?d[0]:0,E=this.__wrapped__,O=function(R){return Wb(R,d)};return p>1||this.__actions__.length||!(E instanceof gt)||!pi(v)?this.thru(O):(E=E.slice(v,+v+(p?1:0)),E.__actions__.push({func:gh,args:[O],thisArg:n}),new Hr(E,this.__chain__).thru(function(R){return p&&!R.length&&R.push(n),R}))});function mte(){return MS(this)}function gte(){return new Hr(this.value(),this.__chain__)}function bte(){this.__values__===n&&(this.__values__=jS(this.value()));var d=this.__index__>=this.__values__.length,p=d?n:this.__values__[this.__index__++];return{done:d,value:p}}function vte(){return this}function yte(d){for(var p,v=this;v instanceof th;){var E=ES(v);E.__index__=0,E.__values__=n,p?O.__wrapped__=E:p=E;var O=E;v=v.__wrapped__}return O.__wrapped__=d,p}function wte(){var d=this.__wrapped__;if(d instanceof gt){var p=d;return this.__actions__.length&&(p=new gt(this)),p=p.reverse(),p.__actions__.push({func:gh,args:[b2],thisArg:n}),new Hr(p,this.__chain__)}return this.thru(b2)}function xte(){return K_(this.__wrapped__,this.__actions__)}var Cte=lh(function(d,p,v){Ot.call(d,v)?++d[v]:ci(d,v,1)});function Ete(d,p,v){var E=Ne(d)?i_:pN;return v&&Xn(d,p,v)&&(p=n),E(d,We(p,3))}function _te(d,p){var v=Ne(d)?is:O_;return v(d,We(p,3))}var Ste=rS(_S),kte=rS(SS);function Tte(d,p){return An(bh(d,p),1)}function Ate(d,p){return An(bh(d,p),P)}function Ote(d,p,v){return v=v===n?1:ot(v),An(bh(d,p),v)}function BS(d,p){var v=Ne(d)?$r:us;return v(d,We(p,3))}function RS(d,p){var v=Ne(d)?XZ:A_;return v(d,We(p,3))}var Mte=lh(function(d,p,v){Ot.call(d,v)?d[v].push(p):ci(d,v,[p])});function Bte(d,p,v,E){d=sr(d)?d:Dl(d),v=v&&!E?ot(v):0;var O=d.length;return v<0&&(v=mn(O+v,0)),Ch(d)?v<=O&&d.indexOf(p,v)>-1:!!O&&_l(d,p,v)>-1}var Rte=ct(function(d,p,v){var E=-1,O=typeof p=="function",R=sr(d)?Q(d.length):[];return us(d,function(F){R[++E]=O?vr(p,F,v):wc(F,p,v)}),R}),Ite=lh(function(d,p,v){ci(d,v,p)});function bh(d,p){var v=Ne(d)?Xt:P_;return v(d,We(p,3))}function Lte(d,p,v,E){return d==null?[]:(Ne(p)||(p=p==null?[]:[p]),v=E?n:v,Ne(v)||(v=v==null?[]:[v]),$_(d,p,v))}var Pte=lh(function(d,p,v){d[v?0:1].push(p)},function(){return[[],[]]});function Dte(d,p,v){var E=Ne(d)?Mb:u_,O=arguments.length<3;return E(d,We(p,4),v,O,us)}function Fte(d,p,v){var E=Ne(d)?JZ:u_,O=arguments.length<3;return E(d,We(p,4),v,O,A_)}function Vte(d,p){var v=Ne(d)?is:O_;return v(d,wh(We(p,3)))}function $te(d){var p=Ne(d)?__:BN;return p(d)}function zte(d,p,v){(v?Xn(d,p,v):p===n)?p=1:p=ot(p);var E=Ne(d)?lN:RN;return E(d,p)}function Hte(d){var p=Ne(d)?uN:LN;return p(d)}function Ute(d){if(d==null)return 0;if(sr(d))return Ch(d)?kl(d):d.length;var p=Vn(d);return p==Y||p==ve?d.size:Jb(d).length}function Wte(d,p,v){var E=Ne(d)?Bb:PN;return v&&Xn(d,p,v)&&(p=n),E(d,We(p,3))}var jte=ct(function(d,p){if(d==null)return[];var v=p.length;return v>1&&Xn(d,p[0],p[1])?p=[]:v>2&&Xn(p[0],p[1],p[2])&&(p=[p[0]]),$_(d,An(p,1),[])}),vh=_Q||function(){return Tn.Date.now()};function qte(d,p){if(typeof p!="function")throw new zr(a);return d=ot(d),function(){if(--d<1)return p.apply(this,arguments)}}function IS(d,p,v){return p=v?n:p,p=d&&p==null?d.length:p,di(d,T,n,n,n,n,p)}function LS(d,p){var v;if(typeof p!="function")throw new zr(a);return d=ot(d),function(){return--d>0&&(v=p.apply(this,arguments)),d<=1&&(p=n),v}}var y2=ct(function(d,p,v){var E=w;if(v.length){var O=as(v,Ll(y2));E|=k}return di(d,E,p,v,O)}),PS=ct(function(d,p,v){var E=w|x;if(v.length){var O=as(v,Ll(PS));E|=k}return di(p,E,d,v,O)});function DS(d,p,v){p=v?n:p;var E=di(d,S,n,n,n,n,n,p);return E.placeholder=DS.placeholder,E}function FS(d,p,v){p=v?n:p;var E=di(d,C,n,n,n,n,n,p);return E.placeholder=FS.placeholder,E}function VS(d,p,v){var E,O,R,F,H,X,ce=0,de=!1,he=!1,ke=!0;if(typeof d!="function")throw new zr(a);p=qr(p)||0,en(v)&&(de=!!v.leading,he="maxWait"in v,R=he?mn(qr(v.maxWait)||0,p):R,ke="trailing"in v?!!v.trailing:ke);function De(un){var fo=E,gi=O;return E=O=n,ce=un,F=d.apply(gi,fo),F}function qe(un){return ce=un,H=Sc(pt,p),de?De(un):F}function ut(un){var fo=un-X,gi=un-ce,rk=p-fo;return he?Fn(rk,R-gi):rk}function Ke(un){var fo=un-X,gi=un-ce;return X===n||fo>=p||fo<0||he&&gi>=R}function pt(){var un=vh();if(Ke(un))return vt(un);H=Sc(pt,ut(un))}function vt(un){return H=n,ke&&E?De(un):(E=O=n,F)}function Cr(){H!==n&&X_(H),ce=0,E=X=O=H=n}function Jn(){return H===n?F:vt(vh())}function Er(){var un=vh(),fo=Ke(un);if(E=arguments,O=this,X=un,fo){if(H===n)return qe(X);if(he)return X_(H),H=Sc(pt,p),De(X)}return H===n&&(H=Sc(pt,p)),F}return Er.cancel=Cr,Er.flush=Jn,Er}var Kte=ct(function(d,p){return T_(d,1,p)}),Gte=ct(function(d,p,v){return T_(d,qr(p)||0,v)});function Xte(d){return di(d,L)}function yh(d,p){if(typeof d!="function"||p!=null&&typeof p!="function")throw new zr(a);var v=function(){var E=arguments,O=p?p.apply(this,E):E[0],R=v.cache;if(R.has(O))return R.get(O);var F=d.apply(this,E);return v.cache=R.set(O,F)||R,F};return v.cache=new(yh.Cache||ui),v}yh.Cache=ui;function wh(d){if(typeof d!="function")throw new zr(a);return function(){var p=arguments;switch(p.length){case 0:return!d.call(this);case 1:return!d.call(this,p[0]);case 2:return!d.call(this,p[0],p[1]);case 3:return!d.call(this,p[0],p[1],p[2])}return!d.apply(this,p)}}function Jte(d){return LS(2,d)}var Yte=DN(function(d,p){p=p.length==1&&Ne(p[0])?Xt(p[0],yr(We())):Xt(An(p,1),yr(We()));var v=p.length;return ct(function(E){for(var O=-1,R=Fn(E.length,v);++O<R;)E[O]=p[O].call(this,E[O]);return vr(d,this,E)})}),w2=ct(function(d,p){var v=as(p,Ll(w2));return di(d,k,n,p,v)}),$S=ct(function(d,p){var v=as(p,Ll($S));return di(d,A,n,p,v)}),Zte=fi(function(d,p){return di(d,B,n,n,n,p)});function Qte(d,p){if(typeof d!="function")throw new zr(a);return p=p===n?p:ot(p),ct(d,p)}function Nte(d,p){if(typeof d!="function")throw new zr(a);return p=p==null?0:mn(ot(p),0),ct(function(v){var E=v[p],O=fs(v,0,p);return E&&ss(O,E),vr(d,this,O)})}function ene(d,p,v){var E=!0,O=!0;if(typeof d!="function")throw new zr(a);return en(v)&&(E="leading"in v?!!v.leading:E,O="trailing"in v?!!v.trailing:O),VS(d,p,{leading:E,maxWait:p,trailing:O})}function tne(d){return IS(d,1)}function nne(d,p){return w2(o2(p),d)}function rne(){if(!arguments.length)return[];var d=arguments[0];return Ne(d)?d:[d]}function one(d){return Ur(d,g)}function ine(d,p){return p=typeof p=="function"?p:n,Ur(d,g,p)}function sne(d){return Ur(d,h|g)}function ane(d,p){return p=typeof p=="function"?p:n,Ur(d,h|g,p)}function lne(d,p){return p==null||k_(d,p,wn(p))}function co(d,p){return d===p||d!==d&&p!==p}var une=fh(Kb),cne=fh(function(d,p){return d>=p}),da=R_(function(){return arguments}())?R_:function(d){return on(d)&&Ot.call(d,"callee")&&!v_.call(d,"callee")},Ne=Q.isArray,dne=NE?yr(NE):yN;function sr(d){return d!=null&&xh(d.length)&&!hi(d)}function ln(d){return on(d)&&sr(d)}function fne(d){return d===!0||d===!1||on(d)&&Gn(d)==J}var ps=kQ||B2,pne=e_?yr(e_):wN;function hne(d){return on(d)&&d.nodeType===1&&!kc(d)}function mne(d){if(d==null)return!0;if(sr(d)&&(Ne(d)||typeof d=="string"||typeof d.splice=="function"||ps(d)||Pl(d)||da(d)))return!d.length;var p=Vn(d);if(p==Y||p==ve)return!d.size;if(_c(d))return!Jb(d).length;for(var v in d)if(Ot.call(d,v))return!1;return!0}function gne(d,p){return xc(d,p)}function bne(d,p,v){v=typeof v=="function"?v:n;var E=v?v(d,p):n;return E===n?xc(d,p,n,v):!!E}function x2(d){if(!on(d))return!1;var p=Gn(d);return p==fe||p==ie||typeof d.message=="string"&&typeof d.name=="string"&&!kc(d)}function vne(d){return typeof d=="number"&&w_(d)}function hi(d){if(!en(d))return!1;var p=Gn(d);return p==Ee||p==Oe||p==W||p==D}function zS(d){return typeof d=="number"&&d==ot(d)}function xh(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=G}function en(d){var p=typeof d;return d!=null&&(p=="object"||p=="function")}function on(d){return d!=null&&typeof d=="object"}var HS=t_?yr(t_):CN;function yne(d,p){return d===p||Xb(d,p,d2(p))}function wne(d,p,v){return v=typeof v=="function"?v:n,Xb(d,p,d2(p),v)}function xne(d){return US(d)&&d!=+d}function Cne(d){if(iee(d))throw new Qe(s);return I_(d)}function Ene(d){return d===null}function _ne(d){return d==null}function US(d){return typeof d=="number"||on(d)&&Gn(d)==we}function kc(d){if(!on(d)||Gn(d)!=wt)return!1;var p=Xp(d);if(p===null)return!0;var v=Ot.call(p,"constructor")&&p.constructor;return typeof v=="function"&&v instanceof v&&jp.call(v)==wQ}var C2=n_?yr(n_):EN;function Sne(d){return zS(d)&&d>=-9007199254740991&&d<=G}var WS=r_?yr(r_):_N;function Ch(d){return typeof d=="string"||!Ne(d)&&on(d)&&Gn(d)==Le}function xr(d){return typeof d=="symbol"||on(d)&&Gn(d)==tt}var Pl=o_?yr(o_):SN;function kne(d){return d===n}function Tne(d){return on(d)&&Vn(d)==N}function Ane(d){return on(d)&&Gn(d)==pe}var One=fh(Yb),Mne=fh(function(d,p){return d<=p});function jS(d){if(!d)return[];if(sr(d))return Ch(d)?lo(d):ir(d);if(pc&&d[pc])return lQ(d[pc]());var p=Vn(d),v=p==Y?Fb:p==ve?Hp:Dl;return v(d)}function mi(d){if(!d)return d===0?d:0;if(d=qr(d),d===P||d===-1/0){var p=d<0?-1:1;return p*Z}return d===d?d:0}function ot(d){var p=mi(d),v=p%1;return p===p?v?p-v:p:0}function qS(d){return d?aa(ot(d),0,ne):0}function qr(d){if(typeof d=="number")return d;if(xr(d))return oe;if(en(d)){var p=typeof d.valueOf=="function"?d.valueOf():d;d=en(p)?p+"":p}if(typeof d!="string")return d===0?d:+d;d=c_(d);var v=dZ.test(d);return v||pZ.test(d)?qZ(d.slice(2),v?2:8):cZ.test(d)?oe:+d}function KS(d){return Io(d,ar(d))}function Bne(d){return d?aa(ot(d),-9007199254740991,G):d===0?d:0}function Tt(d){return d==null?"":wr(d)}var Rne=Rl(function(d,p){if(_c(p)||sr(p)){Io(p,wn(p),d);return}for(var v in p)Ot.call(p,v)&&vc(d,v,p[v])}),GS=Rl(function(d,p){Io(p,ar(p),d)}),Eh=Rl(function(d,p,v,E){Io(p,ar(p),d,E)}),Ine=Rl(function(d,p,v,E){Io(p,wn(p),d,E)}),Lne=fi(Wb);function Pne(d,p){var v=Bl(d);return p==null?v:S_(v,p)}var Dne=ct(function(d,p){d=$t(d);var v=-1,E=p.length,O=E>2?p[2]:n;for(O&&Xn(p[0],p[1],O)&&(E=1);++v<E;)for(var R=p[v],F=ar(R),H=-1,X=F.length;++H<X;){var ce=F[H],de=d[ce];(de===n||co(de,Al[ce])&&!Ot.call(d,ce))&&(d[ce]=R[ce])}return d}),Fne=ct(function(d){return d.push(n,cS),vr(XS,n,d)});function Vne(d,p){return s_(d,We(p,3),Ro)}function $ne(d,p){return s_(d,We(p,3),qb)}function zne(d,p){return d==null?d:jb(d,We(p,3),ar)}function Hne(d,p){return d==null?d:M_(d,We(p,3),ar)}function Une(d,p){return d&&Ro(d,We(p,3))}function Wne(d,p){return d&&qb(d,We(p,3))}function jne(d){return d==null?[]:oh(d,wn(d))}function qne(d){return d==null?[]:oh(d,ar(d))}function E2(d,p,v){var E=d==null?n:la(d,p);return E===n?v:E}function Kne(d,p){return d!=null&&pS(d,p,mN)}function _2(d,p){return d!=null&&pS(d,p,gN)}var Gne=iS(function(d,p,v){p!=null&&typeof p.toString!="function"&&(p=qp.call(p)),d[p]=v},k2(lr)),Xne=iS(function(d,p,v){p!=null&&typeof p.toString!="function"&&(p=qp.call(p)),Ot.call(d,p)?d[p].push(v):d[p]=[v]},We),Jne=ct(wc);function wn(d){return sr(d)?E_(d):Jb(d)}function ar(d){return sr(d)?E_(d,!0):kN(d)}function Yne(d,p){var v={};return p=We(p,3),Ro(d,function(E,O,R){ci(v,p(E,O,R),E)}),v}function Zne(d,p){var v={};return p=We(p,3),Ro(d,function(E,O,R){ci(v,O,p(E,O,R))}),v}var Qne=Rl(function(d,p,v){ih(d,p,v)}),XS=Rl(function(d,p,v,E){ih(d,p,v,E)}),Nne=fi(function(d,p){var v={};if(d==null)return v;var E=!1;p=Xt(p,function(R){return R=ds(R,d),E||(E=R.length>1),R}),Io(d,u2(d),v),E&&(v=Ur(v,h|m|g,GN));for(var O=p.length;O--;)t2(v,p[O]);return v});function ere(d,p){return JS(d,wh(We(p)))}var tre=fi(function(d,p){return d==null?{}:AN(d,p)});function JS(d,p){if(d==null)return{};var v=Xt(u2(d),function(E){return[E]});return p=We(p),z_(d,v,function(E,O){return p(E,O[0])})}function nre(d,p,v){p=ds(p,d);var E=-1,O=p.length;for(O||(O=1,d=n);++E<O;){var R=d==null?n:d[Lo(p[E])];R===n&&(E=O,R=v),d=hi(R)?R.call(d):R}return d}function rre(d,p,v){return d==null?d:Cc(d,p,v)}function ore(d,p,v,E){return E=typeof E=="function"?E:n,d==null?d:Cc(d,p,v,E)}var YS=lS(wn),ZS=lS(ar);function ire(d,p,v){var E=Ne(d),O=E||ps(d)||Pl(d);if(p=We(p,4),v==null){var R=d&&d.constructor;O?v=E?new R:[]:en(d)?v=hi(R)?Bl(Xp(d)):{}:v={}}return(O?$r:Ro)(d,function(F,H,X){return p(v,F,H,X)}),v}function sre(d,p){return d==null?!0:t2(d,p)}function are(d,p,v){return d==null?d:q_(d,p,o2(v))}function lre(d,p,v,E){return E=typeof E=="function"?E:n,d==null?d:q_(d,p,o2(v),E)}function Dl(d){return d==null?[]:Db(d,wn(d))}function ure(d){return d==null?[]:Db(d,ar(d))}function cre(d,p,v){return v===n&&(v=p,p=n),v!==n&&(v=qr(v),v=v===v?v:0),p!==n&&(p=qr(p),p=p===p?p:0),aa(qr(d),p,v)}function dre(d,p,v){return p=mi(p),v===n?(v=p,p=0):v=mi(v),d=qr(d),bN(d,p,v)}function fre(d,p,v){if(v&&typeof v!="boolean"&&Xn(d,p,v)&&(p=v=n),v===n&&(typeof p=="boolean"?(v=p,p=n):typeof d=="boolean"&&(v=d,d=n)),d===n&&p===n?(d=0,p=1):(d=mi(d),p===n?(p=d,d=0):p=mi(p)),d>p){var E=d;d=p,p=E}if(v||d%1||p%1){var O=x_();return Fn(d+O*(p-d+jZ("1e-"+((O+"").length-1))),p)}return Qb(d,p)}var pre=Il(function(d,p,v){return p=p.toLowerCase(),d+(v?QS(p):p)});function QS(d){return S2(Tt(d).toLowerCase())}function NS(d){return d=Tt(d),d&&d.replace(mZ,rQ).replace(LZ,"")}function hre(d,p,v){d=Tt(d),p=wr(p);var E=d.length;v=v===n?E:aa(ot(v),0,E);var O=v;return v-=p.length,v>=0&&d.slice(v,O)==p}function mre(d){return d=Tt(d),d&&cc.test(d)?d.replace(uc,oQ):d}function gre(d){return d=Tt(d),d&&tZ.test(d)?d.replace(wb,"\\$&"):d}var bre=Il(function(d,p,v){return d+(v?"-":"")+p.toLowerCase()}),vre=Il(function(d,p,v){return d+(v?" ":"")+p.toLowerCase()}),yre=nS("toLowerCase");function wre(d,p,v){d=Tt(d),p=ot(p);var E=p?kl(d):0;if(!p||E>=p)return d;var O=(p-E)/2;return dh(Qp(O),v)+d+dh(Zp(O),v)}function xre(d,p,v){d=Tt(d),p=ot(p);var E=p?kl(d):0;return p&&E<p?d+dh(p-E,v):d}function Cre(d,p,v){d=Tt(d),p=ot(p);var E=p?kl(d):0;return p&&E<p?dh(p-E,v)+d:d}function Ere(d,p,v){return v||p==null?p=0:p&&(p=+p),MQ(Tt(d).replace(xb,""),p||0)}function _re(d,p,v){return(v?Xn(d,p,v):p===n)?p=1:p=ot(p),Nb(Tt(d),p)}function Sre(){var d=arguments,p=Tt(d[0]);return d.length<3?p:p.replace(d[1],d[2])}var kre=Il(function(d,p,v){return d+(v?"_":"")+p.toLowerCase()});function Tre(d,p,v){return v&&typeof v!="number"&&Xn(d,p,v)&&(p=v=n),v=v===n?ne:v>>>0,v?(d=Tt(d),d&&(typeof p=="string"||p!=null&&!C2(p))&&(p=wr(p),!p&&Sl(d))?fs(lo(d),0,v):d.split(p,v)):[]}var Are=Il(function(d,p,v){return d+(v?" ":"")+S2(p)});function Ore(d,p,v){return d=Tt(d),v=v==null?0:aa(ot(v),0,d.length),p=wr(p),d.slice(v,v+p.length)==p}function Mre(d,p,v){var E=M.templateSettings;v&&Xn(d,p,v)&&(p=n),d=Tt(d),p=Eh({},p,E,uS);var O=Eh({},p.imports,E.imports,uS),R=wn(O),F=Db(O,R),H,X,ce=0,de=p.interpolate||Dp,he="__p += '",ke=Vb((p.escape||Dp).source+"|"+de.source+"|"+(de===Pp?uZ:Dp).source+"|"+(p.evaluate||Dp).source+"|$","g"),De="//# sourceURL="+(Ot.call(p,"sourceURL")?(p.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$Z+"]")+`
16
+ `)}function nee(d){return Ne(d)||da(d)||!!(y_&&d&&d[y_])}function pi(d,p){var v=typeof d;return p=p??G,!!p&&(v=="number"||v!="symbol"&&hZ.test(d))&&d>-1&&d%1==0&&d<p}function Xn(d,p,v){if(!en(v))return!1;var E=typeof p;return(E=="number"?sr(v)&&pi(p,v.length):E=="string"&&p in v)?co(v[p],d):!1}function p2(d,p){if(Ne(d))return!1;var v=typeof d;return v=="number"||v=="symbol"||v=="boolean"||d==null||xr(d)?!0:Cl.test(d)||!dc.test(d)||p!=null&&d in $t(p)}function ree(d){var p=typeof d;return p=="string"||p=="number"||p=="symbol"||p=="boolean"?d!=="__proto__":d===null}function h2(d){var p=ph(d),v=M[p];if(typeof v!="function"||!(p in gt.prototype))return!1;if(d===v)return!0;var E=c2(v);return!!E&&d===E[0]}function oee(d){return!!m_&&m_ in d}var iee=Wp?hi:B2;function _c(d){var p=d&&d.constructor,v=typeof p=="function"&&p.prototype||Al;return d===v}function mS(d){return d===d&&!en(d)}function gS(d,p){return function(v){return v==null?!1:v[d]===p&&(p!==n||d in $t(v))}}function see(d){var p=yh(d,function(E){return v.size===c&&v.clear(),E}),v=p.cache;return p}function aee(d,p){var v=d[1],E=p[1],O=v|E,R=O<(w|x|T),F=E==T&&v==S||E==T&&v==B&&d[7].length<=p[8]||E==(T|B)&&p[7].length<=p[8]&&v==S;if(!(R||F))return d;E&w&&(d[2]=p[2],O|=v&w?0:_);var H=p[3];if(H){var X=d[3];d[3]=X?Q_(X,H,p[4]):H,d[4]=X?as(d[3],f):p[4]}return H=p[5],H&&(X=d[5],d[5]=X?N_(X,H,p[6]):H,d[6]=X?as(d[5],f):p[6]),H=p[7],H&&(d[7]=H),E&T&&(d[8]=d[8]==null?p[8]:Fn(d[8],p[8])),d[9]==null&&(d[9]=p[9]),d[0]=p[0],d[1]=O,d}function lee(d){var p=[];if(d!=null)for(var v in $t(d))p.push(v);return p}function uee(d){return qp.call(d)}function bS(d,p,v){return p=mn(p===n?d.length-1:p,0),function(){for(var E=arguments,O=-1,R=mn(E.length-p,0),F=Q(R);++O<R;)F[O]=E[p+O];O=-1;for(var H=Q(p+1);++O<p;)H[O]=E[O];return H[p]=v(F),vr(d,this,H)}}function vS(d,p){return p.length<2?d:la(d,Wr(p,0,-1))}function cee(d,p){for(var v=d.length,E=Fn(p.length,v),O=ir(d);E--;){var R=p[E];d[E]=pi(R,v)?O[R]:n}return d}function m2(d,p){if(!(p==="constructor"&&typeof d[p]=="function")&&p!="__proto__")return d[p]}var yS=xS(U_),Sc=SQ||function(d,p){return Tn.setTimeout(d,p)},g2=xS(IN);function wS(d,p,v){var E=p+"";return g2(d,tee(E,dee(QN(E),v)))}function xS(d){var p=0,v=0;return function(){var E=OQ(),O=K-(E-v);if(v=E,O>0){if(++p>=q)return arguments[0]}else p=0;return d.apply(n,arguments)}}function mh(d,p){var v=-1,E=d.length,O=E-1;for(p=p===n?E:p;++v<p;){var R=Qb(v,O),F=d[R];d[R]=d[v],d[v]=F}return d.length=p,d}var CS=see(function(d){var p=[];return d.charCodeAt(0)===46&&p.push(""),d.replace(eZ,function(v,E,O,R){p.push(O?R.replace(lZ,"$1"):E||v)}),p});function Lo(d){if(typeof d=="string"||xr(d))return d;var p=d+"";return p=="0"&&1/d==-1/0?"-0":p}function ca(d){if(d!=null){try{return jp.call(d)}catch{}try{return d+""}catch{}}return""}function dee(d,p){return $r(Ge,function(v){var E="_."+v[0];p&v[1]&&!$p(d,E)&&d.push(E)}),d.sort()}function ES(d){if(d instanceof gt)return d.clone();var p=new Hr(d.__wrapped__,d.__chain__);return p.__actions__=ir(d.__actions__),p.__index__=d.__index__,p.__values__=d.__values__,p}function fee(d,p,v){(v?Xn(d,p,v):p===n)?p=1:p=mn(ot(p),0);var E=d==null?0:d.length;if(!E||p<1)return[];for(var O=0,R=0,F=Q(Zp(E/p));O<E;)F[R++]=Wr(d,O,O+=p);return F}function pee(d){for(var p=-1,v=d==null?0:d.length,E=0,O=[];++p<v;){var R=d[p];R&&(O[E++]=R)}return O}function hee(){var d=arguments.length;if(!d)return[];for(var p=Q(d-1),v=arguments[0],E=d;E--;)p[E-1]=arguments[E];return ss(Ne(v)?ir(v):[v],An(p,1))}var mee=ct(function(d,p){return ln(d)?yc(d,An(p,1,ln,!0)):[]}),gee=ct(function(d,p){var v=jr(p);return ln(v)&&(v=n),ln(d)?yc(d,An(p,1,ln,!0),We(v,2)):[]}),bee=ct(function(d,p){var v=jr(p);return ln(v)&&(v=n),ln(d)?yc(d,An(p,1,ln,!0),n,v):[]});function vee(d,p,v){var E=d==null?0:d.length;return E?(p=v||p===n?1:ot(p),Wr(d,p<0?0:p,E)):[]}function yee(d,p,v){var E=d==null?0:d.length;return E?(p=v||p===n?1:ot(p),p=E-p,Wr(d,0,p<0?0:p)):[]}function wee(d,p){return d&&d.length?ah(d,We(p,3),!0,!0):[]}function xee(d,p){return d&&d.length?ah(d,We(p,3),!0):[]}function Cee(d,p,v,E){var O=d==null?0:d.length;return O?(v&&typeof v!="number"&&Xn(d,p,v)&&(v=0,E=O),hN(d,p,v,E)):[]}function _S(d,p,v){var E=d==null?0:d.length;if(!E)return-1;var O=v==null?0:ot(v);return O<0&&(O=mn(E+O,0)),zp(d,We(p,3),O)}function SS(d,p,v){var E=d==null?0:d.length;if(!E)return-1;var O=E-1;return v!==n&&(O=ot(v),O=v<0?mn(E+O,0):Fn(O,E-1)),zp(d,We(p,3),O,!0)}function kS(d){var p=d==null?0:d.length;return p?An(d,1):[]}function Eee(d){var p=d==null?0:d.length;return p?An(d,P):[]}function _ee(d,p){var v=d==null?0:d.length;return v?(p=p===n?1:ot(p),An(d,p)):[]}function See(d){for(var p=-1,v=d==null?0:d.length,E={};++p<v;){var O=d[p];E[O[0]]=O[1]}return E}function TS(d){return d&&d.length?d[0]:n}function kee(d,p,v){var E=d==null?0:d.length;if(!E)return-1;var O=v==null?0:ot(v);return O<0&&(O=mn(E+O,0)),_l(d,p,O)}function Tee(d){var p=d==null?0:d.length;return p?Wr(d,0,-1):[]}var Aee=ct(function(d){var p=Xt(d,r2);return p.length&&p[0]===d[0]?Gb(p):[]}),Oee=ct(function(d){var p=jr(d),v=Xt(d,r2);return p===jr(v)?p=n:v.pop(),v.length&&v[0]===d[0]?Gb(v,We(p,2)):[]}),Mee=ct(function(d){var p=jr(d),v=Xt(d,r2);return p=typeof p=="function"?p:n,p&&v.pop(),v.length&&v[0]===d[0]?Gb(v,n,p):[]});function Bee(d,p){return d==null?"":TQ.call(d,p)}function jr(d){var p=d==null?0:d.length;return p?d[p-1]:n}function Ree(d,p,v){var E=d==null?0:d.length;if(!E)return-1;var O=E;return v!==n&&(O=ot(v),O=O<0?mn(E+O,0):Fn(O,E-1)),p===p?dQ(d,p,O):zp(d,a_,O,!0)}function Iee(d,p){return d&&d.length?V_(d,ot(p)):n}var Lee=ct(AS);function AS(d,p){return d&&d.length&&p&&p.length?Zb(d,p):d}function Pee(d,p,v){return d&&d.length&&p&&p.length?Zb(d,p,We(v,2)):d}function Dee(d,p,v){return d&&d.length&&p&&p.length?Zb(d,p,n,v):d}var Fee=fi(function(d,p){var v=d==null?0:d.length,E=Wb(d,p);return H_(d,Xt(p,function(O){return pi(O,v)?+O:O}).sort(Z_)),E});function Vee(d,p){var v=[];if(!(d&&d.length))return v;var E=-1,O=[],R=d.length;for(p=We(p,3);++E<R;){var F=d[E];p(F,E,d)&&(v.push(F),O.push(E))}return H_(d,O),v}function b2(d){return d==null?d:BQ.call(d)}function $ee(d,p,v){var E=d==null?0:d.length;return E?(v&&typeof v!="number"&&Xn(d,p,v)?(p=0,v=E):(p=p==null?0:ot(p),v=v===n?E:ot(v)),Wr(d,p,v)):[]}function zee(d,p){return sh(d,p)}function Hee(d,p,v){return e2(d,p,We(v,2))}function Uee(d,p){var v=d==null?0:d.length;if(v){var E=sh(d,p);if(E<v&&co(d[E],p))return E}return-1}function Wee(d,p){return sh(d,p,!0)}function jee(d,p,v){return e2(d,p,We(v,2),!0)}function qee(d,p){var v=d==null?0:d.length;if(v){var E=sh(d,p,!0)-1;if(co(d[E],p))return E}return-1}function Kee(d){return d&&d.length?W_(d):[]}function Gee(d,p){return d&&d.length?W_(d,We(p,2)):[]}function Xee(d){var p=d==null?0:d.length;return p?Wr(d,1,p):[]}function Jee(d,p,v){return d&&d.length?(p=v||p===n?1:ot(p),Wr(d,0,p<0?0:p)):[]}function Yee(d,p,v){var E=d==null?0:d.length;return E?(p=v||p===n?1:ot(p),p=E-p,Wr(d,p<0?0:p,E)):[]}function Zee(d,p){return d&&d.length?ah(d,We(p,3),!1,!0):[]}function Qee(d,p){return d&&d.length?ah(d,We(p,3)):[]}var Nee=ct(function(d){return cs(An(d,1,ln,!0))}),ete=ct(function(d){var p=jr(d);return ln(p)&&(p=n),cs(An(d,1,ln,!0),We(p,2))}),tte=ct(function(d){var p=jr(d);return p=typeof p=="function"?p:n,cs(An(d,1,ln,!0),n,p)});function nte(d){return d&&d.length?cs(d):[]}function rte(d,p){return d&&d.length?cs(d,We(p,2)):[]}function ote(d,p){return p=typeof p=="function"?p:n,d&&d.length?cs(d,n,p):[]}function v2(d){if(!(d&&d.length))return[];var p=0;return d=is(d,function(v){if(ln(v))return p=mn(v.length,p),!0}),Pb(p,function(v){return Xt(d,Rb(v))})}function OS(d,p){if(!(d&&d.length))return[];var v=v2(d);return p==null?v:Xt(v,function(E){return vr(p,n,E)})}var ite=ct(function(d,p){return ln(d)?yc(d,p):[]}),ste=ct(function(d){return n2(is(d,ln))}),ate=ct(function(d){var p=jr(d);return ln(p)&&(p=n),n2(is(d,ln),We(p,2))}),lte=ct(function(d){var p=jr(d);return p=typeof p=="function"?p:n,n2(is(d,ln),n,p)}),ute=ct(v2);function cte(d,p){return G_(d||[],p||[],vc)}function dte(d,p){return G_(d||[],p||[],Cc)}var fte=ct(function(d){var p=d.length,v=p>1?d[p-1]:n;return v=typeof v=="function"?(d.pop(),v):n,OS(d,v)});function MS(d){var p=M(d);return p.__chain__=!0,p}function pte(d,p){return p(d),d}function gh(d,p){return p(d)}var hte=fi(function(d){var p=d.length,v=p?d[0]:0,E=this.__wrapped__,O=function(R){return Wb(R,d)};return p>1||this.__actions__.length||!(E instanceof gt)||!pi(v)?this.thru(O):(E=E.slice(v,+v+(p?1:0)),E.__actions__.push({func:gh,args:[O],thisArg:n}),new Hr(E,this.__chain__).thru(function(R){return p&&!R.length&&R.push(n),R}))});function mte(){return MS(this)}function gte(){return new Hr(this.value(),this.__chain__)}function bte(){this.__values__===n&&(this.__values__=jS(this.value()));var d=this.__index__>=this.__values__.length,p=d?n:this.__values__[this.__index__++];return{done:d,value:p}}function vte(){return this}function yte(d){for(var p,v=this;v instanceof th;){var E=ES(v);E.__index__=0,E.__values__=n,p?O.__wrapped__=E:p=E;var O=E;v=v.__wrapped__}return O.__wrapped__=d,p}function wte(){var d=this.__wrapped__;if(d instanceof gt){var p=d;return this.__actions__.length&&(p=new gt(this)),p=p.reverse(),p.__actions__.push({func:gh,args:[b2],thisArg:n}),new Hr(p,this.__chain__)}return this.thru(b2)}function xte(){return K_(this.__wrapped__,this.__actions__)}var Cte=lh(function(d,p,v){Ot.call(d,v)?++d[v]:ci(d,v,1)});function Ete(d,p,v){var E=Ne(d)?i_:pN;return v&&Xn(d,p,v)&&(p=n),E(d,We(p,3))}function _te(d,p){var v=Ne(d)?is:O_;return v(d,We(p,3))}var Ste=rS(_S),kte=rS(SS);function Tte(d,p){return An(bh(d,p),1)}function Ate(d,p){return An(bh(d,p),P)}function Ote(d,p,v){return v=v===n?1:ot(v),An(bh(d,p),v)}function BS(d,p){var v=Ne(d)?$r:us;return v(d,We(p,3))}function RS(d,p){var v=Ne(d)?XZ:A_;return v(d,We(p,3))}var Mte=lh(function(d,p,v){Ot.call(d,v)?d[v].push(p):ci(d,v,[p])});function Bte(d,p,v,E){d=sr(d)?d:Dl(d),v=v&&!E?ot(v):0;var O=d.length;return v<0&&(v=mn(O+v,0)),Ch(d)?v<=O&&d.indexOf(p,v)>-1:!!O&&_l(d,p,v)>-1}var Rte=ct(function(d,p,v){var E=-1,O=typeof p=="function",R=sr(d)?Q(d.length):[];return us(d,function(F){R[++E]=O?vr(p,F,v):wc(F,p,v)}),R}),Ite=lh(function(d,p,v){ci(d,v,p)});function bh(d,p){var v=Ne(d)?Xt:P_;return v(d,We(p,3))}function Lte(d,p,v,E){return d==null?[]:(Ne(p)||(p=p==null?[]:[p]),v=E?n:v,Ne(v)||(v=v==null?[]:[v]),$_(d,p,v))}var Pte=lh(function(d,p,v){d[v?0:1].push(p)},function(){return[[],[]]});function Dte(d,p,v){var E=Ne(d)?Mb:u_,O=arguments.length<3;return E(d,We(p,4),v,O,us)}function Fte(d,p,v){var E=Ne(d)?JZ:u_,O=arguments.length<3;return E(d,We(p,4),v,O,A_)}function Vte(d,p){var v=Ne(d)?is:O_;return v(d,wh(We(p,3)))}function $te(d){var p=Ne(d)?__:BN;return p(d)}function zte(d,p,v){(v?Xn(d,p,v):p===n)?p=1:p=ot(p);var E=Ne(d)?lN:RN;return E(d,p)}function Hte(d){var p=Ne(d)?uN:LN;return p(d)}function Ute(d){if(d==null)return 0;if(sr(d))return Ch(d)?kl(d):d.length;var p=Vn(d);return p==Y||p==ve?d.size:Jb(d).length}function Wte(d,p,v){var E=Ne(d)?Bb:PN;return v&&Xn(d,p,v)&&(p=n),E(d,We(p,3))}var jte=ct(function(d,p){if(d==null)return[];var v=p.length;return v>1&&Xn(d,p[0],p[1])?p=[]:v>2&&Xn(p[0],p[1],p[2])&&(p=[p[0]]),$_(d,An(p,1),[])}),vh=_Q||function(){return Tn.Date.now()};function qte(d,p){if(typeof p!="function")throw new zr(a);return d=ot(d),function(){if(--d<1)return p.apply(this,arguments)}}function IS(d,p,v){return p=v?n:p,p=d&&p==null?d.length:p,di(d,T,n,n,n,n,p)}function LS(d,p){var v;if(typeof p!="function")throw new zr(a);return d=ot(d),function(){return--d>0&&(v=p.apply(this,arguments)),d<=1&&(p=n),v}}var y2=ct(function(d,p,v){var E=w;if(v.length){var O=as(v,Ll(y2));E|=k}return di(d,E,p,v,O)}),PS=ct(function(d,p,v){var E=w|x;if(v.length){var O=as(v,Ll(PS));E|=k}return di(p,E,d,v,O)});function DS(d,p,v){p=v?n:p;var E=di(d,S,n,n,n,n,n,p);return E.placeholder=DS.placeholder,E}function FS(d,p,v){p=v?n:p;var E=di(d,C,n,n,n,n,n,p);return E.placeholder=FS.placeholder,E}function VS(d,p,v){var E,O,R,F,H,X,ce=0,de=!1,he=!1,ke=!0;if(typeof d!="function")throw new zr(a);p=qr(p)||0,en(v)&&(de=!!v.leading,he="maxWait"in v,R=he?mn(qr(v.maxWait)||0,p):R,ke="trailing"in v?!!v.trailing:ke);function De(un){var fo=E,gi=O;return E=O=n,ce=un,F=d.apply(gi,fo),F}function qe(un){return ce=un,H=Sc(pt,p),de?De(un):F}function ut(un){var fo=un-X,gi=un-ce,rk=p-fo;return he?Fn(rk,R-gi):rk}function Ke(un){var fo=un-X,gi=un-ce;return X===n||fo>=p||fo<0||he&&gi>=R}function pt(){var un=vh();if(Ke(un))return vt(un);H=Sc(pt,ut(un))}function vt(un){return H=n,ke&&E?De(un):(E=O=n,F)}function Cr(){H!==n&&X_(H),ce=0,E=X=O=H=n}function Jn(){return H===n?F:vt(vh())}function Er(){var un=vh(),fo=Ke(un);if(E=arguments,O=this,X=un,fo){if(H===n)return qe(X);if(he)return X_(H),H=Sc(pt,p),De(X)}return H===n&&(H=Sc(pt,p)),F}return Er.cancel=Cr,Er.flush=Jn,Er}var Kte=ct(function(d,p){return T_(d,1,p)}),Gte=ct(function(d,p,v){return T_(d,qr(p)||0,v)});function Xte(d){return di(d,L)}function yh(d,p){if(typeof d!="function"||p!=null&&typeof p!="function")throw new zr(a);var v=function(){var E=arguments,O=p?p.apply(this,E):E[0],R=v.cache;if(R.has(O))return R.get(O);var F=d.apply(this,E);return v.cache=R.set(O,F)||R,F};return v.cache=new(yh.Cache||ui),v}yh.Cache=ui;function wh(d){if(typeof d!="function")throw new zr(a);return function(){var p=arguments;switch(p.length){case 0:return!d.call(this);case 1:return!d.call(this,p[0]);case 2:return!d.call(this,p[0],p[1]);case 3:return!d.call(this,p[0],p[1],p[2])}return!d.apply(this,p)}}function Jte(d){return LS(2,d)}var Yte=DN(function(d,p){p=p.length==1&&Ne(p[0])?Xt(p[0],yr(We())):Xt(An(p,1),yr(We()));var v=p.length;return ct(function(E){for(var O=-1,R=Fn(E.length,v);++O<R;)E[O]=p[O].call(this,E[O]);return vr(d,this,E)})}),w2=ct(function(d,p){var v=as(p,Ll(w2));return di(d,k,n,p,v)}),$S=ct(function(d,p){var v=as(p,Ll($S));return di(d,A,n,p,v)}),Zte=fi(function(d,p){return di(d,B,n,n,n,p)});function Qte(d,p){if(typeof d!="function")throw new zr(a);return p=p===n?p:ot(p),ct(d,p)}function Nte(d,p){if(typeof d!="function")throw new zr(a);return p=p==null?0:mn(ot(p),0),ct(function(v){var E=v[p],O=fs(v,0,p);return E&&ss(O,E),vr(d,this,O)})}function ene(d,p,v){var E=!0,O=!0;if(typeof d!="function")throw new zr(a);return en(v)&&(E="leading"in v?!!v.leading:E,O="trailing"in v?!!v.trailing:O),VS(d,p,{leading:E,maxWait:p,trailing:O})}function tne(d){return IS(d,1)}function nne(d,p){return w2(o2(p),d)}function rne(){if(!arguments.length)return[];var d=arguments[0];return Ne(d)?d:[d]}function one(d){return Ur(d,g)}function ine(d,p){return p=typeof p=="function"?p:n,Ur(d,g,p)}function sne(d){return Ur(d,h|g)}function ane(d,p){return p=typeof p=="function"?p:n,Ur(d,h|g,p)}function lne(d,p){return p==null||k_(d,p,xn(p))}function co(d,p){return d===p||d!==d&&p!==p}var une=fh(Kb),cne=fh(function(d,p){return d>=p}),da=R_(function(){return arguments}())?R_:function(d){return on(d)&&Ot.call(d,"callee")&&!v_.call(d,"callee")},Ne=Q.isArray,dne=NE?yr(NE):yN;function sr(d){return d!=null&&xh(d.length)&&!hi(d)}function ln(d){return on(d)&&sr(d)}function fne(d){return d===!0||d===!1||on(d)&&Gn(d)==J}var ps=kQ||B2,pne=e_?yr(e_):wN;function hne(d){return on(d)&&d.nodeType===1&&!kc(d)}function mne(d){if(d==null)return!0;if(sr(d)&&(Ne(d)||typeof d=="string"||typeof d.splice=="function"||ps(d)||Pl(d)||da(d)))return!d.length;var p=Vn(d);if(p==Y||p==ve)return!d.size;if(_c(d))return!Jb(d).length;for(var v in d)if(Ot.call(d,v))return!1;return!0}function gne(d,p){return xc(d,p)}function bne(d,p,v){v=typeof v=="function"?v:n;var E=v?v(d,p):n;return E===n?xc(d,p,n,v):!!E}function x2(d){if(!on(d))return!1;var p=Gn(d);return p==fe||p==ie||typeof d.message=="string"&&typeof d.name=="string"&&!kc(d)}function vne(d){return typeof d=="number"&&w_(d)}function hi(d){if(!en(d))return!1;var p=Gn(d);return p==Ee||p==Oe||p==W||p==D}function zS(d){return typeof d=="number"&&d==ot(d)}function xh(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=G}function en(d){var p=typeof d;return d!=null&&(p=="object"||p=="function")}function on(d){return d!=null&&typeof d=="object"}var HS=t_?yr(t_):CN;function yne(d,p){return d===p||Xb(d,p,d2(p))}function wne(d,p,v){return v=typeof v=="function"?v:n,Xb(d,p,d2(p),v)}function xne(d){return US(d)&&d!=+d}function Cne(d){if(iee(d))throw new Qe(s);return I_(d)}function Ene(d){return d===null}function _ne(d){return d==null}function US(d){return typeof d=="number"||on(d)&&Gn(d)==we}function kc(d){if(!on(d)||Gn(d)!=wt)return!1;var p=Xp(d);if(p===null)return!0;var v=Ot.call(p,"constructor")&&p.constructor;return typeof v=="function"&&v instanceof v&&jp.call(v)==wQ}var C2=n_?yr(n_):EN;function Sne(d){return zS(d)&&d>=-9007199254740991&&d<=G}var WS=r_?yr(r_):_N;function Ch(d){return typeof d=="string"||!Ne(d)&&on(d)&&Gn(d)==Le}function xr(d){return typeof d=="symbol"||on(d)&&Gn(d)==tt}var Pl=o_?yr(o_):SN;function kne(d){return d===n}function Tne(d){return on(d)&&Vn(d)==N}function Ane(d){return on(d)&&Gn(d)==pe}var One=fh(Yb),Mne=fh(function(d,p){return d<=p});function jS(d){if(!d)return[];if(sr(d))return Ch(d)?lo(d):ir(d);if(pc&&d[pc])return lQ(d[pc]());var p=Vn(d),v=p==Y?Fb:p==ve?Hp:Dl;return v(d)}function mi(d){if(!d)return d===0?d:0;if(d=qr(d),d===P||d===-1/0){var p=d<0?-1:1;return p*Z}return d===d?d:0}function ot(d){var p=mi(d),v=p%1;return p===p?v?p-v:p:0}function qS(d){return d?aa(ot(d),0,ne):0}function qr(d){if(typeof d=="number")return d;if(xr(d))return oe;if(en(d)){var p=typeof d.valueOf=="function"?d.valueOf():d;d=en(p)?p+"":p}if(typeof d!="string")return d===0?d:+d;d=c_(d);var v=dZ.test(d);return v||pZ.test(d)?qZ(d.slice(2),v?2:8):cZ.test(d)?oe:+d}function KS(d){return Io(d,ar(d))}function Bne(d){return d?aa(ot(d),-9007199254740991,G):d===0?d:0}function Tt(d){return d==null?"":wr(d)}var Rne=Rl(function(d,p){if(_c(p)||sr(p)){Io(p,xn(p),d);return}for(var v in p)Ot.call(p,v)&&vc(d,v,p[v])}),GS=Rl(function(d,p){Io(p,ar(p),d)}),Eh=Rl(function(d,p,v,E){Io(p,ar(p),d,E)}),Ine=Rl(function(d,p,v,E){Io(p,xn(p),d,E)}),Lne=fi(Wb);function Pne(d,p){var v=Bl(d);return p==null?v:S_(v,p)}var Dne=ct(function(d,p){d=$t(d);var v=-1,E=p.length,O=E>2?p[2]:n;for(O&&Xn(p[0],p[1],O)&&(E=1);++v<E;)for(var R=p[v],F=ar(R),H=-1,X=F.length;++H<X;){var ce=F[H],de=d[ce];(de===n||co(de,Al[ce])&&!Ot.call(d,ce))&&(d[ce]=R[ce])}return d}),Fne=ct(function(d){return d.push(n,cS),vr(XS,n,d)});function Vne(d,p){return s_(d,We(p,3),Ro)}function $ne(d,p){return s_(d,We(p,3),qb)}function zne(d,p){return d==null?d:jb(d,We(p,3),ar)}function Hne(d,p){return d==null?d:M_(d,We(p,3),ar)}function Une(d,p){return d&&Ro(d,We(p,3))}function Wne(d,p){return d&&qb(d,We(p,3))}function jne(d){return d==null?[]:oh(d,xn(d))}function qne(d){return d==null?[]:oh(d,ar(d))}function E2(d,p,v){var E=d==null?n:la(d,p);return E===n?v:E}function Kne(d,p){return d!=null&&pS(d,p,mN)}function _2(d,p){return d!=null&&pS(d,p,gN)}var Gne=iS(function(d,p,v){p!=null&&typeof p.toString!="function"&&(p=qp.call(p)),d[p]=v},k2(lr)),Xne=iS(function(d,p,v){p!=null&&typeof p.toString!="function"&&(p=qp.call(p)),Ot.call(d,p)?d[p].push(v):d[p]=[v]},We),Jne=ct(wc);function xn(d){return sr(d)?E_(d):Jb(d)}function ar(d){return sr(d)?E_(d,!0):kN(d)}function Yne(d,p){var v={};return p=We(p,3),Ro(d,function(E,O,R){ci(v,p(E,O,R),E)}),v}function Zne(d,p){var v={};return p=We(p,3),Ro(d,function(E,O,R){ci(v,O,p(E,O,R))}),v}var Qne=Rl(function(d,p,v){ih(d,p,v)}),XS=Rl(function(d,p,v,E){ih(d,p,v,E)}),Nne=fi(function(d,p){var v={};if(d==null)return v;var E=!1;p=Xt(p,function(R){return R=ds(R,d),E||(E=R.length>1),R}),Io(d,u2(d),v),E&&(v=Ur(v,h|m|g,GN));for(var O=p.length;O--;)t2(v,p[O]);return v});function ere(d,p){return JS(d,wh(We(p)))}var tre=fi(function(d,p){return d==null?{}:AN(d,p)});function JS(d,p){if(d==null)return{};var v=Xt(u2(d),function(E){return[E]});return p=We(p),z_(d,v,function(E,O){return p(E,O[0])})}function nre(d,p,v){p=ds(p,d);var E=-1,O=p.length;for(O||(O=1,d=n);++E<O;){var R=d==null?n:d[Lo(p[E])];R===n&&(E=O,R=v),d=hi(R)?R.call(d):R}return d}function rre(d,p,v){return d==null?d:Cc(d,p,v)}function ore(d,p,v,E){return E=typeof E=="function"?E:n,d==null?d:Cc(d,p,v,E)}var YS=lS(xn),ZS=lS(ar);function ire(d,p,v){var E=Ne(d),O=E||ps(d)||Pl(d);if(p=We(p,4),v==null){var R=d&&d.constructor;O?v=E?new R:[]:en(d)?v=hi(R)?Bl(Xp(d)):{}:v={}}return(O?$r:Ro)(d,function(F,H,X){return p(v,F,H,X)}),v}function sre(d,p){return d==null?!0:t2(d,p)}function are(d,p,v){return d==null?d:q_(d,p,o2(v))}function lre(d,p,v,E){return E=typeof E=="function"?E:n,d==null?d:q_(d,p,o2(v),E)}function Dl(d){return d==null?[]:Db(d,xn(d))}function ure(d){return d==null?[]:Db(d,ar(d))}function cre(d,p,v){return v===n&&(v=p,p=n),v!==n&&(v=qr(v),v=v===v?v:0),p!==n&&(p=qr(p),p=p===p?p:0),aa(qr(d),p,v)}function dre(d,p,v){return p=mi(p),v===n?(v=p,p=0):v=mi(v),d=qr(d),bN(d,p,v)}function fre(d,p,v){if(v&&typeof v!="boolean"&&Xn(d,p,v)&&(p=v=n),v===n&&(typeof p=="boolean"?(v=p,p=n):typeof d=="boolean"&&(v=d,d=n)),d===n&&p===n?(d=0,p=1):(d=mi(d),p===n?(p=d,d=0):p=mi(p)),d>p){var E=d;d=p,p=E}if(v||d%1||p%1){var O=x_();return Fn(d+O*(p-d+jZ("1e-"+((O+"").length-1))),p)}return Qb(d,p)}var pre=Il(function(d,p,v){return p=p.toLowerCase(),d+(v?QS(p):p)});function QS(d){return S2(Tt(d).toLowerCase())}function NS(d){return d=Tt(d),d&&d.replace(mZ,rQ).replace(LZ,"")}function hre(d,p,v){d=Tt(d),p=wr(p);var E=d.length;v=v===n?E:aa(ot(v),0,E);var O=v;return v-=p.length,v>=0&&d.slice(v,O)==p}function mre(d){return d=Tt(d),d&&cc.test(d)?d.replace(uc,oQ):d}function gre(d){return d=Tt(d),d&&tZ.test(d)?d.replace(wb,"\\$&"):d}var bre=Il(function(d,p,v){return d+(v?"-":"")+p.toLowerCase()}),vre=Il(function(d,p,v){return d+(v?" ":"")+p.toLowerCase()}),yre=nS("toLowerCase");function wre(d,p,v){d=Tt(d),p=ot(p);var E=p?kl(d):0;if(!p||E>=p)return d;var O=(p-E)/2;return dh(Qp(O),v)+d+dh(Zp(O),v)}function xre(d,p,v){d=Tt(d),p=ot(p);var E=p?kl(d):0;return p&&E<p?d+dh(p-E,v):d}function Cre(d,p,v){d=Tt(d),p=ot(p);var E=p?kl(d):0;return p&&E<p?dh(p-E,v)+d:d}function Ere(d,p,v){return v||p==null?p=0:p&&(p=+p),MQ(Tt(d).replace(xb,""),p||0)}function _re(d,p,v){return(v?Xn(d,p,v):p===n)?p=1:p=ot(p),Nb(Tt(d),p)}function Sre(){var d=arguments,p=Tt(d[0]);return d.length<3?p:p.replace(d[1],d[2])}var kre=Il(function(d,p,v){return d+(v?"_":"")+p.toLowerCase()});function Tre(d,p,v){return v&&typeof v!="number"&&Xn(d,p,v)&&(p=v=n),v=v===n?ne:v>>>0,v?(d=Tt(d),d&&(typeof p=="string"||p!=null&&!C2(p))&&(p=wr(p),!p&&Sl(d))?fs(lo(d),0,v):d.split(p,v)):[]}var Are=Il(function(d,p,v){return d+(v?" ":"")+S2(p)});function Ore(d,p,v){return d=Tt(d),v=v==null?0:aa(ot(v),0,d.length),p=wr(p),d.slice(v,v+p.length)==p}function Mre(d,p,v){var E=M.templateSettings;v&&Xn(d,p,v)&&(p=n),d=Tt(d),p=Eh({},p,E,uS);var O=Eh({},p.imports,E.imports,uS),R=xn(O),F=Db(O,R),H,X,ce=0,de=p.interpolate||Dp,he="__p += '",ke=Vb((p.escape||Dp).source+"|"+de.source+"|"+(de===Pp?uZ:Dp).source+"|"+(p.evaluate||Dp).source+"|$","g"),De="//# sourceURL="+(Ot.call(p,"sourceURL")?(p.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$Z+"]")+`
17
17
  `;d.replace(ke,function(Ke,pt,vt,Cr,Jn,Er){return vt||(vt=Cr),he+=d.slice(ce,Er).replace(gZ,iQ),pt&&(H=!0,he+=`' +
18
18
  __e(`+pt+`) +
19
19
  '`),Jn&&(X=!0,he+=`';
@@ -30,7 +30,7 @@ __p += '`),vt&&(he+=`' +
30
30
  function print() { __p += __j.call(arguments, '') }
31
31
  `:`;
32
32
  `)+he+`return __p
33
- }`;var ut=tk(function(){return _t(R,De+"return "+he).apply(n,F)});if(ut.source=he,x2(ut))throw ut;return ut}function Bre(d){return Tt(d).toLowerCase()}function Rre(d){return Tt(d).toUpperCase()}function Ire(d,p,v){if(d=Tt(d),d&&(v||p===n))return c_(d);if(!d||!(p=wr(p)))return d;var E=lo(d),O=lo(p),R=d_(E,O),F=f_(E,O)+1;return fs(E,R,F).join("")}function Lre(d,p,v){if(d=Tt(d),d&&(v||p===n))return d.slice(0,h_(d)+1);if(!d||!(p=wr(p)))return d;var E=lo(d),O=f_(E,lo(p))+1;return fs(E,0,O).join("")}function Pre(d,p,v){if(d=Tt(d),d&&(v||p===n))return d.replace(xb,"");if(!d||!(p=wr(p)))return d;var E=lo(d),O=d_(E,lo(p));return fs(E,O).join("")}function Dre(d,p){var v=I,E=V;if(en(p)){var O="separator"in p?p.separator:O;v="length"in p?ot(p.length):v,E="omission"in p?wr(p.omission):E}d=Tt(d);var R=d.length;if(Sl(d)){var F=lo(d);R=F.length}if(v>=R)return d;var H=v-kl(E);if(H<1)return E;var X=F?fs(F,0,H).join(""):d.slice(0,H);if(O===n)return X+E;if(F&&(H+=X.length-H),C2(O)){if(d.slice(H).search(O)){var ce,de=X;for(O.global||(O=Vb(O.source,Tt(RE.exec(O))+"g")),O.lastIndex=0;ce=O.exec(de);)var he=ce.index;X=X.slice(0,he===n?H:he)}}else if(d.indexOf(wr(O),H)!=H){var ke=X.lastIndexOf(O);ke>-1&&(X=X.slice(0,ke))}return X+E}function Fre(d){return d=Tt(d),d&&ai.test(d)?d.replace(si,fQ):d}var Vre=Il(function(d,p,v){return d+(v?" ":"")+p.toUpperCase()}),S2=nS("toUpperCase");function ek(d,p,v){return d=Tt(d),p=v?n:p,p===n?aQ(d)?mQ(d):QZ(d):d.match(p)||[]}var tk=ct(function(d,p){try{return vr(d,n,p)}catch(v){return x2(v)?v:new Qe(v)}}),$re=fi(function(d,p){return $r(p,function(v){v=Lo(v),ci(d,v,y2(d[v],d))}),d});function zre(d){var p=d==null?0:d.length,v=We();return d=p?Xt(d,function(E){if(typeof E[1]!="function")throw new zr(a);return[v(E[0]),E[1]]}):[],ct(function(E){for(var O=-1;++O<p;){var R=d[O];if(vr(R[0],this,E))return vr(R[1],this,E)}})}function Hre(d){return fN(Ur(d,h))}function k2(d){return function(){return d}}function Ure(d,p){return d==null||d!==d?p:d}var Wre=oS(),jre=oS(!0);function lr(d){return d}function T2(d){return L_(typeof d=="function"?d:Ur(d,h))}function qre(d){return D_(Ur(d,h))}function Kre(d,p){return F_(d,Ur(p,h))}var Gre=ct(function(d,p){return function(v){return wc(v,d,p)}}),Xre=ct(function(d,p){return function(v){return wc(d,v,p)}});function A2(d,p,v){var E=wn(p),O=oh(p,E);v==null&&!(en(p)&&(O.length||!E.length))&&(v=p,p=d,d=this,O=oh(p,wn(p)));var R=!(en(v)&&"chain"in v)||!!v.chain,F=hi(d);return $r(O,function(H){var X=p[H];d[H]=X,F&&(d.prototype[H]=function(){var ce=this.__chain__;if(R||ce){var de=d(this.__wrapped__),he=de.__actions__=ir(this.__actions__);return he.push({func:X,args:arguments,thisArg:d}),de.__chain__=ce,de}return X.apply(d,ss([this.value()],arguments))})}),d}function Jre(){return Tn._===this&&(Tn._=xQ),this}function O2(){}function Yre(d){return d=ot(d),ct(function(p){return V_(p,d)})}var Zre=s2(Xt),Qre=s2(i_),Nre=s2(Bb);function nk(d){return p2(d)?Rb(Lo(d)):ON(d)}function eoe(d){return function(p){return d==null?n:la(d,p)}}var toe=sS(),noe=sS(!0);function M2(){return[]}function B2(){return!1}function roe(){return{}}function ooe(){return""}function ioe(){return!0}function soe(d,p){if(d=ot(d),d<1||d>G)return[];var v=ne,E=Fn(d,ne);p=We(p),d-=ne;for(var O=Pb(E,p);++v<d;)p(v);return O}function aoe(d){return Ne(d)?Xt(d,Lo):xr(d)?[d]:ir(CS(Tt(d)))}function loe(d){var p=++yQ;return Tt(d)+p}var uoe=ch(function(d,p){return d+p},0),coe=a2("ceil"),doe=ch(function(d,p){return d/p},1),foe=a2("floor");function poe(d){return d&&d.length?rh(d,lr,Kb):n}function hoe(d,p){return d&&d.length?rh(d,We(p,2),Kb):n}function moe(d){return l_(d,lr)}function goe(d,p){return l_(d,We(p,2))}function boe(d){return d&&d.length?rh(d,lr,Yb):n}function voe(d,p){return d&&d.length?rh(d,We(p,2),Yb):n}var yoe=ch(function(d,p){return d*p},1),woe=a2("round"),xoe=ch(function(d,p){return d-p},0);function Coe(d){return d&&d.length?Lb(d,lr):0}function Eoe(d,p){return d&&d.length?Lb(d,We(p,2)):0}return M.after=qte,M.ary=IS,M.assign=Rne,M.assignIn=GS,M.assignInWith=Eh,M.assignWith=Ine,M.at=Lne,M.before=LS,M.bind=y2,M.bindAll=$re,M.bindKey=PS,M.castArray=rne,M.chain=MS,M.chunk=fee,M.compact=pee,M.concat=hee,M.cond=zre,M.conforms=Hre,M.constant=k2,M.countBy=Cte,M.create=Pne,M.curry=DS,M.curryRight=FS,M.debounce=VS,M.defaults=Dne,M.defaultsDeep=Fne,M.defer=Kte,M.delay=Gte,M.difference=mee,M.differenceBy=gee,M.differenceWith=bee,M.drop=vee,M.dropRight=yee,M.dropRightWhile=wee,M.dropWhile=xee,M.fill=Cee,M.filter=_te,M.flatMap=Tte,M.flatMapDeep=Ate,M.flatMapDepth=Ote,M.flatten=kS,M.flattenDeep=Eee,M.flattenDepth=_ee,M.flip=Xte,M.flow=Wre,M.flowRight=jre,M.fromPairs=See,M.functions=jne,M.functionsIn=qne,M.groupBy=Mte,M.initial=Tee,M.intersection=Aee,M.intersectionBy=Oee,M.intersectionWith=Mee,M.invert=Gne,M.invertBy=Xne,M.invokeMap=Rte,M.iteratee=T2,M.keyBy=Ite,M.keys=wn,M.keysIn=ar,M.map=bh,M.mapKeys=Yne,M.mapValues=Zne,M.matches=qre,M.matchesProperty=Kre,M.memoize=yh,M.merge=Qne,M.mergeWith=XS,M.method=Gre,M.methodOf=Xre,M.mixin=A2,M.negate=wh,M.nthArg=Yre,M.omit=Nne,M.omitBy=ere,M.once=Jte,M.orderBy=Lte,M.over=Zre,M.overArgs=Yte,M.overEvery=Qre,M.overSome=Nre,M.partial=w2,M.partialRight=$S,M.partition=Pte,M.pick=tre,M.pickBy=JS,M.property=nk,M.propertyOf=eoe,M.pull=Lee,M.pullAll=AS,M.pullAllBy=Pee,M.pullAllWith=Dee,M.pullAt=Fee,M.range=toe,M.rangeRight=noe,M.rearg=Zte,M.reject=Vte,M.remove=Vee,M.rest=Qte,M.reverse=b2,M.sampleSize=zte,M.set=rre,M.setWith=ore,M.shuffle=Hte,M.slice=$ee,M.sortBy=jte,M.sortedUniq=Kee,M.sortedUniqBy=Gee,M.split=Tre,M.spread=Nte,M.tail=Xee,M.take=Jee,M.takeRight=Yee,M.takeRightWhile=Zee,M.takeWhile=Qee,M.tap=pte,M.throttle=ene,M.thru=gh,M.toArray=jS,M.toPairs=YS,M.toPairsIn=ZS,M.toPath=aoe,M.toPlainObject=KS,M.transform=ire,M.unary=tne,M.union=Nee,M.unionBy=ete,M.unionWith=tte,M.uniq=nte,M.uniqBy=rte,M.uniqWith=ote,M.unset=sre,M.unzip=v2,M.unzipWith=OS,M.update=are,M.updateWith=lre,M.values=Dl,M.valuesIn=ure,M.without=ite,M.words=ek,M.wrap=nne,M.xor=ste,M.xorBy=ate,M.xorWith=lte,M.zip=ute,M.zipObject=cte,M.zipObjectDeep=dte,M.zipWith=fte,M.entries=YS,M.entriesIn=ZS,M.extend=GS,M.extendWith=Eh,A2(M,M),M.add=uoe,M.attempt=tk,M.camelCase=pre,M.capitalize=QS,M.ceil=coe,M.clamp=cre,M.clone=one,M.cloneDeep=sne,M.cloneDeepWith=ane,M.cloneWith=ine,M.conformsTo=lne,M.deburr=NS,M.defaultTo=Ure,M.divide=doe,M.endsWith=hre,M.eq=co,M.escape=mre,M.escapeRegExp=gre,M.every=Ete,M.find=Ste,M.findIndex=_S,M.findKey=Vne,M.findLast=kte,M.findLastIndex=SS,M.findLastKey=$ne,M.floor=foe,M.forEach=BS,M.forEachRight=RS,M.forIn=zne,M.forInRight=Hne,M.forOwn=Une,M.forOwnRight=Wne,M.get=E2,M.gt=une,M.gte=cne,M.has=Kne,M.hasIn=_2,M.head=TS,M.identity=lr,M.includes=Bte,M.indexOf=kee,M.inRange=dre,M.invoke=Jne,M.isArguments=da,M.isArray=Ne,M.isArrayBuffer=dne,M.isArrayLike=sr,M.isArrayLikeObject=ln,M.isBoolean=fne,M.isBuffer=ps,M.isDate=pne,M.isElement=hne,M.isEmpty=mne,M.isEqual=gne,M.isEqualWith=bne,M.isError=x2,M.isFinite=vne,M.isFunction=hi,M.isInteger=zS,M.isLength=xh,M.isMap=HS,M.isMatch=yne,M.isMatchWith=wne,M.isNaN=xne,M.isNative=Cne,M.isNil=_ne,M.isNull=Ene,M.isNumber=US,M.isObject=en,M.isObjectLike=on,M.isPlainObject=kc,M.isRegExp=C2,M.isSafeInteger=Sne,M.isSet=WS,M.isString=Ch,M.isSymbol=xr,M.isTypedArray=Pl,M.isUndefined=kne,M.isWeakMap=Tne,M.isWeakSet=Ane,M.join=Bee,M.kebabCase=bre,M.last=jr,M.lastIndexOf=Ree,M.lowerCase=vre,M.lowerFirst=yre,M.lt=One,M.lte=Mne,M.max=poe,M.maxBy=hoe,M.mean=moe,M.meanBy=goe,M.min=boe,M.minBy=voe,M.stubArray=M2,M.stubFalse=B2,M.stubObject=roe,M.stubString=ooe,M.stubTrue=ioe,M.multiply=yoe,M.nth=Iee,M.noConflict=Jre,M.noop=O2,M.now=vh,M.pad=wre,M.padEnd=xre,M.padStart=Cre,M.parseInt=Ere,M.random=fre,M.reduce=Dte,M.reduceRight=Fte,M.repeat=_re,M.replace=Sre,M.result=nre,M.round=woe,M.runInContext=j,M.sample=$te,M.size=Ute,M.snakeCase=kre,M.some=Wte,M.sortedIndex=zee,M.sortedIndexBy=Hee,M.sortedIndexOf=Uee,M.sortedLastIndex=Wee,M.sortedLastIndexBy=jee,M.sortedLastIndexOf=qee,M.startCase=Are,M.startsWith=Ore,M.subtract=xoe,M.sum=Coe,M.sumBy=Eoe,M.template=Mre,M.times=soe,M.toFinite=mi,M.toInteger=ot,M.toLength=qS,M.toLower=Bre,M.toNumber=qr,M.toSafeInteger=Bne,M.toString=Tt,M.toUpper=Rre,M.trim=Ire,M.trimEnd=Lre,M.trimStart=Pre,M.truncate=Dre,M.unescape=Fre,M.uniqueId=loe,M.upperCase=Vre,M.upperFirst=S2,M.each=BS,M.eachRight=RS,M.first=TS,A2(M,function(){var d={};return Ro(M,function(p,v){Ot.call(M.prototype,v)||(d[v]=p)}),d}(),{chain:!1}),M.VERSION=r,$r(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){M[d].placeholder=M}),$r(["drop","take"],function(d,p){gt.prototype[d]=function(v){v=v===n?1:mn(ot(v),0);var E=this.__filtered__&&!p?new gt(this):this.clone();return E.__filtered__?E.__takeCount__=Fn(v,E.__takeCount__):E.__views__.push({size:Fn(v,ne),type:d+(E.__dir__<0?"Right":"")}),E},gt.prototype[d+"Right"]=function(v){return this.reverse()[d](v).reverse()}}),$r(["filter","map","takeWhile"],function(d,p){var v=p+1,E=v==me||v==U;gt.prototype[d]=function(O){var R=this.clone();return R.__iteratees__.push({iteratee:We(O,3),type:v}),R.__filtered__=R.__filtered__||E,R}}),$r(["head","last"],function(d,p){var v="take"+(p?"Right":"");gt.prototype[d]=function(){return this[v](1).value()[0]}}),$r(["initial","tail"],function(d,p){var v="drop"+(p?"":"Right");gt.prototype[d]=function(){return this.__filtered__?new gt(this):this[v](1)}}),gt.prototype.compact=function(){return this.filter(lr)},gt.prototype.find=function(d){return this.filter(d).head()},gt.prototype.findLast=function(d){return this.reverse().find(d)},gt.prototype.invokeMap=ct(function(d,p){return typeof d=="function"?new gt(this):this.map(function(v){return wc(v,d,p)})}),gt.prototype.reject=function(d){return this.filter(wh(We(d)))},gt.prototype.slice=function(d,p){d=ot(d);var v=this;return v.__filtered__&&(d>0||p<0)?new gt(v):(d<0?v=v.takeRight(-d):d&&(v=v.drop(d)),p!==n&&(p=ot(p),v=p<0?v.dropRight(-p):v.take(p-d)),v)},gt.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},gt.prototype.toArray=function(){return this.take(ne)},Ro(gt.prototype,function(d,p){var v=/^(?:filter|find|map|reject)|While$/.test(p),E=/^(?:head|last)$/.test(p),O=M[E?"take"+(p=="last"?"Right":""):p],R=E||/^find/.test(p);O&&(M.prototype[p]=function(){var F=this.__wrapped__,H=E?[1]:arguments,X=F instanceof gt,ce=H[0],de=X||Ne(F),he=function(pt){var vt=O.apply(M,ss([pt],H));return E&&ke?vt[0]:vt};de&&v&&typeof ce=="function"&&ce.length!=1&&(X=de=!1);var ke=this.__chain__,De=!!this.__actions__.length,qe=R&&!ke,ut=X&&!De;if(!R&&de){F=ut?F:new gt(this);var Ke=d.apply(F,H);return Ke.__actions__.push({func:gh,args:[he],thisArg:n}),new Hr(Ke,ke)}return qe&&ut?d.apply(this,H):(Ke=this.thru(he),qe?E?Ke.value()[0]:Ke.value():Ke)})}),$r(["pop","push","shift","sort","splice","unshift"],function(d){var p=Up[d],v=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",E=/^(?:pop|shift)$/.test(d);M.prototype[d]=function(){var O=arguments;if(E&&!this.__chain__){var R=this.value();return p.apply(Ne(R)?R:[],O)}return this[v](function(F){return p.apply(Ne(F)?F:[],O)})}}),Ro(gt.prototype,function(d,p){var v=M[p];if(v){var E=v.name+"";Ot.call(Ml,E)||(Ml[E]=[]),Ml[E].push({name:p,func:v})}}),Ml[uh(n,x).name]=[{name:"wrapper",func:n}],gt.prototype.clone=FQ,gt.prototype.reverse=VQ,gt.prototype.value=$Q,M.prototype.at=hte,M.prototype.chain=mte,M.prototype.commit=gte,M.prototype.next=bte,M.prototype.plant=yte,M.prototype.reverse=wte,M.prototype.toJSON=M.prototype.valueOf=M.prototype.value=xte,M.prototype.first=M.prototype.head,pc&&(M.prototype[pc]=vte),M},Tl=gQ();ra?((ra.exports=Tl)._=Tl,Tb._=Tl):Tn._=Tl}).call(Ea)}(ed,ed.exports);var Et=ed.exports;const xn=(t,e="px")=>{if(!t)return t;const n=cm(t)?String(t):t,r=parseFloat(n),o=n.match(/[a-zA-Z%]+$/),s=o?o[0]:e;return isNaN(r)?t:r+s};function dO(t,e,n){return t<e?e:t>n?n:t}const cm=t=>typeof t=="number",dm=t=>typeof t=="function";function fm(t,e){const{extensions:n=[]}=t.extensionManager??{};return!!n.find(o=>o.name===e)}function py(t){return/\s/.test(t)}function hy(t,e){const n=[];let r=0;for(;r<t.length;){if(t.length-r<=e){n.push({text:t.substring(r),offset:r});break}let o=-1;for(let a=r+e;a>r;a--)if(py(t[a])){o=a;break}let s;if(o>r)for(n.push({text:t.substring(r,o),offset:r}),s=o;s<t.length&&py(t[s]);)s++;else s=r+e,n.push({text:t.substring(r,s),offset:r});r=s}return n.filter(o=>o.text.length>0)}/*!
33
+ }`;var ut=tk(function(){return _t(R,De+"return "+he).apply(n,F)});if(ut.source=he,x2(ut))throw ut;return ut}function Bre(d){return Tt(d).toLowerCase()}function Rre(d){return Tt(d).toUpperCase()}function Ire(d,p,v){if(d=Tt(d),d&&(v||p===n))return c_(d);if(!d||!(p=wr(p)))return d;var E=lo(d),O=lo(p),R=d_(E,O),F=f_(E,O)+1;return fs(E,R,F).join("")}function Lre(d,p,v){if(d=Tt(d),d&&(v||p===n))return d.slice(0,h_(d)+1);if(!d||!(p=wr(p)))return d;var E=lo(d),O=f_(E,lo(p))+1;return fs(E,0,O).join("")}function Pre(d,p,v){if(d=Tt(d),d&&(v||p===n))return d.replace(xb,"");if(!d||!(p=wr(p)))return d;var E=lo(d),O=d_(E,lo(p));return fs(E,O).join("")}function Dre(d,p){var v=I,E=V;if(en(p)){var O="separator"in p?p.separator:O;v="length"in p?ot(p.length):v,E="omission"in p?wr(p.omission):E}d=Tt(d);var R=d.length;if(Sl(d)){var F=lo(d);R=F.length}if(v>=R)return d;var H=v-kl(E);if(H<1)return E;var X=F?fs(F,0,H).join(""):d.slice(0,H);if(O===n)return X+E;if(F&&(H+=X.length-H),C2(O)){if(d.slice(H).search(O)){var ce,de=X;for(O.global||(O=Vb(O.source,Tt(RE.exec(O))+"g")),O.lastIndex=0;ce=O.exec(de);)var he=ce.index;X=X.slice(0,he===n?H:he)}}else if(d.indexOf(wr(O),H)!=H){var ke=X.lastIndexOf(O);ke>-1&&(X=X.slice(0,ke))}return X+E}function Fre(d){return d=Tt(d),d&&ai.test(d)?d.replace(si,fQ):d}var Vre=Il(function(d,p,v){return d+(v?" ":"")+p.toUpperCase()}),S2=nS("toUpperCase");function ek(d,p,v){return d=Tt(d),p=v?n:p,p===n?aQ(d)?mQ(d):QZ(d):d.match(p)||[]}var tk=ct(function(d,p){try{return vr(d,n,p)}catch(v){return x2(v)?v:new Qe(v)}}),$re=fi(function(d,p){return $r(p,function(v){v=Lo(v),ci(d,v,y2(d[v],d))}),d});function zre(d){var p=d==null?0:d.length,v=We();return d=p?Xt(d,function(E){if(typeof E[1]!="function")throw new zr(a);return[v(E[0]),E[1]]}):[],ct(function(E){for(var O=-1;++O<p;){var R=d[O];if(vr(R[0],this,E))return vr(R[1],this,E)}})}function Hre(d){return fN(Ur(d,h))}function k2(d){return function(){return d}}function Ure(d,p){return d==null||d!==d?p:d}var Wre=oS(),jre=oS(!0);function lr(d){return d}function T2(d){return L_(typeof d=="function"?d:Ur(d,h))}function qre(d){return D_(Ur(d,h))}function Kre(d,p){return F_(d,Ur(p,h))}var Gre=ct(function(d,p){return function(v){return wc(v,d,p)}}),Xre=ct(function(d,p){return function(v){return wc(d,v,p)}});function A2(d,p,v){var E=xn(p),O=oh(p,E);v==null&&!(en(p)&&(O.length||!E.length))&&(v=p,p=d,d=this,O=oh(p,xn(p)));var R=!(en(v)&&"chain"in v)||!!v.chain,F=hi(d);return $r(O,function(H){var X=p[H];d[H]=X,F&&(d.prototype[H]=function(){var ce=this.__chain__;if(R||ce){var de=d(this.__wrapped__),he=de.__actions__=ir(this.__actions__);return he.push({func:X,args:arguments,thisArg:d}),de.__chain__=ce,de}return X.apply(d,ss([this.value()],arguments))})}),d}function Jre(){return Tn._===this&&(Tn._=xQ),this}function O2(){}function Yre(d){return d=ot(d),ct(function(p){return V_(p,d)})}var Zre=s2(Xt),Qre=s2(i_),Nre=s2(Bb);function nk(d){return p2(d)?Rb(Lo(d)):ON(d)}function eoe(d){return function(p){return d==null?n:la(d,p)}}var toe=sS(),noe=sS(!0);function M2(){return[]}function B2(){return!1}function roe(){return{}}function ooe(){return""}function ioe(){return!0}function soe(d,p){if(d=ot(d),d<1||d>G)return[];var v=ne,E=Fn(d,ne);p=We(p),d-=ne;for(var O=Pb(E,p);++v<d;)p(v);return O}function aoe(d){return Ne(d)?Xt(d,Lo):xr(d)?[d]:ir(CS(Tt(d)))}function loe(d){var p=++yQ;return Tt(d)+p}var uoe=ch(function(d,p){return d+p},0),coe=a2("ceil"),doe=ch(function(d,p){return d/p},1),foe=a2("floor");function poe(d){return d&&d.length?rh(d,lr,Kb):n}function hoe(d,p){return d&&d.length?rh(d,We(p,2),Kb):n}function moe(d){return l_(d,lr)}function goe(d,p){return l_(d,We(p,2))}function boe(d){return d&&d.length?rh(d,lr,Yb):n}function voe(d,p){return d&&d.length?rh(d,We(p,2),Yb):n}var yoe=ch(function(d,p){return d*p},1),woe=a2("round"),xoe=ch(function(d,p){return d-p},0);function Coe(d){return d&&d.length?Lb(d,lr):0}function Eoe(d,p){return d&&d.length?Lb(d,We(p,2)):0}return M.after=qte,M.ary=IS,M.assign=Rne,M.assignIn=GS,M.assignInWith=Eh,M.assignWith=Ine,M.at=Lne,M.before=LS,M.bind=y2,M.bindAll=$re,M.bindKey=PS,M.castArray=rne,M.chain=MS,M.chunk=fee,M.compact=pee,M.concat=hee,M.cond=zre,M.conforms=Hre,M.constant=k2,M.countBy=Cte,M.create=Pne,M.curry=DS,M.curryRight=FS,M.debounce=VS,M.defaults=Dne,M.defaultsDeep=Fne,M.defer=Kte,M.delay=Gte,M.difference=mee,M.differenceBy=gee,M.differenceWith=bee,M.drop=vee,M.dropRight=yee,M.dropRightWhile=wee,M.dropWhile=xee,M.fill=Cee,M.filter=_te,M.flatMap=Tte,M.flatMapDeep=Ate,M.flatMapDepth=Ote,M.flatten=kS,M.flattenDeep=Eee,M.flattenDepth=_ee,M.flip=Xte,M.flow=Wre,M.flowRight=jre,M.fromPairs=See,M.functions=jne,M.functionsIn=qne,M.groupBy=Mte,M.initial=Tee,M.intersection=Aee,M.intersectionBy=Oee,M.intersectionWith=Mee,M.invert=Gne,M.invertBy=Xne,M.invokeMap=Rte,M.iteratee=T2,M.keyBy=Ite,M.keys=xn,M.keysIn=ar,M.map=bh,M.mapKeys=Yne,M.mapValues=Zne,M.matches=qre,M.matchesProperty=Kre,M.memoize=yh,M.merge=Qne,M.mergeWith=XS,M.method=Gre,M.methodOf=Xre,M.mixin=A2,M.negate=wh,M.nthArg=Yre,M.omit=Nne,M.omitBy=ere,M.once=Jte,M.orderBy=Lte,M.over=Zre,M.overArgs=Yte,M.overEvery=Qre,M.overSome=Nre,M.partial=w2,M.partialRight=$S,M.partition=Pte,M.pick=tre,M.pickBy=JS,M.property=nk,M.propertyOf=eoe,M.pull=Lee,M.pullAll=AS,M.pullAllBy=Pee,M.pullAllWith=Dee,M.pullAt=Fee,M.range=toe,M.rangeRight=noe,M.rearg=Zte,M.reject=Vte,M.remove=Vee,M.rest=Qte,M.reverse=b2,M.sampleSize=zte,M.set=rre,M.setWith=ore,M.shuffle=Hte,M.slice=$ee,M.sortBy=jte,M.sortedUniq=Kee,M.sortedUniqBy=Gee,M.split=Tre,M.spread=Nte,M.tail=Xee,M.take=Jee,M.takeRight=Yee,M.takeRightWhile=Zee,M.takeWhile=Qee,M.tap=pte,M.throttle=ene,M.thru=gh,M.toArray=jS,M.toPairs=YS,M.toPairsIn=ZS,M.toPath=aoe,M.toPlainObject=KS,M.transform=ire,M.unary=tne,M.union=Nee,M.unionBy=ete,M.unionWith=tte,M.uniq=nte,M.uniqBy=rte,M.uniqWith=ote,M.unset=sre,M.unzip=v2,M.unzipWith=OS,M.update=are,M.updateWith=lre,M.values=Dl,M.valuesIn=ure,M.without=ite,M.words=ek,M.wrap=nne,M.xor=ste,M.xorBy=ate,M.xorWith=lte,M.zip=ute,M.zipObject=cte,M.zipObjectDeep=dte,M.zipWith=fte,M.entries=YS,M.entriesIn=ZS,M.extend=GS,M.extendWith=Eh,A2(M,M),M.add=uoe,M.attempt=tk,M.camelCase=pre,M.capitalize=QS,M.ceil=coe,M.clamp=cre,M.clone=one,M.cloneDeep=sne,M.cloneDeepWith=ane,M.cloneWith=ine,M.conformsTo=lne,M.deburr=NS,M.defaultTo=Ure,M.divide=doe,M.endsWith=hre,M.eq=co,M.escape=mre,M.escapeRegExp=gre,M.every=Ete,M.find=Ste,M.findIndex=_S,M.findKey=Vne,M.findLast=kte,M.findLastIndex=SS,M.findLastKey=$ne,M.floor=foe,M.forEach=BS,M.forEachRight=RS,M.forIn=zne,M.forInRight=Hne,M.forOwn=Une,M.forOwnRight=Wne,M.get=E2,M.gt=une,M.gte=cne,M.has=Kne,M.hasIn=_2,M.head=TS,M.identity=lr,M.includes=Bte,M.indexOf=kee,M.inRange=dre,M.invoke=Jne,M.isArguments=da,M.isArray=Ne,M.isArrayBuffer=dne,M.isArrayLike=sr,M.isArrayLikeObject=ln,M.isBoolean=fne,M.isBuffer=ps,M.isDate=pne,M.isElement=hne,M.isEmpty=mne,M.isEqual=gne,M.isEqualWith=bne,M.isError=x2,M.isFinite=vne,M.isFunction=hi,M.isInteger=zS,M.isLength=xh,M.isMap=HS,M.isMatch=yne,M.isMatchWith=wne,M.isNaN=xne,M.isNative=Cne,M.isNil=_ne,M.isNull=Ene,M.isNumber=US,M.isObject=en,M.isObjectLike=on,M.isPlainObject=kc,M.isRegExp=C2,M.isSafeInteger=Sne,M.isSet=WS,M.isString=Ch,M.isSymbol=xr,M.isTypedArray=Pl,M.isUndefined=kne,M.isWeakMap=Tne,M.isWeakSet=Ane,M.join=Bee,M.kebabCase=bre,M.last=jr,M.lastIndexOf=Ree,M.lowerCase=vre,M.lowerFirst=yre,M.lt=One,M.lte=Mne,M.max=poe,M.maxBy=hoe,M.mean=moe,M.meanBy=goe,M.min=boe,M.minBy=voe,M.stubArray=M2,M.stubFalse=B2,M.stubObject=roe,M.stubString=ooe,M.stubTrue=ioe,M.multiply=yoe,M.nth=Iee,M.noConflict=Jre,M.noop=O2,M.now=vh,M.pad=wre,M.padEnd=xre,M.padStart=Cre,M.parseInt=Ere,M.random=fre,M.reduce=Dte,M.reduceRight=Fte,M.repeat=_re,M.replace=Sre,M.result=nre,M.round=woe,M.runInContext=j,M.sample=$te,M.size=Ute,M.snakeCase=kre,M.some=Wte,M.sortedIndex=zee,M.sortedIndexBy=Hee,M.sortedIndexOf=Uee,M.sortedLastIndex=Wee,M.sortedLastIndexBy=jee,M.sortedLastIndexOf=qee,M.startCase=Are,M.startsWith=Ore,M.subtract=xoe,M.sum=Coe,M.sumBy=Eoe,M.template=Mre,M.times=soe,M.toFinite=mi,M.toInteger=ot,M.toLength=qS,M.toLower=Bre,M.toNumber=qr,M.toSafeInteger=Bne,M.toString=Tt,M.toUpper=Rre,M.trim=Ire,M.trimEnd=Lre,M.trimStart=Pre,M.truncate=Dre,M.unescape=Fre,M.uniqueId=loe,M.upperCase=Vre,M.upperFirst=S2,M.each=BS,M.eachRight=RS,M.first=TS,A2(M,function(){var d={};return Ro(M,function(p,v){Ot.call(M.prototype,v)||(d[v]=p)}),d}(),{chain:!1}),M.VERSION=r,$r(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){M[d].placeholder=M}),$r(["drop","take"],function(d,p){gt.prototype[d]=function(v){v=v===n?1:mn(ot(v),0);var E=this.__filtered__&&!p?new gt(this):this.clone();return E.__filtered__?E.__takeCount__=Fn(v,E.__takeCount__):E.__views__.push({size:Fn(v,ne),type:d+(E.__dir__<0?"Right":"")}),E},gt.prototype[d+"Right"]=function(v){return this.reverse()[d](v).reverse()}}),$r(["filter","map","takeWhile"],function(d,p){var v=p+1,E=v==me||v==U;gt.prototype[d]=function(O){var R=this.clone();return R.__iteratees__.push({iteratee:We(O,3),type:v}),R.__filtered__=R.__filtered__||E,R}}),$r(["head","last"],function(d,p){var v="take"+(p?"Right":"");gt.prototype[d]=function(){return this[v](1).value()[0]}}),$r(["initial","tail"],function(d,p){var v="drop"+(p?"":"Right");gt.prototype[d]=function(){return this.__filtered__?new gt(this):this[v](1)}}),gt.prototype.compact=function(){return this.filter(lr)},gt.prototype.find=function(d){return this.filter(d).head()},gt.prototype.findLast=function(d){return this.reverse().find(d)},gt.prototype.invokeMap=ct(function(d,p){return typeof d=="function"?new gt(this):this.map(function(v){return wc(v,d,p)})}),gt.prototype.reject=function(d){return this.filter(wh(We(d)))},gt.prototype.slice=function(d,p){d=ot(d);var v=this;return v.__filtered__&&(d>0||p<0)?new gt(v):(d<0?v=v.takeRight(-d):d&&(v=v.drop(d)),p!==n&&(p=ot(p),v=p<0?v.dropRight(-p):v.take(p-d)),v)},gt.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},gt.prototype.toArray=function(){return this.take(ne)},Ro(gt.prototype,function(d,p){var v=/^(?:filter|find|map|reject)|While$/.test(p),E=/^(?:head|last)$/.test(p),O=M[E?"take"+(p=="last"?"Right":""):p],R=E||/^find/.test(p);O&&(M.prototype[p]=function(){var F=this.__wrapped__,H=E?[1]:arguments,X=F instanceof gt,ce=H[0],de=X||Ne(F),he=function(pt){var vt=O.apply(M,ss([pt],H));return E&&ke?vt[0]:vt};de&&v&&typeof ce=="function"&&ce.length!=1&&(X=de=!1);var ke=this.__chain__,De=!!this.__actions__.length,qe=R&&!ke,ut=X&&!De;if(!R&&de){F=ut?F:new gt(this);var Ke=d.apply(F,H);return Ke.__actions__.push({func:gh,args:[he],thisArg:n}),new Hr(Ke,ke)}return qe&&ut?d.apply(this,H):(Ke=this.thru(he),qe?E?Ke.value()[0]:Ke.value():Ke)})}),$r(["pop","push","shift","sort","splice","unshift"],function(d){var p=Up[d],v=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",E=/^(?:pop|shift)$/.test(d);M.prototype[d]=function(){var O=arguments;if(E&&!this.__chain__){var R=this.value();return p.apply(Ne(R)?R:[],O)}return this[v](function(F){return p.apply(Ne(F)?F:[],O)})}}),Ro(gt.prototype,function(d,p){var v=M[p];if(v){var E=v.name+"";Ot.call(Ml,E)||(Ml[E]=[]),Ml[E].push({name:p,func:v})}}),Ml[uh(n,x).name]=[{name:"wrapper",func:n}],gt.prototype.clone=FQ,gt.prototype.reverse=VQ,gt.prototype.value=$Q,M.prototype.at=hte,M.prototype.chain=mte,M.prototype.commit=gte,M.prototype.next=bte,M.prototype.plant=yte,M.prototype.reverse=wte,M.prototype.toJSON=M.prototype.valueOf=M.prototype.value=xte,M.prototype.first=M.prototype.head,pc&&(M.prototype[pc]=vte),M},Tl=gQ();ra?((ra.exports=Tl)._=Tl,Tb._=Tl):Tn._=Tl}).call(Ea)}(ed,ed.exports);var Et=ed.exports;const gn=(t,e="px")=>{if(!t)return t;const n=cm(t)?String(t):t,r=parseFloat(n),o=n.match(/[a-zA-Z%]+$/),s=o?o[0]:e;return isNaN(r)?t:r+s};function dO(t,e,n){return t<e?e:t>n?n:t}const cm=t=>typeof t=="number",dm=t=>typeof t=="function";function fm(t,e){const{extensions:n=[]}=t.extensionManager??{};return!!n.find(o=>o.name===e)}function py(t){return/\s/.test(t)}function hy(t,e){const n=[];let r=0;for(;r<t.length;){if(t.length-r<=e){n.push({text:t.substring(r),offset:r});break}let o=-1;for(let a=r+e;a>r;a--)if(py(t[a])){o=a;break}let s;if(o>r)for(n.push({text:t.substring(r,o),offset:r}),s=o;s<t.length&&py(t[s]);)s++;else s=r+e,n.push({text:t.substring(r,s),offset:r});r=s}return n.filter(o=>o.text.length>0)}/*!
34
34
  * shared v10.0.6
35
35
  * (c) 2025 kazuya kawaguchi
36
36
  * Released under the MIT License.
@@ -91,16 +91,16 @@ ${c}`:u)}else throw a},onCacheKey:a=>pO(e,n,a)}}function rB(t){if(Se(t))return t
91
91
  `,width:18,height:19}}})}Y3();const ZR={key:0},QR={key:1,class:"flex items-center gap-1"},NR={key:2},eI={class:"flex flex-col items-center text-center max-w-24"},tI={key:0,style:{display:"flex",gap:"4px"}},je=i.defineComponent({__name:"ActionButton",props:{icon:{default:void 0},iconClass:{default:""},title:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},hidden:{type:Boolean},shortcutKeys:{default:void 0},customClass:{default:""},customClassTooltip:{default:""},loading:{type:Boolean,default:!1},tooltipOptions:{default:void 0},color:{default:void 0},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0},editor:{},variant:{default:"ghost"},class:{},id:{default:""}},setup(t){return(e,n)=>(i.openBlock(),i.createBlock(i.unref(Pa),null,{default:i.withCtx(()=>[i.createVNode(i.unref(Ia),{"delay-duration":0},{default:i.withCtx(()=>[i.createVNode(i.unref(La),{class:i.normalizeClass(e.customClassTooltip)},{default:i.withCtx(()=>{var r;return[i.createVNode(i.unref(_3),{id:`action-btn-${e.id}`,size:"sm",class:i.normalizeClass(["h-[32px]",i.unref($e)([e.customClass],{hidden:e.hidden})]),pressed:((r=e.isActive)==null?void 0:r.call(e))||!1,disabled:e.disabled,onClick:e.action},{default:i.withCtx(()=>[e.loading?(i.openBlock(),i.createElementBlock("div",ZR,[i.createVNode(i.unref(Kt),{class:"animate-spin",name:"LoaderCircle"})])):e.icon||e.$slots.icon?(i.openBlock(),i.createElementBlock("div",QR,[e.icon?(i.openBlock(),i.createBlock(i.unref(Kt),{key:0,name:e.icon,class:i.normalizeClass(e.iconClass)},null,8,["name","class"])):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"icon")])):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"default"),e.title?(i.openBlock(),i.createElementBlock("span",NR,i.toDisplayString(e.title),1)):i.createCommentVNode("",!0)]),_:3},8,["id","pressed","disabled","class","onClick"])]}),_:3},8,["class"]),e.tooltip?(i.openBlock(),i.createBlock(i.unref(_s),i.normalizeProps(i.mergeProps({key:0},e.tooltipOptions)),{default:i.withCtx(()=>[i.createElementVNode("div",eI,[i.createElementVNode("div",null,i.toDisplayString(e.tooltip),1),e.shortcutKeys&&e.shortcutKeys.length?(i.openBlock(),i.createElementBlock("div",tI,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.shortcutKeys,(r,o)=>(i.openBlock(),i.createElementBlock("span",{key:o},i.toDisplayString(i.unref(fd)(r)),1))),128))])):i.createCommentVNode("",!0)])]),_:1},16)):i.createCommentVNode("",!0)]),_:3})]),_:3}))}});function Cn(t){this.content=t}Cn.prototype={constructor:Cn,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 r=n&&n!=t?this.remove(n):this,o=r.find(t),s=r.content.slice();return o==-1?s.push(n||t,e):(s[o+1]=e,n&&(s[o]=n)),new Cn(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 Cn(n)},addToStart:function(t,e){return new Cn([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Cn(n)},addBefore:function(t,e,n){var r=this.remove(e),o=r.content.slice(),s=r.find(t);return o.splice(s==-1?o.length:s,0,e,n),new Cn(o)},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=Cn.from(t),t.size?new Cn(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Cn.from(t),t.size?new Cn(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Cn.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}},Cn.from=function(t){if(t instanceof Cn)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Cn(e)};function Z3(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let o=t.child(r),s=e.child(r);if(o==s){n+=o.nodeSize;continue}if(!o.sameMarkup(s))return n;if(o.isText&&o.text!=s.text){for(let a=0;o.text[a]==s.text[a];a++)n++;return n}if(o.content.size||s.content.size){let a=Z3(o.content,s.content,n+1);if(a!=null)return a}n+=o.nodeSize}}function Q3(t,e,n,r){for(let o=t.childCount,s=e.childCount;;){if(o==0||s==0)return o==s?null:{a:n,b:r};let a=t.child(--o),l=e.child(--s),u=a.nodeSize;if(a==l){n-=u,r-=u;continue}if(!a.sameMarkup(l))return{a:n,b:r};if(a.isText&&a.text!=l.text){let c=0,f=Math.min(a.text.length,l.text.length);for(;c<f&&a.text[a.text.length-c-1]==l.text[l.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(a.content.size||l.content.size){let c=Q3(a.content,l.content,n-1,r-1);if(c)return c}n-=u,r-=u}}class ue{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,o=0,s){for(let a=0,l=0;l<n;a++){let u=this.content[a],c=l+u.nodeSize;if(c>e&&r(u,o+l,s||null,a)!==!1&&u.content.size){let f=l+1;u.nodesBetween(Math.max(0,e-f),Math.min(u.content.size,n-f),r,o+f)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,o){let s="",a=!0;return this.nodesBetween(e,n,(l,u)=>{let c=l.isText?l.text.slice(Math.max(e,u)-u,n-u):l.isLeaf?o?typeof o=="function"?o(l):o:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(a?a=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,o=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)o.push(e.content[s]);return new ue(o,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],o=0;if(n>e)for(let s=0,a=0;a<n;s++){let l=this.content[s],u=a+l.nodeSize;u>e&&((a<e||u>n)&&(l.isText?l=l.cut(Math.max(0,e-a),Math.min(l.text.length,n-a)):l=l.cut(Math.max(0,e-a-1),Math.min(l.content.size,n-a-1))),r.push(l),o+=l.nodeSize),a=u}return new ue(r,o)}cutByIndex(e,n){return e==n?ue.empty:e==0&&n==this.content.length?this:new ue(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let o=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return o[e]=n,new ue(o,s)}addToStart(e){return new ue([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ue(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,r=0;n<this.content.length;n++){let o=this.content[n];e(o,r,n),r+=o.nodeSize}}findDiffStart(e,n=0){return Z3(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Q3(this,e,n,r)}findIndex(e,n=-1){if(e==0)return yd(0,e);if(e==this.size)return yd(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,o=0;;r++){let s=this.child(r),a=o+s.nodeSize;if(a>=e)return a==e||n>0?yd(r+1,a):yd(r,o);o=a}}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 ue.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new ue(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ue.empty;let n,r=0;for(let o=0;o<e.length;o++){let s=e[o];r+=s.nodeSize,o&&s.isText&&e[o-1].sameMarkup(s)?(n||(n=e.slice(0,o)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new ue(n||e,r)}static from(e){if(!e)return ue.empty;if(e instanceof ue)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new ue([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}ue.empty=new ue([],0);const e0={index:0,offset:0};function yd(t,e){return e0.index=t,e0.offset=e,e0}function wd(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 r=0;r<t.length;r++)if(!wd(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!wd(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let Ft=class R2{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let o=0;o<e.length;o++){let s=e[o];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,o));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,o)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||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&&wd(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 r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let o=r.create(n.attrs);return r.checkAttrs(o.attrs),o}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return R2.none;if(e instanceof R2)return[e];let n=e.slice();return n.sort((r,o)=>r.type.rank-o.type.rank),n}};Ft.none=[];class xd extends Error{}class xe{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=e4(this.content,e+this.openStart,n);return r&&new xe(r,this.openStart,this.openEnd)}removeBetween(e,n){return new xe(N3(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 xe.empty;let r=n.openStart||0,o=n.openEnd||0;if(typeof r!="number"||typeof o!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new xe(ue.fromJSON(e,n.content),r,o)}static maxOpen(e,n=!0){let r=0,o=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)o++;return new xe(e,r,o)}}xe.empty=new xe(ue.empty,0,0);function N3(t,e,n){let{index:r,offset:o}=t.findIndex(e),s=t.maybeChild(r),{index:a,offset:l}=t.findIndex(n);if(o==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(r!=a)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(N3(s.content,e-o-1,n-o-1)))}function e4(t,e,n,r){let{index:o,offset:s}=t.findIndex(e),a=t.maybeChild(o);if(s==e||a.isText)return t.cut(0,e).append(n).append(t.cut(e));let l=e4(a.content,e-s-1,n);return l&&t.replaceChild(o,a.copy(l))}function nI(t,e,n){if(n.openStart>t.depth)throw new xd("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new xd("Inconsistent open depths");return t4(t,e,n,0)}function t4(t,e,n,r){let o=t.index(r),s=t.node(r);if(o==e.index(r)&&r<t.depth-n.openStart){let a=t4(t,e,n,r+1);return s.copy(s.content.replaceChild(o,a))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let a=t.parent,l=a.content;return ks(a,l.cut(0,t.parentOffset).append(n.content).append(l.cut(e.parentOffset)))}else{let{start:a,end:l}=rI(n,t);return ks(s,r4(t,a,l,e,r))}else return ks(s,Cd(t,e,r))}function n4(t,e){if(!e.type.compatibleContent(t.type))throw new xd("Cannot join "+e.type.name+" onto "+t.type.name)}function t0(t,e,n){let r=t.node(n);return n4(r,e.node(n)),r}function Ss(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 ou(t,e,n,r){let o=(e||t).node(n),s=0,a=e?e.index(n):o.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(Ss(t.nodeAfter,r),s++));for(let l=s;l<a;l++)Ss(o.child(l),r);e&&e.depth==n&&e.textOffset&&Ss(e.nodeBefore,r)}function ks(t,e){return t.type.checkContent(e),t.copy(e)}function r4(t,e,n,r,o){let s=t.depth>o&&t0(t,e,o+1),a=r.depth>o&&t0(n,r,o+1),l=[];return ou(null,t,o,l),s&&a&&e.index(o)==n.index(o)?(n4(s,a),Ss(ks(s,r4(t,e,n,r,o+1)),l)):(s&&Ss(ks(s,Cd(t,e,o+1)),l),ou(e,n,o,l),a&&Ss(ks(a,Cd(n,r,o+1)),l)),ou(r,null,o,l),new ue(l)}function Cd(t,e,n){let r=[];if(ou(null,t,n,r),t.depth>n){let o=t0(t,e,n+1);Ss(ks(o,Cd(t,e,n+1)),r)}return ou(e,null,n,r),new ue(r)}function rI(t,e){let n=e.depth-t.openStart,o=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)o=e.node(s).copy(ue.from(o));return{start:o.resolveNoCache(t.openStart+n),end:o.resolveNoCache(o.content.size-t.openEnd-n)}}class iu{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,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[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].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 r=this.pos-this.path[this.path.length-1],o=e.child(n);return r?e.child(n).cut(r):o}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 r=this.path[n*3],o=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)o+=r.child(s).nodeSize;return o}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return Ft.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),o=e.maybeChild(n);if(!r){let l=r;r=o,o=l}let s=r.marks;for(var a=0;a<s.length;a++)s[a].type.spec.inclusive===!1&&(!o||!s[a].isInSet(o.marks))&&(s=s[a--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,o=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!o||!r[s].isInSet(o.marks))&&(r=r[s--].removeFromSet(r));return r}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 r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ed(this,e,r);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 r=[],o=0,s=n;for(let a=e;;){let{index:l,offset:u}=a.content.findIndex(s),c=s-u;if(r.push(a,l,o+u),!c||(a=a.child(l),a.isText))break;s=c-1,o+=u+1}return new iu(n,r,s)}static resolveCached(e,n){let r=o4.get(e);if(r)for(let s=0;s<r.elts.length;s++){let a=r.elts[s];if(a.pos==n)return a}else o4.set(e,r=new oI);let o=r.elts[r.i]=iu.resolve(e,n);return r.i=(r.i+1)%iI,o}}class oI{constructor(){this.elts=[],this.i=0}}const iI=12,o4=new WeakMap;class Ed{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}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 sI=Object.create(null);let Nr=class I2{constructor(e,n,r,o=Ft.none){this.type=e,this.attrs=n,this.marks=o,this.content=r||ue.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,r,o=0){this.content.nodesBetween(e,n,r,o,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,r,o){return this.content.textBetween(e,n,r,o)}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,r){return this.type==e&&wd(this.attrs,n||e.defaultAttrs||sI)&&Ft.sameSet(this.marks,r||Ft.none)}copy(e=null){return e==this.content?this:new I2(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new I2(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,r=!1){if(e==n)return xe.empty;let o=this.resolve(e),s=this.resolve(n),a=r?0:o.sharedDepth(n),l=o.start(a),c=o.node(a).content.cut(o.pos-l,s.pos-l);return new xe(c,o.depth-a,s.depth-a)}replace(e,n,r){return nI(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:o}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(o==e||n.isText)return n;e-=o+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let o=this.content.child(n-1);return{node:o,index:n-1,offset:r-o.nodeSize}}resolve(e){return iu.resolveCached(this,e)}resolveNoCache(e){return iu.resolve(this,e)}rangeHasMark(e,n,r){let o=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(o=!0),!o)),o}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()+")"),i4(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,r=ue.empty,o=0,s=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,o,s),l=a&&a.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let u=o;u<s;u++)if(!this.type.allowsMarks(r.child(u).marks))return!1;return!0}canReplaceWith(e,n,r,o){if(o&&!this.type.allowsMarks(o))return!1;let s=this.contentMatchAt(e).matchType(r),a=s&&s.matchFragment(this.content,n);return a?a.validEnd:!1}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=Ft.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Ft.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 r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=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,r)}let o=ue.fromJSON(e,n.content),s=e.nodeType(n.type).create(n.attrs,o,r);return s.type.checkAttrs(s.attrs),s}};Nr.prototype.text=void 0;class _d extends Nr{constructor(e,n,r,o){if(super(e,n,null,o),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):i4(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 _d(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new _d(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 i4(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class Ts{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new aI(e,n);if(r.next==null)return Ts.empty;let o=s4(r);r.next&&r.err("Unexpected trailing text");let s=hI(pI(o));return mI(s,r),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,r=e.childCount){let o=this;for(let s=n;o&&s<r;s++)o=o.matchType(e.child(s).type);return o}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 r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let o=[this];function s(a,l){let u=a.matchFragment(e,r);if(u&&(!n||u.validEnd))return ue.from(l.map(c=>c.createAndFill()));for(let c=0;c<a.next.length;c++){let{type:f,next:h}=a.next[c];if(!(f.isText||f.hasRequiredAttrs())&&o.indexOf(h)==-1){o.push(h);let m=s(h,l.concat(f));if(m)return m}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let o=r.shift(),s=o.match;if(s.matchType(e)){let a=[];for(let l=o;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:u}=s.next[a];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!o.type||u.validEnd)&&(r.push({match:l.contentMatch,type:l,via:o}),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=[];function n(r){e.push(r);for(let o=0;o<r.next.length;o++)e.indexOf(r.next[o].next)==-1&&n(r.next[o].next)}return n(this),e.map((r,o)=>{let s=o+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)s+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return s}).join(`
92
92
  `)}}Ts.empty=new Ts(!0);class aI{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 s4(t){let e=[];do e.push(lI(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function lI(t){let e=[];do e.push(uI(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function uI(t){let e=fI(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("{"))e=cI(t,e);else break;return e}function a4(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function cI(t,e){let n=a4(t),r=n;return t.eat(",")&&(t.next!="}"?r=a4(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function dI(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let o=[];for(let s in n){let a=n[s];a.isInGroup(e)&&o.push(a)}return o.length==0&&t.err("No node type or group '"+e+"' found"),o}function fI(t){if(t.eat("(")){let e=s4(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=dI(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function pI(t){let e=[[]];return o(s(t,0),n()),e;function n(){return e.push([])-1}function r(a,l,u){let c={term:u,to:l};return e[a].push(c),c}function o(a,l){a.forEach(u=>u.to=l)}function s(a,l){if(a.type=="choice")return a.exprs.reduce((u,c)=>u.concat(s(c,l)),[]);if(a.type=="seq")for(let u=0;;u++){let c=s(a.exprs[u],l);if(u==a.exprs.length-1)return c;o(c,l=n())}else if(a.type=="star"){let u=n();return r(l,u),o(s(a.expr,u),u),[r(u)]}else if(a.type=="plus"){let u=n();return o(s(a.expr,l),u),o(s(a.expr,u),u),[r(u)]}else{if(a.type=="opt")return[r(l)].concat(s(a.expr,l));if(a.type=="range"){let u=l;for(let c=0;c<a.min;c++){let f=n();o(s(a.expr,u),f),u=f}if(a.max==-1)o(s(a.expr,u),u);else for(let c=a.min;c<a.max;c++){let f=n();r(u,f),o(s(a.expr,u),f),u=f}return[r(u)]}else{if(a.type=="name")return[r(l,void 0,a.value)];throw new Error("Unknown expr type")}}}}function l4(t,e){return e-t}function u4(t,e){let n=[];return r(e),n.sort(l4);function r(o){let s=t[o];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(o);for(let a=0;a<s.length;a++){let{term:l,to:u}=s[a];!l&&n.indexOf(u)==-1&&r(u)}}}function hI(t){let e=Object.create(null);return n(u4(t,0));function n(r){let o=[];r.forEach(a=>{t[a].forEach(({term:l,to:u})=>{if(!l)return;let c;for(let f=0;f<o.length;f++)o[f][0]==l&&(c=o[f][1]);u4(t,u).forEach(f=>{c||o.push([l,c=[]]),c.indexOf(f)==-1&&c.push(f)})})});let s=e[r.join(",")]=new Ts(r.indexOf(t.length-1)>-1);for(let a=0;a<o.length;a++){let l=o[a][1].sort(l4);s.next.push({type:o[a][0],next:e[l.join(",")]||n(l)})}return s}}function mI(t,e){for(let n=0,r=[t];n<r.length;n++){let o=r[n],s=!o.validEnd,a=[];for(let l=0;l<o.next.length;l++){let{type:u,next:c}=o.next[l];a.push(u.name),s&&!(u.isText||u.hasRequiredAttrs())&&(s=!1),r.indexOf(c)==-1&&r.push(c)}s&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function c4(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function d4(t,e){let n=Object.create(null);for(let r in t){let o=e&&e[r];if(o===void 0){let s=t[r];if(s.hasDefault)o=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function f4(t,e,n,r){for(let o in e)if(!(o in t))throw new RangeError(`Unsupported attribute ${o} for ${n} of type ${o}`);for(let o in t){let s=t[o];s.validate&&s.validate(e[o])}}function p4(t,e){let n=Object.create(null);if(e)for(let r in e)n[r]=new bI(t,r,e[r]);return n}let h4=class ok{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=p4(e,r.attrs),this.defaultAttrs=c4(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ts.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:d4(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Nr(this,this.computeAttrs(e),ue.from(n),Ft.setFrom(r))}createChecked(e=null,n,r){return n=ue.from(n),this.checkContent(n),new Nr(this,this.computeAttrs(e),n,Ft.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=ue.from(n),n.size){let a=this.contentMatch.fillBefore(n);if(!a)return null;n=a.append(n)}let o=this.contentMatch.matchFragment(n),s=o&&o.fillBefore(ue.empty,!0);return s?new Nr(this,e,n.append(s),Ft.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).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){f4(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 r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:Ft.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,a)=>r[s]=new ok(s,n,a));let o=n.spec.topNode||"doc";if(!r[o])throw new RangeError("Schema is missing its top node type ('"+o+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function gI(t,e,n){let r=n.split("|");return o=>{let s=o===null?"null":typeof o;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${s}`)}}class bI{constructor(e,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?gI(e,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Sd{constructor(e,n,r,o){this.name=e,this.rank=n,this.schema=r,this.spec=o,this.attrs=p4(e,o.attrs),this.excluded=null;let s=c4(this.attrs);this.instance=s?new Ft(this,s):null}create(e=null){return!e&&this.instance?this.instance:new Ft(this,d4(this.attrs,e))}static compile(e,n){let r=Object.create(null),o=0;return e.forEach((s,a)=>r[s]=new Sd(s,o++,n,a)),r}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){f4(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class m4{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let o in e)n[o]=e[o];n.nodes=Cn.from(e.nodes),n.marks=Cn.from(e.marks||{}),this.nodes=h4.compile(this.spec.nodes,this),this.marks=Sd.compile(this.spec.marks,this);let r=Object.create(null);for(let o in this.nodes){if(o in this.marks)throw new RangeError(o+" can not be both a node and a mark");let s=this.nodes[o],a=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=r[a]||(r[a]=Ts.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?g4(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let o in this.marks){let s=this.marks[o],a=s.spec.excludes;s.excluded=a==null?[s]:a==""?[]:g4(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,o){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof h4){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,o)}text(e,n){let r=this.nodes.text;return new _d(r,r.defaultAttrs,e,Ft.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return Nr.fromJSON(this,e)}markFromJSON(e){return Ft.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function g4(t,e){let n=[];for(let r=0;r<e.length;r++){let o=e[r],s=t.marks[o],a=s;if(s)n.push(s);else for(let l in t.marks){let u=t.marks[l];(o=="_"||u.spec.group&&u.spec.group.split(" ").indexOf(o)>-1)&&n.push(a=u)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function vI(t){return t.tag!=null}function yI(t){return t.style!=null}let su=class L2{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(o=>{if(vI(o))this.tags.push(o);else if(yI(o)){let s=/[^=]*/.exec(o.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(o)}}),this.normalizeLists=!this.tags.some(o=>{if(!/^(ul|ol)\b/.test(o.tag)||!o.node)return!1;let s=e.nodes[o.node];return s.contentMatch.matchType(s)})}parse(e,n={}){let r=new w4(this,n,!1);return r.addAll(e,Ft.none,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new w4(this,n,!0);return r.addAll(e,Ft.none,n.from,n.to),xe.maxOpen(r.finish())}matchTag(e,n,r){for(let o=r?this.tags.indexOf(r)+1:0;o<this.tags.length;o++){let s=this.tags[o];if(CI(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,r,o){for(let s=o?this.styles.indexOf(o)+1:0;s<this.styles.length;s++){let a=this.styles[s],l=a.style;if(!(l.indexOf(e)!=0||a.context&&!r.matchesContext(a.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=n))){if(a.getAttrs){let u=a.getAttrs(n);if(u===!1)continue;a.attrs=u||void 0}return a}}}static schemaRules(e){let n=[];function r(o){let s=o.priority==null?50:o.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,o)}for(let o in e.marks){let s=e.marks[o].spec.parseDOM;s&&s.forEach(a=>{r(a=x4(a)),a.mark||a.ignore||a.clearMark||(a.mark=o)})}for(let o in e.nodes){let s=e.nodes[o].spec.parseDOM;s&&s.forEach(a=>{r(a=x4(a)),a.node||a.ignore||a.mark||(a.node=o)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new L2(e,L2.schemaRules(e)))}};const b4={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},wI={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},v4={ol:!0,ul:!0},au=1,n0=2,kd=4;function y4(t,e,n){return e!=null?(e?au:0)|(e==="full"?n0:0):t&&t.whitespace=="pre"?au|n0:n&-5}class Td{constructor(e,n,r,o,s,a){this.type=e,this.attrs=n,this.marks=r,this.solid=o,this.options=a,this.content=[],this.activeMarks=Ft.none,this.match=s||(a&kd?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(ue.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,o;return(o=r.findWrapping(e.type))?(this.match=r,o):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&au)){let r=this.content[this.content.length-1],o;if(r&&r.isText&&(o=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.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=ue.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(ue.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&&!b4.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class w4{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let o=n.topNode,s,a=y4(null,n.preserveWhitespace,0)|(r?kd:0);o?s=new Td(o.type,o.attrs,Ft.none,!0,n.topMatch||o.type.contentMatch,a):r?s=new Td(null,null,Ft.none,!0,null,a):s=new Td(e.schema.topNodeType,null,Ft.none,!0,null,a),this.nodes=[s],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 r=e.nodeValue,o=this.top,s=o.options&n0?"full":this.localPreserveWS||(o.options&au)>0;if(s==="full"||o.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)s!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
93
93
  `);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=o.content[o.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),n),this.findInText(e)}else this.findInside(e)}addElement(e,n,r){let o=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),l;v4.hasOwnProperty(a)&&this.parser.normalizeLists&&xI(e);let u=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(u?u.ignore:wI.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,n);else if(!u||u.skip||u.closeParent){u&&u.closeParent?this.open=Math.max(0,this.open-1):u&&u.skip.nodeType&&(e=u.skip);let c,f=this.needsBlock;if(b4.hasOwnProperty(a))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),c=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,n);break e}let h=u&&u.skip?n:this.readStyles(e,n);h&&this.addAll(e,h),c&&this.sync(s),this.needsBlock=f}else{let c=this.readStyles(e,n);c&&this.addElementByRule(e,u,c,u.consuming===!1?l:void 0)}this.localPreserveWS=o}leafFallback(e,n){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
94
- `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let s=this.parser.matchedStyles[o],a=r.getPropertyValue(s);if(a)for(let l=void 0;;){let u=this.parser.matchStyle(s,a,this,l);if(!u)break;if(u.ignore)return null;if(u.clearMark?n=n.filter(c=>!u.clearMark(c)):n=n.concat(this.parser.schema.marks[u.mark].create(u.attrs)),u.consuming===!1)l=u;else break}}return n}addElementByRule(e,n,r,o){let s,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),r)||this.leafFallback(e,r);else{let u=this.enter(a,n.attrs||null,r,n.preserveWhitespace);u&&(s=!0,r=u)}else{let u=this.parser.schema.marks[n.mark];r=r.concat(u.create(n.attrs))}let l=this.top;if(a&&a.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(u=>this.insertNode(u,r));else{let u=e;typeof n.contentElement=="string"?u=e.querySelector(n.contentElement):typeof n.contentElement=="function"?u=n.contentElement(e):n.contentElement&&(u=n.contentElement),this.findAround(e,u,!0),this.addAll(u,r),this.findAround(e,u,!1)}s&&this.sync(l)&&this.open--}addAll(e,n,r,o){let s=r||0;for(let a=r?e.childNodes[r]:e.firstChild,l=o==null?null:e.childNodes[o];a!=l;a=a.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(a,n);this.findAtPoint(e,s)}findPlace(e,n){let r,o;for(let s=this.open;s>=0;s--){let a=this.nodes[s],l=a.findWrapping(e);if(l&&(!r||r.length>l.length)&&(r=l,o=a,!l.length)||a.solid)break}if(!r)return null;this.sync(o);for(let s=0;s<r.length;s++)n=this.enterInner(r[s],null,n,!1);return n}insertNode(e,n){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let r=this.findPlace(e,n);if(r){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let s=Ft.none;for(let a of r.concat(e.marks))(o.type?o.type.allowsMarkType(a.type):C4(a.type,e.type))&&(s=a.addToSet(s));return o.content.push(e.mark(s)),!0}return!1}enter(e,n,r,o){let s=this.findPlace(e.create(n),r);return s&&(s=this.enterInner(e,n,r,!0,o)),s}enterInner(e,n,r,o=!1,s){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let l=y4(e,s,a.options);a.options&kd&&a.content.length==0&&(l|=kd);let u=Ft.none;return r=r.filter(c=>(a.type?a.type.allowsMarkType(c.type):C4(c.type,e))?(u=c.addToSet(u),!1):!0),this.nodes.push(new Td(e,n,u,o,null,l)),this.open++,r}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|=au)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].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,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].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("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(o?0:1),a=(l,u)=>{for(;l>=0;l--){let c=n[l];if(c==""){if(l==n.length-1||l==0)continue;for(;u>=s;u--)if(a(l-1,u))return!0;return!1}else{let f=u>0||u==0&&o?this.nodes[u].type:r&&u>=s?r.node(u-s).type:null;if(!f||f.name!=c&&!f.isInGroup(c))return!1;u--}}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 r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function xI(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&v4.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function CI(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function x4(t){let e={};for(let n in t)e[n]=t[n];return e}function C4(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let s=[],a=l=>{s.push(l);for(let u=0;u<l.edgeCount;u++){let{type:c,next:f}=l.edge(u);if(c==e||s.indexOf(f)<0&&a(f))return!0}};if(a(o.contentMatch))return!0}}class Mi{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=r0(n).createDocumentFragment());let o=r,s=[];return e.forEach(a=>{if(s.length||a.marks.length){let l=0,u=0;for(;l<s.length&&u<a.marks.length;){let c=a.marks[u];if(!this.marks[c.type.name]){u++;continue}if(!c.eq(s[l][0])||c.type.spec.spanning===!1)break;l++,u++}for(;l<s.length;)o=s.pop()[1];for(;u<a.marks.length;){let c=a.marks[u++],f=this.serializeMark(c,a.isInline,n);f&&(s.push([c,o]),o.appendChild(f.dom),o=f.contentDOM||f.dom)}}o.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=Ad(r0(n),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let s=this.serializeMark(e.marks[o],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&Ad(r0(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return Ad(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Mi(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=E4(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return E4(e.marks)}}function E4(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function r0(t){return t.document||window.document}const _4=new WeakMap;function EI(t){let e=_4.get(t);return e===void 0&&_4.set(t,e=_I(t)),e}function _I(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o<r.length;o++)n(r[o]);else for(let o in r)n(r[o])}return n(t),e}function Ad(t,e,n,r){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 o=e[0],s;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=EI(r))&&s.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=o.indexOf(" ");a>0&&(n=o.slice(0,a),o=o.slice(a+1));let l,u=n?t.createElementNS(n,o):t.createElement(o),c=e[1],f=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){f=2;for(let h in c)if(c[h]!=null){let m=h.indexOf(" ");m>0?u.setAttributeNS(h.slice(0,m),h.slice(m+1),c[h]):u.setAttribute(h,c[h])}}for(let h=f;h<e.length;h++){let m=e[h];if(m===0){if(h<e.length-1||h>f)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:g,contentDOM:b}=Ad(t,m,n,r);if(u.appendChild(g),b){if(l)throw new RangeError("Multiple content holes");l=b}}}return{dom:u,contentDOM:l}}const S4=65535,k4=Math.pow(2,16);function SI(t,e){return t+e*k4}function T4(t){return t&S4}function kI(t){return(t-(t&S4))/k4}const A4=1,O4=2,Od=4,M4=8;class o0{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&M4)>0}get deletedBefore(){return(this.delInfo&(A4|Od))>0}get deletedAfter(){return(this.delInfo&(O4|Od))>0}get deletedAcross(){return(this.delInfo&Od)>0}}class fr{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&fr.empty)return fr.empty}recover(e){let n=0,r=T4(e);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+kI(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,s=this.inverted?2:1,a=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let u=this.ranges[l]-(this.inverted?o:0);if(u>e)break;let c=this.ranges[l+s],f=this.ranges[l+a],h=u+c;if(e<=h){let m=c?e==u?-1:e==h?1:n:n,g=u+o+(m<0?0:f);if(r)return g;let b=e==(n<0?u:h)?null:SI(l/3,e-u),y=e==u?O4:e==h?A4:Od;return(n<0?e!=u:e!=h)&&(y|=M4),new o0(g,y,b)}o+=f-c}return r?e+o:new o0(e+o,0,null)}touches(e,n){let r=0,o=T4(n),s=this.inverted?2:1,a=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let u=this.ranges[l]-(this.inverted?r:0);if(u>e)break;let c=this.ranges[l+s],f=u+c;if(e<=f&&l==o*3)return!0;r+=this.ranges[l+a]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,s=0;o<this.ranges.length;o+=3){let a=this.ranges[o],l=a-(this.inverted?s:0),u=a+(this.inverted?0:s),c=this.ranges[o+n],f=this.ranges[o+r];e(l,l+c,u,u+f),s+=f-c}}invert(){return new fr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?fr.empty:new fr(e<0?[0,-e,0]:[0,0,e])}}fr.empty=new fr([]);class lu{constructor(e,n,r=0,o=e?e.length:0){this.mirror=n,this.from=r,this.to=o,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new lu(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,r=this._maps.length;n<e._maps.length;n++){let o=e.getMirror(n);this.appendMap(e._maps[n],o!=null&&o<n?r+o: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,r=this._maps.length+e._maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e._maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new lu;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let s=this.from;s<this.to;s++){let a=this._maps[s],l=a.mapResult(e,n);if(l.recover!=null){let u=this.getMirror(s);if(u!=null&&u>s&&u<this.to){s=u,e=this._maps[u].recover(l.recover);continue}}o|=l.delInfo,e=l.pos}return r?e:new o0(e,o,null)}}const i0=Object.create(null);class Bn{getMap(){return fr.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=i0[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in i0)throw new RangeError("Duplicate use of step JSON ID "+e);return i0[e]=n,n.prototype.jsonID=e,n}}class cn{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new cn(e,null)}static fail(e){return new cn(null,e)}static fromReplace(e,n,r,o){try{return cn.ok(e.replace(n,r,o))}catch(s){if(s instanceof xd)return cn.fail(s.message);throw s}}}function s0(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let s=t.child(o);s.content.size&&(s=s.copy(s0(s.content,e,s))),s.isInline&&(s=e(s,n,o)),r.push(s)}return ue.fromArray(r)}class Bi extends Bn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),s=new xe(s0(n.content,(a,l)=>!a.isAtom||!l.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),o),n.openStart,n.openEnd);return cn.fromReplace(e,this.from,this.to,s)}invert(){return new yo(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Bi(n.pos,r.pos,this.mark)}merge(e){return e instanceof Bi&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Bi(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 Bi(n.from,n.to,e.markFromJSON(n.mark))}}Bn.jsonID("addMark",Bi);class yo extends Bn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new xe(s0(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return cn.fromReplace(e,this.from,this.to,r)}invert(){return new Bi(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new yo(n.pos,r.pos,this.mark)}merge(e){return e instanceof yo&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new yo(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 yo(n.from,n.to,e.markFromJSON(n.mark))}}Bn.jsonID("removeMark",yo);class Ri extends Bn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return cn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return cn.fromReplace(e,this.pos,this.pos+1,new xe(ue.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new Ri(this.pos,n.marks[o]);return new Ri(this.pos,this.mark)}}return new Fa(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Ri(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 Ri(n.pos,e.markFromJSON(n.mark))}}Bn.jsonID("addNodeMark",Ri);class Fa extends Bn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return cn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return cn.fromReplace(e,this.pos,this.pos+1,new xe(ue.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Ri(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Fa(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 Fa(n.pos,e.markFromJSON(n.mark))}}Bn.jsonID("removeNodeMark",Fa);class dn extends Bn{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&a0(e,this.from,this.to)?cn.fail("Structure replace would overwrite content"):cn.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new fr([this.from,this.to-this.from,this.slice.size])}invert(e){return new dn(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new dn(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof dn)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?xe.empty:new xe(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new dn(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?xe.empty:new xe(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new dn(e.from,this.to,n,this.structure)}else return null}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 dn(n.from,n.to,xe.fromJSON(e,n.slice),!!n.structure)}}Bn.jsonID("replace",dn);class gn extends Bn{constructor(e,n,r,o,s,a,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=s,this.insert=a,this.structure=l}apply(e){if(this.structure&&(a0(e,this.from,this.gapFrom)||a0(e,this.gapTo,this.to)))return cn.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return cn.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?cn.fromReplace(e,this.from,this.to,r):cn.fail("Content does not fit in gap")}getMap(){return new fr([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 gn(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),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||s>r.pos?null:new gn(n.pos,r.pos,o,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 gn(n.from,n.to,n.gapFrom,n.gapTo,xe.fromJSON(e,n.slice),n.insert,!!n.structure)}}Bn.jsonID("replaceAround",gn);function a0(t,e,n){let r=t.resolve(e),o=n-e,s=r.depth;for(;o>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,o--;if(o>0){let a=r.node(s).maybeChild(r.indexAfter(s));for(;o>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,o--}}return!1}function TI(t,e,n,r){let o=[],s=[],a,l;t.doc.nodesBetween(e,n,(u,c,f)=>{if(!u.isInline)return;let h=u.marks;if(!r.isInSet(h)&&f.type.allowsMarkType(r.type)){let m=Math.max(c,e),g=Math.min(c+u.nodeSize,n),b=r.addToSet(h);for(let y=0;y<h.length;y++)h[y].isInSet(b)||(a&&a.to==m&&a.mark.eq(h[y])?a.to=g:o.push(a=new yo(m,g,h[y])));l&&l.to==m?l.to=g:s.push(l=new Bi(m,g,r))}}),o.forEach(u=>t.step(u)),s.forEach(u=>t.step(u))}function AI(t,e,n,r){let o=[],s=0;t.doc.nodesBetween(e,n,(a,l)=>{if(!a.isInline)return;s++;let u=null;if(r instanceof Sd){let c=a.marks,f;for(;f=r.isInSet(c);)(u||(u=[])).push(f),c=f.removeFromSet(c)}else r?r.isInSet(a.marks)&&(u=[r]):u=a.marks;if(u&&u.length){let c=Math.min(l+a.nodeSize,n);for(let f=0;f<u.length;f++){let h=u[f],m;for(let g=0;g<o.length;g++){let b=o[g];b.step==s-1&&h.eq(o[g].style)&&(m=b)}m?(m.to=c,m.step=s):o.push({style:h,from:Math.max(l,e),to:c,step:s})}}}),o.forEach(a=>t.step(new yo(a.from,a.to,a.style)))}function l0(t,e,n,r=n.contentMatch,o=!0){let s=t.doc.nodeAt(e),a=[],l=e+1;for(let u=0;u<s.childCount;u++){let c=s.child(u),f=l+c.nodeSize,h=r.matchType(c.type);if(!h)a.push(new dn(l,f,xe.empty));else{r=h;for(let m=0;m<c.marks.length;m++)n.allowsMarkType(c.marks[m].type)||t.step(new yo(l,f,c.marks[m]));if(o&&c.isText&&n.whitespace!="pre"){let m,g=/\r?\n|\r/g,b;for(;m=g.exec(c.text);)b||(b=new xe(ue.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),a.push(new dn(l+m.index,l+m.index+m[0].length,b))}}l=f}if(!r.validEnd){let u=r.fillBefore(ue.empty,!0);t.replace(l,l,new xe(u,0,0))}for(let u=a.length-1;u>=0;u--)t.step(a[u])}function OI(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Va(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let o=t.$from.node(r),s=t.$from.index(r),a=t.$to.indexAfter(r);if(r<t.depth&&o.canReplace(s,a,n))return r;if(r==0||o.type.spec.isolating||!OI(o,s,a))break}return null}function MI(t,e,n){let{$from:r,$to:o,depth:s}=e,a=r.before(s+1),l=o.after(s+1),u=a,c=l,f=ue.empty,h=0;for(let b=s,y=!1;b>n;b--)y||r.index(b)>0?(y=!0,f=ue.from(r.node(b).copy(f)),h++):u--;let m=ue.empty,g=0;for(let b=s,y=!1;b>n;b--)y||o.after(b+1)<o.end(b)?(y=!0,m=ue.from(o.node(b).copy(m)),g++):c++;t.step(new gn(u,c,a,l,new xe(f.append(m),h,g),f.size-h,!0))}function u0(t,e,n=null,r=t){let o=BI(t,e),s=o&&RI(r,e);return s?o.map(B4).concat({type:e,attrs:n}).concat(s.map(B4)):null}function B4(t){return{type:t,attrs:null}}function BI(t,e){let{parent:n,startIndex:r,endIndex:o}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let a=s.length?s[0]:e;return n.canReplaceWith(r,o,a)?s:null}function RI(t,e){let{parent:n,startIndex:r,endIndex:o}=t,s=n.child(r),a=e.contentMatch.findWrapping(s.type);if(!a)return null;let u=(a.length?a[a.length-1]:e).contentMatch;for(let c=r;u&&c<o;c++)u=u.matchType(n.child(c).type);return!u||!u.validEnd?null:a}function II(t,e,n){let r=ue.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let l=n[a].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=ue.from(n[a].type.create(n[a].attrs,r))}let o=e.start,s=e.end;t.step(new gn(o,s,o,s,new xe(r,0,0),n.length,!0))}function LI(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(a,l)=>{let u=typeof o=="function"?o(a):o;if(a.isTextblock&&!a.hasMarkup(r,u)&&PI(t.doc,t.mapping.slice(s).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let g=r.whitespace=="pre",b=!!r.contentMatch.matchType(r.schema.linebreakReplacement);g&&!b?c=!1:!g&&b&&(c=!0)}c===!1&&I4(t,a,l,s),l0(t,t.mapping.slice(s).map(l,1),r,void 0,c===null);let f=t.mapping.slice(s),h=f.map(l,1),m=f.map(l+a.nodeSize,1);return t.step(new gn(h,m,h+1,m-1,new xe(ue.from(r.create(u,null,a.marks)),0,0),1,!0)),c===!0&&R4(t,a,l,s),!1}})}function R4(t,e,n,r){e.forEach((o,s)=>{if(o.isText){let a,l=/\r?\n|\r/g;for(;a=l.exec(o.text);){let u=t.mapping.slice(r).map(n+1+s+a.index);t.replaceWith(u,u+1,e.type.schema.linebreakReplacement.create())}}})}function I4(t,e,n,r){e.forEach((o,s)=>{if(o.type==o.type.schema.linebreakReplacement){let a=t.mapping.slice(r).map(n+1+s);t.replaceWith(a,a+1,e.type.schema.text(`
95
- `))}})}function PI(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function DI(t,e,n,r,o){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let a=n.create(r,null,o||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,a);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new gn(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new xe(ue.from(a),0,0),1,!0))}function pr(t,e,n=1,r){let o=t.resolve(e),s=o.depth-n,a=r&&r[r.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!a.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,f=n-2;c>s;c--,f--){let h=o.node(c),m=o.index(c);if(h.type.spec.isolating)return!1;let g=h.content.cutByIndex(m,h.childCount),b=r&&r[f+1];b&&(g=g.replaceChild(0,b.type.create(b.attrs)));let y=r&&r[f]||h;if(!h.canReplace(m+1,h.childCount)||!y.type.validContent(g))return!1}let l=o.indexAfter(s),u=r&&r[0];return o.node(s).canReplaceWith(l,l,u?u.type:o.node(s+1).type)}function FI(t,e,n=1,r){let o=t.doc.resolve(e),s=ue.empty,a=ue.empty;for(let l=o.depth,u=o.depth-n,c=n-1;l>u;l--,c--){s=ue.from(o.node(l).copy(s));let f=r&&r[c];a=ue.from(f?f.type.create(f.attrs,a):o.node(l).copy(a))}t.step(new dn(e,e,new xe(s.append(a),n,n),!0))}function Ii(t,e){let n=t.resolve(e),r=n.index();return L4(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function VI(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let s=e.child(o),a=s.type==r?t.type.schema.nodes.text:s.type;if(n=n.matchType(a),!n||!t.type.allowsMarks(s.marks))return!1}return n.validEnd}function L4(t,e){return!!(t&&e&&!t.isLeaf&&VI(t,e))}function Md(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let s,a,l=r.index(o);if(o==r.depth?(s=r.nodeBefore,a=r.nodeAfter):n>0?(s=r.node(o+1),l++,a=r.node(o).maybeChild(l)):(s=r.node(o).maybeChild(l-1),a=r.node(o+1)),s&&!s.isTextblock&&L4(s,a)&&r.node(o).canReplace(l,l+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function $I(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,s=t.doc.resolve(e-n),a=s.node().type;if(o&&a.inlineContent){let f=a.whitespace=="pre",h=!!a.contentMatch.matchType(o);f&&!h?r=!1:!f&&h&&(r=!0)}let l=t.steps.length;if(r===!1){let f=t.doc.resolve(e+n);I4(t,f.node(),f.before(),l)}a.inlineContent&&l0(t,e+n-1,a,s.node().contentMatchAt(s.index()),r==null);let u=t.mapping.slice(l),c=u.map(e-n);if(t.step(new dn(c,u.map(e+n,-1),xe.empty,!0)),r===!0){let f=t.doc.resolve(c);R4(t,f.node(),f.before(),t.steps.length)}return t}function zI(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let s=r.index(o);if(r.node(o).canReplaceWith(s,s,n))return r.before(o+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let s=r.indexAfter(o);if(r.node(o).canReplaceWith(s,s,n))return r.after(o+1);if(s<r.node(o).childCount)return null}return null}function P4(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let s=0;s<n.openStart;s++)o=o.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let a=r.depth;a>=0;a--){let l=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,u=r.index(a)+(l>0?1:0),c=r.node(a),f=!1;if(s==1)f=c.canReplace(u,u,o);else{let h=c.contentMatchAt(u).findWrapping(o.firstChild.type);f=h&&c.canReplaceWith(u,u,h[0])}if(f)return l==0?r.pos:l<0?r.before(a+1):r.after(a+1)}return null}function Bd(t,e,n=e,r=xe.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),s=t.resolve(n);return D4(o,s,r)?new dn(e,n,r):new HI(o,s,r).fit()}function D4(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class HI{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=ue.empty;for(let o=0;o<=e.depth;o++){let s=e.node(o);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=ue.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let s=this.placed,a=r.depth,l=o.depth;for(;a&&l&&s.childCount==1;)s=s.firstChild.content,a--,l--;let u=new xe(s,a,l);return e>-1?new gn(r.pos,e,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new dn(r.pos,o.pos,u):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(o=0),s.type.spec.isolating&&o<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,s=null;r?(s=c0(this.unplaced.content,r-1).firstChild,o=s.content):o=this.unplaced.content;let a=o.firstChild;for(let l=this.depth;l>=0;l--){let{type:u,match:c}=this.frontier[l],f,h=null;if(n==1&&(a?c.matchType(a.type)||(h=c.fillBefore(ue.from(a),!1)):s&&u.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:l,parent:s,inject:h};if(n==2&&a&&(f=c.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:l,parent:s,wrap:f};if(s&&c.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=c0(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new xe(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=c0(e,n);if(o.childCount<=1&&n>0){let s=e.size-n<=n+o.size;this.unplaced=new xe(uu(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new xe(uu(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let y=0;y<s.length;y++)this.openFrontierNode(s[y]);let a=this.unplaced,l=r?r.content:a.content,u=a.openStart-e,c=0,f=[],{match:h,type:m}=this.frontier[n];if(o){for(let y=0;y<o.childCount;y++)f.push(o.child(y));h=h.matchFragment(o)}let g=l.size+e-(a.content.size-a.openEnd);for(;c<l.childCount;){let y=l.child(c),w=h.matchType(y.type);if(!w)break;c++,(c>1||u==0||y.content.size)&&(h=w,f.push(F4(y.mark(m.allowedMarks(y.marks)),c==1?u:0,c==l.childCount?g:-1)))}let b=c==l.childCount;b||(g=-1),this.placed=cu(this.placed,n,ue.from(f)),this.frontier[n].match=h,b&&g<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let y=0,w=l;y<g;y++){let x=w.lastChild;this.frontier.push({type:x.type,match:x.contentMatchAt(x.childCount)}),w=x.content}this.unplaced=b?e==0?xe.empty:new xe(uu(a.content,e-1,1),e-1,g<0?a.openEnd:e-1):new xe(uu(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!d0(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),a=d0(e,n,o,r,s);if(a){for(let l=n-1;l>=0;l--){let{match:u,type:c}=this.frontier[l],f=d0(e,l,c,u,!0);if(!f||f.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=cu(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),s=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,s)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=cu(this.placed,this.depth,ue.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(ue.empty,!0);n.childCount&&(this.placed=cu(this.placed,this.frontier.length,n))}}function uu(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(uu(t.firstChild.content,e-1,n)))}function cu(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(cu(t.lastChild.content,e-1,n)))}function c0(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function F4(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,F4(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(ue.empty,!0)))),t.copy(r)}function d0(t,e,n,r,o){let s=t.node(e),a=o?t.indexAfter(e):t.index(e);if(a==s.childCount&&!n.compatibleContent(s.type))return null;let l=r.fillBefore(s.content,!0,a);return l&&!UI(n,s.content,a)?l:null}function UI(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function WI(t){return t.spec.defining||t.spec.definingForContent}function jI(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),s=t.doc.resolve(n);if(D4(o,s,r))return t.step(new dn(e,n,r));let a=$4(o,t.doc.resolve(n));a[a.length-1]==0&&a.pop();let l=-(o.depth+1);a.unshift(l);for(let m=o.depth,g=o.pos-1;m>0;m--,g--){let b=o.node(m).type.spec;if(b.defining||b.definingAsContext||b.isolating)break;a.indexOf(m)>-1?l=m:o.before(m)==g&&a.splice(1,0,-m)}let u=a.indexOf(l),c=[],f=r.openStart;for(let m=r.content,g=0;;g++){let b=m.firstChild;if(c.push(b),g==r.openStart)break;m=b.content}for(let m=f-1;m>=0;m--){let g=c[m],b=WI(g.type);if(b&&!g.sameMarkup(o.node(Math.abs(l)-1)))f=m;else if(b||!g.type.isTextblock)break}for(let m=r.openStart;m>=0;m--){let g=(m+f+1)%(r.openStart+1),b=c[g];if(b)for(let y=0;y<a.length;y++){let w=a[(y+u)%a.length],x=!0;w<0&&(x=!1,w=-w);let _=o.node(w-1),S=o.index(w-1);if(_.canReplaceWith(S,S,b.type,b.marks))return t.replace(o.before(w),x?s.after(w):n,new xe(V4(r.content,0,r.openStart,g),g,r.openEnd))}}let h=t.steps.length;for(let m=a.length-1;m>=0&&(t.replace(e,n,r),!(t.steps.length>h));m--){let g=a[m];g<0||(e=o.before(g),n=s.after(g))}}function V4(t,e,n,r,o){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(V4(s.content,e+1,n,r,s)))}if(e>r){let s=o.contentMatchAt(0),a=s.fillBefore(t).append(t);t=a.append(s.matchFragment(a).fillBefore(ue.empty,!0))}return t}function qI(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=zI(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new xe(ue.from(r),0,0))}function KI(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),s=$4(r,o);for(let a=0;a<s.length;a++){let l=s[a],u=a==s.length-1;if(u&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),o.end(l));if(l>0&&(u||r.node(l-1).canReplace(r.index(l-1),o.indexAfter(l-1))))return t.delete(r.before(l),o.after(l))}for(let a=1;a<=r.depth&&a<=o.depth;a++)if(e-r.start(a)==r.depth-a&&n>r.end(a)&&o.end(a)-n!=o.depth-a&&r.start(a-1)==o.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),o.index(a-1)))return t.delete(r.before(a),n);t.delete(e,n)}function $4(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let s=t.start(o);if(s<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;(s==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==s-1)&&n.push(o)}return n}class $a extends Bn{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return cn.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return cn.fromReplace(e,this.pos,this.pos+1,new xe(ue.from(o),0,n.isLeaf?0:1))}getMap(){return fr.empty}invert(e){return new $a(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 $a(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 $a(n.pos,n.attr,n.value)}}Bn.jsonID("attr",$a);class du extends Bn{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return cn.ok(r)}getMap(){return fr.empty}invert(e){return new du(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 du(n.attr,n.value)}}Bn.jsonID("docAttr",du);let za=class extends Error{};za=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},za.prototype=Object.create(Error.prototype),za.prototype.constructor=za,za.prototype.name="TransformError";class f0{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new lu}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new za(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,r=xe.empty){let o=Bd(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new xe(ue.from(r),0,0))}delete(e,n){return this.replace(e,n,xe.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return jI(this,e,n,r),this}replaceRangeWith(e,n,r){return qI(this,e,n,r),this}deleteRange(e,n){return KI(this,e,n),this}lift(e,n){return MI(this,e,n),this}join(e,n=1){return $I(this,e,n),this}wrap(e,n){return II(this,e,n),this}setBlockType(e,n=e,r,o=null){return LI(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return DI(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new $a(e,n,r)),this}setDocAttribute(e,n){return this.step(new du(e,n)),this}addNodeMark(e,n){return this.step(new Ri(e,n)),this}removeNodeMark(e,n){if(!(n instanceof Ft)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Fa(e,n)),this}split(e,n=1,r){return FI(this,e,n,r),this}addMark(e,n,r){return TI(this,e,n,r),this}removeMark(e,n,r){return AI(this,e,n,r),this}clearIncompatible(e,n,r){return l0(this,e,n,r),this}}const p0=Object.create(null);let Ve=class{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new z4(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=xe.empty){let r=n.content.lastChild,o=null;for(let l=0;l<n.openEnd;l++)o=r,r=r.lastChild;let s=e.steps.length,a=this.ranges;for(let l=0;l<a.length;l++){let{$from:u,$to:c}=a[l],f=e.mapping.slice(s);e.replaceRange(f.map(u.pos),f.map(c.pos),l?xe.empty:n),l==0&&W4(e,s,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:a,$to:l}=o[s],u=e.mapping.slice(r),c=u.map(a.pos),f=u.map(l.pos);s?e.deleteRange(c,f):(e.replaceRangeWith(c,f,n),W4(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new Ie(e):Ha(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let s=e.depth-1;s>=0;s--){let a=n<0?Ha(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):Ha(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(a)return a}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Rn(e.node(0))}static atStart(e){return Ha(e,e,0,0,1)||new Rn(e)}static atEnd(e){return Ha(e,e,e.content.size,e.childCount,-1)||new Rn(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=p0[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in p0)throw new RangeError("Duplicate use of selection JSON ID "+e);return p0[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Ie.between(this.$anchor,this.$head).getBookmark()}};Ve.prototype.visible=!0;class z4{constructor(e,n){this.$from=e,this.$to=n}}let H4=!1;function U4(t){!H4&&!t.parent.inlineContent&&(H4=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Ie extends Ve{constructor(e,n=e){U4(e),U4(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return Ve.near(r);let o=e.resolve(n.map(this.anchor));return new Ie(o.parent.inlineContent?o:r,r)}replace(e,n=xe.empty){if(super.replace(e,n),n==xe.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Ie&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Rd(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 Ie(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let s=Ve.findFrom(n,r,!0)||Ve.findFrom(n,-r,!0);if(s)n=s.$head;else return Ve.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(Ve.findFrom(e,-r,!0)||Ve.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new Ie(e,n)}}Ve.jsonID("text",Ie);class Rd{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Rd(e.map(this.anchor),e.map(this.head))}resolve(e){return Ie.between(e.resolve(this.anchor),e.resolve(this.head))}}class Pe extends Ve{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),s=e.resolve(o);return r?Ve.near(s):new Pe(s)}content(){return new xe(ue.from(this.node),0,0)}eq(e){return e instanceof Pe&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new h0(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Pe(e.resolve(n.anchor))}static create(e,n){return new Pe(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Pe.prototype.visible=!1,Ve.jsonID("node",Pe);class h0{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Rd(r,r):new h0(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Pe.isSelectable(r)?new Pe(n):Ve.near(n)}}class Rn extends Ve{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=xe.empty){if(n==xe.empty){e.delete(0,e.doc.content.size);let r=Ve.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Rn(e)}map(e){return new Rn(e)}eq(e){return e instanceof Rn}getBookmark(){return GI}}Ve.jsonID("all",Rn);const GI={map(){return this},resolve(t){return new Rn(t)}};function Ha(t,e,n,r,o,s=!1){if(e.inlineContent)return Ie.create(t,n);for(let a=r-(o>0?0:1);o>0?a<e.childCount:a>=0;a+=o){let l=e.child(a);if(l.isAtom){if(!s&&Pe.isSelectable(l))return Pe.create(t,n-(o<0?l.nodeSize:0))}else{let u=Ha(t,l,n+o,o<0?l.childCount:0,o,s);if(u)return u}n+=l.nodeSize*o}return null}function W4(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof dn||o instanceof gn))return;let s=t.mapping.maps[r],a;s.forEach((l,u,c,f)=>{a==null&&(a=f)}),t.setSelection(Ve.near(t.doc.resolve(a),n))}const j4=1,q4=2,K4=4;class XI extends f0{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=(this.updated|j4)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&j4)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=q4,this}ensureMarks(e){return Ft.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(this.updated&q4)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Ft.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let a=this.doc.resolve(n);s=r==n?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,s)),this.selection.empty||this.setSelection(Ve.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|=K4,this}get scrolledIntoView(){return(this.updated&K4)>0}}function G4(t,e){return!e||!t?t:t.bind(e)}class fu{constructor(e,n,r){this.name=e,this.init=G4(n.init,r),this.apply=G4(n.apply,r)}}const JI=[new fu("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new fu("selection",{init(t,e){return t.selection||Ve.atStart(e.doc)},apply(t){return t.selection}}),new fu("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new fu("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class m0{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=JI.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new fu(r.key,r.spec.state,r))})}}class Ua{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 r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),o=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 u=o?o[a].n:0,c=o?o[a].state:this,f=u<n.length&&l.spec.appendTransaction.call(l,u?n.slice(u):n,c,r);if(f&&r.filterTransaction(f,a)){if(f.setMeta("appendedTransaction",e),!o){o=[];for(let h=0;h<this.config.plugins.length;h++)o.push(h<a?{state:r,n:n.length}:{state:this,n:0})}n.push(f),r=r.applyInner(f),s=!0}o&&(o[a]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Ua(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let s=r[o];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new XI(this)}static create(e){let n=new m0(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Ua(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(e,r);return r}reconfigure(e){let n=new m0(this.schema,e.plugins),r=n.fields,o=new Ua(n);for(let s=0;s<r.length;s++){let a=r[s].name;o[a]=this.hasOwnProperty(a)?this[a]:r[s].init(e,o)}return o}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],s=o.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new m0(e.schema,e.plugins),s=new Ua(o);return o.fields.forEach(a=>{if(a.name=="doc")s.doc=Nr.fromJSON(e.schema,n.doc);else if(a.name=="selection")s.selection=Ve.fromJSON(s.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let u=r[l],c=u.spec.state;if(u.key==a.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){s[a.name]=c.fromJSON.call(u,e,n[l],s);return}}s[a.name]=a.init(e,s)}}),s}}function X4(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=X4(o,e,{})),n[r]=o}return n}class dt{constructor(e){this.spec=e,this.props={},e.props&&X4(e.props,this,this.props),this.key=e.key?e.key.key:J4("plugin")}getState(e){return e[this.key]}}const g0=Object.create(null);function J4(t){return t in g0?t+"$"+ ++g0[t]:(g0[t]=0,t+"$")}class kt{constructor(e="key"){this.key=J4(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const En=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Wa=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let b0=null;const jo=function(t,e,n){let r=b0||(b0=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},YI=function(){b0=null},As=function(t,e,n,r){return n&&(Y4(t,e,n,r,-1)||Y4(t,e,n,r,1))},ZI=/^(img|br|input|textarea|hr)$/i;function Y4(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Ar(t))){let s=t.parentNode;if(!s||s.nodeType!=1||pu(t)||ZI.test(t.nodeName)||t.contentEditable=="false")return!1;e=En(t)+(o<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(o<0?-1:0)],t.contentEditable=="false")return!1;e=o<0?Ar(t):0}else return!1}}function Ar(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function QI(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Ar(t)}else if(t.parentNode&&!pu(t))e=En(t),t=t.parentNode;else return null}}function NI(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!pu(t))e=En(t)+1,t=t.parentNode;else return null}}function eL(t,e,n){for(let r=e==0,o=e==Ar(t);r||o;){if(t==n)return!0;let s=En(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,o=o&&s==Ar(t)}}function pu(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 Id=function(t){return t.focusNode&&As(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Os(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function tL(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function nL(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Ar(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Ar(r.startContainer),r.startOffset)}}}const wo=typeof navigator<"u"?navigator:null,Z4=typeof document<"u"?document:null,Li=wo&&wo.userAgent||"",v0=/Edge\/(\d+)/.exec(Li),Q4=/MSIE \d/.exec(Li),y0=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Li),Zn=!!(Q4||y0||v0),Pi=Q4?document.documentMode:y0?+y0[1]:v0?+v0[1]:0,eo=!Zn&&/gecko\/(\d+)/i.test(Li);eo&&+(/Firefox\/(\d+)/.exec(Li)||[0,0])[1];const w0=!Zn&&/Chrome\/(\d+)/.exec(Li),In=!!w0,N4=w0?+w0[1]:0,Un=!Zn&&!!wo&&/Apple Computer/.test(wo.vendor),ja=Un&&(/Mobile\/\w+/.test(Li)||!!wo&&wo.maxTouchPoints>2),Or=ja||(wo?/Mac/.test(wo.platform):!1),rL=wo?/Win/.test(wo.platform):!1,qo=/Android \d/.test(Li),hu=!!Z4&&"webkitFontSmoothing"in Z4.documentElement.style,oL=hu?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function iL(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 Ko(t,e){return typeof t=="number"?t:t[e]}function sL(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function ew(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let a=n||t.dom;a;){if(a.nodeType!=1){a=Wa(a);continue}let l=a,u=l==s.body,c=u?iL(s):sL(l),f=0,h=0;if(e.top<c.top+Ko(r,"top")?h=-(c.top-e.top+Ko(o,"top")):e.bottom>c.bottom-Ko(r,"bottom")&&(h=e.bottom-e.top>c.bottom-c.top?e.top+Ko(o,"top")-c.top:e.bottom-c.bottom+Ko(o,"bottom")),e.left<c.left+Ko(r,"left")?f=-(c.left-e.left+Ko(o,"left")):e.right>c.right-Ko(r,"right")&&(f=e.right-c.right+Ko(o,"right")),f||h)if(u)s.defaultView.scrollBy(f,h);else{let g=l.scrollLeft,b=l.scrollTop;h&&(l.scrollTop+=h),f&&(l.scrollLeft+=f);let y=l.scrollLeft-g,w=l.scrollTop-b;e={left:e.left-y,top:e.top-w,right:e.right-y,bottom:e.bottom-w}}let m=u?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(m))break;a=m=="absolute"?a.offsetParent:Wa(a)}}function aL(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let s=(e.left+e.right)/2,a=n+1;a<Math.min(innerHeight,e.bottom);a+=5){let l=t.root.elementFromPoint(s,a);if(!l||l==t.dom||!t.dom.contains(l))continue;let u=l.getBoundingClientRect();if(u.top>=n-20){r=l,o=u.top;break}}return{refDOM:r,refTop:o,stack:tw(t.dom)}}function tw(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Wa(r));return e}function lL({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;nw(n,r==0?0:r-e)}function nw(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:s}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let qa=null;function uL(t){if(t.setActive)return t.setActive();if(qa)return t.focus(qa);let e=tw(t);t.focus(qa==null?{get preventScroll(){return qa={preventScroll:!0},!0}}:void 0),qa||(qa=!1,nw(e,0))}function rw(t,e){let n,r=2e8,o,s=0,a=e.top,l=e.top,u,c;for(let f=t.firstChild,h=0;f;f=f.nextSibling,h++){let m;if(f.nodeType==1)m=f.getClientRects();else if(f.nodeType==3)m=jo(f).getClientRects();else continue;for(let g=0;g<m.length;g++){let b=m[g];if(b.top<=a&&b.bottom>=l){a=Math.max(b.bottom,a),l=Math.min(b.top,l);let y=b.left>e.left?b.left-e.left:b.right<e.left?e.left-b.right:0;if(y<r){n=f,r=y,o=y&&n.nodeType==3?{left:b.right<e.left?b.right:b.left,top:e.top}:e,f.nodeType==1&&y&&(s=h+(e.left>=(b.left+b.right)/2?1:0));continue}}else b.top>e.top&&!u&&b.left<=e.left&&b.right>=e.left&&(u=f,c={left:Math.max(b.left,Math.min(b.right,e.left)),top:b.top});!n&&(e.left>=b.right&&e.top>=b.top||e.left>=b.left&&e.top>=b.bottom)&&(s=h+1)}}return!n&&u&&(n=u,o=c,r=0),n&&n.nodeType==3?cL(n,o):!n||r&&n.nodeType==1?{node:t,offset:s}:rw(n,o)}function cL(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let s=Di(r,1);if(s.top!=s.bottom&&x0(e,s))return{node:t,offset:o+(e.left>=(s.left+s.right)/2?1:0)}}return{node:t,offset:0}}function x0(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function dL(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function fL(t,e,n){let{node:r,offset:o}=rw(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();s=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return t.docView.posFromDOM(r,o,s)}function pL(t,e,n,r){let o=-1;for(let s=e,a=!1;s!=t.dom;){let l=t.docView.nearestDesc(s,!0),u;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((u=l.dom.getBoundingClientRect()).width||u.height)&&(l.node.isBlock&&l.parent&&(!a&&u.left>r.left||u.top>r.top?o=l.posBefore:(!a&&u.right<r.left||u.bottom<r.top)&&(o=l.posAfter),a=!0),!l.contentDOM&&o<0&&!l.node.isText))return(l.node.isBlock?r.top<(u.top+u.bottom)/2:r.left<(u.left+u.right)/2)?l.posBefore:l.posAfter;s=l.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function ow(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),s=o;;){let a=t.childNodes[s];if(a.nodeType==1){let l=a.getClientRects();for(let u=0;u<l.length;u++){let c=l[u];if(x0(e,c))return ow(a,e,c)}}if((s=(s+1)%r)==o)break}return t}function hL(t,e){let n=t.dom.ownerDocument,r,o=0,s=nL(n,e.left,e.top);s&&({node:r,offset:o}=s);let a=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!a||!t.dom.contains(a.nodeType!=1?a.parentNode:a)){let c=t.dom.getBoundingClientRect();if(!x0(e,c)||(a=ow(t.dom,e,c),!a))return null}if(Un)for(let c=a;r&&c;c=Wa(c))c.draggable&&(r=void 0);if(a=dL(a,e),r){if(eo&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let f=r.childNodes[o],h;f.nodeName=="IMG"&&(h=f.getBoundingClientRect()).right<=e.left&&h.bottom>e.top&&o++}let c;hu&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(l=pL(t,r,o,e))}l==null&&(l=fL(t,a,e));let u=t.docView.nearestDesc(a,!0);return{pos:l,inside:u?u.posAtStart-u.border:-1}}function iw(t){return t.top<t.bottom||t.left<t.right}function Di(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(iw(r))return r}return Array.prototype.find.call(n,iw)||t.getBoundingClientRect()}const mL=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function sw(t,e,n){let{node:r,offset:o,atom:s}=t.docView.domFromPos(e,n<0?-1:1),a=hu||eo;if(r.nodeType==3)if(a&&(mL.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let u=Di(jo(r,o,o),n);if(eo&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let c=Di(jo(r,o-1,o-1),-1);if(c.top==u.top){let f=Di(jo(r,o,o+1),-1);if(f.top!=u.top)return mu(f,f.left<c.left)}}return u}else{let u=o,c=o,f=n<0?1:-1;return n<0&&!o?(c++,f=-1):n>=0&&o==r.nodeValue.length?(u--,f=1):n<0?u--:c++,mu(Di(jo(r,u,c),f),f<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&o&&(n<0||o==Ar(r))){let u=r.childNodes[o-1];if(u.nodeType==1)return C0(u.getBoundingClientRect(),!1)}if(s==null&&o<Ar(r)){let u=r.childNodes[o];if(u.nodeType==1)return C0(u.getBoundingClientRect(),!0)}return C0(r.getBoundingClientRect(),n>=0)}if(s==null&&o&&(n<0||o==Ar(r))){let u=r.childNodes[o-1],c=u.nodeType==3?jo(u,Ar(u)-(a?0:1)):u.nodeType==1&&(u.nodeName!="BR"||!u.nextSibling)?u:null;if(c)return mu(Di(c,1),!1)}if(s==null&&o<Ar(r)){let u=r.childNodes[o];for(;u.pmViewDesc&&u.pmViewDesc.ignoreForCoords;)u=u.nextSibling;let c=u?u.nodeType==3?jo(u,0,a?0:1):u.nodeType==1?u:null:null;if(c)return mu(Di(c,-1),!0)}return mu(Di(r.nodeType==3?jo(r):r,-n),n>=0)}function mu(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 C0(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 aw(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function gL(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return aw(t,e,()=>{let{node:s}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(s,!0);if(!l)break;if(l.node.isBlock){s=l.contentDOM||l.dom;break}s=l.dom.parentNode}let a=sw(t,o.pos,1);for(let l=s.firstChild;l;l=l.nextSibling){let u;if(l.nodeType==1)u=l.getClientRects();else if(l.nodeType==3)u=jo(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;c<u.length;c++){let f=u[c];if(f.bottom>f.top+1&&(n=="up"?a.top-f.top>(f.bottom-a.top)*2:f.bottom-a.bottom>(a.bottom-f.top)*2))return!1}}return!0})}const bL=/[\u0590-\u08ac]/;function vL(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,s=!o,a=o==r.parent.content.size,l=t.domSelection();return l?!bL.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?s:a:aw(t,e,()=>{let{focusNode:u,focusOffset:c,anchorNode:f,anchorOffset:h}=t.domSelectionRange(),m=l.caretBidiLevel;l.modify("move",n,"character");let g=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:b,focusOffset:y}=t.domSelectionRange(),w=b&&!g.contains(b.nodeType==1?b:b.parentNode)||u==b&&c==y;try{l.collapse(f,h),u&&(u!=f||c!=h)&&l.extend&&l.extend(u,c)}catch{}return m!=null&&(l.caretBidiLevel=m),w}):r.pos==r.start()||r.pos==r.end()}let lw=null,uw=null,cw=!1;function yL(t,e,n){return lw==e&&uw==n?cw:(lw=e,uw=n,cw=n=="up"||n=="down"?gL(t,e,n):vL(t,e,n))}const Mr=0,dw=1,Ms=2,xo=3;class gu{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=Mr,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){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,r=this.posAtStart;;n++){let o=this.children[n];if(o==e)return r;r+=o.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,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<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}else{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 o;if(e==this.dom&&this.contentDOM)o=n>En(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){o=!1;break}if(s.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){o=!0;break}if(s.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let s=this.getDesc(o),a;if(s&&(!n||s.node))if(r&&(a=s.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))r=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let s=this.getDesc(o);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],s=r+o.size;if(r==e&&s!=r){for(;!o.border&&o.children.length;)for(let a=0;a<o.children.length;a++){let l=o.children[a];if(l.size){o=l;break}}return o}if(e<s)return o.descAt(e-r-o.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let s=0;r<this.children.length;r++){let a=this.children[r],l=s+a.size;if(l>e||a instanceof hw){o=e-s;break}s=l}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof fw&&s.side>=0;r--);if(n<=0){let s,a=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,a=!1);return s&&n&&a&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?En(s.dom)+1:0}}else{let s,a=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,a=!1);return s&&a&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?En(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,s=-1;for(let a=r,l=0;;l++){let u=this.children[l],c=a+u.size;if(o==-1&&e<=c){let f=a+u.border;if(e>=f&&n<=c-u.border&&u.node&&u.contentDOM&&this.contentDOM.contains(u.contentDOM))return u.parseRange(e,n,f);e=a;for(let h=l;h>0;h--){let m=this.children[h-1];if(m.size&&m.dom.parentNode==this.contentDOM&&!m.emptyChildAt(1)){o=En(m.dom)+1;break}e-=m.size}o==-1&&(o=0)}if(o>-1&&(c>n||l==this.children.length-1)){n=c;for(let f=l+1;f<this.children.length;f++){let h=this.children[f];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){s=En(h.dom);break}n+=h.size}s==-1&&(s=this.contentDOM.childNodes.length);break}a=c}return{node:this.contentDOM,from:e,to:n,fromOffset:o,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:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,o=!1){let s=Math.min(e,n),a=Math.max(e,n);for(let g=0,b=0;g<this.children.length;g++){let y=this.children[g],w=b+y.size;if(s>b&&a<w)return y.setSelection(e-b-y.border,n-b-y.border,r,o);b=w}let l=this.domFromPos(e,e?-1:1),u=n==e?l:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),f=r.domSelectionRange(),h=!1;if((eo||Un)&&e==n){let{node:g,offset:b}=l;if(g.nodeType==3){if(h=!!(b&&g.nodeValue[b-1]==`
94
+ `),n)}ignoreFallback(e,n){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n)}readStyles(e,n){let r=e.style;if(r&&r.length)for(let o=0;o<this.parser.matchedStyles.length;o++){let s=this.parser.matchedStyles[o],a=r.getPropertyValue(s);if(a)for(let l=void 0;;){let u=this.parser.matchStyle(s,a,this,l);if(!u)break;if(u.ignore)return null;if(u.clearMark?n=n.filter(c=>!u.clearMark(c)):n=n.concat(this.parser.schema.marks[u.mark].create(u.attrs)),u.consuming===!1)l=u;else break}}return n}addElementByRule(e,n,r,o){let s,a;if(n.node)if(a=this.parser.schema.nodes[n.node],a.isLeaf)this.insertNode(a.create(n.attrs),r)||this.leafFallback(e,r);else{let u=this.enter(a,n.attrs||null,r,n.preserveWhitespace);u&&(s=!0,r=u)}else{let u=this.parser.schema.marks[n.mark];r=r.concat(u.create(n.attrs))}let l=this.top;if(a&&a.isLeaf)this.findInside(e);else if(o)this.addElement(e,r,o);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(u=>this.insertNode(u,r));else{let u=e;typeof n.contentElement=="string"?u=e.querySelector(n.contentElement):typeof n.contentElement=="function"?u=n.contentElement(e):n.contentElement&&(u=n.contentElement),this.findAround(e,u,!0),this.addAll(u,r),this.findAround(e,u,!1)}s&&this.sync(l)&&this.open--}addAll(e,n,r,o){let s=r||0;for(let a=r?e.childNodes[r]:e.firstChild,l=o==null?null:e.childNodes[o];a!=l;a=a.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(a,n);this.findAtPoint(e,s)}findPlace(e,n){let r,o;for(let s=this.open;s>=0;s--){let a=this.nodes[s],l=a.findWrapping(e);if(l&&(!r||r.length>l.length)&&(r=l,o=a,!l.length)||a.solid)break}if(!r)return null;this.sync(o);for(let s=0;s<r.length;s++)n=this.enterInner(r[s],null,n,!1);return n}insertNode(e,n){if(e.isInline&&this.needsBlock&&!this.top.type){let o=this.textblockFromContext();o&&(n=this.enterInner(o,null,n))}let r=this.findPlace(e,n);if(r){this.closeExtra();let o=this.top;o.match&&(o.match=o.match.matchType(e.type));let s=Ft.none;for(let a of r.concat(e.marks))(o.type?o.type.allowsMarkType(a.type):C4(a.type,e.type))&&(s=a.addToSet(s));return o.content.push(e.mark(s)),!0}return!1}enter(e,n,r,o){let s=this.findPlace(e.create(n),r);return s&&(s=this.enterInner(e,n,r,!0,o)),s}enterInner(e,n,r,o=!1,s){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let l=y4(e,s,a.options);a.options&kd&&a.content.length==0&&(l|=kd);let u=Ft.none;return r=r.filter(c=>(a.type?a.type.allowsMarkType(c.type):C4(c.type,e))?(u=c.addToSet(u),!1):!0),this.nodes.push(new Td(e,n,u,o,null,l)),this.open++,r}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|=au)}return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let o=r.length-1;o>=0;o--)e+=r[o].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].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,r){if(e!=n&&this.find)for(let o=0;o<this.find.length;o++)this.find[o].pos==null&&e.nodeType==1&&e.contains(this.find[o].node)&&n.compareDocumentPosition(this.find[o].node)&(r?2:4)&&(this.find[o].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("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(o?0:1),a=(l,u)=>{for(;l>=0;l--){let c=n[l];if(c==""){if(l==n.length-1||l==0)continue;for(;u>=s;u--)if(a(l-1,u))return!0;return!1}else{let f=u>0||u==0&&o?this.nodes[u].type:r&&u>=s?r.node(u-s).type:null;if(!f||f.name!=c&&!f.isInGroup(c))return!1;u--}}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 r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function xI(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&v4.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function CI(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function x4(t){let e={};for(let n in t)e[n]=t[n];return e}function C4(t,e){let n=e.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(t))continue;let s=[],a=l=>{s.push(l);for(let u=0;u<l.edgeCount;u++){let{type:c,next:f}=l.edge(u);if(c==e||s.indexOf(f)<0&&a(f))return!0}};if(a(o.contentMatch))return!0}}class Mi{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=r0(n).createDocumentFragment());let o=r,s=[];return e.forEach(a=>{if(s.length||a.marks.length){let l=0,u=0;for(;l<s.length&&u<a.marks.length;){let c=a.marks[u];if(!this.marks[c.type.name]){u++;continue}if(!c.eq(s[l][0])||c.type.spec.spanning===!1)break;l++,u++}for(;l<s.length;)o=s.pop()[1];for(;u<a.marks.length;){let c=a.marks[u++],f=this.serializeMark(c,a.isInline,n);f&&(s.push([c,o]),o.appendChild(f.dom),o=f.contentDOM||f.dom)}}o.appendChild(this.serializeNodeInner(a,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:o}=Ad(r0(n),this.nodes[e.type.name](e),null,e.attrs);if(o){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,o)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let o=e.marks.length-1;o>=0;o--){let s=this.serializeMark(e.marks[o],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let o=this.marks[e.type.name];return o&&Ad(r0(r),o(e,n),null,e.attrs)}static renderSpec(e,n,r=null,o){return Ad(e,n,r,o)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Mi(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=E4(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return E4(e.marks)}}function E4(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function r0(t){return t.document||window.document}const _4=new WeakMap;function EI(t){let e=_4.get(t);return e===void 0&&_4.set(t,e=_I(t)),e}function _I(t){let e=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let o=0;o<r.length;o++)n(r[o]);else for(let o in r)n(r[o])}return n(t),e}function Ad(t,e,n,r){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 o=e[0],s;if(typeof o!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=EI(r))&&s.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=o.indexOf(" ");a>0&&(n=o.slice(0,a),o=o.slice(a+1));let l,u=n?t.createElementNS(n,o):t.createElement(o),c=e[1],f=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){f=2;for(let h in c)if(c[h]!=null){let m=h.indexOf(" ");m>0?u.setAttributeNS(h.slice(0,m),h.slice(m+1),c[h]):u.setAttribute(h,c[h])}}for(let h=f;h<e.length;h++){let m=e[h];if(m===0){if(h<e.length-1||h>f)throw new RangeError("Content hole must be the only child of its parent node");return{dom:u,contentDOM:u}}else{let{dom:g,contentDOM:b}=Ad(t,m,n,r);if(u.appendChild(g),b){if(l)throw new RangeError("Multiple content holes");l=b}}}return{dom:u,contentDOM:l}}const S4=65535,k4=Math.pow(2,16);function SI(t,e){return t+e*k4}function T4(t){return t&S4}function kI(t){return(t-(t&S4))/k4}const A4=1,O4=2,Od=4,M4=8;class o0{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&M4)>0}get deletedBefore(){return(this.delInfo&(A4|Od))>0}get deletedAfter(){return(this.delInfo&(O4|Od))>0}get deletedAcross(){return(this.delInfo&Od)>0}}class fr{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&fr.empty)return fr.empty}recover(e){let n=0,r=T4(e);if(!this.inverted)for(let o=0;o<r;o++)n+=this.ranges[o*3+2]-this.ranges[o*3+1];return this.ranges[r*3]+n+kI(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let o=0,s=this.inverted?2:1,a=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let u=this.ranges[l]-(this.inverted?o:0);if(u>e)break;let c=this.ranges[l+s],f=this.ranges[l+a],h=u+c;if(e<=h){let m=c?e==u?-1:e==h?1:n:n,g=u+o+(m<0?0:f);if(r)return g;let b=e==(n<0?u:h)?null:SI(l/3,e-u),y=e==u?O4:e==h?A4:Od;return(n<0?e!=u:e!=h)&&(y|=M4),new o0(g,y,b)}o+=f-c}return r?e+o:new o0(e+o,0,null)}touches(e,n){let r=0,o=T4(n),s=this.inverted?2:1,a=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let u=this.ranges[l]-(this.inverted?r:0);if(u>e)break;let c=this.ranges[l+s],f=u+c;if(e<=f&&l==o*3)return!0;r+=this.ranges[l+a]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let o=0,s=0;o<this.ranges.length;o+=3){let a=this.ranges[o],l=a-(this.inverted?s:0),u=a+(this.inverted?0:s),c=this.ranges[o+n],f=this.ranges[o+r];e(l,l+c,u,u+f),s+=f-c}}invert(){return new fr(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?fr.empty:new fr(e<0?[0,-e,0]:[0,0,e])}}fr.empty=new fr([]);class lu{constructor(e,n,r=0,o=e?e.length:0){this.mirror=n,this.from=r,this.to=o,this._maps=e||[],this.ownData=!(e||n)}get maps(){return this._maps}slice(e=0,n=this.maps.length){return new lu(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,r=this._maps.length;n<e._maps.length;n++){let o=e.getMirror(n);this.appendMap(e._maps[n],o!=null&&o<n?r+o: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,r=this._maps.length+e._maps.length;n>=0;n--){let o=e.getMirror(n);this.appendMap(e._maps[n].invert(),o!=null&&o>n?r-o-1:void 0)}}invert(){let e=new lu;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let o=0;for(let s=this.from;s<this.to;s++){let a=this._maps[s],l=a.mapResult(e,n);if(l.recover!=null){let u=this.getMirror(s);if(u!=null&&u>s&&u<this.to){s=u,e=this._maps[u].recover(l.recover);continue}}o|=l.delInfo,e=l.pos}return r?e:new o0(e,o,null)}}const i0=Object.create(null);class Bn{getMap(){return fr.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=i0[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in i0)throw new RangeError("Duplicate use of step JSON ID "+e);return i0[e]=n,n.prototype.jsonID=e,n}}class cn{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new cn(e,null)}static fail(e){return new cn(null,e)}static fromReplace(e,n,r,o){try{return cn.ok(e.replace(n,r,o))}catch(s){if(s instanceof xd)return cn.fail(s.message);throw s}}}function s0(t,e,n){let r=[];for(let o=0;o<t.childCount;o++){let s=t.child(o);s.content.size&&(s=s.copy(s0(s.content,e,s))),s.isInline&&(s=e(s,n,o)),r.push(s)}return ue.fromArray(r)}class Bi extends Bn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),o=r.node(r.sharedDepth(this.to)),s=new xe(s0(n.content,(a,l)=>!a.isAtom||!l.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),o),n.openStart,n.openEnd);return cn.fromReplace(e,this.from,this.to,s)}invert(){return new yo(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Bi(n.pos,r.pos,this.mark)}merge(e){return e instanceof Bi&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Bi(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 Bi(n.from,n.to,e.markFromJSON(n.mark))}}Bn.jsonID("addMark",Bi);class yo extends Bn{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new xe(s0(n.content,o=>o.mark(this.mark.removeFromSet(o.marks)),e),n.openStart,n.openEnd);return cn.fromReplace(e,this.from,this.to,r)}invert(){return new Bi(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new yo(n.pos,r.pos,this.mark)}merge(e){return e instanceof yo&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new yo(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 yo(n.from,n.to,e.markFromJSON(n.mark))}}Bn.jsonID("removeMark",yo);class Ri extends Bn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return cn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return cn.fromReplace(e,this.pos,this.pos+1,new xe(ue.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let o=0;o<n.marks.length;o++)if(!n.marks[o].isInSet(r))return new Ri(this.pos,n.marks[o]);return new Ri(this.pos,this.mark)}}return new Fa(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Ri(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 Ri(n.pos,e.markFromJSON(n.mark))}}Bn.jsonID("addNodeMark",Ri);class Fa extends Bn{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return cn.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return cn.fromReplace(e,this.pos,this.pos+1,new xe(ue.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Ri(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Fa(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 Fa(n.pos,e.markFromJSON(n.mark))}}Bn.jsonID("removeNodeMark",Fa);class dn extends Bn{constructor(e,n,r,o=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=o}apply(e){return this.structure&&a0(e,this.from,this.to)?cn.fail("Structure replace would overwrite content"):cn.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new fr([this.from,this.to-this.from,this.slice.size])}invert(e){return new dn(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new dn(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof dn)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?xe.empty:new xe(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new dn(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?xe.empty:new xe(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new dn(e.from,this.to,n,this.structure)}else return null}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 dn(n.from,n.to,xe.fromJSON(e,n.slice),!!n.structure)}}Bn.jsonID("replace",dn);class bn extends Bn{constructor(e,n,r,o,s,a,l=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=o,this.slice=s,this.insert=a,this.structure=l}apply(e){if(this.structure&&(a0(e,this.from,this.gapFrom)||a0(e,this.gapTo,this.to)))return cn.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return cn.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?cn.fromReplace(e,this.from,this.to,r):cn.fail("Content does not fit in gap")}getMap(){return new fr([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 bn(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),r=e.mapResult(this.to,-1),o=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||o<n.pos||s>r.pos?null:new bn(n.pos,r.pos,o,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 bn(n.from,n.to,n.gapFrom,n.gapTo,xe.fromJSON(e,n.slice),n.insert,!!n.structure)}}Bn.jsonID("replaceAround",bn);function a0(t,e,n){let r=t.resolve(e),o=n-e,s=r.depth;for(;o>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,o--;if(o>0){let a=r.node(s).maybeChild(r.indexAfter(s));for(;o>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,o--}}return!1}function TI(t,e,n,r){let o=[],s=[],a,l;t.doc.nodesBetween(e,n,(u,c,f)=>{if(!u.isInline)return;let h=u.marks;if(!r.isInSet(h)&&f.type.allowsMarkType(r.type)){let m=Math.max(c,e),g=Math.min(c+u.nodeSize,n),b=r.addToSet(h);for(let y=0;y<h.length;y++)h[y].isInSet(b)||(a&&a.to==m&&a.mark.eq(h[y])?a.to=g:o.push(a=new yo(m,g,h[y])));l&&l.to==m?l.to=g:s.push(l=new Bi(m,g,r))}}),o.forEach(u=>t.step(u)),s.forEach(u=>t.step(u))}function AI(t,e,n,r){let o=[],s=0;t.doc.nodesBetween(e,n,(a,l)=>{if(!a.isInline)return;s++;let u=null;if(r instanceof Sd){let c=a.marks,f;for(;f=r.isInSet(c);)(u||(u=[])).push(f),c=f.removeFromSet(c)}else r?r.isInSet(a.marks)&&(u=[r]):u=a.marks;if(u&&u.length){let c=Math.min(l+a.nodeSize,n);for(let f=0;f<u.length;f++){let h=u[f],m;for(let g=0;g<o.length;g++){let b=o[g];b.step==s-1&&h.eq(o[g].style)&&(m=b)}m?(m.to=c,m.step=s):o.push({style:h,from:Math.max(l,e),to:c,step:s})}}}),o.forEach(a=>t.step(new yo(a.from,a.to,a.style)))}function l0(t,e,n,r=n.contentMatch,o=!0){let s=t.doc.nodeAt(e),a=[],l=e+1;for(let u=0;u<s.childCount;u++){let c=s.child(u),f=l+c.nodeSize,h=r.matchType(c.type);if(!h)a.push(new dn(l,f,xe.empty));else{r=h;for(let m=0;m<c.marks.length;m++)n.allowsMarkType(c.marks[m].type)||t.step(new yo(l,f,c.marks[m]));if(o&&c.isText&&n.whitespace!="pre"){let m,g=/\r?\n|\r/g,b;for(;m=g.exec(c.text);)b||(b=new xe(ue.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),a.push(new dn(l+m.index,l+m.index+m[0].length,b))}}l=f}if(!r.validEnd){let u=r.fillBefore(ue.empty,!0);t.replace(l,l,new xe(u,0,0))}for(let u=a.length-1;u>=0;u--)t.step(a[u])}function OI(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Va(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let o=t.$from.node(r),s=t.$from.index(r),a=t.$to.indexAfter(r);if(r<t.depth&&o.canReplace(s,a,n))return r;if(r==0||o.type.spec.isolating||!OI(o,s,a))break}return null}function MI(t,e,n){let{$from:r,$to:o,depth:s}=e,a=r.before(s+1),l=o.after(s+1),u=a,c=l,f=ue.empty,h=0;for(let b=s,y=!1;b>n;b--)y||r.index(b)>0?(y=!0,f=ue.from(r.node(b).copy(f)),h++):u--;let m=ue.empty,g=0;for(let b=s,y=!1;b>n;b--)y||o.after(b+1)<o.end(b)?(y=!0,m=ue.from(o.node(b).copy(m)),g++):c++;t.step(new bn(u,c,a,l,new xe(f.append(m),h,g),f.size-h,!0))}function u0(t,e,n=null,r=t){let o=BI(t,e),s=o&&RI(r,e);return s?o.map(B4).concat({type:e,attrs:n}).concat(s.map(B4)):null}function B4(t){return{type:t,attrs:null}}function BI(t,e){let{parent:n,startIndex:r,endIndex:o}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let a=s.length?s[0]:e;return n.canReplaceWith(r,o,a)?s:null}function RI(t,e){let{parent:n,startIndex:r,endIndex:o}=t,s=n.child(r),a=e.contentMatch.findWrapping(s.type);if(!a)return null;let u=(a.length?a[a.length-1]:e).contentMatch;for(let c=r;u&&c<o;c++)u=u.matchType(n.child(c).type);return!u||!u.validEnd?null:a}function II(t,e,n){let r=ue.empty;for(let a=n.length-1;a>=0;a--){if(r.size){let l=n[a].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=ue.from(n[a].type.create(n[a].attrs,r))}let o=e.start,s=e.end;t.step(new bn(o,s,o,s,new xe(r,0,0),n.length,!0))}function LI(t,e,n,r,o){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(a,l)=>{let u=typeof o=="function"?o(a):o;if(a.isTextblock&&!a.hasMarkup(r,u)&&PI(t.doc,t.mapping.slice(s).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let g=r.whitespace=="pre",b=!!r.contentMatch.matchType(r.schema.linebreakReplacement);g&&!b?c=!1:!g&&b&&(c=!0)}c===!1&&I4(t,a,l,s),l0(t,t.mapping.slice(s).map(l,1),r,void 0,c===null);let f=t.mapping.slice(s),h=f.map(l,1),m=f.map(l+a.nodeSize,1);return t.step(new bn(h,m,h+1,m-1,new xe(ue.from(r.create(u,null,a.marks)),0,0),1,!0)),c===!0&&R4(t,a,l,s),!1}})}function R4(t,e,n,r){e.forEach((o,s)=>{if(o.isText){let a,l=/\r?\n|\r/g;for(;a=l.exec(o.text);){let u=t.mapping.slice(r).map(n+1+s+a.index);t.replaceWith(u,u+1,e.type.schema.linebreakReplacement.create())}}})}function I4(t,e,n,r){e.forEach((o,s)=>{if(o.type==o.type.schema.linebreakReplacement){let a=t.mapping.slice(r).map(n+1+s);t.replaceWith(a,a+1,e.type.schema.text(`
95
+ `))}})}function PI(t,e,n){let r=t.resolve(e),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}function DI(t,e,n,r,o){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let a=n.create(r,null,o||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,a);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new bn(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new xe(ue.from(a),0,0),1,!0))}function pr(t,e,n=1,r){let o=t.resolve(e),s=o.depth-n,a=r&&r[r.length-1]||o.parent;if(s<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!a.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let c=o.depth-1,f=n-2;c>s;c--,f--){let h=o.node(c),m=o.index(c);if(h.type.spec.isolating)return!1;let g=h.content.cutByIndex(m,h.childCount),b=r&&r[f+1];b&&(g=g.replaceChild(0,b.type.create(b.attrs)));let y=r&&r[f]||h;if(!h.canReplace(m+1,h.childCount)||!y.type.validContent(g))return!1}let l=o.indexAfter(s),u=r&&r[0];return o.node(s).canReplaceWith(l,l,u?u.type:o.node(s+1).type)}function FI(t,e,n=1,r){let o=t.doc.resolve(e),s=ue.empty,a=ue.empty;for(let l=o.depth,u=o.depth-n,c=n-1;l>u;l--,c--){s=ue.from(o.node(l).copy(s));let f=r&&r[c];a=ue.from(f?f.type.create(f.attrs,a):o.node(l).copy(a))}t.step(new dn(e,e,new xe(s.append(a),n,n),!0))}function Ii(t,e){let n=t.resolve(e),r=n.index();return L4(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function VI(t,e){e.content.size||t.type.compatibleContent(e.type);let n=t.contentMatchAt(t.childCount),{linebreakReplacement:r}=t.type.schema;for(let o=0;o<e.childCount;o++){let s=e.child(o),a=s.type==r?t.type.schema.nodes.text:s.type;if(n=n.matchType(a),!n||!t.type.allowsMarks(s.marks))return!1}return n.validEnd}function L4(t,e){return!!(t&&e&&!t.isLeaf&&VI(t,e))}function Md(t,e,n=-1){let r=t.resolve(e);for(let o=r.depth;;o--){let s,a,l=r.index(o);if(o==r.depth?(s=r.nodeBefore,a=r.nodeAfter):n>0?(s=r.node(o+1),l++,a=r.node(o).maybeChild(l)):(s=r.node(o).maybeChild(l-1),a=r.node(o+1)),s&&!s.isTextblock&&L4(s,a)&&r.node(o).canReplace(l,l+1))return e;if(o==0)break;e=n<0?r.before(o):r.after(o)}}function $I(t,e,n){let r=null,{linebreakReplacement:o}=t.doc.type.schema,s=t.doc.resolve(e-n),a=s.node().type;if(o&&a.inlineContent){let f=a.whitespace=="pre",h=!!a.contentMatch.matchType(o);f&&!h?r=!1:!f&&h&&(r=!0)}let l=t.steps.length;if(r===!1){let f=t.doc.resolve(e+n);I4(t,f.node(),f.before(),l)}a.inlineContent&&l0(t,e+n-1,a,s.node().contentMatchAt(s.index()),r==null);let u=t.mapping.slice(l),c=u.map(e-n);if(t.step(new dn(c,u.map(e+n,-1),xe.empty,!0)),r===!0){let f=t.doc.resolve(c);R4(t,f.node(),f.before(),t.steps.length)}return t}function zI(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let o=r.depth-1;o>=0;o--){let s=r.index(o);if(r.node(o).canReplaceWith(s,s,n))return r.before(o+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let o=r.depth-1;o>=0;o--){let s=r.indexAfter(o);if(r.node(o).canReplaceWith(s,s,n))return r.after(o+1);if(s<r.node(o).childCount)return null}return null}function P4(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let o=n.content;for(let s=0;s<n.openStart;s++)o=o.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let a=r.depth;a>=0;a--){let l=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,u=r.index(a)+(l>0?1:0),c=r.node(a),f=!1;if(s==1)f=c.canReplace(u,u,o);else{let h=c.contentMatchAt(u).findWrapping(o.firstChild.type);f=h&&c.canReplaceWith(u,u,h[0])}if(f)return l==0?r.pos:l<0?r.before(a+1):r.after(a+1)}return null}function Bd(t,e,n=e,r=xe.empty){if(e==n&&!r.size)return null;let o=t.resolve(e),s=t.resolve(n);return D4(o,s,r)?new dn(e,n,r):new HI(o,s,r).fit()}function D4(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class HI{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=ue.empty;for(let o=0;o<=e.depth;o++){let s=e.node(o);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(o))})}for(let o=e.depth;o>0;o--)this.placed=ue.from(e.node(o).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(e<0?this.$to:r.doc.resolve(e));if(!o)return null;let s=this.placed,a=r.depth,l=o.depth;for(;a&&l&&s.childCount==1;)s=s.firstChild.content,a--,l--;let u=new xe(s,a,l);return e>-1?new bn(r.pos,e,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new dn(r.pos,o.pos,u):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,o=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(o=0),s.type.spec.isolating&&o<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let o,s=null;r?(s=c0(this.unplaced.content,r-1).firstChild,o=s.content):o=this.unplaced.content;let a=o.firstChild;for(let l=this.depth;l>=0;l--){let{type:u,match:c}=this.frontier[l],f,h=null;if(n==1&&(a?c.matchType(a.type)||(h=c.fillBefore(ue.from(a),!1)):s&&u.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:l,parent:s,inject:h};if(n==2&&a&&(f=c.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:l,parent:s,wrap:f};if(s&&c.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=c0(e,n);return!o.childCount||o.firstChild.isLeaf?!1:(this.unplaced=new xe(e,n+1,Math.max(r,o.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,o=c0(e,n);if(o.childCount<=1&&n>0){let s=e.size-n<=n+o.size;this.unplaced=new xe(uu(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new xe(uu(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:o,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let y=0;y<s.length;y++)this.openFrontierNode(s[y]);let a=this.unplaced,l=r?r.content:a.content,u=a.openStart-e,c=0,f=[],{match:h,type:m}=this.frontier[n];if(o){for(let y=0;y<o.childCount;y++)f.push(o.child(y));h=h.matchFragment(o)}let g=l.size+e-(a.content.size-a.openEnd);for(;c<l.childCount;){let y=l.child(c),w=h.matchType(y.type);if(!w)break;c++,(c>1||u==0||y.content.size)&&(h=w,f.push(F4(y.mark(m.allowedMarks(y.marks)),c==1?u:0,c==l.childCount?g:-1)))}let b=c==l.childCount;b||(g=-1),this.placed=cu(this.placed,n,ue.from(f)),this.frontier[n].match=h,b&&g<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let y=0,w=l;y<g;y++){let x=w.lastChild;this.frontier.push({type:x.type,match:x.contentMatchAt(x.childCount)}),w=x.content}this.unplaced=b?e==0?xe.empty:new xe(uu(a.content,e-1,1),e-1,g<0?a.openEnd:e-1):new xe(uu(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!d0(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,o=this.$to.after(r);for(;r>1&&o==this.$to.end(--r);)++o;return o}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:o}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),a=d0(e,n,o,r,s);if(a){for(let l=n-1;l>=0;l--){let{match:u,type:c}=this.frontier[l],f=d0(e,l,c,u,!0);if(!f||f.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=cu(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let o=e.node(r),s=o.type.contentMatch.fillBefore(o.content,!0,e.index(r));this.openFrontierNode(o.type,o.attrs,s)}return e}openFrontierNode(e,n=null,r){let o=this.frontier[this.depth];o.match=o.match.matchType(e),this.placed=cu(this.placed,this.depth,ue.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(ue.empty,!0);n.childCount&&(this.placed=cu(this.placed,this.frontier.length,n))}}function uu(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(uu(t.firstChild.content,e-1,n)))}function cu(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(cu(t.lastChild.content,e-1,n)))}function c0(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function F4(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,F4(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(ue.empty,!0)))),t.copy(r)}function d0(t,e,n,r,o){let s=t.node(e),a=o?t.indexAfter(e):t.index(e);if(a==s.childCount&&!n.compatibleContent(s.type))return null;let l=r.fillBefore(s.content,!0,a);return l&&!UI(n,s.content,a)?l:null}function UI(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function WI(t){return t.spec.defining||t.spec.definingForContent}function jI(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let o=t.doc.resolve(e),s=t.doc.resolve(n);if(D4(o,s,r))return t.step(new dn(e,n,r));let a=$4(o,t.doc.resolve(n));a[a.length-1]==0&&a.pop();let l=-(o.depth+1);a.unshift(l);for(let m=o.depth,g=o.pos-1;m>0;m--,g--){let b=o.node(m).type.spec;if(b.defining||b.definingAsContext||b.isolating)break;a.indexOf(m)>-1?l=m:o.before(m)==g&&a.splice(1,0,-m)}let u=a.indexOf(l),c=[],f=r.openStart;for(let m=r.content,g=0;;g++){let b=m.firstChild;if(c.push(b),g==r.openStart)break;m=b.content}for(let m=f-1;m>=0;m--){let g=c[m],b=WI(g.type);if(b&&!g.sameMarkup(o.node(Math.abs(l)-1)))f=m;else if(b||!g.type.isTextblock)break}for(let m=r.openStart;m>=0;m--){let g=(m+f+1)%(r.openStart+1),b=c[g];if(b)for(let y=0;y<a.length;y++){let w=a[(y+u)%a.length],x=!0;w<0&&(x=!1,w=-w);let _=o.node(w-1),S=o.index(w-1);if(_.canReplaceWith(S,S,b.type,b.marks))return t.replace(o.before(w),x?s.after(w):n,new xe(V4(r.content,0,r.openStart,g),g,r.openEnd))}}let h=t.steps.length;for(let m=a.length-1;m>=0&&(t.replace(e,n,r),!(t.steps.length>h));m--){let g=a[m];g<0||(e=o.before(g),n=s.after(g))}}function V4(t,e,n,r,o){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(V4(s.content,e+1,n,r,s)))}if(e>r){let s=o.contentMatchAt(0),a=s.fillBefore(t).append(t);t=a.append(s.matchFragment(a).fillBefore(ue.empty,!0))}return t}function qI(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let o=zI(t.doc,e,r.type);o!=null&&(e=n=o)}t.replaceRange(e,n,new xe(ue.from(r),0,0))}function KI(t,e,n){let r=t.doc.resolve(e),o=t.doc.resolve(n),s=$4(r,o);for(let a=0;a<s.length;a++){let l=s[a],u=a==s.length-1;if(u&&l==0||r.node(l).type.contentMatch.validEnd)return t.delete(r.start(l),o.end(l));if(l>0&&(u||r.node(l-1).canReplace(r.index(l-1),o.indexAfter(l-1))))return t.delete(r.before(l),o.after(l))}for(let a=1;a<=r.depth&&a<=o.depth;a++)if(e-r.start(a)==r.depth-a&&n>r.end(a)&&o.end(a)-n!=o.depth-a&&r.start(a-1)==o.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),o.index(a-1)))return t.delete(r.before(a),n);t.delete(e,n)}function $4(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let o=r;o>=0;o--){let s=t.start(o);if(s<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;(s==e.start(o)||o==t.depth&&o==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&o&&e.start(o-1)==s-1)&&n.push(o)}return n}class $a extends Bn{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return cn.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let o=n.type.create(r,null,n.marks);return cn.fromReplace(e,this.pos,this.pos+1,new xe(ue.from(o),0,n.isLeaf?0:1))}getMap(){return fr.empty}invert(e){return new $a(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 $a(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 $a(n.pos,n.attr,n.value)}}Bn.jsonID("attr",$a);class du extends Bn{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let o in e.attrs)n[o]=e.attrs[o];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return cn.ok(r)}getMap(){return fr.empty}invert(e){return new du(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 du(n.attr,n.value)}}Bn.jsonID("docAttr",du);let za=class extends Error{};za=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},za.prototype=Object.create(Error.prototype),za.prototype.constructor=za,za.prototype.name="TransformError";class f0{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new lu}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new za(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,r=xe.empty){let o=Bd(this.doc,e,n,r);return o&&this.step(o),this}replaceWith(e,n,r){return this.replace(e,n,new xe(ue.from(r),0,0))}delete(e,n){return this.replace(e,n,xe.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return jI(this,e,n,r),this}replaceRangeWith(e,n,r){return qI(this,e,n,r),this}deleteRange(e,n){return KI(this,e,n),this}lift(e,n){return MI(this,e,n),this}join(e,n=1){return $I(this,e,n),this}wrap(e,n){return II(this,e,n),this}setBlockType(e,n=e,r,o=null){return LI(this,e,n,r,o),this}setNodeMarkup(e,n,r=null,o){return DI(this,e,n,r,o),this}setNodeAttribute(e,n,r){return this.step(new $a(e,n,r)),this}setDocAttribute(e,n){return this.step(new du(e,n)),this}addNodeMark(e,n){return this.step(new Ri(e,n)),this}removeNodeMark(e,n){if(!(n instanceof Ft)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Fa(e,n)),this}split(e,n=1,r){return FI(this,e,n,r),this}addMark(e,n,r){return TI(this,e,n,r),this}removeMark(e,n,r){return AI(this,e,n,r),this}clearIncompatible(e,n,r){return l0(this,e,n,r),this}}const p0=Object.create(null);let Ve=class{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new z4(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=xe.empty){let r=n.content.lastChild,o=null;for(let l=0;l<n.openEnd;l++)o=r,r=r.lastChild;let s=e.steps.length,a=this.ranges;for(let l=0;l<a.length;l++){let{$from:u,$to:c}=a[l],f=e.mapping.slice(s);e.replaceRange(f.map(u.pos),f.map(c.pos),l?xe.empty:n),l==0&&W4(e,s,(r?r.isInline:o&&o.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:a,$to:l}=o[s],u=e.mapping.slice(r),c=u.map(a.pos),f=u.map(l.pos);s?e.deleteRange(c,f):(e.replaceRangeWith(c,f,n),W4(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let o=e.parent.inlineContent?new Ie(e):Ha(e.node(0),e.parent,e.pos,e.index(),n,r);if(o)return o;for(let s=e.depth-1;s>=0;s--){let a=n<0?Ha(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):Ha(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(a)return a}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Rn(e.node(0))}static atStart(e){return Ha(e,e,0,0,1)||new Rn(e)}static atEnd(e){return Ha(e,e,e.content.size,e.childCount,-1)||new Rn(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=p0[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in p0)throw new RangeError("Duplicate use of selection JSON ID "+e);return p0[e]=n,n.prototype.jsonID=e,n}getBookmark(){return Ie.between(this.$anchor,this.$head).getBookmark()}};Ve.prototype.visible=!0;class z4{constructor(e,n){this.$from=e,this.$to=n}}let H4=!1;function U4(t){!H4&&!t.parent.inlineContent&&(H4=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Ie extends Ve{constructor(e,n=e){U4(e),U4(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return Ve.near(r);let o=e.resolve(n.map(this.anchor));return new Ie(o.parent.inlineContent?o:r,r)}replace(e,n=xe.empty){if(super.replace(e,n),n==xe.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Ie&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Rd(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 Ie(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let o=e.resolve(n);return new this(o,r==n?o:e.resolve(r))}static between(e,n,r){let o=e.pos-n.pos;if((!r||o)&&(r=o>=0?1:-1),!n.parent.inlineContent){let s=Ve.findFrom(n,r,!0)||Ve.findFrom(n,-r,!0);if(s)n=s.$head;else return Ve.near(n,r)}return e.parent.inlineContent||(o==0?e=n:(e=(Ve.findFrom(e,-r,!0)||Ve.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=o<0&&(e=n))),new Ie(e,n)}}Ve.jsonID("text",Ie);class Rd{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Rd(e.map(this.anchor),e.map(this.head))}resolve(e){return Ie.between(e.resolve(this.anchor),e.resolve(this.head))}}class Pe extends Ve{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:o}=n.mapResult(this.anchor),s=e.resolve(o);return r?Ve.near(s):new Pe(s)}content(){return new xe(ue.from(this.node),0,0)}eq(e){return e instanceof Pe&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new h0(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Pe(e.resolve(n.anchor))}static create(e,n){return new Pe(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Pe.prototype.visible=!1,Ve.jsonID("node",Pe);class h0{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Rd(r,r):new h0(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&Pe.isSelectable(r)?new Pe(n):Ve.near(n)}}class Rn extends Ve{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=xe.empty){if(n==xe.empty){e.delete(0,e.doc.content.size);let r=Ve.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Rn(e)}map(e){return new Rn(e)}eq(e){return e instanceof Rn}getBookmark(){return GI}}Ve.jsonID("all",Rn);const GI={map(){return this},resolve(t){return new Rn(t)}};function Ha(t,e,n,r,o,s=!1){if(e.inlineContent)return Ie.create(t,n);for(let a=r-(o>0?0:1);o>0?a<e.childCount:a>=0;a+=o){let l=e.child(a);if(l.isAtom){if(!s&&Pe.isSelectable(l))return Pe.create(t,n-(o<0?l.nodeSize:0))}else{let u=Ha(t,l,n+o,o<0?l.childCount:0,o,s);if(u)return u}n+=l.nodeSize*o}return null}function W4(t,e,n){let r=t.steps.length-1;if(r<e)return;let o=t.steps[r];if(!(o instanceof dn||o instanceof bn))return;let s=t.mapping.maps[r],a;s.forEach((l,u,c,f)=>{a==null&&(a=f)}),t.setSelection(Ve.near(t.doc.resolve(a),n))}const j4=1,q4=2,K4=4;class XI extends f0{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=(this.updated|j4)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&j4)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=q4,this}ensureMarks(e){return Ft.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(this.updated&q4)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&-3,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Ft.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let o=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(o.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let a=this.doc.resolve(n);s=r==n?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,o.text(e,s)),this.selection.empty||this.setSelection(Ve.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|=K4,this}get scrolledIntoView(){return(this.updated&K4)>0}}function G4(t,e){return!e||!t?t:t.bind(e)}class fu{constructor(e,n,r){this.name=e,this.init=G4(n.init,r),this.apply=G4(n.apply,r)}}const JI=[new fu("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new fu("selection",{init(t,e){return t.selection||Ve.atStart(e.doc)},apply(t){return t.selection}}),new fu("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new fu("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class m0{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=JI.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new fu(r.key,r.spec.state,r))})}}class Ua{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 r=0;r<this.config.plugins.length;r++)if(r!=n){let o=this.config.plugins[r];if(o.spec.filterTransaction&&!o.spec.filterTransaction.call(o,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),o=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 u=o?o[a].n:0,c=o?o[a].state:this,f=u<n.length&&l.spec.appendTransaction.call(l,u?n.slice(u):n,c,r);if(f&&r.filterTransaction(f,a)){if(f.setMeta("appendedTransaction",e),!o){o=[];for(let h=0;h<this.config.plugins.length;h++)o.push(h<a?{state:r,n:n.length}:{state:this,n:0})}n.push(f),r=r.applyInner(f),s=!0}o&&(o[a]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Ua(this.config),r=this.config.fields;for(let o=0;o<r.length;o++){let s=r[o];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new XI(this)}static create(e){let n=new m0(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Ua(n);for(let o=0;o<n.fields.length;o++)r[n.fields[o].name]=n.fields[o].init(e,r);return r}reconfigure(e){let n=new m0(this.schema,e.plugins),r=n.fields,o=new Ua(n);for(let s=0;s<r.length;s++){let a=r[s].name;o[a]=this.hasOwnProperty(a)?this[a]:r[s].init(e,o)}return o}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let o=e[r],s=o.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(o,this[o.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new m0(e.schema,e.plugins),s=new Ua(o);return o.fields.forEach(a=>{if(a.name=="doc")s.doc=Nr.fromJSON(e.schema,n.doc);else if(a.name=="selection")s.selection=Ve.fromJSON(s.doc,n.selection);else if(a.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let u=r[l],c=u.spec.state;if(u.key==a.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){s[a.name]=c.fromJSON.call(u,e,n[l],s);return}}s[a.name]=a.init(e,s)}}),s}}function X4(t,e,n){for(let r in t){let o=t[r];o instanceof Function?o=o.bind(e):r=="handleDOMEvents"&&(o=X4(o,e,{})),n[r]=o}return n}class dt{constructor(e){this.spec=e,this.props={},e.props&&X4(e.props,this,this.props),this.key=e.key?e.key.key:J4("plugin")}getState(e){return e[this.key]}}const g0=Object.create(null);function J4(t){return t in g0?t+"$"+ ++g0[t]:(g0[t]=0,t+"$")}class kt{constructor(e="key"){this.key=J4(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const En=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Wa=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let b0=null;const jo=function(t,e,n){let r=b0||(b0=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},YI=function(){b0=null},As=function(t,e,n,r){return n&&(Y4(t,e,n,r,-1)||Y4(t,e,n,r,1))},ZI=/^(img|br|input|textarea|hr)$/i;function Y4(t,e,n,r,o){for(;;){if(t==n&&e==r)return!0;if(e==(o<0?0:Ar(t))){let s=t.parentNode;if(!s||s.nodeType!=1||pu(t)||ZI.test(t.nodeName)||t.contentEditable=="false")return!1;e=En(t)+(o<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(o<0?-1:0)],t.contentEditable=="false")return!1;e=o<0?Ar(t):0}else return!1}}function Ar(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function QI(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Ar(t)}else if(t.parentNode&&!pu(t))e=En(t),t=t.parentNode;else return null}}function NI(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!pu(t))e=En(t)+1,t=t.parentNode;else return null}}function eL(t,e,n){for(let r=e==0,o=e==Ar(t);r||o;){if(t==n)return!0;let s=En(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,o=o&&s==Ar(t)}}function pu(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 Id=function(t){return t.focusNode&&As(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Os(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function tL(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function nL(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:Math.min(Ar(r.offsetNode),r.offset)}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:Math.min(Ar(r.startContainer),r.startOffset)}}}const wo=typeof navigator<"u"?navigator:null,Z4=typeof document<"u"?document:null,Li=wo&&wo.userAgent||"",v0=/Edge\/(\d+)/.exec(Li),Q4=/MSIE \d/.exec(Li),y0=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Li),Zn=!!(Q4||y0||v0),Pi=Q4?document.documentMode:y0?+y0[1]:v0?+v0[1]:0,eo=!Zn&&/gecko\/(\d+)/i.test(Li);eo&&+(/Firefox\/(\d+)/.exec(Li)||[0,0])[1];const w0=!Zn&&/Chrome\/(\d+)/.exec(Li),In=!!w0,N4=w0?+w0[1]:0,Un=!Zn&&!!wo&&/Apple Computer/.test(wo.vendor),ja=Un&&(/Mobile\/\w+/.test(Li)||!!wo&&wo.maxTouchPoints>2),Or=ja||(wo?/Mac/.test(wo.platform):!1),rL=wo?/Win/.test(wo.platform):!1,qo=/Android \d/.test(Li),hu=!!Z4&&"webkitFontSmoothing"in Z4.documentElement.style,oL=hu?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function iL(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 Ko(t,e){return typeof t=="number"?t:t[e]}function sL(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function ew(t,e,n){let r=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let a=n||t.dom;a;){if(a.nodeType!=1){a=Wa(a);continue}let l=a,u=l==s.body,c=u?iL(s):sL(l),f=0,h=0;if(e.top<c.top+Ko(r,"top")?h=-(c.top-e.top+Ko(o,"top")):e.bottom>c.bottom-Ko(r,"bottom")&&(h=e.bottom-e.top>c.bottom-c.top?e.top+Ko(o,"top")-c.top:e.bottom-c.bottom+Ko(o,"bottom")),e.left<c.left+Ko(r,"left")?f=-(c.left-e.left+Ko(o,"left")):e.right>c.right-Ko(r,"right")&&(f=e.right-c.right+Ko(o,"right")),f||h)if(u)s.defaultView.scrollBy(f,h);else{let g=l.scrollLeft,b=l.scrollTop;h&&(l.scrollTop+=h),f&&(l.scrollLeft+=f);let y=l.scrollLeft-g,w=l.scrollTop-b;e={left:e.left-y,top:e.top-w,right:e.right-y,bottom:e.bottom-w}}let m=u?"fixed":getComputedStyle(a).position;if(/^(fixed|sticky)$/.test(m))break;a=m=="absolute"?a.offsetParent:Wa(a)}}function aL(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,o;for(let s=(e.left+e.right)/2,a=n+1;a<Math.min(innerHeight,e.bottom);a+=5){let l=t.root.elementFromPoint(s,a);if(!l||l==t.dom||!t.dom.contains(l))continue;let u=l.getBoundingClientRect();if(u.top>=n-20){r=l,o=u.top;break}}return{refDOM:r,refTop:o,stack:tw(t.dom)}}function tw(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Wa(r));return e}function lL({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;nw(n,r==0?0:r-e)}function nw(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:o,left:s}=t[n];r.scrollTop!=o+e&&(r.scrollTop=o+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let qa=null;function uL(t){if(t.setActive)return t.setActive();if(qa)return t.focus(qa);let e=tw(t);t.focus(qa==null?{get preventScroll(){return qa={preventScroll:!0},!0}}:void 0),qa||(qa=!1,nw(e,0))}function rw(t,e){let n,r=2e8,o,s=0,a=e.top,l=e.top,u,c;for(let f=t.firstChild,h=0;f;f=f.nextSibling,h++){let m;if(f.nodeType==1)m=f.getClientRects();else if(f.nodeType==3)m=jo(f).getClientRects();else continue;for(let g=0;g<m.length;g++){let b=m[g];if(b.top<=a&&b.bottom>=l){a=Math.max(b.bottom,a),l=Math.min(b.top,l);let y=b.left>e.left?b.left-e.left:b.right<e.left?e.left-b.right:0;if(y<r){n=f,r=y,o=y&&n.nodeType==3?{left:b.right<e.left?b.right:b.left,top:e.top}:e,f.nodeType==1&&y&&(s=h+(e.left>=(b.left+b.right)/2?1:0));continue}}else b.top>e.top&&!u&&b.left<=e.left&&b.right>=e.left&&(u=f,c={left:Math.max(b.left,Math.min(b.right,e.left)),top:b.top});!n&&(e.left>=b.right&&e.top>=b.top||e.left>=b.left&&e.top>=b.bottom)&&(s=h+1)}}return!n&&u&&(n=u,o=c,r=0),n&&n.nodeType==3?cL(n,o):!n||r&&n.nodeType==1?{node:t,offset:s}:rw(n,o)}function cL(t,e){let n=t.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(t,o+1),r.setStart(t,o);let s=Di(r,1);if(s.top!=s.bottom&&x0(e,s))return{node:t,offset:o+(e.left>=(s.left+s.right)/2?1:0)}}return{node:t,offset:0}}function x0(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function dL(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function fL(t,e,n){let{node:r,offset:o}=rw(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();s=a.left!=a.right&&n.left>(a.left+a.right)/2?1:-1}return t.docView.posFromDOM(r,o,s)}function pL(t,e,n,r){let o=-1;for(let s=e,a=!1;s!=t.dom;){let l=t.docView.nearestDesc(s,!0),u;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((u=l.dom.getBoundingClientRect()).width||u.height)&&(l.node.isBlock&&l.parent&&(!a&&u.left>r.left||u.top>r.top?o=l.posBefore:(!a&&u.right<r.left||u.bottom<r.top)&&(o=l.posAfter),a=!0),!l.contentDOM&&o<0&&!l.node.isText))return(l.node.isBlock?r.top<(u.top+u.bottom)/2:r.left<(u.left+u.right)/2)?l.posBefore:l.posAfter;s=l.dom.parentNode}return o>-1?o:t.docView.posFromDOM(e,n,-1)}function ow(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let o=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),s=o;;){let a=t.childNodes[s];if(a.nodeType==1){let l=a.getClientRects();for(let u=0;u<l.length;u++){let c=l[u];if(x0(e,c))return ow(a,e,c)}}if((s=(s+1)%r)==o)break}return t}function hL(t,e){let n=t.dom.ownerDocument,r,o=0,s=nL(n,e.left,e.top);s&&({node:r,offset:o}=s);let a=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),l;if(!a||!t.dom.contains(a.nodeType!=1?a.parentNode:a)){let c=t.dom.getBoundingClientRect();if(!x0(e,c)||(a=ow(t.dom,e,c),!a))return null}if(Un)for(let c=a;r&&c;c=Wa(c))c.draggable&&(r=void 0);if(a=dL(a,e),r){if(eo&&r.nodeType==1&&(o=Math.min(o,r.childNodes.length),o<r.childNodes.length)){let f=r.childNodes[o],h;f.nodeName=="IMG"&&(h=f.getBoundingClientRect()).right<=e.left&&h.bottom>e.top&&o++}let c;hu&&o&&r.nodeType==1&&(c=r.childNodes[o-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&o--,r==t.dom&&o==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(o==0||r.nodeType!=1||r.childNodes[o-1].nodeName!="BR")&&(l=pL(t,r,o,e))}l==null&&(l=fL(t,a,e));let u=t.docView.nearestDesc(a,!0);return{pos:l,inside:u?u.posAtStart-u.border:-1}}function iw(t){return t.top<t.bottom||t.left<t.right}function Di(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(iw(r))return r}return Array.prototype.find.call(n,iw)||t.getBoundingClientRect()}const mL=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function sw(t,e,n){let{node:r,offset:o,atom:s}=t.docView.domFromPos(e,n<0?-1:1),a=hu||eo;if(r.nodeType==3)if(a&&(mL.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let u=Di(jo(r,o,o),n);if(eo&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let c=Di(jo(r,o-1,o-1),-1);if(c.top==u.top){let f=Di(jo(r,o,o+1),-1);if(f.top!=u.top)return mu(f,f.left<c.left)}}return u}else{let u=o,c=o,f=n<0?1:-1;return n<0&&!o?(c++,f=-1):n>=0&&o==r.nodeValue.length?(u--,f=1):n<0?u--:c++,mu(Di(jo(r,u,c),f),f<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&o&&(n<0||o==Ar(r))){let u=r.childNodes[o-1];if(u.nodeType==1)return C0(u.getBoundingClientRect(),!1)}if(s==null&&o<Ar(r)){let u=r.childNodes[o];if(u.nodeType==1)return C0(u.getBoundingClientRect(),!0)}return C0(r.getBoundingClientRect(),n>=0)}if(s==null&&o&&(n<0||o==Ar(r))){let u=r.childNodes[o-1],c=u.nodeType==3?jo(u,Ar(u)-(a?0:1)):u.nodeType==1&&(u.nodeName!="BR"||!u.nextSibling)?u:null;if(c)return mu(Di(c,1),!1)}if(s==null&&o<Ar(r)){let u=r.childNodes[o];for(;u.pmViewDesc&&u.pmViewDesc.ignoreForCoords;)u=u.nextSibling;let c=u?u.nodeType==3?jo(u,0,a?0:1):u.nodeType==1?u:null:null;if(c)return mu(Di(c,-1),!0)}return mu(Di(r.nodeType==3?jo(r):r,-n),n>=0)}function mu(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 C0(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 aw(t,e,n){let r=t.state,o=t.root.activeElement;r!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),o!=t.dom&&o&&o.focus()}}function gL(t,e,n){let r=e.selection,o=n=="up"?r.$from:r.$to;return aw(t,e,()=>{let{node:s}=t.docView.domFromPos(o.pos,n=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(s,!0);if(!l)break;if(l.node.isBlock){s=l.contentDOM||l.dom;break}s=l.dom.parentNode}let a=sw(t,o.pos,1);for(let l=s.firstChild;l;l=l.nextSibling){let u;if(l.nodeType==1)u=l.getClientRects();else if(l.nodeType==3)u=jo(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;c<u.length;c++){let f=u[c];if(f.bottom>f.top+1&&(n=="up"?a.top-f.top>(f.bottom-a.top)*2:f.bottom-a.bottom>(a.bottom-f.top)*2))return!1}}return!0})}const bL=/[\u0590-\u08ac]/;function vL(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,s=!o,a=o==r.parent.content.size,l=t.domSelection();return l?!bL.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?s:a:aw(t,e,()=>{let{focusNode:u,focusOffset:c,anchorNode:f,anchorOffset:h}=t.domSelectionRange(),m=l.caretBidiLevel;l.modify("move",n,"character");let g=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:b,focusOffset:y}=t.domSelectionRange(),w=b&&!g.contains(b.nodeType==1?b:b.parentNode)||u==b&&c==y;try{l.collapse(f,h),u&&(u!=f||c!=h)&&l.extend&&l.extend(u,c)}catch{}return m!=null&&(l.caretBidiLevel=m),w}):r.pos==r.start()||r.pos==r.end()}let lw=null,uw=null,cw=!1;function yL(t,e,n){return lw==e&&uw==n?cw:(lw=e,uw=n,cw=n=="up"||n=="down"?gL(t,e,n):vL(t,e,n))}const Mr=0,dw=1,Ms=2,xo=3;class gu{constructor(e,n,r,o){this.parent=e,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=Mr,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){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,r=this.posAtStart;;n++){let o=this.children[n];if(o==e)return r;r+=o.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,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<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}else{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 o;if(e==this.dom&&this.contentDOM)o=n>En(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))o=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){o=!1;break}if(s.previousSibling)break}if(o==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){o=!0;break}if(s.nextSibling)break}}return o??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,o=e;o;o=o.parentNode){let s=this.getDesc(o),a;if(s&&(!n||s.node))if(r&&(a=s.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))r=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let o=e;o;o=o.parentNode){let s=this.getDesc(o);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],s=r+o.size;if(r==e&&s!=r){for(;!o.border&&o.children.length;)for(let a=0;a<o.children.length;a++){let l=o.children[a];if(l.size){o=l;break}}return o}if(e<s)return o.descAt(e-r-o.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,o=0;for(let s=0;r<this.children.length;r++){let a=this.children[r],l=s+a.size;if(l>e||a instanceof hw){o=e-s;break}s=l}if(o)return this.children[r].domFromPos(o-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof fw&&s.side>=0;r--);if(n<=0){let s,a=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,a=!1);return s&&n&&a&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?En(s.dom)+1:0}}else{let s,a=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,a=!1);return s&&a&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?En(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let o=-1,s=-1;for(let a=r,l=0;;l++){let u=this.children[l],c=a+u.size;if(o==-1&&e<=c){let f=a+u.border;if(e>=f&&n<=c-u.border&&u.node&&u.contentDOM&&this.contentDOM.contains(u.contentDOM))return u.parseRange(e,n,f);e=a;for(let h=l;h>0;h--){let m=this.children[h-1];if(m.size&&m.dom.parentNode==this.contentDOM&&!m.emptyChildAt(1)){o=En(m.dom)+1;break}e-=m.size}o==-1&&(o=0)}if(o>-1&&(c>n||l==this.children.length-1)){n=c;for(let f=l+1;f<this.children.length;f++){let h=this.children[f];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){s=En(h.dom);break}n+=h.size}s==-1&&(s=this.contentDOM.childNodes.length);break}a=c}return{node:this.contentDOM,from:e,to:n,fromOffset:o,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:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,o=!1){let s=Math.min(e,n),a=Math.max(e,n);for(let g=0,b=0;g<this.children.length;g++){let y=this.children[g],w=b+y.size;if(s>b&&a<w)return y.setSelection(e-b-y.border,n-b-y.border,r,o);b=w}let l=this.domFromPos(e,e?-1:1),u=n==e?l:this.domFromPos(n,n?-1:1),c=r.root.getSelection(),f=r.domSelectionRange(),h=!1;if((eo||Un)&&e==n){let{node:g,offset:b}=l;if(g.nodeType==3){if(h=!!(b&&g.nodeValue[b-1]==`
96
96
  `),h&&b==g.nodeValue.length)for(let y=g,w;y;y=y.parentNode){if(w=y.nextSibling){w.nodeName=="BR"&&(l=u={node:w.parentNode,offset:En(w)+1});break}let x=y.pmViewDesc;if(x&&x.node&&x.node.isBlock)break}}else{let y=g.childNodes[b-1];h=y&&(y.nodeName=="BR"||y.contentEditable=="false")}}if(eo&&f.focusNode&&f.focusNode!=u.node&&f.focusNode.nodeType==1){let g=f.focusNode.childNodes[f.focusOffset];g&&g.contentEditable=="false"&&(o=!0)}if(!(o||h&&Un)&&As(l.node,l.offset,f.anchorNode,f.anchorOffset)&&As(u.node,u.offset,f.focusNode,f.focusOffset))return;let m=!1;if((c.extend||e==n)&&!h){c.collapse(l.node,l.offset);try{e!=n&&c.extend(u.node,u.offset),m=!0}catch{}}if(!m){if(e>n){let b=l;l=u,u=b}let g=document.createRange();g.setEnd(u.node,u.offset),g.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(g)}}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 r=0,o=0;o<this.children.length;o++){let s=this.children[o],a=r+s.size;if(r==a?e<=a&&n>=r:e<a&&n>r){let l=r+s.border,u=a-s.border;if(e>=l&&n<=u){this.dirty=e==r||n==a?Ms:dw,e==l&&n==u&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=xo:s.markDirty(e-l,n-l);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?Ms:xo}r=a}this.dirty=Ms}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?Ms:dw;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class fw extends gu{constructor(e,n,r,o){let s,a=n.type.toDOM;if(typeof a=="function"&&(a=a(r,()=>{if(!s)return o;if(s.parent)return s.parent.posBeforeChild(s)})),!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==Mr&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class wL extends gu{constructor(e,n,r,o){super(e,[],n,null),this.textDOM=r,this.text=o}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 Bs extends gu{constructor(e,n,r,o,s){super(e,[],r,o),this.mark=n,this.spec=s}static create(e,n,r,o){let s=o.nodeViews[n.type.name],a=s&&s(n,o,r);return(!a||!a.dom)&&(a=Mi.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new Bs(e,n,a.dom,a.contentDOM||a.dom,a)}parseRule(){return this.dirty&xo||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=xo&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=Mr){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Mr}}slice(e,n,r){let o=Bs.create(this.parent,this.mark,!0,r),s=this.children,a=this.size;n<a&&(s=_0(s,n,a,r)),e>0&&(s=_0(s,0,e,r));for(let l=0;l<s.length;l++)s[l].parent=o;return o.children=s,o}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Fi extends gu{constructor(e,n,r,o,s,a,l,u,c){super(e,[],s,a),this.node=n,this.outerDeco=r,this.innerDeco=o,this.nodeDOM=l}static create(e,n,r,o,s,a){let l=s.nodeViews[n.type.name],u,c=l&&l(n,s,()=>{if(!u)return a;if(u.parent)return u.parent.posBeforeChild(u)},r,o),f=c&&c.dom,h=c&&c.contentDOM;if(n.isText){if(!f)f=document.createTextNode(n.text);else if(f.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else f||({dom:f,contentDOM:h}=Mi.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!h&&!n.isText&&f.nodeName!="BR"&&(f.hasAttribute("contenteditable")||(f.contentEditable="false"),n.type.spec.draggable&&(f.draggable=!0));let m=f;return f=bw(f,r,n),c?u=new xL(e,n,r,o,f,h||null,m,c,s,a+1):n.isText?new Ld(e,n,r,o,f,m,s):new Fi(e,n,r,o,f,h||null,m,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)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>ue.empty)}return e}matchesNode(e,n,r){return this.dirty==Mr&&e.eq(this.node)&&Pd(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,o=n,s=e.composing?this.localCompositionInfo(e,n):null,a=s&&s.pos>-1?s:null,l=s&&s.pos<0,u=new EL(this,a&&a.node,e);kL(this.node,this.innerDeco,(c,f,h)=>{c.spec.marks?u.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!h&&u.syncToMarks(f==this.node.childCount?Ft.none:this.node.child(f).marks,r,e),u.placeWidget(c,e,o)},(c,f,h,m)=>{u.syncToMarks(c.marks,r,e);let g;u.findNodeMatch(c,f,h,m)||l&&e.state.selection.from>o&&e.state.selection.to<o+c.nodeSize&&(g=u.findIndexWithChild(s.node))>-1&&u.updateNodeAt(c,f,h,g,e)||u.updateNextNode(c,f,h,e,m,o)||u.addNode(c,f,h,e,o),o+=c.nodeSize}),u.syncToMarks([],r,e),this.node.isTextblock&&u.addTextblockHacks(),u.destroyRest(),(u.changed||this.dirty==Ms)&&(a&&this.protectLocalComposition(e,a),mw(this.contentDOM,this.children,e),ja&&TL(this.dom))}localCompositionInfo(e,n){let{from:r,to:o}=e.state.selection;if(!(e.state.selection instanceof Ie)||r<n||o>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=AL(this.node.content,a,r-n,o-n);return l<0?null:{node:s,pos:l,text:a}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:o}){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 wL(this,s,n,o);e.input.compositionNodes.push(a),this.children=_0(this.children,r,r+o.length,e,a)}update(e,n,r,o){return this.dirty==xo||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,o),!0)}updateInner(e,n,r,o){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(o,this.posAtStart),this.dirty=Mr}updateOuterDeco(e){if(Pd(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=gw(this.dom,this.nodeDOM,E0(this.outerDeco,this.node,n),E0(e,this.node,n)),this.dom!=r&&(r.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.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function pw(t,e,n,r,o){bw(r,e,t);let s=new Fi(void 0,t,e,n,r,r,r,o,0);return s.contentDOM&&s.updateChildren(o,0),s}class Ld extends Fi{constructor(e,n,r,o,s,a,l){super(e,n,r,o,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,r,o){return this.dirty==xo||this.dirty!=Mr&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Mr||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,o.trackWrites==this.nodeDOM&&(o.trackWrites=null)),this.node=e,this.dirty=Mr,!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,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let o=this.node.cut(e,n),s=document.createTextNode(o.text);return new Ld(this.parent,o,this.outerDeco,this.innerDeco,s,s,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=xo)}get domAtom(){return!1}isText(e){return this.node.text==e}}class hw extends gu{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Mr&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class xL extends Fi{constructor(e,n,r,o,s,a,l,u,c,f){super(e,n,r,o,s,a,l,c,f),this.spec=u}update(e,n,r,o){if(this.dirty==xo)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,o),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,o)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,o){this.spec.setSelection?this.spec.setSelection(e,n,r.root):super.setSelection(e,n,r,o)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function mw(t,e,n){let r=t.firstChild,o=!1;for(let s=0;s<e.length;s++){let a=e[s],l=a.dom;if(l.parentNode==t){for(;l!=r;)r=vw(r),o=!0;r=r.nextSibling}else o=!0,t.insertBefore(l,r);if(a instanceof Bs){let u=r?r.previousSibling:t.lastChild;mw(a.contentDOM,a.children,n),r=u?u.nextSibling:t.firstChild}}for(;r;)r=vw(r),o=!0;o&&n.trackWrites==t&&(n.trackWrites=null)}const bu=function(t){t&&(this.nodeName=t)};bu.prototype=Object.create(null);const Rs=[new bu];function E0(t,e,n){if(t.length==0)return Rs;let r=n?Rs[0]:new bu,o=[r];for(let s=0;s<t.length;s++){let a=t[s].type.attrs;if(a){a.nodeName&&o.push(r=new bu(a.nodeName));for(let l in a){let u=a[l];u!=null&&(n&&o.length==1&&o.push(r=new bu(e.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+u:l=="style"?r.style=(r.style?r.style+";":"")+u:l!="nodeName"&&(r[l]=u))}}}return o}function gw(t,e,n,r){if(n==Rs&&r==Rs)return e;let o=e;for(let s=0;s<r.length;s++){let a=r[s],l=n[s];if(s){let u;l&&l.nodeName==a.nodeName&&o!=t&&(u=o.parentNode)&&u.nodeName.toLowerCase()==a.nodeName||(u=document.createElement(a.nodeName),u.pmIsDeco=!0,u.appendChild(o),l=Rs[0]),o=u}CL(o,l||Rs[0],a)}return o}function CL(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)o.indexOf(r[s])==-1&&t.classList.remove(r[s]);for(let s=0;s<o.length;s++)r.indexOf(o[s])==-1&&t.classList.add(o[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,o;for(;o=r.exec(e.style);)t.style.removeProperty(o[1])}n.style&&(t.style.cssText+=n.style)}}function bw(t,e,n){return gw(t,t,Rs,E0(e,n,t.nodeType!=1))}function Pd(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 vw(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class EL{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=_L(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let o=0,s=this.stack.length>>1,a=Math.min(s,e.length);for(;o<a&&(o==s-1?this.top:this.stack[o+1<<1]).matchesMark(e[o])&&e[o].type.spec.spanning!==!1;)o++;for(;o<s;)this.destroyRest(),this.top.dirty=Mr,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 u=this.index;u<Math.min(this.index+3,this.top.children.length);u++){let c=this.top.children[u];if(c.matchesMark(e[s])&&!this.isLocked(c.dom)){l=u;break}}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let u=Bs.create(this.top,e[s],n,r);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,s++}}findNodeMatch(e,n,r,o){let s=-1,a;if(o>=this.preMatch.index&&(a=this.preMatch.matches[o-this.preMatch.index]).parent==this.top&&a.matchesNode(e,n,r))s=this.top.children.indexOf(a,this.index);else for(let l=this.index,u=Math.min(this.top.children.length,l+5);l<u;l++){let c=this.top.children[l];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){s=l;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,r,o,s){let a=this.top.children[o];return a.dirty==xo&&a.dom==a.contentDOM&&(a.dirty=Ms),a.update(e,n,r,s)?(this.destroyBetween(this.index,o),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let o=this.index;o<this.top.children.length;o++)if(this.top.children[o]==r)return o}return-1}e=n}}updateNextNode(e,n,r,o,s,a){for(let l=this.index;l<this.top.children.length;l++){let u=this.top.children[l];if(u instanceof Fi){let c=this.preMatch.matched.get(u);if(c!=null&&c!=s)return!1;let f=u.dom,h,m=this.isLocked(f)&&!(e.isText&&u.node&&u.node.isText&&u.nodeDOM.nodeValue==e.text&&u.dirty!=xo&&Pd(n,u.outerDeco));if(!m&&u.update(e,n,r,o))return this.destroyBetween(this.index,l),u.dom!=f&&(this.changed=!0),this.index++,!0;if(!m&&(h=this.recreateWrapper(u,e,n,r,o,a)))return this.destroyBetween(this.index,l),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=Ms,h.updateChildren(o,a+1),h.dirty=Mr),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,o,s,a){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content)||!Pd(r,e.outerDeco)||!o.eq(e.innerDeco))return null;let l=Fi.create(this.top,n,r,o,s,a);if(l.contentDOM){l.children=e.children,e.children=[];for(let u of l.children)u.parent=l}return e.destroy(),l}addNode(e,n,r,o,s){let a=Fi.create(this.top,e,n,r,o,s);a.contentDOM&&a.updateChildren(o,s+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,n,r){let o=this.index<this.top.children.length?this.top.children[this.index]:null;if(o&&o.matchesWidget(e)&&(e==o.widget||!o.widget.type.toDOM.parentNode))this.index++;else{let s=new fw(this.top,e,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof Bs;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Ld)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Un||In)&&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 r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let o=new hw(this.top,[],r,null);n!=this.top?n.children.push(o):n.children.splice(this.index++,0,o),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function _L(t,e){let n=e,r=n.children.length,o=t.childCount,s=new Map,a=[];e:for(;o>0;){let l;for(;;)if(r){let c=n.children[r-1];if(c instanceof Bs)n=c,r=c.children.length;else{l=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let u=l.node;if(u){if(u!=t.child(o-1))break;--o,s.set(l,o),a.push(l)}}return{index:o,matched:s,matches:a.reverse()}}function SL(t,e){return t.type.side-e.type.side}function kL(t,e,n,r){let o=e.locals(t),s=0;if(o.length==0){for(let c=0;c<t.childCount;c++){let f=t.child(c);r(f,o,e.forChild(s,f),c),s+=f.nodeSize}return}let a=0,l=[],u=null;for(let c=0;;){let f,h;for(;a<o.length&&o[a].to==s;){let w=o[a++];w.widget&&(f?(h||(h=[f])).push(w):f=w)}if(f)if(h){h.sort(SL);for(let w=0;w<h.length;w++)n(h[w],c,!!u)}else n(f,c,!!u);let m,g;if(u)g=-1,m=u,u=null;else if(c<t.childCount)g=c,m=t.child(c++);else break;for(let w=0;w<l.length;w++)l[w].to<=s&&l.splice(w--,1);for(;a<o.length&&o[a].from<=s&&o[a].to>s;)l.push(o[a++]);let b=s+m.nodeSize;if(m.isText){let w=b;a<o.length&&o[a].from<w&&(w=o[a].from);for(let x=0;x<l.length;x++)l[x].to<w&&(w=l[x].to);w<b&&(u=m.cut(w-s),m=m.cut(0,w-s),b=w,g=-1)}else for(;a<o.length&&o[a].to<b;)a++;let y=m.isInline&&!m.isLeaf?l.filter(w=>!w.inline):l.slice();r(m,y,e.forChild(s,m),g),s=b}}function TL(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function AL(t,e,n,r){for(let o=0,s=0;o<t.childCount&&s<=r;){let a=t.child(o++),l=s;if(s+=a.nodeSize,!a.isText)continue;let u=a.text;for(;o<t.childCount;){let c=t.child(o++);if(s+=c.nodeSize,!c.isText)break;u+=c.text}if(s>=n){if(s>=r&&u.slice(r-e.length-l,r-l)==e)return r-e.length;let c=l<r?u.lastIndexOf(e,r-l-1):-1;if(c>=0&&c+e.length+l>=n)return l+c;if(n==r&&u.length>=r+e.length-l&&u.slice(r-l,r-l+e.length)==e)return r}}return-1}function _0(t,e,n,r,o){let s=[];for(let a=0,l=0;a<t.length;a++){let u=t[a],c=l,f=l+=u.size;c>=n||f<=e?s.push(u):(c<e&&s.push(u.slice(0,e-c,r)),o&&(s.push(o),o=void 0),f>n&&s.push(u.slice(n-c,u.size,r)))}return s}function S0(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let o=t.docView.nearestDesc(n.focusNode),s=o&&o.size==0,a=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;let l=r.resolve(a),u,c;if(Id(n)){for(u=a;o&&!o.node;)o=o.parent;let h=o.node;if(o&&h.isAtom&&Pe.isSelectable(h)&&o.parent&&!(h.isInline&&eL(n.focusNode,n.focusOffset,o.dom))){let m=o.posBefore;c=new Pe(a==m?l:r.resolve(m))}}else{if(n instanceof t.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let h=a,m=a;for(let g=0;g<n.rangeCount;g++){let b=n.getRangeAt(g);h=Math.min(h,t.docView.posFromDOM(b.startContainer,b.startOffset,1)),m=Math.max(m,t.docView.posFromDOM(b.endContainer,b.endOffset,-1))}if(h<0)return null;[u,a]=m==t.state.selection.anchor?[m,h]:[h,m],l=r.resolve(a)}else u=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null}let f=r.resolve(u);if(!c){let h=e=="pointer"||t.state.selection.head<l.pos&&!s?1:-1;c=T0(t,f,l,h)}return c}function yw(t){return t.editable?t.hasFocus():kw(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Go(t,e=!1){let n=t.state.selection;if(Ew(t,n),!!yw(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&In){let r=t.domSelectionRange(),o=t.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&As(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)ML(t);else{let{anchor:r,head:o}=n,s,a;ww&&!(n instanceof Ie)&&(n.$from.parent.inlineContent||(s=xw(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=xw(t,n.to))),t.docView.setSelection(r,o,t,e),ww&&(s&&Cw(s),a&&Cw(a)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&OL(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const ww=Un||In&&N4<63;function xw(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),o=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(Un&&o&&o.contentEditable=="false")return k0(o);if((!o||o.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(o)return k0(o);if(s)return k0(s)}}function k0(t){return t.contentEditable="true",Un&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Cw(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function OL(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,o=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=o)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!yw(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function ML(t){let e=t.domSelection(),n=document.createRange();if(!e)return;let r=t.cursorWrapper.dom,o=r.nodeName=="IMG";o?n.setStart(r.parentNode,En(r)+1):n.setStart(r,0),n.collapse(!0),e.removeAllRanges(),e.addRange(n),!o&&!t.state.selection.visible&&Zn&&Pi<=11&&(r.disabled=!0,r.disabled=!1)}function Ew(t,e){if(e instanceof Pe){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(_w(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else _w(t)}function _w(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function T0(t,e,n,r){return t.someProp("createSelectionBetween",o=>o(t,e,n))||Ie.between(e,n,r)}function Sw(t){return t.editable&&!t.hasFocus()?!1:kw(t)}function kw(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 BL(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return As(e.node,e.offset,n.anchorNode,n.anchorOffset)}function A0(t,e){let{$anchor:n,$head:r}=t.selection,o=e>0?n.max(r):n.min(r),s=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return s&&Ve.findFrom(s,e)}function Vi(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Tw(t,e,n){let r=t.state.selection;if(r instanceof Ie)if(n.indexOf("s")>-1){let{$head:o}=r,s=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let a=t.state.doc.resolve(o.pos+s.nodeSize*(e<0?-1:1));return Vi(t,new Ie(r.$anchor,a))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let o=A0(t.state,e);return o&&o instanceof Pe?Vi(t,o):!1}else if(!(Or&&n.indexOf("m")>-1)){let o=r.$head,s=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter,a;if(!s||s.isText)return!1;let l=e<0?o.pos-s.nodeSize:o.pos;return s.isAtom||(a=t.docView.descAt(l))&&!a.contentDOM?Pe.isSelectable(s)?Vi(t,new Pe(e<0?t.state.doc.resolve(o.pos-s.nodeSize):o)):hu?Vi(t,new Ie(t.state.doc.resolve(e<0?l:l+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Pe&&r.node.isInline)return Vi(t,new Ie(e>0?r.$to:r.$from));{let o=A0(t.state,e);return o?Vi(t,o):!1}}}function Dd(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function vu(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Ka(t,e){return e<0?RL(t):IL(t)}function RL(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o,s,a=!1;for(eo&&n.nodeType==1&&r<Dd(n)&&vu(n.childNodes[r],-1)&&(a=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(vu(l,-1))o=n,s=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(Aw(n))break;{let l=n.previousSibling;for(;l&&vu(l,-1);)o=n.parentNode,s=En(l),l=l.previousSibling;if(l)n=l,r=Dd(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}a?O0(t,n,r):o&&O0(t,o,s)}function IL(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let o=Dd(n),s,a;for(;;)if(r<o){if(n.nodeType!=1)break;let l=n.childNodes[r];if(vu(l,1))s=n,a=++r;else break}else{if(Aw(n))break;{let l=n.nextSibling;for(;l&&vu(l,1);)s=l.parentNode,a=En(l)+1,l=l.nextSibling;if(l)n=l,r=0,o=Dd(n);else{if(n=n.parentNode,n==t.dom)break;r=o=0}}}s&&O0(t,s,a)}function Aw(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function LL(t,e){for(;t&&e==t.childNodes.length&&!pu(t);)e=En(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function PL(t,e){for(;t&&!e&&!pu(t);)e=En(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function O0(t,e,n){if(e.nodeType!=3){let s,a;(a=LL(e,n))?(e=a,n=0):(s=PL(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(!r)return;if(Id(r)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:o}=t;setTimeout(()=>{t.state==o&&Go(t)},50)}function Ow(t,e){let n=t.state.doc.resolve(e);if(!(In||rL)&&n.parent.inlineContent){let o=t.coordsAtPos(e);if(e>n.start()){let s=t.coordsAtPos(e-1),a=(s.top+s.bottom)/2;if(a>o.top&&a<o.bottom&&Math.abs(s.left-o.left)>1)return s.left<o.left?"ltr":"rtl"}if(e<n.end()){let s=t.coordsAtPos(e+1),a=(s.top+s.bottom)/2;if(a>o.top&&a<o.bottom&&Math.abs(s.left-o.left)>1)return s.left>o.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Mw(t,e,n){let r=t.state.selection;if(r instanceof Ie&&!r.empty||n.indexOf("s")>-1||Or&&n.indexOf("m")>-1)return!1;let{$from:o,$to:s}=r;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let a=A0(t.state,e);if(a&&a instanceof Pe)return Vi(t,a)}if(!o.parent.inlineContent){let a=e<0?o:s,l=r instanceof Rn?Ve.near(a,e):Ve.findFrom(a,e);return l?Vi(t,l):!1}return!1}function Bw(t,e){if(!(t.state.selection instanceof Ie))return!0;let{$head:n,$anchor:r,empty:o}=t.state.selection;if(!n.sameParent(r))return!0;if(!o)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 Rw(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function DL(t){if(!Un||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Rw(t,r,"true"),setTimeout(()=>Rw(t,r,"false"),20)}return!1}function FL(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function VL(t,e){let n=e.keyCode,r=FL(e);if(n==8||Or&&n==72&&r=="c")return Bw(t,-1)||Ka(t,-1);if(n==46&&!e.shiftKey||Or&&n==68&&r=="c")return Bw(t,1)||Ka(t,1);if(n==13||n==27)return!0;if(n==37||Or&&n==66&&r=="c"){let o=n==37?Ow(t,t.state.selection.from)=="ltr"?-1:1:-1;return Tw(t,o,r)||Ka(t,o)}else if(n==39||Or&&n==70&&r=="c"){let o=n==39?Ow(t,t.state.selection.from)=="ltr"?1:-1:1;return Tw(t,o,r)||Ka(t,o)}else{if(n==38||Or&&n==80&&r=="c")return Mw(t,-1,r)||Ka(t,-1);if(n==40||Or&&n==78&&r=="c")return DL(t)||Mw(t,1,r)||Ka(t,1);if(r==(Or?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function M0(t,e){t.someProp("transformCopied",g=>{e=g(e,t)});let n=[],{content:r,openStart:o,openEnd:s}=e;for(;o>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){o--,s--;let g=r.firstChild;n.push(g.type.name,g.attrs!=g.type.defaultAttrs?g.attrs:null),r=g.content}let a=t.someProp("clipboardSerializer")||Mi.fromSchema(t.state.schema),l=zw(),u=l.createElement("div");u.appendChild(a.serializeFragment(r,{document:l}));let c=u.firstChild,f,h=0;for(;c&&c.nodeType==1&&(f=Vw[c.nodeName.toLowerCase()]);){for(let g=f.length-1;g>=0;g--){let b=l.createElement(f[g]);for(;u.firstChild;)b.appendChild(u.firstChild);u.appendChild(b),h++}c=u.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${o} ${s}${h?` -${h}`:""} ${JSON.stringify(n)}`);let m=t.someProp("clipboardTextSerializer",g=>g(e,t))||e.content.textBetween(0,e.content.size,`
97
97
 
98
98
  `);return{dom:u,text:m,slice:e}}function Iw(t,e,n,r,o){let s=o.parent.type.spec.code,a,l;if(!n&&!e)return null;let u=e&&(r||s||!n);if(u){if(t.someProp("transformPastedText",m=>{e=m(e,s||r,t)}),s)return e?new xe(ue.from(t.state.schema.text(e.replace(/\r\n?/g,`
99
99
  `))),0,0):xe.empty;let h=t.someProp("clipboardTextParser",m=>m(e,o,r,t));if(h)l=h;else{let m=o.marks(),{schema:g}=t.state,b=Mi.fromSchema(g);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(y=>{let w=a.appendChild(document.createElement("p"));y&&w.appendChild(b.serializeNode(g.text(y,m)))})}}else t.someProp("transformPastedHTML",h=>{n=h(n,t)}),a=UL(n),hu&&WL(a);let c=a&&a.querySelector("[data-pm-slice]"),f=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(f&&f[3])for(let h=+f[3];h>0;h--){let m=a.firstChild;for(;m&&m.nodeType!=1;)m=m.nextSibling;if(!m)break;a=m}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||su.fromSchema(t.state.schema)).parseSlice(a,{preserveWhitespace:!!(u||f),context:o,ruleFromNode(m){return m.nodeName=="BR"&&!m.nextSibling&&m.parentNode&&!$L.test(m.parentNode.nodeName)?{ignore:!0}:null}})),f)l=jL(Fw(l,+f[1],+f[2]),f[4]);else if(l=xe.maxOpen(zL(l.content,o),!0),l.openStart||l.openEnd){let h=0,m=0;for(let g=l.content.firstChild;h<l.openStart&&!g.type.spec.isolating;h++,g=g.firstChild);for(let g=l.content.lastChild;m<l.openEnd&&!g.type.spec.isolating;m++,g=g.lastChild);l=Fw(l,h,m)}return t.someProp("transformPasted",h=>{l=h(l,t)}),l}const $L=/^(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 zL(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let o=e.node(n).contentMatchAt(e.index(n)),s,a=[];if(t.forEach(l=>{if(!a)return;let u=o.findWrapping(l.type),c;if(!u)return a=null;if(c=a.length&&s.length&&Pw(u,s,l,a[a.length-1],0))a[a.length-1]=c;else{a.length&&(a[a.length-1]=Dw(a[a.length-1],s.length));let f=Lw(l,u);a.push(f),o=o.matchType(f.type),s=u}}),a)return ue.from(a)}return t}function Lw(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,ue.from(t));return t}function Pw(t,e,n,r,o){if(o<t.length&&o<e.length&&t[o]==e[o]){let s=Pw(t,e,n,r.lastChild,o+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(o==t.length-1?n.type:t[o+1]))return r.copy(r.content.append(ue.from(Lw(n,t,o+1))))}}function Dw(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Dw(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(ue.empty,!0);return t.copy(n.append(r))}function B0(t,e,n,r,o,s){let a=e<0?t.firstChild:t.lastChild,l=a.content;return t.childCount>1&&(s=0),o<r-1&&(l=B0(l,e,n,r,o+1,s)),o>=n&&(l=e<0?a.contentMatchAt(0).fillBefore(l,s<=o).append(l):l.append(a.contentMatchAt(a.childCount).fillBefore(ue.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,a.copy(l))}function Fw(t,e,n){return e<t.openStart&&(t=new xe(B0(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new xe(B0(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Vw={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 $w=null;function zw(){return $w||($w=document.implementation.createHTMLDocument("title"))}let R0=null;function HL(t){let e=window.trustedTypes;return e?(R0||(R0=e.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),R0.createHTML(t)):t}function UL(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=zw().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),o;if((o=r&&Vw[r[1].toLowerCase()])&&(t=o.map(s=>"<"+s+">").join("")+t+o.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=HL(t),o)for(let s=0;s<o.length;s++)n=n.querySelector(o[s])||n;return n}function WL(t){let e=t.querySelectorAll(In?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function jL(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:o,openStart:s,openEnd:a}=t;for(let l=r.length-2;l>=0;l-=2){let u=n.nodes[r[l]];if(!u||u.hasRequiredAttrs())break;o=ue.from(u.create(r[l+1],o)),s++,a++}return new xe(o,s,a)}const Wn={},jn={},qL={touchstart:!0,touchmove:!0};class KL{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.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 GL(t){for(let e in Wn){let n=Wn[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{JL(t,r)&&!L0(t,r)&&(t.editable||!(r.type in jn))&&n(t,r)},qL[e]?{passive:!0}:void 0)}Un&&t.dom.addEventListener("input",()=>null),I0(t)}function $i(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function XL(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function I0(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>L0(t,r))})}function L0(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function JL(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 YL(t,e){!L0(t,e)&&Wn[e.type]&&(t.editable||!(e.type in jn))&&Wn[e.type](t,e)}jn.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!Uw(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(qo&&In&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),ja&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",o=>o(t,Os(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||VL(t,n)?n.preventDefault():$i(t,"key")},jn.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},jn.keypress=(t,e)=>{let n=e;if(Uw(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||Or&&n.metaKey)return;if(t.someProp("handleKeyPress",o=>o(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof Ie)||!r.$from.sameParent(r.$to)){let o=String.fromCharCode(n.charCode);!/[\r\n]/.test(o)&&!t.someProp("handleTextInput",s=>s(t,r.$from.pos,r.$to.pos,o))&&t.dispatch(t.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}};function Fd(t){return{left:t.clientX,top:t.clientY}}function ZL(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function P0(t,e,n,r,o){if(r==-1)return!1;let s=t.state.doc.resolve(r);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),o,!0):l(t,n,s.node(a),s.before(a),o,!1)))return!0;return!1}function Ga(t,e,n){if(t.focused||t.focus(),t.state.selection.eq(e))return;let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function QL(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&Pe.isSelectable(r)?(Ga(t,new Pe(n)),!0):!1}function NL(t,e){if(e==-1)return!1;let n=t.state.selection,r,o;n instanceof Pe&&(r=n.node);let s=t.state.doc.resolve(e);for(let a=s.depth+1;a>0;a--){let l=a>s.depth?s.nodeAfter:s.node(a);if(Pe.isSelectable(l)){r&&n.$from.depth>0&&a>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?o=s.before(n.$from.depth):o=s.before(a);break}}return o!=null?(Ga(t,Pe.create(t.state.doc,o)),!0):!1}function eP(t,e,n,r,o){return P0(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(o?NL(t,n):QL(t,n))}function tP(t,e,n,r){return P0(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",o=>o(t,e,r))}function nP(t,e,n,r){return P0(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",o=>o(t,e,r))||rP(t,n,r)}function rP(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Ga(t,Ie.create(r,0,r.content.size)),!0):!1;let o=r.resolve(e);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s),l=o.before(s);if(a.inlineContent)Ga(t,Ie.create(r,l+1,l+1+a.content.size));else if(Pe.isSelectable(a))Ga(t,Pe.create(r,l));else continue;return!0}}function D0(t){return Vd(t)}const Hw=Or?"metaKey":"ctrlKey";Wn.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=D0(t),o=Date.now(),s="singleClick";o-t.input.lastClick.time<500&&ZL(n,t.input.lastClick)&&!n[Hw]&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:s};let a=t.posAtCoords(Fd(n));a&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new oP(t,a,n,!!r)):(s=="doubleClick"?tP:nP)(t,a.pos,a.inside,n)?n.preventDefault():$i(t,"pointer"))};class oP{constructor(e,n,r,o){this.view=e,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Hw],this.allowDefault=r.shiftKey;let s,a;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),a=n.inside;else{let f=e.state.doc.resolve(n.pos);s=f.parent,a=f.depth?f.before():0}const l=o?null:r.target,u=l?e.docView.nearestDesc(l,!0):null;this.target=u&&u.dom.nodeType==1?u.dom:null;let{selection:c}=e.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||c instanceof Pe&&c.from<=a&&c.to>a)&&(this.mightDrag={node:s,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&eo&&!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)),$i(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(()=>Go(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(Fd(e))),this.updateAllowDefault(e),this.allowDefault||!n?$i(this.view,"pointer"):eP(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Un&&this.mightDrag&&!this.mightDrag.node.isAtom||In&&!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)?(Ga(this.view,Ve.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):$i(this.view,"pointer")}move(e){this.updateAllowDefault(e),$i(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)}}Wn.touchstart=t=>{t.input.lastTouch=Date.now(),D0(t),$i(t,"pointer")},Wn.touchmove=t=>{t.input.lastTouch=Date.now(),$i(t,"pointer")},Wn.contextmenu=t=>D0(t);function Uw(t,e){return t.composing?!0:Un&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const iP=qo?5e3:-1;jn.compositionstart=jn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$to;if(e.selection instanceof Ie&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Vd(t,!0),t.markCursor=null;else if(Vd(t,!e.selection.empty),eo&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let o=r.focusNode,s=r.focusOffset;o&&o.nodeType==1&&s!=0;){let a=s<0?o.lastChild:o.childNodes[s-1];if(!a)break;if(a.nodeType==3){let l=t.domSelection();l&&l.collapse(a,a.nodeValue.length);break}else o=a,s=-1}}t.input.composing=!0}Ww(t,iP)},jn.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++,Ww(t,20))};function Ww(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Vd(t),e))}function jw(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=aP());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function sP(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=QI(e.focusNode,e.focusOffset),r=NI(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let o=r.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!o||!o.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let a=n.pmViewDesc;if(!(!a||!a.isText(n.nodeValue)))return r}}return n||r}function aP(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Vd(t,e=!1){if(!(qo&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),jw(t),e||t.docView&&t.docView.dirty){let n=S0(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):(t.markCursor||e)&&!t.state.selection.empty?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function lP(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const yu=Zn&&Pi<15||ja&&oL<604;Wn.copy=jn.cut=(t,e)=>{let n=e,r=t.state.selection,o=n.type=="cut";if(r.empty)return;let s=yu?null:n.clipboardData,a=r.content(),{dom:l,text:u}=M0(t,a);s?(n.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",u)):lP(t,l),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function uP(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function cP(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let o=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?wu(t,r.value,null,o,e):wu(t,r.textContent,r.innerHTML,o,e)},50)}function wu(t,e,n,r,o){let s=Iw(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",u=>u(t,o,s||xe.empty)))return!0;if(!s)return!1;let a=uP(s),l=a?t.state.tr.replaceSelectionWith(a,r):t.state.tr.replaceSelection(s);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function qw(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," "):""}jn.paste=(t,e)=>{let n=e;if(t.composing&&!qo)return;let r=yu?null:n.clipboardData,o=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&wu(t,qw(r),r.getData("text/html"),o,n)?n.preventDefault():cP(t,n)};class Kw{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const Gw=Or?"altKey":"ctrlKey";Wn.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let o=t.state.selection,s=o.empty?null:t.posAtCoords(Fd(n)),a;if(!(s&&s.pos>=o.from&&s.pos<=(o instanceof Pe?o.to-1:o.to))){if(r&&r.mightDrag)a=Pe.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let h=t.docView.nearestDesc(n.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(a=Pe.create(t.state.doc,h.posBefore))}}let l=(a||t.state.selection).content(),{dom:u,text:c,slice:f}=M0(t,l);(!n.dataTransfer.files.length||!In||N4>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(yu?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",yu||n.dataTransfer.setData("text/plain",c),t.dragging=new Kw(f,!n[Gw],a)},Wn.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},jn.dragover=jn.dragenter=(t,e)=>e.preventDefault(),jn.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let o=t.posAtCoords(Fd(n));if(!o)return;let s=t.state.doc.resolve(o.pos),a=r&&r.slice;a?t.someProp("transformPasted",b=>{a=b(a,t)}):a=Iw(t,qw(n.dataTransfer),yu?null:n.dataTransfer.getData("text/html"),!1,s);let l=!!(r&&!n[Gw]);if(t.someProp("handleDrop",b=>b(t,n,a||xe.empty,l))){n.preventDefault();return}if(!a)return;n.preventDefault();let u=a?P4(t.state.doc,s.pos,a):s.pos;u==null&&(u=s.pos);let c=t.state.tr;if(l){let{node:b}=r;b?b.replace(c):c.deleteSelection()}let f=c.mapping.map(u),h=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,m=c.doc;if(h?c.replaceRangeWith(f,f,a.content.firstChild):c.replaceRange(f,f,a),c.doc.eq(m))return;let g=c.doc.resolve(f);if(h&&Pe.isSelectable(a.content.firstChild)&&g.nodeAfter&&g.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new Pe(g));else{let b=c.mapping.map(u);c.mapping.maps[c.mapping.maps.length-1].forEach((y,w,x,_)=>b=_),c.setSelection(T0(t,g,c.doc.resolve(b)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},Wn.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())&&Go(t)},20))},Wn.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)},Wn.beforeinput=(t,e)=>{if(In&&qo&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",s=>s(t,Os(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 jn)Wn[t]=jn[t];function xu(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 $d{constructor(e,n){this.toDOM=e,this.spec=n||Is,this.side=this.spec.side||0}map(e,n,r,o){let{pos:s,deleted:a}=e.mapResult(n.from+o,this.side<0?-1:1);return a?null:new Yt(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof $d&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&xu(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class zi{constructor(e,n){this.attrs=e,this.spec=n||Is}map(e,n,r,o){let s=e.map(n.from+o,this.spec.inclusiveStart?-1:1)-r,a=e.map(n.to+o,this.spec.inclusiveEnd?1:-1)-r;return s>=a?null:new Yt(s,a,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof zi&&xu(this.attrs,e.attrs)&&xu(this.spec,e.spec)}static is(e){return e.type instanceof zi}destroy(){}}class F0{constructor(e,n){this.attrs=e,this.spec=n||Is}map(e,n,r,o){let s=e.mapResult(n.from+o,1);if(s.deleted)return null;let a=e.mapResult(n.to+o,-1);return a.deleted||a.pos<=s.pos?null:new Yt(s.pos-r,a.pos-r,this)}valid(e,n){let{index:r,offset:o}=e.content.findIndex(n.from),s;return o==n.from&&!(s=e.child(r)).isText&&o+s.nodeSize==n.to}eq(e){return this==e||e instanceof F0&&xu(this.attrs,e.attrs)&&xu(this.spec,e.spec)}destroy(){}}class Yt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new Yt(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,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new Yt(e,e,new $d(n,r))}static inline(e,n,r,o){return new Yt(e,n,new zi(r,o))}static node(e,n,r,o){return new Yt(e,n,new F0(r,o))}get spec(){return this.type.spec}get inline(){return this.type instanceof zi}get widget(){return this.type instanceof $d}}const Xa=[],Is={};class ht{constructor(e,n){this.local=e.length?e:Xa,this.children=n.length?n:Xa}static create(e,n){return n.length?zd(n,e,0,Is):Ln}find(e,n,r){let o=[];return this.findInner(e??0,n??1e9,o,0,r),o}findInner(e,n,r,o,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))&&r.push(l.copy(l.from+o,l.to+o))}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,r,o+l,s)}}map(e,n,r){return this==Ln||e.maps.length==0?this:this.mapInner(e,n,0,0,r||Is)}mapInner(e,n,r,o,s){let a;for(let l=0;l<this.local.length;l++){let u=this.local[l].map(e,r,o);u&&u.type.valid(n,u)?(a||(a=[])).push(u):s.onRemove&&s.onRemove(this.local[l].spec)}return this.children.length?dP(this.children,a||[],e,n,r,o,s):a?new ht(a.sort(Ls),Xa):Ln}add(e,n){return n.length?this==Ln?ht.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let o,s=0;e.forEach((l,u)=>{let c=u+r,f;if(f=Jw(n,l,c)){for(o||(o=this.children.slice());s<o.length&&o[s]<u;)s+=3;o[s]==u?o[s+2]=o[s+2].addInner(l,f,c+1):o.splice(s,0,u,u+l.nodeSize,zd(f,l,c+1,Is)),s+=3}});let a=Xw(s?Yw(n):n,-r);for(let l=0;l<a.length;l++)a[l].type.valid(e,a[l])||a.splice(l--,1);return new ht(a.length?this.local.concat(a).sort(Ls):this.local,o||this.children)}remove(e){return e.length==0||this==Ln?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,o=this.local;for(let s=0;s<r.length;s+=3){let a,l=r[s]+n,u=r[s+1]+n;for(let f=0,h;f<e.length;f++)(h=e[f])&&h.from>l&&h.to<u&&(e[f]=null,(a||(a=[])).push(h));if(!a)continue;r==this.children&&(r=this.children.slice());let c=r[s+2].removeInner(a,l+1);c!=Ln?r[s+2]=c:(r.splice(s,3),s-=3)}if(o.length){for(let s=0,a;s<e.length;s++)if(a=e[s])for(let l=0;l<o.length;l++)o[l].eq(a,n)&&(o==this.local&&(o=this.local.slice()),o.splice(l--,1))}return r==this.children&&o==this.local?this:o.length||r.length?new ht(o,r):Ln}forChild(e,n){if(this==Ln)return this;if(n.isLeaf)return ht.empty;let r,o;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(r=this.children[l+2]);break}let s=e+1,a=s+n.content.size;for(let l=0;l<this.local.length;l++){let u=this.local[l];if(u.from<a&&u.to>s&&u.type instanceof zi){let c=Math.max(s,u.from)-s,f=Math.min(a,u.to)-s;c<f&&(o||(o=[])).push(u.copy(c,f))}}if(o){let l=new ht(o.sort(Ls),Xa);return r?new Hi([l,r]):l}return r||Ln}eq(e){if(this==e)return!0;if(!(e instanceof ht)||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 V0(this.localsInner(e))}localsInner(e){if(this==Ln)return Xa;if(e.inlineContent||!this.local.some(zi.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof zi||n.push(this.local[r]);return n}forEachSet(e){e(this)}}ht.empty=new ht([],[]),ht.removeOverlap=V0;const Ln=ht.empty;class Hi{constructor(e){this.members=e}map(e,n){const r=this.members.map(o=>o.map(e,n,Is));return Hi.from(r)}forChild(e,n){if(n.isLeaf)return ht.empty;let r=[];for(let o=0;o<this.members.length;o++){let s=this.members[o].forChild(e,n);s!=Ln&&(s instanceof Hi?r=r.concat(s.members):r.push(s))}return Hi.from(r)}eq(e){if(!(e instanceof Hi)||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,r=!0;for(let o=0;o<this.members.length;o++){let s=this.members[o].localsInner(e);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let a=0;a<s.length;a++)n.push(s[a])}}return n?V0(r?n:n.sort(Ls)):Xa}static from(e){switch(e.length){case 0:return Ln;case 1:return e[0];default:return new Hi(e.every(n=>n instanceof ht)?e:e.reduce((n,r)=>n.concat(r instanceof ht?r:r.members),[]))}}forEachSet(e){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(e)}}function dP(t,e,n,r,o,s,a){let l=t.slice();for(let c=0,f=s;c<n.maps.length;c++){let h=0;n.maps[c].forEach((m,g,b,y)=>{let w=y-b-(g-m);for(let x=0;x<l.length;x+=3){let _=l[x+1];if(_<0||m>_+f-h)continue;let S=l[x]+f-h;g>=S?l[x+1]=m<=S?-2:-1:m>=f&&w&&(l[x]+=w,l[x+1]+=w)}h+=w}),f=n.maps[c].map(f,-1)}let u=!1;for(let c=0;c<l.length;c+=3)if(l[c+1]<0){if(l[c+1]==-2){u=!0,l[c+1]=-1;continue}let f=n.map(t[c]+s),h=f-o;if(h<0||h>=r.content.size){u=!0;continue}let m=n.map(t[c+1]+s,-1),g=m-o,{index:b,offset:y}=r.content.findIndex(h),w=r.maybeChild(b);if(w&&y==h&&y+w.nodeSize==g){let x=l[c+2].mapInner(n,w,f+1,t[c]+s+1,a);x!=Ln?(l[c]=h,l[c+1]=g,l[c+2]=x):(l[c+1]=-2,u=!0)}else u=!0}if(u){let c=fP(l,t,e,n,o,s,a),f=zd(c,r,0,a);e=f.local;for(let h=0;h<l.length;h+=3)l[h+1]<0&&(l.splice(h,3),h-=3);for(let h=0,m=0;h<f.children.length;h+=3){let g=f.children[h];for(;m<l.length&&l[m]<g;)m+=3;l.splice(m,0,f.children[h],f.children[h+1],f.children[h+2])}}return new ht(e.sort(Ls),l)}function Xw(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let o=t[r];n.push(new Yt(o.from+e,o.to+e,o.type))}return n}function fP(t,e,n,r,o,s,a){function l(u,c){for(let f=0;f<u.local.length;f++){let h=u.local[f].map(r,o,c);h?n.push(h):a.onRemove&&a.onRemove(u.local[f].spec)}for(let f=0;f<u.children.length;f+=3)l(u.children[f+2],u.children[f]+c+1)}for(let u=0;u<t.length;u+=3)t[u+1]==-1&&l(t[u+2],e[u]+s+1);return n}function Jw(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,o=null;for(let s=0,a;s<t.length;s++)(a=t[s])&&a.from>n&&a.to<r&&((o||(o=[])).push(a),t[s]=null);return o}function Yw(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function zd(t,e,n,r){let o=[],s=!1;e.forEach((l,u)=>{let c=Jw(t,l,u+n);if(c){s=!0;let f=zd(c,l,n+u+1,r);f!=Ln&&o.push(u,u+l.nodeSize,f)}});let a=Xw(s?Yw(t):t,-n).sort(Ls);for(let l=0;l<a.length;l++)a[l].type.valid(e,a[l])||(r.onRemove&&r.onRemove(a[l].spec),a.splice(l--,1));return a.length||o.length?new ht(a,o):Ln}function Ls(t,e){return t.from-e.from||t.to-e.to}function V0(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let o=n+1;o<e.length;o++){let s=e[o];if(s.from==r.from){s.to!=r.to&&(e==t&&(e=t.slice()),e[o]=s.copy(s.from,r.to),Zw(e,o+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,s.from),Zw(e,o,r.copy(s.from,r.to)));break}}}return e}function Zw(t,e,n){for(;e<t.length&&Ls(n,t[e])>0;)e++;t.splice(e,0,n)}function $0(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Ln&&e.push(r)}),t.cursorWrapper&&e.push(ht.create(t.state.doc,[t.cursorWrapper.deco])),Hi.from(e)}const pP={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},hP=Zn&&Pi<=11;class mP{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 gP{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new mP,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let o=0;o<r.length;o++)this.queue.push(r[o]);Zn&&Pi<=11&&r.some(o=>o.type=="childList"&&o.removedNodes.length||o.type=="characterData"&&o.oldValue.length>o.target.nodeValue.length)?this.flushSoon():this.flush()}),hP&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.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,pP)),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(Sw(this.view)){if(this.suppressingSelectionUpdates)return Go(this.view);if(Zn&&Pi<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&As(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=new Set,r;for(let s=e.focusNode;s;s=Wa(s))n.add(s);for(let s=e.anchorNode;s;s=Wa(s))if(n.has(s)){r=s;break}let o=r&&this.view.docView.nearestDesc(r);if(o&&o.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!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 r=e.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Sw(e)&&!this.ignoreSelectionChange(r),s=-1,a=-1,l=!1,u=[];if(e.editable)for(let f=0;f<n.length;f++){let h=this.registerMutation(n[f],u);h&&(s=s<0?h.from:Math.min(h.from,s),a=a<0?h.to:Math.max(h.to,a),h.typeOver&&(l=!0))}if(eo&&u.length){let f=u.filter(h=>h.nodeName=="BR");if(f.length==2){let[h,m]=f;h.parentNode&&h.parentNode.parentNode==m.parentNode?m.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let m of f){let g=m.parentNode;g&&g.nodeName=="LI"&&(!h||yP(e,h)!=g)&&m.remove()}}}let c=null;s<0&&o&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Id(r)&&(c=S0(e))&&c.eq(Ve.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Go(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||o)&&(s>-1&&(e.docView.markDirty(s,a),bP(e)),this.handleDOMChange(s,a,l,u),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Go(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let f=0;f<e.addedNodes.length;f++){let h=e.addedNodes[f];n.push(h),h.nodeType==3&&(this.lastChangedTextNode=h)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let o=e.previousSibling,s=e.nextSibling;if(Zn&&Pi<=11&&e.addedNodes.length)for(let f=0;f<e.addedNodes.length;f++){let{previousSibling:h,nextSibling:m}=e.addedNodes[f];(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(o=h),(!m||Array.prototype.indexOf.call(e.addedNodes,m)<0)&&(s=m)}let a=o&&o.parentNode==e.target?En(o)+1:0,l=r.localPosFromDOM(e.target,a,-1),u=s&&s.parentNode==e.target?En(s):e.target.childNodes.length,c=r.localPosFromDOM(e.target,u,1);return{from:l,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Qw=new WeakMap,Nw=!1;function bP(t){if(!Qw.has(t)&&(Qw.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=eo,Nw)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."),Nw=!0}}function e6(t,e){let n=e.startContainer,r=e.startOffset,o=e.endContainer,s=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return As(a.node,a.offset,o,s)&&([n,r,o,s]=[o,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:s}}function vP(t,e){if(e.getComposedRanges){let o=e.getComposedRanges(t.root)[0];if(o)return e6(t,o)}let n;function r(o){o.preventDefault(),o.stopImmediatePropagation(),n=o.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?e6(t,n):null}function yP(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function wP(t,e,n){let{node:r,fromOffset:o,toOffset:s,from:a,to:l}=t.docView.parseRange(e,n),u=t.domSelectionRange(),c,f=u.anchorNode;if(f&&t.dom.contains(f.nodeType==1?f:f.parentNode)&&(c=[{node:f,offset:u.anchorOffset}],Id(u)||c.push({node:u.focusNode,offset:u.focusOffset})),In&&t.input.lastKeyCode===8)for(let w=s;w>o;w--){let x=r.childNodes[w-1],_=x.pmViewDesc;if(x.nodeName=="BR"&&!_){s=w;break}if(!_||_.size)break}let h=t.state.doc,m=t.someProp("domParser")||su.fromSchema(t.state.schema),g=h.resolve(a),b=null,y=m.parse(r,{topNode:g.parent,topMatch:g.parent.contentMatchAt(g.index()),topOpen:!0,from:o,to:s,preserveWhitespace:g.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:xP,context:g});if(c&&c[0].pos!=null){let w=c[0].pos,x=c[1]&&c[1].pos;x==null&&(x=w),b={anchor:w+a,head:x+a}}return{doc:y,sel:b,from:a,to:l}}function xP(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Un&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Un&&/^(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 CP=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function EP(t,e,n,r,o){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let L=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,I=S0(t,L);if(I&&!t.state.selection.eq(I)){if(In&&qo&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",q=>q(t,Os(13,"Enter"))))return;let V=t.state.tr.setSelection(I);L=="pointer"?V.setMeta("pointer",!0):L=="key"&&V.scrollIntoView(),s&&V.setMeta("composition",s),t.dispatch(V)}return}let a=t.state.doc.resolve(e),l=a.sharedDepth(n);e=a.before(l+1),n=t.state.doc.resolve(n).after(l+1);let u=t.state.selection,c=wP(t,e,n),f=t.state.doc,h=f.slice(c.from,c.to),m,g;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(m=t.state.selection.to,g="end"):(m=t.state.selection.from,g="start"),t.input.lastKeyCode=null;let b=kP(h.content,c.doc.content,c.from,m,g);if(b&&t.input.domChangeCount++,(ja&&t.input.lastIOSEnter>Date.now()-225||qo)&&o.some(L=>L.nodeType==1&&!CP.test(L.nodeName))&&(!b||b.endA>=b.endB)&&t.someProp("handleKeyDown",L=>L(t,Os(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!b)if(r&&u instanceof Ie&&!u.empty&&u.$head.sameParent(u.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))b={start:u.from,endA:u.to,endB:u.to};else{if(c.sel){let L=t6(t,t.state.doc,c.sel);if(L&&!L.eq(t.state.selection)){let I=t.state.tr.setSelection(L);s&&I.setMeta("composition",s),t.dispatch(I)}}return}t.state.selection.from<t.state.selection.to&&b.start==b.endB&&t.state.selection instanceof Ie&&(b.start>t.state.selection.from&&b.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?b.start=t.state.selection.from:b.endA<t.state.selection.to&&b.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(b.endB+=t.state.selection.to-b.endA,b.endA=t.state.selection.to)),Zn&&Pi<=11&&b.endB==b.start+1&&b.endA==b.start&&b.start>c.from&&c.doc.textBetween(b.start-c.from-1,b.start-c.from+1)=="  "&&(b.start--,b.endA--,b.endB--);let y=c.doc.resolveNoCache(b.start-c.from),w=c.doc.resolveNoCache(b.endB-c.from),x=f.resolve(b.start),_=y.sameParent(w)&&y.parent.inlineContent&&x.end()>=b.endA,S;if((ja&&t.input.lastIOSEnter>Date.now()-225&&(!_||o.some(L=>L.nodeName=="DIV"||L.nodeName=="P"))||!_&&y.pos<c.doc.content.size&&!y.sameParent(w)&&(S=Ve.findFrom(c.doc.resolve(y.pos+1),1,!0))&&S.head==w.pos)&&t.someProp("handleKeyDown",L=>L(t,Os(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>b.start&&SP(f,b.start,b.endA,y,w)&&t.someProp("handleKeyDown",L=>L(t,Os(8,"Backspace")))){qo&&In&&t.domObserver.suppressSelectionUpdates();return}In&&b.endB==b.start&&(t.input.lastChromeDelete=Date.now()),qo&&!_&&y.start()!=w.start()&&w.parentOffset==0&&y.depth==w.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==b.endA&&(b.endB-=2,w=c.doc.resolveNoCache(b.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(L){return L(t,Os(13,"Enter"))})},20));let C=b.start,k=b.endA,A,T,B;if(_){if(y.pos==w.pos)Zn&&Pi<=11&&y.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Go(t),20)),A=t.state.tr.delete(C,k),T=f.resolve(b.start).marksAcross(f.resolve(b.endA));else if(b.endA==b.endB&&(B=_P(y.parent.content.cut(y.parentOffset,w.parentOffset),x.parent.content.cut(x.parentOffset,b.endA-x.start()))))A=t.state.tr,B.type=="add"?A.addMark(C,k,B.mark):A.removeMark(C,k,B.mark);else if(y.parent.child(y.index()).isText&&y.index()==w.index()-(w.textOffset?0:1)){let L=y.parent.textBetween(y.parentOffset,w.parentOffset);if(t.someProp("handleTextInput",I=>I(t,C,k,L)))return;A=t.state.tr.insertText(L,C,k)}}if(A||(A=t.state.tr.replace(C,k,c.doc.slice(b.start-c.from,b.endB-c.from))),c.sel){let L=t6(t,A.doc,c.sel);L&&!(In&&t.composing&&L.empty&&(b.start!=b.endB||t.input.lastChromeDelete<Date.now()-100)&&(L.head==C||L.head==A.mapping.map(k)-1)||Zn&&L.empty&&L.head==C)&&A.setSelection(L)}T&&A.ensureMarks(T),s&&A.setMeta("composition",s),t.dispatch(A.scrollIntoView())}function t6(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:T0(t,e.resolve(n.anchor),e.resolve(n.head))}function _P(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,o=n,s=r,a,l,u;for(let f=0;f<r.length;f++)o=r[f].removeFromSet(o);for(let f=0;f<n.length;f++)s=n[f].removeFromSet(s);if(o.length==1&&s.length==0)l=o[0],a="add",u=f=>f.mark(l.addToSet(f.marks));else if(o.length==0&&s.length==1)l=s[0],a="remove",u=f=>f.mark(l.removeFromSet(f.marks));else return null;let c=[];for(let f=0;f<e.childCount;f++)c.push(u(e.child(f)));if(ue.from(c).eq(t))return{mark:l,type:a}}function SP(t,e,n,r,o){if(n-e<=o.pos-r.pos||z0(r,!0,!1)<o.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let l=s.nodeAfter;return l!=null&&n==e+l.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let a=t.resolve(z0(s,!0,!0));return!a.parent.isTextblock||a.pos>n||z0(a,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function z0(t,e,n){let r=t.depth,o=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,o++,e=!1;if(n){let s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,o++}return o}function kP(t,e,n,r,o){let s=t.findDiffStart(e,n);if(s==null)return null;let{a,b:l}=t.findDiffEnd(e,n+t.size,n+e.size);if(o=="end"){let u=Math.max(0,s-Math.min(a,l));r-=a+u-s}if(a<s&&t.size<e.size){let u=r<=s&&r>=a?s-r:0;s-=u,s&&s<e.size&&n6(e.textBetween(s-1,s+1))&&(s+=u?1:-1),l=s+(l-a),a=s}else if(l<s){let u=r<=s&&r>=l?s-r:0;s-=u,s&&s<t.size&&n6(t.textBetween(s-1,s+1))&&(s+=u?1:-1),a=s+(a-l),l=s}return{start:s,endA:a,endB:l}}function n6(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 TP{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 KL,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(a6),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=i6(this),o6(this),this.nodeViews=s6(this),this.docView=pw(this.state.doc,r6(this),$0(this),this.dom,this),this.domObserver=new gP(this,(r,o,s,a)=>EP(this,r,o,s,a)),this.domObserver.start(),GL(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&&I0(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(a6),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let o=this.state,s=!1,a=!1;e.storedMarks&&this.composing&&(jw(this),a=!0),this.state=e;let l=o.plugins!=e.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let g=s6(this);OP(g,this.nodeViews)&&(this.nodeViews=g,s=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&I0(this),this.editable=i6(this),o6(this);let u=$0(this),c=r6(this),f=o.plugins!=e.plugins&&!o.doc.eq(e.doc)?"reset":e.scrollToSelection>o.scrollToSelection?"to selection":"preserve",h=s||!this.docView.matchesNode(e.doc,c,u);(h||!e.selection.eq(o.selection))&&(a=!0);let m=f=="preserve"&&a&&this.dom.style.overflowAnchor==null&&aL(this);if(a){this.domObserver.stop();let g=h&&(Zn||In)&&!this.composing&&!o.selection.empty&&!e.selection.empty&&AP(o.selection,e.selection);if(h){let b=In?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=sP(this)),(s||!this.docView.update(e.doc,c,u,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=pw(e.doc,c,u,this.dom,this)),b&&!this.trackWrites&&(g=!0)}g||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&BL(this))?Go(this,g):(Ew(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(o),!((r=this.dragging)===null||r===void 0)&&r.node&&!o.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,o),f=="reset"?this.dom.scrollTop=0:f=="to selection"?this.scrollToSelection():m&&lL(m)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof Pe){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&ew(this,n.getBoundingClientRect(),e)}else ew(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){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,o=-1;if(this.state.doc.nodeAt(r.from)==r.node)o=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&this.state.doc.nodeAt(s))==r.node&&(o=s)}this.dragging=new Kw(e.slice,e.move,o<0?void 0:Pe.create(this.state.doc,o))}someProp(e,n){let r=this._props&&this._props[e],o;if(r!=null&&(o=n?n(r):r))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(Zn){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&&uL(this.dom),Go(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 hL(this,e)}coordsAtPos(e,n=1){return sw(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,r=-1){let o=this.docView.posFromDOM(e,n,r);if(o==null)throw new RangeError("DOM position not inside the editor");return o}endOfTextblock(e,n){return yL(this,n||this.state,e)}pasteHTML(e,n){return wu(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return wu(this,e,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(e){return M0(this,e)}destroy(){this.docView&&(XL(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],$0(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,YI())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return YL(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?Un&&this.root.nodeType===11&&tL(this.dom.ownerDocument)==this.dom&&vP(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function r6(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 r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[Yt.node(0,t.state.doc.content.size,e)]}function o6(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:Yt.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function i6(t){return!t.someProp("editable",e=>e(t.state)===!1)}function AP(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function s6(t){let e=Object.create(null);function n(r){for(let o in r)Object.prototype.hasOwnProperty.call(e,o)||(e[o]=r[o])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function OP(t,e){let n=0,r=0;for(let o in t){if(t[o]!=e[o])return!0;n++}for(let o in e)r++;return n!=r}function a6(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")}for(var Ui={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:"'"},Hd={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},MP=typeof navigator<"u"&&/Mac/.test(navigator.platform),BP=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),_n=0;_n<10;_n++)Ui[48+_n]=Ui[96+_n]=String(_n);for(var _n=1;_n<=24;_n++)Ui[_n+111]="F"+_n;for(var _n=65;_n<=90;_n++)Ui[_n]=String.fromCharCode(_n+32),Hd[_n]=String.fromCharCode(_n);for(var H0 in Ui)Hd.hasOwnProperty(H0)||(Hd[H0]=Ui[H0]);function RP(t){var e=MP&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||BP&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Hd:Ui)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const IP=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function LP(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,o,s,a;for(let l=0;l<e.length-1;l++){let u=e[l];if(/^(cmd|meta|m)$/i.test(u))a=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))o=!0;else if(/^s(hift)?$/i.test(u))s=!0;else if(/^mod$/i.test(u))IP?a=!0:o=!0;else throw new Error("Unrecognized modifier name: "+u)}return r&&(n="Alt-"+n),o&&(n="Ctrl-"+n),a&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function PP(t){let e=Object.create(null);for(let n in t)e[LP(n)]=t[n];return e}function U0(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 DP(t){return new dt({props:{handleKeyDown:W0(t)}})}function W0(t){let e=PP(t);return function(n,r){let o=RP(r),s,a=e[U0(o,r)];if(a&&a(n.state,n.dispatch,n))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let l=e[U0(o,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||o.charCodeAt(0)>127)&&(s=Ui[r.keyCode])&&s!=o){let l=e[U0(s,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}const Cu=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function l6(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const u6=(t,e,n)=>{let r=l6(t,n);if(!r)return!1;let o=j0(r);if(!o){let a=r.blockRange(),l=a&&Va(a);return l==null?!1:(e&&e(t.tr.lift(a,l).scrollIntoView()),!0)}let s=o.nodeBefore;if(v6(t,o,e,-1))return!0;if(r.parent.content.size==0&&(Ja(s,"end")||Pe.isSelectable(s)))for(let a=r.depth;;a--){let l=Bd(t.doc,r.before(a),r.after(a),xe.empty);if(l&&l.slice.size<l.to-l.from){if(e){let u=t.tr.step(l);u.setSelection(Ja(s,"end")?Ve.findFrom(u.doc.resolve(u.mapping.map(o.pos,-1)),-1):Pe.create(u.doc,o.pos-s.nodeSize)),e(u.scrollIntoView())}return!0}if(a==1||r.node(a-1).childCount>1)break}return s.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos-s.nodeSize,o.pos).scrollIntoView()),!0):!1},FP=(t,e,n)=>{let r=l6(t,n);if(!r)return!1;let o=j0(r);return o?c6(t,o,e):!1},VP=(t,e,n)=>{let r=f6(t,n);if(!r)return!1;let o=q0(r);return o?c6(t,o,e):!1};function c6(t,e,n){let r=e.nodeBefore,o=r,s=e.pos-1;for(;!o.isTextblock;s--){if(o.type.spec.isolating)return!1;let f=o.lastChild;if(!f)return!1;o=f}let a=e.nodeAfter,l=a,u=e.pos+1;for(;!l.isTextblock;u++){if(l.type.spec.isolating)return!1;let f=l.firstChild;if(!f)return!1;l=f}let c=Bd(t.doc,s,u,xe.empty);if(!c||c.from!=s||c instanceof dn&&c.slice.size>=u-s)return!1;if(n){let f=t.tr.step(c);f.setSelection(Ie.create(f.doc,s)),n(f.scrollIntoView())}return!0}function Ja(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const d6=(t,e,n)=>{let{$head:r,empty:o}=t.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=j0(r)}let a=s&&s.nodeBefore;return!a||!Pe.isSelectable(a)?!1:(e&&e(t.tr.setSelection(Pe.create(t.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)};function j0(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 f6(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const p6=(t,e,n)=>{let r=f6(t,n);if(!r)return!1;let o=q0(r);if(!o)return!1;let s=o.nodeAfter;if(v6(t,o,e,1))return!0;if(r.parent.content.size==0&&(Ja(s,"start")||Pe.isSelectable(s))){let a=Bd(t.doc,r.before(),r.after(),xe.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=t.tr.step(a);l.setSelection(Ja(s,"start")?Ve.findFrom(l.doc.resolve(l.mapping.map(o.pos)),1):Pe.create(l.doc,l.mapping.map(o.pos))),e(l.scrollIntoView())}return!0}}return s.isAtom&&o.depth==r.depth-1?(e&&e(t.tr.delete(o.pos,o.pos+s.nodeSize).scrollIntoView()),!0):!1},h6=(t,e,n)=>{let{$head:r,empty:o}=t.selection,s=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;s=q0(r)}let a=s&&s.nodeAfter;return!a||!Pe.isSelectable(a)?!1:(e&&e(t.tr.setSelection(Pe.create(t.doc,s.pos)).scrollIntoView()),!0)};function q0(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 $P=(t,e)=>{let n=t.selection,r=n instanceof Pe,o;if(r){if(n.node.isTextblock||!Ii(t.doc,n.from))return!1;o=n.from}else if(o=Md(t.doc,n.from,-1),o==null)return!1;if(e){let s=t.tr.join(o);r&&s.setSelection(Pe.create(s.doc,o-t.doc.resolve(o).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},zP=(t,e)=>{let n=t.selection,r;if(n instanceof Pe){if(n.node.isTextblock||!Ii(t.doc,n.to))return!1;r=n.to}else if(r=Md(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},HP=(t,e)=>{let{$from:n,$to:r}=t.selection,o=n.blockRange(r),s=o&&Va(o);return s==null?!1:(e&&e(t.tr.lift(o,s).scrollIntoView()),!0)},m6=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
100
- `).scrollIntoView()),!0)};function K0(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 UP=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),s=n.indexAfter(-1),a=K0(o.contentMatchAt(s));if(!a||!o.canReplaceWith(s,s,a))return!1;if(e){let l=n.after(),u=t.tr.replaceWith(l,l,a.createAndFill());u.setSelection(Ve.near(u.doc.resolve(l),1)),e(u.scrollIntoView())}return!0},g6=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof Rn||r.parent.inlineContent||o.parent.inlineContent)return!1;let s=K0(o.parent.contentMatchAt(o.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let a=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,l=t.tr.insert(a,s.createAndFill());l.setSelection(Ie.create(l.doc,a+1)),e(l.scrollIntoView())}return!0},b6=(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(pr(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Va(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function WP(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof Pe&&e.selection.node.isBlock)return!r.parentOffset||!pr(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],a,l,u=!1,c=!1;for(let g=r.depth;;g--)if(r.node(g).isBlock){u=r.end(g)==r.pos+(r.depth-g),c=r.start(g)==r.pos-(r.depth-g),l=K0(r.node(g-1).contentMatchAt(r.indexAfter(g-1))),s.unshift(u&&l?{type:l}:null),a=g;break}else{if(g==1)return!1;s.unshift(null)}let f=e.tr;(e.selection instanceof Ie||e.selection instanceof Rn)&&f.deleteSelection();let h=f.mapping.map(r.pos),m=pr(f.doc,h,s.length,s);if(m||(s[0]=l?{type:l}:null,m=pr(f.doc,h,s.length,s)),f.split(h,s.length,s),!u&&c&&r.node(a).type!=l){let g=f.mapping.map(r.before(a)),b=f.doc.resolve(g);l&&r.node(a-1).canReplaceWith(b.index(),b.index()+1,l)&&f.setNodeMarkup(f.mapping.map(r.before(a)),l)}return n&&n(f.scrollIntoView()),!0}}const jP=WP(),qP=(t,e)=>{let{$from:n,to:r}=t.selection,o,s=n.sharedDepth(r);return s==0?!1:(o=n.before(s),e&&e(t.tr.setSelection(Pe.create(t.doc,o))),!0)},KP=(t,e)=>(e&&e(t.tr.setSelection(new Rn(t.doc))),!0);function GP(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,s=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(o.isTextblock||Ii(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function v6(t,e,n,r){let o=e.nodeBefore,s=e.nodeAfter,a,l,u=o.type.spec.isolating||s.type.spec.isolating;if(!u&&GP(t,e,n))return!0;let c=!u&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(a=(l=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&l.matchType(a[0]||s.type).validEnd){if(n){let g=e.pos+s.nodeSize,b=ue.empty;for(let x=a.length-1;x>=0;x--)b=ue.from(a[x].create(null,b));b=ue.from(o.copy(b));let y=t.tr.step(new gn(e.pos-1,g,e.pos,g,new xe(b,1,0),a.length,!0)),w=y.doc.resolve(g+2*a.length);w.nodeAfter&&w.nodeAfter.type==o.type&&Ii(y.doc,w.pos)&&y.join(w.pos),n(y.scrollIntoView())}return!0}let f=s.type.spec.isolating||r>0&&u?null:Ve.findFrom(e,1),h=f&&f.$from.blockRange(f.$to),m=h&&Va(h);if(m!=null&&m>=e.depth)return n&&n(t.tr.lift(h,m).scrollIntoView()),!0;if(c&&Ja(s,"start",!0)&&Ja(o,"end")){let g=o,b=[];for(;b.push(g),!g.isTextblock;)g=g.lastChild;let y=s,w=1;for(;!y.isTextblock;y=y.firstChild)w++;if(g.canReplace(g.childCount,g.childCount,y.content)){if(n){let x=ue.empty;for(let S=b.length-1;S>=0;S--)x=ue.from(b[S].copy(x));let _=t.tr.step(new gn(e.pos-b.length,e.pos+s.nodeSize,e.pos+w,e.pos+s.nodeSize-w,new xe(x,b.length,0),0,!0));n(_.scrollIntoView())}return!0}}return!1}function y6(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,s=o.depth;for(;o.node(s).isInline;){if(!s)return!1;s--}return o.node(s).isTextblock?(n&&n(e.tr.setSelection(Ie.create(e.doc,t<0?o.start(s):o.end(s)))),!0):!1}}const XP=y6(-1),JP=y6(1);function YP(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,a=o.blockRange(s),l=a&&u0(a,t,e);return l?(r&&r(n.tr.wrap(a,l).scrollIntoView()),!0):!1}}function w6(t,e=null){return function(n,r){let o=!1;for(let s=0;s<n.selection.ranges.length&&!o;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];n.doc.nodesBetween(a,l,(u,c)=>{if(o)return!1;if(!(!u.isTextblock||u.hasMarkup(t,e)))if(u.type==t)o=!0;else{let f=n.doc.resolve(c),h=f.index();o=f.parent.canReplaceWith(h,h+1,t)}})}if(!o)return!1;if(r){let s=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:l},$to:{pos:u}}=n.selection.ranges[a];s.setBlockType(l,u,t,e)}r(s.scrollIntoView())}return!0}}function G0(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}G0(Cu,u6,d6),G0(Cu,p6,h6),G0(m6,g6,b6,jP),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function ZP(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,a=o.blockRange(s);if(!a)return!1;let l=r?n.tr:null;return QP(l,a,t,e)?(r&&r(l.scrollIntoView()),!0):!1}}function QP(t,e,n,r=null){let o=!1,s=e,a=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let u=a.resolve(e.start-2);s=new Ed(u,u,e.depth),e.endIndex<e.parent.childCount&&(e=new Ed(e.$from,a.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let l=u0(s,n,r,e);return l?(t&&NP(t,e,l,o,n),!0):!1}function NP(t,e,n,r,o){let s=ue.empty;for(let f=n.length-1;f>=0;f--)s=ue.from(n[f].type.create(n[f].attrs,s));t.step(new gn(e.start-(r?2:0),e.end,e.start,e.end,new xe(s,0,0),n.length,!0));let a=0;for(let f=0;f<n.length;f++)n[f].type==o&&(a=f+1);let l=n.length-a,u=e.start+n.length-(r?2:0),c=e.parent;for(let f=e.startIndex,h=e.endIndex,m=!0;f<h;f++,m=!1)!m&&pr(t.doc,u,l)&&(t.split(u,l),u+=2*l),u+=c.child(f).nodeSize;return t}function eD(t){return function(e,n){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,a=>a.childCount>0&&a.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?tD(e,n,t,s):nD(e,n,s):!0:!1}}function tD(t,e,n,r){let o=t.tr,s=r.end,a=r.$to.end(r.depth);s<a&&(o.step(new gn(s-1,a,s,a,new xe(ue.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ed(o.doc.resolve(r.$from.pos),o.doc.resolve(a),r.depth));const l=Va(r);if(l==null)return!1;o.lift(r,l);let u=o.doc.resolve(o.mapping.map(s,-1)-1);return Ii(o.doc,u.pos)&&u.nodeBefore.type==u.nodeAfter.type&&o.join(u.pos),e(o.scrollIntoView()),!0}function nD(t,e,n){let r=t.tr,o=n.parent;for(let g=n.end,b=n.endIndex-1,y=n.startIndex;b>y;b--)g-=o.child(b).nodeSize,r.delete(g-1,g+1);let s=r.doc.resolve(n.start),a=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,u=n.endIndex==o.childCount,c=s.node(-1),f=s.index(-1);if(!c.canReplace(f+(l?0:1),f+1,a.content.append(u?ue.empty:ue.from(o))))return!1;let h=s.pos,m=h+a.nodeSize;return r.step(new gn(h-(l?1:0),m+(u?1:0),h+1,m-1,new xe((l?ue.empty:ue.from(o.copy(ue.empty))).append(u?ue.empty:ue.from(o.copy(ue.empty))),l?0:1,u?0:1),l?0:1)),e(r.scrollIntoView()),!0}function rD(t){return function(e,n){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==t);if(!s)return!1;let a=s.startIndex;if(a==0)return!1;let l=s.parent,u=l.child(a-1);if(u.type!=t)return!1;if(n){let c=u.lastChild&&u.lastChild.type==l.type,f=ue.from(c?t.create():null),h=new xe(ue.from(t.create(null,ue.from(l.type.create(null,f)))),c?3:1,0),m=s.start,g=s.end;n(e.tr.step(new gn(m-(c?3:1),g,m,g,h,1,!0)).scrollIntoView())}return!0}}function Ud(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=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 r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,s=n.storedMarks,n}}}class Wd{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:o}=n,{tr:s}=r,a=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([l,u])=>[l,(...f)=>{const h=u(...f)(a);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(s),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:o,state:s}=this,{view:a}=o,l=[],u=!!e,c=e||s.tr,f=()=>(!u&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(c),l.every(m=>m===!0)),h={...Object.fromEntries(Object.entries(r).map(([m,g])=>[m,(...y)=>{const w=this.buildProps(c,n),x=g(...y)(w);return l.push(x),h}])),run:f};return h}createCan(e){const{rawCommands:n,state:r}=this,o=!1,s=e||r.tr,a=this.buildProps(s,o);return{...Object.fromEntries(Object.entries(n).map(([u,c])=>[u,(...f)=>c(...f)({...a,dispatch:void 0})])),chain:()=>this.createChain(s,o)}}buildProps(e,n=!0){const{rawCommands:r,editor:o,state:s}=this,{view:a}=o,l={tr:e,editor:o,view:a,state:Ud({state:s,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([u,c])=>[u,(...f)=>c(...f)(l)]))}};return l}}class oD{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(o=>o.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(o=>o!==n):delete this.callbacks[e]),this}once(e,n){const r=(...o)=>{this.off(e,r),n.apply(this,o)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}}function Be(t,e,n){return t.config[e]===void 0&&t.parent?Be(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?Be(t.parent,e,n):null}):t.config[e]}function jd(t){const e=t.filter(o=>o.type==="extension"),n=t.filter(o=>o.type==="node"),r=t.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function x6(t){const e=[],{nodeExtensions:n,markExtensions:r}=jd(t),o=[...n,...r],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(a=>{const l={name:a.name,options:a.options,storage:a.storage,extensions:o},u=Be(a,"addGlobalAttributes",l);if(!u)return;u().forEach(f=>{f.types.forEach(h=>{Object.entries(f.attributes).forEach(([m,g])=>{e.push({type:h,name:m,attribute:{...s,...g}})})})})}),o.forEach(a=>{const l={name:a.name,options:a.options,storage:a.storage},u=Be(a,"addAttributes",l);if(!u)return;const c=u();Object.entries(c).forEach(([f,h])=>{const m={...s,...h};typeof(m==null?void 0:m.default)=="function"&&(m.default=m.default()),m!=null&&m.isRequired&&(m==null?void 0:m.default)===void 0&&delete m.default,e.push({type:a.name,name:f,attribute:m})})}),e}function pn(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}function mt(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([o,s])=>{if(!r[o]){r[o]=s;return}if(o==="class"){const l=s?String(s).split(" "):[],u=r[o]?r[o].split(" "):[],c=l.filter(f=>!u.includes(f));r[o]=[...u,...c].join(" ")}else if(o==="style"){const l=s?s.split(";").map(f=>f.trim()).filter(Boolean):[],u=r[o]?r[o].split(";").map(f=>f.trim()).filter(Boolean):[],c=new Map;u.forEach(f=>{const[h,m]=f.split(":").map(g=>g.trim());c.set(h,m)}),l.forEach(f=>{const[h,m]=f.split(":").map(g=>g.trim());c.set(h,m)}),r[o]=Array.from(c.entries()).map(([f,h])=>`${f}: ${h}`).join("; ")}else r[o]=s}),r},{})}function X0(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,r)=>mt(n,r),{})}function C6(t){return typeof t=="function"}function st(t,e=void 0,...n){return C6(t)?e?t.bind(e)(...n):t(...n):t}function iD(t={}){return Object.keys(t).length===0&&t.constructor===Object}function sD(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function E6(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const o=e.reduce((s,a)=>{const l=a.attribute.parseHTML?a.attribute.parseHTML(n):sD(n.getAttribute(a.name));return l==null?s:{...s,[a.name]:l}},{});return{...r,...o}}}}function _6(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&iD(n)?!1:n!=null))}function aD(t,e){var n;const r=x6(t),{nodeExtensions:o,markExtensions:s}=jd(t),a=(n=o.find(c=>Be(c,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(o.map(c=>{const f=r.filter(x=>x.type===c.name),h={name:c.name,options:c.options,storage:c.storage,editor:e},m=t.reduce((x,_)=>{const S=Be(_,"extendNodeSchema",h);return{...x,...S?S(c):{}}},{}),g=_6({...m,content:st(Be(c,"content",h)),marks:st(Be(c,"marks",h)),group:st(Be(c,"group",h)),inline:st(Be(c,"inline",h)),atom:st(Be(c,"atom",h)),selectable:st(Be(c,"selectable",h)),draggable:st(Be(c,"draggable",h)),code:st(Be(c,"code",h)),whitespace:st(Be(c,"whitespace",h)),linebreakReplacement:st(Be(c,"linebreakReplacement",h)),defining:st(Be(c,"defining",h)),isolating:st(Be(c,"isolating",h)),attrs:Object.fromEntries(f.map(x=>{var _;return[x.name,{default:(_=x==null?void 0:x.attribute)===null||_===void 0?void 0:_.default}]}))}),b=st(Be(c,"parseHTML",h));b&&(g.parseDOM=b.map(x=>E6(x,f)));const y=Be(c,"renderHTML",h);y&&(g.toDOM=x=>y({node:x,HTMLAttributes:X0(x,f)}));const w=Be(c,"renderText",h);return w&&(g.toText=w),[c.name,g]})),u=Object.fromEntries(s.map(c=>{const f=r.filter(w=>w.type===c.name),h={name:c.name,options:c.options,storage:c.storage,editor:e},m=t.reduce((w,x)=>{const _=Be(x,"extendMarkSchema",h);return{...w,..._?_(c):{}}},{}),g=_6({...m,inclusive:st(Be(c,"inclusive",h)),excludes:st(Be(c,"excludes",h)),group:st(Be(c,"group",h)),spanning:st(Be(c,"spanning",h)),code:st(Be(c,"code",h)),attrs:Object.fromEntries(f.map(w=>{var x;return[w.name,{default:(x=w==null?void 0:w.attribute)===null||x===void 0?void 0:x.default}]}))}),b=st(Be(c,"parseHTML",h));b&&(g.parseDOM=b.map(w=>E6(w,f)));const y=Be(c,"renderHTML",h);return y&&(g.toDOM=w=>y({mark:w,HTMLAttributes:X0(w,f)})),[c.name,g]}));return new m4({topNode:a,nodes:l,marks:u})}function J0(t,e){return e.nodes[t]||e.marks[t]||null}function S6(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Y0(t,e){const n=Mi.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}const lD=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,s,a,l)=>{var u,c;const f=((c=(u=o.type.spec).toText)===null||c===void 0?void 0:c.call(u,{node:o,pos:s,parent:a,index:l}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?f:f.slice(0,Math.max(0,r-s))}),n};function Z0(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class qd{constructor(e){this.find=e.find,this.handler=e.handler}}const uD=(t,e)=>{if(Z0(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Kd(t){var e;const{editor:n,from:r,to:o,text:s,rules:a,plugin:l}=t,{view:u}=n;if(u.composing)return!1;const c=u.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(m=>m.type.spec.code))return!1;let f=!1;const h=lD(c)+s;return a.forEach(m=>{if(f)return;const g=uD(h,m.find);if(!g)return;const b=u.state.tr,y=Ud({state:u.state,transaction:b}),w={from:r-(g[0].length-s.length),to:o},{commands:x,chain:_,can:S}=new Wd({editor:n,state:y});m.handler({state:y,range:w,match:g,commands:x,chain:_,can:S})===null||!b.steps.length||(b.setMeta(l,{transform:b,from:r,to:o,text:s}),u.dispatch(b),f=!0)}),f}function cD(t){const{editor:e,rules:n}=t,r=new dt({state:{init(){return null},apply(o,s,a){const l=o.getMeta(r);if(l)return l;const u=o.getMeta("applyInputRules");return!!u&&setTimeout(()=>{let{text:f}=u;typeof f=="string"?f=f:f=Y0(ue.from(f),a.schema);const{from:h}=u,m=h+f.length;Kd({editor:e,from:h,to:m,text:f,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:s}},props:{handleTextInput(o,s,a,l){return Kd({editor:e,from:s,to:a,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:s}=o.state.selection;s&&Kd({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,s){if(s.key!=="Enter")return!1;const{$cursor:a}=o.state.selection;return a?Kd({editor:e,from:a.pos,to:a.pos,text:`
100
+ `).scrollIntoView()),!0)};function K0(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 UP=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),s=n.indexAfter(-1),a=K0(o.contentMatchAt(s));if(!a||!o.canReplaceWith(s,s,a))return!1;if(e){let l=n.after(),u=t.tr.replaceWith(l,l,a.createAndFill());u.setSelection(Ve.near(u.doc.resolve(l),1)),e(u.scrollIntoView())}return!0},g6=(t,e)=>{let n=t.selection,{$from:r,$to:o}=n;if(n instanceof Rn||r.parent.inlineContent||o.parent.inlineContent)return!1;let s=K0(o.parent.contentMatchAt(o.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let a=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,l=t.tr.insert(a,s.createAndFill());l.setSelection(Ie.create(l.doc,a+1)),e(l.scrollIntoView())}return!0},b6=(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(pr(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Va(r);return o==null?!1:(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)};function WP(t){return(e,n)=>{let{$from:r,$to:o}=e.selection;if(e.selection instanceof Pe&&e.selection.node.isBlock)return!r.parentOffset||!pr(e.doc,r.pos)?!1:(n&&n(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],a,l,u=!1,c=!1;for(let g=r.depth;;g--)if(r.node(g).isBlock){u=r.end(g)==r.pos+(r.depth-g),c=r.start(g)==r.pos-(r.depth-g),l=K0(r.node(g-1).contentMatchAt(r.indexAfter(g-1))),s.unshift(u&&l?{type:l}:null),a=g;break}else{if(g==1)return!1;s.unshift(null)}let f=e.tr;(e.selection instanceof Ie||e.selection instanceof Rn)&&f.deleteSelection();let h=f.mapping.map(r.pos),m=pr(f.doc,h,s.length,s);if(m||(s[0]=l?{type:l}:null,m=pr(f.doc,h,s.length,s)),f.split(h,s.length,s),!u&&c&&r.node(a).type!=l){let g=f.mapping.map(r.before(a)),b=f.doc.resolve(g);l&&r.node(a-1).canReplaceWith(b.index(),b.index()+1,l)&&f.setNodeMarkup(f.mapping.map(r.before(a)),l)}return n&&n(f.scrollIntoView()),!0}}const jP=WP(),qP=(t,e)=>{let{$from:n,to:r}=t.selection,o,s=n.sharedDepth(r);return s==0?!1:(o=n.before(s),e&&e(t.tr.setSelection(Pe.create(t.doc,o))),!0)},KP=(t,e)=>(e&&e(t.tr.setSelection(new Rn(t.doc))),!0);function GP(t,e,n){let r=e.nodeBefore,o=e.nodeAfter,s=e.index();return!r||!o||!r.type.compatibleContent(o.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(o.isTextblock||Ii(t.doc,e.pos))?!1:(n&&n(t.tr.join(e.pos).scrollIntoView()),!0)}function v6(t,e,n,r){let o=e.nodeBefore,s=e.nodeAfter,a,l,u=o.type.spec.isolating||s.type.spec.isolating;if(!u&&GP(t,e,n))return!0;let c=!u&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(a=(l=o.contentMatchAt(o.childCount)).findWrapping(s.type))&&l.matchType(a[0]||s.type).validEnd){if(n){let g=e.pos+s.nodeSize,b=ue.empty;for(let x=a.length-1;x>=0;x--)b=ue.from(a[x].create(null,b));b=ue.from(o.copy(b));let y=t.tr.step(new bn(e.pos-1,g,e.pos,g,new xe(b,1,0),a.length,!0)),w=y.doc.resolve(g+2*a.length);w.nodeAfter&&w.nodeAfter.type==o.type&&Ii(y.doc,w.pos)&&y.join(w.pos),n(y.scrollIntoView())}return!0}let f=s.type.spec.isolating||r>0&&u?null:Ve.findFrom(e,1),h=f&&f.$from.blockRange(f.$to),m=h&&Va(h);if(m!=null&&m>=e.depth)return n&&n(t.tr.lift(h,m).scrollIntoView()),!0;if(c&&Ja(s,"start",!0)&&Ja(o,"end")){let g=o,b=[];for(;b.push(g),!g.isTextblock;)g=g.lastChild;let y=s,w=1;for(;!y.isTextblock;y=y.firstChild)w++;if(g.canReplace(g.childCount,g.childCount,y.content)){if(n){let x=ue.empty;for(let S=b.length-1;S>=0;S--)x=ue.from(b[S].copy(x));let _=t.tr.step(new bn(e.pos-b.length,e.pos+s.nodeSize,e.pos+w,e.pos+s.nodeSize-w,new xe(x,b.length,0),0,!0));n(_.scrollIntoView())}return!0}}return!1}function y6(t){return function(e,n){let r=e.selection,o=t<0?r.$from:r.$to,s=o.depth;for(;o.node(s).isInline;){if(!s)return!1;s--}return o.node(s).isTextblock?(n&&n(e.tr.setSelection(Ie.create(e.doc,t<0?o.start(s):o.end(s)))),!0):!1}}const XP=y6(-1),JP=y6(1);function YP(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,a=o.blockRange(s),l=a&&u0(a,t,e);return l?(r&&r(n.tr.wrap(a,l).scrollIntoView()),!0):!1}}function w6(t,e=null){return function(n,r){let o=!1;for(let s=0;s<n.selection.ranges.length&&!o;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];n.doc.nodesBetween(a,l,(u,c)=>{if(o)return!1;if(!(!u.isTextblock||u.hasMarkup(t,e)))if(u.type==t)o=!0;else{let f=n.doc.resolve(c),h=f.index();o=f.parent.canReplaceWith(h,h+1,t)}})}if(!o)return!1;if(r){let s=n.tr;for(let a=0;a<n.selection.ranges.length;a++){let{$from:{pos:l},$to:{pos:u}}=n.selection.ranges[a];s.setBlockType(l,u,t,e)}r(s.scrollIntoView())}return!0}}function G0(...t){return function(e,n,r){for(let o=0;o<t.length;o++)if(t[o](e,n,r))return!0;return!1}}G0(Cu,u6,d6),G0(Cu,p6,h6),G0(m6,g6,b6,jP),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function ZP(t,e=null){return function(n,r){let{$from:o,$to:s}=n.selection,a=o.blockRange(s);if(!a)return!1;let l=r?n.tr:null;return QP(l,a,t,e)?(r&&r(l.scrollIntoView()),!0):!1}}function QP(t,e,n,r=null){let o=!1,s=e,a=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(n)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let u=a.resolve(e.start-2);s=new Ed(u,u,e.depth),e.endIndex<e.parent.childCount&&(e=new Ed(e.$from,a.resolve(e.$to.end(e.depth)),e.depth)),o=!0}let l=u0(s,n,r,e);return l?(t&&NP(t,e,l,o,n),!0):!1}function NP(t,e,n,r,o){let s=ue.empty;for(let f=n.length-1;f>=0;f--)s=ue.from(n[f].type.create(n[f].attrs,s));t.step(new bn(e.start-(r?2:0),e.end,e.start,e.end,new xe(s,0,0),n.length,!0));let a=0;for(let f=0;f<n.length;f++)n[f].type==o&&(a=f+1);let l=n.length-a,u=e.start+n.length-(r?2:0),c=e.parent;for(let f=e.startIndex,h=e.endIndex,m=!0;f<h;f++,m=!1)!m&&pr(t.doc,u,l)&&(t.split(u,l),u+=2*l),u+=c.child(f).nodeSize;return t}function eD(t){return function(e,n){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,a=>a.childCount>0&&a.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?tD(e,n,t,s):nD(e,n,s):!0:!1}}function tD(t,e,n,r){let o=t.tr,s=r.end,a=r.$to.end(r.depth);s<a&&(o.step(new bn(s-1,a,s,a,new xe(ue.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ed(o.doc.resolve(r.$from.pos),o.doc.resolve(a),r.depth));const l=Va(r);if(l==null)return!1;o.lift(r,l);let u=o.doc.resolve(o.mapping.map(s,-1)-1);return Ii(o.doc,u.pos)&&u.nodeBefore.type==u.nodeAfter.type&&o.join(u.pos),e(o.scrollIntoView()),!0}function nD(t,e,n){let r=t.tr,o=n.parent;for(let g=n.end,b=n.endIndex-1,y=n.startIndex;b>y;b--)g-=o.child(b).nodeSize,r.delete(g-1,g+1);let s=r.doc.resolve(n.start),a=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,u=n.endIndex==o.childCount,c=s.node(-1),f=s.index(-1);if(!c.canReplace(f+(l?0:1),f+1,a.content.append(u?ue.empty:ue.from(o))))return!1;let h=s.pos,m=h+a.nodeSize;return r.step(new bn(h-(l?1:0),m+(u?1:0),h+1,m-1,new xe((l?ue.empty:ue.from(o.copy(ue.empty))).append(u?ue.empty:ue.from(o.copy(ue.empty))),l?0:1,u?0:1),l?0:1)),e(r.scrollIntoView()),!0}function rD(t){return function(e,n){let{$from:r,$to:o}=e.selection,s=r.blockRange(o,c=>c.childCount>0&&c.firstChild.type==t);if(!s)return!1;let a=s.startIndex;if(a==0)return!1;let l=s.parent,u=l.child(a-1);if(u.type!=t)return!1;if(n){let c=u.lastChild&&u.lastChild.type==l.type,f=ue.from(c?t.create():null),h=new xe(ue.from(t.create(null,ue.from(l.type.create(null,f)))),c?3:1,0),m=s.start,g=s.end;n(e.tr.step(new bn(m-(c?3:1),g,m,g,h,1,!0)).scrollIntoView())}return!0}}function Ud(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:o}=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 r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,s=n.storedMarks,n}}}class Wd{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:o}=n,{tr:s}=r,a=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([l,u])=>[l,(...f)=>{const h=u(...f)(a);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(s),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:o,state:s}=this,{view:a}=o,l=[],u=!!e,c=e||s.tr,f=()=>(!u&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(c),l.every(m=>m===!0)),h={...Object.fromEntries(Object.entries(r).map(([m,g])=>[m,(...y)=>{const w=this.buildProps(c,n),x=g(...y)(w);return l.push(x),h}])),run:f};return h}createCan(e){const{rawCommands:n,state:r}=this,o=!1,s=e||r.tr,a=this.buildProps(s,o);return{...Object.fromEntries(Object.entries(n).map(([u,c])=>[u,(...f)=>c(...f)({...a,dispatch:void 0})])),chain:()=>this.createChain(s,o)}}buildProps(e,n=!0){const{rawCommands:r,editor:o,state:s}=this,{view:a}=o,l={tr:e,editor:o,view:a,state:Ud({state:s,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([u,c])=>[u,(...f)=>c(...f)(l)]))}};return l}}class oD{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(o=>o.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(o=>o!==n):delete this.callbacks[e]),this}once(e,n){const r=(...o)=>{this.off(e,r),n.apply(this,o)};return this.on(e,r)}removeAllListeners(){this.callbacks={}}}function Be(t,e,n){return t.config[e]===void 0&&t.parent?Be(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?Be(t.parent,e,n):null}):t.config[e]}function jd(t){const e=t.filter(o=>o.type==="extension"),n=t.filter(o=>o.type==="node"),r=t.filter(o=>o.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function x6(t){const e=[],{nodeExtensions:n,markExtensions:r}=jd(t),o=[...n,...r],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(a=>{const l={name:a.name,options:a.options,storage:a.storage,extensions:o},u=Be(a,"addGlobalAttributes",l);if(!u)return;u().forEach(f=>{f.types.forEach(h=>{Object.entries(f.attributes).forEach(([m,g])=>{e.push({type:h,name:m,attribute:{...s,...g}})})})})}),o.forEach(a=>{const l={name:a.name,options:a.options,storage:a.storage},u=Be(a,"addAttributes",l);if(!u)return;const c=u();Object.entries(c).forEach(([f,h])=>{const m={...s,...h};typeof(m==null?void 0:m.default)=="function"&&(m.default=m.default()),m!=null&&m.isRequired&&(m==null?void 0:m.default)===void 0&&delete m.default,e.push({type:a.name,name:f,attribute:m})})}),e}function pn(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}function mt(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([o,s])=>{if(!r[o]){r[o]=s;return}if(o==="class"){const l=s?String(s).split(" "):[],u=r[o]?r[o].split(" "):[],c=l.filter(f=>!u.includes(f));r[o]=[...u,...c].join(" ")}else if(o==="style"){const l=s?s.split(";").map(f=>f.trim()).filter(Boolean):[],u=r[o]?r[o].split(";").map(f=>f.trim()).filter(Boolean):[],c=new Map;u.forEach(f=>{const[h,m]=f.split(":").map(g=>g.trim());c.set(h,m)}),l.forEach(f=>{const[h,m]=f.split(":").map(g=>g.trim());c.set(h,m)}),r[o]=Array.from(c.entries()).map(([f,h])=>`${f}: ${h}`).join("; ")}else r[o]=s}),r},{})}function X0(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,r)=>mt(n,r),{})}function C6(t){return typeof t=="function"}function st(t,e=void 0,...n){return C6(t)?e?t.bind(e)(...n):t(...n):t}function iD(t={}){return Object.keys(t).length===0&&t.constructor===Object}function sD(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function E6(t,e){return"style"in t?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const o=e.reduce((s,a)=>{const l=a.attribute.parseHTML?a.attribute.parseHTML(n):sD(n.getAttribute(a.name));return l==null?s:{...s,[a.name]:l}},{});return{...r,...o}}}}function _6(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&iD(n)?!1:n!=null))}function aD(t,e){var n;const r=x6(t),{nodeExtensions:o,markExtensions:s}=jd(t),a=(n=o.find(c=>Be(c,"topNode")))===null||n===void 0?void 0:n.name,l=Object.fromEntries(o.map(c=>{const f=r.filter(x=>x.type===c.name),h={name:c.name,options:c.options,storage:c.storage,editor:e},m=t.reduce((x,_)=>{const S=Be(_,"extendNodeSchema",h);return{...x,...S?S(c):{}}},{}),g=_6({...m,content:st(Be(c,"content",h)),marks:st(Be(c,"marks",h)),group:st(Be(c,"group",h)),inline:st(Be(c,"inline",h)),atom:st(Be(c,"atom",h)),selectable:st(Be(c,"selectable",h)),draggable:st(Be(c,"draggable",h)),code:st(Be(c,"code",h)),whitespace:st(Be(c,"whitespace",h)),linebreakReplacement:st(Be(c,"linebreakReplacement",h)),defining:st(Be(c,"defining",h)),isolating:st(Be(c,"isolating",h)),attrs:Object.fromEntries(f.map(x=>{var _;return[x.name,{default:(_=x==null?void 0:x.attribute)===null||_===void 0?void 0:_.default}]}))}),b=st(Be(c,"parseHTML",h));b&&(g.parseDOM=b.map(x=>E6(x,f)));const y=Be(c,"renderHTML",h);y&&(g.toDOM=x=>y({node:x,HTMLAttributes:X0(x,f)}));const w=Be(c,"renderText",h);return w&&(g.toText=w),[c.name,g]})),u=Object.fromEntries(s.map(c=>{const f=r.filter(w=>w.type===c.name),h={name:c.name,options:c.options,storage:c.storage,editor:e},m=t.reduce((w,x)=>{const _=Be(x,"extendMarkSchema",h);return{...w,..._?_(c):{}}},{}),g=_6({...m,inclusive:st(Be(c,"inclusive",h)),excludes:st(Be(c,"excludes",h)),group:st(Be(c,"group",h)),spanning:st(Be(c,"spanning",h)),code:st(Be(c,"code",h)),attrs:Object.fromEntries(f.map(w=>{var x;return[w.name,{default:(x=w==null?void 0:w.attribute)===null||x===void 0?void 0:x.default}]}))}),b=st(Be(c,"parseHTML",h));b&&(g.parseDOM=b.map(w=>E6(w,f)));const y=Be(c,"renderHTML",h);return y&&(g.toDOM=w=>y({mark:w,HTMLAttributes:X0(w,f)})),[c.name,g]}));return new m4({topNode:a,nodes:l,marks:u})}function J0(t,e){return e.nodes[t]||e.marks[t]||null}function S6(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}function Y0(t,e){const n=Mi.fromSchema(e).serializeFragment(t),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}const lD=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(o,s,a,l)=>{var u,c;const f=((c=(u=o.type.spec).toText)===null||c===void 0?void 0:c.call(u,{node:o,pos:s,parent:a,index:l}))||o.textContent||"%leaf%";n+=o.isAtom&&!o.isText?f:f.slice(0,Math.max(0,r-s))}),n};function Z0(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class qd{constructor(e){this.find=e.find,this.handler=e.handler}}const uD=(t,e)=>{if(Z0(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Kd(t){var e;const{editor:n,from:r,to:o,text:s,rules:a,plugin:l}=t,{view:u}=n;if(u.composing)return!1;const c=u.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(m=>m.type.spec.code))return!1;let f=!1;const h=lD(c)+s;return a.forEach(m=>{if(f)return;const g=uD(h,m.find);if(!g)return;const b=u.state.tr,y=Ud({state:u.state,transaction:b}),w={from:r-(g[0].length-s.length),to:o},{commands:x,chain:_,can:S}=new Wd({editor:n,state:y});m.handler({state:y,range:w,match:g,commands:x,chain:_,can:S})===null||!b.steps.length||(b.setMeta(l,{transform:b,from:r,to:o,text:s}),u.dispatch(b),f=!0)}),f}function cD(t){const{editor:e,rules:n}=t,r=new dt({state:{init(){return null},apply(o,s,a){const l=o.getMeta(r);if(l)return l;const u=o.getMeta("applyInputRules");return!!u&&setTimeout(()=>{let{text:f}=u;typeof f=="string"?f=f:f=Y0(ue.from(f),a.schema);const{from:h}=u,m=h+f.length;Kd({editor:e,from:h,to:m,text:f,rules:n,plugin:r})}),o.selectionSet||o.docChanged?null:s}},props:{handleTextInput(o,s,a,l){return Kd({editor:e,from:s,to:a,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:o=>(setTimeout(()=>{const{$cursor:s}=o.state.selection;s&&Kd({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(o,s){if(s.key!=="Enter")return!1;const{$cursor:a}=o.state.selection;return a?Kd({editor:e,from:a.pos,to:a.pos,text:`
101
101
  `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function dD(t){return Object.prototype.toString.call(t).slice(8,-1)}function Gd(t){return dD(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function Xd(t,e){const n={...t};return Gd(t)&&Gd(e)&&Object.keys(e).forEach(r=>{Gd(e[r])&&Gd(t[r])?n[r]=Xd(t[r],e[r]):n[r]=e[r]}),n}class qn{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=st(Be(this,"addOptions",{name:this.name}))),this.storage=st(Be(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new qn(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Xd(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new qn(e);return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=st(Be(n,"addOptions",{name:n.name})),n.storage=st(Be(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,o=e.state.selection.$from;if(o.pos===o.end()){const a=o.marks();if(!!!a.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const u=a.find(c=>(c==null?void 0:c.type.name)===n.name);return u&&r.removeStoredMark(u),r.insertText(" ",o.pos),e.view.dispatch(r),!0}return!1}}function fD(t){return typeof t=="number"}class pD{constructor(e){this.find=e.find,this.handler=e.handler}}const hD=(t,e,n)=>{if(Z0(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(o=>{const s=[o.text];return s.index=o.index,s.input=t,s.data=o.data,o.replaceWith&&(o.text.includes(o.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(o.replaceWith)),s}):[]};function mD(t){const{editor:e,state:n,from:r,to:o,rule:s,pasteEvent:a,dropEvent:l}=t,{commands:u,chain:c,can:f}=new Wd({editor:e,state:n}),h=[];return n.doc.nodesBetween(r,o,(g,b)=>{if(!g.isTextblock||g.type.spec.code)return;const y=Math.max(r,b),w=Math.min(o,b+g.content.size),x=g.textBetween(y-b,w-b,void 0,"");hD(x,s.find,a).forEach(S=>{if(S.index===void 0)return;const C=y+S.index+1,k=C+S[0].length,A={from:n.tr.mapping.map(C),to:n.tr.mapping.map(k)},T=s.handler({state:n,range:A,match:S,commands:u,chain:c,can:f,pasteEvent:a,dropEvent:l});h.push(T)})}),h.every(g=>g!==null)}let Jd=null;const gD=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function bD(t){const{editor:e,rules:n}=t;let r=null,o=!1,s=!1,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const u=({state:f,from:h,to:m,rule:g,pasteEvt:b})=>{const y=f.tr,w=Ud({state:f,transaction:y});if(!(!mD({editor:e,state:w,from:Math.max(h-1,0),to:m.b-1,rule:g,pasteEvent:b,dropEvent:l})||!y.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,y}};return n.map(f=>new dt({view(h){const m=b=>{var y;r=!((y=h.dom.parentElement)===null||y===void 0)&&y.contains(b.target)?h.dom.parentElement:null,r&&(Jd=e)},g=()=>{Jd&&(Jd=null)};return window.addEventListener("dragstart",m),window.addEventListener("dragend",g),{destroy(){window.removeEventListener("dragstart",m),window.removeEventListener("dragend",g)}}},props:{handleDOMEvents:{drop:(h,m)=>{if(s=r===h.dom.parentElement,l=m,!s){const g=Jd;g&&setTimeout(()=>{const b=g.state.selection;b&&g.commands.deleteRange({from:b.from,to:b.to})},10)}return!1},paste:(h,m)=>{var g;const b=(g=m.clipboardData)===null||g===void 0?void 0:g.getData("text/html");return a=m,o=!!(b!=null&&b.includes("data-pm-slice")),!1}}},appendTransaction:(h,m,g)=>{const b=h[0],y=b.getMeta("uiEvent")==="paste"&&!o,w=b.getMeta("uiEvent")==="drop"&&!s,x=b.getMeta("applyPasteRules"),_=!!x;if(!y&&!w&&!_)return;if(_){let{text:k}=x;typeof k=="string"?k=k:k=Y0(ue.from(k),g.schema);const{from:A}=x,T=A+k.length,B=gD(k);return u({rule:f,state:g,from:A,to:{b:T},pasteEvt:B})}const S=m.doc.content.findDiffStart(g.doc.content),C=m.doc.content.findDiffEnd(g.doc.content);if(!(!fD(S)||!C||S===C.b))return u({rule:f,state:g,from:S,to:C,pasteEvt:a})}}))}function vD(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return Array.from(new Set(e))}class Ya{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=Ya.resolve(e),this.schema=aD(this.extensions,n),this.setupExtensions()}static resolve(e){const n=Ya.sort(Ya.flatten(e)),r=vD(n.map(o=>o.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},o=Be(n,"addExtensions",r);return o?[n,...this.flatten(o())]:n}).flat(10)}static sort(e){return e.sort((r,o)=>{const s=Be(r,"priority")||100,a=Be(o,"priority")||100;return s>a?-1:s<a?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:J0(n.name,this.schema)},o=Be(n,"addCommands",r);return o?{...e,...o()}:e},{})}get plugins(){const{editor:e}=this,n=Ya.sort([...this.extensions].reverse()),r=[],o=[],s=n.map(a=>{const l={name:a.name,options:a.options,storage:a.storage,editor:e,type:J0(a.name,this.schema)},u=[],c=Be(a,"addKeyboardShortcuts",l);let f={};if(a.type==="mark"&&Be(a,"exitable",l)&&(f.ArrowRight=()=>qn.handleExit({editor:e,mark:a})),c){const y=Object.fromEntries(Object.entries(c()).map(([w,x])=>[w,()=>x({editor:e})]));f={...f,...y}}const h=DP(f);u.push(h);const m=Be(a,"addInputRules",l);S6(a,e.options.enableInputRules)&&m&&r.push(...m());const g=Be(a,"addPasteRules",l);S6(a,e.options.enablePasteRules)&&g&&o.push(...g());const b=Be(a,"addProseMirrorPlugins",l);if(b){const y=b();u.push(...y)}return u}).flat();return[cD({editor:e,rules:r}),...bD({editor:e,rules:o}),...s]}get attributes(){return x6(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=jd(this.extensions);return Object.fromEntries(n.filter(r=>!!Be(r,"addNodeView")).map(r=>{const o=this.attributes.filter(u=>u.type===r.name),s={name:r.name,options:r.options,storage:r.storage,editor:e,type:pn(r.name,this.schema)},a=Be(r,"addNodeView",s);if(!a)return[];const l=(u,c,f,h,m)=>{const g=X0(u,o);return a()({node:u,view:c,getPos:f,decorations:h,innerDecorations:m,editor:e,extension:r,HTMLAttributes:g})};return[r.name,l]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:J0(e.name,this.schema)};e.type==="mark"&&(!((n=st(Be(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const o=Be(e,"onBeforeCreate",r),s=Be(e,"onCreate",r),a=Be(e,"onUpdate",r),l=Be(e,"onSelectionUpdate",r),u=Be(e,"onTransaction",r),c=Be(e,"onFocus",r),f=Be(e,"onBlur",r),h=Be(e,"onDestroy",r);o&&this.editor.on("beforeCreate",o),s&&this.editor.on("create",s),a&&this.editor.on("update",a),l&&this.editor.on("selectionUpdate",l),u&&this.editor.on("transaction",u),c&&this.editor.on("focus",c),f&&this.editor.on("blur",f),h&&this.editor.on("destroy",h)})}}class at{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=st(Be(this,"addOptions",{name:this.name}))),this.storage=st(Be(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new at(e)}configure(e={}){const n=this.extend({...this.config,addOptions:()=>Xd(this.options,e)});return n.name=this.name,n.parent=this.parent,n}extend(e={}){const n=new at({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=st(Be(n,"addOptions",{name:n.name})),n.storage=st(Be(n,"addStorage",{name:n.name,options:n.options})),n}}function k6(t,e,n){const{from:r,to:o}=e,{blockSeparator:s=`
102
102
 
103
- `,textSerializers:a={}}=n||{};let l="";return t.nodesBetween(r,o,(u,c,f,h)=>{var m;u.isBlock&&c>r&&(l+=s);const g=a==null?void 0:a[u.type.name];if(g)return f&&(l+=g({node:u,pos:c,parent:f,index:h,range:e})),!1;u.isText&&(l+=(m=u==null?void 0:u.text)===null||m===void 0?void 0:m.slice(Math.max(r,c)-c,o-c))}),l}function Q0(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const yD=at.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new dt({key:new kt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:s}=o,a=Math.min(...s.map(f=>f.$from.pos)),l=Math.max(...s.map(f=>f.$to.pos)),u=Q0(n);return k6(r,{from:a,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:u})}}})]}}),wD=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),xD=(t=!1)=>({commands:e})=>e.setContent("",t),CD=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:s,$to:a})=>{t.doc.nodesBetween(s.pos,a.pos,(l,u)=>{if(l.type.isText)return;const{doc:c,mapping:f}=e,h=c.resolve(f.map(u)),m=c.resolve(f.map(u+l.nodeSize)),g=h.blockRange(m);if(!g)return;const b=Va(g);if(l.type.isTextblock){const{defaultType:y}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(g.start,y)}(b||b===0)&&e.lift(g,b)})}),!0},ED=t=>e=>t(e),_D=()=>({state:t,dispatch:e})=>g6(t,e),SD=(t,e)=>({editor:n,tr:r})=>{const{state:o}=n,s=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const a=r.mapping.map(e);return r.insert(a,s.content),r.setSelection(new Ie(r.doc.resolve(a-1))),!0},kD=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===r.type){if(e){const l=o.before(s),u=o.after(s);t.delete(l,u).scrollIntoView()}return!0}return!1},TD=t=>({tr:e,state:n,dispatch:r})=>{const o=pn(t,n.schema),s=e.selection.$anchor;for(let a=s.depth;a>0;a-=1)if(s.node(a).type===o){if(r){const u=s.before(a),c=s.after(a);e.delete(u,c).scrollIntoView()}return!0}return!1},AD=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},OD=()=>({state:t,dispatch:e})=>Cu(t,e),MD=()=>({commands:t})=>t.keyboardShortcut("Enter"),BD=()=>({state:t,dispatch:e})=>UP(t,e);function Yd(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:Z0(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function T6(t,e,n={}){return t.find(r=>r.type===e&&Yd(Object.fromEntries(Object.keys(n).map(o=>[o,r.attrs[o]])),n))}function A6(t,e,n={}){return!!T6(t,e,n)}function Zd(t,e,n){var r;if(!t||!e)return;let o=t.parent.childAfter(t.parentOffset);if((!o.node||!o.node.marks.some(f=>f.type===e))&&(o=t.parent.childBefore(t.parentOffset)),!o.node||!o.node.marks.some(f=>f.type===e)||(n=n||((r=o.node.marks[0])===null||r===void 0?void 0:r.attrs),!T6([...o.node.marks],e,n)))return;let a=o.index,l=t.start()+o.offset,u=a+1,c=l+o.node.nodeSize;for(;a>0&&A6([...t.parent.child(a-1).marks],e,n);)a-=1,l-=t.parent.child(a).nodeSize;for(;u<t.parent.childCount&&A6([...t.parent.child(u).marks],e,n);)c+=t.parent.child(u).nodeSize,u+=1;return{from:l,to:c}}function Wi(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}const RD=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const s=Wi(t,r.schema),{doc:a,selection:l}=n,{$from:u,from:c,to:f}=l;if(o){const h=Zd(u,s,e);if(h&&h.from<=c&&h.to>=f){const m=Ie.create(a,h.from,h.to);n.setSelection(m)}}return!0},ID=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function N0(t){return t instanceof Ie}function Xo(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function O6(t,e=null){if(!e)return null;const n=Ve.atStart(t),r=Ve.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const o=n.from,s=r.to;return e==="all"?Ie.create(t,Xo(0,o,s),Xo(t.content.size,o,s)):Ie.create(t,Xo(e,o,s),Xo(e,o,s))}function M6(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Qd(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const LD=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:s})=>{e={scrollIntoView:!0,...e};const a=()=>{(Qd()||M6())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(s&&t===null&&!N0(n.state.selection))return a(),!0;const l=O6(o.doc,t)||n.state.selection,u=n.state.selection.eq(l);return s&&(u||o.setSelection(l),u&&o.storedMarks&&o.setStoredMarks(o.storedMarks),a()),!0},PD=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),DD=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),B6=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&B6(r)}return t};function Nd(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return B6(n)}function ef(t,e,n){if(t instanceof Nr||t instanceof ue)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,o=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return ue.fromArray(t.map(l=>e.nodeFromJSON(l)));const a=e.nodeFromJSON(t);return n.errorOnInvalidContent&&a.check(),a}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),ef("",e,n)}if(o){if(n.errorOnInvalidContent){let a=!1,l="";const u=new m4({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=>(a=!0,l=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?su.fromSchema(u).parseSlice(Nd(t),n.parseOptions):su.fromSchema(u).parse(Nd(t),n.parseOptions),n.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const s=su.fromSchema(e);return n.slice?s.parseSlice(Nd(t),n.parseOptions).content:s.parse(Nd(t),n.parseOptions)}return ef("",e,n)}function FD(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof dn||o instanceof gn))return;const s=t.mapping.maps[r];let a=0;s.forEach((l,u,c,f)=>{a===0&&(a=f)}),t.setSelection(Ve.near(t.doc.resolve(a),n))}const VD=t=>!("type"in t),$D=(t,e,n)=>({tr:r,dispatch:o,editor:s})=>{var a;if(o){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;try{l=ef(e,s.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(a=n.errorOnInvalidContent)!==null&&a!==void 0?a:s.options.enableContentCheck})}catch(b){return s.emit("contentError",{editor:s,error:b,disableCollaboration:()=>{s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}}),!1}let{from:u,to:c}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,h=!0;if((VD(l)?l:[l]).forEach(b=>{b.check(),f=f?b.isText&&b.marks.length===0:!1,h=h?b.isBlock:!1}),u===c&&h){const{parent:b}=r.doc.resolve(u);b.isTextblock&&!b.type.spec.code&&!b.childCount&&(u-=1,c+=1)}let g;if(f){if(Array.isArray(e))g=e.map(b=>b.text||"").join("");else if(e instanceof ue){let b="";e.forEach(y=>{y.text&&(b+=y.text)}),g=b}else typeof e=="object"&&e&&e.text?g=e.text:g=e;r.insertText(g,u,c)}else g=l,r.replaceWith(u,c,g);n.updateSelection&&FD(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:g})}return!0},zD=()=>({state:t,dispatch:e})=>$P(t,e),HD=()=>({state:t,dispatch:e})=>zP(t,e),UD=()=>({state:t,dispatch:e})=>u6(t,e),WD=()=>({state:t,dispatch:e})=>p6(t,e),jD=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Md(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},qD=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Md(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},KD=()=>({state:t,dispatch:e})=>FP(t,e),GD=()=>({state:t,dispatch:e})=>VP(t,e);function R6(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function XD(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,s,a;for(let l=0;l<e.length-1;l+=1){const u=e[l];if(/^(cmd|meta|m)$/i.test(u))a=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))o=!0;else if(/^s(hift)?$/i.test(u))s=!0;else if(/^mod$/i.test(u))Qd()||R6()?a=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${u}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}const JD=t=>({editor:e,view:n,tr:r,dispatch:o})=>{const s=XD(t).split(/-(?!$)/),a=s.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),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}),u=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,l))});return u==null||u.steps.forEach(c=>{const f=c.map(r.mapping);f&&o&&r.maybeStep(f)}),!0};function Eu(t,e,n={}){const{from:r,to:o,empty:s}=t.selection,a=e?pn(e,t.schema):null,l=[];t.doc.nodesBetween(r,o,(h,m)=>{if(h.isText)return;const g=Math.max(r,m),b=Math.min(o,m+h.nodeSize);l.push({node:h,from:g,to:b})});const u=o-r,c=l.filter(h=>a?a.name===h.node.type.name:!0).filter(h=>Yd(h.node.attrs,n,{strict:!1}));return s?!!c.length:c.reduce((h,m)=>h+m.to-m.from,0)>=u}const YD=(t,e={})=>({state:n,dispatch:r})=>{const o=pn(t,n.schema);return Eu(n,o,e)?HP(n,r):!1},ZD=()=>({state:t,dispatch:e})=>b6(t,e),QD=t=>({state:e,dispatch:n})=>{const r=pn(t,e.schema);return eD(r)(e,n)},ND=()=>({state:t,dispatch:e})=>m6(t,e);function tf(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function I6(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}const eF=(t,e)=>({tr:n,state:r,dispatch:o})=>{let s=null,a=null;const l=tf(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(s=pn(t,r.schema)),l==="mark"&&(a=Wi(t,r.schema)),o&&n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(c,f)=>{s&&s===c.type&&n.setNodeMarkup(f,void 0,I6(c.attrs,e)),a&&c.marks.length&&c.marks.forEach(h=>{a===h.type&&n.addMark(f,f+c.nodeSize,a.create(I6(h.attrs,e)))})})}),!0):!1},tF=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),nF=()=>({tr:t,dispatch:e})=>{if(e){const n=new Rn(t.doc);t.setSelection(n)}return!0},rF=()=>({state:t,dispatch:e})=>d6(t,e),oF=()=>({state:t,dispatch:e})=>h6(t,e),iF=()=>({state:t,dispatch:e})=>qP(t,e),sF=()=>({state:t,dispatch:e})=>JP(t,e),aF=()=>({state:t,dispatch:e})=>XP(t,e);function e1(t,e,n={},r={}){return ef(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const lF=(t,e=!1,n={},r={})=>({editor:o,tr:s,dispatch:a,commands:l})=>{var u,c;const{doc:f}=s;if(n.preserveWhitespace!=="full"){const h=e1(t,o.schema,n,{errorOnInvalidContent:(u=r.errorOnInvalidContent)!==null&&u!==void 0?u:o.options.enableContentCheck});return a&&s.replaceWith(0,f.content.size,h).setMeta("preventUpdate",!e),!0}return a&&s.setMeta("preventUpdate",!e),l.insertContentAt({from:0,to:f.content.size},t,{parseOptions:n,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:o.options.enableContentCheck})};function t1(t,e){const n=Wi(e,t.schema),{from:r,to:o,empty:s}=t.selection,a=[];s?(t.storedMarks&&a.push(...t.storedMarks),a.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,u=>{a.push(...u.marks)});const l=a.find(u=>u.type.name===n.name);return l?{...l.attrs}:{}}function uF(t,e){const n=new f0(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function L6(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function n1(t,e){const n=[];return t.descendants((r,o)=>{e(r)&&n.push({node:r,pos:o})}),n}function P6(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(o,s)=>{n(o)&&r.push({node:o,pos:s})}),r}function D6(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Jo(t){return e=>D6(e.$from,t)}function F6(t,e){const n={from:0,to:t.content.size};return k6(t,n,e)}function cF(t,e){const n=pn(e,t.schema),{from:r,to:o}=t.selection,s=[];t.doc.nodesBetween(r,o,l=>{s.push(l)});const a=s.reverse().find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function V6(t,e){const n=tf(typeof e=="string"?e:e.name,t.schema);return n==="node"?cF(t,e):n==="mark"?t1(t,e):{}}function dF(t,e=JSON.stringify){const n={};return t.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function fF(t){const e=dF(t);return e.length===1?e:e.filter((n,r)=>!e.filter((s,a)=>a!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function pF(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,s)=>{const a=[];if(o.ranges.length)o.forEach((l,u)=>{a.push({from:l,to:u})});else{const{from:l,to:u}=n[s];if(l===void 0||u===void 0)return;a.push({from:l,to:u})}a.forEach(({from:l,to:u})=>{const c=e.slice(s).map(l,-1),f=e.slice(s).map(u),h=e.invert().map(c,-1),m=e.invert().map(f);r.push({oldRange:{from:h,to:m},newRange:{from:c,to:f}})})}),fF(r)}function r1(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(o=>{const s=n.resolve(t),a=Zd(s,o.type);a&&r.push({mark:o,...a})}):n.nodesBetween(t,e,(o,s)=>{!o||(o==null?void 0:o.nodeSize)===void 0||r.push(...o.marks.map(a=>({from:s,to:s+o.nodeSize,mark:a})))}),r}function nf(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(s=>s.type===e&&s.name===r);return o?o.attribute.keepOnSplit:!1}))}function o1(t,e,n={}){const{empty:r,ranges:o}=t.selection,s=e?Wi(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>s?s.name===h.type.name:!0).find(h=>Yd(h.attrs,n,{strict:!1}));let a=0;const l=[];if(o.forEach(({$from:h,$to:m})=>{const g=h.pos,b=m.pos;t.doc.nodesBetween(g,b,(y,w)=>{if(!y.isText&&!y.marks.length)return;const x=Math.max(g,w),_=Math.min(b,w+y.nodeSize),S=_-x;a+=S,l.push(...y.marks.map(C=>({mark:C,from:x,to:_})))})}),a===0)return!1;const u=l.filter(h=>s?s.name===h.mark.type.name:!0).filter(h=>Yd(h.mark.attrs,n,{strict:!1})).reduce((h,m)=>h+m.to-m.from,0),c=l.filter(h=>s?h.mark.type!==s&&h.mark.type.excludes(s):!0).reduce((h,m)=>h+m.to-m.from,0);return(u>0?u+c:u)>=a}function rf(t,e,n={}){if(!e)return Eu(t,null,n)||o1(t,null,n);const r=tf(e,t.schema);return r==="node"?Eu(t,e,n):r==="mark"?o1(t,e,n):!1}function i1(t,e){const{nodeExtensions:n}=jd(e),r=n.find(a=>a.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},s=st(Be(r,"group",o));return typeof s!="string"?!1:s.split(" ").includes("list")}function of(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(s=>{o!==!1&&(of(s,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function $6(t){return t instanceof Pe}function z6(t,e,n){const o=t.state.doc.content.size,s=Xo(e,0,o),a=Xo(n,0,o),l=t.coordsAtPos(s),u=t.coordsAtPos(a,-1),c=Math.min(l.top,u.top),f=Math.max(l.bottom,u.bottom),h=Math.min(l.left,u.left),m=Math.max(l.right,u.right),g=m-h,b=f-c,x={top:c,bottom:f,left:h,right:m,width:g,height:b,x:h,y:c};return{...x,toJSON:()=>x}}function hF(t,e,n){var r;const{selection:o}=e;let s=null;if(N0(o)&&(s=o.$cursor),s){const l=(r=t.storedMarks)!==null&&r!==void 0?r:s.marks();return!!n.isInSet(l)||!l.some(u=>u.type.excludes(n))}const{ranges:a}=o;return a.some(({$from:l,$to:u})=>{let c=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,u.pos,(f,h,m)=>{if(c)return!1;if(f.isInline){const g=!m||m.type.allowsMarkType(n),b=!!n.isInSet(f.marks)||!f.marks.some(y=>y.type.excludes(n));c=g&&b}return!c}),c})}const mF=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=n,{empty:a,ranges:l}=s,u=Wi(t,r.schema);if(o)if(a){const c=t1(r,u);n.addStoredMark(u.create({...c,...e}))}else l.forEach(c=>{const f=c.$from.pos,h=c.$to.pos;r.doc.nodesBetween(f,h,(m,g)=>{const b=Math.max(g,f),y=Math.min(g+m.nodeSize,h);m.marks.find(x=>x.type===u)?m.marks.forEach(x=>{u===x.type&&n.addMark(b,y,u.create({...x.attrs,...e}))}):n.addMark(b,y,u.create(e))})});return hF(r,n,u)},gF=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),bF=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const s=pn(t,n.schema);let a;return n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),s.isTextblock?o().command(({commands:l})=>w6(s,{...a,...e})(n)?!0:l.clearNodes()).command(({state:l})=>w6(s,{...a,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},vF=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=Xo(t,0,r.content.size),s=Pe.create(r,o);e.setSelection(s)}return!0},yF=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:o,to:s}=typeof t=="number"?{from:t,to:t}:t,a=Ie.atStart(r).from,l=Ie.atEnd(r).to,u=Xo(o,a,l),c=Xo(s,a,l),f=Ie.create(r,u,c);e.setSelection(f)}return!0},wF=t=>({state:e,dispatch:n})=>{const r=pn(t,e.schema);return rD(r)(e,n)};function H6(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(o=>e==null?void 0:e.includes(o.type.name));t.tr.ensureMarks(r)}}const xF=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:s,doc:a}=e,{$from:l,$to:u}=s,c=o.extensionManager.attributes,f=nf(c,l.node().type.name,l.node().attrs);if(s instanceof Pe&&s.node.isBlock)return!l.parentOffset||!pr(a,l.pos)?!1:(r&&(t&&H6(n,o.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const h=u.parentOffset===u.parent.content.size,m=l.depth===0?void 0:L6(l.node(-1).contentMatchAt(l.indexAfter(-1)));let g=h&&m?[{type:m,attrs:f}]:void 0,b=pr(e.doc,e.mapping.map(l.pos),1,g);if(!g&&!b&&pr(e.doc,e.mapping.map(l.pos),1,m?[{type:m}]:void 0)&&(b=!0,g=m?[{type:m,attrs:f}]:void 0),r){if(b&&(s instanceof Ie&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,g),m&&!h&&!l.parentOffset&&l.parent.type!==m)){const y=e.mapping.map(l.before()),w=e.doc.resolve(y);l.node(-1).canReplaceWith(w.index(),w.index()+1,m)&&e.setNodeMarkup(e.mapping.map(l.before()),m)}t&&H6(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return b},CF=(t,e={})=>({tr:n,state:r,dispatch:o,editor:s})=>{var a;const l=pn(t,r.schema),{$from:u,$to:c}=r.selection,f=r.selection.node;if(f&&f.isBlock||u.depth<2||!u.sameParent(c))return!1;const h=u.node(-1);if(h.type!==l)return!1;const m=s.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==l||u.index(-2)!==u.node(-2).childCount-1)return!1;if(o){let x=ue.empty;const _=u.index(-1)?1:u.index(-2)?2:3;for(let B=u.depth-_;B>=u.depth-3;B-=1)x=ue.from(u.node(B).copy(x));const S=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,C={...nf(m,u.node().type.name,u.node().attrs),...e},k=((a=l.contentMatch.defaultType)===null||a===void 0?void 0:a.createAndFill(C))||void 0;x=x.append(ue.from(l.createAndFill(null,k)||void 0));const A=u.before(u.depth-(_-1));n.replace(A,u.after(-S),new xe(x,4-_,0));let T=-1;n.doc.nodesBetween(A,n.doc.content.size,(B,L)=>{if(T>-1)return!1;B.isTextblock&&B.content.size===0&&(T=L+1)}),T>-1&&n.setSelection(Ie.near(n.doc.resolve(T))),n.scrollIntoView()}return!0}const g=c.pos===u.end()?h.contentMatchAt(0).defaultType:null,b={...nf(m,h.type.name,h.attrs),...e},y={...nf(m,u.node().type.name,u.node().attrs),...e};n.delete(u.pos,c.pos);const w=g?[{type:l,attrs:b},{type:g,attrs:y}]:[{type:l,attrs:b}];if(!pr(n.doc,u.pos,2))return!1;if(o){const{selection:x,storedMarks:_}=r,{splittableMarks:S}=s.extensionManager,C=_||x.$to.parentOffset&&x.$from.marks();if(n.split(u.pos,2,w).scrollIntoView(),!C||!o)return!0;const k=C.filter(A=>S.includes(A.type.name));n.ensureMarks(k)}return!0},s1=(t,e)=>{const n=Jo(a=>a.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===(o==null?void 0:o.type)&&Ii(t.doc,n.pos)&&t.join(n.pos),!0},a1=(t,e)=>{const n=Jo(a=>a.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===(o==null?void 0:o.type)&&Ii(t.doc,r)&&t.join(r),!0};var EF=Object.freeze({__proto__:null,blur:wD,clearContent:xD,clearNodes:CD,command:ED,createParagraphNear:_D,cut:SD,deleteCurrentNode:kD,deleteNode:TD,deleteRange:AD,deleteSelection:OD,enter:MD,exitCode:BD,extendMarkRange:RD,first:ID,focus:LD,forEach:PD,insertContent:DD,insertContentAt:$D,joinBackward:UD,joinDown:HD,joinForward:WD,joinItemBackward:jD,joinItemForward:qD,joinTextblockBackward:KD,joinTextblockForward:GD,joinUp:zD,keyboardShortcut:JD,lift:YD,liftEmptyBlock:ZD,liftListItem:QD,newlineInCode:ND,resetAttributes:eF,scrollIntoView:tF,selectAll:nF,selectNodeBackward:rF,selectNodeForward:oF,selectParentNode:iF,selectTextblockEnd:sF,selectTextblockStart:aF,setContent:lF,setMark:mF,setMeta:gF,setNode:bF,setNodeSelection:vF,setTextSelection:yF,sinkListItem:wF,splitBlock:xF,splitListItem:CF,toggleList:(t,e,n,r={})=>({editor:o,tr:s,state:a,dispatch:l,chain:u,commands:c,can:f})=>{const{extensions:h,splittableMarks:m}=o.extensionManager,g=pn(t,a.schema),b=pn(e,a.schema),{selection:y,storedMarks:w}=a,{$from:x,$to:_}=y,S=x.blockRange(_),C=w||y.$to.parentOffset&&y.$from.marks();if(!S)return!1;const k=Jo(A=>i1(A.type.name,h))(y);if(S.depth>=1&&k&&S.depth-k.depth<=1){if(k.node.type===g)return c.liftListItem(b);if(i1(k.node.type.name,h)&&g.validContent(k.node.content)&&l)return u().command(()=>(s.setNodeMarkup(k.pos,g),!0)).command(()=>s1(s,g)).command(()=>a1(s,g)).run()}return!n||!C||!l?u().command(()=>f().wrapInList(g,r)?!0:c.clearNodes()).wrapInList(g,r).command(()=>s1(s,g)).command(()=>a1(s,g)).run():u().command(()=>{const A=f().wrapInList(g,r),T=C.filter(B=>m.includes(B.type.name));return s.ensureMarks(T),A?!0:c.clearNodes()}).wrapInList(g,r).command(()=>s1(s,g)).command(()=>a1(s,g)).run()},toggleMark:(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:s=!1}=n,a=Wi(t,r.schema);return o1(r,a,e)?o.unsetMark(a,{extendEmptyMarkRange:s}):o.setMark(a,e)},toggleNode:(t,e,n={})=>({state:r,commands:o})=>{const s=pn(t,r.schema),a=pn(e,r.schema),l=Eu(r,s,n);let u;return r.selection.$anchor.sameParent(r.selection.$head)&&(u=r.selection.$anchor.parent.attrs),l?o.setNode(a,u):o.setNode(s,{...u,...n})},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const o=pn(t,n.schema);return Eu(n,o,e)?r.lift(o):r.wrapIn(o,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let s;if(o.spec.isInputRules&&(s=o.getState(t))){if(e){const a=t.tr,l=s.transform;for(let u=l.steps.length-1;u>=0;u-=1)a.step(l.steps[u].invert(l.docs[u]));if(s.text){const u=a.doc.resolve(s.from).marks();a.replaceWith(s.from,s.to,t.schema.text(s.text,u))}else a.delete(s.from,s.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:o})=>{var s;const{extendEmptyMarkRange:a=!1}=e,{selection:l}=n,u=Wi(t,r.schema),{$from:c,empty:f,ranges:h}=l;if(!o)return!0;if(f&&a){let{from:m,to:g}=l;const b=(s=c.marks().find(w=>w.type===u))===null||s===void 0?void 0:s.attrs,y=Zd(c,u,b);y&&(m=y.from,g=y.to),n.removeMark(m,g,u)}else h.forEach(m=>{n.removeMark(m.$from.pos,m.$to.pos,u)});return n.removeStoredMark(u),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:o})=>{let s=null,a=null;const l=tf(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(s=pn(t,r.schema)),l==="mark"&&(a=Wi(t,r.schema)),o&&n.selection.ranges.forEach(u=>{const c=u.$from.pos,f=u.$to.pos;let h,m,g,b;n.selection.empty?r.doc.nodesBetween(c,f,(y,w)=>{s&&s===y.type&&(g=Math.max(w,c),b=Math.min(w+y.nodeSize,f),h=w,m=y)}):r.doc.nodesBetween(c,f,(y,w)=>{w<c&&s&&s===y.type&&(g=Math.max(w,c),b=Math.min(w+y.nodeSize,f),h=w,m=y),w>=c&&w<=f&&(s&&s===y.type&&n.setNodeMarkup(w,void 0,{...y.attrs,...e}),a&&y.marks.length&&y.marks.forEach(x=>{if(a===x.type){const _=Math.max(w,c),S=Math.min(w+y.nodeSize,f);n.addMark(_,S,a.create({...x.attrs,...e}))}}))}),m&&(h!==void 0&&n.setNodeMarkup(h,void 0,{...m.attrs,...e}),a&&m.marks.length&&m.marks.forEach(y=>{a===y.type&&n.addMark(g,b,a.create({...y.attrs,...e}))}))}),!0):!1},wrapIn:(t,e={})=>({state:n,dispatch:r})=>{const o=pn(t,n.schema);return YP(o,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const o=pn(t,n.schema);return ZP(o,e)(n,r)}});const _F=at.create({name:"commands",addCommands(){return{...EF}}}),SF=at.create({name:"drop",addProseMirrorPlugins(){return[new dt({key:new kt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),kF=at.create({name:"editable",addProseMirrorPlugins(){return[new dt({key:new kt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),TF=at.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new dt({key:new kt("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),AF=at.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:l})=>{const{selection:u,doc:c}=l,{empty:f,$anchor:h}=u,{pos:m,parent:g}=h,b=h.parent.isTextblock&&m>0?l.doc.resolve(m-1):h,y=b.parent.type.spec.isolating,w=h.pos-h.parentOffset,x=y&&b.parent.childCount===1?w===h.pos:Ve.atStart(c).from===m;return!f||!g.type.isTextblock||g.textContent.length||!x||x&&h.parent.type.name==="paragraph"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.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={...r},s={...r,"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 Qd()||R6()?s:o},addProseMirrorPlugins(){return[new dt({key:new kt("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(y=>y.getMeta("composition")))return;const r=t.some(y=>y.docChanged)&&!e.doc.eq(n.doc),o=t.some(y=>y.getMeta("preventClearDocument"));if(!r||o)return;const{empty:s,from:a,to:l}=e.selection,u=Ve.atStart(e.doc).from,c=Ve.atEnd(e.doc).to;if(s||!(a===u&&l===c)||!of(n.doc))return;const m=n.tr,g=Ud({state:n,transaction:m}),{commands:b}=new Wd({editor:this.editor,state:g});if(b.clearNodes(),!!m.steps.length)return m}})]}}),OF=at.create({name:"paste",addProseMirrorPlugins(){return[new dt({key:new kt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),MF=at.create({name:"tabindex",addProseMirrorPlugins(){return[new dt({key:new kt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Ps{get name(){return this.node.type.name}constructor(e,n,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=o}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!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},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 Ps(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 Ps(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 Ps(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,a=this.pos+r+(s?0:1),l=this.resolvedPos.doc.resolve(a);if(!o&&l.depth<=this.depth)return;const u=new Ps(l,this.editor,o,o?n:null);o&&(u.actualDepth=this.depth+1),e.push(new Ps(l,this.editor,o,o?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 r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(n).length>0){const s=o.node.attrs,a=Object.keys(n);for(let l=0;l<a.length;l+=1){const u=a[l];if(s[u]!==n[u])break}}else r=o;o=o.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;const s=Object.keys(n);return this.children.forEach(a=>{r&&o.length>0||(a.node.type.name===e&&s.every(u=>n[u]===a.node.attrs[u])&&o.push(a),!(r&&o.length>0)&&(o=o.concat(a.querySelectorAll(e,n,r))))}),o}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}}const BF=`.ProseMirror {
103
+ `,textSerializers:a={}}=n||{};let l="";return t.nodesBetween(r,o,(u,c,f,h)=>{var m;u.isBlock&&c>r&&(l+=s);const g=a==null?void 0:a[u.type.name];if(g)return f&&(l+=g({node:u,pos:c,parent:f,index:h,range:e})),!1;u.isText&&(l+=(m=u==null?void 0:u.text)===null||m===void 0?void 0:m.slice(Math.max(r,c)-c,o-c))}),l}function Q0(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const yD=at.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new dt({key:new kt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:o}=e,{ranges:s}=o,a=Math.min(...s.map(f=>f.$from.pos)),l=Math.max(...s.map(f=>f.$to.pos)),u=Q0(n);return k6(r,{from:a,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:u})}}})]}}),wD=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),xD=(t=!1)=>({commands:e})=>e.setContent("",t),CD=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:o}=r;return n&&o.forEach(({$from:s,$to:a})=>{t.doc.nodesBetween(s.pos,a.pos,(l,u)=>{if(l.type.isText)return;const{doc:c,mapping:f}=e,h=c.resolve(f.map(u)),m=c.resolve(f.map(u+l.nodeSize)),g=h.blockRange(m);if(!g)return;const b=Va(g);if(l.type.isTextblock){const{defaultType:y}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(g.start,y)}(b||b===0)&&e.lift(g,b)})}),!0},ED=t=>e=>t(e),_D=()=>({state:t,dispatch:e})=>g6(t,e),SD=(t,e)=>({editor:n,tr:r})=>{const{state:o}=n,s=o.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const a=r.mapping.map(e);return r.insert(a,s.content),r.setSelection(new Ie(r.doc.resolve(a-1))),!0},kD=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const o=t.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===r.type){if(e){const l=o.before(s),u=o.after(s);t.delete(l,u).scrollIntoView()}return!0}return!1},TD=t=>({tr:e,state:n,dispatch:r})=>{const o=pn(t,n.schema),s=e.selection.$anchor;for(let a=s.depth;a>0;a-=1)if(s.node(a).type===o){if(r){const u=s.before(a),c=s.after(a);e.delete(u,c).scrollIntoView()}return!0}return!1},AD=t=>({tr:e,dispatch:n})=>{const{from:r,to:o}=t;return n&&e.delete(r,o),!0},OD=()=>({state:t,dispatch:e})=>Cu(t,e),MD=()=>({commands:t})=>t.keyboardShortcut("Enter"),BD=()=>({state:t,dispatch:e})=>UP(t,e);function Yd(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(o=>n.strict?e[o]===t[o]:Z0(e[o])?e[o].test(t[o]):e[o]===t[o]):!0}function T6(t,e,n={}){return t.find(r=>r.type===e&&Yd(Object.fromEntries(Object.keys(n).map(o=>[o,r.attrs[o]])),n))}function A6(t,e,n={}){return!!T6(t,e,n)}function Zd(t,e,n){var r;if(!t||!e)return;let o=t.parent.childAfter(t.parentOffset);if((!o.node||!o.node.marks.some(f=>f.type===e))&&(o=t.parent.childBefore(t.parentOffset)),!o.node||!o.node.marks.some(f=>f.type===e)||(n=n||((r=o.node.marks[0])===null||r===void 0?void 0:r.attrs),!T6([...o.node.marks],e,n)))return;let a=o.index,l=t.start()+o.offset,u=a+1,c=l+o.node.nodeSize;for(;a>0&&A6([...t.parent.child(a-1).marks],e,n);)a-=1,l-=t.parent.child(a).nodeSize;for(;u<t.parent.childCount&&A6([...t.parent.child(u).marks],e,n);)c+=t.parent.child(u).nodeSize,u+=1;return{from:l,to:c}}function Wi(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}const RD=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const s=Wi(t,r.schema),{doc:a,selection:l}=n,{$from:u,from:c,to:f}=l;if(o){const h=Zd(u,s,e);if(h&&h.from<=c&&h.to>=f){const m=Ie.create(a,h.from,h.to);n.setSelection(m)}}return!0},ID=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function N0(t){return t instanceof Ie}function Xo(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function O6(t,e=null){if(!e)return null;const n=Ve.atStart(t),r=Ve.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const o=n.from,s=r.to;return e==="all"?Ie.create(t,Xo(0,o,s),Xo(t.content.size,o,s)):Ie.create(t,Xo(e,o,s),Xo(e,o,s))}function M6(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Qd(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const LD=(t=null,e={})=>({editor:n,view:r,tr:o,dispatch:s})=>{e={scrollIntoView:!0,...e};const a=()=>{(Qd()||M6())&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(s&&t===null&&!N0(n.state.selection))return a(),!0;const l=O6(o.doc,t)||n.state.selection,u=n.state.selection.eq(l);return s&&(u||o.setSelection(l),u&&o.storedMarks&&o.setStoredMarks(o.storedMarks),a()),!0},PD=(t,e)=>n=>t.every((r,o)=>e(r,{...n,index:o})),DD=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),B6=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&B6(r)}return t};function Nd(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return B6(n)}function ef(t,e,n){if(t instanceof Nr||t instanceof ue)return t;n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,o=typeof t=="string";if(r)try{if(Array.isArray(t)&&t.length>0)return ue.fromArray(t.map(l=>e.nodeFromJSON(l)));const a=e.nodeFromJSON(t);return n.errorOnInvalidContent&&a.check(),a}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),ef("",e,n)}if(o){if(n.errorOnInvalidContent){let a=!1,l="";const u=new m4({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=>(a=!0,l=typeof c=="string"?c:c.outerHTML,null)}]}})});if(n.slice?su.fromSchema(u).parseSlice(Nd(t),n.parseOptions):su.fromSchema(u).parse(Nd(t),n.parseOptions),n.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const s=su.fromSchema(e);return n.slice?s.parseSlice(Nd(t),n.parseOptions).content:s.parse(Nd(t),n.parseOptions)}return ef("",e,n)}function FD(t,e,n){const r=t.steps.length-1;if(r<e)return;const o=t.steps[r];if(!(o instanceof dn||o instanceof bn))return;const s=t.mapping.maps[r];let a=0;s.forEach((l,u,c,f)=>{a===0&&(a=f)}),t.setSelection(Ve.near(t.doc.resolve(a),n))}const VD=t=>!("type"in t),$D=(t,e,n)=>({tr:r,dispatch:o,editor:s})=>{var a;if(o){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;try{l=ef(e,s.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions},errorOnInvalidContent:(a=n.errorOnInvalidContent)!==null&&a!==void 0?a:s.options.enableContentCheck})}catch(b){return s.emit("contentError",{editor:s,error:b,disableCollaboration:()=>{s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}}),!1}let{from:u,to:c}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,h=!0;if((VD(l)?l:[l]).forEach(b=>{b.check(),f=f?b.isText&&b.marks.length===0:!1,h=h?b.isBlock:!1}),u===c&&h){const{parent:b}=r.doc.resolve(u);b.isTextblock&&!b.type.spec.code&&!b.childCount&&(u-=1,c+=1)}let g;if(f){if(Array.isArray(e))g=e.map(b=>b.text||"").join("");else if(e instanceof ue){let b="";e.forEach(y=>{y.text&&(b+=y.text)}),g=b}else typeof e=="object"&&e&&e.text?g=e.text:g=e;r.insertText(g,u,c)}else g=l,r.replaceWith(u,c,g);n.updateSelection&&FD(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:u,text:g}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:u,text:g})}return!0},zD=()=>({state:t,dispatch:e})=>$P(t,e),HD=()=>({state:t,dispatch:e})=>zP(t,e),UD=()=>({state:t,dispatch:e})=>u6(t,e),WD=()=>({state:t,dispatch:e})=>p6(t,e),jD=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Md(t.doc,t.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},qD=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Md(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},KD=()=>({state:t,dispatch:e})=>FP(t,e),GD=()=>({state:t,dispatch:e})=>VP(t,e);function R6(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function XD(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,o,s,a;for(let l=0;l<e.length-1;l+=1){const u=e[l];if(/^(cmd|meta|m)$/i.test(u))a=!0;else if(/^a(lt)?$/i.test(u))r=!0;else if(/^(c|ctrl|control)$/i.test(u))o=!0;else if(/^s(hift)?$/i.test(u))s=!0;else if(/^mod$/i.test(u))Qd()||R6()?a=!0:o=!0;else throw new Error(`Unrecognized modifier name: ${u}`)}return r&&(n=`Alt-${n}`),o&&(n=`Ctrl-${n}`),a&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}const JD=t=>({editor:e,view:n,tr:r,dispatch:o})=>{const s=XD(t).split(/-(?!$)/),a=s.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),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}),u=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,l))});return u==null||u.steps.forEach(c=>{const f=c.map(r.mapping);f&&o&&r.maybeStep(f)}),!0};function Eu(t,e,n={}){const{from:r,to:o,empty:s}=t.selection,a=e?pn(e,t.schema):null,l=[];t.doc.nodesBetween(r,o,(h,m)=>{if(h.isText)return;const g=Math.max(r,m),b=Math.min(o,m+h.nodeSize);l.push({node:h,from:g,to:b})});const u=o-r,c=l.filter(h=>a?a.name===h.node.type.name:!0).filter(h=>Yd(h.node.attrs,n,{strict:!1}));return s?!!c.length:c.reduce((h,m)=>h+m.to-m.from,0)>=u}const YD=(t,e={})=>({state:n,dispatch:r})=>{const o=pn(t,n.schema);return Eu(n,o,e)?HP(n,r):!1},ZD=()=>({state:t,dispatch:e})=>b6(t,e),QD=t=>({state:e,dispatch:n})=>{const r=pn(t,e.schema);return eD(r)(e,n)},ND=()=>({state:t,dispatch:e})=>m6(t,e);function tf(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function I6(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,o)=>(n.includes(o)||(r[o]=t[o]),r),{})}const eF=(t,e)=>({tr:n,state:r,dispatch:o})=>{let s=null,a=null;const l=tf(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(s=pn(t,r.schema)),l==="mark"&&(a=Wi(t,r.schema)),o&&n.selection.ranges.forEach(u=>{r.doc.nodesBetween(u.$from.pos,u.$to.pos,(c,f)=>{s&&s===c.type&&n.setNodeMarkup(f,void 0,I6(c.attrs,e)),a&&c.marks.length&&c.marks.forEach(h=>{a===h.type&&n.addMark(f,f+c.nodeSize,a.create(I6(h.attrs,e)))})})}),!0):!1},tF=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),nF=()=>({tr:t,dispatch:e})=>{if(e){const n=new Rn(t.doc);t.setSelection(n)}return!0},rF=()=>({state:t,dispatch:e})=>d6(t,e),oF=()=>({state:t,dispatch:e})=>h6(t,e),iF=()=>({state:t,dispatch:e})=>qP(t,e),sF=()=>({state:t,dispatch:e})=>JP(t,e),aF=()=>({state:t,dispatch:e})=>XP(t,e);function e1(t,e,n={},r={}){return ef(t,e,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}const lF=(t,e=!1,n={},r={})=>({editor:o,tr:s,dispatch:a,commands:l})=>{var u,c;const{doc:f}=s;if(n.preserveWhitespace!=="full"){const h=e1(t,o.schema,n,{errorOnInvalidContent:(u=r.errorOnInvalidContent)!==null&&u!==void 0?u:o.options.enableContentCheck});return a&&s.replaceWith(0,f.content.size,h).setMeta("preventUpdate",!e),!0}return a&&s.setMeta("preventUpdate",!e),l.insertContentAt({from:0,to:f.content.size},t,{parseOptions:n,errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:o.options.enableContentCheck})};function t1(t,e){const n=Wi(e,t.schema),{from:r,to:o,empty:s}=t.selection,a=[];s?(t.storedMarks&&a.push(...t.storedMarks),a.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,o,u=>{a.push(...u.marks)});const l=a.find(u=>u.type.name===n.name);return l?{...l.attrs}:{}}function uF(t,e){const n=new f0(t);return e.forEach(r=>{r.steps.forEach(o=>{n.step(o)})}),n}function L6(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function n1(t,e){const n=[];return t.descendants((r,o)=>{e(r)&&n.push({node:r,pos:o})}),n}function P6(t,e,n){const r=[];return t.nodesBetween(e.from,e.to,(o,s)=>{n(o)&&r.push({node:o,pos:s})}),r}function D6(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Jo(t){return e=>D6(e.$from,t)}function F6(t,e){const n={from:0,to:t.content.size};return k6(t,n,e)}function cF(t,e){const n=pn(e,t.schema),{from:r,to:o}=t.selection,s=[];t.doc.nodesBetween(r,o,l=>{s.push(l)});const a=s.reverse().find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function V6(t,e){const n=tf(typeof e=="string"?e:e.name,t.schema);return n==="node"?cF(t,e):n==="mark"?t1(t,e):{}}function dF(t,e=JSON.stringify){const n={};return t.filter(r=>{const o=e(r);return Object.prototype.hasOwnProperty.call(n,o)?!1:n[o]=!0})}function fF(t){const e=dF(t);return e.length===1?e:e.filter((n,r)=>!e.filter((s,a)=>a!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function pF(t){const{mapping:e,steps:n}=t,r=[];return e.maps.forEach((o,s)=>{const a=[];if(o.ranges.length)o.forEach((l,u)=>{a.push({from:l,to:u})});else{const{from:l,to:u}=n[s];if(l===void 0||u===void 0)return;a.push({from:l,to:u})}a.forEach(({from:l,to:u})=>{const c=e.slice(s).map(l,-1),f=e.slice(s).map(u),h=e.invert().map(c,-1),m=e.invert().map(f);r.push({oldRange:{from:h,to:m},newRange:{from:c,to:f}})})}),fF(r)}function r1(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(o=>{const s=n.resolve(t),a=Zd(s,o.type);a&&r.push({mark:o,...a})}):n.nodesBetween(t,e,(o,s)=>{!o||(o==null?void 0:o.nodeSize)===void 0||r.push(...o.marks.map(a=>({from:s,to:s+o.nodeSize,mark:a})))}),r}function nf(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(s=>s.type===e&&s.name===r);return o?o.attribute.keepOnSplit:!1}))}function o1(t,e,n={}){const{empty:r,ranges:o}=t.selection,s=e?Wi(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>s?s.name===h.type.name:!0).find(h=>Yd(h.attrs,n,{strict:!1}));let a=0;const l=[];if(o.forEach(({$from:h,$to:m})=>{const g=h.pos,b=m.pos;t.doc.nodesBetween(g,b,(y,w)=>{if(!y.isText&&!y.marks.length)return;const x=Math.max(g,w),_=Math.min(b,w+y.nodeSize),S=_-x;a+=S,l.push(...y.marks.map(C=>({mark:C,from:x,to:_})))})}),a===0)return!1;const u=l.filter(h=>s?s.name===h.mark.type.name:!0).filter(h=>Yd(h.mark.attrs,n,{strict:!1})).reduce((h,m)=>h+m.to-m.from,0),c=l.filter(h=>s?h.mark.type!==s&&h.mark.type.excludes(s):!0).reduce((h,m)=>h+m.to-m.from,0);return(u>0?u+c:u)>=a}function rf(t,e,n={}){if(!e)return Eu(t,null,n)||o1(t,null,n);const r=tf(e,t.schema);return r==="node"?Eu(t,e,n):r==="mark"?o1(t,e,n):!1}function i1(t,e){const{nodeExtensions:n}=jd(e),r=n.find(a=>a.name===t);if(!r)return!1;const o={name:r.name,options:r.options,storage:r.storage},s=st(Be(r,"group",o));return typeof s!="string"?!1:s.split(" ").includes("list")}function of(t,{checkChildren:e=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((r=t.text)!==null&&r!==void 0?r:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let o=!0;return t.content.forEach(s=>{o!==!1&&(of(s,{ignoreWhitespace:n,checkChildren:e})||(o=!1))}),o}return!1}function $6(t){return t instanceof Pe}function z6(t,e,n){const o=t.state.doc.content.size,s=Xo(e,0,o),a=Xo(n,0,o),l=t.coordsAtPos(s),u=t.coordsAtPos(a,-1),c=Math.min(l.top,u.top),f=Math.max(l.bottom,u.bottom),h=Math.min(l.left,u.left),m=Math.max(l.right,u.right),g=m-h,b=f-c,x={top:c,bottom:f,left:h,right:m,width:g,height:b,x:h,y:c};return{...x,toJSON:()=>x}}function hF(t,e,n){var r;const{selection:o}=e;let s=null;if(N0(o)&&(s=o.$cursor),s){const l=(r=t.storedMarks)!==null&&r!==void 0?r:s.marks();return!!n.isInSet(l)||!l.some(u=>u.type.excludes(n))}const{ranges:a}=o;return a.some(({$from:l,$to:u})=>{let c=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(l.pos,u.pos,(f,h,m)=>{if(c)return!1;if(f.isInline){const g=!m||m.type.allowsMarkType(n),b=!!n.isInSet(f.marks)||!f.marks.some(y=>y.type.excludes(n));c=g&&b}return!c}),c})}const mF=(t,e={})=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=n,{empty:a,ranges:l}=s,u=Wi(t,r.schema);if(o)if(a){const c=t1(r,u);n.addStoredMark(u.create({...c,...e}))}else l.forEach(c=>{const f=c.$from.pos,h=c.$to.pos;r.doc.nodesBetween(f,h,(m,g)=>{const b=Math.max(g,f),y=Math.min(g+m.nodeSize,h);m.marks.find(x=>x.type===u)?m.marks.forEach(x=>{u===x.type&&n.addMark(b,y,u.create({...x.attrs,...e}))}):n.addMark(b,y,u.create(e))})});return hF(r,n,u)},gF=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),bF=(t,e={})=>({state:n,dispatch:r,chain:o})=>{const s=pn(t,n.schema);let a;return n.selection.$anchor.sameParent(n.selection.$head)&&(a=n.selection.$anchor.parent.attrs),s.isTextblock?o().command(({commands:l})=>w6(s,{...a,...e})(n)?!0:l.clearNodes()).command(({state:l})=>w6(s,{...a,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},vF=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,o=Xo(t,0,r.content.size),s=Pe.create(r,o);e.setSelection(s)}return!0},yF=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:o,to:s}=typeof t=="number"?{from:t,to:t}:t,a=Ie.atStart(r).from,l=Ie.atEnd(r).to,u=Xo(o,a,l),c=Xo(s,a,l),f=Ie.create(r,u,c);e.setSelection(f)}return!0},wF=t=>({state:e,dispatch:n})=>{const r=pn(t,e.schema);return rD(r)(e,n)};function H6(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(o=>e==null?void 0:e.includes(o.type.name));t.tr.ensureMarks(r)}}const xF=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:s,doc:a}=e,{$from:l,$to:u}=s,c=o.extensionManager.attributes,f=nf(c,l.node().type.name,l.node().attrs);if(s instanceof Pe&&s.node.isBlock)return!l.parentOffset||!pr(a,l.pos)?!1:(r&&(t&&H6(n,o.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const h=u.parentOffset===u.parent.content.size,m=l.depth===0?void 0:L6(l.node(-1).contentMatchAt(l.indexAfter(-1)));let g=h&&m?[{type:m,attrs:f}]:void 0,b=pr(e.doc,e.mapping.map(l.pos),1,g);if(!g&&!b&&pr(e.doc,e.mapping.map(l.pos),1,m?[{type:m}]:void 0)&&(b=!0,g=m?[{type:m,attrs:f}]:void 0),r){if(b&&(s instanceof Ie&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,g),m&&!h&&!l.parentOffset&&l.parent.type!==m)){const y=e.mapping.map(l.before()),w=e.doc.resolve(y);l.node(-1).canReplaceWith(w.index(),w.index()+1,m)&&e.setNodeMarkup(e.mapping.map(l.before()),m)}t&&H6(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return b},CF=(t,e={})=>({tr:n,state:r,dispatch:o,editor:s})=>{var a;const l=pn(t,r.schema),{$from:u,$to:c}=r.selection,f=r.selection.node;if(f&&f.isBlock||u.depth<2||!u.sameParent(c))return!1;const h=u.node(-1);if(h.type!==l)return!1;const m=s.extensionManager.attributes;if(u.parent.content.size===0&&u.node(-1).childCount===u.indexAfter(-1)){if(u.depth===2||u.node(-3).type!==l||u.index(-2)!==u.node(-2).childCount-1)return!1;if(o){let x=ue.empty;const _=u.index(-1)?1:u.index(-2)?2:3;for(let B=u.depth-_;B>=u.depth-3;B-=1)x=ue.from(u.node(B).copy(x));const S=u.indexAfter(-1)<u.node(-2).childCount?1:u.indexAfter(-2)<u.node(-3).childCount?2:3,C={...nf(m,u.node().type.name,u.node().attrs),...e},k=((a=l.contentMatch.defaultType)===null||a===void 0?void 0:a.createAndFill(C))||void 0;x=x.append(ue.from(l.createAndFill(null,k)||void 0));const A=u.before(u.depth-(_-1));n.replace(A,u.after(-S),new xe(x,4-_,0));let T=-1;n.doc.nodesBetween(A,n.doc.content.size,(B,L)=>{if(T>-1)return!1;B.isTextblock&&B.content.size===0&&(T=L+1)}),T>-1&&n.setSelection(Ie.near(n.doc.resolve(T))),n.scrollIntoView()}return!0}const g=c.pos===u.end()?h.contentMatchAt(0).defaultType:null,b={...nf(m,h.type.name,h.attrs),...e},y={...nf(m,u.node().type.name,u.node().attrs),...e};n.delete(u.pos,c.pos);const w=g?[{type:l,attrs:b},{type:g,attrs:y}]:[{type:l,attrs:b}];if(!pr(n.doc,u.pos,2))return!1;if(o){const{selection:x,storedMarks:_}=r,{splittableMarks:S}=s.extensionManager,C=_||x.$to.parentOffset&&x.$from.marks();if(n.split(u.pos,2,w).scrollIntoView(),!C||!o)return!0;const k=C.filter(A=>S.includes(A.type.name));n.ensureMarks(k)}return!0},s1=(t,e)=>{const n=Jo(a=>a.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===(o==null?void 0:o.type)&&Ii(t.doc,n.pos)&&t.join(n.pos),!0},a1=(t,e)=>{const n=Jo(a=>a.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const o=t.doc.nodeAt(r);return n.node.type===(o==null?void 0:o.type)&&Ii(t.doc,r)&&t.join(r),!0};var EF=Object.freeze({__proto__:null,blur:wD,clearContent:xD,clearNodes:CD,command:ED,createParagraphNear:_D,cut:SD,deleteCurrentNode:kD,deleteNode:TD,deleteRange:AD,deleteSelection:OD,enter:MD,exitCode:BD,extendMarkRange:RD,first:ID,focus:LD,forEach:PD,insertContent:DD,insertContentAt:$D,joinBackward:UD,joinDown:HD,joinForward:WD,joinItemBackward:jD,joinItemForward:qD,joinTextblockBackward:KD,joinTextblockForward:GD,joinUp:zD,keyboardShortcut:JD,lift:YD,liftEmptyBlock:ZD,liftListItem:QD,newlineInCode:ND,resetAttributes:eF,scrollIntoView:tF,selectAll:nF,selectNodeBackward:rF,selectNodeForward:oF,selectParentNode:iF,selectTextblockEnd:sF,selectTextblockStart:aF,setContent:lF,setMark:mF,setMeta:gF,setNode:bF,setNodeSelection:vF,setTextSelection:yF,sinkListItem:wF,splitBlock:xF,splitListItem:CF,toggleList:(t,e,n,r={})=>({editor:o,tr:s,state:a,dispatch:l,chain:u,commands:c,can:f})=>{const{extensions:h,splittableMarks:m}=o.extensionManager,g=pn(t,a.schema),b=pn(e,a.schema),{selection:y,storedMarks:w}=a,{$from:x,$to:_}=y,S=x.blockRange(_),C=w||y.$to.parentOffset&&y.$from.marks();if(!S)return!1;const k=Jo(A=>i1(A.type.name,h))(y);if(S.depth>=1&&k&&S.depth-k.depth<=1){if(k.node.type===g)return c.liftListItem(b);if(i1(k.node.type.name,h)&&g.validContent(k.node.content)&&l)return u().command(()=>(s.setNodeMarkup(k.pos,g),!0)).command(()=>s1(s,g)).command(()=>a1(s,g)).run()}return!n||!C||!l?u().command(()=>f().wrapInList(g,r)?!0:c.clearNodes()).wrapInList(g,r).command(()=>s1(s,g)).command(()=>a1(s,g)).run():u().command(()=>{const A=f().wrapInList(g,r),T=C.filter(B=>m.includes(B.type.name));return s.ensureMarks(T),A?!0:c.clearNodes()}).wrapInList(g,r).command(()=>s1(s,g)).command(()=>a1(s,g)).run()},toggleMark:(t,e={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:s=!1}=n,a=Wi(t,r.schema);return o1(r,a,e)?o.unsetMark(a,{extendEmptyMarkRange:s}):o.setMark(a,e)},toggleNode:(t,e,n={})=>({state:r,commands:o})=>{const s=pn(t,r.schema),a=pn(e,r.schema),l=Eu(r,s,n);let u;return r.selection.$anchor.sameParent(r.selection.$head)&&(u=r.selection.$anchor.parent.attrs),l?o.setNode(a,u):o.setNode(s,{...u,...n})},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const o=pn(t,n.schema);return Eu(n,o,e)?r.lift(o):r.wrapIn(o,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const o=n[r];let s;if(o.spec.isInputRules&&(s=o.getState(t))){if(e){const a=t.tr,l=s.transform;for(let u=l.steps.length-1;u>=0;u-=1)a.step(l.steps[u].invert(l.docs[u]));if(s.text){const u=a.doc.resolve(s.from).marks();a.replaceWith(s.from,s.to,t.schema.text(s.text,u))}else a.delete(s.from,s.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:o}=n;return r||e&&o.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:o})=>{var s;const{extendEmptyMarkRange:a=!1}=e,{selection:l}=n,u=Wi(t,r.schema),{$from:c,empty:f,ranges:h}=l;if(!o)return!0;if(f&&a){let{from:m,to:g}=l;const b=(s=c.marks().find(w=>w.type===u))===null||s===void 0?void 0:s.attrs,y=Zd(c,u,b);y&&(m=y.from,g=y.to),n.removeMark(m,g,u)}else h.forEach(m=>{n.removeMark(m.$from.pos,m.$to.pos,u)});return n.removeStoredMark(u),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:o})=>{let s=null,a=null;const l=tf(typeof t=="string"?t:t.name,r.schema);return l?(l==="node"&&(s=pn(t,r.schema)),l==="mark"&&(a=Wi(t,r.schema)),o&&n.selection.ranges.forEach(u=>{const c=u.$from.pos,f=u.$to.pos;let h,m,g,b;n.selection.empty?r.doc.nodesBetween(c,f,(y,w)=>{s&&s===y.type&&(g=Math.max(w,c),b=Math.min(w+y.nodeSize,f),h=w,m=y)}):r.doc.nodesBetween(c,f,(y,w)=>{w<c&&s&&s===y.type&&(g=Math.max(w,c),b=Math.min(w+y.nodeSize,f),h=w,m=y),w>=c&&w<=f&&(s&&s===y.type&&n.setNodeMarkup(w,void 0,{...y.attrs,...e}),a&&y.marks.length&&y.marks.forEach(x=>{if(a===x.type){const _=Math.max(w,c),S=Math.min(w+y.nodeSize,f);n.addMark(_,S,a.create({...x.attrs,...e}))}}))}),m&&(h!==void 0&&n.setNodeMarkup(h,void 0,{...m.attrs,...e}),a&&m.marks.length&&m.marks.forEach(y=>{a===y.type&&n.addMark(g,b,a.create({...y.attrs,...e}))}))}),!0):!1},wrapIn:(t,e={})=>({state:n,dispatch:r})=>{const o=pn(t,n.schema);return YP(o,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const o=pn(t,n.schema);return ZP(o,e)(n,r)}});const _F=at.create({name:"commands",addCommands(){return{...EF}}}),SF=at.create({name:"drop",addProseMirrorPlugins(){return[new dt({key:new kt("tiptapDrop"),props:{handleDrop:(t,e,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:n,moved:r})}}})]}}),kF=at.create({name:"editable",addProseMirrorPlugins(){return[new dt({key:new kt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),TF=at.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new dt({key:new kt("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),AF=at.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:l})=>{const{selection:u,doc:c}=l,{empty:f,$anchor:h}=u,{pos:m,parent:g}=h,b=h.parent.isTextblock&&m>0?l.doc.resolve(m-1):h,y=b.parent.type.spec.isolating,w=h.pos-h.parentOffset,x=y&&b.parent.childCount===1?w===h.pos:Ve.atStart(c).from===m;return!f||!g.type.isTextblock||g.textContent.length||!x||x&&h.parent.type.name==="paragraph"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.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={...r},s={...r,"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 Qd()||R6()?s:o},addProseMirrorPlugins(){return[new dt({key:new kt("clearDocument"),appendTransaction:(t,e,n)=>{if(t.some(y=>y.getMeta("composition")))return;const r=t.some(y=>y.docChanged)&&!e.doc.eq(n.doc),o=t.some(y=>y.getMeta("preventClearDocument"));if(!r||o)return;const{empty:s,from:a,to:l}=e.selection,u=Ve.atStart(e.doc).from,c=Ve.atEnd(e.doc).to;if(s||!(a===u&&l===c)||!of(n.doc))return;const m=n.tr,g=Ud({state:n,transaction:m}),{commands:b}=new Wd({editor:this.editor,state:g});if(b.clearNodes(),!!m.steps.length)return m}})]}}),OF=at.create({name:"paste",addProseMirrorPlugins(){return[new dt({key:new kt("tiptapPaste"),props:{handlePaste:(t,e,n)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:n})}}})]}}),MF=at.create({name:"tabindex",addProseMirrorPlugins(){return[new dt({key:new kt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class Ps{get name(){return this.node.type.name}constructor(e,n,r=!1,o=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=o}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!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},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 Ps(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 Ps(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 Ps(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const o=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,a=this.pos+r+(s?0:1),l=this.resolvedPos.doc.resolve(a);if(!o&&l.depth<=this.depth)return;const u=new Ps(l,this.editor,o,o?n:null);o&&(u.actualDepth=this.depth+1),e.push(new Ps(l,this.editor,o,o?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 r=null,o=this.parent;for(;o&&!r;){if(o.node.type.name===e)if(Object.keys(n).length>0){const s=o.node.attrs,a=Object.keys(n);for(let l=0;l<a.length;l+=1){const u=a[l];if(s[u]!==n[u])break}}else r=o;o=o.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let o=[];if(!this.children||this.children.length===0)return o;const s=Object.keys(n);return this.children.forEach(a=>{r&&o.length>0||(a.node.type.name===e&&s.every(u=>n[u]===a.node.attrs[u])&&o.push(a),!(r&&o.length>0)&&(o=o.concat(a.querySelectorAll(e,n,r))))}),o}setAttribute(e){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(n)}}const BF=`.ProseMirror {
104
104
  position: relative;
105
105
  }
106
106
 
@@ -244,11 +244,11 @@ https://github.com/highlightjs/highlight.js/issues/2277`),ne=P,oe=G),Z===void 0&
244
244
  `,MU="️",BU="‍",ag="";let Nf=null,ep=null;function RU(t=[]){const e={};nr.groups=e;const n=new nr;Nf==null&&(Nf=q8(_U)),ep==null&&(ep=q8(SU)),ye(n,"'",N1),ye(n,"{",qu),ye(n,"}",Ku),ye(n,"[",Tf),ye(n,"]",Af),ye(n,"(",Of),ye(n,")",Mf),ye(n,"<",Bf),ye(n,">",Rf),ye(n,"(",If),ye(n,")",Lf),ye(n,"「",Pf),ye(n,"」",Df),ye(n,"『",Ff),ye(n,"』",Vf),ye(n,"<",$f),ye(n,">",zf),ye(n,"&",Hf),ye(n,"*",Uf),ye(n,"@",Ji),ye(n,"`",jf),ye(n,"^",qf),ye(n,":",Yi),ye(n,",",eg),ye(n,"$",Kf),ye(n,".",ko),ye(n,"=",Gf),ye(n,"!",tg),ye(n,"-",Lr),ye(n,"%",Gu),ye(n,"|",Xf),ye(n,"+",Jf),ye(n,"#",Yf),ye(n,"?",Xu),ye(n,'"',ng),ye(n,"/",To),ye(n,";",rg),ye(n,"~",Ju),ye(n,"_",Zf),ye(n,"\\",Wf),ye(n,"・",z8);const r=tn(n,ti,Y1,{[U1]:!0});tn(r,ti,r);const o=tn(r,ei,V8,{[Uu]:!0}),s=tn(r,Yu,$8,{[Wu]:!0}),a=tn(n,ei,No,{[W1]:!0});tn(a,ti,o),tn(a,ei,a),tn(o,ti,o),tn(o,ei,o);const l=tn(n,Yu,G1,{[j1]:!0});tn(l,ei),tn(l,ti,s),tn(l,Yu,l),tn(s,ti,s),tn(s,ei),tn(s,Yu,s);const u=ye(n,sg,Q1,{[K1]:!0}),c=ye(n,W8,Z1,{[K1]:!0}),f=tn(n,ig,Z1,{[K1]:!0});ye(n,ag,f),ye(c,sg,u),ye(c,ag,f),tn(c,ig,f),ye(f,W8),ye(f,sg),tn(f,ig,f),ye(f,ag,f);const h=tn(n,og,H8,{[D8]:!0});ye(h,"#"),tn(h,og,h),ye(h,MU,h);const m=ye(h,BU);ye(m,"#"),tn(m,og,h);const g=[[ei,a],[ti,o]],b=[[ei,null],[Yu,l],[ti,s]];for(let y=0;y<Nf.length;y++)Zi(n,Nf[y],X1,No,g);for(let y=0;y<ep.length;y++)Zi(n,ep[y],J1,G1,b);Gs(X1,{tld:!0,ascii:!0},e),Gs(J1,{utld:!0,alpha:!0},e),Zi(n,"file",kf,No,g),Zi(n,"mailto",kf,No,g),Zi(n,"http",cl,No,g),Zi(n,"https",cl,No,g),Zi(n,"ftp",cl,No,g),Zi(n,"ftps",cl,No,g),Gs(kf,{scheme:!0,ascii:!0},e),Gs(cl,{slashscheme:!0,ascii:!0},e),t=t.sort((y,w)=>y[0]>w[0]?1:-1);for(let y=0;y<t.length;y++){const w=t[y][0],_=t[y][1]?{[kU]:!0}:{[TU]:!0};w.indexOf("-")>=0?_[q1]=!0:ei.test(w)?ti.test(w)?_[Uu]=!0:_[W1]=!0:_[U1]=!0,F8(n,w,w,_)}return F8(n,"localhost",ju,{ascii:!0}),n.jd=new nr(Qf),{start:n,tokens:ul({groups:e},U8)}}function j8(t,e){const n=IU(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,o=[];let s=0,a=0;for(;a<r;){let l=t,u=null,c=0,f=null,h=-1,m=-1;for(;a<r&&(u=l.go(n[a]));)l=u,l.accepts()?(h=0,m=0,f=l):h>=0&&(h+=n[a].length,m++),c+=n[a].length,s+=n[a].length,a++;s-=h,a-=m,c-=h,o.push({t:f.t,v:e.slice(s-c,s),s:s-c,e:s})}return o}function IU(t){const e=[],n=t.length;let r=0;for(;r<n;){let o=t.charCodeAt(r),s,a=o<55296||o>56319||r+1===n||(s=t.charCodeAt(r+1))<56320||s>57343?t[r]:t.slice(r,r+2);e.push(a),r+=a.length}return e}function Zi(t,e,n,r,o){let s;const a=e.length;for(let l=0;l<a-1;l++){const u=e[l];t.j[u]?s=t.j[u]:(s=new nr(r),s.jr=o.slice(),t.j[u]=s),t=s}return s=new nr(n),s.jr=o.slice(),t.j[e[a-1]]=s,s}function q8(t){const e=[],n=[];let r=0,o="0123456789";for(;r<t.length;){let s=0;for(;o.indexOf(t[r+s])>=0;)s++;if(s>0){e.push(n.join(""));for(let a=parseInt(t.substring(r,r+s),10);a>0;a--)n.pop();r+=s}else n.push(t[r]),r++}return e}const Zu={defaultProtocol:"http",events:null,format:K8,formatHref:K8,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function lg(t,e=null){let n=ul({},Zu);t&&(n=ul(n,t instanceof lg?t.o:t));const r=n.ignoreTags,o=[];for(let s=0;s<r.length;s++)o.push(r[s].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=o}lg.prototype={o:Zu,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=e!=null;let o=this.o[t];return o&&(typeof o=="object"?(o=n.t in o?o[n.t]:Zu[t],typeof o=="function"&&r&&(o=o(e,n))):typeof o=="function"&&r&&(o=o(e,n.t,n)),o)},getObj(t,e,n){let r=this.o[t];return typeof r=="function"&&e!=null&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function K8(t){return t}function G8(t,e){this.t="token",this.v=t,this.tk=e}G8.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},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=Zu.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")),r=t.get("formatHref",n,this),o=t.get("tagName",n,e),s=this.toFormattedString(t),a={},l=t.get("className",n,e),u=t.get("target",n,e),c=t.get("rel",n,e),f=t.getObj("attributes",n,e),h=t.getObj("events",n,e);return a.href=r,l&&(a.class=l),u&&(a.target=u),c&&(a.rel=c),f&&ul(a,f),{tagName:o,attributes:a,content:s,eventListeners:h}}};function tp(t,e){class n extends G8{constructor(o,s){super(o,s),this.t=t}}for(const r in e)n.prototype[r]=e[r];return n.t=t,n}const X8=tp("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),J8=tp("text"),LU=tp("nl"),np=tp("url",{isLink:!0,toHref(t=Zu.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==ju&&t[1].t===Yi}}),Pr=t=>new nr(t);function PU({groups:t}){const e=t.domain.concat([Hf,Uf,Ji,Wf,jf,qf,Kf,Gf,Lr,Y1,Gu,Xf,Jf,Yf,To,Qf,Ju,Zf]),n=[Yi,eg,ko,tg,Gu,Xu,ng,rg,Bf,Rf,qu,Ku,Af,Tf,Of,Mf,If,Lf,Pf,Df,Ff,Vf,$f,zf],r=[Hf,N1,Uf,Wf,jf,qf,Kf,Gf,Lr,qu,Ku,Gu,Xf,Jf,Yf,Xu,To,Qf,Ju,Zf],o=Pr(),s=ye(o,Ju);lt(s,r,s),lt(s,t.domain,s);const a=Pr(),l=Pr(),u=Pr();lt(o,t.domain,a),lt(o,t.scheme,l),lt(o,t.slashscheme,u),lt(a,r,s),lt(a,t.domain,a);const c=ye(a,Ji);ye(s,Ji,c),ye(l,Ji,c),ye(u,Ji,c);const f=ye(s,ko);lt(f,r,s),lt(f,t.domain,s);const h=Pr();lt(c,t.domain,h),lt(h,t.domain,h);const m=ye(h,ko);lt(m,t.domain,h);const g=Pr(X8);lt(m,t.tld,g),lt(m,t.utld,g),ye(c,ju,g);const b=ye(h,Lr);ye(b,Lr,b),lt(b,t.domain,h),lt(g,t.domain,h),ye(g,ko,m),ye(g,Lr,b);const y=ye(g,Yi);lt(y,t.numeric,X8);const w=ye(a,Lr),x=ye(a,ko);ye(w,Lr,w),lt(w,t.domain,a),lt(x,r,s),lt(x,t.domain,a);const _=Pr(np);lt(x,t.tld,_),lt(x,t.utld,_),lt(_,t.domain,a),lt(_,r,s),ye(_,ko,x),ye(_,Lr,w),ye(_,Ji,c);const S=ye(_,Yi),C=Pr(np);lt(S,t.numeric,C);const k=Pr(np),A=Pr();lt(k,e,k),lt(k,n,A),lt(A,e,k),lt(A,n,A),ye(_,To,k),ye(C,To,k);const T=ye(l,Yi),B=ye(u,Yi),L=ye(B,To),I=ye(L,To);lt(l,t.domain,a),ye(l,ko,x),ye(l,Lr,w),lt(u,t.domain,a),ye(u,ko,x),ye(u,Lr,w),lt(T,t.domain,k),ye(T,To,k),ye(T,Xu,k),lt(I,t.domain,k),lt(I,e,k),ye(I,To,k);const V=[[qu,Ku],[Tf,Af],[Of,Mf],[Bf,Rf],[If,Lf],[Pf,Df],[Ff,Vf],[$f,zf]];for(let q=0;q<V.length;q++){const[K,me]=V[q],z=ye(k,K);ye(A,K,z),ye(z,me,k);const U=Pr(np);lt(z,e,U);const P=Pr();lt(z,n),lt(U,e,U),lt(U,n,P),lt(P,e,U),lt(P,n,P),ye(U,me,k),ye(P,me,k)}return ye(o,ju,_),ye(o,Q1,LU),{start:o,tokens:U8}}function DU(t,e,n){let r=n.length,o=0,s=[],a=[];for(;o<r;){let l=t,u=null,c=null,f=0,h=null,m=-1;for(;o<r&&!(u=l.go(n[o].t));)a.push(n[o++]);for(;o<r&&(c=u||l.go(n[o].t));)u=null,l=c,l.accepts()?(m=0,h=l):m>=0&&m++,o++,f++;if(m<0)o-=f,o<r&&(a.push(n[o]),o++);else{a.length>0&&(s.push(ug(J8,e,a)),a=[]),o-=m,f-=m;const g=h.t,b=n.slice(o-f,o);s.push(ug(g,e,b))}}return a.length>0&&s.push(ug(J8,e,a)),s}function ug(t,e,n){const r=n[0].s,o=n[n.length-1].e,s=e.slice(r,o);return new t(s,n)}const FU=typeof console<"u"&&console&&console.warn||(()=>{}),VU="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Wt={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function $U(){return nr.groups={},Wt.scanner=null,Wt.parser=null,Wt.tokenQueue=[],Wt.pluginQueue=[],Wt.customSchemes=[],Wt.initialized=!1,Wt}function Y8(t,e=!1){if(Wt.initialized&&FU(`linkifyjs: already initialized - will not register custom scheme "${t}" ${VU}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format.
245
245
  1. Must only contain digits, lowercase ASCII letters or "-"
246
246
  2. Cannot start or end with "-"
247
- 3. "-" cannot repeat`);Wt.customSchemes.push([t,e])}function zU(){Wt.scanner=RU(Wt.customSchemes);for(let t=0;t<Wt.tokenQueue.length;t++)Wt.tokenQueue[t][1]({scanner:Wt.scanner});Wt.parser=PU(Wt.scanner.tokens);for(let t=0;t<Wt.pluginQueue.length;t++)Wt.pluginQueue[t][1]({scanner:Wt.scanner,parser:Wt.parser});return Wt.initialized=!0,Wt}function cg(t){return Wt.initialized||zU(),DU(Wt.parser.start,t,j8(Wt.scanner.start,t))}cg.scan=j8;function Z8(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 r=new lg(n),o=cg(t),s=[];for(let a=0;a<o.length;a++){const l=o[a];l.isLink&&(!e||l.t===e)&&r.check(l)&&s.push(l.toFormattedObject(r))}return s}function HU(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function UU(t){return new dt({key:new kt("autolink"),appendTransaction:(e,n,r)=>{const o=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),s=e.some(c=>c.getMeta("preventAutolink"));if(!o||s)return;const{tr:a}=r,l=uF(n.doc,[...e]);if(pF(l).forEach(({newRange:c})=>{const f=P6(r.doc,c,g=>g.isTextblock);let h,m;if(f.length>1?(h=f[0],m=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ")):f.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(h=f[0],m=r.doc.textBetween(h.pos,c.to,void 0," ")),h&&m){const g=m.split(" ").filter(x=>x!=="");if(g.length<=0)return!1;const b=g[g.length-1],y=h.pos+m.lastIndexOf(b);if(!b)return!1;const w=cg(b).map(x=>x.toObject(t.defaultProtocol));if(!HU(w))return!1;w.filter(x=>x.isLink).map(x=>({...x,from:y+x.start+1,to:y+x.end+1})).filter(x=>r.schema.marks.code?!r.doc.rangeHasMark(x.from,x.to,r.schema.marks.code):!0).filter(x=>t.validate(x.value)).filter(x=>t.shouldAutoLink(x.value)).forEach(x=>{r1(x.from,x.to,r.doc).some(_=>_.mark.type===t.type)||a.addMark(x.from,x.to,t.type.create({href:x.href}))})}}),!!a.steps.length)return a}})}function WU(t){return new dt({key:new kt("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,s;if(r.button!==0||!e.editable)return!1;let a=r.target;const l=[];for(;a.nodeName!=="DIV";)l.push(a),a=a.parentNode;if(!l.find(m=>m.nodeName==="A"))return!1;const u=V6(e.state,t.type.name),c=r.target,f=(o=c==null?void 0:c.href)!==null&&o!==void 0?o:u.href,h=(s=c==null?void 0:c.target)!==null&&s!==void 0?s:u.target;return c&&f?(window.open(f,h),!0):!1}}})}function jU(t){return new dt({key:new kt("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:o}=e,{selection:s}=o,{empty:a}=s;if(a)return!1;let l="";r.content.forEach(c=>{l+=c.textContent});const u=Z8(l,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===l);return!l||!u?!1:t.editor.commands.setMark(t.type,{href:u.href})}}})}const qU=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Xs(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!t||t.replace(qU,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const KU=qn.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=>{if(typeof t=="string"){Y8(t);return}Y8(t.scheme,t.optionalSlashes)})},onDestroy(){$U()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Xs(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return 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=>!!Xs(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Xs(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",mt(this.options.HTMLAttributes,t),0]:["a",mt(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Xs(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Xs(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[ji({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,o=Z8(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!Xs(a,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(s=>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||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(UU({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!Xs(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(WU({type:this.type})),this.options.linkOnPaste&&t.push(jU({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}});function GU(t,e){return i.openBlock(),i.createElementBlock("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[i.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:"currentColor"})])}const Q8=i.defineComponent({__name:"Checkbox",props:{defaultChecked:{type:Boolean},checked:{type:[Boolean,String]},disabled:{type:Boolean},required:{type:Boolean},name:{},value:{},id:{},asChild:{type:Boolean},as:{},class:{}},emits:["update:checked"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>{const{class:a,...l}=n;return l}),s=Lt(o,r);return(a,l)=>(i.openBlock(),i.createBlock(i.unref(x7),i.mergeProps(i.unref(s),{class:i.unref($e)("peer h-4 w-4 shrink-0 rounded-sm border border-ed-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ed-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-ed-primary data-[state=checked]:text-ed-primary-foreground",n.class)}),{default:i.withCtx(()=>[i.createVNode(i.unref(C7),{class:"flex h-full w-full items-center justify-center text-current"},{default:i.withCtx(()=>[i.renderSlot(a.$slots,"default",{},()=>[i.createVNode(i.unref(GU),{class:"h-4 w-4"})])]),_:3})]),_:3},16,["class"]))}}),XU={class:"flex w-full max-w-sm items-center gap-1.5"},JU={class:"relative w-full max-w-sm items-center"},YU={class:"flex w-full max-w-sm items-center gap-1.5"},ZU={class:"relative w-full max-w-sm items-center"},QU={class:"absolute start-0 inset-y-0 flex items-center justify-center px-2"},NU={class:"flex items-center space-x-2 mt-1"},N8=i.defineComponent({__name:"LinkEditBlock",props:{editor:{}},emits:["onSetLink","onClickOutside"],setup(t,{emit:e}){const n=t,r=e,{t:o}=St();let s=i.reactive({text:"",link:""});const a=i.ref(null),{focused:l}=Ze.useFocus(a),u=i.ref(!1),c=i.ref(null);Ze.onClickOutside(c,h=>r("onClickOutside",h)),i.watchEffect(()=>{const{href:h,target:m}=n.editor.getAttributes("link"),{from:g,to:b}=n.editor.state.selection,y=n.editor.state.doc.textBetween(g,b," ");s={link:h,text:y},u.value=m==="_blank"});function f(){r("onSetLink",s.link,s.text,u.value)}return i.onMounted(()=>{l.value=!0}),(h,m)=>{const g=Q8;return i.openBlock(),i.createElementBlock("div",{ref_key:"target",ref:c,class:"p-2 bg-white rounded-lg dark:bg-black shadow-sm border border-neutral-200 dark:border-neutral-800"},[i.createElementVNode("form",{class:"flex flex-col gap-2",onSubmit:i.withModifiers(f,["prevent"])},[i.createVNode(i.unref(dd),null,{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.link.dialog.text")),1)]),_:1}),i.createElementVNode("div",XU,[i.createElementVNode("div",JU,[i.createVNode(i.unref(Ba),{modelValue:i.unref(s).text,"onUpdate:modelValue":m[0]||(m[0]=b=>i.unref(s).text=b),type:"text",required:"",class:"w-80",placeholder:"텍스트"},null,8,["modelValue"])])]),i.createVNode(i.unref(dd),null,{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.link.dialog.link")),1)]),_:1}),i.createElementVNode("div",YU,[i.createElementVNode("div",ZU,[i.createVNode(i.unref(Ba),{ref_key:"inputRef",ref:a,modelValue:i.unref(s).link,"onUpdate:modelValue":m[1]||(m[1]=b=>i.unref(s).link=b),type:"url",required:"",class:"pl-10"},null,8,["modelValue"]),i.createElementVNode("span",QU,[i.createVNode(i.unref(Kt),{class:"size-5 text-ed-muted-foreground",name:"Link"})])])]),i.createElementVNode("div",NU,[i.createVNode(g,{id:"openInNewTab",checked:u.value,"onUpdate:checked":m[2]||(m[2]=b=>u.value=b)},null,8,["checked"]),i.createVNode(i.unref(dd),{for:"openInNewTab"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.link.dialog.openInNewTab")),1)]),_:1})]),i.createVNode(i.unref(er),{type:"submit",class:"mt-2 self-end"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.link.dialog.button.apply")),1)]),_:1})],32)],512)}}}),eW=i.defineComponent({__name:"LinkEditPopover",props:{editor:{},icon:{default:void 0},title:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},shortcutKeys:{default:void 0},isActive:{type:Function,default:void 0},action:{type:Function,default:void 0}},setup(t){const e=t;function n(r,o,s){e.action&&e.action({link:r,text:o,openInNewTab:s})}return(r,o)=>(i.openBlock(),i.createBlock(i.unref(Oa),null,{default:i.withCtx(()=>[i.createVNode(i.unref(Ra),{disabled:r.disabled},{default:i.withCtx(()=>[i.createVNode(je,{icon:r.icon,tooltip:r.tooltip,"is-active":r.isActive,disabled:r.disabled},null,8,["icon","tooltip","is-active","disabled"])]),_:1},8,["disabled"]),i.createVNode(i.unref(Ma),{"hide-when-detached":"","as-child":"",class:"w-full",align:"start",side:"bottom"},{default:i.withCtx(()=>[i.createVNode(N8,{editor:r.editor,onOnSetLink:n},null,8,["editor"])]),_:1})]),_:1}))}}),dg=KU.extend({inclusive:!1,parseHTML(){return[{tag:'a[href]:not([data-type="button"]):not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:t}){return["a",mt(this.options.HTMLAttributes,t,{class:"link"}),0]},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),openOnClick:!0,button:({editor:e,t:n})=>({component:eW,componentProps:{action:r=>{const{link:o,text:s,openInNewTab:a}=r;e.chain().extendMarkRange("link").insertContent({type:"text",text:s,marks:[{type:"link",attrs:{href:o,target:a?"_blank":""}}]}).setLink({href:o}).focus().run()},isActive:()=>e.isActive("link")||!1,disabled:!e.can().setLink({href:""}),icon:"Link",tooltip:n("editor.link.tooltip")}})}},addProseMirrorPlugins(){return[new dt({props:{handleClick:(t,e)=>{const{schema:n,doc:r,tr:o}=t.state,s=Zd(r.resolve(e),n.marks.link);if(!s)return!1;const a=r.resolve(s.from),l=r.resolve(s.to),u=o.setSelection(new Ie(a,l));t.dispatch(u)}}})]}}),tW=Rt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",mt(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:r,$to:o}=n,s=t();return r.parentOffset===0?s.insertContentAt({from:Math.max(r.pos-1,0),to:o.pos},{type:this.name}):$6(n)?s.insertContentAt(o.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({tr:a,dispatch:l})=>{var u;if(l){const{$to:c}=a.selection,f=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?a.setSelection(Ie.create(a.doc,c.pos+1)):c.nodeAfter.isBlock?a.setSelection(Pe.create(a.doc,c.pos)):a.setSelection(Ie.create(a.doc,c.pos));else{const h=(u=c.parent.type.contentMatch.defaultType)===null||u===void 0?void 0:u.create();h&&(a.insert(f,h),a.setSelection(Ie.create(a.doc,f+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[U6({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}).extend({renderHTML(){return["div",mt(this.options.HTMLAttributes,{"data-type":this.name}),["hr"]]},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:n})=>({component:je,componentProps:{action:()=>e.commands.setHorizontalRule(),disabled:!e.can().setHorizontalRule(),icon:"Minus",shortcutKeys:["mod","alt","S"],tooltip:n("editor.horizontalrule.tooltip")}})}},addKeyboardShortcuts(){return{"Mod-Alt-s":()=>this.editor.commands.setHorizontalRule()}}});var rp=200,bn=function(){};bn.prototype.append=function(e){return e.length?(e=bn.from(e),!this.length&&e||e.length<rp&&this.leafAppend(e)||this.length<rp&&e.leafPrepend(this)||this.appendInner(e)):this},bn.prototype.prepend=function(e){return e.length?bn.from(e).append(this):this},bn.prototype.appendInner=function(e){return new nW(this,e)},bn.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?bn.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},bn.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},bn.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},bn.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(s,a){return o.push(e(s,a))},n,r),o},bn.from=function(e){return e instanceof bn?e:e&&e.length?new eC(e):bn.empty};var eC=function(t){function e(r){t.call(this),this.values=r}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,s){return o==0&&s==this.length?this:new e(this.values.slice(o,s))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,s,a,l){for(var u=s;u<a;u++)if(o(this.values[u],l+u)===!1)return!1},e.prototype.forEachInvertedInner=function(o,s,a,l){for(var u=s-1;u>=a;u--)if(o(this.values[u],l+u)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=rp)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=rp)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}(bn);bn.empty=new eC([]);var nW=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.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(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,o,s,a){var l=this.left.length;if(o<l&&this.left.forEachInner(r,o,Math.min(s,l),a)===!1||s>l&&this.right.forEachInner(r,Math.max(o-l,0),Math.min(this.length,s)-l,a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,s,a){var l=this.left.length;if(o>l&&this.right.forEachInvertedInner(r,o-l,Math.max(s,l)-l,a+l)===!1||s<l&&this.left.forEachInvertedInner(r,Math.min(o,l),s,a)===!1)return!1},e.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var s=this.left.length;return o<=s?this.left.slice(r,o):r>=s?this.right.slice(r-s,o-s):this.left.slice(r,s).append(this.right.slice(0,o-s))},e.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new e(o,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(bn);const rW=500;class no{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,s;n&&(o=this.remapping(r,this.items.length),s=o.maps.length);let a=e.tr,l,u,c=[],f=[];return this.items.forEach((h,m)=>{if(!h.step){o||(o=this.remapping(r,m+1),s=o.maps.length),s--,f.push(h);return}if(o){f.push(new Ao(h.map));let g=h.step.map(o.slice(s)),b;g&&a.maybeStep(g).doc&&(b=a.mapping.maps[a.mapping.maps.length-1],c.push(new Ao(b,void 0,void 0,c.length+f.length))),s--,b&&o.appendMap(b,s)}else a.maybeStep(h.step);if(h.selection)return l=o?h.selection.map(o.slice(s)):h.selection,u=new no(this.items.slice(0,r).append(f.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:a,selection:l}}addTransform(e,n,r,o){let s=[],a=this.eventCount,l=this.items,u=!o&&l.length?l.get(l.length-1):null;for(let f=0;f<e.steps.length;f++){let h=e.steps[f].invert(e.docs[f]),m=new Ao(e.mapping.maps[f],h,n),g;(g=u&&u.merge(m))&&(m=g,f?s.pop():l=l.slice(0,l.length-1)),s.push(m),n&&(a++,n=void 0),o||(u=m)}let c=a-r.depth;return c>iW&&(l=oW(l,c),a-=c),new no(l.append(s),a)}remapping(e,n){let r=new lu;return this.items.forEach((o,s)=>{let a=o.mirrorOffset!=null&&s-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,a)},e,n),r}addMaps(e){return this.eventCount==0?this:new no(this.items.append(e.map(n=>new Ao(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),s=e.mapping,a=e.steps.length,l=this.eventCount;this.items.forEach(m=>{m.selection&&l--},o);let u=n;this.items.forEach(m=>{let g=s.getMirror(--u);if(g==null)return;a=Math.min(a,g);let b=s.maps[g];if(m.step){let y=e.steps[g].invert(e.docs[g]),w=m.selection&&m.selection.map(s.slice(u+1,g));w&&l++,r.push(new Ao(b,y,w))}else r.push(new Ao(b))},o);let c=[];for(let m=n;m<a;m++)c.push(new Ao(s.maps[m]));let f=this.items.slice(0,o).append(c).append(r),h=new no(f,l);return h.emptyItemCount()>rW&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],s=0;return this.items.forEach((a,l)=>{if(l>=e)o.push(a),a.selection&&s++;else if(a.step){let u=a.step.map(n.slice(r)),c=u&&u.getMap();if(r--,c&&n.appendMap(c,r),u){let f=a.selection&&a.selection.map(n.slice(r));f&&s++;let h=new Ao(c.invert(),u,f),m,g=o.length-1;(m=o.length&&o[g].merge(h))?o[g]=m:o.push(h)}}else a.map&&r--},this.items.length,0),new no(bn.from(o.reverse()),s)}}no.empty=new no(bn.empty,0);function oW(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}class Ao{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Ao(n.getMap().invert(),n,this.selection)}}}class Qi{constructor(e,n,r,o,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=s}}const iW=20;function sW(t,e,n,r){let o=n.getMeta(Js),s;if(o)return o.historyState;n.getMeta(uW)&&(t=new Qi(t.done,t.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(a&&a.getMeta(Js))return a.getMeta(Js).redo?new Qi(t.done.addTransform(n,void 0,r,op(e)),t.undone,tC(n.mapping.maps),t.prevTime,t.prevComposition):new Qi(t.done,t.undone.addTransform(n,void 0,r,op(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),u=t.prevTime==0||!a&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!aW(n,t.prevRanges)),c=a?fg(t.prevRanges,n.mapping):tC(n.mapping.maps);return new Qi(t.done.addTransform(n,u?e.selection.getBookmark():void 0,r,op(e)),no.empty,c,n.time,l??t.prevComposition)}else return(s=n.getMeta("rebased"))?new Qi(t.done.rebased(n,s),t.undone.rebased(n,s),fg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Qi(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),fg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function aW(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&o>=e[s]&&(n=!0)}),n}function tC(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,o,s,a)=>e.push(s,a));return e}function fg(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),s=e.map(t[r+1],-1);o<=s&&n.push(o,s)}return n}function lW(t,e,n){let r=op(e),o=Js.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let a=s.selection.resolve(s.transform.doc),l=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),o,r),u=new Qi(n?l:s.remaining,n?s.remaining:l,null,0,-1);return s.transform.setSelection(a).setMeta(Js,{redo:n,historyState:u})}let pg=!1,nC=null;function op(t){let e=t.plugins;if(nC!=e){pg=!1,nC=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){pg=!0;break}}return pg}const Js=new kt("history"),uW=new kt("closeHistory");function cW(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new dt({key:Js,state:{init(){return new Qi(no.empty,no.empty,null,0,-1)},apply(e,n,r){return sW(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?oC:r=="historyRedo"?iC:null;return o?(n.preventDefault(),o(e.state,e.dispatch)):!1}}}})}function rC(t,e){return(n,r)=>{let o=Js.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let s=lW(o,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const oC=rC(!1,!0),iC=rC(!0,!0),dW=at.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>oC(t,e),redo:()=>({state:t,dispatch:e})=>iC(t,e)}},addProseMirrorPlugins(){return[cW(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()}}}),sC={HISTORY_TRANSACTION:"history$",ADD_TO_HISTORY_TRANSACTION:"addToHistory"},hg=dW.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),depth:10,button:({editor:e,t:n})=>["undo","redo"].map(o=>({component:je,componentProps:{action:()=>{o==="undo"&&e.commands.undo(),o==="redo"&&e.commands.redo()},shortcutKeys:o==="undo"?["mod","Z"]:["shift","mod","Z"],disabled:!e.can()[o](),icon:o==="undo"?"Undo2":"Redo2",tooltip:n(`editor.${o}.tooltip`)}}))}}}),{isFullscreen:mg,toggleFullscreen:gg}=tr(),fW=at.create({name:"fullscreen",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,extension:n,t:r})=>({component:je,componentProps:{tooltip:mg.value?r("editor.fullscreen.tooltip.exit"):r("editor.fullscreen.tooltip.fullscreen"),action:()=>gg(),icon:mg.value?"Minimize":"Maximize",isActive:()=>mg.value}})}},addKeyboardShortcuts(){return{F11:()=>(gg(),!0),"Mod-F11":()=>(gg(),!0)}}}),pW=at.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{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 r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}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 dt({key:new kt("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const o=this.options.limit;if(o==null||o===0){t=!0;return}const s=this.storage.characters({node:r.doc});if(s>o){const a=s-o,l=0,u=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const c=r.tr.deleteRange(l,u);return t=!0,c}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const o=this.storage.characters({node:n.doc}),s=this.storage.characters({node:e.doc});if(s<=r||o>r&&s>r&&s<=o)return!0;if(o>r&&s>r&&s>o||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,u=s-r,c=l-u,f=l;return e.deleteRange(c,f),!(this.storage.characters({node:e.doc})>r)}})]}});function hW(t={}){return new dt({view(e){return new mW(e,t)}})}class mW{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let s=a=>{this[o](a)};return e.dom.addEventListener(o,s),{name:o,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=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let l=e.nodeBefore,u=e.nodeAfter;if(l||u){let c=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(c){let f=c.getBoundingClientRect(),h=l?f.bottom:f.top;l&&u&&(h=(h+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:f.left,right:f.right,top:h-this.width/2,bottom:h+this.width/2}}}}if(!r){let l=this.editorView.coordsAtPos(this.cursorPos);r={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let o=this.editorView.dom.offsetParent;this.element||(this.element=o.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let s,a;if(!o||o==document.body&&getComputedStyle(o).position=="static")s=-pageXOffset,a=-pageYOffset;else{let l=o.getBoundingClientRect();s=l.left-o.scrollLeft,a=l.top-o.scrollTop}this.element.style.left=r.left-s+"px",this.element.style.top=r.top-a+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"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}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,s=typeof o=="function"?o(this.editorView,n,e):o;if(n&&!s){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=P4(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){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const gW=at.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[hW(this.options)]}}),bW=at.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new dt({key:new kt("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=e,s=[];if(!n||!r)return ht.create(t,[]);let a=0;this.options.mode==="deepest"&&t.descendants((u,c)=>{if(u.isText)return;if(!(o>=c&&o<=c+u.nodeSize-1))return!1;a+=1});let l=0;return t.descendants((u,c)=>{if(u.isText||!(o>=c&&o<=c+u.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&a-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";s.push(Yt.node(c,c+u.nodeSize,{class:this.options.className}))}),ht.create(t,s)}}})]}});class nn extends Ve{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return nn.valid(r)?new nn(r):Ve.near(r)}content(){return xe.empty}eq(e){return e instanceof nn&&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 nn(e.resolve(n.pos))}getBookmark(){return new bg(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!vW(e)||!yW(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&nn.valid(e))return e;let o=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}else if(a==0)return null;o+=n;let u=e.doc.resolve(o);if(nn.valid(u))return u}for(;;){let a=n>0?s.firstChild:s.lastChild;if(!a){if(s.isAtom&&!s.isText&&!Pe.isSelectable(s)){e=e.doc.resolve(o+s.nodeSize*n),r=!1;continue e}break}s=a,o+=n;let l=e.doc.resolve(o);if(nn.valid(l))return l}return null}}}nn.prototype.visible=!1,nn.findFrom=nn.findGapCursorFrom,Ve.jsonID("gapcursor",nn);class bg{constructor(e){this.pos=e}map(e){return new bg(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return nn.valid(n)?new nn(n):Ve.near(n)}}function vW(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function yW(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function wW(){return new dt({props:{decorations:_W,createSelectionBetween(t,e,n){return e.pos==n.pos&&nn.valid(n)?new nn(n):null},handleClick:CW,handleKeyDown:xW,handleDOMEvents:{beforeinput:EW}}})}const xW=W0({ArrowLeft:ip("horiz",-1),ArrowRight:ip("horiz",1),ArrowUp:ip("vert",-1),ArrowDown:ip("vert",1)});function ip(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,s){let a=r.selection,l=e>0?a.$to:a.$from,u=a.empty;if(a instanceof Ie){if(!s.endOfTextblock(n)||l.depth==0)return!1;u=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=nn.findGapCursorFrom(l,e,u);return c?(o&&o(r.tr.setSelection(new nn(c))),!0):!1}}function CW(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!nn.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&Pe.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new nn(r))),!0)}function EW(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof nn))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=ue.empty;for(let a=r.length-1;a>=0;a--)o=ue.from(r[a].createAndFill(null,o));let s=t.state.tr.replace(n.pos,n.pos,new xe(o,0,0));return s.setSelection(Ie.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function _W(t){if(!(t.selection instanceof nn))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ht.create(t.doc,[Yt.widget(t.selection.head,e,{key:"gapcursor"})])}const SW=at.create({name:"gapCursor",addProseMirrorPlugins(){return[wW()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=st(Be(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),kW=Rt.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",mt(this.options.HTMLAttributes,t)]},renderText(){return`
248
- `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:o,storedMarks:s}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:l}=r.extensionManager,u=s||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:f})=>{if(f&&u&&a){const h=u.filter(m=>l.includes(m.type.name));c.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),TW=Rt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",mt(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),aC=Rt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",mt(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),AW=at.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new dt({key:new kt("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,o=[];if(!n)return null;const s=this.editor.isEmpty;return t.descendants((a,l)=>{const u=r>=l&&r<=l+a.nodeSize,c=!a.isLeaf&&of(a);if((u||!this.options.showOnlyCurrent)&&c){const f=[this.options.emptyNodeClass];s&&f.push(this.options.emptyEditorClass);const h=Yt.node(l,l+a.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:l,hasAnchor:u}):this.options.placeholder});o.push(h)}return this.options.includeChildren}),ht.create(t,o)}}})]}}),lC=Rt.create({name:"text",group:"inline"}),uC=Rt.create({name:"doc",topNode:!0,content:"block+"}),cC=uC.extend({content(){var e;return!!((e=this.editor)!=null&&e.options.extensions.find(n=>n.name==="columns"))?"(block|columns)+":"block+"}}),OW=at.create({name:"selection",addProseMirrorPlugins(){const{editor:t}=this;return[new dt({key:new kt("selection"),props:{decorations(e){return e.selection.empty?null:ht.create(e.doc,[Yt.inline(e.selection.from,e.selection.to,{class:"selection"})])}}})]}}),MW=t=>{const e=["size-small","size-medium","size-large"],n=["SizeS","SizeM","SizeL"];return e.map((r,o)=>({type:`video-${r}`,component:je,componentProps:{tooltip:`editor.${r.replace("-",".")}.tooltip`,icon:n[o],action:()=>t.commands.updateVideo({width:gf[r]}),isActive:()=>t.isActive("video",{width:gf[r]})}}))},BW=t=>[...MW(t),{type:"remove",component:je,componentProps:{tooltip:"editor.remove",icon:"Trash2",action:()=>{const{state:e,dispatch:n}=t.view;Cu(e,n)}}}],RW=(t,e,{editor:n,extension:r,t:o})=>{const{extensions:s=[]}=n.extensionManager,a={};for(const l of Object.keys(t)){const u=t[l];if(!u)continue;const c=[];for(const m of u){if(m==="divider"){const y=c[c.length-1];if((y==null?void 0:y.type)==="divider")continue;c.push({type:"divider",component:void 0,componentProps:{}});continue}const g=e.find(y=>y.type===m);if(g){c.push({...g,componentProps:{...g.componentProps,tooltip:g.componentProps.tooltip?o(g.componentProps.tooltip):void 0},componentSlots:g.componentSlots});continue}const b=s.find(y=>y.name===m);if(b){const{button:y}=b.options,w=y({editor:n,extension:b,t:o});c.push({type:m,component:w.component,componentProps:w.componentProps,componentSlots:w.componentSlots});continue}}const f=c[c.length-1],h=c[0];(f==null?void 0:f.type)==="divider"&&c.pop(),(h==null?void 0:h.type)==="divider"&&c.shift(),a[l]=c}return a},IW=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),LW=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var vg;const PW=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),DW=(vg=String.fromCodePoint)!==null&&vg!==void 0?vg:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function FW(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=PW.get(t))!==null&&e!==void 0?e:t}var vn;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(vn||(vn={}));const VW=32;var Ni;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Ni||(Ni={}));function yg(t){return t>=vn.ZERO&&t<=vn.NINE}function $W(t){return t>=vn.UPPER_A&&t<=vn.UPPER_F||t>=vn.LOWER_A&&t<=vn.LOWER_F}function zW(t){return t>=vn.UPPER_A&&t<=vn.UPPER_Z||t>=vn.LOWER_A&&t<=vn.LOWER_Z||yg(t)}function HW(t){return t===vn.EQUALS||zW(t)}var yn;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(yn||(yn={}));var es;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(es||(es={}));class UW{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=yn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=es.Strict}startEntity(e){this.decodeMode=e,this.state=yn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case yn.EntityStart:return e.charCodeAt(n)===vn.NUM?(this.state=yn.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=yn.NamedEntity,this.stateNamedEntity(e,n));case yn.NumericStart:return this.stateNumericStart(e,n);case yn.NumericDecimal:return this.stateNumericDecimal(e,n);case yn.NumericHex:return this.stateNumericHex(e,n);case yn.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|VW)===vn.LOWER_X?(this.state=yn.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=yn.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,o){if(n!==r){const s=r-n;this.result=this.result*Math.pow(o,s)+Number.parseInt(e.substr(n,s),o),this.consumed+=s}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const o=e.charCodeAt(n);if(yg(o)||$W(o))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const o=e.charCodeAt(n);if(yg(o))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===vn.SEMI)this.consumed+=1;else if(this.decodeMode===es.Strict)return 0;return this.emitCodePoint(FW(this.result),this.consumed),this.errors&&(e!==vn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let o=r[this.treeIndex],s=(o&Ni.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const a=e.charCodeAt(n);if(this.treeIndex=WW(r,o,this.treeIndex+Math.max(1,s),a),this.treeIndex<0)return this.result===0||this.decodeMode===es.Attribute&&(s===0||HW(a))?0:this.emitNotTerminatedNamedEntity();if(o=r[this.treeIndex],s=(o&Ni.VALUE_LENGTH)>>14,s!==0){if(a===vn.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==es.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,o=(r[n]&Ni.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:o}=this;return this.emitCodePoint(n===1?o[e]&~Ni.VALUE_LENGTH:o[e+1],r),n===3&&this.emitCodePoint(o[e+2],r),r}end(){var e;switch(this.state){case yn.NamedEntity:return this.result!==0&&(this.decodeMode!==es.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case yn.NumericDecimal:return this.emitNumericEntity(0,2);case yn.NumericHex:return this.emitNumericEntity(0,3);case yn.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case yn.EntityStart:return 0}}}function dC(t){let e="";const n=new UW(t,r=>e+=DW(r));return function(o,s){let a=0,l=0;for(;(l=o.indexOf("&",l))>=0;){e+=o.slice(a,l),n.startEntity(s);const c=n.write(o,l+1);if(c<0){a=l+n.end();break}a=l+c,l=c===0?a+1:a}const u=e+o.slice(a);return e="",u}}function WW(t,e,n,r){const o=(e&Ni.BRANCH_LENGTH)>>7,s=e&Ni.JUMP_TABLE;if(o===0)return s!==0&&r===s?n:-1;if(s){const u=r-s;return u<0||u>=o?-1:t[n+u]-1}let a=n,l=a+o-1;for(;a<=l;){const u=a+l>>>1,c=t[u];if(c<r)a=u+1;else if(c>r)l=u-1;else return t[u+o]}return-1}const jW=dC(IW);dC(LW);function qW(t,e=es.Legacy){return jW(t,e)}var Qt;(function(t){t.Attribute="attribute",t.Pseudo="pseudo",t.PseudoElement="pseudo-element",t.Tag="tag",t.Universal="universal",t.Adjacent="adjacent",t.Child="child",t.Descendant="descendant",t.Parent="parent",t.Sibling="sibling",t.ColumnCombinator="column-combinator"})(Qt||(Qt={}));var Dr;(function(t){t.Any="any",t.Element="element",t.End="end",t.Equals="equals",t.Exists="exists",t.Hyphen="hyphen",t.Not="not",t.Start="start"})(Dr||(Dr={}));const fC=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,KW=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,GW=new Map([[126,Dr.Element],[94,Dr.Start],[36,Dr.End],[42,Dr.Any],[33,Dr.Not],[124,Dr.Hyphen]]),XW=new Set(["has","not","matches","is","where","host","host-context"]);function JW(t){switch(t.type){case Qt.Adjacent:case Qt.Child:case Qt.Descendant:case Qt.Parent:case Qt.Sibling:case Qt.ColumnCombinator:return!0;default:return!1}}const YW=new Set(["contains","icontains"]);function ZW(t,e,n){const r=parseInt(e,16)-65536;return r!==r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,r&1023|56320)}function Qu(t){return t.replace(KW,ZW)}function wg(t){return t===39||t===34}function pC(t){return t===32||t===9||t===10||t===12||t===13}function QW(t){const e=[],n=hC(e,`${t}`,0);if(n<t.length)throw new Error(`Unmatched selector: ${t.slice(n)}`);return e}function hC(t,e,n){let r=[];function o(m){const g=e.slice(n+m).match(fC);if(!g)throw new Error(`Expected name, found ${e.slice(n)}`);const[b]=g;return n+=m+b.length,Qu(b)}function s(m){for(n+=m;n<e.length&&pC(e.charCodeAt(n));)n++}function a(){n+=1;const m=n;let g=1;for(;g>0&&n<e.length;n++)e.charCodeAt(n)===40&&!l(n)?g++:e.charCodeAt(n)===41&&!l(n)&&g--;if(g)throw new Error("Parenthesis not matched");return Qu(e.slice(m,n-1))}function l(m){let g=0;for(;e.charCodeAt(--m)===92;)g++;return(g&1)===1}function u(){if(r.length>0&&JW(r[r.length-1]))throw new Error("Did not expect successive traversals.")}function c(m){if(r.length>0&&r[r.length-1].type===Qt.Descendant){r[r.length-1].type=m;return}u(),r.push({type:m})}function f(m,g){r.push({type:Qt.Attribute,name:m,action:g,value:o(1),namespace:null,ignoreCase:"quirks"})}function h(){if(r.length&&r[r.length-1].type===Qt.Descendant&&r.pop(),r.length===0)throw new Error("Empty sub-selector");t.push(r)}if(s(0),e.length===n)return n;e:for(;n<e.length;){const m=e.charCodeAt(n);switch(m){case 32:case 9:case 10:case 12:case 13:{(r.length===0||r[0].type!==Qt.Descendant)&&(u(),r.push({type:Qt.Descendant})),s(1);break}case 62:{c(Qt.Child),s(1);break}case 60:{c(Qt.Parent),s(1);break}case 126:{c(Qt.Sibling),s(1);break}case 43:{c(Qt.Adjacent),s(1);break}case 46:{f("class",Dr.Element);break}case 35:{f("id",Dr.Equals);break}case 91:{s(1);let g,b=null;e.charCodeAt(n)===124?g=o(1):e.startsWith("*|",n)?(b="*",g=o(2)):(g=o(0),e.charCodeAt(n)===124&&e.charCodeAt(n+1)!==61&&(b=g,g=o(1))),s(0);let y=Dr.Exists;const w=GW.get(e.charCodeAt(n));if(w){if(y=w,e.charCodeAt(n+1)!==61)throw new Error("Expected `=`");s(2)}else e.charCodeAt(n)===61&&(y=Dr.Equals,s(1));let x="",_=null;if(y!=="exists"){if(wg(e.charCodeAt(n))){const k=e.charCodeAt(n);let A=n+1;for(;A<e.length&&(e.charCodeAt(A)!==k||l(A));)A+=1;if(e.charCodeAt(A)!==k)throw new Error("Attribute value didn't end");x=Qu(e.slice(n+1,A)),n=A+1}else{const k=n;for(;n<e.length&&(!pC(e.charCodeAt(n))&&e.charCodeAt(n)!==93||l(n));)n+=1;x=Qu(e.slice(k,n))}s(0);const C=e.charCodeAt(n)|32;C===115?(_=!1,s(1)):C===105&&(_=!0,s(1))}if(e.charCodeAt(n)!==93)throw new Error("Attribute selector didn't terminate");n+=1;const S={type:Qt.Attribute,name:g,action:y,value:x,namespace:b,ignoreCase:_};r.push(S);break}case 58:{if(e.charCodeAt(n+1)===58){r.push({type:Qt.PseudoElement,name:o(2).toLowerCase(),data:e.charCodeAt(n)===40?a():null});continue}const g=o(1).toLowerCase();let b=null;if(e.charCodeAt(n)===40)if(XW.has(g)){if(wg(e.charCodeAt(n+1)))throw new Error(`Pseudo-selector ${g} cannot be quoted`);if(b=[],n=hC(b,e,n+1),e.charCodeAt(n)!==41)throw new Error(`Missing closing parenthesis in :${g} (${e})`);n+=1}else{if(b=a(),YW.has(g)){const y=b.charCodeAt(0);y===b.charCodeAt(b.length-1)&&wg(y)&&(b=b.slice(1,-1))}b=Qu(b)}r.push({type:Qt.Pseudo,name:g,data:b});break}case 44:{h(),r=[],s(1);break}default:{if(e.startsWith("/*",n)){const y=e.indexOf("*/",n+2);if(y<0)throw new Error("Comment was not terminated");n=y+2,r.length===0&&s(0);break}let g=null,b;if(m===42)n+=1,b="*";else if(m===124){if(b="",e.charCodeAt(n+1)===124){c(Qt.ColumnCombinator),s(2);break}}else if(fC.test(e.slice(n)))b=o(0);else break e;e.charCodeAt(n)===124&&e.charCodeAt(n+1)!==124&&(g=b,e.charCodeAt(n+1)===42?(b="*",n+=2):b=o(1)),r.push(b==="*"?{type:Qt.Universal,namespace:g}:{type:Qt.Tag,name:b,namespace:g})}}}return h(),n}function xg(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/\xA0/g,"&nbsp;").replace(/\xAD/g,"&shy;")}var mC=t=>qW(t);function NW(t,e,n,r){if(typeof e=="function")return e({props:{...n,children:r},attrs:n,children:r,h:t.h,context:t});{let o=!0,s;if(e?e.toLowerCase()==="fragment"?(s=t.document.createDocumentFragment(),o=!1):s=t.document.createElement(e):s=t.document.createElement("div"),n&&o){const a=s;for(let[l,u]of Object.entries(n)){l=l.toString();const c=l.toLowerCase();c==="classname"?a.className=u:c==="on"?Object.entries(u).forEach(([f,h])=>{a.setAttribute(`on${f}`,String(h))}):u!==!1&&u!=null&&(u===!0?a.setAttribute(l,l):a.setAttribute(l,u.toString()))}}if(r)for(const a of r){const l=Array.isArray(a)?[...a]:[a];for(const u of l)u&&u!==!1&&u!=null&&(typeof u!="object"?s.appendChild(t.document.createTextNode(u.toString())):s.appendChild(u))}return s}}function gC(t,e,...n){return typeof t=="object"&&(t="fragment",n=t.children,e=t.attrs),Array.isArray(e)?(n=[e],e={}):e?e.attrs&&(e={...e.attrs,...e},delete e.attrs):e={},{tag:t,attrs:e,children:typeof n[0]=="string"?n:n.flat(Number.POSITIVE_INFINITY)}}function ej(t){return t.h=function(n,r,...o){const{tag:s,attrs:a,children:l}=gC(n,r,o);return NW(t,s,a,l)},t.h}var bC={};function tj(t){let e=bC[t];return e==null&&(e=QW(t),bC[t]=e),e}function nj(t,e,{debug:n=!1}={}){for(const r of tj(t)){const o=(s,a)=>{var u,c,f,h;let l=!1;for(const m of a){const{type:g,name:b,action:y,value:w,_ignoreCase:x=!0,data:_}=m;if(g==="attribute")y==="equals"?l=s.getAttribute(b)===w:y==="start"?l=!!((u=s.getAttribute(b))!=null&&u.startsWith(w)):y==="end"?l=!!((c=s.getAttribute(b))!=null&&c.endsWith(w)):y==="element"?b==="class"?l=s.classList.contains(w):l=!!((f=s.getAttribute(b))!=null&&f.includes(w)):y==="exists"?l=s.hasAttribute(b):y==="any"?l=!!((h=s.getAttribute(b))!=null&&h.includes(w)):console.warn("Unknown CSS selector action",y);else if(g==="tag")l=s.tagName===b.toUpperCase();else if(g==="universal")l=!0;else if(g==="pseudo"){if(b==="not"){let S=!0;_.forEach(C=>{o(s,C)||(S=!1)}),l=!S}}else console.warn("Unknown CSS selector type",g,t,a);if(!l)break}return l};if(o(e,r))return!0}return!1}var rj=Symbol.for("nodejs.util.inspect.custom"),vC={fontWeight:"bold"},yC={fontStyle:"italic"},wC={backgroundColor:"rgb(255, 250, 165)"},xC={textDecorations:"underline"},Cg={textDecorations:"line-through"},oj={b:vC,strong:vC,em:yC,i:yC,mark:wC,u:xC,a:xC,s:Cg,del:Cg,ins:wC,strike:Cg};function CC(t){return t.toLowerCase().replace(/[^a-z0-9]+(.)/gi,(e,n)=>n.toUpperCase())}var ni=class _h{constructor(){this.append=this.appendChild,this._parentNode=null,this._childNodes=[]}get nodeType(){return console.error("Subclasses should define nodeType!"),0}get nodeName(){return console.error("Subclasses should define nodeName!"),""}get nodeValue(){return null}cloneNode(e=!1){const n=new this.constructor;return e&&(n._childNodes=this._childNodes.map(r=>r.cloneNode(!0)),n._fixChildNodesParent()),n}_fixChildNodesParent(){this._childNodes.forEach(e=>e._parentNode=this)}insertBefore(e,n){if(e!==n){let r=n?this._childNodes.indexOf(n):0;r<0&&(r=0),this._childNodes.splice(r,0,e),this._fixChildNodesParent()}}appendChild(e){if(e!=null){if(e===this){console.warn("Cannot appendChild to self");return}if(e instanceof _g&&console.warn("No defined how to append a document to a node!",e),e instanceof Eg)for(const n of[...e._childNodes])this.appendChild(n);else if(Array.isArray(e))for(const n of[...e])this.appendChild(n);else if(e instanceof _h)e.remove(),this._childNodes.push(e);else try{const n=typeof e=="string"?e:JSON.stringify(e,null,2);this._childNodes.push(new dl(n))}catch(n){console.error(`The data ${e} to be added to ${this.render()} is problematic: ${n}`)}this._fixChildNodesParent()}}removeChild(e){const n=this._childNodes.indexOf(e);n>=0&&(e._parentNode=null,this._childNodes.splice(n,1),this._fixChildNodesParent())}remove(){var e;return(e=this==null?void 0:this.parentNode)==null||e.removeChild(this),this}replaceChildren(...e){this._childNodes=e.map(n=>typeof n=="string"?new dl(n):n.remove()),this._fixChildNodesParent()}replaceWith(...e){const n=this._parentNode;if(n){const r=this._indexInParent();r>=0&&(e=e.map(o=>typeof o=="string"?new dl(o):o.remove()),n._childNodes.splice(r,1,...e),this._parentNode=null,n._fixChildNodesParent())}}_indexInParent(){return this._parentNode?this._parentNode.childNodes.indexOf(this):-1}get parentNode(){return this._parentNode}get childNodes(){return this._childNodes||[]}get children(){return this._childNodes||[]}get firstChild(){return this._childNodes[0]}get lastChild(){return this._childNodes[this._childNodes.length-1]}get nextSibling(){const e=this._indexInParent();return e!=null&&this.parentNode.childNodes[e+1]||null}get previousSibling(){const e=this._indexInParent();return e>0&&this.parentNode.childNodes[e-1]||null}flatten(){const e=[];this instanceof ro&&e.push(this);for(const n of this._childNodes)e.push(...n.flatten());return e}flattenNodes(){const e=[];e.push(this);for(const n of this._childNodes)e.push(...n.flattenNodes());return e}render(){return""}get textContent(){return this._childNodes.map(e=>e.textContent).join("")}set textContent(e){this._childNodes=[],e&&this.appendChild(new dl(e.toString()))}contains(e){return e===this?!0:this._childNodes.some(n=>n.contains(e))}get ownerDocument(){var e;return this.nodeType===_h.DOCUMENT_NODE||this.nodeType===_h.DOCUMENT_FRAGMENT_NODE?this:(e=this==null?void 0:this._parentNode)==null?void 0:e.ownerDocument}toString(){return`${this.nodeName}`}[rj](){return`${this.constructor.name} "${this.render()}"`}};ni.ELEMENT_NODE=1,ni.TEXT_NODE=3,ni.CDATA_SECTION_NODE=4,ni.PROCESSING_INSTRUCTION_NODE=7,ni.COMMENT_NODE=8,ni.DOCUMENT_NODE=9,ni.DOCUMENT_TYPE_NODE=10,ni.DOCUMENT_FRAGMENT_NODE=11;var ts=ni,dl=class extends ts{get nodeType(){return ts.TEXT_NODE}get nodeName(){return"#text"}get nodeValue(){return this._text||""}get textContent(){return this.nodeValue}constructor(t=""){super(),this._text=t}render(){var e;const t=(e=this.parentNode)==null?void 0:e.tagName;return t==="SCRIPT"||t==="STYLE"?this._text:xg(this._text)}cloneNode(t=!1){const e=super.cloneNode(t);return e._text=this._text,e}},EC=class extends ts{getElementById(t){return this.flatten().find(e=>e._attributes.id===t)}getElementsByClassName(t){return this.flatten().filter(e=>e.classList.contains(t))}matches(t){return nj(t,this)}querySelectorAll(t){return this.flatten().filter(e=>e.matches(t))}querySelector(t){return this.flatten().find(e=>e.matches(t))}parent(t){var e;return this.matches(t)?this:this.parentNode==null?null:(e=this.parentNode)==null?void 0:e.parent(t)}handle(t,e){let n=0;for(const r of this.querySelectorAll(t))e(r,n++)}},ro=class extends EC{get nodeType(){return ts.ELEMENT_NODE}get nodeName(){return this._nodeName}constructor(t="div",e={}){super(),this._originalTagName=t,this._nodeName=(t||"").toUpperCase(),this._attributes=e||{}}cloneNode(t=!1){const e=super.cloneNode(t);return e._originalTagName=this._originalTagName,e._nodeName=this._nodeName,e._attributes=Object.assign({},this._attributes),e}get attributes(){return Object.entries(this._attributes).map(([t,e])=>({name:t,value:e}))}get attributesObject(){return{...this._attributes}}_findAttributeName(t){const e=t.toLowerCase();return Object.keys(this._attributes).find(n=>e===n.toLowerCase())||null}setAttribute(t,e){this.removeAttribute(t),this._attributes[t]=e,this._styles=void 0,this._dataset=void 0}getAttribute(t){const e=this._findAttributeName(t),n=e?this._attributes[e]:null;return n==null?null:typeof n=="string"?n:""}removeAttribute(t){this._findAttributeName(String(t))&&delete this._attributes[t]}hasAttribute(t){const e=this._findAttributeName(t);return e?this._attributes[e]!=null:!1}get style(){if(this._styles==null){const t={};let e=0;const n=this.getAttribute("style");if(n){let r;const o=/\s*([\w-]+)\s*:\s*((url\(.*?\)[^;]*|[^;]+))/gi;for(;r=o.exec(n);){++e;const s=r[1],a=r[2].trim();t[s]=a,t[CC(s)]=a}}this._styles={get length(){return e},getPropertyValue(r){return t[r]},...oj[this.tagName.toLowerCase()],...t}}return this._styles}get dataset(){if(this._dataset==null){const t={};for(const[e,n]of Object.entries(this._attributes))e.startsWith("data-")&&(t[e.slice(5)]=n,t[CC(e.slice(5))]=n);this._dataset=t}return this._dataset}get tagName(){return this._nodeName}setTagName(t){this._nodeName=t.toUpperCase()}get id(){return this._attributes.id||null}set id(t){t==null?delete this._attributes.id:this._attributes.id=t}get src(){return this._attributes.src}set src(t){t==null?delete this._attributes.src:this._attributes.src=t}getElementsByTagName(t){t=t.toUpperCase();const e=this.flatten();return t!=="*"?e.filter(n=>n.tagName===t):e}setInnerHTML(t){}get innerHTML(){return this._childNodes.map(t=>t.render(sp)).join("")}set innerHTML(t){this.setInnerHTML(t)}get outerHTML(){return this.render(ap)}get className(){return this._attributes.class||""}set className(t){Array.isArray(t)?t=t.filter(e=>!!e).join(" "):typeof t=="object"&&(t=Object.entries(t).filter(([e,n])=>!!n).map(([e,n])=>e).join(" ")),this._attributes.class=t}get classList(){const t=String(this.className??"").trim().split(/\s+/g)||[];return{contains(e){return t.includes(e)},add:e=>{t.includes(e)||(t.push(e),this.className=t)},remove:e=>{const n=t.indexOf(e);n>=0&&(t.splice(n,1),this.className=t)}}}render(t=ap){return t(this._originalTagName||this.tagName,this._attributes,this._childNodes.map(e=>e.render(t)).join(""))}},_C=class ik extends ts{get nodeName(){return super.nodeName}get nodeValue(){return super.nodeValue}get nodeType(){return ik.DOCUMENT_TYPE_NODE}render(){return"<!DOCTYPE html>"}},Eg=class sk extends EC{get nodeType(){return ts.DOCUMENT_FRAGMENT_NODE}get nodeName(){return"#document-fragment"}render(e=ap){return this._childNodes.map(n=>n.render(e)||[]).join("")}get innerHTML(){return this._childNodes.map(e=>e.render(sp)).join("")}createElement(e,n={}){return new ro(e,n)}createDocumentFragment(){return new sk}createTextNode(e){return new dl(e)}},_g=class extends Eg{get nodeType(){return ts.DOCUMENT_NODE}get nodeName(){return"#document"}get documentElement(){return this.firstChild}render(t=ap){let e=super.render(t);return this.docType&&(e=this.docType.render()+e),e}},SC=class extends _g{constructor(t=!1){if(super(),this.docType=new _C,!t){const e=new ro("html"),n=new ro("body"),r=new ro("head"),o=new ro("title");e.appendChild(r),r.appendChild(o),e.appendChild(n),this.appendChild(e)}}get body(){let t=this.querySelector("body");if(!t){let e=this.querySelector("html");e||(e=new ro("html"),this.appendChild(e)),t=new ro("body"),e.appendChild(e)}return t}get title(){var t;return((t=this.querySelector("title"))==null?void 0:t.textContent)||""}set title(t){const e=this.querySelector("title");e&&(e.textContent=t)}get head(){let t=this.querySelector("head");if(!t){let e=this.querySelector("html");e||(e=new ro("html"),this.appendChild(e)),t=new ro("head"),e.insertBefore(e)}return t}};function ij(){return new _g}function sj(){return new SC}var kC=ij();ej({document:kC});var aj={},lj=aj.hasOwnProperty;function TC(t,e){return lj.call(t,e)}var AC=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr","command"];function OC(t,e,n={},r){const o=!(typeof r=="string"&&r===""||Array.isArray(r)&&(r.length===0||r.length===1&&r[0]==="")||r==null),s=[];if(e=e.replace(/__/g,":"),e!=="noop"&&e!==""){e!=="cdata"?s.push(`<${e}`):s.push("<![CDATA[");for(let a in n)if(a&&TC(n,a)){const l=n[a];if(a==="html")continue;a.toLowerCase()==="classname"&&(a="class"),a=a.replace(/__/g,":"),l===!0?s.push(` ${a}`):a==="style"&&typeof l=="object"?s.push(` ${a}="${Object.keys(l).filter(u=>l[u]!=null).map(u=>{let c=l[u];return c=typeof c=="number"?`${c}px`:c,`${u.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${c}`}).join(";")}"`):l!==!1&&l!=null&&s.push(` ${a}="${xg(l.toString())}"`)}if(e!=="cdata"){if(t&&!o)return s.push(" />"),s.join("");s.push(">")}if(!t&&AC.includes(e))return s.join("")}if(o){if(typeof r=="string")s.push(r);else if(r&&r.length>0){for(let a of r)if(a!=null&&a!==!1){Array.isArray(a)||(a=[a]);for(const l of a)l.startsWith("<")&&l.endsWith(">")||e==="script"||e==="style"?s.push(l):s.push(xg(l.toString()))}}}return n.html&&s.push(n.html),e!=="noop"&&e!==""&&(e!=="cdata"?s.push(`</${e}>`):s.push("]]>")),s.join("")}function sp(t,e,...n){const{tag:r,attrs:o,children:s}=gC(t,e,n);return OC(!1,r,o,s)}var ap=OC.bind(null,!1);sp.firstLine="<!DOCTYPE html>",sp.html=!0;var uj=/([^=\s]+)(\s*=\s*(("([^"]*)")|('([^']*)')|[^>\s]+))?/g,cj=/^<\/([^>\s]+)[^>]*>/m,dj=/^<([^>\s/]+)((\s+[^=>\s]+(\s*=\s*(("[^"]*")|('[^']*')|[^>\s]+))?)*)\s*(?:\/\s*)?>/m,fj=/\s*\/\s*>\s*$/m,pj=class{constructor(t={}){this.attrRe=uj,this.endTagRe=cj,this.startTagRe=dj,this.defaults={ignoreWhitespaceText:!1},t.scanner&&(this.scanner=t.scanner),this.options=Object.assign({},this.defaults,t)}parse(t){let e=!1,n,r,o;for(;t.length;){if(t.substring(0,4)==="<!--")n=t.indexOf("-->"),n!==-1?(this.scanner.comment(t.substring(4,n)),t=t.substring(n+3),e=!1):e=!0;else if(t.substring(0,2)==="</")r=this.endTagRe.exec(t),r?(t=RegExp.rightContext,e=!1,this.parseEndTag(RegExp.lastMatch,r[1])):e=!0;else if(t.charAt(0)==="<")if(r=this.startTagRe.exec(t),r){t=RegExp.rightContext,e=!1;const s=this.parseStartTag(RegExp.lastMatch,r[1],r);(s==="script"||s==="style")&&(n=t.search(new RegExp(`</${s}`,"i")),n!==-1?(this.scanner.characters(t.substring(0,n)),t=t.substring(n),e=!1):e=!0)}else e=!0;if(e){n=t.indexOf("<");let s=n;n===0&&(n=t.substring(1).indexOf("<"),s=s+1),n===-1?(o=t,t=""):(o=t.substring(0,s),t=t.substring(s)),(!this.options.ignoreWhitespaceText||!/^\s*$/.test(o))&&this.scanner.characters(o)}e=!0,r=null}}parseStartTag(t,e,n){const r=fj.test(t);let o=n[2];r&&(o=o.replace(/\s*\/\s*$/,""));const s=this.parseAttributes(e,o);return this.scanner.startElement(e,s,r,n[0]),e.toLocaleLowerCase()}parseEndTag(t,e){this.scanner.endElement(e)}parseAttributes(t,e){const n={};return e.replace(this.attrRe,(...r)=>{const[o,s,a,l,u,c,f,h]=r;n[s]=h??c??l??!0}),n}};function hj(t){if(typeof t!="string")throw console.error("parseHTML requires string, found",t),new Error("parseHTML requires string");const e=t.indexOf("<!")===0?new SC(!0):new Eg,n=[e];return new pj({scanner:{startElement(o,s,a){if(o.toLowerCase()==="!doctype"){e.docType=new _C;return}for(const c in s)if(TC(s,c)){const f=s[c];typeof f=="string"&&(s[c]=mC(f))}const u=n[n.length-1];if(u){const c=kC.createElement(o,s);u.appendChild(c),AC.includes(o.toLowerCase())||a||n.push(c)}},endElement(o){n.pop()},characters(o){var a;o=mC(o);const s=n[n.length-1];((a=s==null?void 0:s.lastChild)==null?void 0:a.nodeType)===ts.TEXT_NODE?s.lastChild._text+=o:s&&s.appendChild(new dl(o))},comment(o){}}}).parse(t),e}ro.prototype.setInnerHTML=function(t){const e=hj(t);this._childNodes=e._childNodes,this._fixChildNodesParent()};function mj(t,e,n){return Mi.fromSchema(e).serializeFragment(t.content,{document:sj()}).render()}function gj(t,e){const n=Nr.fromJSON(e,t);return mj(n,e)}function bj(t,e){const n=document.getElementById(t.attrs.id)??Sg.getElementById(t.attrs.id);if(!n)return null;const r=MC(n),{lastChild:o}=t,{childCount:s}=t,a=t.content.content.slice(0,s);if(!o)return!1;o.isText&&a.push(e.text("gg"));const l=gj(vj(t.type.create(t.attrs,a,t.marks)),e);return wj(l,t.attrs.id,!1)>r}function vj(t){return{type:"doc",content:[t.toJSON()]}}let yj=null,Sg=null;const kg=new Map;function wj(t,e,n=!0){if(n&&kg.has(t))return kg.get(t);const r=Sg.getElementById("computeddiv");if(r){r.innerHTML=`<p>&nbsp;</p>${t}`;const o=Sg.getElementById(e),{height:s}=MC(o);return r.innerHTML="&nbsp;",n&&kg.set(t,s),s}return 0}function MC(t){const e=window.getComputedStyle(t)||yj.contentWindow.getComputedStyle(t),n=e.getPropertyValue("margin-top"),r=e.getPropertyValue("margin-bottom"),o=parseFloat(n)+parseFloat(r),{height:s}=t.getBoundingClientRect();return{margin:o,height:o+t.offsetHeight+parseFloat(e.borderWidth)}}function Tg(){return Gi(10)}const Ag="paragraph",Fr="page",BC="Extend",fl="Node",xj=fl+BC,Cj="CC",Og="heading",lp="bulletList",Mg="listItem",RC="taskList",Ej="taskItem",up="orderedList",pl="table",Bg="tableHeader",Rg="tableRow",_j="tableCell",Ig="column",Nu="columns",Lg="textBox",hl="image",ml="imageUpload",Sj="iframe",kj="file",Pg="codeBlock",Dg="blockquote",Tj="audio",Aj="toc",IC="video",Oj="horizontalrule",Fg="pagination",Mj=[pl,up,lp,RC],Bj=[IC,hl],Vg="link",Rj="placeholder",Ij="focus",Lj="text",Pj="text-bubble",Dj="gapCursor",Fj="dropCursor",Vj="characterCount",$j="hardBreak",zj="textStyle",Hj="selection",LC="superText",$g="configPlan",Uj="fontSize",Wj="fontFamily",jj="bold",qj="italic",Kj="underline",Gj="strike",Xj="color",Jj="highlight",Yj="moreMark",Zj="textAlign",Qj="indent",Nj="lineHeight",eq="painter",tq="clear",PC="spellchecker",DC="fontSizeIncreaseDecrease",nq=Object.freeze(Object.defineProperty({__proto__:null,AUDIO:Tj,BLOCKQUOTE:Dg,BOLD:jj,BULLETLIST:lp,CASSIE_BLOCK:fl,CASSIE_BLOCK_EXTEND:xj,CC:Cj,CHARACTER_COUNT:Vj,CLEAR:tq,CODE_BLOCK:Pg,COLOR:Xj,COLUMN:Ig,COLUMNS:Nu,CONFIG_PLAN:$g,DROP_CURSOR:Fj,EXTEND:BC,FILE:kj,FOCUS:Ij,FONTSIZEINCREASEDECREASE:DC,FONT_FAMILY:Wj,FONT_SIZE:Uj,GAP_CURSOR:Dj,HARD_BREAK:$j,HEADING:Og,HIGHLIGHT:Jj,HORIZONTALRULE:Oj,IFRAME:Sj,IMAGE:hl,IMAGE_UPLOAD:ml,INDENT:Qj,ITALIC:qj,LINE_HEIGHT:Nj,LINK:Vg,LISTITEM:Mg,LIST_MEDIA:Bj,LIST_TYPE:Mj,MORE_MARK:Yj,ORDEREDLIST:up,PAGE:Fr,PAGEBREAK:Fg,PAINTER:eq,PARAGRAPH:Ag,PLACEHOLDER:Rj,SELECTION:Hj,SPELLCHECKER:PC,STRIKE:Gj,SUPER_TEXT:LC,TABLE:pl,TABLEHEADER:Bg,TABLE_CELL:_j,TABLE_ROW:Rg,TASKITEM:Ej,TASKLIST:RC,TEXT:Lj,TEXT_ALIGN:Zj,TEXT_BOX:Lg,TEXT_BUBBLE:Pj,TEXT_STYLE:zj,TOC:Aj,UNDERLINE:Kj,VIDEO:IC},Symbol.toStringTag,{value:"Module"})),cp=i.defineComponent({__name:"ContextMenu",props:{dir:{},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const o=Lt(t,e);return(s,a)=>(i.openBlock(),i.createBlock(i.unref(eA),i.normalizeProps(i.guardReactiveProps(i.unref(o))),{default:i.withCtx(()=>[i.renderSlot(s.$slots,"default")]),_:3},16))}}),dp=i.defineComponent({__name:"ContextMenuContent",props:{forceMount:{type:Boolean},loop:{type:Boolean},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},sticky:{},hideWhenDetached:{type:Boolean},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","closeAutoFocus"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>{const{class:a,...l}=n;return l}),s=Lt(o,r);return(a,l)=>(i.openBlock(),i.createBlock(i.unref(nA),null,{default:i.withCtx(()=>[i.createVNode(i.unref(rA),i.mergeProps(i.unref(s),{class:i.unref($e)("z-50 min-w-32 overflow-hidden rounded-md border bg-ed-popover p-1 text-ed-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n.class)}),{default:i.withCtx(()=>[i.renderSlot(a.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),fp=i.defineComponent({__name:"ContextMenuItem",props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{},inset:{type:Boolean}},emits:["select"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>{const{class:a,...l}=n;return l}),s=Lt(o,r);return(a,l)=>(i.openBlock(),i.createBlock(i.unref(oA),i.mergeProps(i.unref(s),{class:i.unref($e)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-ed-accent focus:text-ed-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n.inset&&"pl-8",n.class)}),{default:i.withCtx(()=>[i.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),pp=i.defineComponent({__name:"ContextMenuTrigger",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const n=$n(t);return(r,o)=>(i.openBlock(),i.createBlock(i.unref(tA),i.normalizeProps(i.guardReactiveProps(i.unref(n))),{default:i.withCtx(()=>[i.renderSlot(r.$slots,"default")]),_:3},16))}}),FC=i.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const o=Lt(t,e);return(s,a)=>(i.openBlock(),i.createBlock(i.unref(qT),i.normalizeProps(i.guardReactiveProps(i.unref(o))),{default:i.withCtx(()=>[i.renderSlot(s.$slots,"default")]),_:3},16))}}),VC=i.defineComponent({__name:"DialogContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{},isOverlayTransparent:{type:Boolean}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>{const{isOverlayTransparent:a,class:l,...u}=n;return u}),s=Lt(o,r);return(a,l)=>(i.openBlock(),i.createBlock(i.unref(hv),null,{default:i.withCtx(()=>[i.createVNode(i.unref(_v),{class:i.normalizeClass(i.unref($e)("fixed inset-0 z-[60] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a.isOverlayTransparent&&"bg-transparent"))},null,8,["class"]),i.createVNode(i.unref(p7),i.mergeProps(i.unref(s),{class:i.unref($e)("fixed left-1/2 top-1/2 z-[60] grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-ed-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n.class)}),{default:i.withCtx(()=>[i.renderSlot(a.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),$C=i.defineComponent({__name:"DialogFooter",props:{class:{}},setup(t){const e=t;return(n,r)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(i.unref($e)("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2",e.class))},[i.renderSlot(n.$slots,"default")],2))}}),zC=i.defineComponent({__name:"DialogHeader",props:{class:{}},setup(t){const e=t;return(n,r)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(i.unref($e)("flex flex-col gap-y-1.5 text-center sm:text-left",e.class))},[i.renderSlot(n.$slots,"default")],2))}}),HC=i.defineComponent({__name:"DialogClose",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(i.openBlock(),i.createBlock(i.unref(m7),i.normalizeProps(i.guardReactiveProps(e)),{default:i.withCtx(()=>[i.renderSlot(n.$slots,"default")]),_:3},16))}}),UC=i.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=i.computed(()=>{const{class:o,...s}=e;return s}),r=$n(n);return(o,s)=>(i.openBlock(),i.createBlock(i.unref(g7),i.mergeProps(i.unref(r),{class:i.unref($e)("text-lg font-semibold leading-none tracking-tight",e.class)}),{default:i.withCtx(()=>[i.renderSlot(o.$slots,"default")]),_:3},16,["class"]))}}),WC=i.defineComponent({__name:"SimpleEditor",props:{modelValue:{default:""},parentEditor:{},isReadOnly:{type:Boolean}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.inject("isMobile",!1),a=[uC,aC,lC],l=i.computed(()=>{var g;return(g=r.parentEditor)==null?void 0:g.extensionManager.extensions.find(b=>b.name==="spellchecker")}),u=i.computed(()=>{var g,b,y,w,x,_,S;return R5.configure({proofreader:new mE({api:(b=(g=l.value)==null?void 0:g.options.proofreader)==null?void 0:b.api,limit:(w=(y=l.value)==null?void 0:y.options.proofreader)==null?void 0:w.limit,transfer:(_=(x=l.value)==null?void 0:x.options.proofreader)==null?void 0:_.transfer,enabled:!1}),uiStrings:(S=l.value)==null?void 0:S.options.uiStrings})}),c=new ol({enablePasteRules:!1,enableInputRules:!1,content:r.modelValue,extensions:a.concat(u.value),editable:!r.isReadOnly,autofocus:!0,onUpdate:({editor:g})=>{o("update:modelValue",g.getHTML())}});i.watch(()=>r.isReadOnly,g=>{c.setEditable(!g)});function f(g){const{view:b}=c,{from:y}=b.state.selection;c.commands.insertContentAt(y,g)}const h=i.ref(!1);function m(){var g;c.commands.handleActiveSpellCheck(!1),h.value=!h.value,(g=c==null?void 0:c.commands)!=null&&g.setIsEnableSuggestion&&c.commands.setIsEnableSuggestion(!1)}return e({insertSpecialCharater:f,isChecked:h,toggleSpellCheck:m}),(g,b)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(i.unref($e)("h-40 overflow-y-auto",i.unref(s)&&"h-20 rounded-[5px]"))},[i.createVNode(i.unref(Lu),{editor:i.unref(c),class:i.normalizeClass(i.unref($e)(" vdc-editor break-all [&_.tiptap.ProseMirror-focused]:border-ed-input-focus [&_.tiptap]:min-h-40 [&_.tiptap]:border-[inherit]",i.unref(s)&&"[&_.tiptap]:border-ed-gray [&_.tiptap]:min-h-20",g.isReadOnly&&"[&_.tiptap]:border-none"))},null,8,["editor","class"])],2))}}),rq={class:"m-2.5 p-2.5 space-y-2.5 rounded border border-gray-200"},oq={class:"flex gap-x-2"},iq={class:"flex gap-x-7 flex-1"},sq={class:"flex items-center space-x-2 text-xs font-normal"},aq={for:"spellcheck",class:"select-none"},lq={class:"flex gap-x-2"},uq={class:"w-1/6 text-right text-sm p-2"},cq={class:"flex gap-x-2"},ec=i.defineComponent({__name:"SuperInputDialog",props:{editor:{},open:{type:Boolean},superTextInit:{},superTextId:{},superTextElementId:{}},emits:["close","save"],setup(t,{emit:e}){var A,T;const n=e,r=t,{t:o}=St(),s=i.ref(""),a=i.ref(""),l=i.ref(null),u=i.ref(!1),c=i.reactive({x:0,y:0}),f=i.ref(!1),h={x:0,y:0},m=B=>{f.value=!0,h.x=B.clientX-c.x,h.y=B.clientY-c.y,document.addEventListener("mousemove",g),document.addEventListener("mouseup",b)},g=B=>{f.value&&(c.x=B.clientX-h.x,c.y=B.clientY-h.y)},b=()=>{f.value=!1,document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",b)},y=i.computed(()=>{var L;if(!s.value)return!0;const B=document.createElement("div");return B.innerHTML=s.value,((L=B==null?void 0:B.textContent)==null?void 0:L.trim())===""});i.watch(()=>r.open,async B=>{if(B){r.superTextInit&&(s.value=r.superTextInit,r.superTextElementId&&(a.value=r.superTextElementId)),await i.nextTick();const L=document.querySelector(".draggable-dialog");if(L){const{width:I,height:V}=L.getBoundingClientRect(),q=window.innerWidth,K=window.innerHeight;c.x=(q-I)/2,c.y=(K-V)/2}}},{immediate:!0});const w=()=>{n("close"),s.value="",a.value="",u.value=!1},x=()=>{n("save",s.value),s.value=""},_=(T=(A=r.editor)==null?void 0:A.extensionManager.extensions.find(B=>B.name==="superText"))==null?void 0:T.options.specialCharModal,S=(B,L)=>{var I;L&&((I=l.value)==null||I.insertSpecialCharater(B))},C=i.computed(()=>{var B;return(B=l.value)==null?void 0:B.isChecked}),k=()=>{var B;(B=l.value)==null||B.toggleSpellCheck()};return i.onUnmounted(()=>{document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",b)}),(B,L)=>{const I=UC,V=HC,q=zC,K=$C,me=VC,z=FC;return i.openBlock(),i.createBlock(z,{open:B.open},{default:i.withCtx(()=>[i.createVNode(i.unref(hv),null,{default:i.withCtx(()=>[i.createVNode(i.unref(_v),{class:"!pointer-events-none bg-black/30"}),i.createVNode(me,{"is-overlay-transparent":"",class:"p-0 gap-0 !animate-none !transition-none","as-child":""},{default:i.withCtx(()=>{var U,P,G;return[i.createElementVNode("div",{class:"draggable-dialog fixed z-[70] pointer-events-auto",style:i.normalizeStyle({transform:`translate(${c.x}px, ${c.y}px)`,top:"0px",left:"0px"})},[i.createVNode(q,{class:"bg-blue-500 text-white p-2.5 rounded-t-[5px] cursor-move",onMousedown:i.withModifiers(m,["prevent"])},{default:i.withCtx(()=>[i.createVNode(I,null,{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.superinput")),1)]),_:1}),i.createVNode(V,{class:"absolute right-3 top-3 text-white",onClick:w},{default:i.withCtx(()=>[i.createVNode(i.unref(V1),{class:"w-5 h-5"}),L[3]||(L[3]=i.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:1}),i.createElementVNode("div",rq,[i.createElementVNode("div",oq,[L[4]||(L[4]=i.createElementVNode("label",{class:"w-1/6"}," ",-1)),i.createElementVNode("div",iq,[i.createVNode(er,{class:"text-[#65558F] bg-[#ECE6F0] hover:bg-[#ECE6F0]/90 shadow text-xs rounded font-normal h-[25px] px-3",onClick:L[0]||(L[0]=Z=>u.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.insert.symbol")),1)]),_:1}),i.createElementVNode("div",sq,[i.createVNode(Q8,{id:"spellcheck",checked:i.unref(C),class:"border-gray-300","onUpdate:checked":k},null,8,["checked"]),i.createElementVNode("label",aq,i.toDisplayString(i.unref(o)("editor.menubar.menu.spellCheck")),1)])]),u.value?(i.openBlock(),i.createBlock(i.resolveDynamicComponent((U=i.unref(_))==null?void 0:U.component),{key:0,"custom-class":"!z-[70] !pointer-events-auto",class:i.normalizeClass((G=(P=i.unref(_))==null?void 0:P.componentProps)==null?void 0:G.class),onSelectedChar:S,onClose:L[1]||(L[1]=Z=>u.value=!1)},null,40,["class"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",lq,[i.createElementVNode("label",uq,i.toDisplayString(i.unref(o)("editor.detail")),1),i.createVNode(WC,{ref_key:"simpleEditorRef",ref:l,modelValue:s.value,"onUpdate:modelValue":L[2]||(L[2]=Z=>s.value=Z),"parent-editor":B.editor,class:"flex-1"},null,8,["modelValue","parent-editor"])]),i.createElementVNode("div",cq,[L[5]||(L[5]=i.createElementVNode("label",{class:"w-1/6 text-right text-sm p-2"},"ID",-1)),i.createVNode(Ba,{class:"flex-1 rounded-none","default-value":a.value,disabled:""},null,8,["default-value"])])]),i.createVNode(K,{class:"sm:justify-center pb-3.5 pt-1"},{default:i.withCtx(()=>[i.createVNode(er,{as:"button",variant:"default",class:"bg-blue-500 hover:bg-blue-500/90",disabled:i.unref(y),onClick:x},{default:i.withCtx(()=>[i.createVNode(i.unref(F1),{class:"w-5 h-5 mr-2"}),i.createTextVNode(" "+i.toDisplayString(i.unref(o)("editor.check")),1)]),_:1},8,["disabled"]),i.createVNode(er,{as:"button",variant:"destructive",onClick:w},{default:i.withCtx(()=>[i.createVNode(i.unref(V1),{class:"w-5 h-5 mr-2"}),L[6]||(L[6]=i.createTextVNode(" Close "))]),_:1})]),_:1})],4)]}),_:1})]),_:1})]),_:1},8,["open"])}}}),zg=i.defineComponent({__name:"SelectContextMenu",props:{editor:{},mode:{},superTextStore:{},disabled:{type:Boolean}},setup(t,{expose:e}){const n=t,{t:r}=St(),o=i.ref(!1),s=i.reactive({from:0,to:0,text:""}),a=i.ref(""),l=i.ref(""),u=i.ref(!0);let c=0;const f=i.computed(()=>n.mode===Ye.EDITOR||n.mode===Ye.PLAIN_TEXT),h=()=>{const{view:C,state:k}=n.editor,{from:A,to:T}=C.state.selection,B=k.doc.textBetween(A,T,"");s.text=B,s.from=A,s.to=T},m=()=>o.value=!o.value,g=()=>{if(f.value)return;o.value=!0,h();const{from:C,to:k}=n.editor.state.selection;let A="";n.editor.state.doc.nodesBetween(C,k,T=>{var B;(B=T.attrs)!=null&&B.id&&(A=T.attrs.id)}),l.value=A,a.value=s.text},b=()=>o.value=!1,y=C=>{const k=n==null?void 0:n.superTextStore.addMoreSuperText(C);n.editor&&n.editor.commands.insertContentAt(s.from,{type:"superText",attrs:{"data-id":k,"data-text":C}}),o.value=!1,requestAnimationFrame(()=>{var T,B;const A=(T=n.editor)==null?void 0:T.view.dom.parentElement;A&&((B=n.editor)==null||B.view.focus(),A.scrollTop=c)})},w=async()=>{const{view:C,state:k}=n.editor,{from:A,to:T}=k.selection,B=k.doc.textBetween(A,T,`
247
+ 3. "-" cannot repeat`);Wt.customSchemes.push([t,e])}function zU(){Wt.scanner=RU(Wt.customSchemes);for(let t=0;t<Wt.tokenQueue.length;t++)Wt.tokenQueue[t][1]({scanner:Wt.scanner});Wt.parser=PU(Wt.scanner.tokens);for(let t=0;t<Wt.pluginQueue.length;t++)Wt.pluginQueue[t][1]({scanner:Wt.scanner,parser:Wt.parser});return Wt.initialized=!0,Wt}function cg(t){return Wt.initialized||zU(),DU(Wt.parser.start,t,j8(Wt.scanner.start,t))}cg.scan=j8;function Z8(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 r=new lg(n),o=cg(t),s=[];for(let a=0;a<o.length;a++){const l=o[a];l.isLink&&(!e||l.t===e)&&r.check(l)&&s.push(l.toFormattedObject(r))}return s}function HU(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function UU(t){return new dt({key:new kt("autolink"),appendTransaction:(e,n,r)=>{const o=e.some(c=>c.docChanged)&&!n.doc.eq(r.doc),s=e.some(c=>c.getMeta("preventAutolink"));if(!o||s)return;const{tr:a}=r,l=uF(n.doc,[...e]);if(pF(l).forEach(({newRange:c})=>{const f=P6(r.doc,c,g=>g.isTextblock);let h,m;if(f.length>1?(h=f[0],m=r.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ")):f.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(h=f[0],m=r.doc.textBetween(h.pos,c.to,void 0," ")),h&&m){const g=m.split(" ").filter(x=>x!=="");if(g.length<=0)return!1;const b=g[g.length-1],y=h.pos+m.lastIndexOf(b);if(!b)return!1;const w=cg(b).map(x=>x.toObject(t.defaultProtocol));if(!HU(w))return!1;w.filter(x=>x.isLink).map(x=>({...x,from:y+x.start+1,to:y+x.end+1})).filter(x=>r.schema.marks.code?!r.doc.rangeHasMark(x.from,x.to,r.schema.marks.code):!0).filter(x=>t.validate(x.value)).filter(x=>t.shouldAutoLink(x.value)).forEach(x=>{r1(x.from,x.to,r.doc).some(_=>_.mark.type===t.type)||a.addMark(x.from,x.to,t.type.create({href:x.href}))})}}),!!a.steps.length)return a}})}function WU(t){return new dt({key:new kt("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,s;if(r.button!==0||!e.editable)return!1;let a=r.target;const l=[];for(;a.nodeName!=="DIV";)l.push(a),a=a.parentNode;if(!l.find(m=>m.nodeName==="A"))return!1;const u=V6(e.state,t.type.name),c=r.target,f=(o=c==null?void 0:c.href)!==null&&o!==void 0?o:u.href,h=(s=c==null?void 0:c.target)!==null&&s!==void 0?s:u.target;return c&&f?(window.open(f,h),!0):!1}}})}function jU(t){return new dt({key:new kt("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:o}=e,{selection:s}=o,{empty:a}=s;if(a)return!1;let l="";r.content.forEach(c=>{l+=c.textContent});const u=Z8(l,{defaultProtocol:t.defaultProtocol}).find(c=>c.isLink&&c.value===l);return!l||!u?!1:t.editor.commands.setMark(t.type,{href:u.href})}}})}const qU=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Xs(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const o=typeof r=="string"?r:r.scheme;o&&n.push(o)}),!t||t.replace(qU,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const KU=qn.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=>{if(typeof t=="string"){Y8(t);return}Y8(t.scheme,t.optionalSlashes)})},onDestroy(){$U()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!Xs(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}},addAttributes(){return{href:{default:null,parseHTML(t){return 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=>!!Xs(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!Xs(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",mt(this.options.HTMLAttributes,t),0]:["a",mt(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Xs(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:n}=t;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Xs(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[ji({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,o=Z8(t).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!Xs(a,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(s=>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||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(UU({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:o=>!!Xs(o,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&t.push(WU({type:this.type})),this.options.linkOnPaste&&t.push(jU({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}});function GU(t,e){return i.openBlock(),i.createElementBlock("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[i.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:"currentColor"})])}const Q8=i.defineComponent({__name:"Checkbox",props:{defaultChecked:{type:Boolean},checked:{type:[Boolean,String]},disabled:{type:Boolean},required:{type:Boolean},name:{},value:{},id:{},asChild:{type:Boolean},as:{},class:{}},emits:["update:checked"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>{const{class:a,...l}=n;return l}),s=Lt(o,r);return(a,l)=>(i.openBlock(),i.createBlock(i.unref(x7),i.mergeProps(i.unref(s),{class:i.unref($e)("peer h-4 w-4 shrink-0 rounded-sm border border-ed-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ed-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-ed-primary data-[state=checked]:text-ed-primary-foreground",n.class)}),{default:i.withCtx(()=>[i.createVNode(i.unref(C7),{class:"flex h-full w-full items-center justify-center text-current"},{default:i.withCtx(()=>[i.renderSlot(a.$slots,"default",{},()=>[i.createVNode(i.unref(GU),{class:"h-4 w-4"})])]),_:3})]),_:3},16,["class"]))}}),XU={class:"flex w-full max-w-sm items-center gap-1.5"},JU={class:"relative w-full max-w-sm items-center"},YU={class:"flex w-full max-w-sm items-center gap-1.5"},ZU={class:"relative w-full max-w-sm items-center"},QU={class:"absolute start-0 inset-y-0 flex items-center justify-center px-2"},NU={class:"flex items-center space-x-2 mt-1"},N8=i.defineComponent({__name:"LinkEditBlock",props:{editor:{}},emits:["onSetLink","onClickOutside"],setup(t,{emit:e}){const n=t,r=e,{t:o}=St();let s=i.reactive({text:"",link:""});const a=i.ref(null),{focused:l}=Ze.useFocus(a),u=i.ref(!1),c=i.ref(null);Ze.onClickOutside(c,h=>r("onClickOutside",h)),i.watchEffect(()=>{const{href:h,target:m}=n.editor.getAttributes("link"),{from:g,to:b}=n.editor.state.selection,y=n.editor.state.doc.textBetween(g,b," ");s={link:h,text:y},u.value=m==="_blank"});function f(){r("onSetLink",s.link,s.text,u.value)}return i.onMounted(()=>{l.value=!0}),(h,m)=>{const g=Q8;return i.openBlock(),i.createElementBlock("div",{ref_key:"target",ref:c,class:"p-2 bg-white rounded-lg dark:bg-black shadow-sm border border-neutral-200 dark:border-neutral-800"},[i.createElementVNode("form",{class:"flex flex-col gap-2",onSubmit:i.withModifiers(f,["prevent"])},[i.createVNode(i.unref(dd),null,{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.link.dialog.text")),1)]),_:1}),i.createElementVNode("div",XU,[i.createElementVNode("div",JU,[i.createVNode(i.unref(Ba),{modelValue:i.unref(s).text,"onUpdate:modelValue":m[0]||(m[0]=b=>i.unref(s).text=b),type:"text",required:"",class:"w-80",placeholder:"텍스트"},null,8,["modelValue"])])]),i.createVNode(i.unref(dd),null,{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.link.dialog.link")),1)]),_:1}),i.createElementVNode("div",YU,[i.createElementVNode("div",ZU,[i.createVNode(i.unref(Ba),{ref_key:"inputRef",ref:a,modelValue:i.unref(s).link,"onUpdate:modelValue":m[1]||(m[1]=b=>i.unref(s).link=b),type:"url",required:"",class:"pl-10"},null,8,["modelValue"]),i.createElementVNode("span",QU,[i.createVNode(i.unref(Kt),{class:"size-5 text-ed-muted-foreground",name:"Link"})])])]),i.createElementVNode("div",NU,[i.createVNode(g,{id:"openInNewTab",checked:u.value,"onUpdate:checked":m[2]||(m[2]=b=>u.value=b)},null,8,["checked"]),i.createVNode(i.unref(dd),{for:"openInNewTab"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.link.dialog.openInNewTab")),1)]),_:1})]),i.createVNode(i.unref(er),{type:"submit",class:"mt-2 self-end"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.link.dialog.button.apply")),1)]),_:1})],32)],512)}}}),eW=i.defineComponent({__name:"LinkEditPopover",props:{editor:{},icon:{default:void 0},title:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},shortcutKeys:{default:void 0},isActive:{type:Function,default:void 0},action:{type:Function,default:void 0}},setup(t){const e=t;function n(r,o,s){e.action&&e.action({link:r,text:o,openInNewTab:s})}return(r,o)=>(i.openBlock(),i.createBlock(i.unref(Oa),null,{default:i.withCtx(()=>[i.createVNode(i.unref(Ra),{disabled:r.disabled},{default:i.withCtx(()=>[i.createVNode(je,{icon:r.icon,tooltip:r.tooltip,"is-active":r.isActive,disabled:r.disabled},null,8,["icon","tooltip","is-active","disabled"])]),_:1},8,["disabled"]),i.createVNode(i.unref(Ma),{"hide-when-detached":"","as-child":"",class:"w-full",align:"start",side:"bottom"},{default:i.withCtx(()=>[i.createVNode(N8,{editor:r.editor,onOnSetLink:n},null,8,["editor"])]),_:1})]),_:1}))}}),dg=KU.extend({inclusive:!1,parseHTML(){return[{tag:'a[href]:not([data-type="button"]):not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:t}){return["a",mt(this.options.HTMLAttributes,t,{class:"link"}),0]},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),openOnClick:!0,button:({editor:e,t:n})=>({component:eW,componentProps:{action:r=>{const{link:o,text:s,openInNewTab:a}=r;e.chain().extendMarkRange("link").insertContent({type:"text",text:s,marks:[{type:"link",attrs:{href:o,target:a?"_blank":""}}]}).setLink({href:o}).focus().run()},isActive:()=>e.isActive("link")||!1,disabled:!e.can().setLink({href:""}),icon:"Link",tooltip:n("editor.link.tooltip")}})}},addProseMirrorPlugins(){return[new dt({props:{handleClick:(t,e)=>{const{schema:n,doc:r,tr:o}=t.state,s=Zd(r.resolve(e),n.marks.link);if(!s)return!1;const a=r.resolve(s.from),l=r.resolve(s.to),u=o.setSelection(new Ie(a,l));t.dispatch(u)}}})]}}),tW=Rt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",mt(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{selection:n}=e,{$from:r,$to:o}=n,s=t();return r.parentOffset===0?s.insertContentAt({from:Math.max(r.pos-1,0),to:o.pos},{type:this.name}):$6(n)?s.insertContentAt(o.pos,{type:this.name}):s.insertContent({type:this.name}),s.command(({tr:a,dispatch:l})=>{var u;if(l){const{$to:c}=a.selection,f=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?a.setSelection(Ie.create(a.doc,c.pos+1)):c.nodeAfter.isBlock?a.setSelection(Pe.create(a.doc,c.pos)):a.setSelection(Ie.create(a.doc,c.pos));else{const h=(u=c.parent.type.contentMatch.defaultType)===null||u===void 0?void 0:u.create();h&&(a.insert(f,h),a.setSelection(Ie.create(a.doc,f+1)))}a.scrollIntoView()}return!0}).run()}}},addInputRules(){return[U6({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}).extend({renderHTML(){return["div",mt(this.options.HTMLAttributes,{"data-type":this.name}),["hr"]]},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,t:n})=>({component:je,componentProps:{action:()=>e.commands.setHorizontalRule(),disabled:!e.can().setHorizontalRule(),icon:"Minus",shortcutKeys:["mod","alt","S"],tooltip:n("editor.horizontalrule.tooltip")}})}},addKeyboardShortcuts(){return{"Mod-Alt-s":()=>this.editor.commands.setHorizontalRule()}}});var rp=200,vn=function(){};vn.prototype.append=function(e){return e.length?(e=vn.from(e),!this.length&&e||e.length<rp&&this.leafAppend(e)||this.length<rp&&e.leafPrepend(this)||this.appendInner(e)):this},vn.prototype.prepend=function(e){return e.length?vn.from(e).append(this):this},vn.prototype.appendInner=function(e){return new nW(this,e)},vn.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?vn.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},vn.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},vn.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},vn.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var o=[];return this.forEach(function(s,a){return o.push(e(s,a))},n,r),o},vn.from=function(e){return e instanceof vn?e:e&&e.length?new eC(e):vn.empty};var eC=function(t){function e(r){t.call(this),this.values=r}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,s){return o==0&&s==this.length?this:new e(this.values.slice(o,s))},e.prototype.getInner=function(o){return this.values[o]},e.prototype.forEachInner=function(o,s,a,l){for(var u=s;u<a;u++)if(o(this.values[u],l+u)===!1)return!1},e.prototype.forEachInvertedInner=function(o,s,a,l){for(var u=s-1;u>=a;u--)if(o(this.values[u],l+u)===!1)return!1},e.prototype.leafAppend=function(o){if(this.length+o.length<=rp)return new e(this.values.concat(o.flatten()))},e.prototype.leafPrepend=function(o){if(this.length+o.length<=rp)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}(vn);vn.empty=new eC([]);var nW=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.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(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,o,s,a){var l=this.left.length;if(o<l&&this.left.forEachInner(r,o,Math.min(s,l),a)===!1||s>l&&this.right.forEachInner(r,Math.max(o-l,0),Math.min(this.length,s)-l,a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,o,s,a){var l=this.left.length;if(o>l&&this.right.forEachInvertedInner(r,o-l,Math.max(s,l)-l,a+l)===!1||s<l&&this.left.forEachInvertedInner(r,Math.min(o,l),s,a)===!1)return!1},e.prototype.sliceInner=function(r,o){if(r==0&&o==this.length)return this;var s=this.left.length;return o<=s?this.left.slice(r,o):r>=s?this.right.slice(r-s,o-s):this.left.slice(r,s).append(this.right.slice(0,o-s))},e.prototype.leafAppend=function(r){var o=this.right.leafAppend(r);if(o)return new e(this.left,o)},e.prototype.leafPrepend=function(r){var o=this.left.leafPrepend(r);if(o)return new e(o,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(vn);const rW=500;class no{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let o,s;n&&(o=this.remapping(r,this.items.length),s=o.maps.length);let a=e.tr,l,u,c=[],f=[];return this.items.forEach((h,m)=>{if(!h.step){o||(o=this.remapping(r,m+1),s=o.maps.length),s--,f.push(h);return}if(o){f.push(new Ao(h.map));let g=h.step.map(o.slice(s)),b;g&&a.maybeStep(g).doc&&(b=a.mapping.maps[a.mapping.maps.length-1],c.push(new Ao(b,void 0,void 0,c.length+f.length))),s--,b&&o.appendMap(b,s)}else a.maybeStep(h.step);if(h.selection)return l=o?h.selection.map(o.slice(s)):h.selection,u=new no(this.items.slice(0,r).append(f.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:u,transform:a,selection:l}}addTransform(e,n,r,o){let s=[],a=this.eventCount,l=this.items,u=!o&&l.length?l.get(l.length-1):null;for(let f=0;f<e.steps.length;f++){let h=e.steps[f].invert(e.docs[f]),m=new Ao(e.mapping.maps[f],h,n),g;(g=u&&u.merge(m))&&(m=g,f?s.pop():l=l.slice(0,l.length-1)),s.push(m),n&&(a++,n=void 0),o||(u=m)}let c=a-r.depth;return c>iW&&(l=oW(l,c),a-=c),new no(l.append(s),a)}remapping(e,n){let r=new lu;return this.items.forEach((o,s)=>{let a=o.mirrorOffset!=null&&s-o.mirrorOffset>=e?r.maps.length-o.mirrorOffset:void 0;r.appendMap(o.map,a)},e,n),r}addMaps(e){return this.eventCount==0?this:new no(this.items.append(e.map(n=>new Ao(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],o=Math.max(0,this.items.length-n),s=e.mapping,a=e.steps.length,l=this.eventCount;this.items.forEach(m=>{m.selection&&l--},o);let u=n;this.items.forEach(m=>{let g=s.getMirror(--u);if(g==null)return;a=Math.min(a,g);let b=s.maps[g];if(m.step){let y=e.steps[g].invert(e.docs[g]),w=m.selection&&m.selection.map(s.slice(u+1,g));w&&l++,r.push(new Ao(b,y,w))}else r.push(new Ao(b))},o);let c=[];for(let m=n;m<a;m++)c.push(new Ao(s.maps[m]));let f=this.items.slice(0,o).append(c).append(r),h=new no(f,l);return h.emptyItemCount()>rW&&(h=h.compress(this.items.length-r.length)),h}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,o=[],s=0;return this.items.forEach((a,l)=>{if(l>=e)o.push(a),a.selection&&s++;else if(a.step){let u=a.step.map(n.slice(r)),c=u&&u.getMap();if(r--,c&&n.appendMap(c,r),u){let f=a.selection&&a.selection.map(n.slice(r));f&&s++;let h=new Ao(c.invert(),u,f),m,g=o.length-1;(m=o.length&&o[g].merge(h))?o[g]=m:o.push(h)}}else a.map&&r--},this.items.length,0),new no(vn.from(o.reverse()),s)}}no.empty=new no(vn.empty,0);function oW(t,e){let n;return t.forEach((r,o)=>{if(r.selection&&e--==0)return n=o,!1}),t.slice(n)}class Ao{constructor(e,n,r,o){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=o}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new Ao(n.getMap().invert(),n,this.selection)}}}class Qi{constructor(e,n,r,o,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=o,this.prevComposition=s}}const iW=20;function sW(t,e,n,r){let o=n.getMeta(Js),s;if(o)return o.historyState;n.getMeta(uW)&&(t=new Qi(t.done,t.undone,null,0,-1));let a=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(a&&a.getMeta(Js))return a.getMeta(Js).redo?new Qi(t.done.addTransform(n,void 0,r,op(e)),t.undone,tC(n.mapping.maps),t.prevTime,t.prevComposition):new Qi(t.done,t.undone.addTransform(n,void 0,r,op(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),u=t.prevTime==0||!a&&t.prevComposition!=l&&(t.prevTime<(n.time||0)-r.newGroupDelay||!aW(n,t.prevRanges)),c=a?fg(t.prevRanges,n.mapping):tC(n.mapping.maps);return new Qi(t.done.addTransform(n,u?e.selection.getBookmark():void 0,r,op(e)),no.empty,c,n.time,l??t.prevComposition)}else return(s=n.getMeta("rebased"))?new Qi(t.done.rebased(n,s),t.undone.rebased(n,s),fg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Qi(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),fg(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function aW(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,o)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&o>=e[s]&&(n=!0)}),n}function tC(t){let e=[];for(let n=t.length-1;n>=0&&e.length==0;n--)t[n].forEach((r,o,s,a)=>e.push(s,a));return e}function fg(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let o=e.map(t[r],1),s=e.map(t[r+1],-1);o<=s&&n.push(o,s)}return n}function lW(t,e,n){let r=op(e),o=Js.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let a=s.selection.resolve(s.transform.doc),l=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),o,r),u=new Qi(n?l:s.remaining,n?s.remaining:l,null,0,-1);return s.transform.setSelection(a).setMeta(Js,{redo:n,historyState:u})}let pg=!1,nC=null;function op(t){let e=t.plugins;if(nC!=e){pg=!1,nC=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){pg=!0;break}}return pg}const Js=new kt("history"),uW=new kt("closeHistory");function cW(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new dt({key:Js,state:{init(){return new Qi(no.empty,no.empty,null,0,-1)},apply(e,n,r){return sW(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,o=r=="historyUndo"?oC:r=="historyRedo"?iC:null;return o?(n.preventDefault(),o(e.state,e.dispatch)):!1}}}})}function rC(t,e){return(n,r)=>{let o=Js.getState(n);if(!o||(t?o.undone:o.done).eventCount==0)return!1;if(r){let s=lW(o,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const oC=rC(!1,!0),iC=rC(!0,!0),dW=at.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>oC(t,e),redo:()=>({state:t,dispatch:e})=>iC(t,e)}},addProseMirrorPlugins(){return[cW(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()}}}),sC={HISTORY_TRANSACTION:"history$",ADD_TO_HISTORY_TRANSACTION:"addToHistory"},hg=dW.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),depth:10,button:({editor:e,t:n})=>["undo","redo"].map(o=>({component:je,componentProps:{action:()=>{o==="undo"&&e.commands.undo(),o==="redo"&&e.commands.redo()},shortcutKeys:o==="undo"?["mod","Z"]:["shift","mod","Z"],disabled:!e.can()[o](),icon:o==="undo"?"Undo2":"Redo2",tooltip:n(`editor.${o}.tooltip`)}}))}}}),{isFullscreen:mg,toggleFullscreen:gg}=tr(),fW=at.create({name:"fullscreen",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,extension:n,t:r})=>({component:je,componentProps:{tooltip:mg.value?r("editor.fullscreen.tooltip.exit"):r("editor.fullscreen.tooltip.fullscreen"),action:()=>gg(),icon:mg.value?"Minimize":"Maximize",isActive:()=>mg.value}})}},addKeyboardShortcuts(){return{F11:()=>(gg(),!0),"Mod-F11":()=>(gg(),!0)}}}),pW=at.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{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 r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}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 dt({key:new kt("characterCount"),appendTransaction:(e,n,r)=>{if(t)return;const o=this.options.limit;if(o==null||o===0){t=!0;return}const s=this.storage.characters({node:r.doc});if(s>o){const a=s-o,l=0,u=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);const c=r.tr.deleteRange(l,u);return t=!0,c}t=!0},filterTransaction:(e,n)=>{const r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;const o=this.storage.characters({node:n.doc}),s=this.storage.characters({node:e.doc});if(s<=r||o>r&&s>r&&s<=o)return!0;if(o>r&&s>r&&s>o||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,u=s-r,c=l-u,f=l;return e.deleteRange(c,f),!(this.storage.characters({node:e.doc})>r)}})]}});function hW(t={}){return new dt({view(e){return new mW(e,t)}})}class mW{constructor(e,n){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(o=>{let s=a=>{this[o](a)};return e.dom.addEventListener(o,s),{name:o,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=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let l=e.nodeBefore,u=e.nodeAfter;if(l||u){let c=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(c){let f=c.getBoundingClientRect(),h=l?f.bottom:f.top;l&&u&&(h=(h+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:f.left,right:f.right,top:h-this.width/2,bottom:h+this.width/2}}}}if(!r){let l=this.editorView.coordsAtPos(this.cursorPos);r={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let o=this.editorView.dom.offsetParent;this.element||(this.element=o.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let s,a;if(!o||o==document.body&&getComputedStyle(o).position=="static")s=-pageXOffset,a=-pageYOffset;else{let l=o.getBoundingClientRect();s=l.left-o.scrollLeft,a=l.top-o.scrollTop}this.element.style.left=r.left-s+"px",this.element.style.top=r.top-a+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"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}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),o=r&&r.type.spec.disableDropCursor,s=typeof o=="function"?o(this.editorView,n,e):o;if(n&&!s){let a=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=P4(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){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const gW=at.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[hW(this.options)]}}),bW=at.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new dt({key:new kt("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:o}=e,s=[];if(!n||!r)return ht.create(t,[]);let a=0;this.options.mode==="deepest"&&t.descendants((u,c)=>{if(u.isText)return;if(!(o>=c&&o<=c+u.nodeSize-1))return!1;a+=1});let l=0;return t.descendants((u,c)=>{if(u.isText||!(o>=c&&o<=c+u.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&a-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";s.push(Yt.node(c,c+u.nodeSize,{class:this.options.className}))}),ht.create(t,s)}}})]}});class nn extends Ve{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return nn.valid(r)?new nn(r):Ve.near(r)}content(){return xe.empty}eq(e){return e instanceof nn&&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 nn(e.resolve(n.pos))}getBookmark(){return new bg(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!vW(e)||!yW(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let o=n.contentMatchAt(e.index()).defaultType;return o&&o.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&nn.valid(e))return e;let o=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}else if(a==0)return null;o+=n;let u=e.doc.resolve(o);if(nn.valid(u))return u}for(;;){let a=n>0?s.firstChild:s.lastChild;if(!a){if(s.isAtom&&!s.isText&&!Pe.isSelectable(s)){e=e.doc.resolve(o+s.nodeSize*n),r=!1;continue e}break}s=a,o+=n;let l=e.doc.resolve(o);if(nn.valid(l))return l}return null}}}nn.prototype.visible=!1,nn.findFrom=nn.findGapCursorFrom,Ve.jsonID("gapcursor",nn);class bg{constructor(e){this.pos=e}map(e){return new bg(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return nn.valid(n)?new nn(n):Ve.near(n)}}function vW(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n-1);;o=o.lastChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function yW(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let o=r.child(n);;o=o.firstChild){if(o.childCount==0&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}}return!0}function wW(){return new dt({props:{decorations:_W,createSelectionBetween(t,e,n){return e.pos==n.pos&&nn.valid(n)?new nn(n):null},handleClick:CW,handleKeyDown:xW,handleDOMEvents:{beforeinput:EW}}})}const xW=W0({ArrowLeft:ip("horiz",-1),ArrowRight:ip("horiz",1),ArrowUp:ip("vert",-1),ArrowDown:ip("vert",1)});function ip(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,o,s){let a=r.selection,l=e>0?a.$to:a.$from,u=a.empty;if(a instanceof Ie){if(!s.endOfTextblock(n)||l.depth==0)return!1;u=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=nn.findGapCursorFrom(l,e,u);return c?(o&&o(r.tr.setSelection(new nn(c))),!0):!1}}function CW(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!nn.valid(r))return!1;let o=t.posAtCoords({left:n.clientX,top:n.clientY});return o&&o.inside>-1&&Pe.isSelectable(t.state.doc.nodeAt(o.inside))?!1:(t.dispatch(t.state.tr.setSelection(new nn(r))),!0)}function EW(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof nn))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let o=ue.empty;for(let a=r.length-1;a>=0;a--)o=ue.from(r[a].createAndFill(null,o));let s=t.state.tr.replace(n.pos,n.pos,new xe(o,0,0));return s.setSelection(Ie.near(s.doc.resolve(n.pos+1))),t.dispatch(s),!1}function _W(t){if(!(t.selection instanceof nn))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",ht.create(t.doc,[Yt.widget(t.selection.head,e,{key:"gapcursor"})])}const SW=at.create({name:"gapCursor",addProseMirrorPlugins(){return[wW()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=st(Be(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),kW=Rt.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",mt(this.options.HTMLAttributes,t)]},renderText(){return`
248
+ `},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:o,storedMarks:s}=n;if(o.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:l}=r.extensionManager,u=s||o.$to.parentOffset&&o.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:f})=>{if(f&&u&&a){const h=u.filter(m=>l.includes(m.type.name));c.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),TW=Rt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",mt(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),aC=Rt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",mt(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),AW=at.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new dt({key:new kt("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,o=[];if(!n)return null;const s=this.editor.isEmpty;return t.descendants((a,l)=>{const u=r>=l&&r<=l+a.nodeSize,c=!a.isLeaf&&of(a);if((u||!this.options.showOnlyCurrent)&&c){const f=[this.options.emptyNodeClass];s&&f.push(this.options.emptyEditorClass);const h=Yt.node(l,l+a.nodeSize,{class:f.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:a,pos:l,hasAnchor:u}):this.options.placeholder});o.push(h)}return this.options.includeChildren}),ht.create(t,o)}}})]}}),lC=Rt.create({name:"text",group:"inline"}),uC=Rt.create({name:"doc",topNode:!0,content:"block+"}),cC=uC.extend({content(){var e;return!!((e=this.editor)!=null&&e.options.extensions.find(n=>n.name==="columns"))?"(block|columns)+":"block+"}}),OW=at.create({name:"selection",addProseMirrorPlugins(){const{editor:t}=this;return[new dt({key:new kt("selection"),props:{decorations(e){return e.selection.empty?null:ht.create(e.doc,[Yt.inline(e.selection.from,e.selection.to,{class:"selection"})])}}})]}}),MW=t=>{const e=["size-small","size-medium","size-large"],n=["SizeS","SizeM","SizeL"];return e.map((r,o)=>({type:`video-${r}`,component:je,componentProps:{tooltip:`editor.${r.replace("-",".")}.tooltip`,icon:n[o],action:()=>t.commands.updateVideo({width:gf[r]}),isActive:()=>t.isActive("video",{width:gf[r]})}}))},BW=t=>[...MW(t),{type:"remove",component:je,componentProps:{tooltip:"editor.remove",icon:"Trash2",action:()=>{const{state:e,dispatch:n}=t.view;Cu(e,n)}}}],RW=(t,e,{editor:n,extension:r,t:o})=>{const{extensions:s=[]}=n.extensionManager,a={};for(const l of Object.keys(t)){const u=t[l];if(!u)continue;const c=[];for(const m of u){if(m==="divider"){const y=c[c.length-1];if((y==null?void 0:y.type)==="divider")continue;c.push({type:"divider",component:void 0,componentProps:{}});continue}const g=e.find(y=>y.type===m);if(g){c.push({...g,componentProps:{...g.componentProps,tooltip:g.componentProps.tooltip?o(g.componentProps.tooltip):void 0},componentSlots:g.componentSlots});continue}const b=s.find(y=>y.name===m);if(b){const{button:y}=b.options,w=y({editor:n,extension:b,t:o});c.push({type:m,component:w.component,componentProps:w.componentProps,componentSlots:w.componentSlots});continue}}const f=c[c.length-1],h=c[0];(f==null?void 0:f.type)==="divider"&&c.pop(),(h==null?void 0:h.type)==="divider"&&c.shift(),a[l]=c}return a},IW=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),LW=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var vg;const PW=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),DW=(vg=String.fromCodePoint)!==null&&vg!==void 0?vg:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function FW(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=PW.get(t))!==null&&e!==void 0?e:t}var yn;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(yn||(yn={}));const VW=32;var Ni;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Ni||(Ni={}));function yg(t){return t>=yn.ZERO&&t<=yn.NINE}function $W(t){return t>=yn.UPPER_A&&t<=yn.UPPER_F||t>=yn.LOWER_A&&t<=yn.LOWER_F}function zW(t){return t>=yn.UPPER_A&&t<=yn.UPPER_Z||t>=yn.LOWER_A&&t<=yn.LOWER_Z||yg(t)}function HW(t){return t===yn.EQUALS||zW(t)}var wn;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(wn||(wn={}));var es;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(es||(es={}));class UW{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=wn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=es.Strict}startEntity(e){this.decodeMode=e,this.state=wn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case wn.EntityStart:return e.charCodeAt(n)===yn.NUM?(this.state=wn.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=wn.NamedEntity,this.stateNamedEntity(e,n));case wn.NumericStart:return this.stateNumericStart(e,n);case wn.NumericDecimal:return this.stateNumericDecimal(e,n);case wn.NumericHex:return this.stateNumericHex(e,n);case wn.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|VW)===yn.LOWER_X?(this.state=wn.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=wn.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,o){if(n!==r){const s=r-n;this.result=this.result*Math.pow(o,s)+Number.parseInt(e.substr(n,s),o),this.consumed+=s}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const o=e.charCodeAt(n);if(yg(o)||$W(o))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(o,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const o=e.charCodeAt(n);if(yg(o))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(o,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===yn.SEMI)this.consumed+=1;else if(this.decodeMode===es.Strict)return 0;return this.emitCodePoint(FW(this.result),this.consumed),this.errors&&(e!==yn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let o=r[this.treeIndex],s=(o&Ni.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const a=e.charCodeAt(n);if(this.treeIndex=WW(r,o,this.treeIndex+Math.max(1,s),a),this.treeIndex<0)return this.result===0||this.decodeMode===es.Attribute&&(s===0||HW(a))?0:this.emitNotTerminatedNamedEntity();if(o=r[this.treeIndex],s=(o&Ni.VALUE_LENGTH)>>14,s!==0){if(a===yn.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==es.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,o=(r[n]&Ni.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,o,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:o}=this;return this.emitCodePoint(n===1?o[e]&~Ni.VALUE_LENGTH:o[e+1],r),n===3&&this.emitCodePoint(o[e+2],r),r}end(){var e;switch(this.state){case wn.NamedEntity:return this.result!==0&&(this.decodeMode!==es.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case wn.NumericDecimal:return this.emitNumericEntity(0,2);case wn.NumericHex:return this.emitNumericEntity(0,3);case wn.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case wn.EntityStart:return 0}}}function dC(t){let e="";const n=new UW(t,r=>e+=DW(r));return function(o,s){let a=0,l=0;for(;(l=o.indexOf("&",l))>=0;){e+=o.slice(a,l),n.startEntity(s);const c=n.write(o,l+1);if(c<0){a=l+n.end();break}a=l+c,l=c===0?a+1:a}const u=e+o.slice(a);return e="",u}}function WW(t,e,n,r){const o=(e&Ni.BRANCH_LENGTH)>>7,s=e&Ni.JUMP_TABLE;if(o===0)return s!==0&&r===s?n:-1;if(s){const u=r-s;return u<0||u>=o?-1:t[n+u]-1}let a=n,l=a+o-1;for(;a<=l;){const u=a+l>>>1,c=t[u];if(c<r)a=u+1;else if(c>r)l=u-1;else return t[u+o]}return-1}const jW=dC(IW);dC(LW);function qW(t,e=es.Legacy){return jW(t,e)}var Qt;(function(t){t.Attribute="attribute",t.Pseudo="pseudo",t.PseudoElement="pseudo-element",t.Tag="tag",t.Universal="universal",t.Adjacent="adjacent",t.Child="child",t.Descendant="descendant",t.Parent="parent",t.Sibling="sibling",t.ColumnCombinator="column-combinator"})(Qt||(Qt={}));var Dr;(function(t){t.Any="any",t.Element="element",t.End="end",t.Equals="equals",t.Exists="exists",t.Hyphen="hyphen",t.Not="not",t.Start="start"})(Dr||(Dr={}));const fC=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,KW=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,GW=new Map([[126,Dr.Element],[94,Dr.Start],[36,Dr.End],[42,Dr.Any],[33,Dr.Not],[124,Dr.Hyphen]]),XW=new Set(["has","not","matches","is","where","host","host-context"]);function JW(t){switch(t.type){case Qt.Adjacent:case Qt.Child:case Qt.Descendant:case Qt.Parent:case Qt.Sibling:case Qt.ColumnCombinator:return!0;default:return!1}}const YW=new Set(["contains","icontains"]);function ZW(t,e,n){const r=parseInt(e,16)-65536;return r!==r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,r&1023|56320)}function Qu(t){return t.replace(KW,ZW)}function wg(t){return t===39||t===34}function pC(t){return t===32||t===9||t===10||t===12||t===13}function QW(t){const e=[],n=hC(e,`${t}`,0);if(n<t.length)throw new Error(`Unmatched selector: ${t.slice(n)}`);return e}function hC(t,e,n){let r=[];function o(m){const g=e.slice(n+m).match(fC);if(!g)throw new Error(`Expected name, found ${e.slice(n)}`);const[b]=g;return n+=m+b.length,Qu(b)}function s(m){for(n+=m;n<e.length&&pC(e.charCodeAt(n));)n++}function a(){n+=1;const m=n;let g=1;for(;g>0&&n<e.length;n++)e.charCodeAt(n)===40&&!l(n)?g++:e.charCodeAt(n)===41&&!l(n)&&g--;if(g)throw new Error("Parenthesis not matched");return Qu(e.slice(m,n-1))}function l(m){let g=0;for(;e.charCodeAt(--m)===92;)g++;return(g&1)===1}function u(){if(r.length>0&&JW(r[r.length-1]))throw new Error("Did not expect successive traversals.")}function c(m){if(r.length>0&&r[r.length-1].type===Qt.Descendant){r[r.length-1].type=m;return}u(),r.push({type:m})}function f(m,g){r.push({type:Qt.Attribute,name:m,action:g,value:o(1),namespace:null,ignoreCase:"quirks"})}function h(){if(r.length&&r[r.length-1].type===Qt.Descendant&&r.pop(),r.length===0)throw new Error("Empty sub-selector");t.push(r)}if(s(0),e.length===n)return n;e:for(;n<e.length;){const m=e.charCodeAt(n);switch(m){case 32:case 9:case 10:case 12:case 13:{(r.length===0||r[0].type!==Qt.Descendant)&&(u(),r.push({type:Qt.Descendant})),s(1);break}case 62:{c(Qt.Child),s(1);break}case 60:{c(Qt.Parent),s(1);break}case 126:{c(Qt.Sibling),s(1);break}case 43:{c(Qt.Adjacent),s(1);break}case 46:{f("class",Dr.Element);break}case 35:{f("id",Dr.Equals);break}case 91:{s(1);let g,b=null;e.charCodeAt(n)===124?g=o(1):e.startsWith("*|",n)?(b="*",g=o(2)):(g=o(0),e.charCodeAt(n)===124&&e.charCodeAt(n+1)!==61&&(b=g,g=o(1))),s(0);let y=Dr.Exists;const w=GW.get(e.charCodeAt(n));if(w){if(y=w,e.charCodeAt(n+1)!==61)throw new Error("Expected `=`");s(2)}else e.charCodeAt(n)===61&&(y=Dr.Equals,s(1));let x="",_=null;if(y!=="exists"){if(wg(e.charCodeAt(n))){const k=e.charCodeAt(n);let A=n+1;for(;A<e.length&&(e.charCodeAt(A)!==k||l(A));)A+=1;if(e.charCodeAt(A)!==k)throw new Error("Attribute value didn't end");x=Qu(e.slice(n+1,A)),n=A+1}else{const k=n;for(;n<e.length&&(!pC(e.charCodeAt(n))&&e.charCodeAt(n)!==93||l(n));)n+=1;x=Qu(e.slice(k,n))}s(0);const C=e.charCodeAt(n)|32;C===115?(_=!1,s(1)):C===105&&(_=!0,s(1))}if(e.charCodeAt(n)!==93)throw new Error("Attribute selector didn't terminate");n+=1;const S={type:Qt.Attribute,name:g,action:y,value:x,namespace:b,ignoreCase:_};r.push(S);break}case 58:{if(e.charCodeAt(n+1)===58){r.push({type:Qt.PseudoElement,name:o(2).toLowerCase(),data:e.charCodeAt(n)===40?a():null});continue}const g=o(1).toLowerCase();let b=null;if(e.charCodeAt(n)===40)if(XW.has(g)){if(wg(e.charCodeAt(n+1)))throw new Error(`Pseudo-selector ${g} cannot be quoted`);if(b=[],n=hC(b,e,n+1),e.charCodeAt(n)!==41)throw new Error(`Missing closing parenthesis in :${g} (${e})`);n+=1}else{if(b=a(),YW.has(g)){const y=b.charCodeAt(0);y===b.charCodeAt(b.length-1)&&wg(y)&&(b=b.slice(1,-1))}b=Qu(b)}r.push({type:Qt.Pseudo,name:g,data:b});break}case 44:{h(),r=[],s(1);break}default:{if(e.startsWith("/*",n)){const y=e.indexOf("*/",n+2);if(y<0)throw new Error("Comment was not terminated");n=y+2,r.length===0&&s(0);break}let g=null,b;if(m===42)n+=1,b="*";else if(m===124){if(b="",e.charCodeAt(n+1)===124){c(Qt.ColumnCombinator),s(2);break}}else if(fC.test(e.slice(n)))b=o(0);else break e;e.charCodeAt(n)===124&&e.charCodeAt(n+1)!==124&&(g=b,e.charCodeAt(n+1)===42?(b="*",n+=2):b=o(1)),r.push(b==="*"?{type:Qt.Universal,namespace:g}:{type:Qt.Tag,name:b,namespace:g})}}}return h(),n}function xg(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/\xA0/g,"&nbsp;").replace(/\xAD/g,"&shy;")}var mC=t=>qW(t);function NW(t,e,n,r){if(typeof e=="function")return e({props:{...n,children:r},attrs:n,children:r,h:t.h,context:t});{let o=!0,s;if(e?e.toLowerCase()==="fragment"?(s=t.document.createDocumentFragment(),o=!1):s=t.document.createElement(e):s=t.document.createElement("div"),n&&o){const a=s;for(let[l,u]of Object.entries(n)){l=l.toString();const c=l.toLowerCase();c==="classname"?a.className=u:c==="on"?Object.entries(u).forEach(([f,h])=>{a.setAttribute(`on${f}`,String(h))}):u!==!1&&u!=null&&(u===!0?a.setAttribute(l,l):a.setAttribute(l,u.toString()))}}if(r)for(const a of r){const l=Array.isArray(a)?[...a]:[a];for(const u of l)u&&u!==!1&&u!=null&&(typeof u!="object"?s.appendChild(t.document.createTextNode(u.toString())):s.appendChild(u))}return s}}function gC(t,e,...n){return typeof t=="object"&&(t="fragment",n=t.children,e=t.attrs),Array.isArray(e)?(n=[e],e={}):e?e.attrs&&(e={...e.attrs,...e},delete e.attrs):e={},{tag:t,attrs:e,children:typeof n[0]=="string"?n:n.flat(Number.POSITIVE_INFINITY)}}function ej(t){return t.h=function(n,r,...o){const{tag:s,attrs:a,children:l}=gC(n,r,o);return NW(t,s,a,l)},t.h}var bC={};function tj(t){let e=bC[t];return e==null&&(e=QW(t),bC[t]=e),e}function nj(t,e,{debug:n=!1}={}){for(const r of tj(t)){const o=(s,a)=>{var u,c,f,h;let l=!1;for(const m of a){const{type:g,name:b,action:y,value:w,_ignoreCase:x=!0,data:_}=m;if(g==="attribute")y==="equals"?l=s.getAttribute(b)===w:y==="start"?l=!!((u=s.getAttribute(b))!=null&&u.startsWith(w)):y==="end"?l=!!((c=s.getAttribute(b))!=null&&c.endsWith(w)):y==="element"?b==="class"?l=s.classList.contains(w):l=!!((f=s.getAttribute(b))!=null&&f.includes(w)):y==="exists"?l=s.hasAttribute(b):y==="any"?l=!!((h=s.getAttribute(b))!=null&&h.includes(w)):console.warn("Unknown CSS selector action",y);else if(g==="tag")l=s.tagName===b.toUpperCase();else if(g==="universal")l=!0;else if(g==="pseudo"){if(b==="not"){let S=!0;_.forEach(C=>{o(s,C)||(S=!1)}),l=!S}}else console.warn("Unknown CSS selector type",g,t,a);if(!l)break}return l};if(o(e,r))return!0}return!1}var rj=Symbol.for("nodejs.util.inspect.custom"),vC={fontWeight:"bold"},yC={fontStyle:"italic"},wC={backgroundColor:"rgb(255, 250, 165)"},xC={textDecorations:"underline"},Cg={textDecorations:"line-through"},oj={b:vC,strong:vC,em:yC,i:yC,mark:wC,u:xC,a:xC,s:Cg,del:Cg,ins:wC,strike:Cg};function CC(t){return t.toLowerCase().replace(/[^a-z0-9]+(.)/gi,(e,n)=>n.toUpperCase())}var ni=class _h{constructor(){this.append=this.appendChild,this._parentNode=null,this._childNodes=[]}get nodeType(){return console.error("Subclasses should define nodeType!"),0}get nodeName(){return console.error("Subclasses should define nodeName!"),""}get nodeValue(){return null}cloneNode(e=!1){const n=new this.constructor;return e&&(n._childNodes=this._childNodes.map(r=>r.cloneNode(!0)),n._fixChildNodesParent()),n}_fixChildNodesParent(){this._childNodes.forEach(e=>e._parentNode=this)}insertBefore(e,n){if(e!==n){let r=n?this._childNodes.indexOf(n):0;r<0&&(r=0),this._childNodes.splice(r,0,e),this._fixChildNodesParent()}}appendChild(e){if(e!=null){if(e===this){console.warn("Cannot appendChild to self");return}if(e instanceof _g&&console.warn("No defined how to append a document to a node!",e),e instanceof Eg)for(const n of[...e._childNodes])this.appendChild(n);else if(Array.isArray(e))for(const n of[...e])this.appendChild(n);else if(e instanceof _h)e.remove(),this._childNodes.push(e);else try{const n=typeof e=="string"?e:JSON.stringify(e,null,2);this._childNodes.push(new dl(n))}catch(n){console.error(`The data ${e} to be added to ${this.render()} is problematic: ${n}`)}this._fixChildNodesParent()}}removeChild(e){const n=this._childNodes.indexOf(e);n>=0&&(e._parentNode=null,this._childNodes.splice(n,1),this._fixChildNodesParent())}remove(){var e;return(e=this==null?void 0:this.parentNode)==null||e.removeChild(this),this}replaceChildren(...e){this._childNodes=e.map(n=>typeof n=="string"?new dl(n):n.remove()),this._fixChildNodesParent()}replaceWith(...e){const n=this._parentNode;if(n){const r=this._indexInParent();r>=0&&(e=e.map(o=>typeof o=="string"?new dl(o):o.remove()),n._childNodes.splice(r,1,...e),this._parentNode=null,n._fixChildNodesParent())}}_indexInParent(){return this._parentNode?this._parentNode.childNodes.indexOf(this):-1}get parentNode(){return this._parentNode}get childNodes(){return this._childNodes||[]}get children(){return this._childNodes||[]}get firstChild(){return this._childNodes[0]}get lastChild(){return this._childNodes[this._childNodes.length-1]}get nextSibling(){const e=this._indexInParent();return e!=null&&this.parentNode.childNodes[e+1]||null}get previousSibling(){const e=this._indexInParent();return e>0&&this.parentNode.childNodes[e-1]||null}flatten(){const e=[];this instanceof ro&&e.push(this);for(const n of this._childNodes)e.push(...n.flatten());return e}flattenNodes(){const e=[];e.push(this);for(const n of this._childNodes)e.push(...n.flattenNodes());return e}render(){return""}get textContent(){return this._childNodes.map(e=>e.textContent).join("")}set textContent(e){this._childNodes=[],e&&this.appendChild(new dl(e.toString()))}contains(e){return e===this?!0:this._childNodes.some(n=>n.contains(e))}get ownerDocument(){var e;return this.nodeType===_h.DOCUMENT_NODE||this.nodeType===_h.DOCUMENT_FRAGMENT_NODE?this:(e=this==null?void 0:this._parentNode)==null?void 0:e.ownerDocument}toString(){return`${this.nodeName}`}[rj](){return`${this.constructor.name} "${this.render()}"`}};ni.ELEMENT_NODE=1,ni.TEXT_NODE=3,ni.CDATA_SECTION_NODE=4,ni.PROCESSING_INSTRUCTION_NODE=7,ni.COMMENT_NODE=8,ni.DOCUMENT_NODE=9,ni.DOCUMENT_TYPE_NODE=10,ni.DOCUMENT_FRAGMENT_NODE=11;var ts=ni,dl=class extends ts{get nodeType(){return ts.TEXT_NODE}get nodeName(){return"#text"}get nodeValue(){return this._text||""}get textContent(){return this.nodeValue}constructor(t=""){super(),this._text=t}render(){var e;const t=(e=this.parentNode)==null?void 0:e.tagName;return t==="SCRIPT"||t==="STYLE"?this._text:xg(this._text)}cloneNode(t=!1){const e=super.cloneNode(t);return e._text=this._text,e}},EC=class extends ts{getElementById(t){return this.flatten().find(e=>e._attributes.id===t)}getElementsByClassName(t){return this.flatten().filter(e=>e.classList.contains(t))}matches(t){return nj(t,this)}querySelectorAll(t){return this.flatten().filter(e=>e.matches(t))}querySelector(t){return this.flatten().find(e=>e.matches(t))}parent(t){var e;return this.matches(t)?this:this.parentNode==null?null:(e=this.parentNode)==null?void 0:e.parent(t)}handle(t,e){let n=0;for(const r of this.querySelectorAll(t))e(r,n++)}},ro=class extends EC{get nodeType(){return ts.ELEMENT_NODE}get nodeName(){return this._nodeName}constructor(t="div",e={}){super(),this._originalTagName=t,this._nodeName=(t||"").toUpperCase(),this._attributes=e||{}}cloneNode(t=!1){const e=super.cloneNode(t);return e._originalTagName=this._originalTagName,e._nodeName=this._nodeName,e._attributes=Object.assign({},this._attributes),e}get attributes(){return Object.entries(this._attributes).map(([t,e])=>({name:t,value:e}))}get attributesObject(){return{...this._attributes}}_findAttributeName(t){const e=t.toLowerCase();return Object.keys(this._attributes).find(n=>e===n.toLowerCase())||null}setAttribute(t,e){this.removeAttribute(t),this._attributes[t]=e,this._styles=void 0,this._dataset=void 0}getAttribute(t){const e=this._findAttributeName(t),n=e?this._attributes[e]:null;return n==null?null:typeof n=="string"?n:""}removeAttribute(t){this._findAttributeName(String(t))&&delete this._attributes[t]}hasAttribute(t){const e=this._findAttributeName(t);return e?this._attributes[e]!=null:!1}get style(){if(this._styles==null){const t={};let e=0;const n=this.getAttribute("style");if(n){let r;const o=/\s*([\w-]+)\s*:\s*((url\(.*?\)[^;]*|[^;]+))/gi;for(;r=o.exec(n);){++e;const s=r[1],a=r[2].trim();t[s]=a,t[CC(s)]=a}}this._styles={get length(){return e},getPropertyValue(r){return t[r]},...oj[this.tagName.toLowerCase()],...t}}return this._styles}get dataset(){if(this._dataset==null){const t={};for(const[e,n]of Object.entries(this._attributes))e.startsWith("data-")&&(t[e.slice(5)]=n,t[CC(e.slice(5))]=n);this._dataset=t}return this._dataset}get tagName(){return this._nodeName}setTagName(t){this._nodeName=t.toUpperCase()}get id(){return this._attributes.id||null}set id(t){t==null?delete this._attributes.id:this._attributes.id=t}get src(){return this._attributes.src}set src(t){t==null?delete this._attributes.src:this._attributes.src=t}getElementsByTagName(t){t=t.toUpperCase();const e=this.flatten();return t!=="*"?e.filter(n=>n.tagName===t):e}setInnerHTML(t){}get innerHTML(){return this._childNodes.map(t=>t.render(sp)).join("")}set innerHTML(t){this.setInnerHTML(t)}get outerHTML(){return this.render(ap)}get className(){return this._attributes.class||""}set className(t){Array.isArray(t)?t=t.filter(e=>!!e).join(" "):typeof t=="object"&&(t=Object.entries(t).filter(([e,n])=>!!n).map(([e,n])=>e).join(" ")),this._attributes.class=t}get classList(){const t=String(this.className??"").trim().split(/\s+/g)||[];return{contains(e){return t.includes(e)},add:e=>{t.includes(e)||(t.push(e),this.className=t)},remove:e=>{const n=t.indexOf(e);n>=0&&(t.splice(n,1),this.className=t)}}}render(t=ap){return t(this._originalTagName||this.tagName,this._attributes,this._childNodes.map(e=>e.render(t)).join(""))}},_C=class ik extends ts{get nodeName(){return super.nodeName}get nodeValue(){return super.nodeValue}get nodeType(){return ik.DOCUMENT_TYPE_NODE}render(){return"<!DOCTYPE html>"}},Eg=class sk extends EC{get nodeType(){return ts.DOCUMENT_FRAGMENT_NODE}get nodeName(){return"#document-fragment"}render(e=ap){return this._childNodes.map(n=>n.render(e)||[]).join("")}get innerHTML(){return this._childNodes.map(e=>e.render(sp)).join("")}createElement(e,n={}){return new ro(e,n)}createDocumentFragment(){return new sk}createTextNode(e){return new dl(e)}},_g=class extends Eg{get nodeType(){return ts.DOCUMENT_NODE}get nodeName(){return"#document"}get documentElement(){return this.firstChild}render(t=ap){let e=super.render(t);return this.docType&&(e=this.docType.render()+e),e}},SC=class extends _g{constructor(t=!1){if(super(),this.docType=new _C,!t){const e=new ro("html"),n=new ro("body"),r=new ro("head"),o=new ro("title");e.appendChild(r),r.appendChild(o),e.appendChild(n),this.appendChild(e)}}get body(){let t=this.querySelector("body");if(!t){let e=this.querySelector("html");e||(e=new ro("html"),this.appendChild(e)),t=new ro("body"),e.appendChild(e)}return t}get title(){var t;return((t=this.querySelector("title"))==null?void 0:t.textContent)||""}set title(t){const e=this.querySelector("title");e&&(e.textContent=t)}get head(){let t=this.querySelector("head");if(!t){let e=this.querySelector("html");e||(e=new ro("html"),this.appendChild(e)),t=new ro("head"),e.insertBefore(e)}return t}};function ij(){return new _g}function sj(){return new SC}var kC=ij();ej({document:kC});var aj={},lj=aj.hasOwnProperty;function TC(t,e){return lj.call(t,e)}var AC=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr","command"];function OC(t,e,n={},r){const o=!(typeof r=="string"&&r===""||Array.isArray(r)&&(r.length===0||r.length===1&&r[0]==="")||r==null),s=[];if(e=e.replace(/__/g,":"),e!=="noop"&&e!==""){e!=="cdata"?s.push(`<${e}`):s.push("<![CDATA[");for(let a in n)if(a&&TC(n,a)){const l=n[a];if(a==="html")continue;a.toLowerCase()==="classname"&&(a="class"),a=a.replace(/__/g,":"),l===!0?s.push(` ${a}`):a==="style"&&typeof l=="object"?s.push(` ${a}="${Object.keys(l).filter(u=>l[u]!=null).map(u=>{let c=l[u];return c=typeof c=="number"?`${c}px`:c,`${u.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${c}`}).join(";")}"`):l!==!1&&l!=null&&s.push(` ${a}="${xg(l.toString())}"`)}if(e!=="cdata"){if(t&&!o)return s.push(" />"),s.join("");s.push(">")}if(!t&&AC.includes(e))return s.join("")}if(o){if(typeof r=="string")s.push(r);else if(r&&r.length>0){for(let a of r)if(a!=null&&a!==!1){Array.isArray(a)||(a=[a]);for(const l of a)l.startsWith("<")&&l.endsWith(">")||e==="script"||e==="style"?s.push(l):s.push(xg(l.toString()))}}}return n.html&&s.push(n.html),e!=="noop"&&e!==""&&(e!=="cdata"?s.push(`</${e}>`):s.push("]]>")),s.join("")}function sp(t,e,...n){const{tag:r,attrs:o,children:s}=gC(t,e,n);return OC(!1,r,o,s)}var ap=OC.bind(null,!1);sp.firstLine="<!DOCTYPE html>",sp.html=!0;var uj=/([^=\s]+)(\s*=\s*(("([^"]*)")|('([^']*)')|[^>\s]+))?/g,cj=/^<\/([^>\s]+)[^>]*>/m,dj=/^<([^>\s/]+)((\s+[^=>\s]+(\s*=\s*(("[^"]*")|('[^']*')|[^>\s]+))?)*)\s*(?:\/\s*)?>/m,fj=/\s*\/\s*>\s*$/m,pj=class{constructor(t={}){this.attrRe=uj,this.endTagRe=cj,this.startTagRe=dj,this.defaults={ignoreWhitespaceText:!1},t.scanner&&(this.scanner=t.scanner),this.options=Object.assign({},this.defaults,t)}parse(t){let e=!1,n,r,o;for(;t.length;){if(t.substring(0,4)==="<!--")n=t.indexOf("-->"),n!==-1?(this.scanner.comment(t.substring(4,n)),t=t.substring(n+3),e=!1):e=!0;else if(t.substring(0,2)==="</")r=this.endTagRe.exec(t),r?(t=RegExp.rightContext,e=!1,this.parseEndTag(RegExp.lastMatch,r[1])):e=!0;else if(t.charAt(0)==="<")if(r=this.startTagRe.exec(t),r){t=RegExp.rightContext,e=!1;const s=this.parseStartTag(RegExp.lastMatch,r[1],r);(s==="script"||s==="style")&&(n=t.search(new RegExp(`</${s}`,"i")),n!==-1?(this.scanner.characters(t.substring(0,n)),t=t.substring(n),e=!1):e=!0)}else e=!0;if(e){n=t.indexOf("<");let s=n;n===0&&(n=t.substring(1).indexOf("<"),s=s+1),n===-1?(o=t,t=""):(o=t.substring(0,s),t=t.substring(s)),(!this.options.ignoreWhitespaceText||!/^\s*$/.test(o))&&this.scanner.characters(o)}e=!0,r=null}}parseStartTag(t,e,n){const r=fj.test(t);let o=n[2];r&&(o=o.replace(/\s*\/\s*$/,""));const s=this.parseAttributes(e,o);return this.scanner.startElement(e,s,r,n[0]),e.toLocaleLowerCase()}parseEndTag(t,e){this.scanner.endElement(e)}parseAttributes(t,e){const n={};return e.replace(this.attrRe,(...r)=>{const[o,s,a,l,u,c,f,h]=r;n[s]=h??c??l??!0}),n}};function hj(t){if(typeof t!="string")throw console.error("parseHTML requires string, found",t),new Error("parseHTML requires string");const e=t.indexOf("<!")===0?new SC(!0):new Eg,n=[e];return new pj({scanner:{startElement(o,s,a){if(o.toLowerCase()==="!doctype"){e.docType=new _C;return}for(const c in s)if(TC(s,c)){const f=s[c];typeof f=="string"&&(s[c]=mC(f))}const u=n[n.length-1];if(u){const c=kC.createElement(o,s);u.appendChild(c),AC.includes(o.toLowerCase())||a||n.push(c)}},endElement(o){n.pop()},characters(o){var a;o=mC(o);const s=n[n.length-1];((a=s==null?void 0:s.lastChild)==null?void 0:a.nodeType)===ts.TEXT_NODE?s.lastChild._text+=o:s&&s.appendChild(new dl(o))},comment(o){}}}).parse(t),e}ro.prototype.setInnerHTML=function(t){const e=hj(t);this._childNodes=e._childNodes,this._fixChildNodesParent()};function mj(t,e,n){return Mi.fromSchema(e).serializeFragment(t.content,{document:sj()}).render()}function gj(t,e){const n=Nr.fromJSON(e,t);return mj(n,e)}function bj(t,e){const n=document.getElementById(t.attrs.id)??Sg.getElementById(t.attrs.id);if(!n)return null;const r=MC(n),{lastChild:o}=t,{childCount:s}=t,a=t.content.content.slice(0,s);if(!o)return!1;o.isText&&a.push(e.text("gg"));const l=gj(vj(t.type.create(t.attrs,a,t.marks)),e);return wj(l,t.attrs.id,!1)>r}function vj(t){return{type:"doc",content:[t.toJSON()]}}let yj=null,Sg=null;const kg=new Map;function wj(t,e,n=!0){if(n&&kg.has(t))return kg.get(t);const r=Sg.getElementById("computeddiv");if(r){r.innerHTML=`<p>&nbsp;</p>${t}`;const o=Sg.getElementById(e),{height:s}=MC(o);return r.innerHTML="&nbsp;",n&&kg.set(t,s),s}return 0}function MC(t){const e=window.getComputedStyle(t)||yj.contentWindow.getComputedStyle(t),n=e.getPropertyValue("margin-top"),r=e.getPropertyValue("margin-bottom"),o=parseFloat(n)+parseFloat(r),{height:s}=t.getBoundingClientRect();return{margin:o,height:o+t.offsetHeight+parseFloat(e.borderWidth)}}function Tg(){return Gi(10)}const Ag="paragraph",Fr="page",BC="Extend",fl="Node",xj=fl+BC,Cj="CC",Og="heading",lp="bulletList",Mg="listItem",RC="taskList",Ej="taskItem",up="orderedList",pl="table",Bg="tableHeader",Rg="tableRow",_j="tableCell",Ig="column",Nu="columns",Lg="textBox",hl="image",ml="imageUpload",Sj="iframe",kj="file",Pg="codeBlock",Dg="blockquote",Tj="audio",Aj="toc",IC="video",Oj="horizontalrule",Fg="pagination",Mj=[pl,up,lp,RC],Bj=[IC,hl],Vg="link",Rj="placeholder",Ij="focus",Lj="text",Pj="text-bubble",Dj="gapCursor",Fj="dropCursor",Vj="characterCount",$j="hardBreak",zj="textStyle",Hj="selection",LC="superText",$g="configPlan",Uj="fontSize",Wj="fontFamily",jj="bold",qj="italic",Kj="underline",Gj="strike",Xj="color",Jj="highlight",Yj="moreMark",Zj="textAlign",Qj="indent",Nj="lineHeight",eq="painter",tq="clear",PC="spellchecker",DC="fontSizeIncreaseDecrease",nq=Object.freeze(Object.defineProperty({__proto__:null,AUDIO:Tj,BLOCKQUOTE:Dg,BOLD:jj,BULLETLIST:lp,CASSIE_BLOCK:fl,CASSIE_BLOCK_EXTEND:xj,CC:Cj,CHARACTER_COUNT:Vj,CLEAR:tq,CODE_BLOCK:Pg,COLOR:Xj,COLUMN:Ig,COLUMNS:Nu,CONFIG_PLAN:$g,DROP_CURSOR:Fj,EXTEND:BC,FILE:kj,FOCUS:Ij,FONTSIZEINCREASEDECREASE:DC,FONT_FAMILY:Wj,FONT_SIZE:Uj,GAP_CURSOR:Dj,HARD_BREAK:$j,HEADING:Og,HIGHLIGHT:Jj,HORIZONTALRULE:Oj,IFRAME:Sj,IMAGE:hl,IMAGE_UPLOAD:ml,INDENT:Qj,ITALIC:qj,LINE_HEIGHT:Nj,LINK:Vg,LISTITEM:Mg,LIST_MEDIA:Bj,LIST_TYPE:Mj,MORE_MARK:Yj,ORDEREDLIST:up,PAGE:Fr,PAGEBREAK:Fg,PAINTER:eq,PARAGRAPH:Ag,PLACEHOLDER:Rj,SELECTION:Hj,SPELLCHECKER:PC,STRIKE:Gj,SUPER_TEXT:LC,TABLE:pl,TABLEHEADER:Bg,TABLE_CELL:_j,TABLE_ROW:Rg,TASKITEM:Ej,TASKLIST:RC,TEXT:Lj,TEXT_ALIGN:Zj,TEXT_BOX:Lg,TEXT_BUBBLE:Pj,TEXT_STYLE:zj,TOC:Aj,UNDERLINE:Kj,VIDEO:IC},Symbol.toStringTag,{value:"Module"})),cp=i.defineComponent({__name:"ContextMenu",props:{dir:{},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const o=Lt(t,e);return(s,a)=>(i.openBlock(),i.createBlock(i.unref(eA),i.normalizeProps(i.guardReactiveProps(i.unref(o))),{default:i.withCtx(()=>[i.renderSlot(s.$slots,"default")]),_:3},16))}}),dp=i.defineComponent({__name:"ContextMenuContent",props:{forceMount:{type:Boolean},loop:{type:Boolean},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},sticky:{},hideWhenDetached:{type:Boolean},prioritizePosition:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","closeAutoFocus"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>{const{class:a,...l}=n;return l}),s=Lt(o,r);return(a,l)=>(i.openBlock(),i.createBlock(i.unref(nA),null,{default:i.withCtx(()=>[i.createVNode(i.unref(rA),i.mergeProps(i.unref(s),{class:i.unref($e)("z-50 min-w-32 overflow-hidden rounded-md border bg-ed-popover p-1 text-ed-popover-foreground shadow-md animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n.class)}),{default:i.withCtx(()=>[i.renderSlot(a.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),fp=i.defineComponent({__name:"ContextMenuItem",props:{disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{},inset:{type:Boolean}},emits:["select"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>{const{class:a,...l}=n;return l}),s=Lt(o,r);return(a,l)=>(i.openBlock(),i.createBlock(i.unref(oA),i.mergeProps(i.unref(s),{class:i.unref($e)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-ed-accent focus:text-ed-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n.inset&&"pl-8",n.class)}),{default:i.withCtx(()=>[i.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),pp=i.defineComponent({__name:"ContextMenuTrigger",props:{disabled:{type:Boolean},asChild:{type:Boolean},as:{}},setup(t){const n=$n(t);return(r,o)=>(i.openBlock(),i.createBlock(i.unref(tA),i.normalizeProps(i.guardReactiveProps(i.unref(n))),{default:i.withCtx(()=>[i.renderSlot(r.$slots,"default")]),_:3},16))}}),FC=i.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const o=Lt(t,e);return(s,a)=>(i.openBlock(),i.createBlock(i.unref(qT),i.normalizeProps(i.guardReactiveProps(i.unref(o))),{default:i.withCtx(()=>[i.renderSlot(s.$slots,"default")]),_:3},16))}}),VC=i.defineComponent({__name:"DialogContent",props:{forceMount:{type:Boolean},trapFocus:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{},isOverlayTransparent:{type:Boolean}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>{const{isOverlayTransparent:a,class:l,...u}=n;return u}),s=Lt(o,r);return(a,l)=>(i.openBlock(),i.createBlock(i.unref(hv),null,{default:i.withCtx(()=>[i.createVNode(i.unref(_v),{class:i.normalizeClass(i.unref($e)("fixed inset-0 z-[60] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a.isOverlayTransparent&&"bg-transparent"))},null,8,["class"]),i.createVNode(i.unref(p7),i.mergeProps(i.unref(s),{class:i.unref($e)("fixed left-1/2 top-1/2 z-[60] grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-ed-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n.class)}),{default:i.withCtx(()=>[i.renderSlot(a.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),$C=i.defineComponent({__name:"DialogFooter",props:{class:{}},setup(t){const e=t;return(n,r)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(i.unref($e)("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2",e.class))},[i.renderSlot(n.$slots,"default")],2))}}),zC=i.defineComponent({__name:"DialogHeader",props:{class:{}},setup(t){const e=t;return(n,r)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(i.unref($e)("flex flex-col gap-y-1.5 text-center sm:text-left",e.class))},[i.renderSlot(n.$slots,"default")],2))}}),HC=i.defineComponent({__name:"DialogClose",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,r)=>(i.openBlock(),i.createBlock(i.unref(m7),i.normalizeProps(i.guardReactiveProps(e)),{default:i.withCtx(()=>[i.renderSlot(n.$slots,"default")]),_:3},16))}}),UC=i.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=i.computed(()=>{const{class:o,...s}=e;return s}),r=$n(n);return(o,s)=>(i.openBlock(),i.createBlock(i.unref(g7),i.mergeProps(i.unref(r),{class:i.unref($e)("text-lg font-semibold leading-none tracking-tight",e.class)}),{default:i.withCtx(()=>[i.renderSlot(o.$slots,"default")]),_:3},16,["class"]))}}),WC=i.defineComponent({__name:"SimpleEditor",props:{modelValue:{default:""},parentEditor:{},isReadOnly:{type:Boolean}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.inject("isMobile",!1),a=[uC,aC,lC],l=i.computed(()=>{var g;return(g=r.parentEditor)==null?void 0:g.extensionManager.extensions.find(b=>b.name==="spellchecker")}),u=i.computed(()=>{var g,b,y,w,x,_,S;return R5.configure({proofreader:new mE({api:(b=(g=l.value)==null?void 0:g.options.proofreader)==null?void 0:b.api,limit:(w=(y=l.value)==null?void 0:y.options.proofreader)==null?void 0:w.limit,transfer:(_=(x=l.value)==null?void 0:x.options.proofreader)==null?void 0:_.transfer,enabled:!1}),uiStrings:(S=l.value)==null?void 0:S.options.uiStrings})}),c=new ol({enablePasteRules:!1,enableInputRules:!1,content:r.modelValue,extensions:a.concat(u.value),editable:!r.isReadOnly,autofocus:!0,onUpdate:({editor:g})=>{o("update:modelValue",g.getHTML())}});i.watch(()=>r.isReadOnly,g=>{c.setEditable(!g)});function f(g){const{view:b}=c,{from:y}=b.state.selection;c.commands.insertContentAt(y,g)}const h=i.ref(!1);function m(){var g;c.commands.handleActiveSpellCheck(!1),h.value=!h.value,(g=c==null?void 0:c.commands)!=null&&g.setIsEnableSuggestion&&c.commands.setIsEnableSuggestion(!1)}return e({insertSpecialCharater:f,isChecked:h,toggleSpellCheck:m}),(g,b)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(i.unref($e)("h-40 overflow-y-auto",i.unref(s)&&"h-20 rounded-[5px]"))},[i.createVNode(i.unref(Lu),{editor:i.unref(c),class:i.normalizeClass(i.unref($e)(" vdc-editor break-all [&_.tiptap.ProseMirror-focused]:border-ed-input-focus [&_.tiptap]:min-h-40 [&_.tiptap]:border-[inherit]",i.unref(s)&&"[&_.tiptap]:border-ed-gray [&_.tiptap]:min-h-20",g.isReadOnly&&"[&_.tiptap]:border-none"))},null,8,["editor","class"])],2))}}),rq={class:"m-2.5 p-2.5 space-y-2.5 rounded border border-gray-200"},oq={class:"flex gap-x-2"},iq={class:"flex gap-x-7 flex-1"},sq={class:"flex items-center space-x-2 text-xs font-normal"},aq={for:"spellcheck",class:"select-none"},lq={class:"flex gap-x-2"},uq={class:"w-1/6 text-right text-sm p-2"},cq={class:"flex gap-x-2"},ec=i.defineComponent({__name:"SuperInputDialog",props:{editor:{},open:{type:Boolean},superTextInit:{},superTextId:{},superTextElementId:{}},emits:["close","save"],setup(t,{emit:e}){var A,T;const n=e,r=t,{t:o}=St(),s=i.ref(""),a=i.ref(""),l=i.ref(null),u=i.ref(!1),c=i.reactive({x:0,y:0}),f=i.ref(!1),h={x:0,y:0},m=B=>{f.value=!0,h.x=B.clientX-c.x,h.y=B.clientY-c.y,document.addEventListener("mousemove",g),document.addEventListener("mouseup",b)},g=B=>{f.value&&(c.x=B.clientX-h.x,c.y=B.clientY-h.y)},b=()=>{f.value=!1,document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",b)},y=i.computed(()=>{var L;if(!s.value)return!0;const B=document.createElement("div");return B.innerHTML=s.value,((L=B==null?void 0:B.textContent)==null?void 0:L.trim())===""});i.watch(()=>r.open,async B=>{if(B){r.superTextInit&&(s.value=r.superTextInit,r.superTextElementId&&(a.value=r.superTextElementId)),await i.nextTick();const L=document.querySelector(".draggable-dialog");if(L){const{width:I,height:V}=L.getBoundingClientRect(),q=window.innerWidth,K=window.innerHeight;c.x=(q-I)/2,c.y=(K-V)/2}}},{immediate:!0});const w=()=>{n("close"),s.value="",a.value="",u.value=!1},x=()=>{n("save",s.value),s.value=""},_=(T=(A=r.editor)==null?void 0:A.extensionManager.extensions.find(B=>B.name==="superText"))==null?void 0:T.options.specialCharModal,S=(B,L)=>{var I;L&&((I=l.value)==null||I.insertSpecialCharater(B))},C=i.computed(()=>{var B;return(B=l.value)==null?void 0:B.isChecked}),k=()=>{var B;(B=l.value)==null||B.toggleSpellCheck()};return i.onUnmounted(()=>{document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",b)}),(B,L)=>{const I=UC,V=HC,q=zC,K=$C,me=VC,z=FC;return i.openBlock(),i.createBlock(z,{open:B.open},{default:i.withCtx(()=>[i.createVNode(i.unref(hv),null,{default:i.withCtx(()=>[i.createVNode(i.unref(_v),{class:"!pointer-events-none bg-black/30"}),i.createVNode(me,{"is-overlay-transparent":"",class:"p-0 gap-0 !animate-none !transition-none","as-child":""},{default:i.withCtx(()=>{var U,P,G;return[i.createElementVNode("div",{class:"draggable-dialog fixed z-[70] pointer-events-auto",style:i.normalizeStyle({transform:`translate(${c.x}px, ${c.y}px)`,top:"0px",left:"0px"})},[i.createVNode(q,{class:"bg-blue-500 text-white p-2.5 rounded-t-[5px] cursor-move",onMousedown:i.withModifiers(m,["prevent"])},{default:i.withCtx(()=>[i.createVNode(I,null,{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.superinput")),1)]),_:1}),i.createVNode(V,{class:"absolute right-3 top-3 text-white",onClick:w},{default:i.withCtx(()=>[i.createVNode(i.unref(V1),{class:"w-5 h-5"}),L[3]||(L[3]=i.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:1}),i.createElementVNode("div",rq,[i.createElementVNode("div",oq,[L[4]||(L[4]=i.createElementVNode("label",{class:"w-1/6"}," ",-1)),i.createElementVNode("div",iq,[i.createVNode(er,{class:"text-[#65558F] bg-[#ECE6F0] hover:bg-[#ECE6F0]/90 shadow text-xs rounded font-normal h-[25px] px-3",onClick:L[0]||(L[0]=Z=>u.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.insert.symbol")),1)]),_:1}),i.createElementVNode("div",sq,[i.createVNode(Q8,{id:"spellcheck",checked:i.unref(C),class:"border-gray-300","onUpdate:checked":k},null,8,["checked"]),i.createElementVNode("label",aq,i.toDisplayString(i.unref(o)("editor.menubar.menu.spellCheck")),1)])]),u.value?(i.openBlock(),i.createBlock(i.resolveDynamicComponent((U=i.unref(_))==null?void 0:U.component),{key:0,"custom-class":"!z-[70] !pointer-events-auto",class:i.normalizeClass((G=(P=i.unref(_))==null?void 0:P.componentProps)==null?void 0:G.class),onSelectedChar:S,onClose:L[1]||(L[1]=Z=>u.value=!1)},null,40,["class"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",lq,[i.createElementVNode("label",uq,i.toDisplayString(i.unref(o)("editor.detail")),1),i.createVNode(WC,{ref_key:"simpleEditorRef",ref:l,modelValue:s.value,"onUpdate:modelValue":L[2]||(L[2]=Z=>s.value=Z),"parent-editor":B.editor,class:"flex-1"},null,8,["modelValue","parent-editor"])]),i.createElementVNode("div",cq,[L[5]||(L[5]=i.createElementVNode("label",{class:"w-1/6 text-right text-sm p-2"},"ID",-1)),i.createVNode(Ba,{class:"flex-1 rounded-none","default-value":a.value,disabled:""},null,8,["default-value"])])]),i.createVNode(K,{class:"sm:justify-center pb-3.5 pt-1"},{default:i.withCtx(()=>[i.createVNode(er,{as:"button",variant:"default",class:"bg-blue-500 hover:bg-blue-500/90",disabled:i.unref(y),onClick:x},{default:i.withCtx(()=>[i.createVNode(i.unref(F1),{class:"w-5 h-5 mr-2"}),i.createTextVNode(" "+i.toDisplayString(i.unref(o)("editor.check")),1)]),_:1},8,["disabled"]),i.createVNode(er,{as:"button",variant:"destructive",onClick:w},{default:i.withCtx(()=>[i.createVNode(i.unref(V1),{class:"w-5 h-5 mr-2"}),L[6]||(L[6]=i.createTextVNode(" Close "))]),_:1})]),_:1})],4)]}),_:1})]),_:1})]),_:1},8,["open"])}}}),zg=i.defineComponent({__name:"SelectContextMenu",props:{editor:{},mode:{},superTextStore:{},disabled:{type:Boolean}},setup(t,{expose:e}){const n=t,{t:r}=St(),o=i.ref(!1),s=i.reactive({from:0,to:0,text:""}),a=i.ref(""),l=i.ref(""),u=i.ref(!0);let c=0;const f=i.computed(()=>n.mode===Ye.EDITOR||n.mode===Ye.PLAIN_TEXT),h=()=>{const{view:C,state:k}=n.editor,{from:A,to:T}=C.state.selection,B=k.doc.textBetween(A,T,"");s.text=B,s.from=A,s.to=T},m=()=>o.value=!o.value,g=()=>{if(f.value)return;o.value=!0,h();const{from:C,to:k}=n.editor.state.selection;let A="";n.editor.state.doc.nodesBetween(C,k,T=>{var B;(B=T.attrs)!=null&&B.id&&(A=T.attrs.id)}),l.value=A,a.value=s.text},b=()=>o.value=!1,y=C=>{const k=n==null?void 0:n.superTextStore.addMoreSuperText(C);n.editor&&n.editor.commands.insertContentAt(s.from,{type:"superText",attrs:{"data-id":k,"data-text":C}}),o.value=!1,requestAnimationFrame(()=>{var T,B;const A=(T=n.editor)==null?void 0:T.view.dom.parentElement;A&&((B=n.editor)==null||B.view.focus(),A.scrollTop=c)})},w=async()=>{const{view:C,state:k}=n.editor,{from:A,to:T}=k.selection,B=k.doc.textBetween(A,T,`
249
249
  `).trim();if(B)try{await navigator.clipboard.writeText(B)}catch(L){console.error("Failed to copy:",L)}},x=async()=>{try{const C=await navigator.clipboard.readText();C&&n.editor&&n.editor.commands.insertContent(C)}catch(C){console.error("Failed to paste:",C)}},_=async C=>{if(C)try{const k=await navigator.clipboard.readText();u.value=!k.trim()}catch{u.value=!0}},S=C=>{var V,q;if(n.disabled||C.srcElement.nodeName!=="P"||!n.editor||f.value)return;const{view:k,state:A}=n.editor,{from:T,to:B}=A.selection,L=A.doc.textBetween(T,B," ").trim();s.from=T,s.to=B,s.text=L,a.value=L;let I="";A.doc.nodesBetween(T,B,K=>{var me;(me=K.attrs)!=null&&me.id&&(I=K.attrs.id)}),l.value=I,c=((q=(V=n.editor)==null?void 0:V.view.dom.parentElement)==null?void 0:q.scrollTop)||0,k.dom.blur(),o.value=!0};return e({toggleDialog:m,openDialog:g,closeDialog:b}),(C,k)=>{const A=ec,T=pp,B=fp,L=dp,I=cp;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(A,{open:o.value,editor:C.editor,"super-text-init":a.value,"super-text-id":l.value,onClose:m,onSave:y},null,8,["open","editor","super-text-init","super-text-id"]),i.createVNode(I,{"onUpdate:open":_},{default:i.withCtx(()=>[i.createVNode(T,{as:"template",class:"relative",disabled:i.unref(f),onDblclick:k[0]||(k[0]=i.withModifiers(V=>S(V),["prevent","stop"]))},{default:i.withCtx(()=>[i.renderSlot(C.$slots,"default")]),_:3},8,["disabled"]),i.createVNode(L,null,{default:i.withCtx(()=>[i.createVNode(B,{onSelect:g},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("editor.inputSuper")),1)]),_:1}),i.createVNode(B,{onSelect:w},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("editor.copy")),1)]),_:1}),i.createVNode(B,{disabled:u.value,onSelect:x},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(r)("editor.paste")),1)]),_:1},8,["disabled"])]),_:1})]),_:3})],64)}}});var Kn=(t=>(t.TOGGLE_SUPER_TEXT="toggle-super-text",t.SUPER_TEXT_UPDATE_POSITION="SUPER_TEXT_UPDATE_POSITION",t.RENDER_SUPER_TEXT="RENDER_SUPER_TEXT",t.SUPER_VIEW_PAGE="SUPER_VIEW_PAGE",t.INCREASE_DECREASE_FONTSIZE="increase-decrease-fontsize",t))(Kn||{});const dq={id:"editor-panel",class:"flex relative w-full h-full"},fq=i.defineComponent({__name:"PageNode",props:Us,setup(t){const{state:e,page:n,superTextStore:r}=tr(),{size:o,pagination:s,margin:a}=n.value,l=i.ref(null),u=i.ref(t.node.attrs.viewSuperTextArea),c=i.computed(()=>u.value&&t.editor.storage.page.mode!=="editor"),f=i.computed(()=>t.editor.storage.page.mode===Ye.REPORT),{width:h,height:m}=o,g=i.computed(()=>s?`calc(${m} - ${(a==null?void 0:a.top)??0} - ${(a==null?void 0:a.bottom)??0}`:"max-content"),b=Ze.useEventBus(Kn.SUPER_VIEW_PAGE);return i.watch(()=>t.node.attrs,y=>{b.emit(y.pageNumber)},{immediate:!0}),(y,w)=>{var _,S,C,k;const x=zg;return i.openBlock(),i.createBlock(i.unref(Hs),{id:y.node.attrs.id,ref_key:"containerRef",ref:l,"page-number":y.node.attrs.pageNumber,class:"overflow-hidden umo-page-node-view w-full border rounded-[3px] border-[#999999]",style:i.normalizeStyle({"--umo-page-margin-top":((_=i.unref(a))==null?void 0:_.top)??"0","--umo-page-margin-bottom":((S=i.unref(a))==null?void 0:S.bottom)??"0","--umo-page-margin-left":((C=i.unref(a))==null?void 0:C.left)??"0","--umo-page-margin-right":((k=i.unref(a))==null?void 0:k.right)??"0","--umo-page-width":i.unref(h),"--umo-page-height":i.unref(m),"--empty-node-left":"0px",left:100,"min-height":typeof i.unref(m)=="number"?`${i.unref(m)}px`:i.unref(m),height:f.value?typeof i.unref(m)=="number"?`${i.unref(m)}px`:i.unref(m):"auto"})},{default:i.withCtx(()=>[i.createElementVNode("div",dq,[i.createVNode(x,{mode:c.value?i.unref(Ye).REPORT:i.unref(Ye).EDITOR,editor:y.editor,"super-text-store":i.unref(r)},{default:i.withCtx(()=>[i.createVNode(i.unref(Ix),{class:"umo-page-node-content",style:i.normalizeStyle({height:g.value})},null,8,["style"])]),_:1},8,["mode","editor","super-text-store"])])]),_:1},8,["id","page-number","style"])}}}),ri=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},pq=ri(fq,[["__scopeId","data-v-b5bf1538"]]);function jC(t,e){const n=t.storedMarks??(t.selection.$to.parentOffset&&t.selection.$from.marks());if(n){const r=n.filter(o=>e==null?void 0:e.includes(o.type.name));t.tr.ensureMarks(r)}}const hq=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:o})=>{const{selection:s,doc:a}=e,{$from:l,$to:u}=s,c=o.extensionManager.attributes,f=hp(c,l.node().type.name,l.node().attrs);if(f.id=Tg(),f.extend&&(f.extend=!1),s instanceof Pe&&s.node.isBlock)return!l.parentOffset||!pr(a,l.pos)?!1:(r&&(t&&jC(n,o.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(r){const h=u.parentOffset===u.parent.content.size;s instanceof Ie&&e.deleteSelection();const m=l.depth===0?void 0:L6(l.node(-1).contentMatchAt(l.indexAfter(-1)));let g=h&&m?[{type:m,attrs:f}]:void 0,b=pr(e.doc,e.mapping.map(l.pos),1,g);if(!g&&!b&&pr(e.doc,e.mapping.map(l.pos),1,m?[{type:m}]:void 0)&&(b=!0,g=m?[{type:m,attrs:f}]:void 0),b&&(g||(g=[{type:l.node().type,attrs:f}]),e.split(e.mapping.map(l.pos),1,g),m&&!h&&!l.parentOffset&&l.parent.type!==m)){const y=e.mapping.map(l.before()),w=e.doc.resolve(y);l.node(-1).canReplaceWith(w.index(),w.index()+1,m)&&e.setNodeMarkup(e.mapping.map(l.before()),m)}t&&jC(n,o.extensionManager.splittableMarks),e.scrollIntoView()}return!0},mq=t=>({tr:e,state:n,dispatch:r,editor:o})=>{var y;const s=pn(t,n.schema),{$from:a,$to:l}=n.selection,u=n.selection instanceof Pe?n.selection.node:null;if(u!=null&&u.isBlock||a.depth<2||!a.sameParent(l))return!1;const c=a.node(-1);if(c.type!==s)return!1;const f=o.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let w=ue.empty;const x=a.index(-1)?1:a.index(-2)?2:3;for(let T=a.depth-x;T>=a.depth-3;T-=1)w=ue.from(a.node(T).copy(w));const _=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,S=hp(f,a.node().type.name,a.node().attrs),C=((y=s.contentMatch.defaultType)==null?void 0:y.createAndFill(S))??void 0;w=w.append(ue.from(s.createAndFill(null,C)??void 0));const k=a.before(a.depth-(x-1));e.replace(k,a.after(-_),new xe(w,4-x,0));let A=-1;e.doc.nodesBetween(k,e.doc.content.size,(T,B)=>{if(A>-1)return!1;T.isTextblock&&T.content.size===0&&(A=B+1)}),A>-1&&e.setSelection(Ie.near(e.doc.resolve(A))),e.scrollIntoView()}return!0}const h=l.pos===a.end()?c.contentMatchAt(0).defaultType:null,m=hp(f,c.type.name,c.attrs),g=hp(f,a.node().type.name,a.node().attrs);m.id=Tg(),g.id=Tg(),e.delete(a.pos,l.pos);const b=h?[{type:s,attrs:m},{type:h,attrs:g}]:[{type:s,attrs:m}];if(!pr(e.doc,a.pos,2))return!1;if(r){const{selection:w,storedMarks:x}=n,{splittableMarks:_}=o.extensionManager,S=x??(w.$to.parentOffset&&w.$from.marks());if(e.split(a.pos,2,b).scrollIntoView(),!S||!r)return!0;const C=S.filter(k=>_.includes(k.type.name));e.ensureMarks(C)}return!0},gq=[Og,Ag,lp,Mg,up,pl,Rg,fl,Lg,Dg,Ig,Nu,hl,ml,Pg,Fg,Bg,Fr],bq=Rt.create({priority:200,name:`${Fr}`,content:"block*",group:`${Fr}`,isolating:!0,selectable:!1,draggable:!1,isLeaf:!0,addOptions(){return{SystemAttributes:{},nodesComputed:{},View:Ws(pq),types:[],slots:{}}},addAttributes(){return{HTMLAttributes:{},id:{default:Gi(10)},pageNumber:{default:1},force:{default:!1},viewSuperTextArea:{default:!0},slots:{default:this.options.slots,renderHTML:()=>({})}}},parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML({node:t,HTMLAttributes:e}){return["div",{...mt(e),"data-type":this.name},0]},addCommands(){return{splitBlock:hq,splitListItem:mq,autoPaging:(t=!0)=>({tr:e,state:n,dispatch:r,editor:o})=>(r&&e.setMeta("runState",t),!0),setPageBreak:()=>({tr:t,state:e,dispatch:n,editor:r})=>(n&&t.setMeta("splitPage",!0),!0),togglePagePlugin:t=>({tr:e,dispatch:n})=>(e.setMeta("disablePage",t),n&&n(e),!0)}},addGlobalAttributes(){return[{types:gq.concat(this.options.types||[]),attributes:{id:{default:null},extend:{default:!1}}}]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.first(({commands:r})=>[()=>r.undoInputRule(),()=>r.command(({tr:o})=>{const{selection:s,doc:a}=o,{empty:l,$anchor:u}=s,{pos:c,parent:f}=u,h=Ve.atStart(a).from===c;return!l||!h||!f.type.isTextblock||f.textContent.length?!1:r.clearNodes()}),()=>qC(r),()=>r.joinBackward(),()=>r.selectNodeBackward(),()=>r.command(({editor:o,tr:s})=>{const{selection:a,doc:l}=s,{$anchor:u}=a,{pos:c}=u;if(l.childCount===1)return!1;if(Ve.atEnd(l).from===c&&!u.parentOffset)return r.deleteNode(Fr);const f=Jo(h=>h.type.name===Fr)(a);if(f){if(!f.node.firstChild)return r.deleteNode(Fr);const h=f.node.firstChild.type;if(f.start+Ve.atStart(f.node).from===c){const g=Ie.create(l,f.start-2,f.start-2),b=Jo(y=>y.type.name===Fr)(g);if(b){const y=Ve.atEnd(b.node).from+b.start,w=Ie.create(l,y,y);if(h===b.node.lastChild.type){const{parent:x}=w.$anchor;return bj(x,o.schema)?s.setSelection(w):s.step(new dn(y,c,xe.empty)),!0}s.setSelection(w)}return!0}}return!1})]),Delete:()=>this.editor.commands.first(({commands:r})=>[()=>qC(r),()=>r.command(({tr:o})=>{const{selection:s,doc:a}=o,{$anchor:l}=s,u=l.node(),c=Jo(f=>f.type.name===fl)(s);return c&&c.start+Ve.atStart(c.node).from===l.pos&&c.node.childCount===1&&u.content.size===0?!0:r.joinForward()}),()=>r.selectNodeForward(),()=>r.command(({tr:o})=>{const{selection:s,doc:a}=o,{$anchor:l}=s,{pos:u}=l;if(a.childCount===1)return!1;if(Ve.atEnd(a).from===u)return r.deleteNode(Fr);const c=Jo(f=>f.type.name===Fr)(s);if(c&&c.start+Ve.atEnd(c.node).from===u){const h=Ie.create(a,u+2,u+2),m=Jo(g=>g.type.name===Fr)(h);if(m){const g=Ve.atStart(m.node).from+m.start,b=Ie.create(a,g,g);if(Jo(w=>w.attrs.extend)(b))return o.step(new dn(u,g,xe.empty)),!0}}return!1})]),Tab:()=>this.editor.commands.first(({commands:r})=>[()=>!0]),"Mod-Enter":()=>this.editor.commands.setPageBreak()}},addNodeView(){return this.options.View}});function hp(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const o=t.find(s=>s.type===e&&s.name===r);return o?o.attribute.keepOnSplit:!1}))}const qC=t=>t.command(({tr:e})=>{const{selection:n,doc:r}=e,o=P6(r,{from:n.from,to:n.to},s=>s.type.name===fl);for(const s of o){const a=s.pos+s.node.nodeSize;if(n.from<s.pos||n.to>a)return!0}return t.deleteSelection()}),vq=at.create({name:"fontFamily",addOptions(){return{types:["textStyle"]}},addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily,renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}),yq=["data-font"],wq=i.defineComponent({__name:"FontFamilyMenuButton",props:{editor:{},disabled:{type:Boolean,default:!1},color:{default:void 0},shortcutKeys:{default:void 0},maxHeight:{default:void 0},tooltip:{default:""},items:{default:()=>[]},customClass:{default:""}},setup(t){const e=t,n=i.computed(()=>e.editor.extensionStorage["base-kit"].mode===Ye.EDITOR),{t:r}=St(),o=[{label:r("editor.fontFamily.gulim"),value:"Gulim"},{label:r("editor.fontFamily.dotum"),value:"Dotum"},{label:r("editor.fontFamily.gungsuh"),value:"Gungsuh"}],s=i.inject("fontFamily"),a=i.computed(()=>{const h=e.editor.extensionManager.extensions.find(g=>g.name==="fontFamily").options;return Et.isEmpty(h.fontFamilyMap)&&(h.fontFamilyMap=o),[{label:r("editor.fontFamily.default"),value:r("editor.fontFamily.default")},...h.fontFamilyMap]}),l=i.computed(()=>{const h={label:r("editor.fontFamily.default"),value:r("editor.fontFamily.default")};return n.value?t1(e.editor.state,"textStyle").fontFamily||h.value:s.value||h.value}),u=Ze.useEventBus("fontFamily");function c(h){h.value===l.value||h.value===r("editor.fontFamily.default")?(e.editor.commands.unsetFontFamily(),s.value=null):(s.value=h.value,e.editor.commands.setFontFamily(h.value),u.emit())}const f=i.computed(()=>{var h;return(h=a.value.find(m=>m.value===l.value))==null?void 0:h.label});return(h,m)=>(i.openBlock(),i.createBlock(Ks,{disabled:h.disabled,tooltip:h.tooltip,title:f.value,btn_class:`min-w-24 ${h.customClass}`},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,(g,b)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:b},[i.createVNode(i.unref(ll),{checked:l.value===g.value,onClick:y=>c(g)},{default:i.withCtx(()=>[i.createElementVNode("span",{class:"ml-1 h-full","data-font":g.label,style:i.normalizeStyle({fontFamily:g.value??void 0})},i.toDisplayString(g.label),13,yq)]),_:2},1032,["checked","onClick"]),g.label===i.unref(r)("editor.fontFamily.default")?(i.openBlock(),i.createBlock(i.unref(z1),{key:0})):i.createCommentVNode("",!0)],64))),128))]),_:1},8,["disabled","tooltip","title","btn_class"]))}}),KC=vq.extend({name:"fontFamily",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["textStyle"],fontFamilyMap:[],button({editor:e,extension:n,t:r}){return{component:wq,componentProps:{editor:e,disabled:!e.can().setFontFamily(""),tooltip:r("editor.fontFamily.tooltip"),customClass:"border border-gray-300 rounded-none text-gray-500 px-2.5 h-[26px]"}}}}},addGlobalAttributes(){return[{types:["paragraph","heading","textStyle"],attributes:{style:{default:null,parseHTML:t=>t.style.fontFamily||null,renderHTML:t=>t.style?{style:`font-family: ${t.style}`}:{}},fontFamily:{default:null,parseHTML:t=>t.style.fontFamily.replace(/['"]/g,""),renderHTML:t=>t.fontFamily?{style:`font-family: ${t.fontFamily}`}:{}}}}]},addCommands(){return{setFontFamily:t=>({chain:e})=>e().setMark("textStyle",{fontFamily:t}).run(),unsetFontFamily:()=>({chain:t})=>t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}},addStorage(){return{value:null}},onUpdate(){this.storage.value=this.editor.getAttributes("textStyle").fontFamily}}),xq={class:"flex gap-2"},Cq=["disabled"],Eq=ri(i.defineComponent({__name:"FontSizeIncreaseDecrease",props:{editor:Object},setup(t){const e=i.inject("fontSize"),n=i.computed(()=>e.value?parseInt(e.value)===parseInt(T1[0])||parseInt(e.value)<parseInt(T1[0]):!1),r=Ze.useEventBus(Kn.INCREASE_DECREASE_FONTSIZE),o=s=>{r.emit(s)};return(s,a)=>{const l=La,u=Ia,c=Pa;return i.openBlock(),i.createElementBlock("div",xq,[i.createVNode(c,null,{default:i.withCtx(()=>[i.createVNode(u,{"delay-duration":0},{default:i.withCtx(()=>[i.createVNode(l,null,{default:i.withCtx(()=>[i.createElementVNode("button",{class:"btn",onClick:a[0]||(a[0]=f=>o(!0))},[i.createVNode(i.unref(Kt),{name:"Plus",class:"w-6 h-6"})])]),_:1}),i.createVNode(i.unref(_s),null,{default:i.withCtx(()=>a[2]||(a[2]=[i.createTextVNode(" 글꼴 크기 크게 ")])),_:1})]),_:1})]),_:1}),i.createVNode(c,null,{default:i.withCtx(()=>[i.createVNode(u,{"delay-duration":0},{default:i.withCtx(()=>[i.createVNode(l,null,{default:i.withCtx(()=>[i.createElementVNode("button",{class:"btn",onClick:a[1]||(a[1]=f=>o(!1)),disabled:i.unref(n)},[i.createVNode(i.unref(Kt),{name:"Minus",class:"w-6 h-6"})],8,Cq)]),_:1}),i.createVNode(i.unref(_s),null,{default:i.withCtx(()=>a[3]||(a[3]=[i.createTextVNode(" 글꼴 크기 작게 ")])),_:1})]),_:1})]),_:1})])}}}),[["__scopeId","data-v-2f9fcf19"]]),_q=qn.create({name:"fontSizeIncreaseDecrease",addOptions(){return{defaultSize:"14px",button({editor:t}){return{component:Eq,componentProps:{editor:t}}}}},addAttributes(){return{size:{default:this.options.defaultSize,parseHTML:t=>t.style.fontSize||this.options.defaultSize,renderHTML:t=>t.size?{style:`font-size: ${t.size}`}:{}}}},addCommands(){return{setFontSizeIncreaseDecrease:t=>({commands:e})=>e.setMark("textStyle",{fontSize:t})}}}),Hg=at.create({name:"painter",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,extension:n,t:r})=>({component:je,componentProps:{action:()=>{e.commands.setPainter(e==null?void 0:e.state.selection.$head.marks())},icon:"PaintRoller",tooltip:r("editor.format")}})}},addCommands(){return{setPainter:t=>({view:{dispatch:e,state:{tr:n},dom:r}})=>{const a=`url("data:image/svg+xml;utf8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="#000" d="M9 22v-6H4V7q0-1.65 1.175-2.825T8 3h12v13h-5v6zM6 10h12V5h-1v4h-2V5h-1v2h-2V5H8q-.825 0-1.412.588T6 7zm0 4h12v-2H6zm0 0v-2z"/></svg>')}"), auto`;return r.style.cursor=a,e(n.setMeta("painterAction",{type:"start",marks:t})),!0}}},addProseMirrorPlugins(){return[new dt({key:new kt("format-painter"),state:{init:()=>[],apply:(t,e)=>{const n=t.getMeta("painterAction");return n&&n.type==="start"?e=n.marks:n&&n.type==="end"&&(e=[]),e}},props:{handleDOMEvents:{mousedown(t,e){const n=this.getState(t.state);if(!n||n.length==0)return t.dom.style.cursor="",!1;const r=()=>{document.removeEventListener("mouseup",r);const{dispatch:o,state:{selection:s},dom:a}=t;let l=t.state.tr;a.style.cursor="",l=l.removeMark(s.from,s.to);for(const u of n)u.type.name!="link"&&(l=l.addMark(s.from,s.to,u));o(l.setMeta("painterAction",{type:"end"}))};return document.addEventListener("mouseup",r),!0}}}})]}}),Ug=()=>Gi(10),GC=new kt("attrkey"),Sq=t=>new dt({key:GC,state:{init:()=>!1,apply:n=>n.getMeta("initSplit")},appendTransaction(n,r,o){const{tr:s}=o;let a=!1;if(GC.getState(o)||n.some(u=>u.docChanged)){const u=[];o.doc.descendants((c,f,h,m)=>{const{attrs:g}=c,b=u.includes(g.id)?Ug():g.id||Ug();t.includes(c.type.name)&&(s.setNodeMarkup(f,void 0,{...g,id:b,"number-line":m+1}),a=!0),g.id&&u.push(g.id)})}return a?s:null}}),XC=[Og,Ag,lp,Mg,up,pl,Rg,fl,Lg,Dg,Ig,Nu,hl,ml,Pg,Fg,Bg,Fr],kq=at.create({name:"autoId",addGlobalAttributes(){return[{types:XC.concat(this.options.types||[]),attributes:{id:{default:Ug()},extend:{default:!1},class:{default:null},"number-line":{default:null}}}]},addProseMirrorPlugins(){return[Sq(XC.concat(this.options.types||[]))]}}),Tq=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Aq=Rt.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",mt(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[U6({find:Tq,type:this.type,getAttributes:t=>{const[,,e,n,r]=t;return{src:n,alt:e,title:r}}})]}}),Oq=["src","alt"],Mq={key:0,class:"image-resizer"},Bq=["onMousedown"],Rq=i.defineComponent({__name:"ImageView",props:{...Us,selected:{type:Boolean,required:!0}},setup(t){const e=t,n={TOP_LEFT:"tl",TOP_RIGHT:"tr",BOTTOM_LEFT:"bl",BOTTOM_RIGHT:"br"},r=i.ref({width:Fx,height:Fx}),o=i.ref({width:0,height:0}),s=i.ref(!1),a=i.ref({x:0,y:0,w:0,h:0,dir:""}),l=i.computed(()=>{const{src:C,alt:k,width:A,height:T,flipX:B,flipY:L}=e.node.attrs,I=[];B&&I.push("rotateX(180deg)"),L&&I.push("rotateY(180deg)");const V=I.join(" ");return{src:C||void 0,alt:k||void 0,style:{width:cm(A)?`${A}px`:A,height:cm(T)?`${T}px`:T,transform:V||"none"}}}),u=i.computed(()=>({width:i.unref(l).style.width==="100%"?"100%":void 0})),c=i.ref(null),f=new ResizeObserver(C=>{for(const k of C){const{width:A,height:T}=k.contentRect;o.value={width:A,height:T},e.updateAttributes({originWidth:A,originHeight:T})}});function h(){const{editor:C,getPos:k}=e;C.commands.setNodeSelection(k())}const m=Et.throttle(()=>{const{editor:C}=e;r.value.width=parseInt(getComputedStyle(C.view.dom).width,10)},Vx);function g(C,k){C.preventDefault(),C.stopPropagation();const{width:A,height:T}=i.unref(o),B=A/T;let L=Number(e.node.attrs.width)||A,I=Number(e.node.attrs.height)||Math.round(L/B);const V=i.unref(r).width;L=Math.min(L>V?V:L,V),I=Math.round(L/B),Object.assign(a.value,{x:C.clientX,y:C.clientY,w:L,h:I,dir:k}),s.value=!0,w()}const b=Et.throttle(C=>{if(!i.unref(s))return;const{x:k,y:A,w:T,dir:B}=i.unref(a),L=(C.clientX-k)*(/l/.test(B)?-1:1),I=dO(T+L,S$,i.unref(r).width);e.updateAttributes({width:I})},Vx);function y(C){C.preventDefault(),C.stopPropagation(),i.unref(s)&&(s.value=!1,Object.assign(a.value,{x:0,y:0,w:0,h:0,dir:""}),x(),h())}function w(){document.addEventListener("mousemove",b,!0),document.addEventListener("mouseup",y,!0)}function x(){document.removeEventListener("mousemove",b,!0),document.removeEventListener("mouseup",y,!0)}const _=new ResizeObserver(m),S=i.computed(()=>{const{textAlign:C}=e.node.attrs;return{left:"margin-right: auto;",right:"margin-left: auto;",center:"margin-left: auto; margin-right: auto;"}[C]||""});return i.onMounted(()=>{c.value&&f.observe(c.value),_.observe(e.editor.view.dom)}),i.onBeforeUnmount(()=>{x(),f.disconnect(),_.disconnect()}),(C,k)=>(i.openBlock(),i.createBlock(i.unref(Hs),{class:"node-image"},{default:i.withCtx(()=>[i.createElementVNode("div",{class:"image-view",style:i.normalizeStyle([l.value.style,S.value])},[i.createElementVNode("div",{draggable:"true","data-drag-handle":"",class:i.normalizeClass([{"image-view__body--focused":t.selected,"image-view__body--resizing":s.value},"image-view__body"]),style:i.normalizeStyle(u.value)},[i.createElementVNode("img",{ref_key:"imageRef",ref:c,src:l.value.src,alt:l.value.alt,class:"block w-full image-view__body__image",onClick:h},null,8,Oq),C.editor.view.editable?i.withDirectives((i.openBlock(),i.createElementBlock("div",Mq,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Object.values(n),A=>(i.openBlock(),i.createElementBlock("span",{key:A,class:i.normalizeClass([`image-resizer__handler--${A}`,"image-resizer__handler"]),onMousedown:T=>g(T,A)},null,42,Bq))),128))],512)),[[i.vShow,t.selected||s.value]]):i.createCommentVNode("",!0)],6)],4)]),_:1}))}}),Iq=ri(Rq,[["__scopeId","data-v-3de11163"]]),Wg=Aq.extend({group:"block",defining:!0,isolating:!0,addAttributes(){var t;return{...(t=this.parent)==null?void 0:t.call(this),flipX:{default:!1},flipY:{default:!1},originWidth:{default:null},originHeight:{default:null},textAlign:{default:"left",parseHTML:e=>e.style.textAlign||e.getAttribute("textAlign")||null,renderHTML:e=>({textAlign:e.textAlign})},width:{default:"100%",parseHTML:e=>{const n=e.style.width||e.getAttribute("width")||null;return n&&n.endsWith("%")?n:n==null?null:parseInt(n,10)},renderHTML:e=>({width:e.width})}}},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this)}},addNodeView(){return Ws(Iq)},addCommands(){var t;return{...(t=this.parent)==null?void 0:t.call(this),updateImage:e=>({commands:n,editor:r})=>n.updateAttributes(this.name,e)}},renderHTML({node:t,HTMLAttributes:e}){const{textAlign:n,flipX:r,flipY:o}=t.attrs,l=`${{left:"margin-right: auto;",right:"margin-left: auto;",center:"margin-left: auto; margin-right: auto;"}[n]||""} ${r||o?`transform: rotateX(${r?"180":"0"}deg) rotateY(${o?"180":"0"}deg);`:""}`;return["img",mt({height:"auto",style:l},this.options.HTMLAttributes,e)]},parseHTML(){return[{tag:"img[src]"}]},addProseMirrorPlugins(){return[new dt({props:{handleTextInput(t){const{selection:e}=t.state;return e instanceof Pe&&e.node.type.name==="image"},handlePaste(t){const{selection:e}=t.state;return e instanceof Pe&&e.node.type.name==="image"}}})]}});var Ys=(t=>(t[t.max=7]="max",t[t.min=0]="min",t[t.more=1]="more",t[t.less=-1]="less",t))(Ys||{});function Lq(t,e,n){return t<e?e:t>n?n:t}function Pq(t,e,n,r){const{doc:o,selection:s}=t;if(!o||!s||!(s instanceof Ie||s instanceof Rn))return t;const{from:a,to:l}=s;return o.nodesBetween(a,l,(u,c)=>{const f=u.type;return n.includes(f.name)?(t=Dq(t,c,e),!1):!i1(u.type.name,r.extensionManager.extensions)}),t}function Dq(t,e,n){if(!t.doc)return t;const r=t.doc.nodeAt(e);if(!r)return t;const a=Lq((r.attrs.indent||0)+n,0,7);if(a===r.attrs.indent)return t;const l={...r.attrs,indent:a};return t.setNodeMarkup(e,r.type,l,r.marks)}function JC({delta:t,types:e}){return({state:n,dispatch:r,editor:o})=>{const{selection:s}=n;let{tr:a}=n;return a=a.setSelection(s),a=Pq(a,t,e,o),a.docChanged?(r&&r(a),!0):!1}}const YC=at.create({name:"indent",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","blockquote"],minIndent:Ys.min,maxIndent:Ys.max,button({editor:e,t:n}){var s,a;const{selection:r}=e.state,o=r.$anchor.parent;return[{component:je,componentProps:{action:()=>{e.commands.indent()},disabled:((s=o==null?void 0:o.attrs)==null?void 0:s.indent)>=Ys.max||!e.can().indent(),shortcutKeys:["Tab"],icon:"IndentIncrease",tooltip:n("editor.indent.tooltip")}},{component:je,componentProps:{action:()=>{e.commands.outdent()},shortcutKeys:["Shift","Tab"],disabled:((a=o==null?void 0:o.attrs)==null?void 0:a.indent)<=Ys.min||!e.can().outdent(),icon:"IndentDecrease",tooltip:n("editor.outdent.tooltip")}}]}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{indent:{default:0,parseHTML:t=>{const e=t.getAttribute("data-indent");return(e?parseInt(e,10):0)||0},renderHTML:t=>t.indent?{"data-indent":t.indent}:{}}}}]},addCommands(){return{indent:()=>JC({delta:Ys.more,types:this.options.types}),outdent:()=>JC({delta:Ys.less,types:this.options.types})}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.indent(),"Shift-Tab":()=>this.editor.commands.outdent()}}}),Fq=["paragraph","heading","list_item","todo_item"];function Vq(t,e){const{selection:n,doc:r}=t;if(!n||!r||!(n instanceof Ie||n instanceof Rn))return t;const{from:o,to:s}=n,a=[],l=e&&e!==$x?e:null;return r.nodesBetween(o,s,(u,c)=>{const f=u.type;return Fq.includes(f.name)?((u.attrs.lineHeight||null)!==l&&a.push({node:u,pos:c,nodeType:f}),f.name!=="list_item"&&f.name!=="todo_item"):!0}),a.length&&a.forEach(u=>{const{node:c,pos:f,nodeType:h}=u;let{attrs:m}=c;m={...m,lineHeight:l},t=t.setNodeMarkup(f,h,m,c.marks)}),t}function $q(t){return({state:e,dispatch:n})=>{const{selection:r}=e;let{tr:o}=e;return o=o.setSelection(r),o=Vq(o,t),o.docChanged?(n&&n(o),!0):!1}}const zq=i.defineComponent({__name:"LineHeightDropdown",props:{editor:{},icon:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0}},setup(t){const{t:e}=St();function n(l){return parseFloat(l.replace("%",""))/100}const r=i.computed(()=>{const c=s.editor.extensionManager.extensions.find(f=>f.name==="lineHeight").options.lineHeights.map(f=>({label:n(f),value:f}));return c.unshift({label:i.unref(e)("editor.default"),value:"default"}),c}),o=i.ref("default"),s=t;function a(l){l==="default"?s.editor.commands.unsetLineHeight():s.editor.commands.setLineHeight(l),o.value=l}return(l,u)=>(i.openBlock(),i.createBlock(Ks,{icon:l.icon,tooltip:l.tooltip,disabled:l.disabled},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,(c,f)=>(i.openBlock(),i.createBlock(i.unref(ll),{key:f,checked:c.value===o.value,onClick:h=>a(c.value)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(c.label),1)]),_:2},1032,["checked","onClick"]))),128))]),_:1},8,["icon","tooltip","disabled"]))}}),ZC=at.create({name:"lineHeight",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),types:["paragraph","heading","list_item","todo_item"],lineHeights:["100%","115%","150%","200%","250%","300%"],defaultHeight:$x,button({editor:e,t:n}){return{component:zq,componentProps:{editor:e,icon:"LineHeight",tooltip:n("editor.lineheight.tooltip")}}}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:t=>t.style.lineHeight||this.options.defaultHeight,renderHTML:t=>t.lineHeight===this.options.defaultHeight||!t.lineHeight?{}:{style:`line-height: ${t.lineHeight}`}}}}]},addCommands(){return{setLineHeight:t=>$q(t),unsetLineHeight:()=>({commands:t})=>this.options.types.every(e=>t.resetAttributes(e,"lineHeight"))}}}),Hq=Rt.create({name:"column",content:"block+",isolating:!0,addAttributes(){return{position:{default:"",parseHTML:t=>t.getAttribute("data-position"),renderHTML:t=>({"data-position":t.position})}}},renderHTML({HTMLAttributes:t}){return["div",mt(t,{"data-type":"column"}),0]},parseHTML(){return[{tag:'div[data-type="column"]'}]}});var Zs=(t=>(t.SidebarLeft="sidebar-left",t.SidebarRight="sidebar-right",t.TwoColumn="two-column",t))(Zs||{});const jg=Rt.create({name:"columns",group:"columns",content:"column+",defining:!0,isolating:!0,addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),layout:"two-column"}},addAttributes(){return{layout:{default:"two-column"}}},addCommands(){return{setColumns:()=>({commands:t})=>(t.insertContent('<div data-type="columns"><div data-type="column" data-position="left"><p></p></div><div data-type="column" data-position="right"><p></p></div></div>'),!0),setLayout:t=>({commands:e})=>e.updateAttributes("columns",{layout:t})}},renderHTML({HTMLAttributes:t}){return["div",{"data-type":"columns",class:`layout-${t.layout}`},0]},parseHTML(){return[{tag:'div[data-type="columns"]'}]},addExtensions(){return[Hq.configure(this.options.columnOptions)]}}),Uq=i.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=i.computed(()=>{const{class:o,...s}=e;return s}),r=$n(n);return(o,s)=>(i.openBlock(),i.createBlock(i.unref(b7),i.mergeProps(i.unref(r),{class:i.unref($e)("text-sm text-ed-muted-foreground",e.class)}),{default:i.withCtx(()=>[i.renderSlot(o.$slots,"default")]),_:3},16,["class"]))}}),Wq={class:"flex gap-x-2 items-center"},jq={class:"sr-only"},qq={class:"flex justify-end gap-x-2.5 flex-1"},Kq=["disabled"],mp=i.defineComponent({__name:"SuperInputDialogMoblie",props:{editor:{},open:{type:Boolean},superTextInit:{},superTextId:{},superTextElementId:{},isViewMode:{type:Boolean},title:{}},emits:["close","save","delete"],setup(t,{emit:e}){const n=e,r=t,{t:o}=St(),s=i.ref(""),a=i.ref(!1),l=i.ref(r.isViewMode??!1),u=i.ref(!1);i.watch(()=>r.isViewMode,g=>{l.value=g,g||(s.value="")});const c=i.computed(()=>{var b;if(!s.value)return!0;const g=document.createElement("div");return g.innerHTML=s.value,((b=g==null?void 0:g.textContent)==null?void 0:b.trim())===""});i.watch(()=>r.open,()=>{r.open&&r.superTextInit&&(s.value=r.superTextInit)});const f=()=>{n("close"),a.value=!1,l.value=!0,u.value=!1},h=()=>{n("save",s.value),s.value="",l.value=!0,u.value=!1},m=()=>{u.value=!0,l.value=!1};return(g,b)=>{const y=UC,w=HC,x=zC,_=Uq,S=$C,C=VC,k=FC;return i.openBlock(),i.createBlock(k,{open:g.open},{default:i.withCtx(()=>[i.createVNode(C,{isOverlayTransparent:"",class:"p-2.5 gap-0 gap-y-2.5 border-none w-[calc(100%-40px)] !shadow-ed rounded-[5px]"},{default:i.withCtx(()=>[i.createVNode(x,{class:"text-left flex-row justify-between"},{default:i.withCtx(()=>[i.createVNode(y,{class:"text-base font-normal"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(g.title?g.title:i.unref(o)("editor.superinput")),1)]),_:1}),i.createElementVNode("div",Wq,[i.withDirectives(i.createElementVNode("button",{onClick:m},[i.createVNode(i.unref(J3),{icon:"lucide:edit-2"})],512),[[i.vShow,l.value]]),i.createVNode(w,{class:"outline-none",onClick:f},{default:i.withCtx(()=>[i.createVNode(i.unref(V1),{class:"w-5 h-5"}),i.createElementVNode("span",jq,i.toDisplayString(i.unref(o)("editor.close")),1)]),_:1})])]),_:1}),i.createVNode(_,{class:"hidden"}),i.createVNode(WC,{isReadOnly:l.value,modelValue:s.value,"onUpdate:modelValue":b[0]||(b[0]=A=>s.value=A)},null,8,["isReadOnly","modelValue"]),i.createVNode(S,{class:"flex-row justify-between"},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("button",{onClick:b[1]||(b[1]=A=>n("delete"))},i.toDisplayString(i.unref(o)("editor.delete")),513),[[i.vShow,u.value]]),i.withDirectives(i.createElementVNode("div",qq,[i.createElementVNode("button",{onClick:f},i.toDisplayString(i.unref(o)("editor.menubar.menu.cancel")),1),i.createElementVNode("button",{onClick:h,disabled:i.unref(c),class:i.normalizeClass({"cursor-not-allowed":i.unref(c)})},i.toDisplayString(i.unref(o)("editor.menubar.menu.save")),11,Kq)],512),[[i.vShow,u.value||!l.value]])]),_:1})]),_:1})]),_:1},8,["open"])}}}),Gq=["book-mark-node-id","page-id","page-number","book-mark-content","node-id","element-id","line-id"],Xq=i.defineComponent({__name:"SuperText",props:Us,setup(t){const e=t,n=i.ref(!1),r=i.ref(null),{selection:o,doc:s}=e.editor.state,a=i.inject("isMobile",!1),l=i.ref(!1),u=Ze.useEventBus(Kn.RENDER_SUPER_TEXT),c=i.computed(()=>{var k,A;const x=s.resolve(o.from),_=x==null?void 0:x.node(-1),S=(k=_==null?void 0:_.attrs)==null?void 0:k.id,C=(A=_==null?void 0:_.attrs)==null?void 0:A.pageNumber;return{pageId:S,pageNumber:C}}),f=i.computed(()=>{const x=e.getPos(),_=e.editor.state.doc.resolve(x);for(let S=_.depth;S>0;S--){const C=_.node(S);if(C.type.name==="paragraph")return C}return null}),h=i.computed(()=>{var x;return((x=f.value)==null?void 0:x.attrs.id)||""});function m(x){const _=e.getPos();e.updateAttributes({[ft.TEXT]:x}),n.value=!1,requestAnimationFrame(()=>{e.editor.commands.setTextSelection(_+1),e.editor.view.focus()})}function g(x){const _=e.node.attrs[ft.TEXT],S=e.node.attrs[ft.ID],k={lineId:x.target.querySelector(`[node-id="${S}"]`).getAttribute("line-id"),text:_};u.emit({action:"hover",payload:k})}function b(x){const _=e.node.attrs[ft.ID],C={lineId:x.target.querySelector(`[node-id="${_}"]`).getAttribute("line-id"),text:""};u.emit({action:"hover",payload:C})}function y(){const{getPos:x,node:_,editor:S}=e,C=x(),k=C+1;S.commands.deleteRange({from:C,to:k})}function w(){e.editor.view.dom.blur(),n.value=!0,a&&(l.value=!0)}return(x,_)=>{const S=er,C=pp,k=fp,A=dp,T=cp,B=ec;return i.openBlock(),i.createBlock(i.unref(Hs),{as:"span",class:i.normalizeClass(["w-fit text-inherit super-text align-middle",{"text-red-600 !leading-[13px]":i.unref(a)}]),"data-drag-handle":"",draggable:"true",contenteditable:"false"},{default:i.withCtx(()=>[i.createVNode(T,null,{default:i.withCtx(()=>[i.createVNode(C,{as:"template",class:"relative"},{default:i.withCtx(()=>[i.createVNode(S,{variant:"ghost",class:"!p-0 !m-0 !h-fit",onDblclick:w,onMouseenter:g,onMouseleave:b},{default:i.withCtx(()=>[i.createVNode(i.unref(Kt),{name:"fileEdit",class:i.normalizeClass({"w-[13px] h-auto":i.unref(a)})},null,8,["class"]),i.createElementVNode("div",{ref_key:"bookMarkRef",ref:r,"book-mark-node-id":e.node.attrs[i.unref(ft).ID],"page-id":c.value.pageId,"page-number":c.value.pageNumber,"book-mark-content":e.node.attrs[i.unref(ft).TEXT],"node-id":e.node.attrs[i.unref(ft).ID],"element-id":e.node.attrs[i.unref(ft).ELEMENT_ID],"line-id":h.value},null,8,Gq)]),_:1})]),_:1}),i.createVNode(A,null,{default:i.withCtx(()=>[i.createVNode(k,{onSelect:_[0]||(_[0]=L=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(x.$t("editor.super.edit")),1)]),_:1}),i.createVNode(k,{onSelect:y},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(x.$t("editor.super.delete")),1)]),_:1})]),_:1})]),_:1}),i.unref(a)?(i.openBlock(),i.createBlock(mp,{key:1,open:n.value,"is-view-mode":l.value,editor:e.editor,"super-text-init":e.node.attrs[i.unref(ft).TEXT],"super-text-id":e.node.attrs[i.unref(ft).ID],"super-text-element-id":e.node.attrs[i.unref(ft).ELEMENT_ID],onClose:_[2]||(_[2]=L=>n.value=!1),onSave:m,onDelete:y},null,8,["open","is-view-mode","editor","super-text-init","super-text-id","super-text-element-id"])):(i.openBlock(),i.createBlock(B,{key:0,open:n.value,editor:e.editor,"super-text-init":e.node.attrs[i.unref(ft).TEXT],"super-text-id":e.node.attrs[i.unref(ft).ID],"super-text-element-id":e.node.attrs[i.unref(ft).ELEMENT_ID],onClose:_[1]||(_[1]=L=>n.value=!1),onSave:m},null,8,["open","editor","super-text-init","super-text-id","super-text-element-id"]))]),_:1},8,["class"])}}}),gl="superText",QC={UPDATE:"superTextUpdate"},NC=Rt.create({name:"superText",inline:!0,group:"inline",atom:!0,draggable:!0,addStorage(){return{enable:!0,isShowSuperViewMoblie:!1,isShowSuperInputMoblie:!1,view:!0,items:[]}},addOptions(){return{specialCharModal:null,button:({editor:t,t:e,isMobile:n})=>[...n?[{component:je,componentProps:{action:()=>{t.commands.toggleSuperInputMoblie()},isActive:()=>{},icon:"fileEdit",title:e("editor.menubar.menu.insertSuper"),tooltip:e("editor.menubar.menu.insertSuper"),customClass:"whitespace-nowrap !bg-ed-blue !text-white !font-normal rounded-[3px] h-[26px] ml-auto",customClassTooltip:"ml-auto"}}]:[],{component:je,componentProps:{action:()=>t.commands.toggleSuperText(n),isActive:()=>t.storage.superText.enable,title:e("editor.menubar.menu.superView"),customClass:`whitespace-nowrap !text-white !font-normal rounded-[3px] h-[26px]
250
250
  ${n?"!bg-ed-blue":t.storage.superText.enable?"!bg-blue-700":"!bg-blue-500"}
251
- `,tooltip:"수퍼 보기"}}]}},addAttributes(){return{[ft.ID]:{default:null},[ft.TEXT]:{default:""},[ft.POSITION]:{default:"0"},[ft.ELEMENT_ID]:{default:""}}},addCommands(){return{toggleSuperText:t=>({editor:e})=>t?e.storage.superText.isShowSuperViewMoblie=!e.storage.superText.isShowSuperViewMoblie:e.storage.superText.enable=!e.storage.superText.enable,toggleSuperInputMoblie:()=>({editor:t})=>t.storage.superText.isShowSuperInputMoblie=!t.storage.superText.isShowSuperInputMoblie}},parseHTML(){return[{tag:"button.super-text"}]},renderHTML({HTMLAttributes:t}){return["button",mt(t,{class:"super-text"})]},addNodeView(){return Ws(Xq)},addProseMirrorPlugins(){return[new dt({appendTransaction(t,e,n){let r=n.tr,o=!1;return n.doc.descendants((s,a)=>{if(s.type.name==="superText"){const l=s.attrs[ft.POSITION],u=String(a);l!==u&&(r=r.setNodeMarkup(a,void 0,{...s.attrs,[ft.POSITION]:u}),o=!0)}}),o?r:null}}),new dt({filterTransaction(t,e){return t.steps.some(r=>{if(r.toJSON&&r.toJSON().stepType==="replace"){const o=r.toJSON();return o.slice&&o.slice.content&&o.slice.content.some(s=>s.type===gl)}return!1})&&t.setMeta(QC.UPDATE,!0),!0}})]}}),Jq=["innerHTML"],Yq=["book-mark-node-id","page-id","page-number","book-mark-content","node-id","line-id"],Zq=i.defineComponent({__name:"ConfigPlan",props:Us,setup(t){const e=t,n=i.ref(!1),r=i.ref(null),{selection:o,doc:s}=e.editor.state,a=i.inject("isMobile"),l=i.ref(!1),u=Ze.useEventBus(Kn.RENDER_SUPER_TEXT),c=i.computed(()=>{var k,A;const x=s.resolve(o.from),_=x==null?void 0:x.node(-1),S=(k=_==null?void 0:_.attrs)==null?void 0:k.id,C=(A=_==null?void 0:_.attrs)==null?void 0:A.pageNumber;return{pageId:S,pageNumber:C}}),f=i.computed(()=>{const x=e.getPos(),_=e.editor.state.doc.resolve(x);for(let S=_.depth;S>0;S--){const C=_.node(S);if(C.type.name==="paragraph")return C}return null}),h=i.computed(()=>{var x;return((x=f.value)==null?void 0:x.attrs.id)||""});function m(x){e.updateAttributes({"data-text":x}),n.value=!1}function g(x){const _=e.node.attrs[ft.TEXT],S=e.node.attrs[ft.ID],k={lineId:x.target.querySelector(`[node-id="${S}"]`).getAttribute("line-id"),text:_};u.emit({action:"hover",payload:k})}function b(x){const _=e.node.attrs[ft.ID],C={lineId:x.target.querySelector(`[node-id="${_}"]`).getAttribute("line-id"),text:""};u.emit({action:"hover",payload:C})}function y(){const{getPos:x,node:_,editor:S}=e,C=x(),k=C+1;S.commands.deleteRange({from:C,to:k})}function w(){n.value=!0,a&&(l.value=!0)}return(x,_)=>{const S=er,C=pp,k=fp,A=dp,T=cp,B=ec;return i.openBlock(),i.createBlock(i.unref(Hs),{as:"span",class:i.normalizeClass(["w-fit text-inherit super-text align-middle",{"!leading-[9px] [&_*]:!leading-[9px]":i.unref(a)}]),"data-drag-handle":"",draggable:"true",contenteditable:"false"},{default:i.withCtx(()=>[i.createVNode(T,null,{default:i.withCtx(()=>[i.createVNode(C,{as:"template",class:"relative"},{default:i.withCtx(()=>[i.createVNode(S,{variant:"ghost",class:"!p-0 !m-0 !h-fit font-normal !text-ed-blue",onClick:w,onMouseenter:g,onMouseleave:b},{default:i.withCtx(()=>[i.createVNode(i.unref(Kt),{name:"plan",class:i.normalizeClass({"w-[18px] h-auto pr-1":i.unref(a)})},null,8,["class"]),_[3]||(_[3]=i.createTextVNode(" [")),i.createElementVNode("span",{class:"[&_*]:inline",innerHTML:e.node.attrs[i.unref(ft).TEXT]},null,8,Jq),_[4]||(_[4]=i.createTextVNode("] ")),i.createElementVNode("div",{ref_key:"bookMarkRef",ref:r,"book-mark-node-id":e.node.attrs[i.unref(ft).ID],"page-id":c.value.pageId,"page-number":c.value.pageNumber,"book-mark-content":e.node.attrs[i.unref(ft).TEXT],"node-id":e.node.attrs[i.unref(ft).ID],"line-id":h.value},null,8,Yq)]),_:1})]),_:1}),i.createVNode(A,null,{default:i.withCtx(()=>[i.createVNode(k,{onSelect:_[0]||(_[0]=L=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(x.$t("editor.configPlan.edit")),1)]),_:1}),i.createVNode(k,{onSelect:y},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(x.$t("editor.configPlan.delete")),1)]),_:1})]),_:1})]),_:1}),i.unref(a)?(i.openBlock(),i.createBlock(mp,{key:1,title:x.$t("editor.configPlan"),open:n.value,"is-view-mode":l.value,editor:e.editor,"super-text-init":e.node.attrs[i.unref(ft).TEXT],"super-text-id":e.node.attrs[i.unref(ft).ID],onClose:_[2]||(_[2]=L=>n.value=!1),onSave:m,onDelete:y},null,8,["title","open","is-view-mode","editor","super-text-init","super-text-id"])):(i.openBlock(),i.createBlock(B,{key:0,open:n.value,editor:e.editor,"super-text-init":e.node.attrs[i.unref(ft).TEXT],"super-text-id":e.node.attrs[i.unref(ft).ID],"super-text-element-id":e.node.attrs[i.unref(ft).ELEMENT_ID],onClose:_[1]||(_[1]=L=>n.value=!1),onSave:m},null,8,["open","editor","super-text-init","super-text-id","super-text-element-id"]))]),_:1},8,["class"])}}}),e5=Rt.create({name:"configPlan",inline:!0,group:"inline",atom:!0,draggable:!0,addStorage(){return{isShowConfigPlanInput:!1}},addOptions(){return{specialCharModal:null,button:({editor:t,t:e,isMobile:n})=>[...n?[{component:je,componentProps:{action:()=>{t.commands.toggleConfigPlanInput()},isActive:()=>{},icon:"plan",title:e("editor.insertConfigPlan"),tooltip:e("editor.insertConfigPlan"),customClass:"whitespace-nowrap !bg-ed-blue !text-white !font-normal rounded-[3px] h-[26px] gap-x-1 ml-auto",customClassTooltip:"ml-auto"}}]:[]]}},addAttributes(){return{"data-id":{default:null},"data-text":{default:""},"data-position":{default:"0"}}},addCommands(){return{toggleConfigPlanInput:()=>({editor:t})=>t.storage.configPlan.isShowConfigPlanInput=!t.storage.configPlan.isShowConfigPlanInput}},parseHTML(){return[{tag:"button.config-plan"}]},renderHTML({HTMLAttributes:t}){return["button",mt(t,{class:"config-plan"})]},addNodeView(){return Ws(Zq)},addProseMirrorPlugins(){return[new dt({appendTransaction(t,e,n){let r=n.tr,o=!1;return n.doc.descendants((s,a)=>{if(s.type.name==="configPlan"){const l=s.attrs["data-position"],u=String(a);l!==u&&(r=r.setNodeMarkup(a,void 0,{...s.attrs,"data-position":u}),o=!0)}}),o?r:null}})]}});var qg,Kg;if(typeof WeakMap<"u"){let t=new WeakMap;qg=e=>t.get(e),Kg=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;qg=r=>{for(let o=0;o<t.length;o+=2)if(t[o]==r)return t[o+1]},Kg=(r,o)=>(n==10&&(n=0),t[n++]=r,t[n++]=o)}var rn=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,o=e/this.width|0;let s=r+1,a=o+1;for(let l=1;s<this.width&&this.map[e+l]==n;l++)s++;for(let l=1;a<this.height&&this.map[e+this.width*l]==n;l++)a++;return{left:r,top:o,right:s,bottom:a}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:o,top:s,bottom:a}=this.findCell(t);return e=="horiz"?(n<0?r==0:o==this.width)?null:this.map[s*this.width+(n<0?r-1:o)]:(n<0?s==0:a==this.height)?null:this.map[r+this.width*(n<0?s-1:a)]}rectBetween(t,e){const{left:n,right:r,top:o,bottom:s}=this.findCell(t),{left:a,right:l,top:u,bottom:c}=this.findCell(e);return{left:Math.min(n,a),top:Math.min(o,u),right:Math.max(r,l),bottom:Math.max(s,c)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let o=t.left;o<t.right;o++){const s=r*this.width+o,a=this.map[s];n[a]||(n[a]=!0,!(o==t.left&&o&&this.map[s-1]==a||r==t.top&&r&&this.map[s-this.width]==a)&&e.push(a))}return e}positionAt(t,e,n){for(let r=0,o=0;;r++){const s=o+n.child(r).nodeSize;if(r==t){let a=e+t*this.width;const l=(t+1)*this.width;for(;a<l&&this.map[a]<o;)a++;return a==l?s-1:this.map[a]}o=s}}static get(t){return qg(t)||Kg(t,Qq(t))}};function Qq(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=Nq(t),n=t.childCount,r=[];let o=0,s=null;const a=[];for(let c=0,f=e*n;c<f;c++)r[c]=0;for(let c=0,f=0;c<n;c++){const h=t.child(c);f++;for(let b=0;;b++){for(;o<r.length&&r[o]!=0;)o++;if(b==h.childCount)break;const y=h.child(b),{colspan:w,rowspan:x,colwidth:_}=y.attrs;for(let S=0;S<x;S++){if(S+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:f,n:x-S});break}const C=o+S*e;for(let k=0;k<w;k++){r[C+k]==0?r[C+k]=f:(s||(s=[])).push({type:"collision",row:c,pos:f,n:w-k});const A=_&&_[k];if(A){const T=(C+k)%e*2,B=a[T];B==null||B!=A&&a[T+1]==1?(a[T]=A,a[T+1]=1):B==A&&a[T+1]++}}}o+=w,f+=y.nodeSize}const m=(c+1)*e;let g=0;for(;o<m;)r[o++]==0&&g++;g&&(s||(s=[])).push({type:"missing",row:c,n:g}),f++}(e===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const l=new rn(e,n,r,s);let u=!1;for(let c=0;!u&&c<a.length;c+=2)a[c]!=null&&a[c+1]<n&&(u=!0);return u&&eK(l,a,t),l}function Nq(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const o=t.child(r);let s=0;if(n)for(let a=0;a<r;a++){const l=t.child(a);for(let u=0;u<l.childCount;u++){const c=l.child(u);a+c.attrs.rowspan>r&&(s+=c.attrs.colspan)}}for(let a=0;a<o.childCount;a++){const l=o.child(a);s+=l.attrs.colspan,l.attrs.rowspan>1&&(n=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function eK(t,e,n){t.problems||(t.problems=[]);const r={};for(let o=0;o<t.map.length;o++){const s=t.map[o];if(r[s])continue;r[s]=!0;const a=n.nodeAt(s);if(!a)throw new RangeError(`No cell with offset ${s} found`);let l=null;const u=a.attrs;for(let c=0;c<u.colspan;c++){const f=(o+c)%t.width,h=e[f*2];h!=null&&(!u.colwidth||u.colwidth[c]!=h)&&((l||(l=tK(u)))[c]=h)}l&&t.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:l})}}function tK(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Pn(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],o=r.spec.tableRole;o&&(e[o]=r)}}return e}var ns=new kt("selectingCells");function bl(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function nK(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function oo(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function gp(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=bl(e.$head)||rK(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function rK(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Gg(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function oK(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function Xg(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function t5(t,e,n){const r=t.node(-1),o=rn.get(r),s=t.start(-1),a=o.nextCell(t.pos-s,e,n);return a==null?null:t.node(0).resolve(s+a)}function Qs(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(o=>o>0)||(r.colwidth=null)),r}function n5(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let o=0;o<n;o++)r.colwidth.splice(e,0,0)}return r}function iK(t,e,n){const r=Pn(e.type.schema).header_cell;for(let o=0;o<t.height;o++)if(e.nodeAt(t.map[n+o*t.width]).type!=r)return!1;return!0}var Vt=class bi extends Ve{constructor(e,n=e){const r=e.node(-1),o=rn.get(r),s=e.start(-1),a=o.rectBetween(e.pos-s,n.pos-s),l=e.node(0),u=o.cellsInRect(a).filter(f=>f!=n.pos-s);u.unshift(n.pos-s);const c=u.map(f=>{const h=r.nodeAt(f);if(!h)throw RangeError(`No cell with offset ${f} found`);const m=s+f+1;return new z4(l.resolve(m),l.resolve(m+h.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),o=e.resolve(n.map(this.$headCell.pos));if(Gg(r)&&Gg(o)&&Xg(r,o)){const s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?bi.rowSelection(r,o):s&&this.isColSelection()?bi.colSelection(r,o):new bi(r,o)}return Ie.between(r,o)}content(){const e=this.$anchorCell.node(-1),n=rn.get(e),r=this.$anchorCell.start(-1),o=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),s={},a=[];for(let u=o.top;u<o.bottom;u++){const c=[];for(let f=u*n.width+o.left,h=o.left;h<o.right;h++,f++){const m=n.map[f];if(s[m])continue;s[m]=!0;const g=n.findCell(m);let b=e.nodeAt(m);if(!b)throw RangeError(`No cell with offset ${m} found`);const y=o.left-g.left,w=g.right-o.right;if(y>0||w>0){let x=b.attrs;if(y>0&&(x=Qs(x,0,y)),w>0&&(x=Qs(x,x.colspan-w,w)),g.left<o.left){if(b=b.type.createAndFill(x),!b)throw RangeError(`Could not create cell with attrs ${JSON.stringify(x)}`)}else b=b.type.create(x,b.content)}if(g.top<o.top||g.bottom>o.bottom){const x={...b.attrs,rowspan:Math.min(g.bottom,o.bottom)-Math.max(g.top,o.top)};g.top<o.top?b=b.type.createAndFill(x):b=b.type.create(x,b.content)}c.push(b)}a.push(e.child(u).copy(ue.from(c)))}const l=this.isColSelection()&&this.isRowSelection()?e:a;return new xe(ue.from(l),1,1)}replace(e,n=xe.empty){const r=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){const{$from:l,$to:u}=o[a],c=e.mapping.slice(r);e.replace(c.map(l.pos),c.map(u.pos),a?xe.empty:n)}const s=Ve.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,n){this.replace(e,new xe(ue.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=rn.get(n),o=this.$anchorCell.start(-1),s=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o));for(let a=0;a<s.length;a++)e(n.nodeAt(s[a]),o+s[a])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,o=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,o)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),o=rn.get(r),s=e.start(-1),a=o.findCell(e.pos-s),l=o.findCell(n.pos-s),u=e.node(0);return a.top<=l.top?(a.top>0&&(e=u.resolve(s+o.map[a.left])),l.bottom<o.height&&(n=u.resolve(s+o.map[o.width*(o.height-1)+l.right-1]))):(l.top>0&&(n=u.resolve(s+o.map[l.left])),a.bottom<o.height&&(e=u.resolve(s+o.map[o.width*(o.height-1)+a.right-1]))),new bi(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=rn.get(e),r=this.$anchorCell.start(-1),o=n.colCount(this.$anchorCell.pos-r),s=n.colCount(this.$headCell.pos-r);if(Math.min(o,s)>0)return!1;const a=o+this.$anchorCell.nodeAfter.attrs.colspan,l=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,l)==n.width}eq(e){return e instanceof bi&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),o=rn.get(r),s=e.start(-1),a=o.findCell(e.pos-s),l=o.findCell(n.pos-s),u=e.node(0);return a.left<=l.left?(a.left>0&&(e=u.resolve(s+o.map[a.top*o.width])),l.right<o.width&&(n=u.resolve(s+o.map[o.width*(l.top+1)-1]))):(l.left>0&&(n=u.resolve(s+o.map[l.top*o.width])),a.right<o.width&&(e=u.resolve(s+o.map[o.width*(a.top+1)-1]))),new bi(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new bi(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new bi(e.resolve(n),e.resolve(r))}getBookmark(){return new sK(this.$anchorCell.pos,this.$headCell.pos)}};Vt.prototype.visible=!1,Ve.jsonID("cell",Vt);var sK=class ak{constructor(e,n){this.anchor=e,this.head=n}map(e){return new ak(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&Xg(n,r)?new Vt(n,r):Ve.near(r,1)}};function aK(t){if(!(t.selection instanceof Vt))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(Yt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),ht.create(t.doc,e)}function lK({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,o=t.depth;for(;o>=0&&!(t.after(o+1)<t.end(o));o--,n++);for(let s=e.depth;s>=0&&!(e.before(s+1)>e.start(s));s--,r--);return n==r&&/row|table/.test(t.node(o).type.spec.tableRole)}function uK({$from:t,$to:e}){let n,r;for(let o=t.depth;o>0;o--){const s=t.node(o);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let o=e.depth;o>0;o--){const s=e.node(o);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){r=s;break}}return n!==r&&e.parentOffset===0}function cK(t,e,n){const r=(e||t).selection,o=(e||t).doc;let s,a;if(r instanceof Pe&&(a=r.node.type.spec.tableRole)){if(a=="cell"||a=="header_cell")s=Vt.create(o,r.from);else if(a=="row"){const l=o.resolve(r.from+1);s=Vt.rowSelection(l,l)}else if(!n){const l=rn.get(r.node),u=r.from+1,c=u+l.map[l.width*l.height-1];s=Vt.create(o,u+1,c)}}else r instanceof Ie&&lK(r)?s=Ie.create(o,r.from):r instanceof Ie&&uK(r)&&(s=Ie.create(o,r.$from.start(),r.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}var dK=new kt("fix-tables");function r5(t,e,n,r){const o=t.childCount,s=e.childCount;e:for(let a=0,l=0;a<s;a++){const u=e.child(a);for(let c=l,f=Math.min(o,a+3);c<f;c++)if(t.child(c)==u){l=c+1,n+=u.nodeSize;continue e}r(u,n),l<o&&t.child(l).sameMarkup(u)?r5(t.child(l),u,n+1,r):u.nodesBetween(0,u.content.size,r,n+1),n+=u.nodeSize}}function o5(t,e){let n;const r=(o,s)=>{o.type.spec.tableRole=="table"&&(n=fK(t,o,s,n))};return e?e.doc!=t.doc&&r5(e.doc,t.doc,0,r):t.doc.descendants(r),n}function fK(t,e,n,r){const o=rn.get(e);if(!o.problems)return r;r||(r=t.tr);const s=[];for(let u=0;u<o.height;u++)s.push(0);for(let u=0;u<o.problems.length;u++){const c=o.problems[u];if(c.type=="collision"){const f=e.nodeAt(c.pos);if(!f)continue;const h=f.attrs;for(let m=0;m<h.rowspan;m++)s[c.row+m]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,Qs(h,h.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const f=e.nodeAt(c.pos);if(!f)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...f.attrs,rowspan:f.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const f=e.nodeAt(c.pos);if(!f)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...f.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const f=r.mapping.map(n);r.delete(f,f+e.nodeSize)}}let a,l;for(let u=0;u<s.length;u++)s[u]&&(a==null&&(a=u),l=u);for(let u=0,c=n+1;u<o.height;u++){const f=e.child(u),h=c+f.nodeSize,m=s[u];if(m>0){let g="cell";f.firstChild&&(g=f.firstChild.type.spec.tableRole);const b=[];for(let w=0;w<m;w++){const x=Pn(t.schema)[g].createAndFill();x&&b.push(x)}const y=(u==0||a==u-1)&&l==u?c+1:h-1;r.insert(r.mapping.map(y),b)}c=h}return r.setMeta(dK,{fixTables:!0})}function Oo(t){const e=t.selection,n=gp(t),r=n.node(-1),o=n.start(-1),s=rn.get(r);return{...e instanceof Vt?s.rectBetween(e.$anchorCell.pos-o,e.$headCell.pos-o):s.findCell(n.pos-o),tableStart:o,map:s,table:r}}function i5(t,{map:e,tableStart:n,table:r},o){let s=o>0?-1:0;iK(e,r,o+s)&&(s=o==0||o==e.width?null:0);for(let a=0;a<e.height;a++){const l=a*e.width+o;if(o>0&&o<e.width&&e.map[l-1]==e.map[l]){const u=e.map[l],c=r.nodeAt(u);t.setNodeMarkup(t.mapping.map(n+u),null,n5(c.attrs,o-e.colCount(u))),a+=c.attrs.rowspan-1}else{const u=s==null?Pn(r.type.schema).cell:r.nodeAt(e.map[l+s]).type,c=e.positionAt(a,o,r);t.insert(t.mapping.map(n+c),u.createAndFill())}}return t}function pK(t,e){if(!oo(t))return!1;if(e){const n=Oo(t);e(i5(t.tr,n,n.left))}return!0}function hK(t,e){if(!oo(t))return!1;if(e){const n=Oo(t);e(i5(t.tr,n,n.right))}return!0}function mK(t,{map:e,table:n,tableStart:r},o){const s=t.mapping.maps.length;for(let a=0;a<e.height;){const l=a*e.width+o,u=e.map[l],c=n.nodeAt(u),f=c.attrs;if(o>0&&e.map[l-1]==u||o<e.width-1&&e.map[l+1]==u)t.setNodeMarkup(t.mapping.slice(s).map(r+u),null,Qs(f,o-e.colCount(u)));else{const h=t.mapping.slice(s).map(r+u);t.delete(h,h+c.nodeSize)}a+=f.rowspan}}function gK(t,e){if(!oo(t))return!1;if(e){const n=Oo(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let o=n.right-1;mK(r,n,o),o!=n.left;o--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=rn.get(s)}e(r)}return!0}function bK(t,e,n){var r;const o=Pn(e.type.schema).header_cell;for(let s=0;s<t.width;s++)if(((r=e.nodeAt(t.map[s+n*t.width]))==null?void 0:r.type)!=o)return!1;return!0}function s5(t,{map:e,tableStart:n,table:r},o){var s;let a=n;for(let c=0;c<o;c++)a+=r.child(c).nodeSize;const l=[];let u=o>0?-1:0;bK(e,r,o+u)&&(u=o==0||o==e.height?null:0);for(let c=0,f=e.width*o;c<e.width;c++,f++)if(o>0&&o<e.height&&e.map[f]==e.map[f-e.width]){const h=e.map[f],m=r.nodeAt(h).attrs;t.setNodeMarkup(n+h,null,{...m,rowspan:m.rowspan+1}),c+=m.colspan-1}else{const h=u==null?Pn(r.type.schema).cell:(s=r.nodeAt(e.map[f+u*e.width]))==null?void 0:s.type,m=h==null?void 0:h.createAndFill();m&&l.push(m)}return t.insert(a,Pn(r.type.schema).row.create(null,l)),t}function vK(t,e){if(!oo(t))return!1;if(e){const n=Oo(t);e(s5(t.tr,n,n.top))}return!0}function yK(t,e){if(!oo(t))return!1;if(e){const n=Oo(t);e(s5(t.tr,n,n.bottom))}return!0}function wK(t,{map:e,table:n,tableStart:r},o){let s=0;for(let c=0;c<o;c++)s+=n.child(c).nodeSize;const a=s+n.child(o).nodeSize,l=t.mapping.maps.length;t.delete(s+r,a+r);const u=new Set;for(let c=0,f=o*e.width;c<e.width;c++,f++){const h=e.map[f];if(!u.has(h)){if(u.add(h),o>0&&h==e.map[f-e.width]){const m=n.nodeAt(h).attrs;t.setNodeMarkup(t.mapping.slice(l).map(h+r),null,{...m,rowspan:m.rowspan-1}),c+=m.colspan-1}else if(o<e.height&&h==e.map[f+e.width]){const m=n.nodeAt(h),g=m.attrs,b=m.type.create({...g,rowspan:m.attrs.rowspan-1},m.content),y=e.positionAt(o+1,c,n);t.insert(t.mapping.slice(l).map(r+y),b),c+=g.colspan-1}}}}function xK(t,e){if(!oo(t))return!1;if(e){const n=Oo(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let o=n.bottom-1;wK(r,n,o),o!=n.top;o--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=rn.get(n.table)}e(r)}return!0}function a5(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function CK({width:t,height:e,map:n},r){let o=r.top*t+r.left,s=o,a=(r.bottom-1)*t+r.left,l=o+(r.right-r.left-1);for(let u=r.top;u<r.bottom;u++){if(r.left>0&&n[s]==n[s-1]||r.right<t&&n[l]==n[l+1])return!0;s+=t,l+=t}for(let u=r.left;u<r.right;u++){if(r.top>0&&n[o]==n[o-t]||r.bottom<e&&n[a]==n[a+t])return!0;o++,a++}return!1}function l5(t,e){const n=t.selection;if(!(n instanceof Vt)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=Oo(t),{map:o}=r;if(CK(o,r))return!1;if(e){const s=t.tr,a={};let l=ue.empty,u,c;for(let f=r.top;f<r.bottom;f++)for(let h=r.left;h<r.right;h++){const m=o.map[f*o.width+h],g=r.table.nodeAt(m);if(!(a[m]||!g))if(a[m]=!0,u==null)u=m,c=g;else{a5(g)||(l=l.append(g.content));const b=s.mapping.map(m+r.tableStart);s.delete(b,b+g.nodeSize)}}if(u==null||c==null)return!0;if(s.setNodeMarkup(u+r.tableStart,null,{...n5(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),l.size){const f=u+1+c.content.size,h=a5(c)?u+1:f;s.replaceWith(h+r.tableStart,f+r.tableStart,l)}s.setSelection(new Vt(s.doc.resolve(u+r.tableStart))),e(s)}return!0}function u5(t,e){const n=Pn(t.schema);return EK(({node:r})=>n[r.type.spec.tableRole])(t,e)}function EK(t){return(e,n)=>{var r;const o=e.selection;let s,a;if(o instanceof Vt){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;s=o.$anchorCell.nodeAfter,a=o.$anchorCell.pos}else{if(s=nK(o.$from),!s)return!1;a=(r=bl(o.$from))==null?void 0:r.pos}if(s==null||a==null||s.attrs.colspan==1&&s.attrs.rowspan==1)return!1;if(n){let l=s.attrs;const u=[],c=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});const f=Oo(e),h=e.tr;for(let g=0;g<f.right-f.left;g++)u.push(c?{...l,colwidth:c&&c[g]?[c[g]]:null}:l);let m;for(let g=f.top;g<f.bottom;g++){let b=f.map.positionAt(g,f.left,f.table);g==f.top&&(b+=s.nodeSize);for(let y=f.left,w=0;y<f.right;y++,w++)y==f.left&&g==f.top||h.insert(m=h.mapping.map(b+f.tableStart,1),t({node:s,row:g,col:y}).createAndFill(u[w]))}h.setNodeMarkup(a,t({node:s,row:f.top,col:f.left}),u[0]),o instanceof Vt&&h.setSelection(new Vt(h.doc.resolve(o.$anchorCell.pos),m?h.doc.resolve(m):void 0)),n(h)}return!0}}function _K(t,e){return function(n,r){if(!oo(n))return!1;const o=gp(n);if(o.nodeAfter.attrs[t]===e)return!1;if(r){const s=n.tr;n.selection instanceof Vt?n.selection.forEachCell((a,l)=>{a.attrs[t]!==e&&s.setNodeMarkup(l,null,{...a.attrs,[t]:e})}):s.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[t]:e}),r(s)}return!0}}function SK(t){return function(e,n){if(!oo(e))return!1;if(n){const r=Pn(e.schema),o=Oo(e),s=e.tr,a=o.map.cellsInRect(t=="column"?{left:o.left,top:0,right:o.right,bottom:o.map.height}:t=="row"?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),l=a.map(u=>o.table.nodeAt(u));for(let u=0;u<a.length;u++)l[u].type==r.header_cell&&s.setNodeMarkup(o.tableStart+a[u],r.cell,l[u].attrs);if(s.steps.length==0)for(let u=0;u<a.length;u++)s.setNodeMarkup(o.tableStart+a[u],r.header_cell,l[u].attrs);n(s)}return!0}}function c5(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let o=0;o<r.length;o++){const s=e.table.nodeAt(r[o]);if(s&&s.type!==n.header_cell)return!1}return!0}function tc(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?SK(t):function(n,r){if(!oo(n))return!1;if(r){const o=Pn(n.schema),s=Oo(n),a=n.tr,l=c5("row",s,o),u=c5("column",s,o),f=(t==="column"?l:t==="row"?u:!1)?1:0,h=t=="column"?{left:0,top:f,right:1,bottom:s.map.height}:t=="row"?{left:f,top:0,right:s.map.width,bottom:1}:s,m=t=="column"?u?o.cell:o.header_cell:t=="row"?l?o.cell:o.header_cell:o.cell;s.map.cellsInRect(h).forEach(g=>{const b=g+s.tableStart,y=a.doc.nodeAt(b);y&&a.setNodeMarkup(b,m,y.attrs)}),r(a)}return!0}}tc("row",{useDeprecatedLogic:!0}),tc("column",{useDeprecatedLogic:!0});var kK=tc("cell",{useDeprecatedLogic:!0});function TK(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,o=t.before();r>=0;r--){const s=t.node(-1).child(r),a=s.lastChild;if(a)return o-1-a.nodeSize;o-=s.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),o=t.after();r<n.childCount;r++){const s=n.child(r);if(s.childCount)return o+1;o+=s.nodeSize}}return null}function d5(t){return function(e,n){if(!oo(e))return!1;const r=TK(gp(e),t);if(r==null)return!1;if(n){const o=e.doc.resolve(r);n(e.tr.setSelection(Ie.between(o,oK(o))).scrollIntoView())}return!0}}function AK(t,e){const n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function bp(t,e){const n=t.selection;if(!(n instanceof Vt))return!1;if(e){const r=t.tr,o=Pn(t.schema).cell.createAndFill().content;n.forEachCell((s,a)=>{s.content.eq(o)||r.replace(r.mapping.map(a+1),r.mapping.map(a+s.nodeSize-1),new xe(o,0,0))}),r.docChanged&&e(r)}return!0}function OK(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const o=e.child(0),s=o.type.spec.tableRole,a=o.type.schema,l=[];if(s=="row")for(let u=0;u<e.childCount;u++){let c=e.child(u).content;const f=u?0:Math.max(0,n-1),h=u<e.childCount-1?0:Math.max(0,r-1);(f||h)&&(c=Jg(Pn(a).row,new xe(c,f,h)).content),l.push(c)}else if(s=="cell"||s=="header_cell")l.push(n||r?Jg(Pn(a).row,new xe(e,n,r)).content:e);else return null;return MK(a,l)}function MK(t,e){const n=[];for(let o=0;o<e.length;o++){const s=e[o];for(let a=s.childCount-1;a>=0;a--){const{rowspan:l,colspan:u}=s.child(a).attrs;for(let c=o;c<o+l;c++)n[c]=(n[c]||0)+u}}let r=0;for(let o=0;o<n.length;o++)r=Math.max(r,n[o]);for(let o=0;o<n.length;o++)if(o>=e.length&&e.push(ue.empty),n[o]<r){const s=Pn(t).cell.createAndFill(),a=[];for(let l=n[o];l<r;l++)a.push(s);e[o]=e[o].append(ue.from(a))}return{height:e.length,width:r,rows:e}}function Jg(t,e){const n=t.createAndFill();return new f0(n).replace(0,n.content.size,e).doc}function BK({width:t,height:e,rows:n},r,o){if(t!=r){const s=[],a=[];for(let l=0;l<n.length;l++){const u=n[l],c=[];for(let f=s[l]||0,h=0;f<r;h++){let m=u.child(h%u.childCount);f+m.attrs.colspan>r&&(m=m.type.createChecked(Qs(m.attrs,m.attrs.colspan,f+m.attrs.colspan-r),m.content)),c.push(m),f+=m.attrs.colspan;for(let g=1;g<m.attrs.rowspan;g++)s[l+g]=(s[l+g]||0)+m.attrs.colspan}a.push(ue.from(c))}n=a,t=r}if(e!=o){const s=[];for(let a=0,l=0;a<o;a++,l++){const u=[],c=n[l%e];for(let f=0;f<c.childCount;f++){let h=c.child(f);a+h.attrs.rowspan>o&&(h=h.type.create({...h.attrs,rowspan:Math.max(1,o-h.attrs.rowspan)},h.content)),u.push(h)}s.push(ue.from(u))}n=s,e=o}return{width:t,height:e,rows:n}}function RK(t,e,n,r,o,s,a){const l=t.doc.type.schema,u=Pn(l);let c,f;if(o>e.width)for(let h=0,m=0;h<e.height;h++){const g=n.child(h);m+=g.nodeSize;const b=[];let y;g.lastChild==null||g.lastChild.type==u.cell?y=c||(c=u.cell.createAndFill()):y=f||(f=u.header_cell.createAndFill());for(let w=e.width;w<o;w++)b.push(y);t.insert(t.mapping.slice(a).map(m-1+r),b)}if(s>e.height){const h=[];for(let b=0,y=(e.height-1)*e.width;b<Math.max(e.width,o);b++){const w=b>=e.width?!1:n.nodeAt(e.map[y+b]).type==u.header_cell;h.push(w?f||(f=u.header_cell.createAndFill()):c||(c=u.cell.createAndFill()))}const m=u.row.create(null,ue.from(h)),g=[];for(let b=e.height;b<s;b++)g.push(m);t.insert(t.mapping.slice(a).map(r+n.nodeSize-2),g)}return!!(c||f)}function f5(t,e,n,r,o,s,a,l){if(a==0||a==e.height)return!1;let u=!1;for(let c=o;c<s;c++){const f=a*e.width+c,h=e.map[f];if(e.map[f-e.width]==h){u=!0;const m=n.nodeAt(h),{top:g,left:b}=e.findCell(h);t.setNodeMarkup(t.mapping.slice(l).map(h+r),null,{...m.attrs,rowspan:a-g}),t.insert(t.mapping.slice(l).map(e.positionAt(a,b,n)),m.type.createAndFill({...m.attrs,rowspan:g+m.attrs.rowspan-a})),c+=m.attrs.colspan-1}}return u}function p5(t,e,n,r,o,s,a,l){if(a==0||a==e.width)return!1;let u=!1;for(let c=o;c<s;c++){const f=c*e.width+a,h=e.map[f];if(e.map[f-1]==h){u=!0;const m=n.nodeAt(h),g=e.colCount(h),b=t.mapping.slice(l).map(h+r);t.setNodeMarkup(b,null,Qs(m.attrs,a-g,m.attrs.colspan-(a-g))),t.insert(b+m.nodeSize,m.type.createAndFill(Qs(m.attrs,0,a-g))),c+=m.attrs.rowspan-1}}return u}function h5(t,e,n,r,o){let s=n?t.doc.nodeAt(n-1):t.doc;if(!s)throw new Error("No table found");let a=rn.get(s);const{top:l,left:u}=r,c=u+o.width,f=l+o.height,h=t.tr;let m=0;function g(){if(s=n?h.doc.nodeAt(n-1):h.doc,!s)throw new Error("No table found");a=rn.get(s),m=h.mapping.maps.length}RK(h,a,s,n,c,f,m)&&g(),f5(h,a,s,n,u,c,l,m)&&g(),f5(h,a,s,n,u,c,f,m)&&g(),p5(h,a,s,n,l,f,u,m)&&g(),p5(h,a,s,n,l,f,c,m)&&g();for(let b=l;b<f;b++){const y=a.positionAt(b,u,s),w=a.positionAt(b,c,s);h.replace(h.mapping.slice(m).map(y+n),h.mapping.slice(m).map(w+n),new xe(o.rows[b-l],0,0))}g(),h.setSelection(new Vt(h.doc.resolve(n+a.positionAt(l,u,s)),h.doc.resolve(n+a.positionAt(f-1,c-1,s)))),e(h)}var IK=W0({ArrowLeft:yp("horiz",-1),ArrowRight:yp("horiz",1),ArrowUp:yp("vert",-1),ArrowDown:yp("vert",1),"Shift-ArrowLeft":wp("horiz",-1),"Shift-ArrowRight":wp("horiz",1),"Shift-ArrowUp":wp("vert",-1),"Shift-ArrowDown":wp("vert",1),Backspace:bp,"Mod-Backspace":bp,Delete:bp,"Mod-Delete":bp});function vp(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function yp(t,e){return(n,r,o)=>{if(!o)return!1;const s=n.selection;if(s instanceof Vt)return vp(n,r,Ve.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const a=m5(o,t,e);if(a==null)return!1;if(t=="horiz")return vp(n,r,Ve.near(n.doc.resolve(s.head+e),e));{const l=n.doc.resolve(a),u=t5(l,t,e);let c;return u?c=Ve.near(u,1):e<0?c=Ve.near(n.doc.resolve(l.before(-1)),-1):c=Ve.near(n.doc.resolve(l.after(-1)),1),vp(n,r,c)}}}function wp(t,e){return(n,r,o)=>{if(!o)return!1;const s=n.selection;let a;if(s instanceof Vt)a=s;else{const u=m5(o,t,e);if(u==null)return!1;a=new Vt(n.doc.resolve(u))}const l=t5(a.$headCell,t,e);return l?vp(n,r,new Vt(a.$anchorCell,l)):!1}}function LK(t,e){const n=t.state.doc,r=bl(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new Vt(r))),!0):!1}function PK(t,e,n){if(!oo(t.state))return!1;let r=OK(n);const o=t.state.selection;if(o instanceof Vt){r||(r={width:1,height:1,rows:[ue.from(Jg(Pn(t.state.schema).cell,n))]});const s=o.$anchorCell.node(-1),a=o.$anchorCell.start(-1),l=rn.get(s).rectBetween(o.$anchorCell.pos-a,o.$headCell.pos-a);return r=BK(r,l.right-l.left,l.bottom-l.top),h5(t.state,t.dispatch,a,l,r),!0}else if(r){const s=gp(t.state),a=s.start(-1);return h5(t.state,t.dispatch,a,rn.get(s.node(-1)).findCell(s.pos-a),r),!0}else return!1}function DK(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=g5(t,e.target);let o;if(e.shiftKey&&t.state.selection instanceof Vt)s(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(o=bl(t.state.selection.$anchor))!=null&&((n=Yg(t,e))==null?void 0:n.pos)!=o.pos)s(o,e),e.preventDefault();else if(!r)return;function s(u,c){let f=Yg(t,c);const h=ns.getState(t.state)==null;if(!f||!Xg(u,f))if(h)f=u;else return;const m=new Vt(u,f);if(h||!t.state.selection.eq(m)){const g=t.state.tr.setSelection(m);h&&g.setMeta(ns,u.pos),t.dispatch(g)}}function a(){t.root.removeEventListener("mouseup",a),t.root.removeEventListener("dragstart",a),t.root.removeEventListener("mousemove",l),ns.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(ns,-1))}function l(u){const c=u,f=ns.getState(t.state);let h;if(f!=null)h=t.state.doc.resolve(f);else if(g5(t,c.target)!=r&&(h=Yg(t,e),!h))return a();h&&s(h,c)}t.root.addEventListener("mouseup",a),t.root.addEventListener("dragstart",a),t.root.addEventListener("mousemove",l)}function m5(t,e,n){if(!(t.state.selection instanceof Ie))return null;const{$head:r}=t.state.selection;for(let o=r.depth-1;o>=0;o--){const s=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=r.before(o),u=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(u)?l:null}}return null}function g5(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Yg(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?bl(t.state.doc.resolve(n.pos)):null}var FK=class{constructor(e,n){this.node=e,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Zg(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,Zg(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function Zg(t,e,n,r,o,s){var a;let l=0,u=!0,c=e.firstChild;const f=t.firstChild;if(f){for(let h=0,m=0;h<f.childCount;h++){const{colspan:g,colwidth:b}=f.child(h).attrs;for(let y=0;y<g;y++,m++){const w=o==m?s:b&&b[y],x=w?w+"px":"";if(l+=w||r,w||(u=!1),c)c.style.width!=x&&(c.style.width=x),c=c.nextSibling;else{const _=document.createElement("col");_.style.width=x,e.appendChild(_)}}}for(;c;){const h=c.nextSibling;(a=c.parentNode)==null||a.removeChild(c),c=h}u?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}var gr=new kt("tableColumnResizing");function VK({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=FK,lastColumnResizable:o=!0}={}){const s=new dt({key:gr,state:{init(a,l){var u,c;const f=(c=(u=s.spec)==null?void 0:u.props)==null?void 0:c.nodeViews,h=Pn(l.schema).table.name;return r&&f&&(f[h]=(m,g)=>new r(m,n,g)),new $K(-1,!1)},apply(a,l){return l.apply(a)}},props:{attributes:a=>{const l=gr.getState(a);return l&&l.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(a,l)=>{zK(a,l,t,o)},mouseleave:a=>{HK(a)},mousedown:(a,l)=>{UK(a,l,e,n)}},decorations:a=>{const l=gr.getState(a);if(l&&l.activeHandle>-1)return GK(a,l.activeHandle)},nodeViews:{}}});return s}var $K=class Sh{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(gr);if(r&&r.setHandle!=null)return new Sh(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Sh(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let o=e.mapping.map(n.activeHandle,-1);return Gg(e.doc.resolve(o))||(o=-1),new Sh(o,n.dragging)}return n}};function zK(t,e,n,r){if(!t.editable)return;const o=gr.getState(t.state);if(o&&!o.dragging){const s=jK(e.target);let a=-1;if(s){const{left:l,right:u}=s.getBoundingClientRect();e.clientX-l<=n?a=b5(t,e,"left",n):u-e.clientX<=n&&(a=b5(t,e,"right",n))}if(a!=o.activeHandle){if(!r&&a!==-1){const l=t.state.doc.resolve(a),u=l.node(-1),c=rn.get(u),f=l.start(-1);if(c.colCount(l.pos-f)+l.nodeAfter.attrs.colspan-1==c.width-1)return}y5(t,a)}}}function HK(t){if(!t.editable)return;const e=gr.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&y5(t,-1)}function UK(t,e,n,r){var o;if(!t.editable)return!1;const s=(o=t.dom.ownerDocument.defaultView)!=null?o:window,a=gr.getState(t.state);if(!a||a.activeHandle==-1||a.dragging)return!1;const l=t.state.doc.nodeAt(a.activeHandle),u=WK(t,a.activeHandle,l.attrs);t.dispatch(t.state.tr.setMeta(gr,{setDragging:{startX:e.clientX,startWidth:u}}));function c(h){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",f);const m=gr.getState(t.state);m!=null&&m.dragging&&(qK(t,m.activeHandle,v5(m.dragging,h,n)),t.dispatch(t.state.tr.setMeta(gr,{setDragging:null})))}function f(h){if(!h.which)return c(h);const m=gr.getState(t.state);if(m&&m.dragging){const g=v5(m.dragging,h,n);w5(t,m.activeHandle,g,r)}}return w5(t,a.activeHandle,u,r),s.addEventListener("mouseup",c),s.addEventListener("mousemove",f),e.preventDefault(),!0}function WK(t,e,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const s=t.domAtPos(e);let l=s.node.childNodes[s.offset].offsetWidth,u=n;if(r)for(let c=0;c<n;c++)r[c]&&(l-=r[c],u--);return l/u}function jK(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function b5(t,e,n,r){const o=n=="right"?-r:r,s=t.posAtCoords({left:e.clientX+o,top:e.clientY});if(!s)return-1;const{pos:a}=s,l=bl(t.state.doc.resolve(a));if(!l)return-1;if(n=="right")return l.pos;const u=rn.get(l.node(-1)),c=l.start(-1),f=u.map.indexOf(l.pos-c);return f%u.width==0?-1:c+u.map[f-1]}function v5(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function y5(t,e){t.dispatch(t.state.tr.setMeta(gr,{setHandle:e}))}function qK(t,e,n){const r=t.state.doc.resolve(e),o=r.node(-1),s=rn.get(o),a=r.start(-1),l=s.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1,u=t.state.tr;for(let c=0;c<s.height;c++){const f=c*s.width+l;if(c&&s.map[f]==s.map[f-s.width])continue;const h=s.map[f],m=o.nodeAt(h).attrs,g=m.colspan==1?0:l-s.colCount(h);if(m.colwidth&&m.colwidth[g]==n)continue;const b=m.colwidth?m.colwidth.slice():KK(m.colspan);b[g]=n,u.setNodeMarkup(a+h,null,{...m,colwidth:b})}u.docChanged&&t.dispatch(u)}function w5(t,e,n,r){const o=t.state.doc.resolve(e),s=o.node(-1),a=o.start(-1),l=rn.get(s).colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1;let u=t.domAtPos(o.start(-1)).node;for(;u&&u.nodeName!="TABLE";)u=u.parentNode;u&&Zg(s,u.firstChild,u,r,l,n)}function KK(t){return Array(t).fill(0)}function GK(t,e){var n;const r=[],o=t.doc.resolve(e),s=o.node(-1);if(!s)return ht.empty;const a=rn.get(s),l=o.start(-1),u=a.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<a.height;c++){const f=u+c*a.width;if((u==a.width-1||a.map[f]!=a.map[f+1])&&(c==0||a.map[f]!=a.map[f-a.width])){const h=a.map[f],m=l+h+s.nodeAt(h).nodeSize-1,g=document.createElement("div");g.className="column-resize-handle",(n=gr.getState(t))!=null&&n.dragging&&r.push(Yt.node(l+h,l+h+s.nodeAt(h).nodeSize,{class:"column-resize-dragging"})),r.push(Yt.widget(m,g))}}return ht.create(t.doc,r)}function XK({allowTableNodeSelection:t=!1}={}){return new dt({key:ns,state:{init(){return null},apply(e,n){const r=e.getMeta(ns);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:o,pos:s}=e.mapping.mapResult(n);return o?null:s}},props:{decorations:aK,handleDOMEvents:{mousedown:DK},createSelectionBetween(e){return ns.getState(e.state)!=null?e.state.selection:null},handleTripleClick:LK,handleKeyDown:IK,handlePaste:PK},appendTransaction(e,n,r){return cK(r,o5(r,n),t)}})}const JK=(t,e,n)=>{if(!t.doc)return t;const r=t.doc.nodeAt(e);if(!r||n===r.attrs.backgroundColor)return t;const o={...r.attrs,backgroundColor:n};return t.setNodeMarkup(e,r.type,o,r.marks)},YK=(t,e,n)=>{const{doc:r,selection:o}=t;return!r||!o||!(o instanceof Vt)||o.forEachCell((s,a)=>{t=JK(t,a,n)}),t},x5=(t,e)=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=r;return n=n.setSelection(s),n=YK(n,e,t),n.docChanged?(o==null||o(n),!0):!1},ZK=at.create({name:"tableCellBackground",addOptions(){return{types:["tableCell"],HTMLAttributes:{}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{parseHTML:t=>t.style.backgroundColor||"",renderHTML:t=>!t.backgroundColor||t.backgroundColor===""?{}:{style:`background-color: ${t.backgroundColor}`}}}}]},addCommands(){return{setTableCellBackground:t=>x5(t,this.options),unsetTableCellBackground:()=>x5("",this.options)}}}),QK=Rt.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",mt(this.options.HTMLAttributes,t),0]}}),NK=Rt.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",mt(this.options.HTMLAttributes,t),0]}}),eG=Rt.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",mt(this.options.HTMLAttributes,t),0]}});function Qg(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function C5(t,e,n,r,o,s){var a;let l=0,u=!0,c=e.firstChild;const f=t.firstChild;if(f!==null)for(let h=0,m=0;h<f.childCount;h+=1){const{colspan:g,colwidth:b}=f.child(h).attrs;for(let y=0;y<g;y+=1,m+=1){const w=o===m?s:b&&b[y],x=w?`${w}px`:"";if(l+=w||r,w||(u=!1),c){if(c.style.width!==x){const[_,S]=Qg(r,w);c.style.setProperty(_,S)}c=c.nextSibling}else{const _=document.createElement("col"),[S,C]=Qg(r,w);_.style.setProperty(S,C),e.appendChild(_)}}}for(;c;){const h=c.nextSibling;(a=c.parentNode)===null||a===void 0||a.removeChild(c),c=h}u?(n.style.width=`${l}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${l}px`)}class tG{constructor(e,n){this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),C5(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,C5(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function nG(t,e,n,r){let o=0,s=!0;const a=[],l=t.firstChild;if(!l)return{};for(let h=0,m=0;h<l.childCount;h+=1){const{colspan:g,colwidth:b}=l.child(h).attrs;for(let y=0;y<g;y+=1,m+=1){const w=n===m?r:b&&b[y];o+=w||e,w||(s=!1);const[x,_]=Qg(e,w);a.push(["col",{style:`${x}: ${_}`}])}}const u=s?`${o}px`:"",c=s?"":`${o}px`;return{colgroup:["colgroup",{},...a],tableWidth:u,tableMinWidth:c}}function E5(t,e){return t.createAndFill()}function rG(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function oG(t,e,n,r,o){const s=rG(t),a=[],l=[];for(let c=0;c<n;c+=1){const f=E5(s.cell);if(f&&l.push(f),r){const h=E5(s.header_cell);h&&a.push(h)}}const u=[];for(let c=0;c<e;c+=1)u.push(s.row.createChecked(null,r&&c===0?a:l));return s.table.createChecked(null,u)}function iG(t){return t instanceof Vt}const xp=({editor:t})=>{const{selection:e}=t.state;if(!iG(e))return!1;let n=0;const r=D6(e.ranges[0].$from,s=>s.type.name==="table");return r==null||r.node.descendants(s=>{if(s.type.name==="table")return!1;["tableCell","tableHeader"].includes(s.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},sG=Rt.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:tG,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:n,tableWidth:r,tableMinWidth:o}=nG(t,this.options.cellMinWidth);return["table",mt(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${o}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:o,editor:s})=>{const a=oG(s.schema,t,e,n);if(o){const l=r.selection.from+1;r.replaceSelectionWith(a).scrollIntoView().setSelection(Ie.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>pK(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>hK(t,e),deleteColumn:()=>({state:t,dispatch:e})=>gK(t,e),addRowBefore:()=>({state:t,dispatch:e})=>vK(t,e),addRowAfter:()=>({state:t,dispatch:e})=>yK(t,e),deleteRow:()=>({state:t,dispatch:e})=>xK(t,e),deleteTable:()=>({state:t,dispatch:e})=>AK(t,e),mergeCells:()=>({state:t,dispatch:e})=>l5(t,e),splitCell:()=>({state:t,dispatch:e})=>u5(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>tc("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>tc("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>kK(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>l5(t,e)?!0:u5(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>_K(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>d5(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>d5(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&o5(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=Vt.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:xp,"Mod-Backspace":xp,Delete:xp,"Mod-Delete":xp}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[VK({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],XK({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:st(Be(t,"tableRole",e))}}}),aG=["disabled"],lG={"content-class":"table-grid-size-editor","content-style":"padding:0"},uG={class:"flex flex-col flex-wrap gap-1 justify-between"},cG=["onMouseover","onMousedown"],dG={class:"text-center text-sm text-zinc-600 mt-2"},fG=i.defineComponent({__name:"CreateTablePopover",props:{disabled:{type:Boolean,default:!1}},emits:["create-table"],setup(t,{emit:e}){const n=e,r=i.ref(!1),o=i.ref(!0),s=i.reactive({rows:Kl()?hf:pf,cols:Kl()?hf:pf}),a=i.reactive({rows:mf,cols:mf});function l(f,h){f===s.rows&&(s.rows=Math.min(f+1,hf)),h===s.cols&&(s.cols=Math.min(h+1,hf)),a.rows=f,a.cols=h}function u(f,h){n("create-table",{rows:f,cols:h,withHeaderRow:i.unref(o)}),c()}function c(){r.value=!1,o.value=!1,s.rows=pf,s.cols=pf,a.rows=mf,a.cols=mf}return(f,h)=>(i.openBlock(),i.createBlock(i.unref(Oa),null,{default:i.withCtx(()=>[i.createVNode(i.unref(Ra),{"as-child":""},{default:i.withCtx(()=>[i.createElementVNode("button",{disabled:t.disabled,class:"m-0 p-0"},[i.renderSlot(f.$slots,"trigger")],8,aG)]),_:3}),i.createVNode(i.unref(Ma),{class:"w-full",align:"start",side:"bottom"},{default:i.withCtx(()=>[i.createElementVNode("div",lG,[i.createElementVNode("div",uG,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.rows,m=>(i.openBlock(),i.createElementBlock("div",{key:"r"+m,class:"flex gap-1"},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.cols,g=>(i.openBlock(),i.createElementBlock("div",{key:"c"+g,class:i.normalizeClass([[g<=a.cols&&m<=a.rows&&"bg-ed-foreground border-ed-border","cursor-pointer"],"pa-1"]),onMouseover:b=>l(m,g),onMousedown:b=>u(m,g)},h[0]||(h[0]=[i.createElementVNode("div",{class:"w-4 h-4 p-1 border box-border"},null,-1)]),42,cG))),128))]))),128))]),i.createElementVNode("div",dG,i.toDisplayString(a.rows)+" x "+i.toDisplayString(a.cols),1)])]),_:1})]),_:3}))}}),pG={style:{display:"flex"}},hG=i.defineComponent({__name:"TableActionButton",props:{editor:{},icon:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},color:{default:void 0},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0}},setup(t){const e=t;function n(r){e.disabled||e.editor.chain().focus().insertTable({...r,withHeaderRow:!1}).run()}return(r,o)=>(i.openBlock(),i.createBlock(fG,{disabled:r.disabled,onCreateTable:n},{trigger:i.withCtx(()=>[i.createElementVNode("div",pG,[i.createVNode(je,{icon:r.icon,tooltip:r.tooltip,disabled:r.disabled,color:r.color,action:r.action,"is-active":r.isActive},null,8,["icon","tooltip","disabled","color","action","is-active"])])]),_:1},8,["disabled"]))}}),Ng=sG.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),resizable:!0,lastColumnResizable:!0,allowTableNodeSelection:!1,button:({editor:e,t:n})=>({component:hG,componentProps:{disabled:e.isActive("table")||!1,icon:"Table",tooltip:n("editor.table.tooltip")}})}},addExtensions(){return[NK.configure(this.options.tableRow),QK.configure(this.options.tableHeader),eG.configure(this.options.tableCell),ZK.configure(this.options.tableCellBackground)]}}),mG={class:"flex items-center gap-2 px-2"},gG=i.defineComponent({__name:"TextDropdown",props:{editor:{},disabled:{type:Boolean,default:!1},color:{default:void 0},maxHeight:{default:void 0},icon:{default:void 0},tooltip:{default:""}},setup(t){const e=t,{t:n}=St(),r=i.computed(()=>[{name:"paragraph",label:n("editor.paragraph.tooltip"),iconName:"Paragraph",isActive:()=>e.editor.isActive("paragraph")&&!e.editor.isActive("orderedList")&&!e.editor.isActive("bulletList")&&!e.editor.isActive("taskList"),action:()=>e.editor.chain().focus().clearNodes().run()},{name:"heading1",label:n("editor.heading.h1.tooltip"),isActive:()=>e.editor.isActive("heading",{level:1}),iconName:"Heading1",action:()=>e.editor.chain().focus().clearNodes().toggleHeading({level:1}).run()},{name:"heading2",label:n("editor.heading.h2.tooltip"),isActive:()=>e.editor.isActive("heading",{level:2}),iconName:"Heading2",action:()=>e.editor.chain().focus().clearNodes().toggleHeading({level:2}).run()},{name:"heading3",label:n("editor.heading.h3.tooltip"),isActive:()=>e.editor.isActive("heading",{level:3}),iconName:"Heading3",action:()=>e.editor.chain().focus().clearNodes().toggleHeading({level:3}).run()},{name:"bulletList",label:n("editor.bulletlist.tooltip"),isActive:()=>e.editor.isActive("bulletList"),iconName:"List",action:()=>e.editor.chain().focus().clearNodes().toggleBulletList().run()},{name:"numberedList",label:n("editor.orderedlist.tooltip"),isActive:()=>e.editor.isActive("orderedList"),iconName:"ListOrdered",action:()=>e.editor.chain().focus().clearNodes().toggleOrderedList().run()},{name:"taskList",label:n("editor.tasklist.tooltip"),isActive:()=>e.editor.isActive("taskList"),iconName:"ListTodo",action:()=>e.editor.chain().focus().clearNodes().toggleTaskList().run()},{name:"blockquote",label:n("editor.blockquote.tooltip"),isActive:()=>e.editor.isActive("blockquote"),iconName:"TextQuote",action:()=>e.editor.chain().focus().clearNodes().toggleBlockquote().run()},{name:"codeBlock",label:n("editor.codeblock.tooltip"),isActive:()=>e.editor.isActive("codeBlock"),iconName:"Code2",action:()=>e.editor.chain().focus().clearNodes().toggleCodeBlock().run()}]),o=i.computed(()=>r.value.filter(s=>s.isActive()).pop()??{label:n("editor.modify")});return(s,a)=>{var l;return i.openBlock(),i.createBlock(Ks,{title:(l=o.value)==null?void 0:l.label,"side-offset":5},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,(u,c)=>{var f;return i.openBlock(),i.createBlock(i.unref(ll),{key:c,class:"cursor-pointer",checked:((f=u.isActive)==null?void 0:f.call(u))||!1,onClick:u.action},{default:i.withCtx(()=>[i.createElementVNode("div",mG,[i.createVNode(i.unref(Kt),{name:u.iconName,class:"h3 w-3"},null,8,["name"]),i.createElementVNode("span",null,i.toDisplayString(u.label),1)])]),_:2},1032,["checked","onClick"])}),128))]),_:1},8,["title"])}}}),bG=at.create({name:"text-bubble",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),toolbar:!1,button:()=>({component:gG,componentProps:{}})}}}),_5=at.create({name:"base-kit",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),bubble:{list:A$,defaultBubbleList:BW,button:({editor:e,extension:n,t:r})=>{var l;const{list:o={},defaultBubbleList:s}=((l=n.options)==null?void 0:l.bubble)??{},a=(s==null?void 0:s(e))??[];return RW(o,a,{editor:e,extension:n,t:r})}}}},addExtensions(){var n,r,o,s;const{t}=St(),e=[];this.options.placeholder!==!1&&e.push(AW.configure({placeholder:({node:a,pos:l})=>{var c;const u=(c=a==null?void 0:a.type)==null?void 0:c.name;return u==="heading"?`${t(`editor.heading.h${a.attrs.level}.tooltip`)}`:u==="table"||u==="codeBlock"?"":l===0?t("editor.content"):""},...this.options.placeholder})),this.options.focus!==!1&&e.push(bW.configure({className:"focus",...this.options.focus})),this.options.document!==!1&&(this.options.page?(e.push(cC.configure().extend({content:"page+"})),e.push(bq.configure({types:((r=(n=this.options.page)==null?void 0:n.nodesComputedOption)==null?void 0:r.types)??[],slots:i.useSlots()}))):e.push(cC.configure())),this.options.dropcursor!==!1&&e.push(gW.configure({...this.options.dropcursor,width:2,class:"ProseMirror-dropcursor border-black"})),this.options.characterCount!==!1&&e.push(pW.configure(this.options.characterCount)),this.options.paragraph!==!1&&e.push(aC.configure(this.options.paragraph)),this.options.hardBreak!==!1&&e.push(kW.configure(this.options.hardBreak)),this.options.listItem!==!1&&e.push(TW.configure(this.options.listItem)),this.options.textStyle!==!1&&e.push(ZH.configure(this.options.textStyle)),this.options.history!==!1&&e.push(hg.configure(this.options.history)),this.options.fontSize!==!1&&e.push(A8.configure(this.options.fontSize)),this.options.fontFamily!==!1&&e.push(KC.configure(this.options.fontFamily)),this.options.mode!==Ye.EDITOR&&(this.options.superText!==!1&&this.options.mode!==Ye.PLAIN_TEXT&&(typeof this.options.superText=="boolean"?e.push(NC.configure()):e.push(NC.configure({specialCharModal:(o=this.options.superText)==null?void 0:o.specialCharModal}))),e.push(_q)),this.options.mode===Ye.EDITOR&&(this.options.image!==!1&&e.push(Wg.configure()),e.push(k8.configure({spacer:!0}),Jx,Xx,Yx,dg,Ng)),this.options.mode!==Ye.EDITOR&&this.options.configPlan!==!1&&this.options.mode!==Ye.PLAIN_TEXT&&(typeof this.options.configPlan=="boolean"?e.push(e5.configure()):e.push(e5.configure({specialCharModal:(s=this.options.configPlan)==null?void 0:s.specialCharModal}))),this.options.mode!==Ye.EDITOR&&this.options.mode!==Ye.PLAIN_TEXT&&e.push(kq),e.push(OW,lC.configure(),bG.configure(),SW.configure(),Zx,O8.configure({spacer:!0}),T8.configure({types:["heading","paragraph"],spacer:!0}),YC,ZC,jg,Hg,H1,M8.configure({multicolor:!0}));for(const a in this.options.excludes)Object.prototype.hasOwnProperty.call(this.options.excludes,a)&&this.options.excludes[a]&&Et.remove(e,({name:u})=>u===a);return e},addStorage(){return{mode:this.options.mode}}}),S5=qn.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",mt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),k5=qn.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",mt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),vG=at.create({name:"subAndSuperScript",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,extension:n,t:r})=>{const o=n.options.subscript,s=n.options.superscript,a={component:je,componentProps:{action:()=>e.commands.toggleSubscript(),isActive:()=>e.isActive("subscript")||!1,disabled:!e.can().toggleSubscript(),icon:"Subscript",tooltip:r("editor.subscript.tooltip")}},l={component:je,componentProps:{action:()=>e.commands.toggleSuperscript(),isActive:()=>e.isActive("superscript")||!1,disabled:!e.can().toggleSuperscript(),icon:"Superscript",tooltip:r("editor.superscript.tooltip")}},u=[];return o!==!1&&u.push(a),s!==!1&&u.push(l),u}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(S5.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(k5.configure(this.options.superscript)),t}}),yG={class:"ml-1"},wG=i.defineComponent({__name:"ActionMoreButton",props:{editor:{},disabled:{type:Boolean,default:!1},color:{default:void 0},maxHeight:{default:void 0},icon:{default:void 0},tooltip:{default:""},items:{default:()=>[]}},setup(t){const e=t,n=i.computed(()=>{const r=e.items.find(s=>s.isActive());return r&&!r.default?{...r,icon:r.icon?r.icon:e.icon}:{title:e.tooltip,icon:e.icon,isActive:()=>!1}});return(r,o)=>(i.openBlock(),i.createBlock(Ks,{icon:r.icon,tooltip:r.tooltip,disabled:r.disabled},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.items,(s,a)=>(i.openBlock(),i.createBlock(i.unref(ll),{key:a,checked:n.value.title===s.title,disabled:s.disabled,class:"flex gap-3 items-center",onClick:s.action},{default:i.withCtx(()=>[s.icon?(i.openBlock(),i.createBlock(i.unref(Kt),{key:0,name:s.icon},null,8,["name"])):i.createCommentVNode("",!0),i.createElementVNode("span",yG,i.toDisplayString(s.title),1),s.shortcutKeys?(i.openBlock(),i.createBlock(i.unref(S8),{key:1,class:"ml-auto"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(x3)(s.shortcutKeys)),1)]),_:2},1024)):i.createCommentVNode("",!0)]),_:2},1032,["checked","disabled","onClick"]))),128))]),_:1},8,["icon","tooltip","disabled"]))}}),xG=at.create({name:"moreMark",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:e,extension:n,t:r}){const o=n.options.subscript,s=n.options.superscript,a={action:()=>e.commands.toggleSubscript(),isActive:()=>e.isActive("subscript")||!1,disabled:!e.can().toggleSubscript(),icon:"Subscript",title:r("editor.subscript.tooltip"),shortcutKeys:["mod","."]},l={action:()=>e.commands.toggleSuperscript(),isActive:()=>e.isActive("superscript")||!1,disabled:!e.can().toggleSuperscript(),icon:"Superscript",title:r("editor.superscript.tooltip"),shortcutKeys:["mod",","]},u=fm(e,"code"),c=[];if(o!==!1&&c.push(a),s!==!1&&c.push(l),u){const f={action:()=>e.commands.toggleCode(),isActive:()=>e.isActive("code")||!1,disabled:!e.can().toggleCode(),icon:"Code",title:r("editor.code.tooltip"),shortcutKeys:["mod","E"]};u&&c.push(f)}return{component:wG,componentProps:{icon:"Type",tooltip:r("editor.moremark"),disabled:!e.isEditable||c.every(f=>f.disabled),items:c}}}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(S5.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(k5.configure(this.options.superscript)),t}});function CG(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:s,startOfLine:a,$position:l}=t,u=r&&!o,c=LF(n),f=new RegExp(`\\s${c}$`),h=a?"^":"",m=o?"":c,g=u?new RegExp(`${h}${c}.*?(?=\\s${m}|$)`,"gm"):new RegExp(`${h}(?:^)?${c}[^\\s${m}]*`,"gm"),b=((e=l.nodeBefore)===null||e===void 0?void 0:e.isText)&&l.nodeBefore.text;if(!b)return null;const y=l.pos-b.length,w=Array.from(b.matchAll(g)).pop();if(!w||w.input===void 0||w.index===void 0)return null;const x=w.input.slice(Math.max(0,w.index-1),w.index),_=new RegExp(`^[${s==null?void 0:s.join("")}\0]?$`).test(x);if(s!==null&&!_)return null;const S=y+w.index;let C=S+w[0].length;return u&&f.test(b.slice(C-1,C+1))&&(w[0]+=" ",C+=1),S<l.pos&&C>=l.pos?{range:{from:S,to:C},query:w[0].slice(n.length),text:w[0]}:null}const EG=new kt("suggestion");function _G({pluginKey:t=EG,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:o=!1,allowedPrefixes:s=[" "],startOfLine:a=!1,decorationTag:l="span",decorationClass:u="suggestion",command:c=()=>null,items:f=()=>[],render:h=()=>({}),allow:m=()=>!0,findSuggestionMatch:g=CG}){let b;const y=h==null?void 0:h(),w=new dt({key:t,view(){return{update:async(x,_)=>{var S,C,k,A,T,B,L;const I=(S=this.key)===null||S===void 0?void 0:S.getState(_),V=(C=this.key)===null||C===void 0?void 0:C.getState(x.state),q=I.active&&V.active&&I.range.from!==V.range.from,K=!I.active&&V.active,me=I.active&&!V.active,z=!K&&!me&&I.query!==V.query,U=K||q&&z,P=z||q,G=me||q&&z;if(!U&&!P&&!G)return;const Z=G&&!U?I:V,oe=x.dom.querySelector(`[data-decoration-id="${Z.decorationId}"]`);b={editor:e,range:Z.range,query:Z.query,text:Z.text,items:[],command:ne=>c({editor:e,range:Z.range,props:ne}),decorationNode:oe,clientRect:oe?()=>{var ne;const{decorationId:Ce}=(ne=this.key)===null||ne===void 0?void 0:ne.getState(e.state),_e=x.dom.querySelector(`[data-decoration-id="${Ce}"]`);return(_e==null?void 0:_e.getBoundingClientRect())||null}:null},U&&((k=y==null?void 0:y.onBeforeStart)===null||k===void 0||k.call(y,b)),P&&((A=y==null?void 0:y.onBeforeUpdate)===null||A===void 0||A.call(y,b)),(P||U)&&(b.items=await f({editor:e,query:Z.query})),G&&((T=y==null?void 0:y.onExit)===null||T===void 0||T.call(y,b)),P&&((B=y==null?void 0:y.onUpdate)===null||B===void 0||B.call(y,b)),U&&((L=y==null?void 0:y.onStart)===null||L===void 0||L.call(y,b))},destroy:()=>{var x;b&&((x=y==null?void 0:y.onExit)===null||x===void 0||x.call(y,b))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(x,_,S,C){const{isEditable:k}=e,{composing:A}=e.view,{selection:T}=x,{empty:B,from:L}=T,I={..._};if(I.composing=A,k&&(B||e.view.composing)){(L<_.range.from||L>_.range.to)&&!A&&!_.composing&&(I.active=!1);const V=g({char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:s,startOfLine:a,$position:T.$from}),q=`id_${Math.floor(Math.random()*4294967295)}`;V&&m({editor:e,state:C,range:V.range,isActive:_.active})?(I.active=!0,I.decorationId=_.decorationId?_.decorationId:q,I.range=V.range,I.query=V.query,I.text=V.text):I.active=!1}else I.active=!1;return I.active||(I.decorationId=null,I.range={from:0,to:0},I.query=null,I.text=null),I}},props:{handleKeyDown(x,_){var S;const{active:C,range:k}=w.getState(x.state);return C&&((S=y==null?void 0:y.onKeyDown)===null||S===void 0?void 0:S.call(y,{view:x,event:_,range:k}))||!1},decorations(x){const{active:_,range:S,decorationId:C}=w.getState(x);return _?ht.create(x.doc,[Yt.inline(S.from,S.to,{nodeName:l,class:u,"data-decoration-id":C})]):null}}});return w}const SG=[{label:"优酷",value:"youku",icon:"Youku"},{label:"哔哩哔哩",value:"bilibili",icon:"BiliBili"},{label:"腾讯视频",value:"qqvideo",icon:"QQVideo"}],kG=[{label:"高德地图",value:"amap",icon:"Gaode"},{label:"百度地图",value:"baidu_map",icon:"Baidu"}],TG=[{label:"墨刀",value:"modao",icon:"Modao"},{label:"蓝湖",value:"lanhu",icon:"Lanhu"},{label:"Figma",value:"figma",icon:"Figma"},{label:"Canva",value:"canva",icon:"Canva"},{label:"ProcessOn",value:"processon",icon:"Processon"}],AG=[{label:"CodePen",value:"codepen",icon:"Codepen"}],OG=[{label:"金数据",value:"jinshuju",icon:"Jinshuju"}],MG=[],BG=[...SG,...kG,...TG,...AG,...OG,...MG];function RG(t){const{t:e}=St(),n=[{name:"format",title:e("editor.slash.format"),commands:[{name:"paragraph",label:e("editor.paragraph.tooltip"),aliases:["paragraph","zw"],iconName:"Paragraph",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setHeading({level:1}).run()}},{name:"heading1",label:e("editor.heading.h1.tooltip"),aliases:["h1","bt","bt1"],iconName:"Heading1",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setHeading({level:1}).run()}},{name:"heading2",label:e("editor.heading.h2.tooltip"),aliases:["h2","bt","bt2"],iconName:"Heading2",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setNode("heading",{level:2}).run()}},{name:"heading3",label:e("editor.heading.h3.tooltip"),aliases:["h3","bt","bt3","heading3"],iconName:"Heading3",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setNode("heading",{level:3}).run()}},{name:"bulletList",label:e("editor.bulletlist.tooltip"),aliases:["ul","yxlb","bulletList"],iconName:"List",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).toggleBulletList().run()}},{name:"numberedList",label:e("editor.orderedlist.tooltip"),aliases:["ol","yxlb"],iconName:"ListOrdered",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).toggleOrderedList().run()}},{name:"codeBlock",label:e("editor.codeblock.tooltip"),iconName:"Code2",aliases:["codeBlock"],description:"Code block with syntax highlighting",shouldBeHidden:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setCodeBlock().run()}},{name:"blockquote",label:e("editor.blockquote.tooltip"),description:"插入引入格式",aliases:["yr"],iconName:"TextQuote",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setBlockquote().run()}},{name:"horizontalrule",label:e("editor.horizontalrule.tooltip"),aliases:["fgx","horizontalRule"],iconName:"Minus",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setHorizontalRule().run()}},{name:"link",label:e("editor.link.tooltip"),aliases:["link","lianjie","lj"],iconName:"Link",action:({editor:o,range:s})=>{o.chain().deleteRange(s).extendMarkRange("link").insertContent({type:"text",text:"link",marks:[{type:"link",attrs:{href:"",target:"_blank"}}]}).setLink({href:""}).focus().run()}}]},{name:"insert",title:e("editor.slash.insert"),commands:[{name:"image",label:e("editor.image.tooltip"),iconName:"ImageUp",description:"Insert a image",aliases:["image","tp","tupian"],shouldBeHidden:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setImageUpload().run()}},{name:"table",label:e("editor.table.tooltip"),iconName:"Table",description:"Insert a table",aliases:["table","bg","biaoge","biao"],shouldBeHidden:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).insertTable({rows:3,cols:3,withHeaderRow:!1}).run()}},{name:"video",label:e("editor.video.tooltip"),iconName:"Video",description:"Insert a video",aliases:["video","sp","shipin"],shouldBeHidden:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setVideoUpload().run()}},{name:"taskList",label:e("editor.tasklist.tooltip"),iconName:"ListTodo",description:"Task list with todo items",aliases:["todo"],action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).toggleTaskList().run()}},{name:"columns",label:e("editor.columns.tooltip"),iconName:"Columns2",description:"Add two column content",aliases:["columns","cols","2cols"],shouldBeHidden:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().deleteRange(s).setColumns().focus(o.state.selection.head-1).run()}}]}];if(fm(t,"iframes")){const o=BG;n.push({name:"others",title:e("editor.slash.embed"),commands:o.map(s=>({name:s.value,label:s.label,iconName:s.icon,aliases:[s.value,s.label],shouldBeHidden:a=>a.isActive("columns"),action:({editor:a,range:l})=>{a.chain().deleteRange(l).focus().setIframe({src:"",service:s.value}).run()}}))})}return n}const IG={key:0,class:"grid grid-cols-1 gap-0.5 min-w-48"},LG={className:"text-neutral-500 text-[0.65rem] col-[1/-1] mx-2 mt-2 font-semibold tracking-wider select-none uppercase first:mt-0.5"},PG=["onClick"],DG=["src"],FG={key:1,class:"p-3"},VG={class:"text-xs text-gray-800 dark:text-gray-100"},$G=i.defineComponent({__name:"CommandsList",props:{editor:{},items:{default:void 0},command:{type:Function,default:void 0}},setup(t,{expose:e}){const n=i.ref(0),r=i.ref(0),o=i.ref(null),{t:s}=St(),a=i.ref([]),l=t;e({onKeyDown:u}),i.watch([()=>n.value,()=>r.value],async()=>{if(!o.value)return;await i.nextTick();const y=r.value*1e3+n.value,w=a.value[y];w&&w.scrollIntoView({behavior:"smooth",block:"nearest"})});function u({event:y}){return y.key==="ArrowUp"?(c(),!0):y.key==="ArrowDown"?(f(),!0):y.key==="Enter"?(h(),!0):!1}function c(){var x;if(!l.items.length)return!1;let y=n.value-1,w=r.value;y<0&&(w=r.value-1,y=((x=l.items[w])==null?void 0:x.commands.length)-1||0),w<0&&(w=l.items.length-1,y=l.items[w].commands.length-1),n.value=y,r.value=w}function f(){if(!l.items.length)return!1;const y=l.items[r.value].commands;let w=n.value+1,x=r.value;y.length-1<w&&(w=0,x=r.value+1),l.items.length-1<x&&(x=0),n.value=w,r.value=x}function h(){if(!l.items.length||r.value===-1||n.value===-1)return!1;m(r.value,n.value)}function m(y,w){const x=l.items[y].commands[w];l.command(x)}function g(y,w){m(y,w)}function b(y,w,x){a.value[y*1e3+w]=x}return(y,w)=>{var x;return i.openBlock(),i.createElementBlock("div",{ref_key:"scrollContainer",ref:o,class:"bg-white rounded-lg dark:bg-black shadow-sm border border-neutral-200 dark:border-neutral-800 text-black max-h-[min(80vh,24rem)] overflow-auto flex-wrap mb-8 p-1"},[(x=y.items)!=null&&x.length?(i.openBlock(),i.createElementBlock("div",IG,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(y.items,(_,S)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:_.title},[i.createElementVNode("div",LG,i.toDisplayString(_.title),1),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(_.commands,(C,k)=>(i.openBlock(),i.createElementBlock("button",{ref_for:!0,ref:A=>b(S,k,A),key:k,class:i.normalizeClass(["flex items-center gap-3 px-2 py-1.5 text-sm text-neutral-800 dark:text-neutral-200 text-left w-full rounded-sm outline-none transition-colors",[r.value===S&&n.value===k?"bg-ed-accent text-neutral-800 dark:bg-neutral-900 dark:text-neutral-200":"hover:bg-ed-accent hover:text-neutral-800 dark:hover:bg-neutral-900 dark:hover:text-neutral-200"]]),onClick:A=>g(S,k)},[C.iconUrl?(i.openBlock(),i.createElementBlock("img",{key:0,class:"w-6 h-6",src:C.iconUrl},null,8,DG)):i.createCommentVNode("",!0),C.iconName?(i.openBlock(),i.createBlock(i.unref(Kt),{key:1,name:C.iconName,class:"mr-1 text-lg"},null,8,["name"])):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(C.label),1)],10,PG))),128))],64))),128))])):(i.openBlock(),i.createElementBlock("div",FG,[i.createElementVNode("span",VG,i.toDisplayString(i.unref(s)("editor.slash.empty")),1)]))],512)}}}),Ns="slashCommand";let It;const zG=at.create({name:Ns,priority:200,onCreate(){It=zs("body",{interactive:!0,trigger:"manual",placement:"bottom-start",theme:"slash-command",maxWidth:"16rem",offset:[16,8],popperOptions:{strategy:"fixed",modifiers:[{name:"flip",enabled:!1}]}})},addProseMirrorPlugins(){return[_G({editor:this.editor,char:"/",allowSpaces:!0,startOfLine:!0,pluginKey:new kt(Ns),allow:({state:t,range:e})=>{var c,f,h;const n=t.doc.resolve(e.from),r=n.depth===1,o=n.parent.type.name==="paragraph",s=((c=n.parent.textContent)==null?void 0:c.charAt(0))==="/",a=this.editor.isActive("column"),l=(h=n.parent.textContent)==null?void 0:h.substring((f=n.parent.textContent)==null?void 0:f.indexOf("/")),u=!(l!=null&&l.endsWith(" "));return(r&&o&&s||a&&o&&s)&&u},command:({editor:t,range:e,props:n})=>{const{view:r}=t;n.action({editor:t,range:e}),r.focus()},items:({query:t})=>RG(this.editor).map(s=>({...s,commands:s.commands.filter(a=>{const l=a.label.toLowerCase().trim(),u=t.toLowerCase().trim();if(a.aliases){const c=a.aliases.map(m=>m.toLowerCase().trim()),f=l.match(u),h=c.some(m=>m.match(u));return f||h}return l.match(u)}).filter(a=>a.shouldBeHidden?!a.shouldBeHidden(this.editor):!0)})).filter(s=>s.commands.length>0).map(s=>({...s,commands:s.commands.map(a=>({...a,isEnabled:!0}))})),render:()=>{let t,e=null;return{onStart:n=>{var s;t=new Lx($G,{props:n,editor:n.editor});const{view:r}=n.editor,o=()=>{if(!n.clientRect)return n.editor.storage[Ns].rect;const a=n.clientRect();if(!a)return n.editor.storage[Ns].rect;let l=a.y;if(t.element instanceof HTMLElement&&a.top+t.element.offsetHeight+40>window.innerHeight){const u=a.top+t.element.offsetHeight-window.innerHeight+40;l=a.y-u}return new DOMRect(a.x,l,a.width,a.height)};e=()=>{It==null||It[0].setProps({getReferenceClientRect:o})},(s=r.dom.parentElement)==null||s.addEventListener("scroll",e),t.element&&(It==null||It[0].setProps({getReferenceClientRect:o,appendTo:()=>document.body,content:t.element})),It==null||It[0].show()},onUpdate(n){var a;t.updateProps(n);const{view:r}=n.editor,o=()=>{if(!n.clientRect)return n.editor.storage[Ns].rect;const l=n.clientRect();return l?new DOMRect(l.x,l.y,l.width,l.height):n.editor.storage[Ns].rect},s=()=>{It==null||It[0].setProps({getReferenceClientRect:o})};(a=r.dom.parentElement)==null||a.addEventListener("scroll",s),n.editor.storage[Ns].rect=n.clientRect?o():{width:0,height:0,left:0,top:0,right:0,bottom:0},It==null||It[0].setProps({getReferenceClientRect:o})},onKeyDown(n){var r;return n.event.key==="Escape"?(It==null||It[0].hide(),!0):(It!=null&&It[0].state.isShown||It==null||It[0].show(),(r=t.ref)==null?void 0:r.onKeyDown(n))},onExit(n){var r;if(It==null||It[0].hide(),e){const{view:o}=n.editor;(r=o.dom.parentElement)==null||r.removeEventListener("scroll",e)}t.destroy()}}}})]},addStorage(){return{rect:{width:0,height:0,left:0,top:0,right:0,bottom:0}}}});function HG(t){return t=t.replace("https://youtu.be/","https://www.youtube.com/watch?v=").replace("watch?v=","embed/"),t=t.replace("https://vimeo.com/","https://player.vimeo.com/video/"),/^https?:\/\/www.bilibili.com\/video\/.*/i.test(t)&&(t=t.replace(/\?.*$/i,"").replace("https://www.bilibili.com/video/","https://player.bilibili.com/player.html?bvid=")),t.includes("drive.google.com")&&(t=t.replace("/view","/preview")),t}const T5=Rt.create({name:"video",group:"block",atom:!0,draggable:!0,addAttributes(){return{src:{default:null,renderHTML:({src:t})=>({src:t?HG(t):null})},width:{default:this.options.width,renderHTML:({width:t})=>({width:xn(t)})},frameborder:{default:this.options.frameborder?1:0,parseHTML:()=>this.options.frameborder?1:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen}}},parseHTML(){return[{tag:"div[data-video] iframe"}]},renderHTML({HTMLAttributes:t}){const{width:e="100%"}=t??{},n={...t,width:"100%",height:"100%"},r=`position: relative;overflow: hidden;display: flex;flex: 1;max-width: ${e};`,o=`flex: 1;padding-bottom: ${9/16*100}%;`,l=["div",{style:r},["div",{style:o}],["iframe",n]];return["div",{...this.options.HTMLAttributes,"data-video":""},l]},addCommands(){return{setVideo:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t}),updateVideo:t=>({commands:e})=>e.updateAttributes(this.name,t)}},addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,frameborder:!1,width:gf["size-medium"],HTMLAttributes:{class:"iframe-wrapper",style:"display: flex;justify-content: center;"}}}}),UG=1,WG=1e6,oi={ADD_TOAST:"ADD_TOAST",UPDATE_TOAST:"UPDATE_TOAST",DISMISS_TOAST:"DISMISS_TOAST",REMOVE_TOAST:"REMOVE_TOAST"};let eb=0;function jG(){return eb=(eb+1)%Number.MAX_VALUE,eb.toString()}const tb=new Map;function A5(t){if(tb.has(t))return;const e=setTimeout(()=>{tb.delete(t),nc({type:oi.REMOVE_TOAST,toastId:t})},WG);tb.set(t,e)}const io=i.ref({toasts:[]});function nc(t){switch(t.type){case oi.ADD_TOAST:io.value.toasts=[t.toast,...io.value.toasts].slice(0,UG);break;case oi.UPDATE_TOAST:io.value.toasts=io.value.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e);break;case oi.DISMISS_TOAST:{const{toastId:e}=t;e?A5(e):io.value.toasts.forEach(n=>{A5(n.id)}),io.value.toasts=io.value.toasts.map(n=>n.id===e||e===void 0?{...n,open:!1}:n);break}case oi.REMOVE_TOAST:t.toastId===void 0?io.value.toasts=[]:io.value.toasts=io.value.toasts.filter(e=>e.id!==t.toastId);break}}function nb(){return{toasts:i.computed(()=>io.value.toasts),toast:qG,dismiss:t=>nc({type:oi.DISMISS_TOAST,toastId:t})}}function qG(t){const e=jG(),n=o=>nc({type:oi.UPDATE_TOAST,toast:{...o,id:e}}),r=()=>nc({type:oi.DISMISS_TOAST,toastId:e});return nc({type:oi.ADD_TOAST,toast:{...t,id:e,open:!0,onOpenChange:o=>{o||r()}}}),{id:e,dismiss:r,update:n}}const KG=i.defineComponent({__name:"AIButton",props:{editor:{},icon:{default:void 0},title:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},shortcutKeys:{default:void 0},customClass:{default:""},loading:{type:Boolean,default:!1},tooltipOptions:{default:void 0},color:{default:void 0},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0}},setup(t){const e=t,n=tr(),{toast:r}=nb();function o(){var a,l,u;const s=(l=(a=e.editor.extensionManager.extensions.find(c=>c.name==="AI"))==null?void 0:a.options)==null?void 0:l.completions;if(typeof s!="function"){r({title:"AI completions method is not set or is not a valid function",variant:"destructive"});return}if(s.constructor.name!=="AsyncFunction"){r({title:"AI completions method must be an asynchronous function",variant:"destructive"});return}n.state.AIMenu=!0,(u=e.editor)==null||u.commands.focus()}return(s,a)=>(i.openBlock(),i.createBlock(je,{action:o,title:"AI",disabled:s.disabled,icon:s.icon,tooltip:s.tooltip},null,8,["disabled","icon","tooltip"]))}}),GG=Rt.create({name:"AI",group:"block",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),toolbar:!1,button:({editor:e,t:n})=>({component:KG,componentProps:{icon:"Sparkles",tooltip:n("editor.AI.ask")}})}}});function XG(t,e){const n=atob(t.split(",")[1]),r=new Array(n.length);for(let s=0;s<n.length;s++)r[s]=n.charCodeAt(s);const o=new Uint8Array(r);return new Blob([o],{type:e})}function JG(t,e){return new File([t],e,{type:t.type})}const YG=at.create({name:"importWord",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),upload:void 0,convert:void 0,limit:1024*1024*10,button:({editor:e,extension:n,t:r})=>({component:je,componentProps:{action:()=>{var o;return(o=e.commands)==null?void 0:o.toggleImportWord()},disabled:!e.can().setHorizontalRule(),icon:"Word",tooltip:r("editor.importWord.tooltip")}})}},addCommands(){return{toggleImportWord:()=>({chain:t,editor:e})=>{const{toast:n}=nb(),{t:r}=St();async function o(u){var g;const f=new DOMParser().parseFromString(u,"text/html"),h=f.querySelectorAll("img");if(!h.length)return f.body.innerHTML;if(fm(e,"image")){const b=(g=e.extensionManager.extensions.find(y=>y.name==="importWord"))==null?void 0:g.options;if(b&&typeof b.upload=="function"){const y=[];for(const x of h){const _=x.getAttribute("src"),S=XG(_,"image/jpeg"),C=JG(S,"image.jpeg");y.push(C)}const w=await b.upload(y);for(let x=0;x<h.length;x++){const _=h[x];_.setAttribute("src",w[x].src);const S=_.parentElement;(S==null?void 0:S.tagName)==="P"&&(S.insertAdjacentElement("beforebegin",_),!S.hasChildNodes()&&S.textContent===""&&S.remove())}return f.body.innerHTML}else return console.warn("Image Upload method found, skip image conversion"),f.body.innerHTML}else return console.error("Image extension not found, unable to convert image"),f.body.innerHTML}async function s(u){const c=await o(u);e.chain().setContent(c.toString(),!0).run(),n({title:r("editor.importWord.success")})}const{open:a,onChange:l}=Ze.useFileDialog({accept:".docx",reset:!0,multiple:!1});return a(),l(async u=>{const[c]=Array.from(u??[]);if(c){if(c.size>this.options.limit){n({title:r("editor.importWord.fileTooLarge"),variant:"destructive"});return}if(this.options.convert){const f=await this.options.convert(c);s(f)}else{const f=new FormData,h=JSON.stringify({collaboration_features:{comments:!0,user_id:"e3",track_changes:!0},formatting:{resets:"none",defaults:"inline",styles:"inline",comments:"basic"}});f.append("config",h),f.append("file",c),fetch("https://docx-converter.cke-cs.com/v2/convert/docx-html",{method:"POST",body:f}).then(m=>m.json()).then(async m=>{s(m.html)}).catch(m=>{n({title:r("editor.importWord.error"),variant:"destructive"}),console.error("Error:",m)})}}}),!1}}}}),Cp=i.defineComponent({__name:"TabsContent",props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=i.computed(()=>{const{class:r,...o}=e;return o});return(r,o)=>(i.openBlock(),i.createBlock(i.unref(y9),i.mergeProps({class:i.unref($e)("mt-2 ring-offset-ed-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ed-ring focus-visible:ring-offset-2",e.class)},n.value),{default:i.withCtx(()=>[i.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),vl=new kt("upload-image"),ZG=()=>new dt({key:vl,state:{init(){return ht.empty},apply(t,e){e=e.map(t.mapping,t.doc);const n=t.getMeta(vl);return n!=null&&n.add?n.add.forEach(({id:r,pos:o,src:s})=>{const a=QG(s),l=Yt.widget(o,a,{id:r});e=e.add(t.doc,[l])}):n!=null&&n.remove&&n.remove.forEach(r=>{e=e.remove(e.find(void 0,void 0,o=>o.id===r))}),e}},props:{decorations(t){return this.getState(t)}}});function QG(t){const e=document.createElement("div"),n=document.createElement("img");return n.setAttribute("class","opacity-50"),n.src=t,n.onload=()=>{e.setAttribute("class","img-placeholder")},e.appendChild(n),e}function NG(t,e){var o;const r=vl.getState(t).find(void 0,void 0,s=>s.id===e);return r.length?(o=r[0])==null?void 0:o.from:null}const O5=({validateFn:t,onUpload:e})=>(n,r,o,s)=>{n.forEach(a=>{if(t&&!t(a))return;s||(s=Gi(6));const l=r.state.tr;l.selection.empty||l.deleteSelection();let u=null;r.state.doc.descendants((h,m)=>{h.type.name===ml&&h.attrs.id===s&&(u=m)});const c=URL.createObjectURL(a);l.setMeta(vl,{add:[{id:s,pos:o,src:c}]}),r.dispatch(l);const f=NG(r.state,s)||u;e(a).then(h=>{var w;const{schema:m}=r.state;if(f===null)throw new Error("Not found placeholderPos");const g=typeof h=="object"?c:h,b=(w=m.nodes.image)==null?void 0:w.create({src:g});if(!b)return;const y=r.state.tr.replaceWith(f,f,b).setMeta(vl,{remove:[s]});r.dispatch(y)},()=>{const h=r.state.tr.delete(o,o).setMeta(vl,{remove:[s]});r.dispatch(h)})})},eX=(t,e,n)=>{var o;const r=Array.from(((o=e.clipboardData)==null?void 0:o.files)||[]);if(r.length){e.preventDefault();const s=t.state.selection.from;return n(r,t,s+1),!0}return!1},tX=(t,e,n,r)=>{var s;const o=Array.from(((s=e.dataTransfer)==null?void 0:s.files)||[]);if(!n&&o.length){e.preventDefault();const a=t.posAtCoords({left:e.clientX,top:e.clientY});if(a)return r(o,t,a.pos+1),!0}return!1},nX={class:"flex items-center w-full p-3 my-3 transition-all border rounded-sm cursor-pointer hover:bg-ed-accent border-ed-border text-ed-muted-foreground"},rX={class:"flex items-center justify-between w-full"},oX={class:"flex items-center justify-center gap-3"},iX={class:"text-sm"},sX={class:"flex items-center gap-2"},aX=i.defineComponent({__name:"ImageUploader",props:{...Us},setup(t){const e=t,n=i.ref(""),r=i.ref(),{t:o}=St();function s(c){var b,y;const f=(b=c==null?void 0:c.target)==null?void 0:b.files;if(!e.editor||e.editor.isDestroyed||f.length===0)return;const h=f[0],m=(y=e.editor.extensionManager.extensions.find(w=>w.name==="imageUpload"))==null?void 0:y.options;O5({validateFn:w=>!0,onUpload:m.upload})([h],e.editor.view,e.getPos(),e.node.attrs.id)}function a(){e.editor.chain().setImage({src:n.value}).deleteRange({from:e.getPos(),to:e.getPos()}).focus().run()}function l(){e.deleteNode()}function u(){var c;(c=r.value)==null||c.click()}return(c,f)=>(i.openBlock(),i.createBlock(i.unref(Hs),{id:c.node.attrs.id,class:"p-0 m-0","data-drag-handle":""},{default:i.withCtx(()=>[i.createVNode(i.unref(Oa),{"default-open":"",modal:""},{default:i.withCtx(()=>[i.createVNode(i.unref(Ra),{"as-child":""},{default:i.withCtx(()=>[i.createElementVNode("div",nX,[i.createElementVNode("div",rX,[i.createElementVNode("div",oX,[i.createVNode(i.unref(Kt),{name:"ImageUp",class:"w-6 h-6"}),i.createElementVNode("span",iX,i.toDisplayString(i.unref(o)("editor.image.dialog.title")),1)]),i.createVNode(i.unref(Kt),{name:"Trash2",class:"hover:text-ed-foreground",onClick:i.withModifiers(l,["stop"])})])])]),_:1}),i.createVNode(i.unref(Ma),{"trap-focus":"",class:"w-full","on-open-auto-focus":h=>h.preventDefault()},{default:i.withCtx(()=>[i.createVNode(i.unref(zm),{"default-value":"upload",class:"w-[300px] sm:w-[400px]","activation-mode":"manual"},{default:i.withCtx(()=>[i.createVNode(i.unref(Hm),{class:"grid w-full grid-cols-2"},{default:i.withCtx(()=>[i.createVNode(i.unref(eu),{value:"upload"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.tab.upload")),1)]),_:1}),i.createVNode(i.unref(eu),{value:"link"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.tab.url")),1)]),_:1})]),_:1}),i.createVNode(i.unref(Cp),{value:"upload"},{default:i.withCtx(()=>[i.createVNode(i.unref(er),{class:"w-full mt-1",size:"sm",onClick:u},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.tab.upload")),1)]),_:1}),i.createElementVNode("input",{ref_key:"fileInput",ref:r,type:"file",accept:"image/*",multiple:"",style:{display:"none"},onChange:s},null,544)]),_:1}),i.createVNode(i.unref(Cp),{value:"link"},{default:i.withCtx(()=>[i.createElementVNode("div",sX,[i.createVNode(i.unref(Ba),{modelValue:n.value,"onUpdate:modelValue":f[0]||(f[0]=h=>n.value=h),type:"url",autofocus:"",required:"",placeholder:i.unref(o)("editor.image.dialog.placeholder")},null,8,["modelValue","placeholder"]),i.createVNode(i.unref(er),{onClick:a},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.button.apply")),1)]),_:1})])]),_:1})]),_:1})]),_:1},8,["on-open-auto-focus"])]),_:1})]),_:1},8,["id"]))}}),lX={acceptMimes:["image/jpeg","image/gif","image/png","image/jpg"],maxSize:1024*1024*5},uX=t=>`${(t/1024/1024).toFixed(2)}MB`,cX=Rt.create({name:"imageUpload",isolating:!0,defining:!0,group:"block",draggable:!1,selectable:!0,inline:!1,onCreate(){if(typeof this.options.upload!="function")throw new Error("Image upload function should be a function")},parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML(){return["div",{"data-type":this.name}]},addAttributes(){return{id:{default:Gi(6),parseHTML:t=>t.getAttribute("id"),renderHTML:t=>t.id?{id:t.id}:{}}}},addCommands(){return{setImageUpload:()=>({commands:t})=>t.insertContent(`<div data-type="${this.name}"></div>`)}},addNodeView(){return Ws(aX)},addOptions(){var t;return{...lX,...(t=this.parent)==null?void 0:t.call(this),upload:()=>Promise.reject("Image Upload Function"),button:({editor:e,extension:n,t:r})=>{var o,s;return{component:je,componentProps:{action:()=>e.commands.setImageUpload(),disabled:!((s=(o=e.can()).setImage)!=null&&s.call(o,{})),icon:"ImageUp",tooltip:r("editor.image.tooltip")}}}}},addProseMirrorPlugins(){const{toast:t}=nb(),{t:e}=St(),r=O5({validateFn:o=>this.options.acceptMimes.includes(o.type)?o.size>this.options.maxSize?(t({description:`${e("editor.imageUpload.fileSizeTooBig")} ${uX(this.options.maxSize)}.`,duration:2e3}),!1):!0:(t({description:e("editor.imageUpload.fileTypeNotSupported"),duration:2e3}),!1),onUpload:this.options.upload});return[new dt({props:{handlePaste:(o,s)=>!s.clipboardData||Array.from(s.clipboardData.items||[]).some(l=>l.type==="text/html")?!1:eX(o,s,r),handleDrop:(o,s,a,l)=>(!(s instanceof DragEvent)||!s.dataTransfer||tX(o,s,l,r),!1)}}),ZG()]}}),dX={class:"flex items-center w-full p-3 my-3 hover:bg-ed-accent border border-ed-border text-ed-muted-foreground cursor-pointer rounded-sm transition-all"},fX={key:0,class:"flex justify-center items-center gap-3 text-s"},pX={key:1,class:"flex justify-between items-center w-full"},hX={class:"flex justify-center items-center gap-3"},mX={class:"text-sm"},gX={class:"flex items-center gap-2"},bX=i.defineComponent({__name:"VideoUploader",props:{...Us},setup(t){const e=t,n=i.ref(""),r=i.ref(!1),o=i.ref(),{t:s}=St();function a(f){var b,y;r.value=!0;const h=(b=f==null?void 0:f.target)==null?void 0:b.files;if(!e.editor||e.editor.isDestroyed||h.length===0)return;const m=h[0],g=(y=e.editor.extensionManager.extensions.find(w=>w.name==="videoUpload"))==null?void 0:y.options;g==null||g.upload([m]).then(w=>{e.editor.chain().setVideo({src:w[0].src,width:"100%"}).deleteRange({from:e.getPos(),to:e.getPos()}).focus().run(),r.value=!1})}function l(){e.editor.chain().setVideo({src:n.value,width:"100%"}).deleteRange({from:e.getPos(),to:e.getPos()}).focus().run()}function u(){e.deleteNode()}function c(){var f;(f=o.value)==null||f.click()}return(f,h)=>(i.openBlock(),i.createBlock(i.unref(Hs),{as:"div","data-drag-handle":""},{default:i.withCtx(()=>[i.createVNode(i.unref(Oa),{"default-open":"",modal:""},{default:i.withCtx(()=>[i.createVNode(i.unref(Ra),{"as-child":""},{default:i.withCtx(()=>[i.createElementVNode("div",dX,[r.value?(i.openBlock(),i.createElementBlock("div",fX,[i.createVNode(i.unref(Kt),{class:"animate-spin w-6 h-6",name:"LoaderCircle"}),i.createElementVNode("span",null,i.toDisplayString(i.unref(s)("editor.video.dialog.uploading"))+"...",1)])):(i.openBlock(),i.createElementBlock("div",pX,[i.createElementVNode("div",hX,[i.createVNode(i.unref(Kt),{name:"Video",class:"w-6 h-6"}),i.createElementVNode("span",mX,i.toDisplayString(i.unref(s)("editor.video.dialog.title")),1)]),i.createVNode(i.unref(Kt),{name:"Trash2",class:"hover:text-ed-foreground",onClick:i.withModifiers(u,["stop"])})]))])]),_:1}),i.createVNode(i.unref(Ma),{"trap-focus":"",class:"w-full","on-open-auto-focus":m=>m.preventDefault()},{default:i.withCtx(()=>[i.createVNode(i.unref(zm),{"default-value":"upload",class:"w-[400px]","activation-mode":"manual"},{default:i.withCtx(()=>[i.createVNode(i.unref(Hm),{class:"grid w-full grid-cols-2"},{default:i.withCtx(()=>[i.createVNode(i.unref(eu),{value:"upload"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.tab.upload")),1)]),_:1}),i.createVNode(i.unref(eu),{value:"link"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.link")),1)]),_:1})]),_:1}),i.createVNode(i.unref(Cp),{value:"upload"},{default:i.withCtx(()=>[i.createVNode(i.unref(er),{class:"w-full mt-1",size:"sm",onClick:c},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.tab.upload")),1)]),_:1}),i.createElementVNode("input",{ref_key:"fileInput",ref:o,type:"file",accept:"video/*",multiple:"",style:{display:"none"},onChange:a},null,544)]),_:1}),i.createVNode(i.unref(Cp),{value:"link"},{default:i.withCtx(()=>[i.createElementVNode("form",{onSubmit:i.withModifiers(l,["prevent"])},[i.createElementVNode("div",gX,[i.createVNode(i.unref(Ba),{modelValue:n.value,"onUpdate:modelValue":h[0]||(h[0]=m=>n.value=m),type:"url",autofocus:"",required:"",placeholder:i.unref(s)("editor.video.dialog.placeholder")},null,8,["modelValue","placeholder"]),i.createVNode(i.unref(er),{type:"submit"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.button.apply")),1)]),_:1})])],32)]),_:1})]),_:1})]),_:1},8,["on-open-auto-focus"])]),_:1})]),_:1}))}}),vX=Rt.create({name:"videoUpload",isolating:!0,defining:!0,group:"block",draggable:!0,selectable:!0,inline:!1,parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML(){return["div",{"data-type":this.name}]},addCommands(){return{setVideoUpload:()=>({commands:t})=>t.insertContent(`<div data-type="${this.name}"></div>`)}},addNodeView(){return Ws(bX)},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),upload:void 0,button:({editor:e,t:n})=>({component:je,componentProps:{action:()=>e.commands.setVideoUpload(),isActive:()=>e.isActive("video")||!1,disabled:!e.can().setVideo({}),icon:"Video",tooltip:n("editor.video.tooltip")}})}}}),rb=tr(),yX=at.create({name:"preview",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({t:e})=>({component:je,componentProps:{icon:"Eye",action:()=>{rb.togglePreview()},tooltip:e("editor.preview.tooltip"),isActive:()=>rb.state.showPreview}})}},addCommands(){return{togglePreview:()=>()=>(rb.togglePreview(),!0)}}}),M5=tr(),wX=(t,e,n)=>RegExp(e?t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):t,n?"gu":"gui");function xX(t,e,n,r){const o=[],s=[];let a=[],l=0;if(!e)return{decorationsToReturn:ht.empty,results:[]};t==null||t.descendants((u,c)=>{u.isText?a[l]?a[l]={text:a[l].text+u.text,pos:a[l].pos}:a[l]={text:`${u.text}`,pos:c}:l+=1}),a=a.filter(Boolean);for(const u of a){const{text:c,pos:f}=u,h=Array.from(c.matchAll(e)).filter(([m])=>m.trim());for(const m of h){if(m[0]==="")break;m.index!==void 0&&s.push({from:f+m.index,to:f+m.index+m[0].length})}}for(let u=0;u<s.length;u+=1){const c=s[u],f=u===r?`${n} ${n}-current`:n,h=Yt.inline(c.from,c.to,{class:f});o.push(h)}return{decorationsToReturn:ht.create(t,o),results:s}}const CX=(t,e,{state:n,dispatch:r})=>{if(!e[0])return;const{from:s,to:a}=e[0];r&&r(n.tr.insertText(t,s,a))},EX=(t,e,n,r)=>{const o=e+1;if(!r[o])return null;const{from:s,to:a}=r[e],l=a-s-t.length+n,{from:u,to:c}=r[o];return r[o]={to:c-l,from:u-l},[l,r]},_X=(t,e,{tr:n,dispatch:r})=>{let o=0,s=e.slice();if(s.length){for(let a=0;a<s.length;a+=1){const{from:l,to:u}=s[a];n.insertText(t,l,u);const c=EX(t,a,o,s);c&&(o=c[0],s=c[1])}r&&r(n)}},SX=new kt("findAndReplacePlugin"),kX=at.create({name:"findAndReplace",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),searchResultClass:"vdc-editor-search-result",disableRegex:!0,button:({editor:e,extension:n,t:r})=>({component:je,componentProps:{icon:"DocSearch",tooltip:r("editor.findAndReplace.tooltip"),action:()=>{M5.toggleFindAndReplace()},isActive:()=>M5.state.findAndReplace}})}},addStorage(){return{searchTerm:"",replaceTerm:"",results:[],lastSearchTerm:"",caseSensitive:!1,lastCaseSensitive:!1,resultIndex:0,lastResultIndex:0}},addCommands(){return{setSearchTerm:t=>({editor:e})=>(e.storage.findAndReplace.searchTerm=t,!1),setReplaceTerm:t=>({editor:e})=>(e.storage.findAndReplace.replaceTerm=t,!1),setCaseSensitive:t=>({editor:e})=>(e.storage.findAndReplace.caseSensitive=t,!1),resetIndex:()=>({editor:t})=>(t.storage.findAndReplace.resultIndex=0,!1),nextSearchResult:()=>({editor:t})=>{const{results:e,resultIndex:n}=t.storage.findAndReplace,r=n+1;return e[r]?t.storage.findAndReplace.resultIndex=r:t.storage.findAndReplace.resultIndex=0,!1},previousSearchResult:()=>({editor:t})=>{const{results:e,resultIndex:n}=t.storage.findAndReplace,r=n-1;return e[r]?t.storage.findAndReplace.resultIndex=r:t.storage.findAndReplace.resultIndex=e.length-1,!1},replace:()=>({editor:t,state:e,dispatch:n})=>{const{replaceTerm:r,results:o}=t.storage.findAndReplace;return CX(r,o,{state:e,dispatch:n}),!1},replaceAll:()=>({editor:t,tr:e,dispatch:n})=>{const{replaceTerm:r,results:o}=t.storage.findAndReplace;return _X(r,o,{tr:e,dispatch:n}),!1}}},addProseMirrorPlugins(){const t=this.editor,{searchResultClass:e,disableRegex:n}=this.options,r=a=>t.storage.findAndReplace.lastSearchTerm=a,o=a=>t.storage.findAndReplace.lastCaseSensitive=a,s=a=>t.storage.findAndReplace.lastResultIndex=a;return[new dt({key:SX,state:{init:()=>ht.empty,apply({doc:a,docChanged:l},u){const{searchTerm:c,lastSearchTerm:f,caseSensitive:h,lastCaseSensitive:m,resultIndex:g,lastResultIndex:b}=t.storage.findAndReplace;if(!l&&f===c&&m===h&&b===g)return u;if(r(c),o(h),s(g),!c)return t.storage.findAndReplace.results=[],ht.empty;const{decorationsToReturn:y,results:w}=xX(a,wX(c,n,h),e,g);return t.storage.findAndReplace.results=w,y}},props:{decorations(a){return this.getState(a)}}})]}}),{togglePrinter:TX,state:AX}=tr(),OX=at.create({name:"printer",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({t:e})=>({component:je,componentProps:{tooltip:e("editor.printer.tooltip"),action:()=>TX(),icon:"Printer",shortcutKeys:["mod","P"],isActive:()=>AX.printer}})}}});function MX(t){let e=t;for(;e&&e!==document.body;){if(e.nodeType===1){const n=e;if(n.id==="editor-panel")return n}e=e.parentNode}return null}const ob="spell-check";class BX{constructor(e,n,r,o=1e3){qt(this,"debouncedGetMatchAndSetDecorations",Et.debounce(this.getMatchAndSetDecorations.bind(this),300));qt(this,"debouncedGetMatchAndSetDecorationsList",Et.debounce(this.getMatchAndSetDecorationsList.bind(this),300));qt(this,"debouncedClickEventsListener",Et.debounce(this.clickEventsListener.bind(this),0));qt(this,"debouncedAcceptSuggestionEventsListener",Et.debounce(this.acceptSuggestionListener.bind(this),0));qt(this,"debouncedProofreadChangedNodes",Et.debounce(this.proofreadChangedNodes.bind(this),300));qt(this,"proofreader");qt(this,"uiStrings");qt(this,"showSuggestionsEvent");qt(this,"decorationSet");qt(this,"editorView");qt(this,"isInitialProofreadingDone",!1);qt(this,"lastOriginalFrom",0);qt(this,"lastClickedDecoration",null);qt(this,"suggestionBox");qt(this,"isEnableSuggestion");qt(this,"isMobile");qt(this,"limit",1e3);qt(this,"_debouncedProofreadDoc",Et.debounce((e,n)=>{this.proofreadDoc(e),n&&n()},500));qt(this,"_debouncedHandleEnterKey",Et.debounce((e,n,r)=>{this.handleEnterKey(e,n),r&&r()},500));this.proofreader=e,this.uiStrings=n,this.showSuggestionsEvent=r,this.decorationSet=ht.empty,this.limit=o,this.suggestionBox=document.createElement("div"),this.suggestionBox.id="suggestions-box",this.suggestionBox.tabIndex=0,this.isEnableSuggestion=!0,this.isMobile=!1,this.hideSuggestionBox()}get completeProofreadingDone(){return this.isInitialProofreadingDone}getProofreader(){return this.proofreader}toggleIsEnabledSpellCheck(){this.proofreader.toggleIsEnabled()}getIsEnabledSpellCheck(){return this.proofreader.getIsEnabled()}setDecorationSet(e){this.decorationSet=e}getDecorationSet(){return this.decorationSet}setEditorView(e){this.editorView=e}getEditorView(){return this.editorView}getSuggestionBox(){return this.suggestionBox}hideSuggestionBox(){this.suggestionBox.textContent="",this.suggestionBox.style.display="none"}setIsEnableSuggestion(e){this.isEnableSuggestion=e}setIsMobile(e){this.isMobile=e}getChangedNodesFromTransaction(e,n=!1,r=!1){const o=[],s=new Set;let a=!1;return e.steps.forEach(l=>{var h,m,g;const u=l;if(u.from===void 0||u.to===void 0||n&&u.structure)return;((m=(h=u.slice)==null?void 0:h.content[0])==null?void 0:m.type.name)===gl&&(a=!0);const c=u.from-(r?1:0);let f=Math.max(u.to,u.from+(((g=u.slice)==null?void 0:g.size)||0))-(r?1:0);f>e.doc.content.size&&(f=e.doc.content.size),e.doc.nodesBetween(c,f,(b,y)=>{b&&(b.isText&&!s.has(y)&&(o.push({node:b,pos:y}),s.add(y)),b.type.name===gl&&(a=!0))})}),{changedNodes:o,isChangedSuperText:a}}debouncedProofreadDoc(e,n){this._debouncedProofreadDoc(e,n)}isSuperTextAlone(e,n){let r=!1;return e.descendants((o,s,a)=>o===n?(a&&a.type.name==="paragraph"&&a.childCount===1&&a.firstChild===n&&(r=!0),!1):!0),r}proofreadDoc(e){let n=[],r=0;e==null||e.descendants((u,c)=>{if(!u.isText&&u.type.name!==gl)return r+=1,!0;const f={text:"",from:-1,to:-1};if(u.type.name===gl&&this.isSuperTextAlone(e,u))return f.text=`
251
+ `,tooltip:"수퍼 보기"}}]}},addAttributes(){return{[ft.ID]:{default:null},[ft.TEXT]:{default:""},[ft.POSITION]:{default:"0"},[ft.ELEMENT_ID]:{default:""}}},addCommands(){return{toggleSuperText:t=>({editor:e})=>t?e.storage.superText.isShowSuperViewMoblie=!e.storage.superText.isShowSuperViewMoblie:e.storage.superText.enable=!e.storage.superText.enable,toggleSuperInputMoblie:()=>({editor:t})=>t.storage.superText.isShowSuperInputMoblie=!t.storage.superText.isShowSuperInputMoblie}},parseHTML(){return[{tag:"button.super-text"}]},renderHTML({HTMLAttributes:t}){return["button",mt(t,{class:"super-text"})]},addNodeView(){return Ws(Xq)},addProseMirrorPlugins(){return[new dt({appendTransaction(t,e,n){let r=n.tr,o=!1;return n.doc.descendants((s,a)=>{if(s.type.name==="superText"){const l=s.attrs[ft.POSITION],u=String(a);l!==u&&(r=r.setNodeMarkup(a,void 0,{...s.attrs,[ft.POSITION]:u}),o=!0)}}),o?r:null}}),new dt({filterTransaction(t,e){return t.steps.some(r=>{if(r.toJSON&&r.toJSON().stepType==="replace"){const o=r.toJSON();return o.slice&&o.slice.content&&o.slice.content.some(s=>s.type===gl)}return!1})&&t.setMeta(QC.UPDATE,!0),!0}})]}}),Jq=["innerHTML"],Yq=["book-mark-node-id","page-id","page-number","book-mark-content","node-id","line-id"],Zq=i.defineComponent({__name:"ConfigPlan",props:Us,setup(t){const e=t,n=i.ref(!1),r=i.ref(null),{selection:o,doc:s}=e.editor.state,a=i.inject("isMobile"),l=i.ref(!1),u=Ze.useEventBus(Kn.RENDER_SUPER_TEXT),c=i.computed(()=>{var k,A;const x=s.resolve(o.from),_=x==null?void 0:x.node(-1),S=(k=_==null?void 0:_.attrs)==null?void 0:k.id,C=(A=_==null?void 0:_.attrs)==null?void 0:A.pageNumber;return{pageId:S,pageNumber:C}}),f=i.computed(()=>{const x=e.getPos(),_=e.editor.state.doc.resolve(x);for(let S=_.depth;S>0;S--){const C=_.node(S);if(C.type.name==="paragraph")return C}return null}),h=i.computed(()=>{var x;return((x=f.value)==null?void 0:x.attrs.id)||""});function m(x){e.updateAttributes({"data-text":x}),n.value=!1}function g(x){const _=e.node.attrs[ft.TEXT],S=e.node.attrs[ft.ID],k={lineId:x.target.querySelector(`[node-id="${S}"]`).getAttribute("line-id"),text:_};u.emit({action:"hover",payload:k})}function b(x){const _=e.node.attrs[ft.ID],C={lineId:x.target.querySelector(`[node-id="${_}"]`).getAttribute("line-id"),text:""};u.emit({action:"hover",payload:C})}function y(){const{getPos:x,node:_,editor:S}=e,C=x(),k=C+1;S.commands.deleteRange({from:C,to:k})}function w(){n.value=!0,a&&(l.value=!0)}return(x,_)=>{const S=er,C=pp,k=fp,A=dp,T=cp,B=ec;return i.openBlock(),i.createBlock(i.unref(Hs),{as:"span",class:i.normalizeClass(["w-fit text-inherit super-text align-middle",{"!leading-[9px] [&_*]:!leading-[9px]":i.unref(a)}]),"data-drag-handle":"",draggable:"true",contenteditable:"false"},{default:i.withCtx(()=>[i.createVNode(T,null,{default:i.withCtx(()=>[i.createVNode(C,{as:"template",class:"relative"},{default:i.withCtx(()=>[i.createVNode(S,{variant:"ghost",class:"!p-0 !m-0 !h-fit font-normal !text-ed-blue",onClick:w,onMouseenter:g,onMouseleave:b},{default:i.withCtx(()=>[i.createVNode(i.unref(Kt),{name:"plan",class:i.normalizeClass({"w-[18px] h-auto pr-1":i.unref(a)})},null,8,["class"]),_[3]||(_[3]=i.createTextVNode(" [")),i.createElementVNode("span",{class:"[&_*]:inline",innerHTML:e.node.attrs[i.unref(ft).TEXT]},null,8,Jq),_[4]||(_[4]=i.createTextVNode("] ")),i.createElementVNode("div",{ref_key:"bookMarkRef",ref:r,"book-mark-node-id":e.node.attrs[i.unref(ft).ID],"page-id":c.value.pageId,"page-number":c.value.pageNumber,"book-mark-content":e.node.attrs[i.unref(ft).TEXT],"node-id":e.node.attrs[i.unref(ft).ID],"line-id":h.value},null,8,Yq)]),_:1})]),_:1}),i.createVNode(A,null,{default:i.withCtx(()=>[i.createVNode(k,{onSelect:_[0]||(_[0]=L=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(x.$t("editor.configPlan.edit")),1)]),_:1}),i.createVNode(k,{onSelect:y},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(x.$t("editor.configPlan.delete")),1)]),_:1})]),_:1})]),_:1}),i.unref(a)?(i.openBlock(),i.createBlock(mp,{key:1,title:x.$t("editor.configPlan"),open:n.value,"is-view-mode":l.value,editor:e.editor,"super-text-init":e.node.attrs[i.unref(ft).TEXT],"super-text-id":e.node.attrs[i.unref(ft).ID],onClose:_[2]||(_[2]=L=>n.value=!1),onSave:m,onDelete:y},null,8,["title","open","is-view-mode","editor","super-text-init","super-text-id"])):(i.openBlock(),i.createBlock(B,{key:0,open:n.value,editor:e.editor,"super-text-init":e.node.attrs[i.unref(ft).TEXT],"super-text-id":e.node.attrs[i.unref(ft).ID],"super-text-element-id":e.node.attrs[i.unref(ft).ELEMENT_ID],onClose:_[1]||(_[1]=L=>n.value=!1),onSave:m},null,8,["open","editor","super-text-init","super-text-id","super-text-element-id"]))]),_:1},8,["class"])}}}),e5=Rt.create({name:"configPlan",inline:!0,group:"inline",atom:!0,draggable:!0,addStorage(){return{isShowConfigPlanInput:!1}},addOptions(){return{specialCharModal:null,button:({editor:t,t:e,isMobile:n})=>[...n?[{component:je,componentProps:{action:()=>{t.commands.toggleConfigPlanInput()},isActive:()=>{},icon:"plan",title:e("editor.insertConfigPlan"),tooltip:e("editor.insertConfigPlan"),customClass:"whitespace-nowrap !bg-ed-blue !text-white !font-normal rounded-[3px] h-[26px] gap-x-1 ml-auto",customClassTooltip:"ml-auto"}}]:[]]}},addAttributes(){return{"data-id":{default:null},"data-text":{default:""},"data-position":{default:"0"}}},addCommands(){return{toggleConfigPlanInput:()=>({editor:t})=>t.storage.configPlan.isShowConfigPlanInput=!t.storage.configPlan.isShowConfigPlanInput}},parseHTML(){return[{tag:"button.config-plan"}]},renderHTML({HTMLAttributes:t}){return["button",mt(t,{class:"config-plan"})]},addNodeView(){return Ws(Zq)},addProseMirrorPlugins(){return[new dt({appendTransaction(t,e,n){let r=n.tr,o=!1;return n.doc.descendants((s,a)=>{if(s.type.name==="configPlan"){const l=s.attrs["data-position"],u=String(a);l!==u&&(r=r.setNodeMarkup(a,void 0,{...s.attrs,"data-position":u}),o=!0)}}),o?r:null}})]}});var qg,Kg;if(typeof WeakMap<"u"){let t=new WeakMap;qg=e=>t.get(e),Kg=(e,n)=>(t.set(e,n),n)}else{const t=[];let n=0;qg=r=>{for(let o=0;o<t.length;o+=2)if(t[o]==r)return t[o+1]},Kg=(r,o)=>(n==10&&(n=0),t[n++]=r,t[n++]=o)}var rn=class{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){const n=this.map[e];if(n!=t)continue;const r=e%this.width,o=e/this.width|0;let s=r+1,a=o+1;for(let l=1;s<this.width&&this.map[e+l]==n;l++)s++;for(let l=1;a<this.height&&this.map[e+this.width*l]==n;l++)a++;return{left:r,top:o,right:s,bottom:a}}throw new RangeError(`No cell with offset ${t} found`)}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError(`No cell with offset ${t} found`)}nextCell(t,e,n){const{left:r,right:o,top:s,bottom:a}=this.findCell(t);return e=="horiz"?(n<0?r==0:o==this.width)?null:this.map[s*this.width+(n<0?r-1:o)]:(n<0?s==0:a==this.height)?null:this.map[r+this.width*(n<0?s-1:a)]}rectBetween(t,e){const{left:n,right:r,top:o,bottom:s}=this.findCell(t),{left:a,right:l,top:u,bottom:c}=this.findCell(e);return{left:Math.min(n,a),top:Math.min(o,u),right:Math.max(r,l),bottom:Math.max(s,c)}}cellsInRect(t){const e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let o=t.left;o<t.right;o++){const s=r*this.width+o,a=this.map[s];n[a]||(n[a]=!0,!(o==t.left&&o&&this.map[s-1]==a||r==t.top&&r&&this.map[s-this.width]==a)&&e.push(a))}return e}positionAt(t,e,n){for(let r=0,o=0;;r++){const s=o+n.child(r).nodeSize;if(r==t){let a=e+t*this.width;const l=(t+1)*this.width;for(;a<l&&this.map[a]<o;)a++;return a==l?s-1:this.map[a]}o=s}}static get(t){return qg(t)||Kg(t,Qq(t))}};function Qq(t){if(t.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+t.type.name);const e=Nq(t),n=t.childCount,r=[];let o=0,s=null;const a=[];for(let c=0,f=e*n;c<f;c++)r[c]=0;for(let c=0,f=0;c<n;c++){const h=t.child(c);f++;for(let b=0;;b++){for(;o<r.length&&r[o]!=0;)o++;if(b==h.childCount)break;const y=h.child(b),{colspan:w,rowspan:x,colwidth:_}=y.attrs;for(let S=0;S<x;S++){if(S+c>=n){(s||(s=[])).push({type:"overlong_rowspan",pos:f,n:x-S});break}const C=o+S*e;for(let k=0;k<w;k++){r[C+k]==0?r[C+k]=f:(s||(s=[])).push({type:"collision",row:c,pos:f,n:w-k});const A=_&&_[k];if(A){const T=(C+k)%e*2,B=a[T];B==null||B!=A&&a[T+1]==1?(a[T]=A,a[T+1]=1):B==A&&a[T+1]++}}}o+=w,f+=y.nodeSize}const m=(c+1)*e;let g=0;for(;o<m;)r[o++]==0&&g++;g&&(s||(s=[])).push({type:"missing",row:c,n:g}),f++}(e===0||n===0)&&(s||(s=[])).push({type:"zero_sized"});const l=new rn(e,n,r,s);let u=!1;for(let c=0;!u&&c<a.length;c+=2)a[c]!=null&&a[c+1]<n&&(u=!0);return u&&eK(l,a,t),l}function Nq(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){const o=t.child(r);let s=0;if(n)for(let a=0;a<r;a++){const l=t.child(a);for(let u=0;u<l.childCount;u++){const c=l.child(u);a+c.attrs.rowspan>r&&(s+=c.attrs.colspan)}}for(let a=0;a<o.childCount;a++){const l=o.child(a);s+=l.attrs.colspan,l.attrs.rowspan>1&&(n=!0)}e==-1?e=s:e!=s&&(e=Math.max(e,s))}return e}function eK(t,e,n){t.problems||(t.problems=[]);const r={};for(let o=0;o<t.map.length;o++){const s=t.map[o];if(r[s])continue;r[s]=!0;const a=n.nodeAt(s);if(!a)throw new RangeError(`No cell with offset ${s} found`);let l=null;const u=a.attrs;for(let c=0;c<u.colspan;c++){const f=(o+c)%t.width,h=e[f*2];h!=null&&(!u.colwidth||u.colwidth[c]!=h)&&((l||(l=tK(u)))[c]=h)}l&&t.problems.unshift({type:"colwidth mismatch",pos:s,colwidth:l})}}function tK(t){if(t.colwidth)return t.colwidth.slice();const e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function Pn(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(const n in t.nodes){const r=t.nodes[n],o=r.spec.tableRole;o&&(e[o]=r)}}return e}var ns=new kt("selectingCells");function bl(t){for(let e=t.depth-1;e>0;e--)if(t.node(e).type.spec.tableRole=="row")return t.node(0).resolve(t.before(e+1));return null}function nK(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if(n==="cell"||n==="header_cell")return t.node(e)}return null}function oo(t){const e=t.selection.$head;for(let n=e.depth;n>0;n--)if(e.node(n).type.spec.tableRole=="row")return!0;return!1}function gp(t){const e=t.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const n=bl(e.$head)||rK(e.$head);if(n)return n;throw new RangeError(`No cell found around position ${e.head}`)}function rK(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){const r=e.type.spec.tableRole;if(r=="cell"||r=="header_cell")return t.doc.resolve(n-e.nodeSize)}}function Gg(t){return t.parent.type.spec.tableRole=="row"&&!!t.nodeAfter}function oK(t){return t.node(0).resolve(t.pos+t.nodeAfter.nodeSize)}function Xg(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function t5(t,e,n){const r=t.node(-1),o=rn.get(r),s=t.start(-1),a=o.nextCell(t.pos-s,e,n);return a==null?null:t.node(0).resolve(s+a)}function Qs(t,e,n=1){const r={...t,colspan:t.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some(o=>o>0)||(r.colwidth=null)),r}function n5(t,e,n=1){const r={...t,colspan:t.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let o=0;o<n;o++)r.colwidth.splice(e,0,0)}return r}function iK(t,e,n){const r=Pn(e.type.schema).header_cell;for(let o=0;o<t.height;o++)if(e.nodeAt(t.map[n+o*t.width]).type!=r)return!1;return!0}var Vt=class bi extends Ve{constructor(e,n=e){const r=e.node(-1),o=rn.get(r),s=e.start(-1),a=o.rectBetween(e.pos-s,n.pos-s),l=e.node(0),u=o.cellsInRect(a).filter(f=>f!=n.pos-s);u.unshift(n.pos-s);const c=u.map(f=>{const h=r.nodeAt(f);if(!h)throw RangeError(`No cell with offset ${f} found`);const m=s+f+1;return new z4(l.resolve(m),l.resolve(m+h.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=n}map(e,n){const r=e.resolve(n.map(this.$anchorCell.pos)),o=e.resolve(n.map(this.$headCell.pos));if(Gg(r)&&Gg(o)&&Xg(r,o)){const s=this.$anchorCell.node(-1)!=r.node(-1);return s&&this.isRowSelection()?bi.rowSelection(r,o):s&&this.isColSelection()?bi.colSelection(r,o):new bi(r,o)}return Ie.between(r,o)}content(){const e=this.$anchorCell.node(-1),n=rn.get(e),r=this.$anchorCell.start(-1),o=n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r),s={},a=[];for(let u=o.top;u<o.bottom;u++){const c=[];for(let f=u*n.width+o.left,h=o.left;h<o.right;h++,f++){const m=n.map[f];if(s[m])continue;s[m]=!0;const g=n.findCell(m);let b=e.nodeAt(m);if(!b)throw RangeError(`No cell with offset ${m} found`);const y=o.left-g.left,w=g.right-o.right;if(y>0||w>0){let x=b.attrs;if(y>0&&(x=Qs(x,0,y)),w>0&&(x=Qs(x,x.colspan-w,w)),g.left<o.left){if(b=b.type.createAndFill(x),!b)throw RangeError(`Could not create cell with attrs ${JSON.stringify(x)}`)}else b=b.type.create(x,b.content)}if(g.top<o.top||g.bottom>o.bottom){const x={...b.attrs,rowspan:Math.min(g.bottom,o.bottom)-Math.max(g.top,o.top)};g.top<o.top?b=b.type.createAndFill(x):b=b.type.create(x,b.content)}c.push(b)}a.push(e.child(u).copy(ue.from(c)))}const l=this.isColSelection()&&this.isRowSelection()?e:a;return new xe(ue.from(l),1,1)}replace(e,n=xe.empty){const r=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){const{$from:l,$to:u}=o[a],c=e.mapping.slice(r);e.replace(c.map(l.pos),c.map(u.pos),a?xe.empty:n)}const s=Ve.findFrom(e.doc.resolve(e.mapping.slice(r).map(this.to)),-1);s&&e.setSelection(s)}replaceWith(e,n){this.replace(e,new xe(ue.from(n),0,0))}forEachCell(e){const n=this.$anchorCell.node(-1),r=rn.get(n),o=this.$anchorCell.start(-1),s=r.cellsInRect(r.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o));for(let a=0;a<s.length;a++)e(n.nodeAt(s[a]),o+s[a])}isColSelection(){const e=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(e,n)>0)return!1;const r=e+this.$anchorCell.nodeAfter.attrs.rowspan,o=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(r,o)==this.$headCell.node(-1).childCount}static colSelection(e,n=e){const r=e.node(-1),o=rn.get(r),s=e.start(-1),a=o.findCell(e.pos-s),l=o.findCell(n.pos-s),u=e.node(0);return a.top<=l.top?(a.top>0&&(e=u.resolve(s+o.map[a.left])),l.bottom<o.height&&(n=u.resolve(s+o.map[o.width*(o.height-1)+l.right-1]))):(l.top>0&&(n=u.resolve(s+o.map[l.left])),a.bottom<o.height&&(e=u.resolve(s+o.map[o.width*(o.height-1)+a.right-1]))),new bi(e,n)}isRowSelection(){const e=this.$anchorCell.node(-1),n=rn.get(e),r=this.$anchorCell.start(-1),o=n.colCount(this.$anchorCell.pos-r),s=n.colCount(this.$headCell.pos-r);if(Math.min(o,s)>0)return!1;const a=o+this.$anchorCell.nodeAfter.attrs.colspan,l=s+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,l)==n.width}eq(e){return e instanceof bi&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,n=e){const r=e.node(-1),o=rn.get(r),s=e.start(-1),a=o.findCell(e.pos-s),l=o.findCell(n.pos-s),u=e.node(0);return a.left<=l.left?(a.left>0&&(e=u.resolve(s+o.map[a.top*o.width])),l.right<o.width&&(n=u.resolve(s+o.map[o.width*(l.top+1)-1]))):(l.left>0&&(n=u.resolve(s+o.map[l.top*o.width])),a.right<o.width&&(e=u.resolve(s+o.map[o.width*(a.top+1)-1]))),new bi(e,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,n){return new bi(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){return new bi(e.resolve(n),e.resolve(r))}getBookmark(){return new sK(this.$anchorCell.pos,this.$headCell.pos)}};Vt.prototype.visible=!1,Ve.jsonID("cell",Vt);var sK=class ak{constructor(e,n){this.anchor=e,this.head=n}map(e){return new ak(e.map(this.anchor),e.map(this.head))}resolve(e){const n=e.resolve(this.anchor),r=e.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&r.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&r.index()<r.parent.childCount&&Xg(n,r)?new Vt(n,r):Ve.near(r,1)}};function aK(t){if(!(t.selection instanceof Vt))return null;const e=[];return t.selection.forEachCell((n,r)=>{e.push(Yt.node(r,r+n.nodeSize,{class:"selectedCell"}))}),ht.create(t.doc,e)}function lK({$from:t,$to:e}){if(t.pos==e.pos||t.pos<e.pos-6)return!1;let n=t.pos,r=e.pos,o=t.depth;for(;o>=0&&!(t.after(o+1)<t.end(o));o--,n++);for(let s=e.depth;s>=0&&!(e.before(s+1)>e.start(s));s--,r--);return n==r&&/row|table/.test(t.node(o).type.spec.tableRole)}function uK({$from:t,$to:e}){let n,r;for(let o=t.depth;o>0;o--){const s=t.node(o);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){n=s;break}}for(let o=e.depth;o>0;o--){const s=e.node(o);if(s.type.spec.tableRole==="cell"||s.type.spec.tableRole==="header_cell"){r=s;break}}return n!==r&&e.parentOffset===0}function cK(t,e,n){const r=(e||t).selection,o=(e||t).doc;let s,a;if(r instanceof Pe&&(a=r.node.type.spec.tableRole)){if(a=="cell"||a=="header_cell")s=Vt.create(o,r.from);else if(a=="row"){const l=o.resolve(r.from+1);s=Vt.rowSelection(l,l)}else if(!n){const l=rn.get(r.node),u=r.from+1,c=u+l.map[l.width*l.height-1];s=Vt.create(o,u+1,c)}}else r instanceof Ie&&lK(r)?s=Ie.create(o,r.from):r instanceof Ie&&uK(r)&&(s=Ie.create(o,r.$from.start(),r.$from.end()));return s&&(e||(e=t.tr)).setSelection(s),e}var dK=new kt("fix-tables");function r5(t,e,n,r){const o=t.childCount,s=e.childCount;e:for(let a=0,l=0;a<s;a++){const u=e.child(a);for(let c=l,f=Math.min(o,a+3);c<f;c++)if(t.child(c)==u){l=c+1,n+=u.nodeSize;continue e}r(u,n),l<o&&t.child(l).sameMarkup(u)?r5(t.child(l),u,n+1,r):u.nodesBetween(0,u.content.size,r,n+1),n+=u.nodeSize}}function o5(t,e){let n;const r=(o,s)=>{o.type.spec.tableRole=="table"&&(n=fK(t,o,s,n))};return e?e.doc!=t.doc&&r5(e.doc,t.doc,0,r):t.doc.descendants(r),n}function fK(t,e,n,r){const o=rn.get(e);if(!o.problems)return r;r||(r=t.tr);const s=[];for(let u=0;u<o.height;u++)s.push(0);for(let u=0;u<o.problems.length;u++){const c=o.problems[u];if(c.type=="collision"){const f=e.nodeAt(c.pos);if(!f)continue;const h=f.attrs;for(let m=0;m<h.rowspan;m++)s[c.row+m]+=c.n;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,Qs(h,h.colspan-c.n,c.n))}else if(c.type=="missing")s[c.row]+=c.n;else if(c.type=="overlong_rowspan"){const f=e.nodeAt(c.pos);if(!f)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...f.attrs,rowspan:f.attrs.rowspan-c.n})}else if(c.type=="colwidth mismatch"){const f=e.nodeAt(c.pos);if(!f)continue;r.setNodeMarkup(r.mapping.map(n+1+c.pos),null,{...f.attrs,colwidth:c.colwidth})}else if(c.type=="zero_sized"){const f=r.mapping.map(n);r.delete(f,f+e.nodeSize)}}let a,l;for(let u=0;u<s.length;u++)s[u]&&(a==null&&(a=u),l=u);for(let u=0,c=n+1;u<o.height;u++){const f=e.child(u),h=c+f.nodeSize,m=s[u];if(m>0){let g="cell";f.firstChild&&(g=f.firstChild.type.spec.tableRole);const b=[];for(let w=0;w<m;w++){const x=Pn(t.schema)[g].createAndFill();x&&b.push(x)}const y=(u==0||a==u-1)&&l==u?c+1:h-1;r.insert(r.mapping.map(y),b)}c=h}return r.setMeta(dK,{fixTables:!0})}function Oo(t){const e=t.selection,n=gp(t),r=n.node(-1),o=n.start(-1),s=rn.get(r);return{...e instanceof Vt?s.rectBetween(e.$anchorCell.pos-o,e.$headCell.pos-o):s.findCell(n.pos-o),tableStart:o,map:s,table:r}}function i5(t,{map:e,tableStart:n,table:r},o){let s=o>0?-1:0;iK(e,r,o+s)&&(s=o==0||o==e.width?null:0);for(let a=0;a<e.height;a++){const l=a*e.width+o;if(o>0&&o<e.width&&e.map[l-1]==e.map[l]){const u=e.map[l],c=r.nodeAt(u);t.setNodeMarkup(t.mapping.map(n+u),null,n5(c.attrs,o-e.colCount(u))),a+=c.attrs.rowspan-1}else{const u=s==null?Pn(r.type.schema).cell:r.nodeAt(e.map[l+s]).type,c=e.positionAt(a,o,r);t.insert(t.mapping.map(n+c),u.createAndFill())}}return t}function pK(t,e){if(!oo(t))return!1;if(e){const n=Oo(t);e(i5(t.tr,n,n.left))}return!0}function hK(t,e){if(!oo(t))return!1;if(e){const n=Oo(t);e(i5(t.tr,n,n.right))}return!0}function mK(t,{map:e,table:n,tableStart:r},o){const s=t.mapping.maps.length;for(let a=0;a<e.height;){const l=a*e.width+o,u=e.map[l],c=n.nodeAt(u),f=c.attrs;if(o>0&&e.map[l-1]==u||o<e.width-1&&e.map[l+1]==u)t.setNodeMarkup(t.mapping.slice(s).map(r+u),null,Qs(f,o-e.colCount(u)));else{const h=t.mapping.slice(s).map(r+u);t.delete(h,h+c.nodeSize)}a+=f.rowspan}}function gK(t,e){if(!oo(t))return!1;if(e){const n=Oo(t),r=t.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let o=n.right-1;mK(r,n,o),o!=n.left;o--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=rn.get(s)}e(r)}return!0}function bK(t,e,n){var r;const o=Pn(e.type.schema).header_cell;for(let s=0;s<t.width;s++)if(((r=e.nodeAt(t.map[s+n*t.width]))==null?void 0:r.type)!=o)return!1;return!0}function s5(t,{map:e,tableStart:n,table:r},o){var s;let a=n;for(let c=0;c<o;c++)a+=r.child(c).nodeSize;const l=[];let u=o>0?-1:0;bK(e,r,o+u)&&(u=o==0||o==e.height?null:0);for(let c=0,f=e.width*o;c<e.width;c++,f++)if(o>0&&o<e.height&&e.map[f]==e.map[f-e.width]){const h=e.map[f],m=r.nodeAt(h).attrs;t.setNodeMarkup(n+h,null,{...m,rowspan:m.rowspan+1}),c+=m.colspan-1}else{const h=u==null?Pn(r.type.schema).cell:(s=r.nodeAt(e.map[f+u*e.width]))==null?void 0:s.type,m=h==null?void 0:h.createAndFill();m&&l.push(m)}return t.insert(a,Pn(r.type.schema).row.create(null,l)),t}function vK(t,e){if(!oo(t))return!1;if(e){const n=Oo(t);e(s5(t.tr,n,n.top))}return!0}function yK(t,e){if(!oo(t))return!1;if(e){const n=Oo(t);e(s5(t.tr,n,n.bottom))}return!0}function wK(t,{map:e,table:n,tableStart:r},o){let s=0;for(let c=0;c<o;c++)s+=n.child(c).nodeSize;const a=s+n.child(o).nodeSize,l=t.mapping.maps.length;t.delete(s+r,a+r);const u=new Set;for(let c=0,f=o*e.width;c<e.width;c++,f++){const h=e.map[f];if(!u.has(h)){if(u.add(h),o>0&&h==e.map[f-e.width]){const m=n.nodeAt(h).attrs;t.setNodeMarkup(t.mapping.slice(l).map(h+r),null,{...m,rowspan:m.rowspan-1}),c+=m.colspan-1}else if(o<e.height&&h==e.map[f+e.width]){const m=n.nodeAt(h),g=m.attrs,b=m.type.create({...g,rowspan:m.attrs.rowspan-1},m.content),y=e.positionAt(o+1,c,n);t.insert(t.mapping.slice(l).map(r+y),b),c+=g.colspan-1}}}}function xK(t,e){if(!oo(t))return!1;if(e){const n=Oo(t),r=t.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let o=n.bottom-1;wK(r,n,o),o!=n.top;o--){const s=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!s)throw RangeError("No table found");n.table=s,n.map=rn.get(n.table)}e(r)}return!0}function a5(t){const e=t.content;return e.childCount==1&&e.child(0).isTextblock&&e.child(0).childCount==0}function CK({width:t,height:e,map:n},r){let o=r.top*t+r.left,s=o,a=(r.bottom-1)*t+r.left,l=o+(r.right-r.left-1);for(let u=r.top;u<r.bottom;u++){if(r.left>0&&n[s]==n[s-1]||r.right<t&&n[l]==n[l+1])return!0;s+=t,l+=t}for(let u=r.left;u<r.right;u++){if(r.top>0&&n[o]==n[o-t]||r.bottom<e&&n[a]==n[a+t])return!0;o++,a++}return!1}function l5(t,e){const n=t.selection;if(!(n instanceof Vt)||n.$anchorCell.pos==n.$headCell.pos)return!1;const r=Oo(t),{map:o}=r;if(CK(o,r))return!1;if(e){const s=t.tr,a={};let l=ue.empty,u,c;for(let f=r.top;f<r.bottom;f++)for(let h=r.left;h<r.right;h++){const m=o.map[f*o.width+h],g=r.table.nodeAt(m);if(!(a[m]||!g))if(a[m]=!0,u==null)u=m,c=g;else{a5(g)||(l=l.append(g.content));const b=s.mapping.map(m+r.tableStart);s.delete(b,b+g.nodeSize)}}if(u==null||c==null)return!0;if(s.setNodeMarkup(u+r.tableStart,null,{...n5(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),l.size){const f=u+1+c.content.size,h=a5(c)?u+1:f;s.replaceWith(h+r.tableStart,f+r.tableStart,l)}s.setSelection(new Vt(s.doc.resolve(u+r.tableStart))),e(s)}return!0}function u5(t,e){const n=Pn(t.schema);return EK(({node:r})=>n[r.type.spec.tableRole])(t,e)}function EK(t){return(e,n)=>{var r;const o=e.selection;let s,a;if(o instanceof Vt){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;s=o.$anchorCell.nodeAfter,a=o.$anchorCell.pos}else{if(s=nK(o.$from),!s)return!1;a=(r=bl(o.$from))==null?void 0:r.pos}if(s==null||a==null||s.attrs.colspan==1&&s.attrs.rowspan==1)return!1;if(n){let l=s.attrs;const u=[],c=l.colwidth;l.rowspan>1&&(l={...l,rowspan:1}),l.colspan>1&&(l={...l,colspan:1});const f=Oo(e),h=e.tr;for(let g=0;g<f.right-f.left;g++)u.push(c?{...l,colwidth:c&&c[g]?[c[g]]:null}:l);let m;for(let g=f.top;g<f.bottom;g++){let b=f.map.positionAt(g,f.left,f.table);g==f.top&&(b+=s.nodeSize);for(let y=f.left,w=0;y<f.right;y++,w++)y==f.left&&g==f.top||h.insert(m=h.mapping.map(b+f.tableStart,1),t({node:s,row:g,col:y}).createAndFill(u[w]))}h.setNodeMarkup(a,t({node:s,row:f.top,col:f.left}),u[0]),o instanceof Vt&&h.setSelection(new Vt(h.doc.resolve(o.$anchorCell.pos),m?h.doc.resolve(m):void 0)),n(h)}return!0}}function _K(t,e){return function(n,r){if(!oo(n))return!1;const o=gp(n);if(o.nodeAfter.attrs[t]===e)return!1;if(r){const s=n.tr;n.selection instanceof Vt?n.selection.forEachCell((a,l)=>{a.attrs[t]!==e&&s.setNodeMarkup(l,null,{...a.attrs,[t]:e})}):s.setNodeMarkup(o.pos,null,{...o.nodeAfter.attrs,[t]:e}),r(s)}return!0}}function SK(t){return function(e,n){if(!oo(e))return!1;if(n){const r=Pn(e.schema),o=Oo(e),s=e.tr,a=o.map.cellsInRect(t=="column"?{left:o.left,top:0,right:o.right,bottom:o.map.height}:t=="row"?{left:0,top:o.top,right:o.map.width,bottom:o.bottom}:o),l=a.map(u=>o.table.nodeAt(u));for(let u=0;u<a.length;u++)l[u].type==r.header_cell&&s.setNodeMarkup(o.tableStart+a[u],r.cell,l[u].attrs);if(s.steps.length==0)for(let u=0;u<a.length;u++)s.setNodeMarkup(o.tableStart+a[u],r.header_cell,l[u].attrs);n(s)}return!0}}function c5(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:t=="row"?e.map.width:1,bottom:t=="column"?e.map.height:1});for(let o=0;o<r.length;o++){const s=e.table.nodeAt(r[o]);if(s&&s.type!==n.header_cell)return!1}return!0}function tc(t,e){return e=e||{useDeprecatedLogic:!1},e.useDeprecatedLogic?SK(t):function(n,r){if(!oo(n))return!1;if(r){const o=Pn(n.schema),s=Oo(n),a=n.tr,l=c5("row",s,o),u=c5("column",s,o),f=(t==="column"?l:t==="row"?u:!1)?1:0,h=t=="column"?{left:0,top:f,right:1,bottom:s.map.height}:t=="row"?{left:f,top:0,right:s.map.width,bottom:1}:s,m=t=="column"?u?o.cell:o.header_cell:t=="row"?l?o.cell:o.header_cell:o.cell;s.map.cellsInRect(h).forEach(g=>{const b=g+s.tableStart,y=a.doc.nodeAt(b);y&&a.setNodeMarkup(b,m,y.attrs)}),r(a)}return!0}}tc("row",{useDeprecatedLogic:!0}),tc("column",{useDeprecatedLogic:!0});var kK=tc("cell",{useDeprecatedLogic:!0});function TK(t,e){if(e<0){const n=t.nodeBefore;if(n)return t.pos-n.nodeSize;for(let r=t.index(-1)-1,o=t.before();r>=0;r--){const s=t.node(-1).child(r),a=s.lastChild;if(a)return o-1-a.nodeSize;o-=s.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;const n=t.node(-1);for(let r=t.indexAfter(-1),o=t.after();r<n.childCount;r++){const s=n.child(r);if(s.childCount)return o+1;o+=s.nodeSize}}return null}function d5(t){return function(e,n){if(!oo(e))return!1;const r=TK(gp(e),t);if(r==null)return!1;if(n){const o=e.doc.resolve(r);n(e.tr.setSelection(Ie.between(o,oK(o))).scrollIntoView())}return!0}}function AK(t,e){const n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole=="table")return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function bp(t,e){const n=t.selection;if(!(n instanceof Vt))return!1;if(e){const r=t.tr,o=Pn(t.schema).cell.createAndFill().content;n.forEachCell((s,a)=>{s.content.eq(o)||r.replace(r.mapping.map(a+1),r.mapping.map(a+s.nodeSize-1),new xe(o,0,0))}),r.docChanged&&e(r)}return!0}function OK(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;e.childCount==1&&(n>0&&r>0||e.child(0).type.spec.tableRole=="table");)n--,r--,e=e.child(0).content;const o=e.child(0),s=o.type.spec.tableRole,a=o.type.schema,l=[];if(s=="row")for(let u=0;u<e.childCount;u++){let c=e.child(u).content;const f=u?0:Math.max(0,n-1),h=u<e.childCount-1?0:Math.max(0,r-1);(f||h)&&(c=Jg(Pn(a).row,new xe(c,f,h)).content),l.push(c)}else if(s=="cell"||s=="header_cell")l.push(n||r?Jg(Pn(a).row,new xe(e,n,r)).content:e);else return null;return MK(a,l)}function MK(t,e){const n=[];for(let o=0;o<e.length;o++){const s=e[o];for(let a=s.childCount-1;a>=0;a--){const{rowspan:l,colspan:u}=s.child(a).attrs;for(let c=o;c<o+l;c++)n[c]=(n[c]||0)+u}}let r=0;for(let o=0;o<n.length;o++)r=Math.max(r,n[o]);for(let o=0;o<n.length;o++)if(o>=e.length&&e.push(ue.empty),n[o]<r){const s=Pn(t).cell.createAndFill(),a=[];for(let l=n[o];l<r;l++)a.push(s);e[o]=e[o].append(ue.from(a))}return{height:e.length,width:r,rows:e}}function Jg(t,e){const n=t.createAndFill();return new f0(n).replace(0,n.content.size,e).doc}function BK({width:t,height:e,rows:n},r,o){if(t!=r){const s=[],a=[];for(let l=0;l<n.length;l++){const u=n[l],c=[];for(let f=s[l]||0,h=0;f<r;h++){let m=u.child(h%u.childCount);f+m.attrs.colspan>r&&(m=m.type.createChecked(Qs(m.attrs,m.attrs.colspan,f+m.attrs.colspan-r),m.content)),c.push(m),f+=m.attrs.colspan;for(let g=1;g<m.attrs.rowspan;g++)s[l+g]=(s[l+g]||0)+m.attrs.colspan}a.push(ue.from(c))}n=a,t=r}if(e!=o){const s=[];for(let a=0,l=0;a<o;a++,l++){const u=[],c=n[l%e];for(let f=0;f<c.childCount;f++){let h=c.child(f);a+h.attrs.rowspan>o&&(h=h.type.create({...h.attrs,rowspan:Math.max(1,o-h.attrs.rowspan)},h.content)),u.push(h)}s.push(ue.from(u))}n=s,e=o}return{width:t,height:e,rows:n}}function RK(t,e,n,r,o,s,a){const l=t.doc.type.schema,u=Pn(l);let c,f;if(o>e.width)for(let h=0,m=0;h<e.height;h++){const g=n.child(h);m+=g.nodeSize;const b=[];let y;g.lastChild==null||g.lastChild.type==u.cell?y=c||(c=u.cell.createAndFill()):y=f||(f=u.header_cell.createAndFill());for(let w=e.width;w<o;w++)b.push(y);t.insert(t.mapping.slice(a).map(m-1+r),b)}if(s>e.height){const h=[];for(let b=0,y=(e.height-1)*e.width;b<Math.max(e.width,o);b++){const w=b>=e.width?!1:n.nodeAt(e.map[y+b]).type==u.header_cell;h.push(w?f||(f=u.header_cell.createAndFill()):c||(c=u.cell.createAndFill()))}const m=u.row.create(null,ue.from(h)),g=[];for(let b=e.height;b<s;b++)g.push(m);t.insert(t.mapping.slice(a).map(r+n.nodeSize-2),g)}return!!(c||f)}function f5(t,e,n,r,o,s,a,l){if(a==0||a==e.height)return!1;let u=!1;for(let c=o;c<s;c++){const f=a*e.width+c,h=e.map[f];if(e.map[f-e.width]==h){u=!0;const m=n.nodeAt(h),{top:g,left:b}=e.findCell(h);t.setNodeMarkup(t.mapping.slice(l).map(h+r),null,{...m.attrs,rowspan:a-g}),t.insert(t.mapping.slice(l).map(e.positionAt(a,b,n)),m.type.createAndFill({...m.attrs,rowspan:g+m.attrs.rowspan-a})),c+=m.attrs.colspan-1}}return u}function p5(t,e,n,r,o,s,a,l){if(a==0||a==e.width)return!1;let u=!1;for(let c=o;c<s;c++){const f=c*e.width+a,h=e.map[f];if(e.map[f-1]==h){u=!0;const m=n.nodeAt(h),g=e.colCount(h),b=t.mapping.slice(l).map(h+r);t.setNodeMarkup(b,null,Qs(m.attrs,a-g,m.attrs.colspan-(a-g))),t.insert(b+m.nodeSize,m.type.createAndFill(Qs(m.attrs,0,a-g))),c+=m.attrs.rowspan-1}}return u}function h5(t,e,n,r,o){let s=n?t.doc.nodeAt(n-1):t.doc;if(!s)throw new Error("No table found");let a=rn.get(s);const{top:l,left:u}=r,c=u+o.width,f=l+o.height,h=t.tr;let m=0;function g(){if(s=n?h.doc.nodeAt(n-1):h.doc,!s)throw new Error("No table found");a=rn.get(s),m=h.mapping.maps.length}RK(h,a,s,n,c,f,m)&&g(),f5(h,a,s,n,u,c,l,m)&&g(),f5(h,a,s,n,u,c,f,m)&&g(),p5(h,a,s,n,l,f,u,m)&&g(),p5(h,a,s,n,l,f,c,m)&&g();for(let b=l;b<f;b++){const y=a.positionAt(b,u,s),w=a.positionAt(b,c,s);h.replace(h.mapping.slice(m).map(y+n),h.mapping.slice(m).map(w+n),new xe(o.rows[b-l],0,0))}g(),h.setSelection(new Vt(h.doc.resolve(n+a.positionAt(l,u,s)),h.doc.resolve(n+a.positionAt(f-1,c-1,s)))),e(h)}var IK=W0({ArrowLeft:yp("horiz",-1),ArrowRight:yp("horiz",1),ArrowUp:yp("vert",-1),ArrowDown:yp("vert",1),"Shift-ArrowLeft":wp("horiz",-1),"Shift-ArrowRight":wp("horiz",1),"Shift-ArrowUp":wp("vert",-1),"Shift-ArrowDown":wp("vert",1),Backspace:bp,"Mod-Backspace":bp,Delete:bp,"Mod-Delete":bp});function vp(t,e,n){return n.eq(t.selection)?!1:(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function yp(t,e){return(n,r,o)=>{if(!o)return!1;const s=n.selection;if(s instanceof Vt)return vp(n,r,Ve.near(s.$headCell,e));if(t!="horiz"&&!s.empty)return!1;const a=m5(o,t,e);if(a==null)return!1;if(t=="horiz")return vp(n,r,Ve.near(n.doc.resolve(s.head+e),e));{const l=n.doc.resolve(a),u=t5(l,t,e);let c;return u?c=Ve.near(u,1):e<0?c=Ve.near(n.doc.resolve(l.before(-1)),-1):c=Ve.near(n.doc.resolve(l.after(-1)),1),vp(n,r,c)}}}function wp(t,e){return(n,r,o)=>{if(!o)return!1;const s=n.selection;let a;if(s instanceof Vt)a=s;else{const u=m5(o,t,e);if(u==null)return!1;a=new Vt(n.doc.resolve(u))}const l=t5(a.$headCell,t,e);return l?vp(n,r,new Vt(a.$anchorCell,l)):!1}}function LK(t,e){const n=t.state.doc,r=bl(n.resolve(e));return r?(t.dispatch(t.state.tr.setSelection(new Vt(r))),!0):!1}function PK(t,e,n){if(!oo(t.state))return!1;let r=OK(n);const o=t.state.selection;if(o instanceof Vt){r||(r={width:1,height:1,rows:[ue.from(Jg(Pn(t.state.schema).cell,n))]});const s=o.$anchorCell.node(-1),a=o.$anchorCell.start(-1),l=rn.get(s).rectBetween(o.$anchorCell.pos-a,o.$headCell.pos-a);return r=BK(r,l.right-l.left,l.bottom-l.top),h5(t.state,t.dispatch,a,l,r),!0}else if(r){const s=gp(t.state),a=s.start(-1);return h5(t.state,t.dispatch,a,rn.get(s.node(-1)).findCell(s.pos-a),r),!0}else return!1}function DK(t,e){var n;if(e.ctrlKey||e.metaKey)return;const r=g5(t,e.target);let o;if(e.shiftKey&&t.state.selection instanceof Vt)s(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&(o=bl(t.state.selection.$anchor))!=null&&((n=Yg(t,e))==null?void 0:n.pos)!=o.pos)s(o,e),e.preventDefault();else if(!r)return;function s(u,c){let f=Yg(t,c);const h=ns.getState(t.state)==null;if(!f||!Xg(u,f))if(h)f=u;else return;const m=new Vt(u,f);if(h||!t.state.selection.eq(m)){const g=t.state.tr.setSelection(m);h&&g.setMeta(ns,u.pos),t.dispatch(g)}}function a(){t.root.removeEventListener("mouseup",a),t.root.removeEventListener("dragstart",a),t.root.removeEventListener("mousemove",l),ns.getState(t.state)!=null&&t.dispatch(t.state.tr.setMeta(ns,-1))}function l(u){const c=u,f=ns.getState(t.state);let h;if(f!=null)h=t.state.doc.resolve(f);else if(g5(t,c.target)!=r&&(h=Yg(t,e),!h))return a();h&&s(h,c)}t.root.addEventListener("mouseup",a),t.root.addEventListener("dragstart",a),t.root.addEventListener("mousemove",l)}function m5(t,e,n){if(!(t.state.selection instanceof Ie))return null;const{$head:r}=t.state.selection;for(let o=r.depth-1;o>=0;o--){const s=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:s.childCount))return null;if(s.type.spec.tableRole=="cell"||s.type.spec.tableRole=="header_cell"){const l=r.before(o),u=e=="vert"?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(u)?l:null}}return null}function g5(t,e){for(;e&&e!=t.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Yg(t,e){const n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?bl(t.state.doc.resolve(n.pos)):null}var FK=class{constructor(e,n){this.node=e,this.defaultCellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${n}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Zg(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,Zg(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function Zg(t,e,n,r,o,s){var a;let l=0,u=!0,c=e.firstChild;const f=t.firstChild;if(f){for(let h=0,m=0;h<f.childCount;h++){const{colspan:g,colwidth:b}=f.child(h).attrs;for(let y=0;y<g;y++,m++){const w=o==m?s:b&&b[y],x=w?w+"px":"";if(l+=w||r,w||(u=!1),c)c.style.width!=x&&(c.style.width=x),c=c.nextSibling;else{const _=document.createElement("col");_.style.width=x,e.appendChild(_)}}}for(;c;){const h=c.nextSibling;(a=c.parentNode)==null||a.removeChild(c),c=h}u?(n.style.width=l+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=l+"px")}}var gr=new kt("tableColumnResizing");function VK({handleWidth:t=5,cellMinWidth:e=25,defaultCellMinWidth:n=100,View:r=FK,lastColumnResizable:o=!0}={}){const s=new dt({key:gr,state:{init(a,l){var u,c;const f=(c=(u=s.spec)==null?void 0:u.props)==null?void 0:c.nodeViews,h=Pn(l.schema).table.name;return r&&f&&(f[h]=(m,g)=>new r(m,n,g)),new $K(-1,!1)},apply(a,l){return l.apply(a)}},props:{attributes:a=>{const l=gr.getState(a);return l&&l.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(a,l)=>{zK(a,l,t,o)},mouseleave:a=>{HK(a)},mousedown:(a,l)=>{UK(a,l,e,n)}},decorations:a=>{const l=gr.getState(a);if(l&&l.activeHandle>-1)return GK(a,l.activeHandle)},nodeViews:{}}});return s}var $K=class Sh{constructor(e,n){this.activeHandle=e,this.dragging=n}apply(e){const n=this,r=e.getMeta(gr);if(r&&r.setHandle!=null)return new Sh(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new Sh(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&e.docChanged){let o=e.mapping.map(n.activeHandle,-1);return Gg(e.doc.resolve(o))||(o=-1),new Sh(o,n.dragging)}return n}};function zK(t,e,n,r){if(!t.editable)return;const o=gr.getState(t.state);if(o&&!o.dragging){const s=jK(e.target);let a=-1;if(s){const{left:l,right:u}=s.getBoundingClientRect();e.clientX-l<=n?a=b5(t,e,"left",n):u-e.clientX<=n&&(a=b5(t,e,"right",n))}if(a!=o.activeHandle){if(!r&&a!==-1){const l=t.state.doc.resolve(a),u=l.node(-1),c=rn.get(u),f=l.start(-1);if(c.colCount(l.pos-f)+l.nodeAfter.attrs.colspan-1==c.width-1)return}y5(t,a)}}}function HK(t){if(!t.editable)return;const e=gr.getState(t.state);e&&e.activeHandle>-1&&!e.dragging&&y5(t,-1)}function UK(t,e,n,r){var o;if(!t.editable)return!1;const s=(o=t.dom.ownerDocument.defaultView)!=null?o:window,a=gr.getState(t.state);if(!a||a.activeHandle==-1||a.dragging)return!1;const l=t.state.doc.nodeAt(a.activeHandle),u=WK(t,a.activeHandle,l.attrs);t.dispatch(t.state.tr.setMeta(gr,{setDragging:{startX:e.clientX,startWidth:u}}));function c(h){s.removeEventListener("mouseup",c),s.removeEventListener("mousemove",f);const m=gr.getState(t.state);m!=null&&m.dragging&&(qK(t,m.activeHandle,v5(m.dragging,h,n)),t.dispatch(t.state.tr.setMeta(gr,{setDragging:null})))}function f(h){if(!h.which)return c(h);const m=gr.getState(t.state);if(m&&m.dragging){const g=v5(m.dragging,h,n);w5(t,m.activeHandle,g,r)}}return w5(t,a.activeHandle,u,r),s.addEventListener("mouseup",c),s.addEventListener("mousemove",f),e.preventDefault(),!0}function WK(t,e,{colspan:n,colwidth:r}){const o=r&&r[r.length-1];if(o)return o;const s=t.domAtPos(e);let l=s.node.childNodes[s.offset].offsetWidth,u=n;if(r)for(let c=0;c<n;c++)r[c]&&(l-=r[c],u--);return l/u}function jK(t){for(;t&&t.nodeName!="TD"&&t.nodeName!="TH";)t=t.classList&&t.classList.contains("ProseMirror")?null:t.parentNode;return t}function b5(t,e,n,r){const o=n=="right"?-r:r,s=t.posAtCoords({left:e.clientX+o,top:e.clientY});if(!s)return-1;const{pos:a}=s,l=bl(t.state.doc.resolve(a));if(!l)return-1;if(n=="right")return l.pos;const u=rn.get(l.node(-1)),c=l.start(-1),f=u.map.indexOf(l.pos-c);return f%u.width==0?-1:c+u.map[f-1]}function v5(t,e,n){const r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function y5(t,e){t.dispatch(t.state.tr.setMeta(gr,{setHandle:e}))}function qK(t,e,n){const r=t.state.doc.resolve(e),o=r.node(-1),s=rn.get(o),a=r.start(-1),l=s.colCount(r.pos-a)+r.nodeAfter.attrs.colspan-1,u=t.state.tr;for(let c=0;c<s.height;c++){const f=c*s.width+l;if(c&&s.map[f]==s.map[f-s.width])continue;const h=s.map[f],m=o.nodeAt(h).attrs,g=m.colspan==1?0:l-s.colCount(h);if(m.colwidth&&m.colwidth[g]==n)continue;const b=m.colwidth?m.colwidth.slice():KK(m.colspan);b[g]=n,u.setNodeMarkup(a+h,null,{...m,colwidth:b})}u.docChanged&&t.dispatch(u)}function w5(t,e,n,r){const o=t.state.doc.resolve(e),s=o.node(-1),a=o.start(-1),l=rn.get(s).colCount(o.pos-a)+o.nodeAfter.attrs.colspan-1;let u=t.domAtPos(o.start(-1)).node;for(;u&&u.nodeName!="TABLE";)u=u.parentNode;u&&Zg(s,u.firstChild,u,r,l,n)}function KK(t){return Array(t).fill(0)}function GK(t,e){var n;const r=[],o=t.doc.resolve(e),s=o.node(-1);if(!s)return ht.empty;const a=rn.get(s),l=o.start(-1),u=a.colCount(o.pos-l)+o.nodeAfter.attrs.colspan-1;for(let c=0;c<a.height;c++){const f=u+c*a.width;if((u==a.width-1||a.map[f]!=a.map[f+1])&&(c==0||a.map[f]!=a.map[f-a.width])){const h=a.map[f],m=l+h+s.nodeAt(h).nodeSize-1,g=document.createElement("div");g.className="column-resize-handle",(n=gr.getState(t))!=null&&n.dragging&&r.push(Yt.node(l+h,l+h+s.nodeAt(h).nodeSize,{class:"column-resize-dragging"})),r.push(Yt.widget(m,g))}}return ht.create(t.doc,r)}function XK({allowTableNodeSelection:t=!1}={}){return new dt({key:ns,state:{init(){return null},apply(e,n){const r=e.getMeta(ns);if(r!=null)return r==-1?null:r;if(n==null||!e.docChanged)return n;const{deleted:o,pos:s}=e.mapping.mapResult(n);return o?null:s}},props:{decorations:aK,handleDOMEvents:{mousedown:DK},createSelectionBetween(e){return ns.getState(e.state)!=null?e.state.selection:null},handleTripleClick:LK,handleKeyDown:IK,handlePaste:PK},appendTransaction(e,n,r){return cK(r,o5(r,n),t)}})}const JK=(t,e,n)=>{if(!t.doc)return t;const r=t.doc.nodeAt(e);if(!r||n===r.attrs.backgroundColor)return t;const o={...r.attrs,backgroundColor:n};return t.setNodeMarkup(e,r.type,o,r.marks)},YK=(t,e,n)=>{const{doc:r,selection:o}=t;return!r||!o||!(o instanceof Vt)||o.forEachCell((s,a)=>{t=JK(t,a,n)}),t},x5=(t,e)=>({tr:n,state:r,dispatch:o})=>{const{selection:s}=r;return n=n.setSelection(s),n=YK(n,e,t),n.docChanged?(o==null||o(n),!0):!1},ZK=at.create({name:"tableCellBackground",addOptions(){return{types:["tableCell"],HTMLAttributes:{}}},addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{parseHTML:t=>t.style.backgroundColor||"",renderHTML:t=>!t.backgroundColor||t.backgroundColor===""?{}:{style:`background-color: ${t.backgroundColor}`}}}}]},addCommands(){return{setTableCellBackground:t=>x5(t,this.options),unsetTableCellBackground:()=>x5("",this.options)}}}),QK=Rt.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:t}){return["th",mt(this.options.HTMLAttributes,t),0]}}),NK=Rt.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:t}){return["tr",mt(this.options.HTMLAttributes,t),0]}}),eG=Rt.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map(r=>parseInt(r,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:t}){return["td",mt(this.options.HTMLAttributes,t),0]}});function Qg(t,e){return e?["width",`${Math.max(e,t)}px`]:["min-width",`${t}px`]}function C5(t,e,n,r,o,s){var a;let l=0,u=!0,c=e.firstChild;const f=t.firstChild;if(f!==null)for(let h=0,m=0;h<f.childCount;h+=1){const{colspan:g,colwidth:b}=f.child(h).attrs;for(let y=0;y<g;y+=1,m+=1){const w=o===m?s:b&&b[y],x=w?`${w}px`:"";if(l+=w||r,w||(u=!1),c){if(c.style.width!==x){const[_,S]=Qg(r,w);c.style.setProperty(_,S)}c=c.nextSibling}else{const _=document.createElement("col"),[S,C]=Qg(r,w);_.style.setProperty(S,C),e.appendChild(_)}}}for(;c;){const h=c.nextSibling;(a=c.parentNode)===null||a===void 0||a.removeChild(c),c=h}u?(n.style.width=`${l}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${l}px`)}class tG{constructor(e,n){this.node=e,this.cellMinWidth=n,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),C5(e,this.colgroup,this.table,n),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!==this.node.type?!1:(this.node=e,C5(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return e.type==="attributes"&&(e.target===this.table||this.colgroup.contains(e.target))}}function nG(t,e,n,r){let o=0,s=!0;const a=[],l=t.firstChild;if(!l)return{};for(let h=0,m=0;h<l.childCount;h+=1){const{colspan:g,colwidth:b}=l.child(h).attrs;for(let y=0;y<g;y+=1,m+=1){const w=n===m?r:b&&b[y];o+=w||e,w||(s=!1);const[x,_]=Qg(e,w);a.push(["col",{style:`${x}: ${_}`}])}}const u=s?`${o}px`:"",c=s?"":`${o}px`;return{colgroup:["colgroup",{},...a],tableWidth:u,tableMinWidth:c}}function E5(t,e){return t.createAndFill()}function rG(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach(n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)}),t.cached.tableNodeTypes=e,e}function oG(t,e,n,r,o){const s=rG(t),a=[],l=[];for(let c=0;c<n;c+=1){const f=E5(s.cell);if(f&&l.push(f),r){const h=E5(s.header_cell);h&&a.push(h)}}const u=[];for(let c=0;c<e;c+=1)u.push(s.row.createChecked(null,r&&c===0?a:l));return s.table.createChecked(null,u)}function iG(t){return t instanceof Vt}const xp=({editor:t})=>{const{selection:e}=t.state;if(!iG(e))return!1;let n=0;const r=D6(e.ranges[0].$from,s=>s.type.name==="table");return r==null||r.node.descendants(s=>{if(s.type.name==="table")return!1;["tableCell","tableHeader"].includes(s.type.name)&&(n+=1)}),n===e.ranges.length?(t.commands.deleteTable(),!0):!1},sG=Rt.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:tG,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:t,HTMLAttributes:e}){const{colgroup:n,tableWidth:r,tableMinWidth:o}=nG(t,this.options.cellMinWidth);return["table",mt(this.options.HTMLAttributes,e,{style:r?`width: ${r}`:`min-width: ${o}`}),n,["tbody",0]]},addCommands(){return{insertTable:({rows:t=3,cols:e=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:o,editor:s})=>{const a=oG(s.schema,t,e,n);if(o){const l=r.selection.from+1;r.replaceSelectionWith(a).scrollIntoView().setSelection(Ie.near(r.doc.resolve(l)))}return!0},addColumnBefore:()=>({state:t,dispatch:e})=>pK(t,e),addColumnAfter:()=>({state:t,dispatch:e})=>hK(t,e),deleteColumn:()=>({state:t,dispatch:e})=>gK(t,e),addRowBefore:()=>({state:t,dispatch:e})=>vK(t,e),addRowAfter:()=>({state:t,dispatch:e})=>yK(t,e),deleteRow:()=>({state:t,dispatch:e})=>xK(t,e),deleteTable:()=>({state:t,dispatch:e})=>AK(t,e),mergeCells:()=>({state:t,dispatch:e})=>l5(t,e),splitCell:()=>({state:t,dispatch:e})=>u5(t,e),toggleHeaderColumn:()=>({state:t,dispatch:e})=>tc("column")(t,e),toggleHeaderRow:()=>({state:t,dispatch:e})=>tc("row")(t,e),toggleHeaderCell:()=>({state:t,dispatch:e})=>kK(t,e),mergeOrSplit:()=>({state:t,dispatch:e})=>l5(t,e)?!0:u5(t,e),setCellAttribute:(t,e)=>({state:n,dispatch:r})=>_K(t,e)(n,r),goToNextCell:()=>({state:t,dispatch:e})=>d5(1)(t,e),goToPreviousCell:()=>({state:t,dispatch:e})=>d5(-1)(t,e),fixTables:()=>({state:t,dispatch:e})=>(e&&o5(t),!0),setCellSelection:t=>({tr:e,dispatch:n})=>{if(n){const r=Vt.create(e.doc,t.anchorCell,t.headCell);e.setSelection(r)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:xp,"Mod-Backspace":xp,Delete:xp,"Mod-Delete":xp}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[VK({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],XK({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:st(Be(t,"tableRole",e))}}}),aG=["disabled"],lG={"content-class":"table-grid-size-editor","content-style":"padding:0"},uG={class:"flex flex-col flex-wrap gap-1 justify-between"},cG=["onMouseover","onMousedown"],dG={class:"text-center text-sm text-zinc-600 mt-2"},fG=i.defineComponent({__name:"CreateTablePopover",props:{disabled:{type:Boolean,default:!1}},emits:["create-table"],setup(t,{emit:e}){const n=e,r=i.ref(!1),o=i.ref(!0),s=i.reactive({rows:Kl()?hf:pf,cols:Kl()?hf:pf}),a=i.reactive({rows:mf,cols:mf});function l(f,h){f===s.rows&&(s.rows=Math.min(f+1,hf)),h===s.cols&&(s.cols=Math.min(h+1,hf)),a.rows=f,a.cols=h}function u(f,h){n("create-table",{rows:f,cols:h,withHeaderRow:i.unref(o)}),c()}function c(){r.value=!1,o.value=!1,s.rows=pf,s.cols=pf,a.rows=mf,a.cols=mf}return(f,h)=>(i.openBlock(),i.createBlock(i.unref(Oa),null,{default:i.withCtx(()=>[i.createVNode(i.unref(Ra),{"as-child":""},{default:i.withCtx(()=>[i.createElementVNode("button",{disabled:t.disabled,class:"m-0 p-0"},[i.renderSlot(f.$slots,"trigger")],8,aG)]),_:3}),i.createVNode(i.unref(Ma),{class:"w-full",align:"start",side:"bottom"},{default:i.withCtx(()=>[i.createElementVNode("div",lG,[i.createElementVNode("div",uG,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.rows,m=>(i.openBlock(),i.createElementBlock("div",{key:"r"+m,class:"flex gap-1"},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.cols,g=>(i.openBlock(),i.createElementBlock("div",{key:"c"+g,class:i.normalizeClass([[g<=a.cols&&m<=a.rows&&"bg-ed-foreground border-ed-border","cursor-pointer"],"pa-1"]),onMouseover:b=>l(m,g),onMousedown:b=>u(m,g)},h[0]||(h[0]=[i.createElementVNode("div",{class:"w-4 h-4 p-1 border box-border"},null,-1)]),42,cG))),128))]))),128))]),i.createElementVNode("div",dG,i.toDisplayString(a.rows)+" x "+i.toDisplayString(a.cols),1)])]),_:1})]),_:3}))}}),pG={style:{display:"flex"}},hG=i.defineComponent({__name:"TableActionButton",props:{editor:{},icon:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},color:{default:void 0},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0}},setup(t){const e=t;function n(r){e.disabled||e.editor.chain().focus().insertTable({...r,withHeaderRow:!1}).run()}return(r,o)=>(i.openBlock(),i.createBlock(fG,{disabled:r.disabled,onCreateTable:n},{trigger:i.withCtx(()=>[i.createElementVNode("div",pG,[i.createVNode(je,{icon:r.icon,tooltip:r.tooltip,disabled:r.disabled,color:r.color,action:r.action,"is-active":r.isActive},null,8,["icon","tooltip","disabled","color","action","is-active"])])]),_:1},8,["disabled"]))}}),Ng=sG.extend({addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),resizable:!0,lastColumnResizable:!0,allowTableNodeSelection:!1,button:({editor:e,t:n})=>({component:hG,componentProps:{disabled:e.isActive("table")||!1,icon:"Table",tooltip:n("editor.table.tooltip")}})}},addExtensions(){return[NK.configure(this.options.tableRow),QK.configure(this.options.tableHeader),eG.configure(this.options.tableCell),ZK.configure(this.options.tableCellBackground)]}}),mG={class:"flex items-center gap-2 px-2"},gG=i.defineComponent({__name:"TextDropdown",props:{editor:{},disabled:{type:Boolean,default:!1},color:{default:void 0},maxHeight:{default:void 0},icon:{default:void 0},tooltip:{default:""}},setup(t){const e=t,{t:n}=St(),r=i.computed(()=>[{name:"paragraph",label:n("editor.paragraph.tooltip"),iconName:"Paragraph",isActive:()=>e.editor.isActive("paragraph")&&!e.editor.isActive("orderedList")&&!e.editor.isActive("bulletList")&&!e.editor.isActive("taskList"),action:()=>e.editor.chain().focus().clearNodes().run()},{name:"heading1",label:n("editor.heading.h1.tooltip"),isActive:()=>e.editor.isActive("heading",{level:1}),iconName:"Heading1",action:()=>e.editor.chain().focus().clearNodes().toggleHeading({level:1}).run()},{name:"heading2",label:n("editor.heading.h2.tooltip"),isActive:()=>e.editor.isActive("heading",{level:2}),iconName:"Heading2",action:()=>e.editor.chain().focus().clearNodes().toggleHeading({level:2}).run()},{name:"heading3",label:n("editor.heading.h3.tooltip"),isActive:()=>e.editor.isActive("heading",{level:3}),iconName:"Heading3",action:()=>e.editor.chain().focus().clearNodes().toggleHeading({level:3}).run()},{name:"bulletList",label:n("editor.bulletlist.tooltip"),isActive:()=>e.editor.isActive("bulletList"),iconName:"List",action:()=>e.editor.chain().focus().clearNodes().toggleBulletList().run()},{name:"numberedList",label:n("editor.orderedlist.tooltip"),isActive:()=>e.editor.isActive("orderedList"),iconName:"ListOrdered",action:()=>e.editor.chain().focus().clearNodes().toggleOrderedList().run()},{name:"taskList",label:n("editor.tasklist.tooltip"),isActive:()=>e.editor.isActive("taskList"),iconName:"ListTodo",action:()=>e.editor.chain().focus().clearNodes().toggleTaskList().run()},{name:"blockquote",label:n("editor.blockquote.tooltip"),isActive:()=>e.editor.isActive("blockquote"),iconName:"TextQuote",action:()=>e.editor.chain().focus().clearNodes().toggleBlockquote().run()},{name:"codeBlock",label:n("editor.codeblock.tooltip"),isActive:()=>e.editor.isActive("codeBlock"),iconName:"Code2",action:()=>e.editor.chain().focus().clearNodes().toggleCodeBlock().run()}]),o=i.computed(()=>r.value.filter(s=>s.isActive()).pop()??{label:n("editor.modify")});return(s,a)=>{var l;return i.openBlock(),i.createBlock(Ks,{title:(l=o.value)==null?void 0:l.label,"side-offset":5},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,(u,c)=>{var f;return i.openBlock(),i.createBlock(i.unref(ll),{key:c,class:"cursor-pointer",checked:((f=u.isActive)==null?void 0:f.call(u))||!1,onClick:u.action},{default:i.withCtx(()=>[i.createElementVNode("div",mG,[i.createVNode(i.unref(Kt),{name:u.iconName,class:"h3 w-3"},null,8,["name"]),i.createElementVNode("span",null,i.toDisplayString(u.label),1)])]),_:2},1032,["checked","onClick"])}),128))]),_:1},8,["title"])}}}),bG=at.create({name:"text-bubble",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),toolbar:!1,button:()=>({component:gG,componentProps:{}})}}}),_5=at.create({name:"base-kit",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),bubble:{list:A$,defaultBubbleList:BW,button:({editor:e,extension:n,t:r})=>{var l;const{list:o={},defaultBubbleList:s}=((l=n.options)==null?void 0:l.bubble)??{},a=(s==null?void 0:s(e))??[];return RW(o,a,{editor:e,extension:n,t:r})}}}},addExtensions(){var n,r,o,s;const{t}=St(),e=[];this.options.placeholder!==!1&&e.push(AW.configure({placeholder:({node:a,pos:l})=>{var c;const u=(c=a==null?void 0:a.type)==null?void 0:c.name;return u==="heading"?`${t(`editor.heading.h${a.attrs.level}.tooltip`)}`:u==="table"||u==="codeBlock"?"":l===0?t("editor.content"):""},...this.options.placeholder})),this.options.focus!==!1&&e.push(bW.configure({className:"focus",...this.options.focus})),this.options.document!==!1&&(this.options.page?(e.push(cC.configure().extend({content:"page+"})),e.push(bq.configure({types:((r=(n=this.options.page)==null?void 0:n.nodesComputedOption)==null?void 0:r.types)??[],slots:i.useSlots()}))):e.push(cC.configure())),this.options.dropcursor!==!1&&e.push(gW.configure({...this.options.dropcursor,width:2,class:"ProseMirror-dropcursor border-black"})),this.options.characterCount!==!1&&e.push(pW.configure(this.options.characterCount)),this.options.paragraph!==!1&&e.push(aC.configure(this.options.paragraph)),this.options.hardBreak!==!1&&e.push(kW.configure(this.options.hardBreak)),this.options.listItem!==!1&&e.push(TW.configure(this.options.listItem)),this.options.textStyle!==!1&&e.push(ZH.configure(this.options.textStyle)),this.options.history!==!1&&e.push(hg.configure(this.options.history)),this.options.fontSize!==!1&&e.push(A8.configure(this.options.fontSize)),this.options.fontFamily!==!1&&e.push(KC.configure(this.options.fontFamily)),this.options.mode!==Ye.EDITOR&&(this.options.superText!==!1&&this.options.mode!==Ye.PLAIN_TEXT&&(typeof this.options.superText=="boolean"?e.push(NC.configure()):e.push(NC.configure({specialCharModal:(o=this.options.superText)==null?void 0:o.specialCharModal}))),e.push(_q)),this.options.mode===Ye.EDITOR&&(this.options.image!==!1&&e.push(Wg.configure()),e.push(k8.configure({spacer:!0}),Jx,Xx,Yx,dg,Ng)),this.options.mode!==Ye.EDITOR&&this.options.configPlan!==!1&&this.options.mode!==Ye.PLAIN_TEXT&&(typeof this.options.configPlan=="boolean"?e.push(e5.configure()):e.push(e5.configure({specialCharModal:(s=this.options.configPlan)==null?void 0:s.specialCharModal}))),this.options.mode!==Ye.EDITOR&&this.options.mode!==Ye.PLAIN_TEXT&&e.push(kq),e.push(OW,lC.configure(),bG.configure(),SW.configure(),Zx,O8.configure({spacer:!0}),T8.configure({types:["heading","paragraph"],spacer:!0}),YC,ZC,jg,Hg,H1,M8.configure({multicolor:!0}));for(const a in this.options.excludes)Object.prototype.hasOwnProperty.call(this.options.excludes,a)&&this.options.excludes[a]&&Et.remove(e,({name:u})=>u===a);return e},addStorage(){return{mode:this.options.mode}}}),S5=qn.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(t){return t!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sub",mt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSubscript:()=>({commands:t})=>t.setMark(this.name),toggleSubscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSubscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),k5=qn.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(t){return t!=="super"?!1:null}}]},renderHTML({HTMLAttributes:t}){return["sup",mt(this.options.HTMLAttributes,t),0]},addCommands(){return{setSuperscript:()=>({commands:t})=>t.setMark(this.name),toggleSuperscript:()=>({commands:t})=>t.toggleMark(this.name),unsetSuperscript:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),vG=at.create({name:"subAndSuperScript",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({editor:e,extension:n,t:r})=>{const o=n.options.subscript,s=n.options.superscript,a={component:je,componentProps:{action:()=>e.commands.toggleSubscript(),isActive:()=>e.isActive("subscript")||!1,disabled:!e.can().toggleSubscript(),icon:"Subscript",tooltip:r("editor.subscript.tooltip")}},l={component:je,componentProps:{action:()=>e.commands.toggleSuperscript(),isActive:()=>e.isActive("superscript")||!1,disabled:!e.can().toggleSuperscript(),icon:"Superscript",tooltip:r("editor.superscript.tooltip")}},u=[];return o!==!1&&u.push(a),s!==!1&&u.push(l),u}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(S5.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(k5.configure(this.options.superscript)),t}}),yG={class:"ml-1"},wG=i.defineComponent({__name:"ActionMoreButton",props:{editor:{},disabled:{type:Boolean,default:!1},color:{default:void 0},maxHeight:{default:void 0},icon:{default:void 0},tooltip:{default:""},items:{default:()=>[]}},setup(t){const e=t,n=i.computed(()=>{const r=e.items.find(s=>s.isActive());return r&&!r.default?{...r,icon:r.icon?r.icon:e.icon}:{title:e.tooltip,icon:e.icon,isActive:()=>!1}});return(r,o)=>(i.openBlock(),i.createBlock(Ks,{icon:r.icon,tooltip:r.tooltip,disabled:r.disabled},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(e.items,(s,a)=>(i.openBlock(),i.createBlock(i.unref(ll),{key:a,checked:n.value.title===s.title,disabled:s.disabled,class:"flex gap-3 items-center",onClick:s.action},{default:i.withCtx(()=>[s.icon?(i.openBlock(),i.createBlock(i.unref(Kt),{key:0,name:s.icon},null,8,["name"])):i.createCommentVNode("",!0),i.createElementVNode("span",yG,i.toDisplayString(s.title),1),s.shortcutKeys?(i.openBlock(),i.createBlock(i.unref(S8),{key:1,class:"ml-auto"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(x3)(s.shortcutKeys)),1)]),_:2},1024)):i.createCommentVNode("",!0)]),_:2},1032,["checked","disabled","onClick"]))),128))]),_:1},8,["icon","tooltip","disabled"]))}}),xG=at.create({name:"moreMark",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button({editor:e,extension:n,t:r}){const o=n.options.subscript,s=n.options.superscript,a={action:()=>e.commands.toggleSubscript(),isActive:()=>e.isActive("subscript")||!1,disabled:!e.can().toggleSubscript(),icon:"Subscript",title:r("editor.subscript.tooltip"),shortcutKeys:["mod","."]},l={action:()=>e.commands.toggleSuperscript(),isActive:()=>e.isActive("superscript")||!1,disabled:!e.can().toggleSuperscript(),icon:"Superscript",title:r("editor.superscript.tooltip"),shortcutKeys:["mod",","]},u=fm(e,"code"),c=[];if(o!==!1&&c.push(a),s!==!1&&c.push(l),u){const f={action:()=>e.commands.toggleCode(),isActive:()=>e.isActive("code")||!1,disabled:!e.can().toggleCode(),icon:"Code",title:r("editor.code.tooltip"),shortcutKeys:["mod","E"]};u&&c.push(f)}return{component:wG,componentProps:{icon:"Type",tooltip:r("editor.moremark"),disabled:!e.isEditable||c.every(f=>f.disabled),items:c}}}}},addExtensions(){const t=[];return this.options.subscript!==!1&&t.push(S5.configure(this.options.subscript)),this.options.superscript!==!1&&t.push(k5.configure(this.options.superscript)),t}});function CG(t){var e;const{char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:s,startOfLine:a,$position:l}=t,u=r&&!o,c=LF(n),f=new RegExp(`\\s${c}$`),h=a?"^":"",m=o?"":c,g=u?new RegExp(`${h}${c}.*?(?=\\s${m}|$)`,"gm"):new RegExp(`${h}(?:^)?${c}[^\\s${m}]*`,"gm"),b=((e=l.nodeBefore)===null||e===void 0?void 0:e.isText)&&l.nodeBefore.text;if(!b)return null;const y=l.pos-b.length,w=Array.from(b.matchAll(g)).pop();if(!w||w.input===void 0||w.index===void 0)return null;const x=w.input.slice(Math.max(0,w.index-1),w.index),_=new RegExp(`^[${s==null?void 0:s.join("")}\0]?$`).test(x);if(s!==null&&!_)return null;const S=y+w.index;let C=S+w[0].length;return u&&f.test(b.slice(C-1,C+1))&&(w[0]+=" ",C+=1),S<l.pos&&C>=l.pos?{range:{from:S,to:C},query:w[0].slice(n.length),text:w[0]}:null}const EG=new kt("suggestion");function _G({pluginKey:t=EG,editor:e,char:n="@",allowSpaces:r=!1,allowToIncludeChar:o=!1,allowedPrefixes:s=[" "],startOfLine:a=!1,decorationTag:l="span",decorationClass:u="suggestion",command:c=()=>null,items:f=()=>[],render:h=()=>({}),allow:m=()=>!0,findSuggestionMatch:g=CG}){let b;const y=h==null?void 0:h(),w=new dt({key:t,view(){return{update:async(x,_)=>{var S,C,k,A,T,B,L;const I=(S=this.key)===null||S===void 0?void 0:S.getState(_),V=(C=this.key)===null||C===void 0?void 0:C.getState(x.state),q=I.active&&V.active&&I.range.from!==V.range.from,K=!I.active&&V.active,me=I.active&&!V.active,z=!K&&!me&&I.query!==V.query,U=K||q&&z,P=z||q,G=me||q&&z;if(!U&&!P&&!G)return;const Z=G&&!U?I:V,oe=x.dom.querySelector(`[data-decoration-id="${Z.decorationId}"]`);b={editor:e,range:Z.range,query:Z.query,text:Z.text,items:[],command:ne=>c({editor:e,range:Z.range,props:ne}),decorationNode:oe,clientRect:oe?()=>{var ne;const{decorationId:Ce}=(ne=this.key)===null||ne===void 0?void 0:ne.getState(e.state),_e=x.dom.querySelector(`[data-decoration-id="${Ce}"]`);return(_e==null?void 0:_e.getBoundingClientRect())||null}:null},U&&((k=y==null?void 0:y.onBeforeStart)===null||k===void 0||k.call(y,b)),P&&((A=y==null?void 0:y.onBeforeUpdate)===null||A===void 0||A.call(y,b)),(P||U)&&(b.items=await f({editor:e,query:Z.query})),G&&((T=y==null?void 0:y.onExit)===null||T===void 0||T.call(y,b)),P&&((B=y==null?void 0:y.onUpdate)===null||B===void 0||B.call(y,b)),U&&((L=y==null?void 0:y.onStart)===null||L===void 0||L.call(y,b))},destroy:()=>{var x;b&&((x=y==null?void 0:y.onExit)===null||x===void 0||x.call(y,b))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(x,_,S,C){const{isEditable:k}=e,{composing:A}=e.view,{selection:T}=x,{empty:B,from:L}=T,I={..._};if(I.composing=A,k&&(B||e.view.composing)){(L<_.range.from||L>_.range.to)&&!A&&!_.composing&&(I.active=!1);const V=g({char:n,allowSpaces:r,allowToIncludeChar:o,allowedPrefixes:s,startOfLine:a,$position:T.$from}),q=`id_${Math.floor(Math.random()*4294967295)}`;V&&m({editor:e,state:C,range:V.range,isActive:_.active})?(I.active=!0,I.decorationId=_.decorationId?_.decorationId:q,I.range=V.range,I.query=V.query,I.text=V.text):I.active=!1}else I.active=!1;return I.active||(I.decorationId=null,I.range={from:0,to:0},I.query=null,I.text=null),I}},props:{handleKeyDown(x,_){var S;const{active:C,range:k}=w.getState(x.state);return C&&((S=y==null?void 0:y.onKeyDown)===null||S===void 0?void 0:S.call(y,{view:x,event:_,range:k}))||!1},decorations(x){const{active:_,range:S,decorationId:C}=w.getState(x);return _?ht.create(x.doc,[Yt.inline(S.from,S.to,{nodeName:l,class:u,"data-decoration-id":C})]):null}}});return w}const SG=[{label:"优酷",value:"youku",icon:"Youku"},{label:"哔哩哔哩",value:"bilibili",icon:"BiliBili"},{label:"腾讯视频",value:"qqvideo",icon:"QQVideo"}],kG=[{label:"高德地图",value:"amap",icon:"Gaode"},{label:"百度地图",value:"baidu_map",icon:"Baidu"}],TG=[{label:"墨刀",value:"modao",icon:"Modao"},{label:"蓝湖",value:"lanhu",icon:"Lanhu"},{label:"Figma",value:"figma",icon:"Figma"},{label:"Canva",value:"canva",icon:"Canva"},{label:"ProcessOn",value:"processon",icon:"Processon"}],AG=[{label:"CodePen",value:"codepen",icon:"Codepen"}],OG=[{label:"金数据",value:"jinshuju",icon:"Jinshuju"}],MG=[],BG=[...SG,...kG,...TG,...AG,...OG,...MG];function RG(t){const{t:e}=St(),n=[{name:"format",title:e("editor.slash.format"),commands:[{name:"paragraph",label:e("editor.paragraph.tooltip"),aliases:["paragraph","zw"],iconName:"Paragraph",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setHeading({level:1}).run()}},{name:"heading1",label:e("editor.heading.h1.tooltip"),aliases:["h1","bt","bt1"],iconName:"Heading1",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setHeading({level:1}).run()}},{name:"heading2",label:e("editor.heading.h2.tooltip"),aliases:["h2","bt","bt2"],iconName:"Heading2",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setNode("heading",{level:2}).run()}},{name:"heading3",label:e("editor.heading.h3.tooltip"),aliases:["h3","bt","bt3","heading3"],iconName:"Heading3",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setNode("heading",{level:3}).run()}},{name:"bulletList",label:e("editor.bulletlist.tooltip"),aliases:["ul","yxlb","bulletList"],iconName:"List",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).toggleBulletList().run()}},{name:"numberedList",label:e("editor.orderedlist.tooltip"),aliases:["ol","yxlb"],iconName:"ListOrdered",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).toggleOrderedList().run()}},{name:"codeBlock",label:e("editor.codeblock.tooltip"),iconName:"Code2",aliases:["codeBlock"],description:"Code block with syntax highlighting",shouldBeHidden:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setCodeBlock().run()}},{name:"blockquote",label:e("editor.blockquote.tooltip"),description:"插入引入格式",aliases:["yr"],iconName:"TextQuote",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setBlockquote().run()}},{name:"horizontalrule",label:e("editor.horizontalrule.tooltip"),aliases:["fgx","horizontalRule"],iconName:"Minus",action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setHorizontalRule().run()}},{name:"link",label:e("editor.link.tooltip"),aliases:["link","lianjie","lj"],iconName:"Link",action:({editor:o,range:s})=>{o.chain().deleteRange(s).extendMarkRange("link").insertContent({type:"text",text:"link",marks:[{type:"link",attrs:{href:"",target:"_blank"}}]}).setLink({href:""}).focus().run()}}]},{name:"insert",title:e("editor.slash.insert"),commands:[{name:"image",label:e("editor.image.tooltip"),iconName:"ImageUp",description:"Insert a image",aliases:["image","tp","tupian"],shouldBeHidden:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setImageUpload().run()}},{name:"table",label:e("editor.table.tooltip"),iconName:"Table",description:"Insert a table",aliases:["table","bg","biaoge","biao"],shouldBeHidden:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).insertTable({rows:3,cols:3,withHeaderRow:!1}).run()}},{name:"video",label:e("editor.video.tooltip"),iconName:"Video",description:"Insert a video",aliases:["video","sp","shipin"],shouldBeHidden:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).setVideoUpload().run()}},{name:"taskList",label:e("editor.tasklist.tooltip"),iconName:"ListTodo",description:"Task list with todo items",aliases:["todo"],action:({editor:o,range:s})=>{o.chain().focus().deleteRange(s).toggleTaskList().run()}},{name:"columns",label:e("editor.columns.tooltip"),iconName:"Columns2",description:"Add two column content",aliases:["columns","cols","2cols"],shouldBeHidden:o=>o.isActive("columns"),action:({editor:o,range:s})=>{o.chain().deleteRange(s).setColumns().focus(o.state.selection.head-1).run()}}]}];if(fm(t,"iframes")){const o=BG;n.push({name:"others",title:e("editor.slash.embed"),commands:o.map(s=>({name:s.value,label:s.label,iconName:s.icon,aliases:[s.value,s.label],shouldBeHidden:a=>a.isActive("columns"),action:({editor:a,range:l})=>{a.chain().deleteRange(l).focus().setIframe({src:"",service:s.value}).run()}}))})}return n}const IG={key:0,class:"grid grid-cols-1 gap-0.5 min-w-48"},LG={className:"text-neutral-500 text-[0.65rem] col-[1/-1] mx-2 mt-2 font-semibold tracking-wider select-none uppercase first:mt-0.5"},PG=["onClick"],DG=["src"],FG={key:1,class:"p-3"},VG={class:"text-xs text-gray-800 dark:text-gray-100"},$G=i.defineComponent({__name:"CommandsList",props:{editor:{},items:{default:void 0},command:{type:Function,default:void 0}},setup(t,{expose:e}){const n=i.ref(0),r=i.ref(0),o=i.ref(null),{t:s}=St(),a=i.ref([]),l=t;e({onKeyDown:u}),i.watch([()=>n.value,()=>r.value],async()=>{if(!o.value)return;await i.nextTick();const y=r.value*1e3+n.value,w=a.value[y];w&&w.scrollIntoView({behavior:"smooth",block:"nearest"})});function u({event:y}){return y.key==="ArrowUp"?(c(),!0):y.key==="ArrowDown"?(f(),!0):y.key==="Enter"?(h(),!0):!1}function c(){var x;if(!l.items.length)return!1;let y=n.value-1,w=r.value;y<0&&(w=r.value-1,y=((x=l.items[w])==null?void 0:x.commands.length)-1||0),w<0&&(w=l.items.length-1,y=l.items[w].commands.length-1),n.value=y,r.value=w}function f(){if(!l.items.length)return!1;const y=l.items[r.value].commands;let w=n.value+1,x=r.value;y.length-1<w&&(w=0,x=r.value+1),l.items.length-1<x&&(x=0),n.value=w,r.value=x}function h(){if(!l.items.length||r.value===-1||n.value===-1)return!1;m(r.value,n.value)}function m(y,w){const x=l.items[y].commands[w];l.command(x)}function g(y,w){m(y,w)}function b(y,w,x){a.value[y*1e3+w]=x}return(y,w)=>{var x;return i.openBlock(),i.createElementBlock("div",{ref_key:"scrollContainer",ref:o,class:"bg-white rounded-lg dark:bg-black shadow-sm border border-neutral-200 dark:border-neutral-800 text-black max-h-[min(80vh,24rem)] overflow-auto flex-wrap mb-8 p-1"},[(x=y.items)!=null&&x.length?(i.openBlock(),i.createElementBlock("div",IG,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(y.items,(_,S)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:_.title},[i.createElementVNode("div",LG,i.toDisplayString(_.title),1),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(_.commands,(C,k)=>(i.openBlock(),i.createElementBlock("button",{ref_for:!0,ref:A=>b(S,k,A),key:k,class:i.normalizeClass(["flex items-center gap-3 px-2 py-1.5 text-sm text-neutral-800 dark:text-neutral-200 text-left w-full rounded-sm outline-none transition-colors",[r.value===S&&n.value===k?"bg-ed-accent text-neutral-800 dark:bg-neutral-900 dark:text-neutral-200":"hover:bg-ed-accent hover:text-neutral-800 dark:hover:bg-neutral-900 dark:hover:text-neutral-200"]]),onClick:A=>g(S,k)},[C.iconUrl?(i.openBlock(),i.createElementBlock("img",{key:0,class:"w-6 h-6",src:C.iconUrl},null,8,DG)):i.createCommentVNode("",!0),C.iconName?(i.openBlock(),i.createBlock(i.unref(Kt),{key:1,name:C.iconName,class:"mr-1 text-lg"},null,8,["name"])):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(C.label),1)],10,PG))),128))],64))),128))])):(i.openBlock(),i.createElementBlock("div",FG,[i.createElementVNode("span",VG,i.toDisplayString(i.unref(s)("editor.slash.empty")),1)]))],512)}}}),Ns="slashCommand";let It;const zG=at.create({name:Ns,priority:200,onCreate(){It=zs("body",{interactive:!0,trigger:"manual",placement:"bottom-start",theme:"slash-command",maxWidth:"16rem",offset:[16,8],popperOptions:{strategy:"fixed",modifiers:[{name:"flip",enabled:!1}]}})},addProseMirrorPlugins(){return[_G({editor:this.editor,char:"/",allowSpaces:!0,startOfLine:!0,pluginKey:new kt(Ns),allow:({state:t,range:e})=>{var c,f,h;const n=t.doc.resolve(e.from),r=n.depth===1,o=n.parent.type.name==="paragraph",s=((c=n.parent.textContent)==null?void 0:c.charAt(0))==="/",a=this.editor.isActive("column"),l=(h=n.parent.textContent)==null?void 0:h.substring((f=n.parent.textContent)==null?void 0:f.indexOf("/")),u=!(l!=null&&l.endsWith(" "));return(r&&o&&s||a&&o&&s)&&u},command:({editor:t,range:e,props:n})=>{const{view:r}=t;n.action({editor:t,range:e}),r.focus()},items:({query:t})=>RG(this.editor).map(s=>({...s,commands:s.commands.filter(a=>{const l=a.label.toLowerCase().trim(),u=t.toLowerCase().trim();if(a.aliases){const c=a.aliases.map(m=>m.toLowerCase().trim()),f=l.match(u),h=c.some(m=>m.match(u));return f||h}return l.match(u)}).filter(a=>a.shouldBeHidden?!a.shouldBeHidden(this.editor):!0)})).filter(s=>s.commands.length>0).map(s=>({...s,commands:s.commands.map(a=>({...a,isEnabled:!0}))})),render:()=>{let t,e=null;return{onStart:n=>{var s;t=new Lx($G,{props:n,editor:n.editor});const{view:r}=n.editor,o=()=>{if(!n.clientRect)return n.editor.storage[Ns].rect;const a=n.clientRect();if(!a)return n.editor.storage[Ns].rect;let l=a.y;if(t.element instanceof HTMLElement&&a.top+t.element.offsetHeight+40>window.innerHeight){const u=a.top+t.element.offsetHeight-window.innerHeight+40;l=a.y-u}return new DOMRect(a.x,l,a.width,a.height)};e=()=>{It==null||It[0].setProps({getReferenceClientRect:o})},(s=r.dom.parentElement)==null||s.addEventListener("scroll",e),t.element&&(It==null||It[0].setProps({getReferenceClientRect:o,appendTo:()=>document.body,content:t.element})),It==null||It[0].show()},onUpdate(n){var a;t.updateProps(n);const{view:r}=n.editor,o=()=>{if(!n.clientRect)return n.editor.storage[Ns].rect;const l=n.clientRect();return l?new DOMRect(l.x,l.y,l.width,l.height):n.editor.storage[Ns].rect},s=()=>{It==null||It[0].setProps({getReferenceClientRect:o})};(a=r.dom.parentElement)==null||a.addEventListener("scroll",s),n.editor.storage[Ns].rect=n.clientRect?o():{width:0,height:0,left:0,top:0,right:0,bottom:0},It==null||It[0].setProps({getReferenceClientRect:o})},onKeyDown(n){var r;return n.event.key==="Escape"?(It==null||It[0].hide(),!0):(It!=null&&It[0].state.isShown||It==null||It[0].show(),(r=t.ref)==null?void 0:r.onKeyDown(n))},onExit(n){var r;if(It==null||It[0].hide(),e){const{view:o}=n.editor;(r=o.dom.parentElement)==null||r.removeEventListener("scroll",e)}t.destroy()}}}})]},addStorage(){return{rect:{width:0,height:0,left:0,top:0,right:0,bottom:0}}}});function HG(t){return t=t.replace("https://youtu.be/","https://www.youtube.com/watch?v=").replace("watch?v=","embed/"),t=t.replace("https://vimeo.com/","https://player.vimeo.com/video/"),/^https?:\/\/www.bilibili.com\/video\/.*/i.test(t)&&(t=t.replace(/\?.*$/i,"").replace("https://www.bilibili.com/video/","https://player.bilibili.com/player.html?bvid=")),t.includes("drive.google.com")&&(t=t.replace("/view","/preview")),t}const T5=Rt.create({name:"video",group:"block",atom:!0,draggable:!0,addAttributes(){return{src:{default:null,renderHTML:({src:t})=>({src:t?HG(t):null})},width:{default:this.options.width,renderHTML:({width:t})=>({width:gn(t)})},frameborder:{default:this.options.frameborder?1:0,parseHTML:()=>this.options.frameborder?1:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen}}},parseHTML(){return[{tag:"video"}]},renderHTML({HTMLAttributes:t}){const{src:e,width:n="100%"}=t??{};return["video",{src:e?e.replace(/\\/g,"/"):"",controls:!0,style:`max-width: ${gn(n)}; height: auto;`}]},addCommands(){return{setVideo:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t}),updateVideo:t=>({commands:e})=>e.updateAttributes(this.name,t)}},addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,frameborder:!1,width:gf["size-medium"],HTMLAttributes:{class:"iframe-wrapper",style:"display: flex;justify-content: center;"}}}}),UG=1,WG=1e6,oi={ADD_TOAST:"ADD_TOAST",UPDATE_TOAST:"UPDATE_TOAST",DISMISS_TOAST:"DISMISS_TOAST",REMOVE_TOAST:"REMOVE_TOAST"};let eb=0;function jG(){return eb=(eb+1)%Number.MAX_VALUE,eb.toString()}const tb=new Map;function A5(t){if(tb.has(t))return;const e=setTimeout(()=>{tb.delete(t),nc({type:oi.REMOVE_TOAST,toastId:t})},WG);tb.set(t,e)}const io=i.ref({toasts:[]});function nc(t){switch(t.type){case oi.ADD_TOAST:io.value.toasts=[t.toast,...io.value.toasts].slice(0,UG);break;case oi.UPDATE_TOAST:io.value.toasts=io.value.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e);break;case oi.DISMISS_TOAST:{const{toastId:e}=t;e?A5(e):io.value.toasts.forEach(n=>{A5(n.id)}),io.value.toasts=io.value.toasts.map(n=>n.id===e||e===void 0?{...n,open:!1}:n);break}case oi.REMOVE_TOAST:t.toastId===void 0?io.value.toasts=[]:io.value.toasts=io.value.toasts.filter(e=>e.id!==t.toastId);break}}function nb(){return{toasts:i.computed(()=>io.value.toasts),toast:qG,dismiss:t=>nc({type:oi.DISMISS_TOAST,toastId:t})}}function qG(t){const e=jG(),n=o=>nc({type:oi.UPDATE_TOAST,toast:{...o,id:e}}),r=()=>nc({type:oi.DISMISS_TOAST,toastId:e});return nc({type:oi.ADD_TOAST,toast:{...t,id:e,open:!0,onOpenChange:o=>{o||r()}}}),{id:e,dismiss:r,update:n}}const KG=i.defineComponent({__name:"AIButton",props:{editor:{},icon:{default:void 0},title:{default:void 0},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},shortcutKeys:{default:void 0},customClass:{default:""},loading:{type:Boolean,default:!1},tooltipOptions:{default:void 0},color:{default:void 0},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0}},setup(t){const e=t,n=tr(),{toast:r}=nb();function o(){var a,l,u;const s=(l=(a=e.editor.extensionManager.extensions.find(c=>c.name==="AI"))==null?void 0:a.options)==null?void 0:l.completions;if(typeof s!="function"){r({title:"AI completions method is not set or is not a valid function",variant:"destructive"});return}if(s.constructor.name!=="AsyncFunction"){r({title:"AI completions method must be an asynchronous function",variant:"destructive"});return}n.state.AIMenu=!0,(u=e.editor)==null||u.commands.focus()}return(s,a)=>(i.openBlock(),i.createBlock(je,{action:o,title:"AI",disabled:s.disabled,icon:s.icon,tooltip:s.tooltip},null,8,["disabled","icon","tooltip"]))}}),GG=Rt.create({name:"AI",group:"block",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),toolbar:!1,button:({editor:e,t:n})=>({component:KG,componentProps:{icon:"Sparkles",tooltip:n("editor.AI.ask")}})}}});function XG(t,e){const n=atob(t.split(",")[1]),r=new Array(n.length);for(let s=0;s<n.length;s++)r[s]=n.charCodeAt(s);const o=new Uint8Array(r);return new Blob([o],{type:e})}function JG(t,e){return new File([t],e,{type:t.type})}const YG=at.create({name:"importWord",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),upload:void 0,convert:void 0,limit:1024*1024*10,button:({editor:e,extension:n,t:r})=>({component:je,componentProps:{action:()=>{var o;return(o=e.commands)==null?void 0:o.toggleImportWord()},disabled:!e.can().setHorizontalRule(),icon:"Word",tooltip:r("editor.importWord.tooltip")}})}},addCommands(){return{toggleImportWord:()=>({chain:t,editor:e})=>{const{toast:n}=nb(),{t:r}=St();async function o(u){var g;const f=new DOMParser().parseFromString(u,"text/html"),h=f.querySelectorAll("img");if(!h.length)return f.body.innerHTML;if(fm(e,"image")){const b=(g=e.extensionManager.extensions.find(y=>y.name==="importWord"))==null?void 0:g.options;if(b&&typeof b.upload=="function"){const y=[];for(const x of h){const _=x.getAttribute("src"),S=XG(_,"image/jpeg"),C=JG(S,"image.jpeg");y.push(C)}const w=await b.upload(y);for(let x=0;x<h.length;x++){const _=h[x];_.setAttribute("src",w[x].src);const S=_.parentElement;(S==null?void 0:S.tagName)==="P"&&(S.insertAdjacentElement("beforebegin",_),!S.hasChildNodes()&&S.textContent===""&&S.remove())}return f.body.innerHTML}else return console.warn("Image Upload method found, skip image conversion"),f.body.innerHTML}else return console.error("Image extension not found, unable to convert image"),f.body.innerHTML}async function s(u){const c=await o(u);e.chain().setContent(c.toString(),!0).run(),n({title:r("editor.importWord.success")})}const{open:a,onChange:l}=Ze.useFileDialog({accept:".docx",reset:!0,multiple:!1});return a(),l(async u=>{const[c]=Array.from(u??[]);if(c){if(c.size>this.options.limit){n({title:r("editor.importWord.fileTooLarge"),variant:"destructive"});return}if(this.options.convert){const f=await this.options.convert(c);s(f)}else{const f=new FormData,h=JSON.stringify({collaboration_features:{comments:!0,user_id:"e3",track_changes:!0},formatting:{resets:"none",defaults:"inline",styles:"inline",comments:"basic"}});f.append("config",h),f.append("file",c),fetch("https://docx-converter.cke-cs.com/v2/convert/docx-html",{method:"POST",body:f}).then(m=>m.json()).then(async m=>{s(m.html)}).catch(m=>{n({title:r("editor.importWord.error"),variant:"destructive"}),console.error("Error:",m)})}}}),!1}}}}),Cp=i.defineComponent({__name:"TabsContent",props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{}},setup(t){const e=t,n=i.computed(()=>{const{class:r,...o}=e;return o});return(r,o)=>(i.openBlock(),i.createBlock(i.unref(y9),i.mergeProps({class:i.unref($e)("mt-2 ring-offset-ed-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ed-ring focus-visible:ring-offset-2",e.class)},n.value),{default:i.withCtx(()=>[i.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),vl=new kt("upload-image"),ZG=()=>new dt({key:vl,state:{init(){return ht.empty},apply(t,e){e=e.map(t.mapping,t.doc);const n=t.getMeta(vl);return n!=null&&n.add?n.add.forEach(({id:r,pos:o,src:s})=>{const a=QG(s),l=Yt.widget(o,a,{id:r});e=e.add(t.doc,[l])}):n!=null&&n.remove&&n.remove.forEach(r=>{e=e.remove(e.find(void 0,void 0,o=>o.id===r))}),e}},props:{decorations(t){return this.getState(t)}}});function QG(t){const e=document.createElement("div"),n=document.createElement("img");return n.setAttribute("class","opacity-50"),n.src=t,n.onload=()=>{e.setAttribute("class","img-placeholder")},e.appendChild(n),e}function NG(t,e){var o;const r=vl.getState(t).find(void 0,void 0,s=>s.id===e);return r.length?(o=r[0])==null?void 0:o.from:null}const O5=({validateFn:t,onUpload:e})=>(n,r,o,s)=>{n.forEach(a=>{if(t&&!t(a))return;s||(s=Gi(6));const l=r.state.tr;l.selection.empty||l.deleteSelection();let u=null;r.state.doc.descendants((h,m)=>{h.type.name===ml&&h.attrs.id===s&&(u=m)});const c=URL.createObjectURL(a);l.setMeta(vl,{add:[{id:s,pos:o,src:c}]}),r.dispatch(l);const f=NG(r.state,s)||u;e(a).then(h=>{var w;const{schema:m}=r.state;if(f===null)throw new Error("Not found placeholderPos");const g=typeof h=="object"?c:h,b=(w=m.nodes.image)==null?void 0:w.create({src:g});if(!b)return;const y=r.state.tr.replaceWith(f,f,b).setMeta(vl,{remove:[s]});r.dispatch(y)},()=>{const h=r.state.tr.delete(o,o).setMeta(vl,{remove:[s]});r.dispatch(h)})})},eX=(t,e,n)=>{var o;const r=Array.from(((o=e.clipboardData)==null?void 0:o.files)||[]);if(r.length){e.preventDefault();const s=t.state.selection.from;return n(r,t,s+1),!0}return!1},tX=(t,e,n,r)=>{var s;const o=Array.from(((s=e.dataTransfer)==null?void 0:s.files)||[]);if(!n&&o.length){e.preventDefault();const a=t.posAtCoords({left:e.clientX,top:e.clientY});if(a)return r(o,t,a.pos+1),!0}return!1},nX={class:"flex items-center w-full p-3 my-3 transition-all border rounded-sm cursor-pointer hover:bg-ed-accent border-ed-border text-ed-muted-foreground"},rX={class:"flex items-center justify-between w-full"},oX={class:"flex items-center justify-center gap-3"},iX={class:"text-sm"},sX={class:"flex items-center gap-2"},aX=i.defineComponent({__name:"ImageUploader",props:{...Us},setup(t){const e=t,n=i.ref(""),r=i.ref(),{t:o}=St();function s(c){var b,y;const f=(b=c==null?void 0:c.target)==null?void 0:b.files;if(!e.editor||e.editor.isDestroyed||f.length===0)return;const h=f[0],m=(y=e.editor.extensionManager.extensions.find(w=>w.name==="imageUpload"))==null?void 0:y.options;O5({validateFn:w=>!0,onUpload:m.upload})([h],e.editor.view,e.getPos(),e.node.attrs.id)}function a(){e.editor.chain().setImage({src:n.value}).deleteRange({from:e.getPos(),to:e.getPos()}).focus().run()}function l(){e.deleteNode()}function u(){var c;(c=r.value)==null||c.click()}return(c,f)=>(i.openBlock(),i.createBlock(i.unref(Hs),{id:c.node.attrs.id,class:"p-0 m-0","data-drag-handle":""},{default:i.withCtx(()=>[i.createVNode(i.unref(Oa),{"default-open":"",modal:""},{default:i.withCtx(()=>[i.createVNode(i.unref(Ra),{"as-child":""},{default:i.withCtx(()=>[i.createElementVNode("div",nX,[i.createElementVNode("div",rX,[i.createElementVNode("div",oX,[i.createVNode(i.unref(Kt),{name:"ImageUp",class:"w-6 h-6"}),i.createElementVNode("span",iX,i.toDisplayString(i.unref(o)("editor.image.dialog.title")),1)]),i.createVNode(i.unref(Kt),{name:"Trash2",class:"hover:text-ed-foreground",onClick:i.withModifiers(l,["stop"])})])])]),_:1}),i.createVNode(i.unref(Ma),{"trap-focus":"",class:"w-full","on-open-auto-focus":h=>h.preventDefault()},{default:i.withCtx(()=>[i.createVNode(i.unref(zm),{"default-value":"upload",class:"w-[300px] sm:w-[400px]","activation-mode":"manual"},{default:i.withCtx(()=>[i.createVNode(i.unref(Hm),{class:"grid w-full grid-cols-2"},{default:i.withCtx(()=>[i.createVNode(i.unref(eu),{value:"upload"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.tab.upload")),1)]),_:1}),i.createVNode(i.unref(eu),{value:"link"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.tab.url")),1)]),_:1})]),_:1}),i.createVNode(i.unref(Cp),{value:"upload"},{default:i.withCtx(()=>[i.createVNode(i.unref(er),{class:"w-full mt-1",size:"sm",onClick:u},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.tab.upload")),1)]),_:1}),i.createElementVNode("input",{ref_key:"fileInput",ref:r,type:"file",accept:"image/*",multiple:"",style:{display:"none"},onChange:s},null,544)]),_:1}),i.createVNode(i.unref(Cp),{value:"link"},{default:i.withCtx(()=>[i.createElementVNode("div",sX,[i.createVNode(i.unref(Ba),{modelValue:n.value,"onUpdate:modelValue":f[0]||(f[0]=h=>n.value=h),type:"url",autofocus:"",required:"",placeholder:i.unref(o)("editor.image.dialog.placeholder")},null,8,["modelValue","placeholder"]),i.createVNode(i.unref(er),{onClick:a},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(o)("editor.image.dialog.button.apply")),1)]),_:1})])]),_:1})]),_:1})]),_:1},8,["on-open-auto-focus"])]),_:1})]),_:1},8,["id"]))}}),lX={acceptMimes:["image/jpeg","image/gif","image/png","image/jpg"],maxSize:1024*1024*5},uX=t=>`${(t/1024/1024).toFixed(2)}MB`,cX=Rt.create({name:"imageUpload",isolating:!0,defining:!0,group:"block",draggable:!1,selectable:!0,inline:!1,onCreate(){if(typeof this.options.upload!="function")throw new Error("Image upload function should be a function")},parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML(){return["div",{"data-type":this.name}]},addAttributes(){return{id:{default:Gi(6),parseHTML:t=>t.getAttribute("id"),renderHTML:t=>t.id?{id:t.id}:{}}}},addCommands(){return{setImageUpload:()=>({commands:t})=>t.insertContent(`<div data-type="${this.name}"></div>`)}},addNodeView(){return Ws(aX)},addOptions(){var t;return{...lX,...(t=this.parent)==null?void 0:t.call(this),upload:()=>Promise.reject("Image Upload Function"),button:({editor:e,extension:n,t:r})=>{var o,s;return{component:je,componentProps:{action:()=>e.commands.setImageUpload(),disabled:!((s=(o=e.can()).setImage)!=null&&s.call(o,{})),icon:"ImageUp",tooltip:r("editor.image.tooltip")}}}}},addProseMirrorPlugins(){const{toast:t}=nb(),{t:e}=St(),r=O5({validateFn:o=>this.options.acceptMimes.includes(o.type)?o.size>this.options.maxSize?(t({description:`${e("editor.imageUpload.fileSizeTooBig")} ${uX(this.options.maxSize)}.`,duration:2e3}),!1):!0:(t({description:e("editor.imageUpload.fileTypeNotSupported"),duration:2e3}),!1),onUpload:this.options.upload});return[new dt({props:{handlePaste:(o,s)=>!s.clipboardData||Array.from(s.clipboardData.items||[]).some(l=>l.type==="text/html")?!1:eX(o,s,r),handleDrop:(o,s,a,l)=>(!(s instanceof DragEvent)||!s.dataTransfer||tX(o,s,l,r),!1)}}),ZG()]}}),dX={class:"flex items-center w-full p-3 my-3 hover:bg-ed-accent border border-ed-border text-ed-muted-foreground cursor-pointer rounded-sm transition-all"},fX={key:0,class:"flex justify-center items-center gap-3 text-s"},pX={key:1,class:"flex justify-between items-center w-full"},hX={class:"flex justify-center items-center gap-3"},mX={class:"text-sm"},gX={class:"flex items-center gap-2"},bX=i.defineComponent({__name:"VideoUploader",props:{...Us},setup(t){const e=t,n=i.ref(""),r=i.ref(!1),o=i.ref(),{t:s}=St();function a(f){var b,y;r.value=!0;const h=(b=f==null?void 0:f.target)==null?void 0:b.files;if(!e.editor||e.editor.isDestroyed||h.length===0)return;const m=h[0],g=(y=e.editor.extensionManager.extensions.find(w=>w.name==="videoUpload"))==null?void 0:y.options;g==null||g.upload([m]).then(w=>{e.editor.chain().setVideo({src:w[0].src,width:"100%"}).deleteRange({from:e.getPos(),to:e.getPos()}).focus().run(),r.value=!1})}function l(){e.editor.chain().setVideo({src:n.value,width:"100%"}).deleteRange({from:e.getPos(),to:e.getPos()}).focus().run()}function u(){e.deleteNode()}function c(){var f;(f=o.value)==null||f.click()}return(f,h)=>(i.openBlock(),i.createBlock(i.unref(Hs),{as:"div","data-drag-handle":""},{default:i.withCtx(()=>[i.createVNode(i.unref(Oa),{"default-open":"",modal:""},{default:i.withCtx(()=>[i.createVNode(i.unref(Ra),{"as-child":""},{default:i.withCtx(()=>[i.createElementVNode("div",dX,[r.value?(i.openBlock(),i.createElementBlock("div",fX,[i.createVNode(i.unref(Kt),{class:"animate-spin w-6 h-6",name:"LoaderCircle"}),i.createElementVNode("span",null,i.toDisplayString(i.unref(s)("editor.video.dialog.uploading"))+"...",1)])):(i.openBlock(),i.createElementBlock("div",pX,[i.createElementVNode("div",hX,[i.createVNode(i.unref(Kt),{name:"Video",class:"w-6 h-6"}),i.createElementVNode("span",mX,i.toDisplayString(i.unref(s)("editor.video.dialog.title")),1)]),i.createVNode(i.unref(Kt),{name:"Trash2",class:"hover:text-ed-foreground",onClick:i.withModifiers(u,["stop"])})]))])]),_:1}),i.createVNode(i.unref(Ma),{"trap-focus":"",class:"w-full","on-open-auto-focus":m=>m.preventDefault()},{default:i.withCtx(()=>[i.createVNode(i.unref(zm),{"default-value":"upload",class:"w-[400px]","activation-mode":"manual"},{default:i.withCtx(()=>[i.createVNode(i.unref(Hm),{class:"grid w-full grid-cols-2"},{default:i.withCtx(()=>[i.createVNode(i.unref(eu),{value:"upload"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.tab.upload")),1)]),_:1}),i.createVNode(i.unref(eu),{value:"link"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.link")),1)]),_:1})]),_:1}),i.createVNode(i.unref(Cp),{value:"upload"},{default:i.withCtx(()=>[i.createVNode(i.unref(er),{class:"w-full mt-1",size:"sm",onClick:c},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.tab.upload")),1)]),_:1}),i.createElementVNode("input",{ref_key:"fileInput",ref:o,type:"file",accept:"video/*",multiple:"",style:{display:"none"},onChange:a},null,544)]),_:1}),i.createVNode(i.unref(Cp),{value:"link"},{default:i.withCtx(()=>[i.createElementVNode("form",{onSubmit:i.withModifiers(l,["prevent"])},[i.createElementVNode("div",gX,[i.createVNode(i.unref(Ba),{modelValue:n.value,"onUpdate:modelValue":h[0]||(h[0]=m=>n.value=m),type:"url",autofocus:"",required:"",placeholder:i.unref(s)("editor.video.dialog.placeholder")},null,8,["modelValue","placeholder"]),i.createVNode(i.unref(er),{type:"submit"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(s)("editor.video.dialog.button.apply")),1)]),_:1})])],32)]),_:1})]),_:1})]),_:1},8,["on-open-auto-focus"])]),_:1})]),_:1}))}}),vX=Rt.create({name:"videoUpload",isolating:!0,defining:!0,group:"block",draggable:!0,selectable:!0,inline:!1,parseHTML(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML(){return["div",{"data-type":this.name}]},addCommands(){return{setVideoUpload:()=>({commands:t})=>t.insertContent(`<div data-type="${this.name}"></div>`)}},addNodeView(){return Ws(bX)},addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),upload:void 0,button:({editor:e,t:n})=>({component:je,componentProps:{action:()=>e.commands.setVideoUpload(),isActive:()=>e.isActive("video")||!1,disabled:!e.can().setVideo({}),icon:"Video",tooltip:n("editor.video.tooltip")}})}}}),rb=tr(),yX=at.create({name:"preview",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({t:e})=>({component:je,componentProps:{icon:"Eye",action:()=>{rb.togglePreview()},tooltip:e("editor.preview.tooltip"),isActive:()=>rb.state.showPreview}})}},addCommands(){return{togglePreview:()=>()=>(rb.togglePreview(),!0)}}}),M5=tr(),wX=(t,e,n)=>RegExp(e?t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):t,n?"gu":"gui");function xX(t,e,n,r){const o=[],s=[];let a=[],l=0;if(!e)return{decorationsToReturn:ht.empty,results:[]};t==null||t.descendants((u,c)=>{u.isText?a[l]?a[l]={text:a[l].text+u.text,pos:a[l].pos}:a[l]={text:`${u.text}`,pos:c}:l+=1}),a=a.filter(Boolean);for(const u of a){const{text:c,pos:f}=u,h=Array.from(c.matchAll(e)).filter(([m])=>m.trim());for(const m of h){if(m[0]==="")break;m.index!==void 0&&s.push({from:f+m.index,to:f+m.index+m[0].length})}}for(let u=0;u<s.length;u+=1){const c=s[u],f=u===r?`${n} ${n}-current`:n,h=Yt.inline(c.from,c.to,{class:f});o.push(h)}return{decorationsToReturn:ht.create(t,o),results:s}}const CX=(t,e,{state:n,dispatch:r})=>{if(!e[0])return;const{from:s,to:a}=e[0];r&&r(n.tr.insertText(t,s,a))},EX=(t,e,n,r)=>{const o=e+1;if(!r[o])return null;const{from:s,to:a}=r[e],l=a-s-t.length+n,{from:u,to:c}=r[o];return r[o]={to:c-l,from:u-l},[l,r]},_X=(t,e,{tr:n,dispatch:r})=>{let o=0,s=e.slice();if(s.length){for(let a=0;a<s.length;a+=1){const{from:l,to:u}=s[a];n.insertText(t,l,u);const c=EX(t,a,o,s);c&&(o=c[0],s=c[1])}r&&r(n)}},SX=new kt("findAndReplacePlugin"),kX=at.create({name:"findAndReplace",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),searchResultClass:"vdc-editor-search-result",disableRegex:!0,button:({editor:e,extension:n,t:r})=>({component:je,componentProps:{icon:"DocSearch",tooltip:r("editor.findAndReplace.tooltip"),action:()=>{M5.toggleFindAndReplace()},isActive:()=>M5.state.findAndReplace}})}},addStorage(){return{searchTerm:"",replaceTerm:"",results:[],lastSearchTerm:"",caseSensitive:!1,lastCaseSensitive:!1,resultIndex:0,lastResultIndex:0}},addCommands(){return{setSearchTerm:t=>({editor:e})=>(e.storage.findAndReplace.searchTerm=t,!1),setReplaceTerm:t=>({editor:e})=>(e.storage.findAndReplace.replaceTerm=t,!1),setCaseSensitive:t=>({editor:e})=>(e.storage.findAndReplace.caseSensitive=t,!1),resetIndex:()=>({editor:t})=>(t.storage.findAndReplace.resultIndex=0,!1),nextSearchResult:()=>({editor:t})=>{const{results:e,resultIndex:n}=t.storage.findAndReplace,r=n+1;return e[r]?t.storage.findAndReplace.resultIndex=r:t.storage.findAndReplace.resultIndex=0,!1},previousSearchResult:()=>({editor:t})=>{const{results:e,resultIndex:n}=t.storage.findAndReplace,r=n-1;return e[r]?t.storage.findAndReplace.resultIndex=r:t.storage.findAndReplace.resultIndex=e.length-1,!1},replace:()=>({editor:t,state:e,dispatch:n})=>{const{replaceTerm:r,results:o}=t.storage.findAndReplace;return CX(r,o,{state:e,dispatch:n}),!1},replaceAll:()=>({editor:t,tr:e,dispatch:n})=>{const{replaceTerm:r,results:o}=t.storage.findAndReplace;return _X(r,o,{tr:e,dispatch:n}),!1}}},addProseMirrorPlugins(){const t=this.editor,{searchResultClass:e,disableRegex:n}=this.options,r=a=>t.storage.findAndReplace.lastSearchTerm=a,o=a=>t.storage.findAndReplace.lastCaseSensitive=a,s=a=>t.storage.findAndReplace.lastResultIndex=a;return[new dt({key:SX,state:{init:()=>ht.empty,apply({doc:a,docChanged:l},u){const{searchTerm:c,lastSearchTerm:f,caseSensitive:h,lastCaseSensitive:m,resultIndex:g,lastResultIndex:b}=t.storage.findAndReplace;if(!l&&f===c&&m===h&&b===g)return u;if(r(c),o(h),s(g),!c)return t.storage.findAndReplace.results=[],ht.empty;const{decorationsToReturn:y,results:w}=xX(a,wX(c,n,h),e,g);return t.storage.findAndReplace.results=w,y}},props:{decorations(a){return this.getState(a)}}})]}}),{togglePrinter:TX,state:AX}=tr(),OX=at.create({name:"printer",addOptions(){var t;return{...(t=this.parent)==null?void 0:t.call(this),button:({t:e})=>({component:je,componentProps:{tooltip:e("editor.printer.tooltip"),action:()=>TX(),icon:"Printer",shortcutKeys:["mod","P"],isActive:()=>AX.printer}})}}});function MX(t){let e=t;for(;e&&e!==document.body;){if(e.nodeType===1){const n=e;if(n.id==="editor-panel")return n}e=e.parentNode}return null}const ob="spell-check";class BX{constructor(e,n,r,o=1e3){qt(this,"debouncedGetMatchAndSetDecorations",Et.debounce(this.getMatchAndSetDecorations.bind(this),300));qt(this,"debouncedGetMatchAndSetDecorationsList",Et.debounce(this.getMatchAndSetDecorationsList.bind(this),300));qt(this,"debouncedClickEventsListener",Et.debounce(this.clickEventsListener.bind(this),0));qt(this,"debouncedAcceptSuggestionEventsListener",Et.debounce(this.acceptSuggestionListener.bind(this),0));qt(this,"debouncedProofreadChangedNodes",Et.debounce(this.proofreadChangedNodes.bind(this),300));qt(this,"proofreader");qt(this,"uiStrings");qt(this,"showSuggestionsEvent");qt(this,"decorationSet");qt(this,"editorView");qt(this,"isInitialProofreadingDone",!1);qt(this,"lastOriginalFrom",0);qt(this,"lastClickedDecoration",null);qt(this,"suggestionBox");qt(this,"isEnableSuggestion");qt(this,"isMobile");qt(this,"limit",1e3);qt(this,"_debouncedProofreadDoc",Et.debounce((e,n)=>{this.proofreadDoc(e),n&&n()},500));qt(this,"_debouncedHandleEnterKey",Et.debounce((e,n,r)=>{this.handleEnterKey(e,n),r&&r()},500));this.proofreader=e,this.uiStrings=n,this.showSuggestionsEvent=r,this.decorationSet=ht.empty,this.limit=o,this.suggestionBox=document.createElement("div"),this.suggestionBox.id="suggestions-box",this.suggestionBox.tabIndex=0,this.isEnableSuggestion=!0,this.isMobile=!1,this.hideSuggestionBox()}get completeProofreadingDone(){return this.isInitialProofreadingDone}getProofreader(){return this.proofreader}toggleIsEnabledSpellCheck(){this.proofreader.toggleIsEnabled()}getIsEnabledSpellCheck(){return this.proofreader.getIsEnabled()}setDecorationSet(e){this.decorationSet=e}getDecorationSet(){return this.decorationSet}setEditorView(e){this.editorView=e}getEditorView(){return this.editorView}getSuggestionBox(){return this.suggestionBox}hideSuggestionBox(){this.suggestionBox.textContent="",this.suggestionBox.style.display="none"}setIsEnableSuggestion(e){this.isEnableSuggestion=e}setIsMobile(e){this.isMobile=e}getChangedNodesFromTransaction(e,n=!1,r=!1){const o=[],s=new Set;let a=!1;return e.steps.forEach(l=>{var h,m,g;const u=l;if(u.from===void 0||u.to===void 0||n&&u.structure)return;((m=(h=u.slice)==null?void 0:h.content[0])==null?void 0:m.type.name)===gl&&(a=!0);const c=u.from-(r?1:0);let f=Math.max(u.to,u.from+(((g=u.slice)==null?void 0:g.size)||0))-(r?1:0);f>e.doc.content.size&&(f=e.doc.content.size),e.doc.nodesBetween(c,f,(b,y)=>{b&&(b.isText&&!s.has(y)&&(o.push({node:b,pos:y}),s.add(y)),b.type.name===gl&&(a=!0))})}),{changedNodes:o,isChangedSuperText:a}}debouncedProofreadDoc(e,n){this._debouncedProofreadDoc(e,n)}isSuperTextAlone(e,n){let r=!1;return e.descendants((o,s,a)=>o===n?(a&&a.type.name==="paragraph"&&a.childCount===1&&a.firstChild===n&&(r=!0),!1):!0),r}proofreadDoc(e){let n=[],r=0;e==null||e.descendants((u,c)=>{if(!u.isText&&u.type.name!==gl)return r+=1,!0;const f={text:"",from:-1,to:-1};if(u.type.name===gl&&this.isSuperTextAlone(e,u))return f.text=`
252
252
  `,f.from=c,f.to=c+u.nodeSize,n[r]=f,r+=1,!0;n[r]?(u.type.name===gl?f.text=n[r].text+" ":f.text=n[r].text+u.text,f.from=n[r].from,f.to=f.from+u.nodeSize):(f.text=u.text||"",f.from=c,f.to=c+u.nodeSize),n[r]=f}),n=n.filter(Boolean);let o="",s=1;for(const{text:u,from:c,to:f}of n){const h=c-s;h>0&&(o+=Array(h+1).join(`
253
253
  `)),s=f,o+=u}const a=hy(o,this.limit),l=this.getMatchAndSetDecorationsList(a.map(u=>({text:u.text,originalFrom:u.offset+1})));this.editorView&&this.dispatch(this.editorView.state.tr.setMeta(so.LOADING_TRANSACTION,!0)),l.then(()=>{this.editorView&&this.dispatch(this.editorView.state.tr.setMeta(so.LOADING_TRANSACTION,!1))}),this.isInitialProofreadingDone=!0}async proofreadChangedNodes(e){const n=this.isMobile?1:2,o=e.reduce((s,a)=>{if(s.length===0)return s.push({changedNode:a,time:1}),s;const l=s[s.length-1];return a.pos===l.changedNode.pos+l.changedNode.node.nodeSize+n*l.time?(l.changedNode.node.text+=a.node.text,l.time+=1):s.push({changedNode:a,time:1}),s},[]).map(({changedNode:s})=>{var c;const a=((c=s.node)==null?void 0:c.textContent)||"",l=s.pos;return hy(a,this.limit).map(f=>({text:f.text,originalFrom:l+f.offset}))});this.debouncedGetMatchAndSetDecorationsList(o.flat())}async getMatchAndSetDecorationsList(e){const n=e.map(r=>this.getMatchAndSetDecorations(r.text,r.originalFrom));await Promise.all(n)}async getMatchAndSetDecorations(e,n){const r=await this.proofreader.proofreadText(this.proofreader.normalizeTextForLanguage(e)),o=[];for(const l of r){const u=l.startIndex+n,c=u+l.length,f=await this.proofreader.getSuggestions(l.wrongWord),h={length:l.length,wrongWord:l.wrongWord,suggestions:f};o.push(Yt.inline(u,c,{class:"spell-error",nodeName:"span",[ob]:JSON.stringify(h)}))}const s=this.decorationSet.find(n,n+e.length);let a=this.decorationSet.remove(s);this.editorView&&(a=a.add(this.editorView.state.doc,o)),this.setDecorationSet(a),this.editorView&&this.dispatch(this.editorView.state.tr.setMeta(so.SPELLCHECKER_TRANSACTION,!0)),this.addEventListenersToDecorations()}addEventListenersToDecorations(){var e;if(this.isEnableSuggestion)try{const n=(e=this.editorView)==null?void 0:e.domAtPos(this.lastOriginalFrom).node,r=(n==null?void 0:n.querySelectorAll("span.spell-error"))||[];if(!r.length)return;r.forEach(o=>{o.addEventListener("click",this.debouncedClickEventsListener)})}catch{}}addEventListenersToSuggestionBox(){const e=this.suggestionBox.querySelectorAll("li");e.length&&e.forEach(n=>{n.addEventListener("click",this.debouncedAcceptSuggestionEventsListener)})}dispatch(e){this.editorView&&this.editorView.dispatch(e)}findChangedTextNodes(e,n,r,o){if(!e.isBlock)return!1;if(!e.isTextblock)return e.descendants((u,c)=>{this.findChangedTextNodes(u,c,r,o)}),!1;const[s,a]=[n,n+e.nodeSize];if(!(s<=r&&o<=a))return;const l={node:e,pos:n};this.onNodeChanged(l.node.textContent,l.pos+1)}onNodeChanged(e,n){n!==this.lastOriginalFrom?this.getMatchAndSetDecorations(e,n):this.debouncedGetMatchAndSetDecorations(e,n),this.lastOriginalFrom=n}async clickEventsListener(e){var c,f;if(!e.target)return;const n=e.target;this.lastClickedDecoration=n;const r=(c=n.getAttribute(ob))==null?void 0:c.trim();if(!r){console.error("No match string provided",{spellCheckerAttributes:r});return}const{length:o,wrongWord:s,suggestions:a}=JSON.parse(r),l=((f=this.editorView)==null?void 0:f.posAtDOM(n,0))??0,u=l+o;if(this.editorView){this.addSuggestionsList(a,l,u),this.suggestionBox.style.display="";const h=MX(n);if(!h)return;const m=n.getBoundingClientRect(),g=h.getBoundingClientRect(),b=m.left-g.left+3,y=m.top-g.top+30;this.suggestionBox.style.left=b+"px",this.suggestionBox.style.top=y+"px",this.showSuggestionsEvent&&this.showSuggestionsEvent(this.proofreader.normalizeTextForLanguage(s))}return this.addEventListenersToSuggestionBox(),!1}acceptSuggestionListener(e){var s;if(!e.target)return;const n=e.target;let r=0,o=0;if(this.lastClickedDecoration&&this.editorView){const a=(s=this.lastClickedDecoration.getAttribute(ob))==null?void 0:s.trim();if(a){const{length:l}=JSON.parse(a);r=this.editorView.posAtDOM(this.lastClickedDecoration,0),o=r+l}}this.editorView&&r>=0&&o>r&&(this.dispatch(this.editorView.state.tr.setMeta(so.ACCEPT_SUGGESTION,!0)),this.dispatch(this.editorView.state.tr.insertText(n.textContent||"",r,o))),this.hideSuggestionBox(),this.lastClickedDecoration&&(this.lastClickedDecoration.removeEventListener("click",this.debouncedClickEventsListener),this.lastClickedDecoration=null)}addSuggestionsList(e,n,r){if(this.suggestionBox.textContent="",e.length>0){const o=document.createElement("ul");o.className="suggestion-list",e.forEach(s=>{const a=document.createElement("li");a.innerText=s,a.dataset.from=n+"",a.dataset.to=r+"",o.appendChild(a)}),this.suggestionBox.appendChild(o)}if(e.length===0){const o=document.createElement("b"),s=this.uiStrings&&this.uiStrings.noSuggestions?this.uiStrings.noSuggestions:"No suggestions found";o.textContent=s,this.suggestionBox.appendChild(o)}}isUndoRedo(e,n){return e.getMeta(sC.ADD_TO_HISTORY_TRANSACTION)===!1||e.getMeta(so.APPENDED)===!0||n.isUndoRedoOperation}handleUndoRedo(e,n){var s;const r=(s=e.getMeta(sC.HISTORY_TRANSACTION))==null?void 0:s.redo;if(n.isUndoRedoOperation=!1,r)return this.debouncedProofreadDoc(e.doc),this.getDecorationSet();const{changedNodes:o}=this.getChangedNodesFromTransaction(e,!0);return o.length>0&&this.debouncedProofreadChangedNodes(o),this.getDecorationSet()}isTextContentChangedOrDeleted(e){let n=!1;return{isTextContentChanged:e.steps.some(o=>{var a,l;const s=(a=o.toJSON)==null?void 0:a.call(o);return(s==null?void 0:s.stepType)==="replace"&&((l=s==null?void 0:s.slice)!=null&&l.content)?s.slice.content.some(u=>u.type==="paragraph"&&u.content&&u.content.length>0):(s==null?void 0:s.stepType)==="replace"&&(!s.slice||!s.slice.content||s.slice.content.length===0)?(n=!0,s.from!==s.to):!1}),isDeleteAction:n}}handleEnterKey(e,n){if(n)return this.debouncedProofreadDoc(e.doc),this.getDecorationSet();const r=e.getMeta(so.APPENDED_TRANSACTION);if(!r)return this.getDecorationSet();const s=r.steps[0].to,a=r.before.nodeAt(s-1);if(!(a!=null&&a.isText))return this.getDecorationSet();let l=0;return r.before.descendants((c,f)=>{c.textContent===(a==null?void 0:a.textContent)&&(l=f)}),l+((a==null?void 0:a.nodeSize)||0)===s?this.getDecorationSet():(this.debouncedProofreadDoc(e.doc),this.getDecorationSet())}handleEnterKeyDebounced(e,n,r){this._debouncedHandleEnterKey(e,n,r)}}const B5=tr(),so={SPELLCHECKER_TRANSACTION:"spellcheckerTransaction",IS_ACTIVE_SPELLCHECK:"isActiveSpellCheck",LOADING_TRANSACTION:"loading",PREVENT_UPDATE:"preventUpdate",APPENDED:"appended",APPENDED_TRANSACTION:"appendedTransaction",ACCEPT_SUGGESTION:"acceptSuggestion"},R5=at.create({name:"spellchecker",addOptions(){return{proofreader:void 0,uiStrings:{noSuggestions:""},button:({editor:t,t:e,isMobile:n})=>({component:je,componentProps:{action:()=>t.commands.handleActiveSpellCheck(),isActive:()=>{var r,o,s,a;return((a=(s=(o=(r=t==null?void 0:t.extensionStorage)==null?void 0:r.spellchecker)==null?void 0:o.spellchecker)==null?void 0:s.proofreader)==null?void 0:a.enabled)||!1},icon:"SpellCheck",tooltip:"맞춤법 검사",title:n?e("editor.menubar.menu.spelling"):""}})}},addStorage(){return{didPaste:!1,spellchecker:void 0,isUndoRedoOperation:!1,pendingSpellCheck:!1,enterKeyPressed:!1}},addCommands(){return{checkSpelling:()=>({tr:t})=>(this.storage.spellchecker.proofreadDoc(t.doc),!0),selectAll:()=>({state:t,dispatch:e})=>(KP(t,e),!0),copy:()=>()=>(document.execCommand("copy"),!0),handleActiveSpellCheck:(t=!0)=>({editor:e})=>{const n=e.extensionStorage.spellchecker.spellchecker;return n.toggleIsEnabledSpellCheck(),e.view.dispatch(e.state.tr.setMeta(so.IS_ACTIVE_SPELLCHECK,n.getIsEnabledSpellCheck())),t&&B5.setSpellCheck(n.getIsEnabledSpellCheck()),!0},setIsEnableSuggestion:t=>()=>(this.storage.spellchecker.setIsEnableSuggestion(t),!0),setIsMobile:t=>()=>(this.storage.spellchecker.setIsMobile(t),!0)}},addProseMirrorPlugins(){return[new dt({key:new kt("spellcheckerPlugin"),props:{decorations(t){return this.getState(t)},handlePaste:()=>{this.storage.didPaste=!0},handleClick:()=>{this.storage.spellchecker.hideSuggestionBox()},handleKeyDown:(t,e)=>((e.ctrlKey||e.metaKey)&&(e.key==="z"||e.key==="y")&&(this.storage.isUndoRedoOperation=!0,this.storage.pendingSpellCheck=!0),this.storage.enterKeyPressed&&(this.storage.pendingSpellCheck=!0),e.key==="Enter"&&(this.storage.enterKeyPressed=!0),!1)},state:{init:(t,e)=>{var r,o;const n=new BX(this.options.proofreader,this.options.uiStrings,this.options.onShowSuggestionsEvent,(r=this.options.proofreader)==null?void 0:r.limit);return this.storage.spellchecker=n,n.setDecorationSet(ht.create(e.doc,[])),B5.setSpellCheck(n.getIsEnabledSpellCheck()),(o=this.options.proofreader)!=null&&o.enabled&&n.proofreadDoc(e.doc),n.getDecorationSet()},apply:t=>{var r;const e=this.storage.spellchecker,n=t.getMeta(so.IS_ACTIVE_SPELLCHECK);if(n!==void 0)return n?e.proofreadDoc(t.doc):e.setDecorationSet(ht.empty),e.getDecorationSet();if(t.getMeta(so.SPELLCHECKER_TRANSACTION))return e.getDecorationSet();if(t.docChanged&&t.doc.nodeSize){const s=e.getDecorationSet().map(t.mapping,t.doc);if(e.setDecorationSet(s),e.isUndoRedo(t,this.storage))return e.handleUndoRedo(t,this.storage);const{isTextContentChanged:a,isDeleteAction:l}=e.isTextContentChangedOrDeleted(t);if(l){const{changedNodes:h}=e.getChangedNodesFromTransaction(t,!1,!0);return h.length>0&&e.debouncedProofreadChangedNodes([h[0]]),e.getDecorationSet()}if(this.storage.enterKeyPressed)return e.handleEnterKeyDebounced(t,this.storage.pendingSpellCheck,()=>{this.storage.enterKeyPressed=!1,this.storage.pendingSpellCheck=!1}),e.getDecorationSet();if(this.storage.pendingSpellCheck||a)return e.debouncedProofreadDoc(t.doc,()=>{this.storage.pendingSpellCheck=!1}),e.getDecorationSet();if(t.getMeta(QC.UPDATE)||t.updated===0&&((r=t.steps[0])==null?void 0:r.structure)===!0)return e.getDecorationSet();if(t.getMeta(so.PREVENT_UPDATE)===!0&&t.before.textContent.length===0)return e.debouncedProofreadDoc(t.doc),e.getDecorationSet();this.storage.didPaste&&(this.storage.didPaste=!1);const{changedNodes:c,isChangedSuperText:f}=e.getChangedNodesFromTransaction(t);if(f)return e.debouncedProofreadDoc(t.doc),e.getDecorationSet();c.length>0&&e.debouncedProofreadChangedNodes(c)}return e.getDecorationSet()}},view:()=>({update:t=>{var n,r;const e=this.storage.spellchecker;e.setEditorView(t),(r=(n=t==null?void 0:t.dom)==null?void 0:n.parentNode)==null||r.appendChild(e.getSuggestionBox())}})})]}});function I5(t,e){return function(){return t.apply(e,arguments)}}const{toString:RX}=Object.prototype,{getPrototypeOf:ib}=Object,Ep=(t=>e=>{const n=RX.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ao=t=>(t=t.toLowerCase(),e=>Ep(e)===t),_p=t=>e=>typeof e===t,{isArray:yl}=Array,rc=_p("undefined");function IX(t){return t!==null&&!rc(t)&&t.constructor!==null&&!rc(t.constructor)&&br(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const L5=ao("ArrayBuffer");function LX(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&L5(t.buffer),e}const PX=_p("string"),br=_p("function"),P5=_p("number"),Sp=t=>t!==null&&typeof t=="object",DX=t=>t===!0||t===!1,kp=t=>{if(Ep(t)!=="object")return!1;const e=ib(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},FX=ao("Date"),VX=ao("File"),$X=ao("Blob"),zX=ao("FileList"),HX=t=>Sp(t)&&br(t.pipe),UX=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||br(t.append)&&((e=Ep(t))==="formdata"||e==="object"&&br(t.toString)&&t.toString()==="[object FormData]"))},WX=ao("URLSearchParams"),[jX,qX,KX,GX]=["ReadableStream","Request","Response","Headers"].map(ao),XX=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function oc(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,o;if(typeof t!="object"&&(t=[t]),yl(t))for(r=0,o=t.length;r<o;r++)e.call(null,t[r],r,t);else{const s=n?Object.getOwnPropertyNames(t):Object.keys(t),a=s.length;let l;for(r=0;r<a;r++)l=s[r],e.call(null,t[l],l,t)}}function D5(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length,o;for(;r-- >0;)if(o=n[r],e===o.toLowerCase())return o;return null}const ea=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,F5=t=>!rc(t)&&t!==ea;function sb(){const{caseless:t}=F5(this)&&this||{},e={},n=(r,o)=>{const s=t&&D5(e,o)||o;kp(e[s])&&kp(r)?e[s]=sb(e[s],r):kp(r)?e[s]=sb({},r):yl(r)?e[s]=r.slice():e[s]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&oc(arguments[r],n);return e}const JX=(t,e,n,{allOwnKeys:r}={})=>(oc(e,(o,s)=>{n&&br(o)?t[s]=I5(o,n):t[s]=o},{allOwnKeys:r}),t),YX=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),ZX=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},QX=(t,e,n,r)=>{let o,s,a;const l={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),s=o.length;s-- >0;)a=o[s],(!r||r(a,t,e))&&!l[a]&&(e[a]=t[a],l[a]=!0);t=n!==!1&&ib(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},NX=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},eJ=t=>{if(!t)return null;if(yl(t))return t;let e=t.length;if(!P5(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},tJ=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&ib(Uint8Array)),nJ=(t,e)=>{const r=(t&&t[Symbol.iterator]).call(t);let o;for(;(o=r.next())&&!o.done;){const s=o.value;e.call(t,s[0],s[1])}},rJ=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},oJ=ao("HTMLFormElement"),iJ=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),V5=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),sJ=ao("RegExp"),$5=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};oc(n,(o,s)=>{let a;(a=e(o,s,t))!==!1&&(r[s]=a||o)}),Object.defineProperties(t,r)},aJ=t=>{$5(t,(e,n)=>{if(br(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(br(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},lJ=(t,e)=>{const n={},r=o=>{o.forEach(s=>{n[s]=!0})};return yl(t)?r(t):r(String(t).split(e)),n},uJ=()=>{},cJ=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function dJ(t){return!!(t&&br(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const fJ=t=>{const e=new Array(10),n=(r,o)=>{if(Sp(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[o]=r;const s=yl(r)?[]:{};return oc(r,(a,l)=>{const u=n(a,o+1);!rc(u)&&(s[l]=u)}),e[o]=void 0,s}}return r};return n(t,0)},pJ=ao("AsyncFunction"),hJ=t=>t&&(Sp(t)||br(t))&&br(t.then)&&br(t.catch),z5=((t,e)=>t?setImmediate:e?((n,r)=>(ea.addEventListener("message",({source:o,data:s})=>{o===ea&&s===n&&r.length&&r.shift()()},!1),o=>{r.push(o),ea.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",br(ea.postMessage)),mJ=typeof queueMicrotask<"u"?queueMicrotask.bind(ea):typeof process<"u"&&process.nextTick||z5,ee={isArray:yl,isArrayBuffer:L5,isBuffer:IX,isFormData:UX,isArrayBufferView:LX,isString:PX,isNumber:P5,isBoolean:DX,isObject:Sp,isPlainObject:kp,isReadableStream:jX,isRequest:qX,isResponse:KX,isHeaders:GX,isUndefined:rc,isDate:FX,isFile:VX,isBlob:$X,isRegExp:sJ,isFunction:br,isStream:HX,isURLSearchParams:WX,isTypedArray:tJ,isFileList:zX,forEach:oc,merge:sb,extend:JX,trim:XX,stripBOM:YX,inherits:ZX,toFlatObject:QX,kindOf:Ep,kindOfTest:ao,endsWith:NX,toArray:eJ,forEachEntry:nJ,matchAll:rJ,isHTMLForm:oJ,hasOwnProperty:V5,hasOwnProp:V5,reduceDescriptors:$5,freezeMethods:aJ,toObjectSet:lJ,toCamelCase:iJ,noop:uJ,toFiniteNumber:cJ,findKey:D5,global:ea,isContextDefined:F5,isSpecCompliantForm:dJ,toJSONObject:fJ,isAsyncFn:pJ,isThenable:hJ,setImmediate:z5,asap:mJ};function et(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}ee.inherits(et,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ee.toJSONObject(this.config),code:this.code,status:this.status}}});const H5=et.prototype,U5={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{U5[t]={value:t}}),Object.defineProperties(et,U5),Object.defineProperty(H5,"isAxiosError",{value:!0}),et.from=(t,e,n,r,o,s)=>{const a=Object.create(H5);return ee.toFlatObject(t,a,function(u){return u!==Error.prototype},l=>l!=="isAxiosError"),et.call(a,t.message,e,n,r,o),a.cause=t,a.name=t.name,s&&Object.assign(a,s),a};const gJ=null;function ab(t){return ee.isPlainObject(t)||ee.isArray(t)}function W5(t){return ee.endsWith(t,"[]")?t.slice(0,-2):t}function j5(t,e,n){return t?t.concat(e).map(function(o,s){return o=W5(o),!n&&s?"["+o+"]":o}).join(n?".":""):e}function bJ(t){return ee.isArray(t)&&!t.some(ab)}const vJ=ee.toFlatObject(ee,{},null,function(e){return/^is[A-Z]/.test(e)});function Tp(t,e,n){if(!ee.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=ee.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,w){return!ee.isUndefined(w[y])});const r=n.metaTokens,o=n.visitor||f,s=n.dots,a=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&ee.isSpecCompliantForm(e);if(!ee.isFunction(o))throw new TypeError("visitor must be a function");function c(b){if(b===null)return"";if(ee.isDate(b))return b.toISOString();if(!u&&ee.isBlob(b))throw new et("Blob is not supported. Use a Buffer instead.");return ee.isArrayBuffer(b)||ee.isTypedArray(b)?u&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function f(b,y,w){let x=b;if(b&&!w&&typeof b=="object"){if(ee.endsWith(y,"{}"))y=r?y:y.slice(0,-2),b=JSON.stringify(b);else if(ee.isArray(b)&&bJ(b)||(ee.isFileList(b)||ee.endsWith(y,"[]"))&&(x=ee.toArray(b)))return y=W5(y),x.forEach(function(S,C){!(ee.isUndefined(S)||S===null)&&e.append(a===!0?j5([y],C,s):a===null?y:y+"[]",c(S))}),!1}return ab(b)?!0:(e.append(j5(w,y,s),c(b)),!1)}const h=[],m=Object.assign(vJ,{defaultVisitor:f,convertValue:c,isVisitable:ab});function g(b,y){if(!ee.isUndefined(b)){if(h.indexOf(b)!==-1)throw Error("Circular reference detected in "+y.join("."));h.push(b),ee.forEach(b,function(x,_){(!(ee.isUndefined(x)||x===null)&&o.call(e,x,ee.isString(_)?_.trim():_,y,m))===!0&&g(x,y?y.concat(_):[_])}),h.pop()}}if(!ee.isObject(t))throw new TypeError("data must be an object");return g(t),e}function q5(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function lb(t,e){this._pairs=[],t&&Tp(t,this,e)}const K5=lb.prototype;K5.append=function(e,n){this._pairs.push([e,n])},K5.toString=function(e){const n=e?function(r){return e.call(this,r,q5)}:q5;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function yJ(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function G5(t,e,n){if(!e)return t;const r=n&&n.encode||yJ;ee.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(o?s=o(e,n):s=ee.isURLSearchParams(e)?e.toString():new lb(e,n).toString(r),s){const a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class X5{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ee.forEach(this.handlers,function(r){r!==null&&e(r)})}}const J5={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},wJ={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:lb,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ub=typeof window<"u"&&typeof document<"u",cb=typeof navigator=="object"&&navigator||void 0,xJ=ub&&(!cb||["ReactNative","NativeScript","NS"].indexOf(cb.product)<0),CJ=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",EJ=ub&&window.location.href||"http://localhost",Dn={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ub,hasStandardBrowserEnv:xJ,hasStandardBrowserWebWorkerEnv:CJ,navigator:cb,origin:EJ},Symbol.toStringTag,{value:"Module"})),...wJ};function _J(t,e){return Tp(t,new Dn.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,s){return Dn.isNode&&ee.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function SJ(t){return ee.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function kJ(t){const e={},n=Object.keys(t);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],e[s]=t[s];return e}function Y5(t){function e(n,r,o,s){let a=n[s++];if(a==="__proto__")return!0;const l=Number.isFinite(+a),u=s>=n.length;return a=!a&&ee.isArray(o)?o.length:a,u?(ee.hasOwnProp(o,a)?o[a]=[o[a],r]:o[a]=r,!l):((!o[a]||!ee.isObject(o[a]))&&(o[a]=[]),e(n,r,o[a],s)&&ee.isArray(o[a])&&(o[a]=kJ(o[a])),!l)}if(ee.isFormData(t)&&ee.isFunction(t.entries)){const n={};return ee.forEachEntry(t,(r,o)=>{e(SJ(r),o,n,0)}),n}return null}function TJ(t,e,n){if(ee.isString(t))try{return(e||JSON.parse)(t),ee.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const ic={transitional:J5,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,s=ee.isObject(e);if(s&&ee.isHTMLForm(e)&&(e=new FormData(e)),ee.isFormData(e))return o?JSON.stringify(Y5(e)):e;if(ee.isArrayBuffer(e)||ee.isBuffer(e)||ee.isStream(e)||ee.isFile(e)||ee.isBlob(e)||ee.isReadableStream(e))return e;if(ee.isArrayBufferView(e))return e.buffer;if(ee.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return _J(e,this.formSerializer).toString();if((l=ee.isFileList(e))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Tp(l?{"files[]":e}:e,u&&new u,this.formSerializer)}}return s||o?(n.setContentType("application/json",!1),TJ(e)):e}],transformResponse:[function(e){const n=this.transitional||ic.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(ee.isResponse(e)||ee.isReadableStream(e))return e;if(e&&ee.isString(e)&&(r&&!this.responseType||o)){const a=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(l){if(a)throw l.name==="SyntaxError"?et.from(l,et.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Dn.classes.FormData,Blob:Dn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ee.forEach(["delete","get","head","post","put","patch"],t=>{ic.headers[t]={}});const AJ=ee.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),OJ=t=>{const e={};let n,r,o;return t&&t.split(`
254
254
  `).forEach(function(a){o=a.indexOf(":"),n=a.substring(0,o).trim().toLowerCase(),r=a.substring(o+1).trim(),!(!n||e[n]&&AJ[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},Z5=Symbol("internals");function sc(t){return t&&String(t).trim().toLowerCase()}function Ap(t){return t===!1||t==null?t:ee.isArray(t)?t.map(Ap):String(t)}function MJ(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const BJ=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function db(t,e,n,r,o){if(ee.isFunction(r))return r.call(this,e,n);if(o&&(e=n),!!ee.isString(e)){if(ee.isString(r))return e.indexOf(r)!==-1;if(ee.isRegExp(r))return r.test(e)}}function RJ(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function IJ(t,e){const n=ee.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(o,s,a){return this[r].call(this,e,o,s,a)},configurable:!0})})}let rr=class{constructor(e){e&&this.set(e)}set(e,n,r){const o=this;function s(l,u,c){const f=sc(u);if(!f)throw new Error("header name must be a non-empty string");const h=ee.findKey(o,f);(!h||o[h]===void 0||c===!0||c===void 0&&o[h]!==!1)&&(o[h||u]=Ap(l))}const a=(l,u)=>ee.forEach(l,(c,f)=>s(c,f,u));if(ee.isPlainObject(e)||e instanceof this.constructor)a(e,n);else if(ee.isString(e)&&(e=e.trim())&&!BJ(e))a(OJ(e),n);else if(ee.isHeaders(e))for(const[l,u]of e.entries())s(u,l,r);else e!=null&&s(n,e,r);return this}get(e,n){if(e=sc(e),e){const r=ee.findKey(this,e);if(r){const o=this[r];if(!n)return o;if(n===!0)return MJ(o);if(ee.isFunction(n))return n.call(this,o,r);if(ee.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=sc(e),e){const r=ee.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||db(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let o=!1;function s(a){if(a=sc(a),a){const l=ee.findKey(r,a);l&&(!n||db(r,r[l],l,n))&&(delete r[l],o=!0)}}return ee.isArray(e)?e.forEach(s):s(e),o}clear(e){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const s=n[r];(!e||db(this,this[s],s,e,!0))&&(delete this[s],o=!0)}return o}normalize(e){const n=this,r={};return ee.forEach(this,(o,s)=>{const a=ee.findKey(r,s);if(a){n[a]=Ap(o),delete n[s];return}const l=e?RJ(s):String(s).trim();l!==s&&delete n[s],n[l]=Ap(o),r[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return ee.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=e&&ee.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(`
@@ -256,11 +256,11 @@ https://github.com/highlightjs/highlight.js/issues/2277`),ne=P,oe=G),Z===void 0&
256
256
  `+s.map(uE).join(`
257
257
  `):" "+uE(s[0]):"as no adapter specified";throw new et("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:hb};function mb(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new wl(null,t)}function dE(t){return mb(t),t.headers=rr.from(t.headers),t.data=fb.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),cE.getAdapter(t.adapter||ic.adapter)(t).then(function(r){return mb(t),r.data=fb.call(t,t.transformResponse,r),r.headers=rr.from(r.headers),r},function(r){return Q5(r)||(mb(t),r&&r.response&&(r.response.data=fb.call(t,t.transformResponse,r.response),r.response.headers=rr.from(r.response.headers))),Promise.reject(r)})}const fE="1.8.4",Rp={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Rp[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const pE={};Rp.transitional=function(e,n,r){function o(s,a){return"[Axios v"+fE+"] Transitional option '"+s+"'"+a+(r?". "+r:"")}return(s,a,l)=>{if(e===!1)throw new et(o(a," has been removed"+(n?" in "+n:"")),et.ERR_DEPRECATED);return n&&!pE[a]&&(pE[a]=!0,console.warn(o(a," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,a,l):!0}},Rp.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function ZJ(t,e,n){if(typeof t!="object")throw new et("options must be an object",et.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const s=r[o],a=e[s];if(a){const l=t[s],u=l===void 0||a(l,s,t);if(u!==!0)throw new et("option "+s+" must be "+u,et.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new et("Unknown option "+s,et.ERR_BAD_OPTION)}}const Ip={assertOptions:ZJ,validators:Rp},Mo=Ip.validators;let na=class{constructor(e){this.defaults=e,this.interceptors={request:new X5,response:new X5}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
258
258
  `+s):r.stack=s}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=ta(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&Ip.assertOptions(r,{silentJSONParsing:Mo.transitional(Mo.boolean),forcedJSONParsing:Mo.transitional(Mo.boolean),clarifyTimeoutError:Mo.transitional(Mo.boolean)},!1),o!=null&&(ee.isFunction(o)?n.paramsSerializer={serialize:o}:Ip.assertOptions(o,{encode:Mo.function,serialize:Mo.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Ip.assertOptions(n,{baseUrl:Mo.spelling("baseURL"),withXsrfToken:Mo.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=s&&ee.merge(s.common,s[n.method]);s&&ee.forEach(["delete","get","head","post","put","patch","common"],b=>{delete s[b]}),n.headers=rr.concat(a,s);const l=[];let u=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(u=u&&y.synchronous,l.unshift(y.fulfilled,y.rejected))});const c=[];this.interceptors.response.forEach(function(y){c.push(y.fulfilled,y.rejected)});let f,h=0,m;if(!u){const b=[dE.bind(this),void 0];for(b.unshift.apply(b,l),b.push.apply(b,c),m=b.length,f=Promise.resolve(n);h<m;)f=f.then(b[h++],b[h++]);return f}m=l.length;let g=n;for(h=0;h<m;){const b=l[h++],y=l[h++];try{g=b(g)}catch(w){y.call(this,w);break}}try{f=dE.call(this,g)}catch(b){return Promise.reject(b)}for(h=0,m=c.length;h<m;)f=f.then(c[h++],c[h++]);return f}getUri(e){e=ta(this.defaults,e);const n=nE(e.baseURL,e.url,e.allowAbsoluteUrls);return G5(n,e.params,e.paramsSerializer)}};ee.forEach(["delete","get","head","options"],function(e){na.prototype[e]=function(n,r){return this.request(ta(r||{},{method:e,url:n,data:(r||{}).data}))}}),ee.forEach(["post","put","patch"],function(e){function n(r){return function(s,a,l){return this.request(ta(l||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}na.prototype[e]=n(),na.prototype[e+"Form"]=n(!0)});let QJ=class lk{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(o=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const a=new Promise(l=>{r.subscribe(l),s=l}).then(o);return a.cancel=function(){r.unsubscribe(s)},a},e(function(s,a,l){r.reason||(r.reason=new wl(s,a,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new lk(function(o){e=o}),cancel:e}}};function NJ(t){return function(n){return t.apply(null,n)}}function eY(t){return ee.isObject(t)&&t.isAxiosError===!0}const gb={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(gb).forEach(([t,e])=>{gb[e]=t});function hE(t){const e=new na(t),n=I5(na.prototype.request,e);return ee.extend(n,na.prototype,e,{allOwnKeys:!0}),ee.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return hE(ta(t,o))},n}const an=hE(ic);an.Axios=na,an.CanceledError=wl,an.CancelToken=QJ,an.isCancel=Q5,an.VERSION=fE,an.toFormData=Tp,an.AxiosError=et,an.Cancel=an.CanceledError,an.all=function(e){return Promise.all(e)},an.spread=NJ,an.isAxiosError=eY,an.mergeConfig=ta,an.AxiosHeaders=rr,an.formToJSON=t=>Y5(ee.isHTMLForm(t)?new FormData(t):t),an.getAdapter=cE.getAdapter,an.HttpStatusCode=gb,an.default=an;const{Axios:aie,AxiosError:lie,CanceledError:uie,isCancel:cie,CancelToken:die,VERSION:fie,all:pie,Cancel:hie,isAxiosError:mie,spread:gie,toFormData:bie,AxiosHeaders:vie,HttpStatusCode:yie,formToJSON:wie,getAdapter:xie,mergeConfig:Cie}=an,tY=async function(t){let e=[];try{if(this.enabled===!1||t.length===0||t.trim()==="")return e;if(this.limit&&t.length>this.limit)throw new Error("Text is too long");const n=await an.post(this.getApi(),{value:t}),r=this.transfer(n.data);e=(r==null?void 0:r.map(o=>o.errorText))||[],this!=null&&this.setSuggestions&&this.setSuggestions(r)}catch(n){console.error(n)}return e};class mE{constructor({api:e,limit:n,transfer:r,enabled:o}){qt(this,"suggestions",[]);qt(this,"api","");qt(this,"enabled",!0);qt(this,"limit");qt(this,"transfer");this.suggestions=[],this.api=e,this.limit=n,this.transfer=r,this.enabled=o??!0}setSuggestions(e){this.suggestions=e}getSuggestions(e){var n;return Promise.resolve(((n=this.suggestions.find(r=>r.errorText.wrongWord===e))==null?void 0:n.spellData.correctWord)??[])}getApi(){return this.api}normalizeTextForLanguage(e){return e}proofreadText(e){return Promise.resolve(tY.call(this,e))}toggleIsEnabled(){this.enabled=!this.enabled}getIsEnabled(){return this.enabled}}const nY=Object.freeze(Object.defineProperty({__proto__:null,AI:GG,BaseKit:_5,Blockquote:EU,Bold:Xx,BulletList:hU,Clear:H1,Code:wz,CodeBlock:PH,Color:O8,Columns:jg,FindAndReplace:kX,FontFamily:KC,FontSize:A8,FormatPainter:Hg,Fullscreen:fW,Heading:k8,Highlight:uU,History:hg,HorizontalRule:tW,Image:Wg,ImageUpload:cX,ImportWord:YG,Indent:YC,Italic:Jx,LineHeight:ZC,Link:dg,MoreMark:xG,OrderedList:vU,Preview:yX,Printer:OX,Proofreader:mE,SlashCommand:zG,SpellcheckerExtension:R5,Strike:Zx,SubAndSuperScript:vG,Table:Ng,TaskList:xU,TextAlign:T8,Underline:Yx,Video:T5,VideoUpload:vX},Symbol.toStringTag,{value:"Module"})),rY='<page id="ft6nbbxs" extend="false" pagenumber="1" force="false"><h1 id="tk6n64mj" extend="&quot;false&quot;"><strong>Introduction(English)</strong></h1><p id="s864ng1o" extend="&quot;false&quot;">MyMy Editor is open-source document editor based on Vue3 and Tiptap. MyMy Editor provides comprehensive document editing capabilities, supports pagination, supports Markdown syntax, offers basic rich text editing functions, allows for the insertion of various node types in multiple formats, provides a variety of practical tools, and supports setting page styles. It also supports exporting in various formats, printing and print preview, block-level document editing, adding custom extensions, multi-language settings, and a dark theme.</p><h1 id="jm9johtz" extend="&quot;false&quot;"><strong>소개(국문)</strong></h1><p id="0qei01hl" extend="&quot;false&quot;">마이마이 에디터는 Vue3과 Tiptap을 기반으로 한 오픈소스 문서 편집기입니다. 마이마이 에디터는 포괄적인 문서 편집 기능을 제공하며, 페이지네이션, 마크다운 구문 지원, 기본적인 리치 텍스트 편집 기능, 다양한 형식의 다양한 노드 유형 삽입, 다양한 실용적인 도구 제공, 페이지 스타일 설정 지원 등을 제공합니다. 또한 다양한 형식으로 내보내기, 인쇄 및 인쇄 미리보기, 블록 수준의 문서 편집, 사용자 지정 확장 추가, 다국어 설정 및 다크 테마를 지원합니다.마이마이 에디터는 Vue3과 Tiptap을 기반으로 한 오픈소스 문서 편집기입니다. 마이마이 에디터는 포괄적인 문서 편집 기능을 제공하며, 페이지네이션, 마크다운 구문 지원, 기본적인 리치 텍스트 편집 기능, 다양한 형식의 다양한 노드 유형 삽입, 다양한 실용적인 도구 제공, 페이지 스타일 설정 지원 등을 제공합니다. 또한 다양한 형식으로 내보내기, 인쇄 및 인쇄 미리보기, 블록 수준의 문서 편집, 사용자 지정 확장 추가, 다국어 설정 및 다크 테마를 지원합니다.</p><blockquote class="blockquote"><p id="nekf7yi0" extend="false"><span style="color: rgb(115, 209, 61)"><strong><em>Make by VDC</em></strong></span></p></blockquote></page>';function oY(){const t=window.localStorage.getItem("content"),e=i.ref(t||rY),n=i.computed(()=>[_5.configure({placeholder:{showOnlyCurrent:!0},characterCount:{limit:5e4},excludes:{}}),hg,jg,Hg,H1,dg,Wg,Ng]),r=Ze.useEventBus(Kn.RENDER_SUPER_TEXT);function o(s,a){const l={action:"status",payload:{id:s,status:a}};r.emit(l)}return{defaultExtensions:n,content:e,dispatchUpdateStatusSuperText:o}}const iY={class:"flex items-center h-[32px] hover:bg-ed-muted rounded-md"},sY={class:"text-sm flex items-center justify-center"},aY={width:"18px",height:"18px",viewBox:"0 0 256 256",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},lY={id:"icon/填充色",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},uY={id:"icon/背景颜色"},cY=["fill"],gE=i.defineComponent({__name:"HighlightActionButton",props:{editor:{},tooltip:{default:void 0},disabled:{type:Boolean,default:!1},action:{type:Function,default:void 0},isActive:{type:Function,default:void 0},tooltipOptions:{default:void 0}},setup(t){const e=t,n=i.ref(void 0),{state:r}=tr();function o(a){var l;(l=e.action)==null||l.call(e,a)}function s(a){var l;(l=e.action)==null||l.call(e,n.value)}return i.watchEffect(()=>{const{color:a}=e.editor.getAttributes("highlight");r.highlight=a}),(a,l)=>(i.openBlock(),i.createElementBlock("div",iY,[i.createVNode(je,{id:"highlight",tooltip:a.tooltip,disabled:a.disabled,action:s,"tooltip-options":a.tooltipOptions},{icon:i.withCtx(()=>[i.createElementVNode("span",sY,[(i.openBlock(),i.createElementBlock("svg",aY,[i.createElementVNode("g",lY,[i.createElementVNode("g",uY,[l[1]||(l[1]=i.createElementVNode("g",{id:"编组",fill:"currentColor"},[i.createElementVNode("g",{id:"矩形",transform:"translate(119.502295, 137.878331) rotate(-135.000000) translate(-119.502295, -137.878331) translate(48.002295, 31.757731)"},[i.createElementVNode("path",{d:"M100.946943,60.8084699 L43.7469427,60.8084699 C37.2852111,60.8084699 32.0469427,66.0467383 32.0469427,72.5084699 L32.0469427,118.70847 C32.0469427,125.170201 37.2852111,130.40847 43.7469427,130.40847 L100.946943,130.40847 C107.408674,130.40847 112.646943,125.170201 112.646943,118.70847 L112.646943,72.5084699 C112.646943,66.0467383 107.408674,60.8084699 100.946943,60.8084699 Z M93.646,79.808 L93.646,111.408 L51.046,111.408 L51.046,79.808 L93.646,79.808 Z","fill-rule":"nonzero"}),i.createElementVNode("path",{d:"M87.9366521,16.90916 L87.9194966,68.2000001 C87.9183543,69.4147389 86.9334998,70.399264 85.7187607,70.4 L56.9423078,70.4 C55.7272813,70.4 54.7423078,69.4150264 54.7423078,68.2 L54.7423078,39.4621057 C54.7423078,37.2523513 55.5736632,35.1234748 57.0711706,33.4985176 L76.4832996,12.4342613 C78.9534987,9.75382857 83.1289108,9.5834005 85.8093436,12.0535996 C87.1658473,13.303709 87.9372691,15.0644715 87.9366521,16.90916 Z","fill-rule":"evenodd"}),i.createElementVNode("path",{d:"M131.3,111.241199 L11.7,111.241199 C5.23826843,111.241199 0,116.479467 0,122.941199 L0,200.541199 C0,207.002931 5.23826843,212.241199 11.7,212.241199 L131.3,212.241199 C137.761732,212.241199 143,207.002931 143,200.541199 L143,122.941199 C143,116.479467 137.761732,111.241199 131.3,111.241199 Z M124,130.241 L124,193.241 L19,193.241 L19,130.241 L124,130.241 Z","fill-rule":"nonzero"})])],-1)),i.createElementVNode("path",{id:"矩形",d:"M51,218 L205,218 C211.075132,218 216,222.924868 216,229 C216,235.075132 211.075132,240 205,240 L51,240 C44.9248678,240 40,235.075132 40,229 C40,222.924868 44.9248678,218 51,218 Z",fill:n.value||"#FBDE28"},null,8,cY)])])]))])]),_:1},8,["tooltip","disabled","tooltip-options"]),i.createVNode(zx,{modelValue:n.value,"onUpdate:modelValue":l[0]||(l[0]=u=>n.value=u),highlight:"",disabled:a.disabled,onChange:o},{default:i.withCtx(()=>[i.createVNode(i.unref(er),{variant:"ghost",size:"icon",class:"w-3 h-[32px] rounded-l-none hover:bg-ed-muted-foreground/20",disabled:a.disabled},{default:i.withCtx(()=>[i.createVNode(i.unref(Kt),{class:"w-3 h-3 text-zinc-500",name:"MenuDown"})]),_:1},8,["disabled"])]),_:1},8,["modelValue","disabled"])]))}}),dY={class:"min-w-32 flex flex-row h-full items-center leading-none gap-0.5 p-2 w-full bg-ed-background rounded-lg shadow-sm border border-ed-border"},bE=i.defineComponent({__name:"TableBubbleMenu",props:{editor:{}},setup(t){const e=t,n=({editor:y})=>rf(y.view.state,"table"),{t:r}=St();function o(){e.editor.chain().focus().addColumnBefore().run()}function s(){e.editor.chain().focus().addColumnAfter().run()}function a(){e.editor.chain().focus().deleteColumn().run()}function l(){e.editor.chain().focus().addRowBefore().run()}function u(){e.editor.chain().focus().addRowAfter().run()}function c(){e.editor.chain().focus().deleteRow().run()}function f(){e.editor.chain().focus().mergeCells().run()}function h(){var y;(y=e.editor)==null||y.chain().focus().splitCell().run()}function m(){e.editor.chain().focus().deleteTable().run()}function g(y){e.editor.chain().focus().setTableCellBackground(y).run()}const b=()=>{var k;const{view:y,state:{selection:{from:w}}}=e.editor,x=y.domAtPos(w).node;if(!x)return new DOMRect(-1e3,-1e3,0,0);const _=x.nodeType===Node.TEXT_NODE?x.parentElement:x,S=(k=_==null?void 0:_.closest)==null?void 0:k.call(_,".tableWrapper");return S?S.getBoundingClientRect():new DOMRect(-1e3,-1e3,0,0)};return(y,w)=>(i.openBlock(),i.createBlock(i.unref(ff),{editor:y.editor,"plugin-key":"table","should-show":n,"update-delay":0,"tippy-options":{maxWidth:"auto",getReferenceClientRect:b}},{default:i.withCtx(()=>{var x,_,S,C,k,A,T,B,L;return[i.createElementVNode("div",dY,[i.createVNode(je,{icon:"TablerColumnInsertLeft",iconClass:"w-5 h-5",tooltip:i.unref(r)("editor.table.menu.insertColumnBefore"),action:o,"tooltip-options":{sideOffset:15},disabled:!((x=y.editor)!=null&&x.can().addColumnBefore())},null,8,["tooltip","disabled"]),i.createVNode(je,{icon:"TablerColumnInsertRight",tooltip:i.unref(r)("editor.table.menu.insertColumnAfter"),iconClass:"w-5 h-5",action:s,"tooltip-options":{sideOffset:15},disabled:!((_=y.editor)!=null&&_.can().addColumnAfter())},null,8,["tooltip","disabled"]),i.createVNode(je,{icon:"TablerColumnRemove",action:a,iconClass:"w-5 h-5",tooltip:i.unref(r)("editor.table.menu.deleteColumn"),"tooltip-options":{sideOffset:15},disabled:!((S=y.editor)!=null&&S.can().deleteColumn())},null,8,["tooltip","disabled"]),i.createVNode(i.unref(Ho),{orientation:"vertical",class:"mx-1 me-2 h-[16px]"}),i.createVNode(je,{icon:"TablerRowInsertTop",action:l,iconClass:"w-5 h-5",tooltip:i.unref(r)("editor.table.menu.insertRowAbove"),"tooltip-options":{sideOffset:15},disabled:!((C=y.editor)!=null&&C.can().addRowBefore())},null,8,["tooltip","disabled"]),i.createVNode(je,{icon:"TablerRowInsertBottom",action:u,iconClass:"w-5 h-5",tooltip:i.unref(r)("editor.table.menu.insertRowBelow"),"tooltip-options":{sideOffset:15},disabled:!((k=y.editor)!=null&&k.can().addRowAfter())},null,8,["tooltip","disabled"]),i.createVNode(je,{icon:"TablerRowRemove",action:c,iconClass:"w-5 h-5",tooltip:i.unref(r)("editor.table.menu.deleteRow"),"tooltip-options":{sideOffset:15},disabled:!((A=y.editor)!=null&&A.can().deleteRow())},null,8,["tooltip","disabled"]),i.createVNode(i.unref(Ho),{orientation:"vertical",class:"mx-1 me-2 h-[16px]"}),i.createVNode(je,{icon:"TableCellsMerge",action:f,iconClass:"w-5 h-5",tooltip:i.unref(r)("editor.table.menu.mergeCells"),"tooltip-options":{sideOffset:15},disabled:!((T=y.editor)!=null&&T.can().mergeCells())},null,8,["tooltip","disabled"]),i.createVNode(je,{icon:"TableCellsSplit",action:h,iconClass:"w-5 h-5",tooltip:i.unref(r)("editor.table.menu.splitCells"),"tooltip-options":{sideOffset:15},disabled:!((B=y.editor)!=null&&B.can().splitCell())},null,8,["tooltip","disabled"]),i.createVNode(i.unref(Ho),{orientation:"vertical",class:"mx-1 me-2 h-[16px]"}),i.createVNode(gE,{editor:y.editor,tooltip:i.unref(r)("editor.table.menu.setCellsBgColor"),action:g,"tooltip-options":{sideOffset:15}},null,8,["editor","tooltip"]),i.createVNode(je,{icon:"Trash2",tooltip:i.unref(r)("editor.table.menu.deleteTable"),iconClass:"w-5 h-5",action:m,"tooltip-options":{sideOffset:15},disabled:!((L=y.editor)!=null&&L.can().deleteTable())},null,8,["tooltip","disabled"])])]}),_:1},8,["editor","tippy-options"]))}}),fY={class:"p-2 bg-white border rounded-lg shadow-sm dark:bg-black border-neutral-200 dark:border-neutral-800"},pY={class:"flex items-center gap-1"},vE=i.defineComponent({__name:"ColumnsBubbleMenu",props:{editor:{},disabled:{type:Boolean,default:!1}},setup(t){const e=t,n=({editor:l})=>rf(l.view.state,"columns"),r=()=>{const l=Px(e.editor,"columns");return(l==null?void 0:l.getBoundingClientRect())||new DOMRect(-1e3,-1e3,0,0)},o=()=>{e.editor.chain().focus().setLayout(Zs.SidebarLeft).run()},s=()=>{e.editor.chain().focus().setLayout(Zs.SidebarRight).run()},a=()=>{e.editor.chain().focus().setLayout(Zs.TwoColumn).run()};return(l,u)=>(i.openBlock(),i.createBlock(i.unref(ff),{editor:l.editor,"plugin-key":"columns","should-show":n,"update-delay":0,"tippy-options":{offset:[0,8],popperOptions:{modifiers:[{name:"flip",enabled:!1}]},getReferenceClientRect:r,plugins:[i.unref(h$)],sticky:"popper"}},{default:i.withCtx(()=>[i.createElementVNode("div",fY,[i.createElementVNode("div",pY,[i.createVNode(je,{id:"panel-left",title:"ok",icon:"PanelLeft",tooltip:"tooltip",action:o,"is-active":()=>l.editor.isActive("columns",{layout:i.unref(Zs).SidebarLeft}),"tooltip-options":{sideOffset:15}},null,8,["is-active"]),i.createVNode(je,{id:"columns",title:"ok",icon:"Columns",tooltip:"tooltip",action:a,"is-active":()=>l.editor.isActive("columns",{layout:i.unref(Zs).TwoColumn}),"tooltip-options":{sideOffset:15}},null,8,["is-active"]),i.createVNode(je,{id:"panel-right",title:"ok",icon:"PanelRight",tooltip:"tooltip",action:s,"is-active":()=>l.editor.isActive("columns",{layout:i.unref(Zs).SidebarRight}),"tooltip-options":{sideOffset:15}},null,8,["is-active"])])])]),_:1},8,["editor","tippy-options"]))}}),hY={class:"flex items-center gap-2 p-2 bg-white border rounded-lg shadow-sm dark:bg-black border-neutral-200 dark:border-neutral-800"},mY=["href"],gY={class:"flex flex-nowrap"},bY=i.defineComponent({__name:"LinkViewBlock",props:{editor:{},link:{default:void 0}},emits:["clear","edit"],setup(t,{emit:e}){const{t:n}=St(),r=e;function o(){r("clear")}function s(){r("edit")}return(a,l)=>(i.openBlock(),i.createElementBlock("div",hY,[i.createElementVNode("a",{href:a.link,target:"_blank",rel:"noopener noreferrer",class:"text-sm underline break-all"},i.toDisplayString(i.unref(Et.truncate)(a.link,{length:50,omission:"…"})),9,mY),a.link?(i.openBlock(),i.createBlock(i.unref(Ho),{key:0,orientation:"vertical",class:"h-4"})):i.createCommentVNode("",!0),i.createElementVNode("div",gY,[i.createVNode(je,{icon:"Pencil",tooltip:i.unref(n)("editor.link.edit.tooltip"),action:s,"tooltip-options":{sideOffset:15}},null,8,["tooltip"]),i.createVNode(je,{icon:"Unlink",tooltip:i.unref(n)("editor.link.unlink.tooltip"),action:o,"tooltip-options":{sideOffset:15}},null,8,["tooltip"])])]))}}),yE=i.defineComponent({__name:"LinkBubbleMenu",props:{editor:{},disabled:{type:Boolean,default:!1}},setup(t){const e=t,n=i.ref(!1),r=i.computed(()=>{const{href:u}=e.editor.getAttributes("link");return u}),o=i.computed(()=>e.editor.isActive("link"));function s(u,c,f){e.editor.chain().extendMarkRange("link").insertContent({type:"text",text:c,marks:[{type:"link",attrs:{href:u,target:f?"_blank":""}}]}).setLink({href:u}).focus().run(),n.value=!1}function a(){e.editor.chain().extendMarkRange("link").unsetLink().focus().run(),n.value=!1}function l(){const{state:u,view:c}=e.editor,{tr:f,selection:h}=u,m=f.setSelection(Ie.create(u.doc,h.from));c.dispatch(m),n.value=!1}return(u,c)=>i.withDirectives((i.openBlock(),i.createBlock(i.unref(ff),{editor:u.editor,"update-delay":0,"tippy-options":{popperOptions:{modifiers:[{name:"flip",enabled:!1}]},appendTo:"parent",placement:"bottom-start",offset:[-2,16],zIndex:9999,onHidden:()=>{n.value=!1}}},{default:i.withCtx(()=>[n.value?(i.openBlock(),i.createBlock(N8,{key:0,editor:u.editor,onOnSetLink:s,onOnClickOutside:l},null,8,["editor"])):(i.openBlock(),i.createBlock(bY,{key:1,editor:u.editor,link:r.value,onClear:a,onEdit:c[0]||(c[0]=f=>n.value=!0)},null,8,["editor","link"]))]),_:1},8,["editor","tippy-options"])),[[i.vShow,o.value]])}}),Bo=(t,e,n)=>{if(typeof t=="string"&&n===Ye.PLAIN_TEXT)return t.replace(/\n/g,"<br>");if(!e||typeof t=="object")return t;const r=document.createElement("div");return r.innerHTML=t,r.querySelectorAll("p").forEach(o=>{const s=[];o.querySelectorAll("button.super-text").forEach(a=>{const l=a.getAttribute("data-text")||"",u=String(l).replace(/<\/p>\s*<p>/g,"<br/>").replace(/<\/?p>/g,""),c=document.createElement("p");c.innerHTML=`{${u}}`,c.setAttribute("class","text-red-500"),s.push(c),a.remove()}),s.forEach(a=>o.before(a)),o.innerHTML=o.innerHTML.trim()}),r.innerHTML},wE=i.defineComponent({__name:"Badge",props:{variant:{},class:{}},setup(t){const e=t;return(n,r)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(i.unref($e)(i.unref(vY)({variant:e.variant}),e.class))},[i.renderSlot(n.$slots,"default")],2))}}),vY=jm("inline-flex items-center rounded-full border px-2.5 py-0.5 font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-ed-primary text-ed-primary-foreground hover:bg-ed-primary/80",secondary:"border-transparent bg-ed-secondary text-ed-secondary-foreground hover:bg-ed-secondary/80",destructive:"border-transparent bg-ed-destructive text-ed-destructive-foreground hover:bg-ed-destructive/80",outline:"text-ed-foreground"}},defaultVariants:{variant:"default"}}),yY={id:"super-text-view-wrapper",class:"relative w-[32%]"},wY=["index","book-mark-id","line-id","onMouseover"],xY=["innerHTML"],CY=ri(i.defineComponent({__name:"SuperTextView",props:{editor:l1},setup(t){const e=t,n=Ze.useEventBus(Kn.RENDER_SUPER_TEXT),r=i.ref([]),o=i.ref([]),s=i.ref(!1),a=i.ref(!1),l=i.inject("isMobile",!1),u=i.ref(null),c=(T,B)=>{const L=o.value.findIndex(I=>I.id===T);L>-1&&(o.value[L].status=B)},f=()=>{const T=[];return document.querySelectorAll("#editor-container #editor-panel p[id]").forEach(L=>{const I=L.querySelectorAll("[node-id]");I.length>0&&T.push(I[I.length-1])}),T},h=T=>{const B=T.closest("#editor-container");if(!B)return;const L=B.getBoundingClientRect().top,I=B==null?void 0:B.scrollTop;return T.getBoundingClientRect().top-(L-I)},m=T=>T.replace(/<p><\/p>/g,"<p>&nbsp;</p>"),g=async()=>{await i.nextTick();const B=f().map(L=>{const I=L.getAttribute("node-id"),V=L.getAttribute("book-mark-content"),q=L.getAttribute("page-id"),K=L.getAttribute("page-number"),me=L.getBoundingClientRect(),z=L.getAttribute("line-id"),U=L.getAttribute("element-id");return{position:me,text:m(V),id:I,pageId:q,pageNumber:K,visiblePosition:h(L),status:0,lineId:z,elementId:U,textOriginal:m(V)}});o.value=B},b=T=>{const B=r.value.find(V=>V.getAttribute("line-id")===T.lineId);if(!B)return;const L=Number(B.getAttribute("index"));if(!T.text){B.querySelector(".super-text-lines").innerHTML=o.value[L].textOriginal,r.value.forEach(V=>V.classList.remove("hidden")),x();return}B.querySelector(".super-text-lines").innerHTML=m(T.text),B.classList.remove("super-text-truncate");const I=B.getBoundingClientRect();r.value.forEach((V,q)=>{if(q!==L){const K=V.getBoundingClientRect();w(I,K)&&V.classList.add("hidden")}})},y=T=>{switch(T.action){case"hover":b(T.payload);break;case"status":c(T.payload.id,T.payload.status);break;case"render":g();break;default:console.log("There is no action")}};i.onBeforeMount(()=>{n.on(y),window.addEventListener("resize",A)}),i.onBeforeUnmount(()=>{n.off(y),window.removeEventListener("resize",A)});const w=(T,B)=>{const L=T.bottom<=B.top,I=T.top>=B.bottom;return!(L||I)};async function x(){const T=r.value;!T||T.length===0||(T.sort((B,L)=>{const I=Number(B.getAttribute("index")),V=Number(L.getAttribute("index"));return I-V}),T.forEach(B=>B.classList.remove("super-text-truncate")),T.forEach((B,L)=>{const I=B.getBoundingClientRect();T.slice(L+1).forEach(V=>{const q=V.getBoundingClientRect();w(I,q)&&B.classList.add("super-text-truncate")})}))}i.watch(()=>o,async()=>{await i.nextTick(),x()},{deep:!0});const _=(T,B)=>{const L=T.currentTarget;L.classList.remove("super-text-truncate");const I=L.getBoundingClientRect();r.value.forEach((V,q)=>{if(q!==B){const K=V.getBoundingClientRect();w(I,K)&&V.classList.add("hidden")}})},S=()=>{r.value.forEach(T=>T.classList.remove("hidden")),x()},C=(T,B)=>{u.value={id:T.id,text:T.text,elementId:T.elementId,index:B},s.value=!0,l&&(a.value=!0)},k=T=>{if(!u.value)return;const B=u.value.index,L=u.value.id,{state:I,view:V}=e.editor,{tr:q}=I;let K=!1;I.doc.descendants((me,z)=>{var U;return((U=me.attrs)==null?void 0:U[ft.ID])===L?(q.setNodeMarkup(z,void 0,{...me.attrs,[ft.TEXT]:T}),K=!0,!1):!0}),K&&e.editor&&e.editor.view.dispatch(q),B!==-1&&(o.value[B].text=T,o.value[B].textOriginal=T),s.value=!1},A=()=>{f().forEach((B,L)=>{o.value[L]&&(o.value[L].visiblePosition=h(B))})};return(T,B)=>{const L=Kt;return i.openBlock(),i.createElementBlock("div",yY,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,(I,V)=>{var q;return i.openBlock(),i.createElementBlock("div",{key:I.id,ref_for:!0,ref_key:"superTextRefs",ref:r,index:V,"book-mark-id":I.id,"line-id":I.lineId,class:i.normalizeClass(i.unref($e)("super-text-view","absolute w-full px-2 translate-y-[-10px] group",{})),style:i.normalizeStyle({top:`${I.visiblePosition||((q=I.position)==null?void 0:q.top)}px`}),onMouseover:K=>_(K,V),onMouseleave:S},[i.createVNode(i.unref(wE),{role:"text",variant:"outline",class:i.normalizeClass(i.unref($e)("break-all w-full !font-normal px-1 pt-0 m-0 !leading-tight rounded-sm text-white border-transparent",I.elementId?"bg-black":"bg-red-500 cursor-pointer")),onDblclick:K=>C(I,V)},{default:i.withCtx(()=>[i.createElementVNode("div",{class:"super-text-lines",innerHTML:I.text},null,8,xY),i.createVNode(L,{name:"triangle",class:i.normalizeClass(["absolute top-1.5 rotate-90 w-3 h-3 right-0",I.elementId?"text-black":"text-red-500"])},null,8,["class"])]),_:2},1032,["class","onDblclick"])],46,wY)}),128)),!i.unref(l)&&u.value?(i.openBlock(),i.createBlock(ec,{key:0,open:s.value,editor:e.editor,"super-text-init":u.value.text,"super-text-id":u.value.id,"super-text-element-id":u.value.elementId,onClose:B[0]||(B[0]=I=>s.value=!1),onSave:k},null,8,["open","editor","super-text-init","super-text-id","super-text-element-id"])):i.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-c6051e12"]]),EY={id:"super-text-view-wrapper",class:"relative w-[32%]"},_Y=["index","book-mark-id","line-id","onMouseover"],SY=["innerHTML"],kY=ri(i.defineComponent({__name:"SuperTextViewComment",props:{editor:l1},setup(t){const e=t,n=Ze.useEventBus(Kn.RENDER_SUPER_TEXT),r=i.ref([]),o=i.ref([]),s=i.ref(!1),a=i.ref(!1),l=i.inject("isMobile",!1),u=i.ref(null),c=(T,B)=>{const L=o.value.findIndex(I=>I.id===T);L>-1&&(o.value[L].status=B)},f=()=>{const T=[];return document.querySelectorAll("#editor-container-comment #editor-panel p[id]").forEach(L=>{const I=L.querySelectorAll("[node-id]");I.length>0&&T.push(I[I.length-1])}),T},h=T=>{const B=T.closest("#editor-container-comment");if(!B)return;const L=B.getBoundingClientRect().top,I=B==null?void 0:B.scrollTop;return T.getBoundingClientRect().top-(L-I)},m=T=>T.replace(/<p><\/p>/g,"<p>&nbsp;</p>"),g=async()=>{await i.nextTick();const B=f().map(L=>{const I=L.getAttribute("node-id"),V=L.getAttribute("book-mark-content"),q=L.getAttribute("page-id"),K=L.getAttribute("page-number"),me=L.getBoundingClientRect(),z=L.getAttribute("line-id"),U=L.getAttribute("element-id");return{position:me,text:m(V),id:I,pageId:q,pageNumber:K,visiblePosition:h(L),status:0,lineId:z,elementId:U,textOriginal:m(V)}});o.value=B},b=T=>{const B=r.value.find(V=>V.getAttribute("line-id")===T.lineId);if(!B)return;const L=Number(B.getAttribute("index"));if(!T.text){B.querySelector(".super-text-lines").innerHTML=o.value[L].textOriginal,r.value.forEach(V=>V.classList.remove("hidden")),x();return}B.querySelector(".super-text-lines").innerHTML=m(T.text),B.classList.remove("super-text-truncate");const I=B.getBoundingClientRect();r.value.forEach((V,q)=>{if(q!==L){const K=V.getBoundingClientRect();w(I,K)&&V.classList.add("hidden")}})},y=T=>{switch(T.action){case"hover":b(T.payload);break;case"status":c(T.payload.id,T.payload.status);break;case"render":g();break;default:console.log("There is no action")}};i.onBeforeMount(()=>{n.on(y),window.addEventListener("resize",A)}),i.onBeforeUnmount(()=>{n.off(y),window.removeEventListener("resize",A)});const w=(T,B)=>{const L=T.bottom<=B.top,I=T.top>=B.bottom;return!(L||I)};async function x(){const T=r.value;!T||T.length===0||(T.sort((B,L)=>{const I=Number(B.getAttribute("index")),V=Number(L.getAttribute("index"));return I-V}),T.forEach(B=>B.classList.remove("super-text-truncate")),T.forEach((B,L)=>{const I=B.getBoundingClientRect();T.slice(L+1).forEach(V=>{const q=V.getBoundingClientRect();w(I,q)&&B.classList.add("super-text-truncate")})}))}i.watch(()=>o,async()=>{await i.nextTick(),x()},{deep:!0});const _=(T,B)=>{const L=T.currentTarget;L.classList.remove("super-text-truncate");const I=L.getBoundingClientRect();r.value.forEach((V,q)=>{if(q!==B){const K=V.getBoundingClientRect();w(I,K)&&V.classList.add("hidden")}})},S=()=>{r.value.forEach(T=>T.classList.remove("hidden")),x()},C=(T,B)=>{u.value={id:T.id,text:T.text,elementId:T.elementId,index:B},s.value=!0,l&&(a.value=!0)},k=T=>{if(!u.value)return;const B=u.value.index,L=u.value.id,{state:I,view:V}=e.editor,{tr:q}=I;let K=!1;I.doc.descendants((me,z)=>{var U;return((U=me.attrs)==null?void 0:U["data-id"])===L?(q.setNodeMarkup(z,void 0,{...me.attrs,"data-text":T}),K=!0,!1):!0}),K&&e.editor&&e.editor.view.dispatch(q),B!==-1&&(o.value[B].text=T,o.value[B].textOriginal=T),s.value=!1},A=()=>{f().forEach((B,L)=>{o.value[L]&&(o.value[L].visiblePosition=h(B))})};return(T,B)=>{const L=Kt;return i.openBlock(),i.createElementBlock("div",EY,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,(I,V)=>{var q;return i.openBlock(),i.createElementBlock("div",{key:I.id,ref_for:!0,ref_key:"superTextRefs",ref:r,index:V,"book-mark-id":I.id,"line-id":I.lineId,class:i.normalizeClass(i.unref($e)("super-text-view","absolute w-full px-2 translate-y-[-10px] group",{})),style:i.normalizeStyle({top:`${I.visiblePosition||((q=I.position)==null?void 0:q.top)}px`}),onMouseover:K=>_(K,V),onMouseleave:S},[i.createVNode(i.unref(wE),{role:"text",variant:"outline",class:i.normalizeClass(i.unref($e)("break-all w-full !font-normal px-1 pt-0 m-0 !leading-tight rounded-sm text-white border-transparent",I.elementId?"bg-black":"bg-red-500 cursor-pointer")),onDblclick:K=>C(I,V)},{default:i.withCtx(()=>[i.createElementVNode("div",{class:"super-text-lines",innerHTML:I.text},null,8,SY),i.createVNode(L,{name:"triangle",class:i.normalizeClass(["absolute top-1.5 rotate-90 w-3 h-3 right-0",I.elementId?"text-black":"text-red-500"])},null,8,["class"])]),_:2},1032,["class","onDblclick"])],46,_Y)}),128)),!i.unref(l)&&u.value?(i.openBlock(),i.createBlock(ec,{key:0,open:s.value,editor:e.editor,"super-text-init":u.value.text,"super-text-id":u.value.id,"super-text-element-id":u.value.elementId,onClose:B[0]||(B[0]=I=>s.value=!1),onSave:k},null,8,["open","editor","super-text-init","super-text-id","super-text-element-id"])):i.createCommentVNode("",!0)])}}}),[["__scopeId","data-v-0b7acf3e"]]),xE=t=>{t=t.replace(/\s*style="[^"]*"/g,"");const e=t.match(/<!--StartFragment-->([\s\S]*?)<!--EndFragment-->/),r=(e?e[1]:t).replace(/<br\s*\/?>/gi,`
259
- `).split(/\r?\n/),o=[];for(const s of r){const a=s.trim();if(a==="")o.push("<p></p>");else if(/^<br\s*\/?>/i.test(a)){const l=a.replace(/^<br\s*\/?>/i,"").trim();o.push(`<p>${l}</p>`)}else if(/^<\/BR>/i.test(a)){const l=a.replace(/^<\/BR>/i,"").trim();o.push(`<p>${l}</p>`)}else/^<(?!p\b)[^>]+>/i.test(a)?o.push(`<p>${a}</p>`):o.push(a)}return o.join("")},TY=tr(),bb=t=>{const e=i.computed(()=>TY.state.spellCheck);i.watch(()=>e.value,n=>{t.view.dispatch(t.state.tr.setMeta(so.IS_ACTIVE_SPELLCHECK,n))},{immediate:!0})},AY={id:"editor-container-comment",class:"flex flex-col"},OY={class:"flex flex-1"},MY={id:"editor-panel",class:"flex-1"},BY=i.defineComponent({__name:"EditorComment",props:{isMobile:{type:Boolean},superTextArea:{default:{view:!0,button:!0}},mode:{},modelValue:{default:""},comment:{},fontSizeDefault:{},fontFamilyDefault:{},isOpenSuperView:{type:Boolean,default:!0},output:{default:"html"},dark:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameContent:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean,default:!1},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:600},maxHeight:{default:void 0},height:{},extensions:{default:()=>[]},editorClass:{default:void 0},contentClass:{default:void 0},isCompare:{type:Boolean},autoHeight:{type:Boolean},autoResize:{type:Boolean}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=Ze.useEventBus(Kn.RENDER_SUPER_TEXT),a=i.useAttrs(),l=tr(),{state:u,isReady:c,editor:f,updateEditorState:h,superTextStore:m,checkSpellStore:g,setEditorContextMenuRef:b}=l,y=Ze.useDark(),w=new ol({enablePasteRules:!1,enableInputRules:!1,content:Bo(r.modelValue,r.disabled),editorProps:{handleKeyDown:Et.throttle((k,A)=>A.key==="Enter"&&a.enter&&!A.shiftKey?(o("enter"),!0):!1,Ki),transformPastedHTML:k=>xE(k),handlePaste:(k,A)=>{const T=A.clipboardData;if(!T)return!1;const B=r.mode,L=T.getData("text/plain")||"",I=Array.from(T.items).some(V=>V.type.startsWith("image/"));return(B===Ye.STRAIGHT||B===Ye.REPORT)&&I?(A.preventDefault(),!0):B===Ye.PLAIN_TEXT?(A.preventDefault(),k.dispatch(k.state.tr.insertText(L,k.state.selection.from)),!0):!1},clipboardTextParser:(k,A)=>{const T=k.split(/(?:\r\n?|\n)/),B=[];T.forEach(I=>{let V={type:"paragraph"};I.length>0&&(V.content=[{type:"text",text:I}]);let q=Nr.fromJSON(A.doc.type.schema,V);B.push(q)});const L=ue.fromArray(B);return xe.maxOpen(L)}},onCreate:({editor:k})=>{h(k)},onUpdate:Et.throttle(({editor:k})=>{c.value=!0;const A=_(k,r.output);o("update:modelValue",A),o("change",{editor:k,output:A}),h(k),x()},Ki),extensions:r.extensions,editable:!r.disabled,onFocus:()=>{b(S.value)}});function x(){s.emit({action:"render"})}function _(k,A){if(!k)return"";if(k.isEmpty)return A==="json"?{}:"";switch(A){case"html":return k.getHTML();case"json":return k.getJSON();case"text":return k.getText();default:return""}}i.watch(()=>r.dark,()=>Ze.useToggle(y)),i.watch(()=>g.languages,()=>{w.commands.checkSpelling()}),i.watch(()=>r.modelValue,k=>{if(!w||Et.isEqual(_(w,r.output),k))return;const{from:A,to:T}=w.state.selection;w.commands.setTextSelection({from:A,to:T}),x(),w.commands.setContent(Bo(k,r.disabled),!1)},{deep:!0}),i.watch(()=>r.disabled,k=>{var A;w==null||w.setEditable(!k),(A=w==null?void 0:w.commands)!=null&&A.setIsEnableSuggestion&&w.commands.setIsEnableSuggestion(!k)},{immediate:!0}),i.watch(()=>f.value,()=>{f.value&&f.value.on("selectionUpdate",({editor:k})=>{o("changed:selection",{editor:k})})}),i.onUnmounted(()=>w==null?void 0:w.destroy()),wf(bf.SAVE,()=>{localStorage.setItem("comment",_(w,"html"))});const S=i.ref(null);function C(k){k===Ye.REPORT&&b(S.value)}return i.onMounted(()=>{C(r.mode)}),i.watch(()=>r.mode,k=>{C(k)}),bb(w),e({editor:w}),(k,A)=>(i.openBlock(),i.createElementBlock("div",AY,[i.createElementVNode("div",OY,[i.withDirectives(i.createVNode(kY,{editor:i.unref(w),class:"mr-2.5 border border-[#999999] rounded-[3px] bg-[#F2F2F7]"},null,8,["editor"]),[[i.vShow,k.isOpenSuperView]]),i.createElementVNode("div",MY,[i.createVNode(zg,{ref_key:"selectContextMenuRef",ref:S,disabled:r.disabled,editor:i.unref(w),mode:k.mode,"super-text-store":i.unref(m)},{default:i.withCtx(()=>[i.createVNode(i.unref(Lu),{editor:i.unref(w),spellcheck:"true",class:"h-full break-all"},null,8,["editor"])]),_:1},8,["disabled","editor","mode","super-text-store"])])])]))}});function RY(t,e,n=!1,r=200){const{height:o}=Ze.useElementSize(t),s=i.ref(0),a=i.ref(0),l=i.ref(r),u=i.ref(0),c=async()=>{await i.nextTick();const f=o.value-8;e.value===Ye.REPORT?(s.value=f/3,a.value=n?"auto":f-s.value,l.value=r/3*2,u.value=r/3):(s.value=0,a.value=n?"auto":o.value)};return n||i.watch(()=>o.value,c),i.onMounted(()=>{c()}),{commentHeight:s,contentHeight:a,minHeight:l,minHeightComment:u}}const IY={class:"flex flex-1"},LY={id:"editor-panel",class:"flex-1"},Lp=i.defineComponent({__name:"CoreEditorV2",props:{isMobile:{type:Boolean},superTextArea:{default:{view:!0,button:!0}},mode:{},modelValue:{default:""},comment:{default:""},fontSizeDefault:{default:"14px"},fontFamilyDefault:{default:""},isOpenSuperView:{type:Boolean},output:{default:"html"},dark:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameContent:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean,default:!1},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:200},maxHeight:{default:void 0},height:{default:void 0},extensions:{default:()=>[]},editorClass:{default:void 0},contentClass:{default:void 0},isCompare:{type:Boolean},autoHeight:{type:Boolean,default:!1},autoResize:{type:Boolean}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=Ze.useEventBus(Kn.RENDER_SUPER_TEXT),a=Ze.useEventBus(Kn.INCREASE_DECREASE_FONTSIZE),l=i.useAttrs(),u=tr(),{state:c,isFullscreen:f,setEditor:h,isReady:m,page:g,editor:b,changePageOption:y,updateEditorState:w,viewSuperText:x,superTextStore:_,checkSpellStore:S,setEditorContextMenuRef:C}=u,k=Ze.useDark(),A=i.computed(()=>{const ge=[...c.extensions,...Et.differenceBy(r.extensions,c.extensions,"name")];return ge.some(J=>J.name==="video")||ge.push(T5.configure({upload:async J=>URL.createObjectURL(J)})),ge.map((J,re)=>{var ie;return((ie=J.configure)==null?void 0:ie.call(J,{sort:re}))||J})}),T=i.computed(()=>r.mode===Ye.EDITOR),B=i.ref(r.fontSizeDefault),L=i.ref(r.fontFamilyDefault);i.provide("fontSize",B),i.provide("fontFamily",L);const I=i.computed(()=>r.autoHeight?{height:"auto",minHeight:r.minHeight?xn(r.minHeight):void 0,maxHeight:r.maxHeight?xn(r.maxHeight):void 0,overflowY:"auto"}:T.value?{}:{fontFamily:L.value,fontSize:B.value});i.watch(()=>I.value,()=>{me()}),i.onMounted(()=>{me()});const V=ge=>{const W=parseInt(B.value||"16px"),J=ge?W+2:W-2;B.value=J+"px"};i.onBeforeMount(()=>{r.disabled||a.on(V)}),i.onBeforeUnmount(()=>{r.disabled||a.off(V)});const q=i.computed(()=>({...i.unref(f)?{height:"100%"}:{minHeight:r.minHeight?xn(r.minHeight):void 0,maxHeight:r.maxHeight?xn(r.maxHeight):void 0,height:r.height?xn(r.height):void 0},maxWidth:xn(r.maxWidth),width:r.maxWidth?"100%":void 0,margin:r.maxWidth?"0 auto":void 0})),K=new ol({enablePasteRules:!1,enableInputRules:!1,content:Bo(r.modelValue,r.disabled,r.mode),editorProps:{handleKeyDown:Et.throttle((ge,W)=>W.key==="Enter"&&l.enter&&!W.shiftKey?(o("enter"),!0):!1,Ki),transformPastedHTML:ge=>xE(ge),handlePaste:(ge,W)=>{const J=W.clipboardData;if(!J)return!1;const re=r.mode,ie=J.getData("text/plain")||"",fe=Array.from(J.items),Ee=fe.some(Y=>Y.type.startsWith("image/")),Oe=fe.some(Y=>Y.type.startsWith("video/"));return(re===Ye.STRAIGHT||re===Ye.REPORT)&&(Ee||Oe)?(W.preventDefault(),!0):Oe?(W.preventDefault(),U(["video"])&&fe.forEach(async Y=>{var D;if(!Y.type.startsWith("video/"))return;const we=Y.getAsFile();if(!we)return;const ze=K.extensionManager.extensions.find(ae=>ae.name==="video"),wt=(D=ze==null?void 0:ze.options)==null?void 0:D.upload,$=wt?await wt(we):URL.createObjectURL(we);K.commands.focus(),K.commands.setVideo({src:$})}),!0):re===Ye.PLAIN_TEXT?(W.preventDefault(),ge.dispatch(ge.state.tr.insertText(ie,ge.state.selection.from)),!0):!1},clipboardTextParser:(ge,W)=>{const J=ge.split(/(?:\r\n?|\n)/),re=[];J.forEach(fe=>{let Ee={type:"paragraph"};fe.length>0&&(Ee.content=[{type:"text",text:fe}]);let Oe=Nr.fromJSON(W.doc.type.schema,Ee);re.push(Oe)});const ie=ue.fromArray(re);return xe.maxOpen(ie)}},onCreate:({editor:ge})=>{w(ge)},onUpdate:Et.throttle(({editor:ge})=>{m.value=!0;const W=z(ge,r.output);o("update:modelValue",W),o("change",{editor:ge,output:W}),w(ge),me()},Ki),extensions:Et.uniqBy(Et.reverse(i.unref(A)),"name"),editable:!r.disabled,onFocus:()=>{C(Ge.value)}});function me(){s.emit({action:"render"})}function z(ge,W){if(!ge)return"";if(ge.isEmpty)return W==="json"?{}:"";if(r.mode===Ye.PLAIN_TEXT)return ge.getText({blockSeparator:`
259
+ `).split(/\r?\n/),o=[];for(const s of r){const a=s.trim();if(a==="")o.push("<p></p>");else if(/^<br\s*\/?>/i.test(a)){const l=a.replace(/^<br\s*\/?>/i,"").trim();o.push(`<p>${l}</p>`)}else if(/^<\/BR>/i.test(a)){const l=a.replace(/^<\/BR>/i,"").trim();o.push(`<p>${l}</p>`)}else/^<(?!p\b)[^>]+>/i.test(a)?o.push(`<p>${a}</p>`):o.push(a)}return o.join("")},TY=tr(),bb=t=>{const e=i.computed(()=>TY.state.spellCheck);i.watch(()=>e.value,n=>{t.view.dispatch(t.state.tr.setMeta(so.IS_ACTIVE_SPELLCHECK,n))},{immediate:!0})},AY={id:"editor-container-comment",class:"flex flex-col"},OY={class:"flex flex-1"},MY={id:"editor-panel",class:"flex-1"},BY=i.defineComponent({__name:"EditorComment",props:{isMobile:{type:Boolean},superTextArea:{default:{view:!0,button:!0}},mode:{},modelValue:{default:""},comment:{},fontSizeDefault:{},fontFamilyDefault:{},isOpenSuperView:{type:Boolean,default:!0},output:{default:"html"},dark:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameContent:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean,default:!1},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:600},maxHeight:{default:void 0},height:{},extensions:{default:()=>[]},editorClass:{default:void 0},contentClass:{default:void 0},isCompare:{type:Boolean},autoHeight:{type:Boolean},autoResize:{type:Boolean}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=Ze.useEventBus(Kn.RENDER_SUPER_TEXT),a=i.useAttrs(),l=tr(),{state:u,isReady:c,editor:f,updateEditorState:h,superTextStore:m,checkSpellStore:g,setEditorContextMenuRef:b}=l,y=Ze.useDark(),w=new ol({enablePasteRules:!1,enableInputRules:!1,content:Bo(r.modelValue,r.disabled),editorProps:{handleKeyDown:Et.throttle((k,A)=>A.key==="Enter"&&a.enter&&!A.shiftKey?(o("enter"),!0):!1,Ki),transformPastedHTML:k=>xE(k),handlePaste:(k,A)=>{const T=A.clipboardData;if(!T)return!1;const B=r.mode,L=T.getData("text/plain")||"",I=Array.from(T.items).some(V=>V.type.startsWith("image/"));return(B===Ye.STRAIGHT||B===Ye.REPORT)&&I?(A.preventDefault(),!0):B===Ye.PLAIN_TEXT?(A.preventDefault(),k.dispatch(k.state.tr.insertText(L,k.state.selection.from)),!0):!1},clipboardTextParser:(k,A)=>{const T=k.split(/(?:\r\n?|\n)/),B=[];T.forEach(I=>{let V={type:"paragraph"};I.length>0&&(V.content=[{type:"text",text:I}]);let q=Nr.fromJSON(A.doc.type.schema,V);B.push(q)});const L=ue.fromArray(B);return xe.maxOpen(L)}},onCreate:({editor:k})=>{h(k)},onUpdate:Et.throttle(({editor:k})=>{c.value=!0;const A=_(k,r.output);o("update:modelValue",A),o("change",{editor:k,output:A}),h(k),x()},Ki),extensions:r.extensions,editable:!r.disabled,onFocus:()=>{b(S.value)}});function x(){s.emit({action:"render"})}function _(k,A){if(!k)return"";if(k.isEmpty)return A==="json"?{}:"";switch(A){case"html":return k.getHTML();case"json":return k.getJSON();case"text":return k.getText();default:return""}}i.watch(()=>r.dark,()=>Ze.useToggle(y)),i.watch(()=>g.languages,()=>{w.commands.checkSpelling()}),i.watch(()=>r.modelValue,k=>{if(!w||Et.isEqual(_(w,r.output),k))return;const{from:A,to:T}=w.state.selection;w.commands.setTextSelection({from:A,to:T}),x(),w.commands.setContent(Bo(k,r.disabled),!1)},{deep:!0}),i.watch(()=>r.disabled,k=>{var A;w==null||w.setEditable(!k),(A=w==null?void 0:w.commands)!=null&&A.setIsEnableSuggestion&&w.commands.setIsEnableSuggestion(!k)},{immediate:!0}),i.watch(()=>f.value,()=>{f.value&&f.value.on("selectionUpdate",({editor:k})=>{o("changed:selection",{editor:k})})}),i.onUnmounted(()=>w==null?void 0:w.destroy()),wf(bf.SAVE,()=>{localStorage.setItem("comment",_(w,"html"))});const S=i.ref(null);function C(k){k===Ye.REPORT&&b(S.value)}return i.onMounted(()=>{C(r.mode)}),i.watch(()=>r.mode,k=>{C(k)}),bb(w),e({editor:w}),(k,A)=>(i.openBlock(),i.createElementBlock("div",AY,[i.createElementVNode("div",OY,[i.withDirectives(i.createVNode(kY,{editor:i.unref(w),class:"mr-2.5 border border-[#999999] rounded-[3px] bg-[#F2F2F7]"},null,8,["editor"]),[[i.vShow,k.isOpenSuperView]]),i.createElementVNode("div",MY,[i.createVNode(zg,{ref_key:"selectContextMenuRef",ref:S,disabled:r.disabled,editor:i.unref(w),mode:k.mode,"super-text-store":i.unref(m)},{default:i.withCtx(()=>[i.createVNode(i.unref(Lu),{editor:i.unref(w),spellcheck:"true",class:"h-full break-all"},null,8,["editor"])]),_:1},8,["disabled","editor","mode","super-text-store"])])])]))}});function RY(t,e,n=!1,r=200){const{height:o}=Ze.useElementSize(t),s=i.ref(0),a=i.ref(0),l=i.ref(r),u=i.ref(0),c=async()=>{await i.nextTick();const f=o.value-8;e.value===Ye.REPORT?(s.value=f/3,a.value=n?"auto":f-s.value,l.value=r/3*2,u.value=r/3):(s.value=0,a.value=n?"auto":o.value)};return n||i.watch(()=>o.value,c),i.onMounted(()=>{c()}),{commentHeight:s,contentHeight:a,minHeight:l,minHeightComment:u}}const IY={class:"flex flex-1"},LY={id:"editor-panel",class:"flex-1"},Lp=i.defineComponent({__name:"CoreEditorV2",props:{isMobile:{type:Boolean},superTextArea:{default:{view:!0,button:!0}},mode:{},modelValue:{default:""},comment:{default:""},fontSizeDefault:{default:"14px"},fontFamilyDefault:{default:""},isOpenSuperView:{type:Boolean},output:{default:"html"},dark:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameContent:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean,default:!1},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:200},maxHeight:{default:void 0},height:{default:void 0},extensions:{default:()=>[]},editorClass:{default:void 0},contentClass:{default:void 0},isCompare:{type:Boolean},autoHeight:{type:Boolean,default:!1},autoResize:{type:Boolean}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=Ze.useEventBus(Kn.RENDER_SUPER_TEXT),a=Ze.useEventBus(Kn.INCREASE_DECREASE_FONTSIZE),l=i.useAttrs(),u=tr(),{state:c,isFullscreen:f,setEditor:h,isReady:m,page:g,editor:b,changePageOption:y,updateEditorState:w,viewSuperText:x,superTextStore:_,checkSpellStore:S,setEditorContextMenuRef:C}=u,k=Ze.useDark(),A=i.computed(()=>{const ge=[...c.extensions,...Et.differenceBy(r.extensions,c.extensions,"name")];return ge.some(J=>J.name==="video")||ge.push(T5.configure({upload:async J=>URL.createObjectURL(J)})),ge.map((J,re)=>{var ie;return((ie=J.configure)==null?void 0:ie.call(J,{sort:re}))||J})}),T=i.computed(()=>r.mode===Ye.EDITOR),B=i.ref(r.fontSizeDefault),L=i.ref(r.fontFamilyDefault);i.provide("fontSize",B),i.provide("fontFamily",L);const I=i.computed(()=>r.autoHeight?{height:"auto",minHeight:r.minHeight?gn(r.minHeight):void 0,maxHeight:r.maxHeight?gn(r.maxHeight):void 0,overflowY:"auto"}:T.value?{}:{fontFamily:L.value,fontSize:B.value});i.watch(()=>I.value,()=>{me()}),i.onMounted(()=>{me()});const V=ge=>{const W=parseInt(B.value||"16px"),J=ge?W+2:W-2;B.value=J+"px"};i.onBeforeMount(()=>{r.disabled||a.on(V)}),i.onBeforeUnmount(()=>{r.disabled||a.off(V)});const q=i.computed(()=>({...i.unref(f)?{height:"100%"}:{minHeight:r.minHeight?gn(r.minHeight):void 0,maxHeight:r.maxHeight?gn(r.maxHeight):void 0,height:r.height?gn(r.height):void 0},maxWidth:gn(r.maxWidth),width:r.maxWidth?"100%":void 0,margin:r.maxWidth?"0 auto":void 0})),K=new ol({enablePasteRules:!1,enableInputRules:!1,content:Bo(r.modelValue,r.disabled,r.mode),editorProps:{handleKeyDown:Et.throttle((ge,W)=>W.key==="Enter"&&l.enter&&!W.shiftKey?(o("enter"),!0):!1,Ki),transformPastedHTML:ge=>xE(ge),handlePaste:(ge,W)=>{const J=W.clipboardData;if(!J)return!1;const re=r.mode,ie=J.getData("text/plain")||"",fe=Array.from(J.items),Ee=fe.some(Y=>Y.type.startsWith("image/")),Oe=fe.some(Y=>Y.type.startsWith("video/"));return(re===Ye.STRAIGHT||re===Ye.REPORT)&&(Ee||Oe)?(W.preventDefault(),!0):Oe?(W.preventDefault(),U(["video"])&&fe.forEach(async Y=>{var D;if(!Y.type.startsWith("video/"))return;const we=Y.getAsFile();if(!we)return;const ze=K.extensionManager.extensions.find(ae=>ae.name==="video"),wt=(D=ze==null?void 0:ze.options)==null?void 0:D.upload,$=wt?await wt(we):URL.createObjectURL(we);K.commands.focus(),K.commands.setVideo({src:$})}),!0):re===Ye.PLAIN_TEXT?(W.preventDefault(),ge.dispatch(ge.state.tr.insertText(ie,ge.state.selection.from)),!0):!1},clipboardTextParser:(ge,W)=>{const J=ge.split(/(?:\r\n?|\n)/),re=[];J.forEach(fe=>{let Ee={type:"paragraph"};fe.length>0&&(Ee.content=[{type:"text",text:fe}]);let Oe=Nr.fromJSON(W.doc.type.schema,Ee);re.push(Oe)});const ie=ue.fromArray(re);return xe.maxOpen(ie)}},onCreate:({editor:ge})=>{w(ge)},onUpdate:Et.throttle(({editor:ge})=>{m.value=!0;const W=z(ge,r.output);o("update:modelValue",W),o("change",{editor:ge,output:W}),w(ge),me()},Ki),extensions:Et.uniqBy(Et.reverse(i.unref(A)),"name"),editable:!r.disabled,onFocus:()=>{C(Ge.value)}});function me(){s.emit({action:"render"})}function z(ge,W){if(!ge)return"";if(ge.isEmpty)return W==="json"?{}:"";if(r.mode===Ye.PLAIN_TEXT)return ge.getText({blockSeparator:`
260
260
  `});switch(W){case"html":return ge.getHTML();case"json":return ge.getJSON();case"text":return ge.getText({blockSeparator:`
261
- `});default:return""}}function U(ge){return ge.every(W=>K==null?void 0:K.extensionManager.extensions.find(J=>J.name===W))}i.watch(()=>r.dark,()=>Ze.useToggle(k)),i.watch(()=>S.languages,()=>{K.commands.checkSpelling()}),i.watch(()=>r.modelValue,ge=>{if(!K||Et.isEqual(z(K,r.output),ge))return;const{from:W,to:J}=K.state.selection;K.commands.setTextSelection({from:W,to:J}),me(),K.commands.setContent(Bo(ge,r.disabled,r.mode),!1)},{deep:!0}),i.watch(()=>r.disabled,ge=>{var W;K==null||K.setEditable(!ge),(W=K==null?void 0:K.commands)!=null&&W.setIsEnableSuggestion&&K.commands.setIsEnableSuggestion(!ge)},{immediate:!0}),i.watch(()=>b.value,()=>{b.value&&b.value.on("selectionUpdate",({editor:ge})=>{o("changed:selection",{editor:ge})})}),i.onUnmounted(()=>K==null?void 0:K.destroy()),wf(bf.SAVE,()=>{localStorage.setItem("content",z(K,"html"))});const P=i.computed(()=>{var re;if(!((re=K==null?void 0:K.storage)!=null&&re.superText))return!1;const{enable:ge}=K.storage.superText,W=[Ye.EDITOR,Ye.PLAIN_TEXT].includes(r.mode),J=r.disabled;return ge&&!W&&!J}),G=i.ref(null),Z=i.computed(()=>r.mode),{commentHeight:oe,contentHeight:ne,minHeight:Ce,minHeightComment:_e}=RY(G,Z,r.autoHeight,typeof r.minHeight=="string"?parseInt(r.minHeight):r.minHeight),Ge=i.ref(null);function Me(ge){ge===Ye.STRAIGHT&&C(Ge.value)}return i.onMounted(()=>{Me(r.mode)}),i.watch(()=>r.mode,ge=>{Me(ge)}),e({editor:K}),(ge,W)=>{const J=yE,re=vE,ie=bE,fe=Dx,Ee=ZB;return i.unref(K)?(i.openBlock(),i.createElementBlock("div",{key:0,id:"vdc-editor",class:i.normalizeClass(["vdc-editor w-full flex flex-col",[ge.editorClass,{"outline-ed-primary":i.unref(K).isFocused,"outline-ed-border":!i.unref(K).isFocused}]]),style:i.normalizeStyle(q.value)},[!ge.hideBubble&&!ge.disabled&&i.unref(K).isEditable?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[U([i.unref(Vg)])?(i.openBlock(),i.createBlock(J,{key:0,editor:i.unref(K)},null,8,["editor"])):i.createCommentVNode("",!0),U([i.unref(Nu)])?(i.openBlock(),i.createBlock(re,{key:1,editor:i.unref(K)},null,8,["editor"])):i.createCommentVNode("",!0),U([i.unref(pl)])?(i.openBlock(),i.createBlock(ie,{key:2,editor:i.unref(K)},null,8,["editor"])):i.createCommentVNode("",!0),U([i.unref(hl),i.unref(ml)])?(i.openBlock(),i.createBlock(fe,{key:3,editor:i.unref(K)},null,8,["editor"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),ge.hideToolbar?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(Ee,{key:1,editor:i.unref(K),mode:ge.mode,disabled:ge.disabled,class:"mb-2"},null,8,["editor","mode","disabled"])),i.createElementVNode("div",{ref_key:"editorWrapRef",ref:G,class:i.normalizeClass(i.unref($e)("space-y-2 flex-1 flex flex-col break-keep",!T.value&&"[&_*]:!font-inherit [&_*]:!text-font-size-inherit",L.value&&!T.value&&"[&_*]:!font-inherit",B.value&&!T.value&&"[&_*]:!text-font-size-inherit")),style:i.normalizeStyle(I.value)},[ge.mode===i.unref(Ye).REPORT?(i.openBlock(),i.createBlock(BY,{key:0,mode:i.unref(Ye).REPORT,extensions:ge.extensions,"model-value":r.comment,disabled:r.disabled,"is-open-super-view":P.value,style:i.normalizeStyle(r.autoHeight?{height:"auto",minHeight:i.unref(xn)(i.unref(_e))}:{height:i.unref(xn)(i.unref(oe)),minHeight:i.unref(xn)(i.unref(Ce))}),class:"relative overflow-y-auto","onUpdate:modelValue":W[0]||(W[0]=Oe=>o("update:comment",Oe))},null,8,["mode","extensions","model-value","disabled","is-open-super-view","style"])):i.createCommentVNode("",!0),i.createElementVNode("div",{id:"editor-container",class:"relative overflow-y-auto flex flex-col",style:i.normalizeStyle(r.autoHeight?{height:"auto",minHeight:i.unref(xn)(i.unref(Ce))}:{height:i.unref(xn)(i.unref(ne))})},[i.createElementVNode("div",IY,[i.withDirectives(i.createVNode(CY,{editor:i.unref(K),class:"mr-2.5 border border-[#999999] rounded-[3px] bg-[#F2F2F7]"},null,8,["editor"]),[[i.vShow,P.value]]),i.createElementVNode("div",LY,[i.createVNode(zg,{ref_key:"selectContextMenuRef",ref:Ge,editor:i.unref(K),mode:ge.mode,disabled:r.disabled,"super-text-store":i.unref(_)},{default:i.withCtx(()=>[i.createVNode(i.unref(Lu),{editor:i.unref(K),spellcheck:"true",class:"h-full break-all"},null,8,["editor"])]),_:1},8,["editor","mode","disabled","super-text-store"])])])],4)],6)],6)):i.createCommentVNode("",!0)}}}),PY={class:"flex gap-2 items-center"},CE=ri(i.defineComponent({__name:"ToolbarFormat",props:{editor:{},disabled:{type:Boolean,default:!1},mode:{},activeExtensions:{default:()=>[]}},setup(t){const{t:e}=St(),n=t,r=["fontSize","fontFamily","superText","spellchecker",DC],o=i.computed(()=>{const l=[...n.editor.extensionManager.extensions];let u=[];for(const c of l){const{button:f,divider:h=!1,spacer:m=!1,toolbar:g=!0}=c.options;if(!f||!dm(f)||!g)continue;const b=f({editor:n.editor,extension:c,t:i.unref(e),isMobile:!0});if(Array.isArray(b)){const y=b.map((w,x)=>({id:`${c.name}`,button:w,divider:x===b.length-1?h:!1,spacer:x===0?m:!1}));u=[...u,...y];continue}u.push({button:b,divider:h,spacer:m,id:`${c.name}`})}return n.activeExtensions.length?u.filter(c=>c.id&&n.activeExtensions.includes(c.id)):(r.length&&(u=u.filter(c=>c.id&&!r.includes(c.id))),u)}),s=l=>l.id==="spellchecker"?"!text-ed-blue !bg-white !font-normal rounded [&>div>svg]:w-[19px] [&>div>svg]:h-[19px] h-[26px] gap-x-1 whitespace-nowrap":l.button.componentProps.customClass,a=l=>l.id==="spellchecker"?"Spellchecker":l.button.componentProps.icon;return(l,u)=>(i.openBlock(),i.createElementBlock("div",{id:"tool-bar-format",class:i.normalizeClass(i.unref($e)("z-10 bg-[#E0E0E0] rounded-[5px] px-2.5 py-[5px] leading-none overflow-x-auto overflow-y-hidden min-h-[48px]",i.unref(Kl)()&&"top-16",!o.value.length&&"hidden"))},[i.createElementVNode("div",PY,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,(c,f)=>{var h;return i.openBlock(),i.createBlock(i.resolveDynamicComponent(c.button.component),i.mergeProps({key:f,id:c.id,ref_for:!0},c.button.componentProps,{editor:l.editor,disabled:l.disabled||((h=c.button.componentProps)==null?void 0:h.disabled),"custom-class":s(c),icon:a(c)}),i.createSlots({_:2},[i.renderList(c.button.componentSlots,(m,g,b)=>({name:`${g}`,fn:i.withCtx(y=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(m),i.mergeProps({ref_for:!0},y==null?void 0:y.props,{id:c.id}),null,16,["id"]))])}))]),1040,["id","editor","disabled","custom-class","icon"])}),128))])],2))}}),[["__scopeId","data-v-d8f182ea"]]),DY={class:"flex gap-2 items-center overflow-x-auto"},FY=ri(i.defineComponent({__name:"ToolbarMobile",props:{editor:{},disabled:{type:Boolean,default:!1},mode:{},activeExtensions:{default:()=>[LC,PC,$g]}},setup(t){const{t:e}=St(),n=t,r=i.computed(()=>{const a=[...n.editor.extensionManager.extensions],l=a.find(f=>f.name===$g);let u=a.sort((f,h)=>f.name==="spellchecker"?-1:h.name==="spellchecker"||f.name==="superText"?1:h.name==="superText"?-1:0);l&&(u=a.sort((f,h)=>f.name==="configPlan"?1:h.name==="configPlan"?-1:0));let c=[];for(const f of u){const{button:h,divider:m=!1,spacer:g=!1,toolbar:b=!0}=f.options;if(!h||!dm(h)||!b)continue;const y=h({editor:n.editor,extension:f,t:i.unref(e),isMobile:!0});if(Array.isArray(y)){const w=y.map((x,_)=>({id:`${f.name}`,button:x,divider:_===y.length-1?m:!1,spacer:_===0?g:!1}));c=[...c,...w];continue}c.push({button:y,divider:m,spacer:g,id:`${f.name}`})}return n.activeExtensions.length?c.filter(f=>f.id&&n.activeExtensions.includes(f.id)):c}),o=a=>a.id==="spellchecker"?"!text-ed-blue bg-white !font-normal rounded [&>div>svg]:w-[19px] [&>div>svg]:h-[19px] h-[26px] gap-x-1 whitespace-nowrap":a.button.componentProps.customClass,s=a=>a.id==="spellchecker"?"Spellchecker":a.button.componentProps.icon;return(a,l)=>(i.openBlock(),i.createElementBlock("div",{id:"tool-bar",class:i.normalizeClass(i.unref($e)("z-10 bg-[#E0E0E0] rounded-[5px] px-2.5 py-[5px] leading-none",i.unref(Kl)()&&"top-16",!r.value.length&&"hidden"))},[i.createElementVNode("div",DY,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,(u,c)=>{var f;return i.openBlock(),i.createElementBlock(i.Fragment,{key:c},[u.spacer&&c!==0?(i.openBlock(),i.createBlock(i.unref(Ho),{key:0,orientation:"vertical",class:"h-[16px] mx-[10px]"})):i.createCommentVNode("",!0),(i.openBlock(),i.createBlock(i.resolveDynamicComponent(u.button.component),i.mergeProps({id:u.id,ref_for:!0},u.button.componentProps,{editor:a.editor,disabled:a.disabled||((f=u.button.componentProps)==null?void 0:f.disabled),"custom-class":o(u),icon:s(u)}),i.createSlots({_:2},[i.renderList(u.button.componentSlots,(h,m,g)=>({name:`${m}`,fn:i.withCtx(b=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(h),i.mergeProps({ref_for:!0},b==null?void 0:b.props,{id:u.id}),null,16,["id"]))])}))]),1040,["id","editor","disabled","custom-class","icon"])),u.divider?(i.openBlock(),i.createBlock(i.unref(Ho),{key:1,orientation:"vertical",class:"mx-2 h-auto"})):i.createCommentVNode("",!0)],64)}),128))])],2))}}),[["__scopeId","data-v-7448e31d"]]),VY={class:"bg-ed-blue px-1"},$Y={class:"bg-ed-blue px-1"},EE=ri(i.defineComponent({__name:"SelectContextMenuMobile",props:{editor:{},mode:{}},setup(t){var y;const e=t,{t:n}=St(),r=i.ref(!1),o=(y=e.editor.extensionManager.extensions.find(w=>w.name==="superText"))==null?void 0:y.options.specialCharModal,s=w=>{e.editor.chain().focus().insertContent(w).run()},a=async()=>{const{from:w,to:x}=e.editor.state.selection;if(w!==x){const _=e.editor.state.doc.textBetween(w,x,`
261
+ `});default:return""}}function U(ge){return ge.every(W=>K==null?void 0:K.extensionManager.extensions.find(J=>J.name===W))}i.watch(()=>r.dark,()=>Ze.useToggle(k)),i.watch(()=>S.languages,()=>{K.commands.checkSpelling()}),i.watch(()=>r.modelValue,ge=>{if(!K||Et.isEqual(z(K,r.output),ge))return;const{from:W,to:J}=K.state.selection;K.commands.setTextSelection({from:W,to:J}),me(),K.commands.setContent(Bo(ge,r.disabled,r.mode),!1)},{deep:!0}),i.watch(()=>r.disabled,ge=>{var W;K==null||K.setEditable(!ge),(W=K==null?void 0:K.commands)!=null&&W.setIsEnableSuggestion&&K.commands.setIsEnableSuggestion(!ge)},{immediate:!0}),i.watch(()=>b.value,()=>{b.value&&b.value.on("selectionUpdate",({editor:ge})=>{o("changed:selection",{editor:ge})})}),i.onUnmounted(()=>K==null?void 0:K.destroy()),wf(bf.SAVE,()=>{localStorage.setItem("content",z(K,"html"))});const P=i.computed(()=>{var re;if(!((re=K==null?void 0:K.storage)!=null&&re.superText))return!1;const{enable:ge}=K.storage.superText,W=[Ye.EDITOR,Ye.PLAIN_TEXT].includes(r.mode),J=r.disabled;return ge&&!W&&!J}),G=i.ref(null),Z=i.computed(()=>r.mode),{commentHeight:oe,contentHeight:ne,minHeight:Ce,minHeightComment:_e}=RY(G,Z,r.autoHeight,typeof r.minHeight=="string"?parseInt(r.minHeight):r.minHeight),Ge=i.ref(null);function Me(ge){ge===Ye.STRAIGHT&&C(Ge.value)}return i.onMounted(()=>{Me(r.mode)}),i.watch(()=>r.mode,ge=>{Me(ge)}),e({editor:K}),(ge,W)=>{const J=yE,re=vE,ie=bE,fe=Dx,Ee=ZB;return i.unref(K)?(i.openBlock(),i.createElementBlock("div",{key:0,id:"vdc-editor",class:i.normalizeClass(["vdc-editor w-full flex flex-col",[ge.editorClass,{"outline-ed-primary":i.unref(K).isFocused,"outline-ed-border":!i.unref(K).isFocused}]]),style:i.normalizeStyle(q.value)},[!ge.hideBubble&&!ge.disabled&&i.unref(K).isEditable?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[U([i.unref(Vg)])?(i.openBlock(),i.createBlock(J,{key:0,editor:i.unref(K)},null,8,["editor"])):i.createCommentVNode("",!0),U([i.unref(Nu)])?(i.openBlock(),i.createBlock(re,{key:1,editor:i.unref(K)},null,8,["editor"])):i.createCommentVNode("",!0),U([i.unref(pl)])?(i.openBlock(),i.createBlock(ie,{key:2,editor:i.unref(K)},null,8,["editor"])):i.createCommentVNode("",!0),U([i.unref(hl),i.unref(ml)])?(i.openBlock(),i.createBlock(fe,{key:3,editor:i.unref(K)},null,8,["editor"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),ge.hideToolbar?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(Ee,{key:1,editor:i.unref(K),mode:ge.mode,disabled:ge.disabled,class:"mb-2"},null,8,["editor","mode","disabled"])),i.createElementVNode("div",{ref_key:"editorWrapRef",ref:G,class:i.normalizeClass(i.unref($e)("space-y-2 flex-1 flex flex-col break-keep",!T.value&&"[&_*]:!font-inherit [&_*]:!text-font-size-inherit",L.value&&!T.value&&"[&_*]:!font-inherit",B.value&&!T.value&&"[&_*]:!text-font-size-inherit")),style:i.normalizeStyle(I.value)},[ge.mode===i.unref(Ye).REPORT?(i.openBlock(),i.createBlock(BY,{key:0,mode:i.unref(Ye).REPORT,extensions:ge.extensions,"model-value":r.comment,disabled:r.disabled,"is-open-super-view":P.value,style:i.normalizeStyle(r.autoHeight?{height:"auto",minHeight:i.unref(gn)(i.unref(_e))}:{height:i.unref(gn)(i.unref(oe)),minHeight:i.unref(gn)(i.unref(Ce))}),class:"relative overflow-y-auto","onUpdate:modelValue":W[0]||(W[0]=Oe=>o("update:comment",Oe))},null,8,["mode","extensions","model-value","disabled","is-open-super-view","style"])):i.createCommentVNode("",!0),i.createElementVNode("div",{id:"editor-container",class:"relative overflow-y-auto flex flex-col",style:i.normalizeStyle(r.autoHeight?{height:"auto",minHeight:i.unref(gn)(i.unref(Ce))}:{height:i.unref(gn)(i.unref(ne))})},[i.createElementVNode("div",IY,[i.withDirectives(i.createVNode(CY,{editor:i.unref(K),class:"mr-2.5 border border-[#999999] rounded-[3px] bg-[#F2F2F7]"},null,8,["editor"]),[[i.vShow,P.value]]),i.createElementVNode("div",LY,[i.createVNode(zg,{ref_key:"selectContextMenuRef",ref:Ge,editor:i.unref(K),mode:ge.mode,disabled:r.disabled,"super-text-store":i.unref(_)},{default:i.withCtx(()=>[i.createVNode(i.unref(Lu),{editor:i.unref(K),spellcheck:"true",class:"h-full break-all"},null,8,["editor"])]),_:1},8,["editor","mode","disabled","super-text-store"])])])],4)],6)],6)):i.createCommentVNode("",!0)}}}),PY={class:"flex gap-2 items-center"},CE=ri(i.defineComponent({__name:"ToolbarFormat",props:{editor:{},disabled:{type:Boolean,default:!1},mode:{},activeExtensions:{default:()=>[]}},setup(t){const{t:e}=St(),n=t,r=["fontSize","fontFamily","superText","spellchecker",DC],o=i.computed(()=>{const l=[...n.editor.extensionManager.extensions];let u=[];for(const c of l){const{button:f,divider:h=!1,spacer:m=!1,toolbar:g=!0}=c.options;if(!f||!dm(f)||!g)continue;const b=f({editor:n.editor,extension:c,t:i.unref(e),isMobile:!0});if(Array.isArray(b)){const y=b.map((w,x)=>({id:`${c.name}`,button:w,divider:x===b.length-1?h:!1,spacer:x===0?m:!1}));u=[...u,...y];continue}u.push({button:b,divider:h,spacer:m,id:`${c.name}`})}return n.activeExtensions.length?u.filter(c=>c.id&&n.activeExtensions.includes(c.id)):(r.length&&(u=u.filter(c=>c.id&&!r.includes(c.id))),u)}),s=l=>l.id==="spellchecker"?"!text-ed-blue !bg-white !font-normal rounded [&>div>svg]:w-[19px] [&>div>svg]:h-[19px] h-[26px] gap-x-1 whitespace-nowrap":l.button.componentProps.customClass,a=l=>l.id==="spellchecker"?"Spellchecker":l.button.componentProps.icon;return(l,u)=>(i.openBlock(),i.createElementBlock("div",{id:"tool-bar-format",class:i.normalizeClass(i.unref($e)("z-10 bg-[#E0E0E0] rounded-[5px] px-2.5 py-[5px] leading-none overflow-x-auto overflow-y-hidden min-h-[48px]",i.unref(Kl)()&&"top-16",!o.value.length&&"hidden"))},[i.createElementVNode("div",PY,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,(c,f)=>{var h;return i.openBlock(),i.createBlock(i.resolveDynamicComponent(c.button.component),i.mergeProps({key:f,id:c.id,ref_for:!0},c.button.componentProps,{editor:l.editor,disabled:l.disabled||((h=c.button.componentProps)==null?void 0:h.disabled),"custom-class":s(c),icon:a(c)}),i.createSlots({_:2},[i.renderList(c.button.componentSlots,(m,g,b)=>({name:`${g}`,fn:i.withCtx(y=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(m),i.mergeProps({ref_for:!0},y==null?void 0:y.props,{id:c.id}),null,16,["id"]))])}))]),1040,["id","editor","disabled","custom-class","icon"])}),128))])],2))}}),[["__scopeId","data-v-d8f182ea"]]),DY={class:"flex gap-2 items-center overflow-x-auto"},FY=ri(i.defineComponent({__name:"ToolbarMobile",props:{editor:{},disabled:{type:Boolean,default:!1},mode:{},activeExtensions:{default:()=>[LC,PC,$g]}},setup(t){const{t:e}=St(),n=t,r=i.computed(()=>{const a=[...n.editor.extensionManager.extensions],l=a.find(f=>f.name===$g);let u=a.sort((f,h)=>f.name==="spellchecker"?-1:h.name==="spellchecker"||f.name==="superText"?1:h.name==="superText"?-1:0);l&&(u=a.sort((f,h)=>f.name==="configPlan"?1:h.name==="configPlan"?-1:0));let c=[];for(const f of u){const{button:h,divider:m=!1,spacer:g=!1,toolbar:b=!0}=f.options;if(!h||!dm(h)||!b)continue;const y=h({editor:n.editor,extension:f,t:i.unref(e),isMobile:!0});if(Array.isArray(y)){const w=y.map((x,_)=>({id:`${f.name}`,button:x,divider:_===y.length-1?m:!1,spacer:_===0?g:!1}));c=[...c,...w];continue}c.push({button:y,divider:m,spacer:g,id:`${f.name}`})}return n.activeExtensions.length?c.filter(f=>f.id&&n.activeExtensions.includes(f.id)):c}),o=a=>a.id==="spellchecker"?"!text-ed-blue bg-white !font-normal rounded [&>div>svg]:w-[19px] [&>div>svg]:h-[19px] h-[26px] gap-x-1 whitespace-nowrap":a.button.componentProps.customClass,s=a=>a.id==="spellchecker"?"Spellchecker":a.button.componentProps.icon;return(a,l)=>(i.openBlock(),i.createElementBlock("div",{id:"tool-bar",class:i.normalizeClass(i.unref($e)("z-10 bg-[#E0E0E0] rounded-[5px] px-2.5 py-[5px] leading-none",i.unref(Kl)()&&"top-16",!r.value.length&&"hidden"))},[i.createElementVNode("div",DY,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,(u,c)=>{var f;return i.openBlock(),i.createElementBlock(i.Fragment,{key:c},[u.spacer&&c!==0?(i.openBlock(),i.createBlock(i.unref(Ho),{key:0,orientation:"vertical",class:"h-[16px] mx-[10px]"})):i.createCommentVNode("",!0),(i.openBlock(),i.createBlock(i.resolveDynamicComponent(u.button.component),i.mergeProps({id:u.id,ref_for:!0},u.button.componentProps,{editor:a.editor,disabled:a.disabled||((f=u.button.componentProps)==null?void 0:f.disabled),"custom-class":o(u),icon:s(u)}),i.createSlots({_:2},[i.renderList(u.button.componentSlots,(h,m,g)=>({name:`${m}`,fn:i.withCtx(b=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(h),i.mergeProps({ref_for:!0},b==null?void 0:b.props,{id:u.id}),null,16,["id"]))])}))]),1040,["id","editor","disabled","custom-class","icon"])),u.divider?(i.openBlock(),i.createBlock(i.unref(Ho),{key:1,orientation:"vertical",class:"mx-2 h-auto"})):i.createCommentVNode("",!0)],64)}),128))])],2))}}),[["__scopeId","data-v-7448e31d"]]),VY={class:"bg-ed-blue px-1"},$Y={class:"bg-ed-blue px-1"},EE=ri(i.defineComponent({__name:"SelectContextMenuMobile",props:{editor:{},mode:{}},setup(t){var y;const e=t,{t:n}=St(),r=i.ref(!1),o=(y=e.editor.extensionManager.extensions.find(w=>w.name==="superText"))==null?void 0:y.options.specialCharModal,s=w=>{e.editor.chain().focus().insertContent(w).run()},a=async()=>{const{from:w,to:x}=e.editor.state.selection;if(w!==x){const _=e.editor.state.doc.textBetween(w,x,`
262
262
  `);await navigator.clipboard.writeText(_),e.editor.chain().focus().deleteSelection().run()}},l=async()=>{const{from:w,to:x}=e.editor.state.selection;if(w!==x){const _=e.editor.state.doc.textBetween(w,x,`
263
- `);await navigator.clipboard.writeText(_)}},u=async()=>{try{const _=(await navigator.clipboard.readText()).split(/\n/).map(S=>S.trim()).map(S=>`<p>${S}</p>`).join("");e.editor.chain().focus().insertContent(_).run()}catch(w){console.warn("Clipboard paste failed:",w)}},c=()=>{e.editor.chain().focus().selectAll().run()},f=i.ref(!1),h=async()=>{try{const w=await navigator.clipboard.readText();f.value=!!w}catch{f.value=!1}},m=i.computed(()=>!1),g=i.computed(()=>[...e.editor.extensionManager.extensions].find(x=>x.name==="configPlan")),b=i.computed(()=>[...e.editor.extensionManager.extensions].find(x=>x.name==="superText"));return(w,x)=>{var A,T,B;const _=pp,S=fp,C=dp,k=cp;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(k,{"onUpdate:open":h},{default:i.withCtx(()=>[i.createVNode(_,{as:"template",disabled:i.unref(m)},{default:i.withCtx(()=>[i.renderSlot(w.$slots,"default",{},void 0,!0)]),_:3},8,["disabled"]),i.createVNode(C,{class:"flex bg-[#616161] text-white max-w-[310px] overflow-x-auto whitespace-nowrap"},{default:i.withCtx(()=>[i.unref(b)?(i.openBlock(),i.createBlock(S,{key:0,onClick:x[0]||(x[0]=L=>w.editor.commands.toggleSuperInputMoblie())},{default:i.withCtx(()=>[i.createElementVNode("span",VY,i.toDisplayString(i.unref(n)("editor.super")),1)]),_:1})):i.createCommentVNode("",!0),i.unref(g)?(i.openBlock(),i.createBlock(S,{key:1,onClick:x[1]||(x[1]=L=>w.editor.commands.toggleConfigPlanInput())},{default:i.withCtx(()=>[i.createElementVNode("span",$Y,i.toDisplayString(i.unref(n)("editor.configPlan")),1)]),_:1})):i.createCommentVNode("",!0),i.createVNode(S,{onClick:x[2]||(x[2]=L=>r.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("editor.insertSpecial")),1)]),_:1}),i.unref(f)?(i.openBlock(),i.createBlock(S,{key:2,onClick:u},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("editor.paste")),1)]),_:1})):i.createCommentVNode("",!0),i.createVNode(S,{onClick:a},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("editor.cut")),1)]),_:1}),i.createVNode(S,{onClick:l},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("editor.copy")),1)]),_:1}),i.createVNode(S,{onClick:c},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("editor.selectAll")),1)]),_:1})]),_:1})]),_:3}),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent((A=i.unref(o))==null?void 0:A.component),{"is-open":i.unref(r),open:i.unref(r),class:i.normalizeClass((B=(T=i.unref(o))==null?void 0:T.componentProps)==null?void 0:B.class),onSelectedChar:s,onClose:x[3]||(x[3]=L=>r.value=!1)},null,40,["is-open","open","class"]))]))],64)}}}),[["__scopeId","data-v-de936629"]]),zY={class:"text-red-500 relative -top-1"},_E=i.defineComponent({__name:"EditorFieldName",props:{fieldName:{},mode:{},disabled:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>e.disabled&&e.mode!==Ye.EDITOR?`[${e.fieldName.label}]`:e.fieldName.label);return(r,o)=>(i.openBlock(),i.createElementBlock("p",null,[i.createElementVNode("span",{class:i.normalizeClass(i.unref($e)("font-bold",r.mode!==i.unref(Ye).EDITOR&&"rounded-full border border-ed-blue text-ed-blue text-xs py-[2px] px-1 inline-block font-normal",r.disabled&&"border-transparent px-0"))},i.toDisplayString(i.unref(n)),3),i.withDirectives(i.createElementVNode("span",zY," •",512),[[i.vShow,r.fieldName.isRequired]])]))}}),HY=i.defineComponent({__name:"EditorCommentMoblie",props:{isMobile:{type:Boolean},superTextArea:{default:{view:!0,button:!0}},mode:{},modelValue:{default:""},comment:{},fontSizeDefault:{},fontFamilyDefault:{},isOpenSuperView:{type:Boolean,default:!0},output:{default:"html"},dark:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameContent:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean,default:!1},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:600},maxHeight:{default:void 0},height:{},extensions:{default:()=>[]},editorClass:{default:void 0},contentClass:{default:void 0},isCompare:{type:Boolean},autoHeight:{type:Boolean},autoResize:{type:Boolean}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected"],setup(t,{expose:e,emit:n}){const r=t,o=n,{t:s}=St(),a=Ze.useEventBus(Kn.RENDER_SUPER_TEXT),l=i.useAttrs(),u=tr(),{isReady:c,editor:f,updateEditorState:h,checkSpellStore:m}=u,g=Ze.useDark(),b=new ol({enablePasteRules:!1,enableInputRules:!1,content:Bo(r.modelValue,r.disabled),editorProps:{handleKeyDown:Et.throttle((C,k)=>k.key==="Enter"&&l.enter&&!k.shiftKey?(o("enter"),!0):!1,Ki),transformPastedHTML:C=>(C=C.replace(/\s*style="[^"]*"/g,""),C)},onCreate:({editor:C})=>{h(C)},onUpdate:Et.throttle(({editor:C})=>{c.value=!0;const k=_(C,r.output);o("update:modelValue",k),o("change",{editor:C,output:k}),h(C),x()},Ki),extensions:Et.uniqBy(Et.reverse(i.unref(r.extensions)),"name"),editable:!r.disabled,onFocus:()=>{w(),y.value=!0},onBlur:()=>y.value=!1}),y=i.ref(!1);function w(){o("setEditorSelected",b)}function x(){a.emit({action:"render"})}function _(C,k){if(!C)return"";if(C.isEmpty)return k==="json"?{}:"";switch(k){case"html":return C.getHTML();case"json":return C.getJSON();case"text":return C.getText();default:return""}}i.watch(()=>r.dark,()=>Ze.useToggle(g)),i.watch(()=>m.languages,()=>{b.commands.checkSpelling()}),i.watch(()=>r.modelValue,C=>{if(!b||Et.isEqual(_(b,r.output),C))return;const{from:k,to:A}=b.state.selection;b.commands.setTextSelection({from:k,to:A}),x(),b.commands.setContent(Bo(C,r.disabled),!1)},{deep:!0}),i.watch(()=>r.disabled,C=>{b==null||b.setEditable(!C)}),i.watch(()=>f.value,()=>{f.value&&f.value.on("selectionUpdate",({editor:C})=>{o("changed:selection",{editor:C})})}),i.onUnmounted(()=>b==null?void 0:b.destroy()),wf(bf.SAVE,()=>{localStorage.setItem("comment",_(b,"html"))});function S(C){b.commands.focus("end"),w()}return bb(b),i.onMounted(()=>{S(r.mode)}),i.watch(()=>r.mode,C=>{S()}),e({editor:b,isFocused:y}),(C,k)=>{var B;const A=_E,T=CE;return i.openBlock(),i.createElementBlock(i.Fragment,null,[(B=C.fieldNameComment)!=null&&B.label?(i.openBlock(),i.createBlock(A,{key:0,"field-name":C.fieldNameComment,mode:C.mode,disabled:C.disabled,class:"mb-1"},null,8,["field-name","mode","disabled"])):i.createCommentVNode("",!0),C.isShowFormatControlBar?(i.openBlock(),i.createBlock(T,{key:1,editor:i.unref(b),mode:C.mode,disabled:C.disabled,class:"mb-[3px]"},null,8,["editor","mode","disabled"])):i.createCommentVNode("",!0),i.createVNode(EE,{editor:i.unref(b),mode:C.mode},{default:i.withCtx(()=>[i.createVNode(i.unref(Lu),{editor:i.unref(b),spellcheck:"true",class:"flex-1 flex-col"},null,8,["editor"])]),_:1},8,["editor","mode"])],64)}}}),SE={__name:"splitpanes",props:{horizontal:{type:Boolean,default:!1},pushOtherPanes:{type:Boolean,default:!0},maximizePanes:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean,default:!1}},emits:["ready","resize","resized","pane-click","pane-maximize","pane-add","pane-remove","splitter-click","splitter-dblclick"],setup(t,{emit:e}){const n=e,r=t,o=i.useSlots(),s=i.ref([]),a=i.computed(()=>s.value.reduce((W,J)=>(W[~~J.id]=J)&&W,{})),l=i.computed(()=>s.value.length),u=i.ref(null),c=i.ref(!1),f=i.ref({mouseDown:!1,dragging:!1,activeSplitter:null,cursorOffset:0}),h=i.ref({splitter:null,timeoutId:null}),m=i.computed(()=>({[`splitpanes splitpanes--${r.horizontal?"horizontal":"vertical"}`]:!0,"splitpanes--dragging":f.value.dragging})),g=()=>{document.addEventListener("mousemove",w,{passive:!1}),document.addEventListener("mouseup",x),"ontouchstart"in window&&(document.addEventListener("touchmove",w,{passive:!1}),document.addEventListener("touchend",x))},b=()=>{document.removeEventListener("mousemove",w,{passive:!1}),document.removeEventListener("mouseup",x),"ontouchstart"in window&&(document.removeEventListener("touchmove",w,{passive:!1}),document.removeEventListener("touchend",x))},y=(W,J)=>{const re=W.target.closest(".splitpanes__splitter");if(re){const{left:ie,top:fe}=re.getBoundingClientRect(),{clientX:Ee,clientY:Oe}="ontouchstart"in window&&W.touches?W.touches[0]:W;f.value.cursorOffset=r.horizontal?Oe-fe:Ee-ie}g(),f.value.mouseDown=!0,f.value.activeSplitter=J},w=W=>{f.value.mouseDown&&(W.preventDefault(),f.value.dragging=!0,requestAnimationFrame(()=>{T(k(W)),Me("resize",{event:W},!0)}))},x=W=>{f.value.dragging&&(window.getSelection().removeAllRanges(),Me("resized",{event:W},!0)),f.value.mouseDown=!1,f.value.activeSplitter=null,setTimeout(()=>{f.value.dragging=!1,b()},100)},_=(W,J)=>{"ontouchstart"in window&&(W.preventDefault(),h.value.splitter===J?(clearTimeout(h.value.timeoutId),h.value.timeoutId=null,S(W,J),h.value.splitter=null):(h.value.splitter=J,h.value.timeoutId=setTimeout(()=>h.value.splitter=null,500))),f.value.dragging||Me("splitter-click",{event:W,index:J},!0)},S=(W,J)=>{if(Me("splitter-dblclick",{event:W,index:J},!0),r.maximizePanes){let re=0;s.value=s.value.map((ie,fe)=>(ie.size=fe===J?ie.max:ie.min,fe!==J&&(re+=ie.min),ie)),s.value[J].size-=re,Me("pane-maximize",{event:W,index:J,pane:s.value[J]}),Me("resized",{event:W,index:J},!0)}},C=(W,J)=>{Me("pane-click",{event:W,index:a.value[J].index,pane:a.value[J]})},k=W=>{const J=u.value.getBoundingClientRect(),{clientX:re,clientY:ie}="ontouchstart"in window&&W.touches?W.touches[0]:W;return{x:re-(r.horizontal?0:f.value.cursorOffset)-J.left,y:ie-(r.horizontal?f.value.cursorOffset:0)-J.top}},A=W=>{W=W[r.horizontal?"y":"x"];const J=u.value[r.horizontal?"clientHeight":"clientWidth"];return r.rtl&&!r.horizontal&&(W=J-W),W*100/J},T=W=>{const J=f.value.activeSplitter;let re={prevPanesSize:L(J),nextPanesSize:I(J),prevReachedMinPanes:0,nextReachedMinPanes:0};const ie=0+(r.pushOtherPanes?0:re.prevPanesSize),fe=100-(r.pushOtherPanes?0:re.nextPanesSize),Ee=Math.max(Math.min(A(W),fe),ie);let Oe=[J,J+1],Y=s.value[Oe[0]]||null,we=s.value[Oe[1]]||null;const ze=Y.max<100&&Ee>=Y.max+re.prevPanesSize,wt=we.max<100&&Ee<=100-(we.max+I(J+1));if(ze||wt){ze?(Y.size=Y.max,we.size=Math.max(100-Y.max-re.prevPanesSize-re.nextPanesSize,0)):(Y.size=Math.max(100-we.max-re.prevPanesSize-I(J+1),0),we.size=we.max);return}if(r.pushOtherPanes){const $=B(re,Ee);if(!$)return;({sums:re,panesToResize:Oe}=$),Y=s.value[Oe[0]]||null,we=s.value[Oe[1]]||null}Y!==null&&(Y.size=Math.min(Math.max(Ee-re.prevPanesSize-re.prevReachedMinPanes,Y.min),Y.max)),we!==null&&(we.size=Math.min(Math.max(100-Ee-re.nextPanesSize-re.nextReachedMinPanes,we.min),we.max))},B=(W,J)=>{const re=f.value.activeSplitter,ie=[re,re+1];return J<W.prevPanesSize+s.value[ie[0]].min&&(ie[0]=V(re).index,W.prevReachedMinPanes=0,ie[0]<re&&s.value.forEach((fe,Ee)=>{Ee>ie[0]&&Ee<=re&&(fe.size=fe.min,W.prevReachedMinPanes+=fe.min)}),W.prevPanesSize=L(ie[0]),ie[0]===void 0)?(W.prevReachedMinPanes=0,s.value[0].size=s.value[0].min,s.value.forEach((fe,Ee)=>{Ee>0&&Ee<=re&&(fe.size=fe.min,W.prevReachedMinPanes+=fe.min)}),s.value[ie[1]].size=100-W.prevReachedMinPanes-s.value[0].min-W.prevPanesSize-W.nextPanesSize,null):J>100-W.nextPanesSize-s.value[ie[1]].min&&(ie[1]=q(re).index,W.nextReachedMinPanes=0,ie[1]>re+1&&s.value.forEach((fe,Ee)=>{Ee>re&&Ee<ie[1]&&(fe.size=fe.min,W.nextReachedMinPanes+=fe.min)}),W.nextPanesSize=I(ie[1]-1),ie[1]===void 0)?(W.nextReachedMinPanes=0,s.value.forEach((fe,Ee)=>{Ee<l.value-1&&Ee>=re+1&&(fe.size=fe.min,W.nextReachedMinPanes+=fe.min)}),s.value[ie[0]].size=100-W.prevPanesSize-I(ie[0]-1),null):{sums:W,panesToResize:ie}},L=W=>s.value.reduce((J,re,ie)=>J+(ie<W?re.size:0),0),I=W=>s.value.reduce((J,re,ie)=>J+(ie>W+1?re.size:0),0),V=W=>[...s.value].reverse().find(J=>J.index<W&&J.size>J.min)||{},q=W=>s.value.find(J=>J.index>W+1&&J.size>J.min)||{},K=()=>{var W;const J=Array.from(((W=u.value)==null?void 0:W.children)||[]);for(const re of J){const ie=re.classList.contains("splitpanes__pane"),fe=re.classList.contains("splitpanes__splitter");!ie&&!fe&&(re.remove(),console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed."))}},me=(W,J,re=!1)=>{const ie=W-1,fe=document.createElement("div");fe.classList.add("splitpanes__splitter"),re||(fe.onmousedown=Ee=>y(Ee,ie),typeof window<"u"&&"ontouchstart"in window&&(fe.ontouchstart=Ee=>y(Ee,ie)),fe.onclick=Ee=>_(Ee,ie+1)),fe.ondblclick=Ee=>S(Ee,ie+1),J.parentNode.insertBefore(fe,J)},z=W=>{W.onmousedown=void 0,W.onclick=void 0,W.ondblclick=void 0,W.remove()},U=()=>{var W;const J=Array.from(((W=u.value)==null?void 0:W.children)||[]);for(const ie of J)ie.className.includes("splitpanes__splitter")&&z(ie);let re=0;for(const ie of J)ie.className.includes("splitpanes__pane")&&(!re&&r.firstSplitter?me(re,ie,!0):re&&me(re,ie),re++)},P=({uid:W,...J})=>{const re=a.value[W];for(const[ie,fe]of Object.entries(J))re[ie]=fe},G=W=>{var J;let re=-1;Array.from(((J=u.value)==null?void 0:J.children)||[]).some(ie=>(ie.className.includes("splitpanes__pane")&&re++,ie.isSameNode(W.el))),s.value.splice(re,0,{...W,index:re}),s.value.forEach((ie,fe)=>ie.index=fe),c.value&&i.nextTick(()=>{U(),oe({addedPane:s.value[re]}),Me("pane-add",{pane:s.value[re]})})},Z=W=>{const J=s.value.findIndex(ie=>ie.id===W);s.value[J].el=null;const re=s.value.splice(J,1)[0];s.value.forEach((ie,fe)=>ie.index=fe),i.nextTick(()=>{U(),Me("pane-remove",{pane:re}),oe({removedPane:{...re}})})},oe=(W={})=>{!W.addedPane&&!W.removedPane?Ce():s.value.some(J=>J.givenSize!==null||J.min||J.max<100)?_e(W):ne(),c.value&&Me("resized")},ne=()=>{const W=100/l.value;let J=0;const re=[],ie=[];for(const fe of s.value)fe.size=Math.max(Math.min(W,fe.max),fe.min),J-=fe.size,fe.size>=fe.max&&re.push(fe.id),fe.size<=fe.min&&ie.push(fe.id);J>.1&&Ge(J,re,ie)},Ce=()=>{let W=100;const J=[],re=[];let ie=0;for(const Ee of s.value)W-=Ee.size,Ee.givenSize!==null&&ie++,Ee.size>=Ee.max&&J.push(Ee.id),Ee.size<=Ee.min&&re.push(Ee.id);let fe=100;if(W>.1){for(const Ee of s.value)Ee.givenSize===null&&(Ee.size=Math.max(Math.min(W/(l.value-ie),Ee.max),Ee.min)),fe-=Ee.size;fe>.1&&Ge(fe,J,re)}},_e=({addedPane:W,removedPane:J}={})=>{let re=100/l.value,ie=0;const fe=[],Ee=[];((W==null?void 0:W.givenSize)??null)!==null&&(re=(100-W.givenSize)/(l.value-1));for(const Oe of s.value)ie-=Oe.size,Oe.size>=Oe.max&&fe.push(Oe.id),Oe.size<=Oe.min&&Ee.push(Oe.id);if(!(Math.abs(ie)<.1)){for(const Oe of s.value)(W==null?void 0:W.givenSize)!==null&&(W==null?void 0:W.id)===Oe.id||(Oe.size=Math.max(Math.min(re,Oe.max),Oe.min)),ie-=Oe.size,Oe.size>=Oe.max&&fe.push(Oe.id),Oe.size<=Oe.min&&Ee.push(Oe.id);ie>.1&&Ge(ie,fe,Ee)}},Ge=(W,J,re)=>{let ie;W>0?ie=W/(l.value-J.length):ie=W/(l.value-re.length),s.value.forEach((fe,Ee)=>{if(W>0&&!J.includes(fe.id)){const Oe=Math.max(Math.min(fe.size+ie,fe.max),fe.min),Y=Oe-fe.size;W-=Y,fe.size=Oe}else if(!re.includes(fe.id)){const Oe=Math.max(Math.min(fe.size+ie,fe.max),fe.min),Y=Oe-fe.size;W-=Y,fe.size=Oe}}),Math.abs(W)>.1&&i.nextTick(()=>{c.value&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})},Me=(W,J=void 0,re=!1)=>{const ie=(J==null?void 0:J.index)??f.value.activeSplitter??null;n(W,{...J,...ie!==null&&{index:ie},...re&&ie!==null&&{prevPane:s.value[ie-(r.firstSplitter?1:0)],nextPane:s.value[ie+(r.firstSplitter?0:1)]},panes:s.value.map(fe=>({min:fe.min,max:fe.max,size:fe.size}))})};i.watch(()=>r.firstSplitter,()=>U()),i.onMounted(()=>{K(),U(),oe(),Me("ready"),c.value=!0}),i.onBeforeUnmount(()=>c.value=!1);const ge=()=>{var W;return i.h("div",{ref:u,class:m.value},(W=o.default)==null?void 0:W.call(o))};return i.provide("panes",s),i.provide("indexedPanes",a),i.provide("horizontal",i.computed(()=>r.horizontal)),i.provide("requestUpdate",P),i.provide("onPaneAdd",G),i.provide("onPaneRemove",Z),i.provide("onPaneClick",C),(W,J)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(ge)))}},ac={__name:"pane",props:{size:{type:[Number,String]},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},setup(t){var e;const n=t,r=i.inject("requestUpdate"),o=i.inject("onPaneAdd"),s=i.inject("horizontal"),a=i.inject("onPaneRemove"),l=i.inject("onPaneClick"),u=(e=i.getCurrentInstance())==null?void 0:e.uid,c=i.inject("indexedPanes"),f=i.computed(()=>c.value[u]),h=i.ref(null),m=i.computed(()=>{const w=isNaN(n.size)||n.size===void 0?0:parseFloat(n.size);return Math.max(Math.min(w,b.value),g.value)}),g=i.computed(()=>{const w=parseFloat(n.minSize);return isNaN(w)?0:w}),b=i.computed(()=>{const w=parseFloat(n.maxSize);return isNaN(w)?100:w}),y=i.computed(()=>{var w;return`${s.value?"height":"width"}: ${(w=f.value)==null?void 0:w.size}%`});return i.watch(()=>m.value,w=>r({uid:u,size:w})),i.watch(()=>g.value,w=>r({uid:u,min:w})),i.watch(()=>b.value,w=>r({uid:u,max:w})),i.onMounted(()=>{o({id:u,el:h.value,min:g.value,max:b.value,givenSize:n.size===void 0?null:m.value,size:m.value})}),i.onBeforeUnmount(()=>a(u)),(w,x)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"paneEl",ref:h,class:"splitpanes__pane",onClick:x[0]||(x[0]=_=>i.unref(l)(_,w._.uid)),style:i.normalizeStyle(y.value)},[i.renderSlot(w.$slots,"default")],4))}},vb=i.defineComponent({__name:"ToolbarTitle",props:{titleBar:{},customClass:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("h3",{class:i.normalizeClass(i.unref($e)("rounded-[5px] px-2.5 py-[5px] min-h-[32px] flex items-center bg-[#E0E0E0]",[e.customClass],[e.titleBar.bgClass]))},i.toDisplayString(e.titleBar.title),3))}});function yb(){let e=null,n=!1;const r=i.ref(!1),o=i.ref(0),s=i.ref(0),a=i.ref(50),l=i.ref(50);let u=[];function c(x,_){n=!1,e=setTimeout(()=>{n=!0},200);const S=_.getBoundingClientRect();o.value=S.left+S.width/2,s.value=S.top+S.height/2}function f(x){clearTimeout(e),e=null,n||(r.value=!0),n=!1}function h(){const x=document.querySelectorAll(".splitpanes__splitter");u=Array.from(x),u.forEach(_=>{_.addEventListener("mousedown",S=>c(S,_)),_.addEventListener("mouseup",f),_.addEventListener("touchstart",S=>c(S,_)),_.addEventListener("touchend",f)})}function m(){u.forEach(x=>{x.removeEventListener("mouseup",f),x.removeEventListener("touchend",f),x.removeEventListener("mousedown",_=>c(_,x)),x.removeEventListener("touchstart",_=>c(_,x))}),u=[]}const g=i.ref([{name:"paneUp",selected:!1},{name:"paneMiddle",selected:!0},{name:"paneDown",selected:!1}]),b=i.ref({name:"paneMiddle",selected:!0});function y(x){b.value=x}async function w(x){y(x),r.value=!1,await i.nextTick(),x.name==="paneUp"?(a.value=0,l.value=100):x.name==="paneDown"?(a.value=100,l.value=0):(a.value=50,l.value=50)}return{showMenuSplitter:r,menuX:o,menuY:s,commentSize:a,contentSize:l,setupSplitterListeners:h,removeSplitterListeners:m,iconSplitters:g,iconSplitSelected:b,setSelectedIconSplit:y,clickIconSplitter:w}}const kE=i.defineComponent({__name:"ScreenSplitToastPopup",props:{menuX:{},menuY:{},iconSplitSelected:{}},emits:["on-change-split"],setup(t,{emit:e}){const{iconSplitters:n}=yb(),r=t,o=e,s=i.computed(()=>({top:`${r.menuY}px`,left:`${r.menuX}px`,transform:"translate(-50%, -50%)"}));return(a,l)=>(i.openBlock(),i.createElementBlock("div",{style:i.normalizeStyle(i.unref(s)),class:"fixed bg-[#424242]/40 text-white/40 rounded-[21px] w-[132px] h-[37px] flex items-center justify-center gap-6 [&>svg]:cursor-pointer"},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(n),u=>(i.openBlock(),i.createBlock(i.unref(Kt),{key:u.name,name:u.name,class:i.normalizeClass({"text-black/80":u.name===a.iconSplitSelected.name}),onClick:c=>o("on-change-split",u)},null,8,["name","class","onClick"]))),128))],4))}});function UY(t,e,n,r=!1,o=39){const{top:s,height:a}=Ze.useElementBounding(t),l=i.ref(0),u=f=>f-(e?0:o),c=async()=>{await i.nextTick(),a.value>0&&(l.value=u(a.value))};return n||(i.watch(()=>a.value,c),i.watch(()=>s.value,()=>{l.value=0})),i.onMounted(()=>{if(n){l.value=u(n);return}c(),r&&!n&&Ze.useIntervalFn(()=>{const{top:f}=Ze.useElementBounding(t);f.value!==s.value&&(l.value=0)},1e3)}),{wrapHeight:l}}const lc=i.defineComponent({__name:"CoreEditorMoblie",props:{isMobile:{type:Boolean},superTextArea:{default:{view:!0,button:!0}},mode:{},modelValue:{default:""},comment:{default:""},fontSizeDefault:{default:"12px"},fontFamilyDefault:{default:""},isOpenSuperView:{type:Boolean},output:{default:"html"},dark:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean,default:!1},titleBarComment:{default:null},titleBarContent:{default:null},fieldNameComment:{default:null},fieldNameContent:{default:null},isScreenSplit:{default:!1},isShowLineNumber:{type:Boolean,default:!1},hideMenubar:{type:Boolean},disableBubble:{type:Boolean,default:!1},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:200},maxHeight:{default:void 0},height:{default:void 0},extensions:{default:()=>[]},editorClass:{default:void 0},contentClass:{default:void 0},isCompare:{type:Boolean},autoHeight:{type:Boolean},autoResize:{type:Boolean,default:!1}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected"],setup(t,{expose:e,emit:n}){const r=t,o=n;i.provide("isMobile",!0);const{t:s}=St(),a=Ze.useEventBus(Kn.RENDER_SUPER_TEXT),l=Ze.useEventBus(Kn.INCREASE_DECREASE_FONTSIZE),u=i.useAttrs(),c=tr(),{state:f,isFullscreen:h,isReady:m,editor:g,updateEditorState:b,superTextStore:y,checkSpellStore:w,setImageAttachment:x}=c,_=Ze.useDark(),S=i.computed(()=>[...f.extensions,...Et.differenceBy(r.extensions,f.extensions,"name")].map((Y,we)=>Y.configure({sort:we}))),C=i.ref(r.fontSizeDefault),k=i.ref(r.fontFamilyDefault);i.provide("fontSize",C),i.provide("fontFamily",k);const A=i.computed(()=>({fontFamily:k.value,fontSize:C.value})),T=i.ref(),{wrapHeight:B}=UY(T,r.hideToolbar,r.height,r.autoResize);i.watch(()=>A.value,()=>{P()}),i.onMounted(()=>{P()});const L=Y=>{const we=parseInt(C.value||"12px"),ze=Y?we+2:we-2;C.value=ze+"px"};i.onBeforeMount(()=>{l.on(L)}),i.onBeforeUnmount(()=>{l.off(L)});const I=i.computed(()=>({...i.unref(h)?{height:"100%"}:{minHeight:r.minHeight?xn(r.minHeight):void 0,maxHeight:r.maxHeight?xn(r.maxHeight):void 0,height:r.height?xn(r.height):void 0},maxWidth:xn(r.maxWidth),width:r.maxWidth?"100%":void 0,margin:r.maxWidth?"0 auto":void 0})),V=new ol({enablePasteRules:!1,enableInputRules:!1,content:Bo(r.modelValue,r.disabled,r.mode),editorProps:{handleKeyDown:Et.throttle((Y,we)=>we.key==="Enter"&&u.enter&&!we.shiftKey?(o("enter"),!0):!1,Ki),transformPastedHTML:Y=>(Y=Y.replace(/\s*style="[^"]*"/g,""),Y),handlePaste(Y,we){var D;if(r.mode!==Ye.PLAIN_TEXT)return!1;we.preventDefault();const ze=((D=we.clipboardData)==null?void 0:D.getData("text/plain"))||"",{tr:wt,selection:$}=Y.state;return Y.dispatch(wt.insertText(ze,$.from)),!0}},onCreate:({editor:Y})=>{b(Y)},onUpdate:Et.throttle(({editor:Y})=>{m.value=!0;const we=G(Y,r.output);o("update:modelValue",we),o("change",{editor:Y,output:we}),b(Y),P(),me(Y)},Ki),extensions:Et.uniqBy(Et.reverse(i.unref(S)),"name"),editable:!r.disabled,onFocus:()=>{U(),q.value=!0},onBlur:()=>q.value=!1}),q=i.ref(!1),K=i.ref();function me(Y){const we=[];Y.state.doc.descendants(ze=>{ze.type.name==="image"&&we.push({id:ze.attrs.id,src:ze.attrs.src})}),x(we)}const z=i.ref();i.onMounted(()=>{z.value=V});function U(Y){z.value=Y??V}function P(){a.emit({action:"render"})}function G(Y,we){if(!Y)return"";if(Y.isEmpty)return we==="json"?{}:"";if(r.mode===Ye.PLAIN_TEXT)return Y.getText({blockSeparator:`
263
+ `);await navigator.clipboard.writeText(_)}},u=async()=>{try{const _=(await navigator.clipboard.readText()).split(/\n/).map(S=>S.trim()).map(S=>`<p>${S}</p>`).join("");e.editor.chain().focus().insertContent(_).run()}catch(w){console.warn("Clipboard paste failed:",w)}},c=()=>{e.editor.chain().focus().selectAll().run()},f=i.ref(!1),h=async()=>{try{const w=await navigator.clipboard.readText();f.value=!!w}catch{f.value=!1}},m=i.computed(()=>!1),g=i.computed(()=>[...e.editor.extensionManager.extensions].find(x=>x.name==="configPlan")),b=i.computed(()=>[...e.editor.extensionManager.extensions].find(x=>x.name==="superText"));return(w,x)=>{var A,T,B;const _=pp,S=fp,C=dp,k=cp;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(k,{"onUpdate:open":h},{default:i.withCtx(()=>[i.createVNode(_,{as:"template",disabled:i.unref(m)},{default:i.withCtx(()=>[i.renderSlot(w.$slots,"default",{},void 0,!0)]),_:3},8,["disabled"]),i.createVNode(C,{class:"flex bg-[#616161] text-white max-w-[310px] overflow-x-auto whitespace-nowrap"},{default:i.withCtx(()=>[i.unref(b)?(i.openBlock(),i.createBlock(S,{key:0,onClick:x[0]||(x[0]=L=>w.editor.commands.toggleSuperInputMoblie())},{default:i.withCtx(()=>[i.createElementVNode("span",VY,i.toDisplayString(i.unref(n)("editor.super")),1)]),_:1})):i.createCommentVNode("",!0),i.unref(g)?(i.openBlock(),i.createBlock(S,{key:1,onClick:x[1]||(x[1]=L=>w.editor.commands.toggleConfigPlanInput())},{default:i.withCtx(()=>[i.createElementVNode("span",$Y,i.toDisplayString(i.unref(n)("editor.configPlan")),1)]),_:1})):i.createCommentVNode("",!0),i.createVNode(S,{onClick:x[2]||(x[2]=L=>r.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("editor.insertSpecial")),1)]),_:1}),i.unref(f)?(i.openBlock(),i.createBlock(S,{key:2,onClick:u},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("editor.paste")),1)]),_:1})):i.createCommentVNode("",!0),i.createVNode(S,{onClick:a},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("editor.cut")),1)]),_:1}),i.createVNode(S,{onClick:l},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("editor.copy")),1)]),_:1}),i.createVNode(S,{onClick:c},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(i.unref(n)("editor.selectAll")),1)]),_:1})]),_:1})]),_:3}),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent((A=i.unref(o))==null?void 0:A.component),{"is-open":i.unref(r),open:i.unref(r),class:i.normalizeClass((B=(T=i.unref(o))==null?void 0:T.componentProps)==null?void 0:B.class),onSelectedChar:s,onClose:x[3]||(x[3]=L=>r.value=!1)},null,40,["is-open","open","class"]))]))],64)}}}),[["__scopeId","data-v-de936629"]]),zY={class:"text-red-500 relative -top-1"},_E=i.defineComponent({__name:"EditorFieldName",props:{fieldName:{},mode:{},disabled:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>e.disabled&&e.mode!==Ye.EDITOR?`[${e.fieldName.label}]`:e.fieldName.label);return(r,o)=>(i.openBlock(),i.createElementBlock("p",null,[i.createElementVNode("span",{class:i.normalizeClass(i.unref($e)("font-bold",r.mode!==i.unref(Ye).EDITOR&&"rounded-full border border-ed-blue text-ed-blue text-xs py-[2px] px-1 inline-block font-normal",r.disabled&&"border-transparent px-0"))},i.toDisplayString(i.unref(n)),3),i.withDirectives(i.createElementVNode("span",zY," •",512),[[i.vShow,r.fieldName.isRequired]])]))}}),HY=i.defineComponent({__name:"EditorCommentMoblie",props:{isMobile:{type:Boolean},superTextArea:{default:{view:!0,button:!0}},mode:{},modelValue:{default:""},comment:{},fontSizeDefault:{},fontFamilyDefault:{},isOpenSuperView:{type:Boolean,default:!0},output:{default:"html"},dark:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameContent:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean,default:!1},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:600},maxHeight:{default:void 0},height:{},extensions:{default:()=>[]},editorClass:{default:void 0},contentClass:{default:void 0},isCompare:{type:Boolean},autoHeight:{type:Boolean},autoResize:{type:Boolean}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected"],setup(t,{expose:e,emit:n}){const r=t,o=n,{t:s}=St(),a=Ze.useEventBus(Kn.RENDER_SUPER_TEXT),l=i.useAttrs(),u=tr(),{isReady:c,editor:f,updateEditorState:h,checkSpellStore:m}=u,g=Ze.useDark(),b=new ol({enablePasteRules:!1,enableInputRules:!1,content:Bo(r.modelValue,r.disabled),editorProps:{handleKeyDown:Et.throttle((C,k)=>k.key==="Enter"&&l.enter&&!k.shiftKey?(o("enter"),!0):!1,Ki),transformPastedHTML:C=>(C=C.replace(/\s*style="[^"]*"/g,""),C)},onCreate:({editor:C})=>{h(C)},onUpdate:Et.throttle(({editor:C})=>{c.value=!0;const k=_(C,r.output);o("update:modelValue",k),o("change",{editor:C,output:k}),h(C),x()},Ki),extensions:Et.uniqBy(Et.reverse(i.unref(r.extensions)),"name"),editable:!r.disabled,onFocus:()=>{w(),y.value=!0},onBlur:()=>y.value=!1}),y=i.ref(!1);function w(){o("setEditorSelected",b)}function x(){a.emit({action:"render"})}function _(C,k){if(!C)return"";if(C.isEmpty)return k==="json"?{}:"";switch(k){case"html":return C.getHTML();case"json":return C.getJSON();case"text":return C.getText();default:return""}}i.watch(()=>r.dark,()=>Ze.useToggle(g)),i.watch(()=>m.languages,()=>{b.commands.checkSpelling()}),i.watch(()=>r.modelValue,C=>{if(!b||Et.isEqual(_(b,r.output),C))return;const{from:k,to:A}=b.state.selection;b.commands.setTextSelection({from:k,to:A}),x(),b.commands.setContent(Bo(C,r.disabled),!1)},{deep:!0}),i.watch(()=>r.disabled,C=>{b==null||b.setEditable(!C)}),i.watch(()=>f.value,()=>{f.value&&f.value.on("selectionUpdate",({editor:C})=>{o("changed:selection",{editor:C})})}),i.onUnmounted(()=>b==null?void 0:b.destroy()),wf(bf.SAVE,()=>{localStorage.setItem("comment",_(b,"html"))});function S(C){b.commands.focus("end"),w()}return bb(b),i.onMounted(()=>{S(r.mode)}),i.watch(()=>r.mode,C=>{S()}),e({editor:b,isFocused:y}),(C,k)=>{var B;const A=_E,T=CE;return i.openBlock(),i.createElementBlock(i.Fragment,null,[(B=C.fieldNameComment)!=null&&B.label?(i.openBlock(),i.createBlock(A,{key:0,"field-name":C.fieldNameComment,mode:C.mode,disabled:C.disabled,class:"mb-1"},null,8,["field-name","mode","disabled"])):i.createCommentVNode("",!0),C.isShowFormatControlBar?(i.openBlock(),i.createBlock(T,{key:1,editor:i.unref(b),mode:C.mode,disabled:C.disabled,class:"mb-[3px]"},null,8,["editor","mode","disabled"])):i.createCommentVNode("",!0),i.createVNode(EE,{editor:i.unref(b),mode:C.mode},{default:i.withCtx(()=>[i.createVNode(i.unref(Lu),{editor:i.unref(b),spellcheck:"true",class:"flex-1 flex-col"},null,8,["editor"])]),_:1},8,["editor","mode"])],64)}}}),SE={__name:"splitpanes",props:{horizontal:{type:Boolean,default:!1},pushOtherPanes:{type:Boolean,default:!0},maximizePanes:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean,default:!1}},emits:["ready","resize","resized","pane-click","pane-maximize","pane-add","pane-remove","splitter-click","splitter-dblclick"],setup(t,{emit:e}){const n=e,r=t,o=i.useSlots(),s=i.ref([]),a=i.computed(()=>s.value.reduce((W,J)=>(W[~~J.id]=J)&&W,{})),l=i.computed(()=>s.value.length),u=i.ref(null),c=i.ref(!1),f=i.ref({mouseDown:!1,dragging:!1,activeSplitter:null,cursorOffset:0}),h=i.ref({splitter:null,timeoutId:null}),m=i.computed(()=>({[`splitpanes splitpanes--${r.horizontal?"horizontal":"vertical"}`]:!0,"splitpanes--dragging":f.value.dragging})),g=()=>{document.addEventListener("mousemove",w,{passive:!1}),document.addEventListener("mouseup",x),"ontouchstart"in window&&(document.addEventListener("touchmove",w,{passive:!1}),document.addEventListener("touchend",x))},b=()=>{document.removeEventListener("mousemove",w,{passive:!1}),document.removeEventListener("mouseup",x),"ontouchstart"in window&&(document.removeEventListener("touchmove",w,{passive:!1}),document.removeEventListener("touchend",x))},y=(W,J)=>{const re=W.target.closest(".splitpanes__splitter");if(re){const{left:ie,top:fe}=re.getBoundingClientRect(),{clientX:Ee,clientY:Oe}="ontouchstart"in window&&W.touches?W.touches[0]:W;f.value.cursorOffset=r.horizontal?Oe-fe:Ee-ie}g(),f.value.mouseDown=!0,f.value.activeSplitter=J},w=W=>{f.value.mouseDown&&(W.preventDefault(),f.value.dragging=!0,requestAnimationFrame(()=>{T(k(W)),Me("resize",{event:W},!0)}))},x=W=>{f.value.dragging&&(window.getSelection().removeAllRanges(),Me("resized",{event:W},!0)),f.value.mouseDown=!1,f.value.activeSplitter=null,setTimeout(()=>{f.value.dragging=!1,b()},100)},_=(W,J)=>{"ontouchstart"in window&&(W.preventDefault(),h.value.splitter===J?(clearTimeout(h.value.timeoutId),h.value.timeoutId=null,S(W,J),h.value.splitter=null):(h.value.splitter=J,h.value.timeoutId=setTimeout(()=>h.value.splitter=null,500))),f.value.dragging||Me("splitter-click",{event:W,index:J},!0)},S=(W,J)=>{if(Me("splitter-dblclick",{event:W,index:J},!0),r.maximizePanes){let re=0;s.value=s.value.map((ie,fe)=>(ie.size=fe===J?ie.max:ie.min,fe!==J&&(re+=ie.min),ie)),s.value[J].size-=re,Me("pane-maximize",{event:W,index:J,pane:s.value[J]}),Me("resized",{event:W,index:J},!0)}},C=(W,J)=>{Me("pane-click",{event:W,index:a.value[J].index,pane:a.value[J]})},k=W=>{const J=u.value.getBoundingClientRect(),{clientX:re,clientY:ie}="ontouchstart"in window&&W.touches?W.touches[0]:W;return{x:re-(r.horizontal?0:f.value.cursorOffset)-J.left,y:ie-(r.horizontal?f.value.cursorOffset:0)-J.top}},A=W=>{W=W[r.horizontal?"y":"x"];const J=u.value[r.horizontal?"clientHeight":"clientWidth"];return r.rtl&&!r.horizontal&&(W=J-W),W*100/J},T=W=>{const J=f.value.activeSplitter;let re={prevPanesSize:L(J),nextPanesSize:I(J),prevReachedMinPanes:0,nextReachedMinPanes:0};const ie=0+(r.pushOtherPanes?0:re.prevPanesSize),fe=100-(r.pushOtherPanes?0:re.nextPanesSize),Ee=Math.max(Math.min(A(W),fe),ie);let Oe=[J,J+1],Y=s.value[Oe[0]]||null,we=s.value[Oe[1]]||null;const ze=Y.max<100&&Ee>=Y.max+re.prevPanesSize,wt=we.max<100&&Ee<=100-(we.max+I(J+1));if(ze||wt){ze?(Y.size=Y.max,we.size=Math.max(100-Y.max-re.prevPanesSize-re.nextPanesSize,0)):(Y.size=Math.max(100-we.max-re.prevPanesSize-I(J+1),0),we.size=we.max);return}if(r.pushOtherPanes){const $=B(re,Ee);if(!$)return;({sums:re,panesToResize:Oe}=$),Y=s.value[Oe[0]]||null,we=s.value[Oe[1]]||null}Y!==null&&(Y.size=Math.min(Math.max(Ee-re.prevPanesSize-re.prevReachedMinPanes,Y.min),Y.max)),we!==null&&(we.size=Math.min(Math.max(100-Ee-re.nextPanesSize-re.nextReachedMinPanes,we.min),we.max))},B=(W,J)=>{const re=f.value.activeSplitter,ie=[re,re+1];return J<W.prevPanesSize+s.value[ie[0]].min&&(ie[0]=V(re).index,W.prevReachedMinPanes=0,ie[0]<re&&s.value.forEach((fe,Ee)=>{Ee>ie[0]&&Ee<=re&&(fe.size=fe.min,W.prevReachedMinPanes+=fe.min)}),W.prevPanesSize=L(ie[0]),ie[0]===void 0)?(W.prevReachedMinPanes=0,s.value[0].size=s.value[0].min,s.value.forEach((fe,Ee)=>{Ee>0&&Ee<=re&&(fe.size=fe.min,W.prevReachedMinPanes+=fe.min)}),s.value[ie[1]].size=100-W.prevReachedMinPanes-s.value[0].min-W.prevPanesSize-W.nextPanesSize,null):J>100-W.nextPanesSize-s.value[ie[1]].min&&(ie[1]=q(re).index,W.nextReachedMinPanes=0,ie[1]>re+1&&s.value.forEach((fe,Ee)=>{Ee>re&&Ee<ie[1]&&(fe.size=fe.min,W.nextReachedMinPanes+=fe.min)}),W.nextPanesSize=I(ie[1]-1),ie[1]===void 0)?(W.nextReachedMinPanes=0,s.value.forEach((fe,Ee)=>{Ee<l.value-1&&Ee>=re+1&&(fe.size=fe.min,W.nextReachedMinPanes+=fe.min)}),s.value[ie[0]].size=100-W.prevPanesSize-I(ie[0]-1),null):{sums:W,panesToResize:ie}},L=W=>s.value.reduce((J,re,ie)=>J+(ie<W?re.size:0),0),I=W=>s.value.reduce((J,re,ie)=>J+(ie>W+1?re.size:0),0),V=W=>[...s.value].reverse().find(J=>J.index<W&&J.size>J.min)||{},q=W=>s.value.find(J=>J.index>W+1&&J.size>J.min)||{},K=()=>{var W;const J=Array.from(((W=u.value)==null?void 0:W.children)||[]);for(const re of J){const ie=re.classList.contains("splitpanes__pane"),fe=re.classList.contains("splitpanes__splitter");!ie&&!fe&&(re.remove(),console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed."))}},me=(W,J,re=!1)=>{const ie=W-1,fe=document.createElement("div");fe.classList.add("splitpanes__splitter"),re||(fe.onmousedown=Ee=>y(Ee,ie),typeof window<"u"&&"ontouchstart"in window&&(fe.ontouchstart=Ee=>y(Ee,ie)),fe.onclick=Ee=>_(Ee,ie+1)),fe.ondblclick=Ee=>S(Ee,ie+1),J.parentNode.insertBefore(fe,J)},z=W=>{W.onmousedown=void 0,W.onclick=void 0,W.ondblclick=void 0,W.remove()},U=()=>{var W;const J=Array.from(((W=u.value)==null?void 0:W.children)||[]);for(const ie of J)ie.className.includes("splitpanes__splitter")&&z(ie);let re=0;for(const ie of J)ie.className.includes("splitpanes__pane")&&(!re&&r.firstSplitter?me(re,ie,!0):re&&me(re,ie),re++)},P=({uid:W,...J})=>{const re=a.value[W];for(const[ie,fe]of Object.entries(J))re[ie]=fe},G=W=>{var J;let re=-1;Array.from(((J=u.value)==null?void 0:J.children)||[]).some(ie=>(ie.className.includes("splitpanes__pane")&&re++,ie.isSameNode(W.el))),s.value.splice(re,0,{...W,index:re}),s.value.forEach((ie,fe)=>ie.index=fe),c.value&&i.nextTick(()=>{U(),oe({addedPane:s.value[re]}),Me("pane-add",{pane:s.value[re]})})},Z=W=>{const J=s.value.findIndex(ie=>ie.id===W);s.value[J].el=null;const re=s.value.splice(J,1)[0];s.value.forEach((ie,fe)=>ie.index=fe),i.nextTick(()=>{U(),Me("pane-remove",{pane:re}),oe({removedPane:{...re}})})},oe=(W={})=>{!W.addedPane&&!W.removedPane?Ce():s.value.some(J=>J.givenSize!==null||J.min||J.max<100)?_e(W):ne(),c.value&&Me("resized")},ne=()=>{const W=100/l.value;let J=0;const re=[],ie=[];for(const fe of s.value)fe.size=Math.max(Math.min(W,fe.max),fe.min),J-=fe.size,fe.size>=fe.max&&re.push(fe.id),fe.size<=fe.min&&ie.push(fe.id);J>.1&&Ge(J,re,ie)},Ce=()=>{let W=100;const J=[],re=[];let ie=0;for(const Ee of s.value)W-=Ee.size,Ee.givenSize!==null&&ie++,Ee.size>=Ee.max&&J.push(Ee.id),Ee.size<=Ee.min&&re.push(Ee.id);let fe=100;if(W>.1){for(const Ee of s.value)Ee.givenSize===null&&(Ee.size=Math.max(Math.min(W/(l.value-ie),Ee.max),Ee.min)),fe-=Ee.size;fe>.1&&Ge(fe,J,re)}},_e=({addedPane:W,removedPane:J}={})=>{let re=100/l.value,ie=0;const fe=[],Ee=[];((W==null?void 0:W.givenSize)??null)!==null&&(re=(100-W.givenSize)/(l.value-1));for(const Oe of s.value)ie-=Oe.size,Oe.size>=Oe.max&&fe.push(Oe.id),Oe.size<=Oe.min&&Ee.push(Oe.id);if(!(Math.abs(ie)<.1)){for(const Oe of s.value)(W==null?void 0:W.givenSize)!==null&&(W==null?void 0:W.id)===Oe.id||(Oe.size=Math.max(Math.min(re,Oe.max),Oe.min)),ie-=Oe.size,Oe.size>=Oe.max&&fe.push(Oe.id),Oe.size<=Oe.min&&Ee.push(Oe.id);ie>.1&&Ge(ie,fe,Ee)}},Ge=(W,J,re)=>{let ie;W>0?ie=W/(l.value-J.length):ie=W/(l.value-re.length),s.value.forEach((fe,Ee)=>{if(W>0&&!J.includes(fe.id)){const Oe=Math.max(Math.min(fe.size+ie,fe.max),fe.min),Y=Oe-fe.size;W-=Y,fe.size=Oe}else if(!re.includes(fe.id)){const Oe=Math.max(Math.min(fe.size+ie,fe.max),fe.min),Y=Oe-fe.size;W-=Y,fe.size=Oe}}),Math.abs(W)>.1&&i.nextTick(()=>{c.value&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})},Me=(W,J=void 0,re=!1)=>{const ie=(J==null?void 0:J.index)??f.value.activeSplitter??null;n(W,{...J,...ie!==null&&{index:ie},...re&&ie!==null&&{prevPane:s.value[ie-(r.firstSplitter?1:0)],nextPane:s.value[ie+(r.firstSplitter?0:1)]},panes:s.value.map(fe=>({min:fe.min,max:fe.max,size:fe.size}))})};i.watch(()=>r.firstSplitter,()=>U()),i.onMounted(()=>{K(),U(),oe(),Me("ready"),c.value=!0}),i.onBeforeUnmount(()=>c.value=!1);const ge=()=>{var W;return i.h("div",{ref:u,class:m.value},(W=o.default)==null?void 0:W.call(o))};return i.provide("panes",s),i.provide("indexedPanes",a),i.provide("horizontal",i.computed(()=>r.horizontal)),i.provide("requestUpdate",P),i.provide("onPaneAdd",G),i.provide("onPaneRemove",Z),i.provide("onPaneClick",C),(W,J)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(ge)))}},ac={__name:"pane",props:{size:{type:[Number,String]},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},setup(t){var e;const n=t,r=i.inject("requestUpdate"),o=i.inject("onPaneAdd"),s=i.inject("horizontal"),a=i.inject("onPaneRemove"),l=i.inject("onPaneClick"),u=(e=i.getCurrentInstance())==null?void 0:e.uid,c=i.inject("indexedPanes"),f=i.computed(()=>c.value[u]),h=i.ref(null),m=i.computed(()=>{const w=isNaN(n.size)||n.size===void 0?0:parseFloat(n.size);return Math.max(Math.min(w,b.value),g.value)}),g=i.computed(()=>{const w=parseFloat(n.minSize);return isNaN(w)?0:w}),b=i.computed(()=>{const w=parseFloat(n.maxSize);return isNaN(w)?100:w}),y=i.computed(()=>{var w;return`${s.value?"height":"width"}: ${(w=f.value)==null?void 0:w.size}%`});return i.watch(()=>m.value,w=>r({uid:u,size:w})),i.watch(()=>g.value,w=>r({uid:u,min:w})),i.watch(()=>b.value,w=>r({uid:u,max:w})),i.onMounted(()=>{o({id:u,el:h.value,min:g.value,max:b.value,givenSize:n.size===void 0?null:m.value,size:m.value})}),i.onBeforeUnmount(()=>a(u)),(w,x)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"paneEl",ref:h,class:"splitpanes__pane",onClick:x[0]||(x[0]=_=>i.unref(l)(_,w._.uid)),style:i.normalizeStyle(y.value)},[i.renderSlot(w.$slots,"default")],4))}},vb=i.defineComponent({__name:"ToolbarTitle",props:{titleBar:{},customClass:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("h3",{class:i.normalizeClass(i.unref($e)("rounded-[5px] px-2.5 py-[5px] min-h-[32px] flex items-center bg-[#E0E0E0]",[e.customClass],[e.titleBar.bgClass]))},i.toDisplayString(e.titleBar.title),3))}});function yb(){let e=null,n=!1;const r=i.ref(!1),o=i.ref(0),s=i.ref(0),a=i.ref(50),l=i.ref(50);let u=[];function c(x,_){n=!1,e=setTimeout(()=>{n=!0},200);const S=_.getBoundingClientRect();o.value=S.left+S.width/2,s.value=S.top+S.height/2}function f(x){clearTimeout(e),e=null,n||(r.value=!0),n=!1}function h(){const x=document.querySelectorAll(".splitpanes__splitter");u=Array.from(x),u.forEach(_=>{_.addEventListener("mousedown",S=>c(S,_)),_.addEventListener("mouseup",f),_.addEventListener("touchstart",S=>c(S,_)),_.addEventListener("touchend",f)})}function m(){u.forEach(x=>{x.removeEventListener("mouseup",f),x.removeEventListener("touchend",f),x.removeEventListener("mousedown",_=>c(_,x)),x.removeEventListener("touchstart",_=>c(_,x))}),u=[]}const g=i.ref([{name:"paneUp",selected:!1},{name:"paneMiddle",selected:!0},{name:"paneDown",selected:!1}]),b=i.ref({name:"paneMiddle",selected:!0});function y(x){b.value=x}async function w(x){y(x),r.value=!1,await i.nextTick(),x.name==="paneUp"?(a.value=0,l.value=100):x.name==="paneDown"?(a.value=100,l.value=0):(a.value=50,l.value=50)}return{showMenuSplitter:r,menuX:o,menuY:s,commentSize:a,contentSize:l,setupSplitterListeners:h,removeSplitterListeners:m,iconSplitters:g,iconSplitSelected:b,setSelectedIconSplit:y,clickIconSplitter:w}}const kE=i.defineComponent({__name:"ScreenSplitToastPopup",props:{menuX:{},menuY:{},iconSplitSelected:{}},emits:["on-change-split"],setup(t,{emit:e}){const{iconSplitters:n}=yb(),r=t,o=e,s=i.computed(()=>({top:`${r.menuY}px`,left:`${r.menuX}px`,transform:"translate(-50%, -50%)"}));return(a,l)=>(i.openBlock(),i.createElementBlock("div",{style:i.normalizeStyle(i.unref(s)),class:"fixed bg-[#424242]/40 text-white/40 rounded-[21px] w-[132px] h-[37px] flex items-center justify-center gap-6 [&>svg]:cursor-pointer"},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(n),u=>(i.openBlock(),i.createBlock(i.unref(Kt),{key:u.name,name:u.name,class:i.normalizeClass({"text-black/80":u.name===a.iconSplitSelected.name}),onClick:c=>o("on-change-split",u)},null,8,["name","class","onClick"]))),128))],4))}});function UY(t,e,n,r=!1,o=39){const{top:s,height:a}=Ze.useElementBounding(t),l=i.ref(0),u=f=>f-(e?0:o),c=async()=>{await i.nextTick(),a.value>0&&(l.value=u(a.value))};return n||(i.watch(()=>a.value,c),i.watch(()=>s.value,()=>{l.value=0})),i.onMounted(()=>{if(n){l.value=u(n);return}c(),r&&!n&&Ze.useIntervalFn(()=>{const{top:f}=Ze.useElementBounding(t);f.value!==s.value&&(l.value=0)},1e3)}),{wrapHeight:l}}const lc=i.defineComponent({__name:"CoreEditorMoblie",props:{isMobile:{type:Boolean},superTextArea:{default:{view:!0,button:!0}},mode:{},modelValue:{default:""},comment:{default:""},fontSizeDefault:{default:"12px"},fontFamilyDefault:{default:""},isOpenSuperView:{type:Boolean},output:{default:"html"},dark:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},hideToolbar:{type:Boolean,default:!1},isShowFormatControlBar:{type:Boolean,default:!1},titleBarComment:{default:null},titleBarContent:{default:null},fieldNameComment:{default:null},fieldNameContent:{default:null},isScreenSplit:{default:!1},isShowLineNumber:{type:Boolean,default:!1},hideMenubar:{type:Boolean},disableBubble:{type:Boolean,default:!1},hideBubble:{type:Boolean,default:!1},maxWidth:{default:void 0},minHeight:{default:200},maxHeight:{default:void 0},height:{default:void 0},extensions:{default:()=>[]},editorClass:{default:void 0},contentClass:{default:void 0},isCompare:{type:Boolean},autoHeight:{type:Boolean},autoResize:{type:Boolean,default:!1}},emits:["enter","change","update:modelValue","update:comment","onFocusEditor","changed:selection","setEditorSelected"],setup(t,{expose:e,emit:n}){const r=t,o=n;i.provide("isMobile",!0);const{t:s}=St(),a=Ze.useEventBus(Kn.RENDER_SUPER_TEXT),l=Ze.useEventBus(Kn.INCREASE_DECREASE_FONTSIZE),u=i.useAttrs(),c=tr(),{state:f,isFullscreen:h,isReady:m,editor:g,updateEditorState:b,superTextStore:y,checkSpellStore:w,setImageAttachment:x}=c,_=Ze.useDark(),S=i.computed(()=>[...f.extensions,...Et.differenceBy(r.extensions,f.extensions,"name")].map((Y,we)=>Y.configure({sort:we}))),C=i.ref(r.fontSizeDefault),k=i.ref(r.fontFamilyDefault);i.provide("fontSize",C),i.provide("fontFamily",k);const A=i.computed(()=>({fontFamily:k.value,fontSize:C.value})),T=i.ref(),{wrapHeight:B}=UY(T,r.hideToolbar,r.height,r.autoResize);i.watch(()=>A.value,()=>{P()}),i.onMounted(()=>{P()});const L=Y=>{const we=parseInt(C.value||"12px"),ze=Y?we+2:we-2;C.value=ze+"px"};i.onBeforeMount(()=>{l.on(L)}),i.onBeforeUnmount(()=>{l.off(L)});const I=i.computed(()=>({...i.unref(h)?{height:"100%"}:{minHeight:r.minHeight?gn(r.minHeight):void 0,maxHeight:r.maxHeight?gn(r.maxHeight):void 0,height:r.height?gn(r.height):void 0},maxWidth:gn(r.maxWidth),width:r.maxWidth?"100%":void 0,margin:r.maxWidth?"0 auto":void 0})),V=new ol({enablePasteRules:!1,enableInputRules:!1,content:Bo(r.modelValue,r.disabled,r.mode),editorProps:{handleKeyDown:Et.throttle((Y,we)=>we.key==="Enter"&&u.enter&&!we.shiftKey?(o("enter"),!0):!1,Ki),transformPastedHTML:Y=>(Y=Y.replace(/\s*style="[^"]*"/g,""),Y),handlePaste(Y,we){var D;if(r.mode!==Ye.PLAIN_TEXT)return!1;we.preventDefault();const ze=((D=we.clipboardData)==null?void 0:D.getData("text/plain"))||"",{tr:wt,selection:$}=Y.state;return Y.dispatch(wt.insertText(ze,$.from)),!0}},onCreate:({editor:Y})=>{b(Y)},onUpdate:Et.throttle(({editor:Y})=>{m.value=!0;const we=G(Y,r.output);o("update:modelValue",we),o("change",{editor:Y,output:we}),b(Y),P(),me(Y)},Ki),extensions:Et.uniqBy(Et.reverse(i.unref(S)),"name"),editable:!r.disabled,onFocus:()=>{U(),q.value=!0},onBlur:()=>q.value=!1}),q=i.ref(!1),K=i.ref();function me(Y){const we=[];Y.state.doc.descendants(ze=>{ze.type.name==="image"&&we.push({id:ze.attrs.id,src:ze.attrs.src})}),x(we)}const z=i.ref();i.onMounted(()=>{z.value=V});function U(Y){z.value=Y??V}function P(){a.emit({action:"render"})}function G(Y,we){if(!Y)return"";if(Y.isEmpty)return we==="json"?{}:"";if(r.mode===Ye.PLAIN_TEXT)return Y.getText({blockSeparator:`
264
264
  `});switch(we){case"html":return Y.getHTML();case"json":return Y.getJSON();case"text":return Y.getText({blockSeparator:`
265
- `});default:return""}}function Z(Y){return Y.every(we=>V==null?void 0:V.extensionManager.extensions.find(ze=>ze.name===we))}i.watch(()=>r.dark,()=>Ze.useToggle(_)),i.watch(()=>w.languages,()=>{V.commands.checkSpelling()}),i.watch(()=>r.modelValue,Y=>{if(!V||Et.isEqual(G(V,r.output),Y))return;const{from:we,to:ze}=V.state.selection;V.commands.setTextSelection({from:we,to:ze}),P(),V.commands.setContent(Bo(Y,r.disabled,r.mode),!1)},{deep:!0}),i.watch(()=>r.disabled,Y=>V==null?void 0:V.setEditable(!Y)),i.watch(()=>g.value,()=>{g.value&&g.value.on("selectionUpdate",({editor:Y})=>{o("changed:selection",{editor:Y})})}),i.onUnmounted(()=>{var Y;V==null||V.destroy(),(Y=z.value)==null||Y.destroy()}),wf(bf.SAVE,()=>{localStorage.setItem("content",G(V,"html"))});const oe=i.computed(()=>{var we,ze;if(!((ze=(we=z.value)==null?void 0:we.storage)!=null&&ze.superText))return!1;const{isShowSuperViewMoblie:Y}=z.value.storage.superText;return Y});i.watch(()=>z.value,(Y,we)=>{Y&&z.value.storage.superText&&(z.value.storage.superText.isShowSuperViewMoblie=we==null?void 0:we.storage.superText.isShowSuperViewMoblie)});const ne=Y=>{var ze;const we=z.value??V;if(we){const{from:wt}=we.view.state.selection;we.commands.insertContentAt(wt,{type:"superText",attrs:{"data-id":Gi(6),"data-text":Y}})}(ze=z.value)==null||ze.commands.toggleSuperInputMoblie()},Ce=Y=>{var ze;const we=z.value??V;if(we){const{from:wt}=we.view.state.selection;we.commands.insertContentAt(wt,{type:"configPlan",attrs:{"data-id":Gi(6),"data-text":Y}})}(ze=z.value)==null||ze.commands.toggleConfigPlanInput()};function _e(Y){Y===Ye.STRAIGHT&&V.commands.focus("end"),Y===Ye.EDITOR&&V.commands.focus("end")}i.onMounted(()=>{var Y,we;_e(r.mode),(Y=V==null?void 0:V.commands)!=null&&Y.setIsEnableSuggestion&&V.commands.setIsEnableSuggestion(!1),(we=V==null?void 0:V.commands)!=null&&we.setIsMobile&&V.commands.setIsMobile(!0)}),i.watch(()=>r.mode,Y=>{_e(Y)});const{showMenuSplitter:Ge,menuX:Me,menuY:ge,commentSize:W,contentSize:J,setupSplitterListeners:re,removeSplitterListeners:ie,iconSplitSelected:fe,clickIconSplitter:Ee}=yb();i.onMounted(()=>{re()}),i.onUnmounted(()=>{ie()});const Oe=i.ref();return Ze.onClickOutside(Oe,Y=>{Ge.value=!1}),bb(V),e({editor:V}),(Y,we)=>{var Le,tt,He,N,pe,le;const ze=yE,wt=vE,$=bE,D=Dx,ae=FY,ve=CE;return i.openBlock(),i.createElementBlock(i.Fragment,null,[z.value?(i.openBlock(),i.createElementBlock("div",{key:0,id:"vdc-editor",ref_key:"editorRef",ref:T,style:i.normalizeStyle(I.value),class:i.normalizeClass(i.unref($e)("vdc-editor moblie relative w-full flex flex-col",!r.height&&"flex-1",Y.editorClass,(Y.isShowLineNumber||oe.value)&&"editor-line-number",Y.disabled&&"disabled",Y.mode!==i.unref(Ye).EDITOR&&"editor-line"))},[!Y.hideBubble&&!Y.disabled&&i.unref(V).isEditable?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[Z([i.unref(Vg)])?(i.openBlock(),i.createBlock(ze,{key:0,editor:i.unref(V)},null,8,["editor"])):i.createCommentVNode("",!0),Z([i.unref(Nu)])?(i.openBlock(),i.createBlock(wt,{key:1,editor:i.unref(V)},null,8,["editor"])):i.createCommentVNode("",!0),Z([i.unref(pl)])?(i.openBlock(),i.createBlock($,{key:2,editor:i.unref(V)},null,8,["editor"])):i.createCommentVNode("",!0),Z([i.unref(hl),i.unref(ml)])?(i.openBlock(),i.createBlock(D,{key:3,editor:i.unref(V)},null,8,["editor"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),Y.hideToolbar?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(ae,{key:1,editor:z.value,mode:Y.mode,disabled:Y.disabled,class:"mb-[3px]"},null,8,["editor","mode","disabled"])),i.createVNode(i.unref(SE),{class:i.normalizeClass(i.unref($e)("flex flex-col [&_*]:!font-inherit [&_*]:!text-font-size-inherit",k.value&&"[&_*]:!font-inherit",C.value&&"[&_*]:!text-font-size-inherit")),style:i.normalizeStyle({...A.value,height:i.unref(xn)(i.unref(B))}),horizontal:"",onReady:i.unref(re),onResized:i.unref(re)},{default:i.withCtx(()=>[Y.mode===i.unref(Ye).REPORT||Y.mode===i.unref(Ye).EDITOR&&Y.isScreenSplit?(i.openBlock(),i.createBlock(i.unref(ac),{key:0,size:i.unref(W),class:"border-none p-0 flex flex-col"},{default:i.withCtx(()=>{var be,Fe;return[(be=Y.titleBarComment)!=null&&be.title?(i.openBlock(),i.createBlock(vb,{key:0,"title-bar":Y.titleBarComment,class:"mb-[3px]"},null,8,["title-bar"])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(i.unref($e)("!overflow-y-scroll flex h-full flex-col pt-1.5 p-2.5 border border-ed-gray rounded-[5px]",((Fe=K.value)==null?void 0:Fe.isFocused)&&"border-ed-blue",Y.disabled&&"border-transparent"))},[i.createVNode(HY,{ref_key:"editorCommentRef",ref:K,mode:Y.mode,extensions:Y.extensions,"model-value":r.comment,disabled:r.disabled,"is-open-super-view":oe.value,"field-name-comment":Y.fieldNameComment,"is-show-format-control-bar":Y.isShowFormatControlBar,"onUpdate:modelValue":we[0]||(we[0]=nt=>o("update:comment",nt)),onSetEditorSelected:U},null,8,["mode","extensions","model-value","disabled","is-open-super-view","field-name-comment","is-show-format-control-bar"])],2)]}),_:1},8,["size"])):i.createCommentVNode("",!0),i.createVNode(i.unref(ac),{size:i.unref(J),class:"border-none p-0 flex flex-col"},{default:i.withCtx(()=>{var be,Fe;return[(be=Y.titleBarContent)!=null&&be.title?(i.openBlock(),i.createBlock(vb,{key:0,"title-bar":Y.titleBarContent,class:"mb-[3px]"},null,8,["title-bar"])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(i.unref($e)("flex-1 !overflow-y-auto flex flex-col pt-1.5 p-2.5 border border-ed-gray rounded-[5px]",q.value&&"border-ed-blue",Y.disabled&&"border-transparent"))},[(Fe=Y.fieldNameContent)!=null&&Fe.label?(i.openBlock(),i.createBlock(_E,{key:0,"field-name":Y.fieldNameContent,mode:Y.mode,disabled:Y.disabled,class:"mb-1"},null,8,["field-name","mode","disabled"])):i.createCommentVNode("",!0),Y.isShowFormatControlBar?(i.openBlock(),i.createBlock(ve,{key:1,editor:i.unref(V),mode:Y.mode,disabled:Y.disabled,class:"mb-[3px]"},null,8,["editor","mode","disabled"])):i.createCommentVNode("",!0),i.createVNode(EE,{editor:i.unref(V),mode:Y.mode},{default:i.withCtx(()=>[i.createVNode(i.unref(Lu),{editor:i.unref(V),spellcheck:"true",class:"flex-1 flex-col"},null,8,["editor"])]),_:1},8,["editor","mode"])],2)]}),_:1},8,["size"])]),_:1},8,["class","style","onReady","onResized"])],6)):i.createCommentVNode("",!0),i.unref(Ge)&&!Y.disabled?(i.openBlock(),i.createBlock(kE,{key:1,ref_key:"splitToastRef",ref:Oe,"icon-split-selected":i.unref(fe),"menu-x":i.unref(Me),"menu-y":i.unref(ge),onOnChangeSplit:i.unref(Ee)},null,8,["icon-split-selected","menu-x","menu-y","onOnChangeSplit"])):i.createCommentVNode("",!0),(Le=z.value)!=null&&Le.storage.superText?(i.openBlock(),i.createBlock(mp,{key:2,open:(tt=z.value)==null?void 0:tt.storage.superText.isShowSuperInputMoblie,"is-view-mode":!((He=z.value)!=null&&He.storage.superText.isShowSuperInputMoblie),editor:z.value,onClose:we[1]||(we[1]=be=>z.value.commands.toggleSuperInputMoblie()),onSave:ne},null,8,["open","is-view-mode","editor"])):i.createCommentVNode("",!0),(N=z.value)!=null&&N.storage.configPlan?(i.openBlock(),i.createBlock(mp,{key:3,open:(pe=z.value)==null?void 0:pe.storage.configPlan.isShowConfigPlanInput,"is-view-mode":!((le=z.value)!=null&&le.storage.configPlan.isShowConfigPlanInput),editor:z.value,title:Y.$t("editor.configPlan"),onClose:we[2]||(we[2]=be=>z.value.commands.toggleConfigPlanInput()),onSave:Ce},null,8,["open","is-view-mode","editor","title"])):i.createCommentVNode("",!0)],64)}}}),WY=i.defineComponent({__name:"ArticleEditor",props:{mode:{default:Ye.STRAIGHT},isMobile:{type:Boolean},superTextArea:{},modelValue:{},comment:{},fontSizeDefault:{},fontFamilyDefault:{},isOpenSuperView:{type:Boolean},output:{},dark:{type:Boolean},disabled:{type:Boolean},hideToolbar:{type:Boolean},isShowFormatControlBar:{type:Boolean},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameContent:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean},hideBubble:{type:Boolean},maxWidth:{},minHeight:{},maxHeight:{},height:{},extensions:{},editorClass:{},contentClass:{},isCompare:{type:Boolean},autoHeight:{type:Boolean},autoResize:{type:Boolean}},setup(t){const e=t;return(n,r)=>e.isMobile?(i.openBlock(),i.createBlock(lc,i.mergeProps({key:1},e,{"onUpdate:modelValue":r[2]||(r[2]=o=>n.$emit("update:modelValue",o)),"onUpdate:comment":r[3]||(r[3]=o=>n.$emit("update:comment",o))}),null,16)):(i.openBlock(),i.createBlock(Lp,i.mergeProps({key:0},e,{"onUpdate:modelValue":r[0]||(r[0]=o=>n.$emit("update:modelValue",o)),"onUpdate:comment":r[1]||(r[1]=o=>n.$emit("update:comment",o))}),null,16))}}),jY=i.defineComponent({__name:"DigitalNewsEditor",props:{mode:{default:Ye.EDITOR},isMobile:{type:Boolean},superTextArea:{},modelValue:{},comment:{},fontSizeDefault:{},fontFamilyDefault:{},isOpenSuperView:{type:Boolean},output:{},dark:{type:Boolean},disabled:{type:Boolean},hideToolbar:{type:Boolean},isShowFormatControlBar:{type:Boolean},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameContent:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean},hideBubble:{type:Boolean},maxWidth:{},minHeight:{},maxHeight:{},height:{},extensions:{},editorClass:{},contentClass:{},isCompare:{type:Boolean},autoHeight:{type:Boolean},autoResize:{type:Boolean}},setup(t){const e=t;return(n,r)=>{const o=Lp,s=lc;return e.isMobile?(i.openBlock(),i.createBlock(s,i.mergeProps({key:1},e,{"onUpdate:modelValue":r[1]||(r[1]=a=>n.$emit("update:modelValue",a)),"onUpdate:comment":r[2]||(r[2]=a=>n.$emit("update:comment",a))}),null,16)):(i.openBlock(),i.createBlock(o,i.mergeProps({key:0},e,{"onUpdate:modelValue":r[0]||(r[0]=a=>n.$emit("update:modelValue",a))}),null,16))}}});var TE={exports:{}};(function(t){(function(){function e(z){return z===">"}function n(z){return z==="<"}function r(z){return/^\s+$/.test(z)}function o(z){var U=z.match(/^\s*<([^!>][^>]*)>\s*$/);return!!U&&U[1].trim().split(" ")[0]}function s(z){return!o(z)}function a(z){return/^<!--/.test(z)}function l(z){return/--\>$/.test(z)}var u,c=new RegExp("^<(iframe|object|math|svg|script|video|head|style|a)");function f(z){var U=u.exec(z);return U&&U[1]}function h(z,U){return z.substring(z.length-U.length-2)==="</"+U}function m(z){return/^\s*<[^>]+\/>\s*$/.test(z)}function g(z){var U=/^<img[\s>]/.test(z);return U||s(z)||f(z)||m(z)}function b(z){return{string:z,key:x(z)}}function y(z,U,P,G){this.segment=G,this.length=P,this.startInBefore=z+G.beforeIndex,this.startInAfter=U+G.afterIndex,this.endInBefore=this.startInBefore+this.length-1,this.endInAfter=this.startInAfter+this.length-1,this.segmentStartInBefore=z,this.segmentStartInAfter=U,this.segmentEndInBefore=this.segmentStartInBefore+this.length-1,this.segmentEndInAfter=this.segmentStartInAfter+this.length-1}function w(z){for(var U="char",P="",G="",Z=[],oe=0;oe<z.length;oe++){var ne=z[oe];switch(U){case"tag":var Ce=f(P);Ce?(U="atomic_tag",G=Ce,P+=ne):a(P)?(U="html_comment",P+=ne):e(ne)?(P+=">",Z.push(b(P)),P="",r(ne)?U="whitespace":U="char"):P+=ne;break;case"atomic_tag":e(ne)&&h(P,G)?(P+=">",Z.push(b(P)),P="",G="",U="char"):P+=ne;break;case"html_comment":P+=ne,l(P)&&(P="",U="char");break;case"char":n(ne)?(P&&Z.push(b(P)),P="<",U="tag"):/\s/.test(ne)?(P&&Z.push(b(P)),P=ne,U="whitespace"):/[\w\d\#@]/.test(ne)?P+=ne:/&/.test(ne)?(P&&Z.push(b(P)),P=ne):(P+=ne,Z.push(b(P)),P="");break;case"whitespace":n(ne)?(P&&Z.push(b(P)),P="<",U="tag"):r(ne)?P+=ne:(P&&Z.push(b(P)),P=ne,U="char");break;default:throw new Error("Unknown mode "+U)}}return P&&Z.push(b(P)),Z}function x(z){var U=/^<img.*src=['"]([^"']*)['"].*>$/.exec(z);if(U)return'<img src="'+U[1]+'">';var P=/^<a.*href=['"]([^"']*)['"]/.exec(z);if(P)return'<a href="'+P[1]+'"></a>';var G=/^<object.*data=['"]([^"']*)['"]/.exec(z);if(G)return'<object src="'+G[1]+'"></object>';if(/^<(svg|math|video)[\s>]/.test(z)){var Z=z.indexOf('data-uuid="');if(Z!==-1){var oe=z.slice(0,Z),ne=z.slice(Z+44);return oe+ne}else return z}var Ce=/^<iframe.*src=['"]([^"']*)['"].*>/.exec(z);if(Ce)return'<iframe src="'+Ce[1]+'"></iframe>';var _e=/<([^\s>]+)[\s>]/.exec(z);return _e?"<"+_e[1].toLowerCase()+">":z&&z.replace(/(\s+|&nbsp;|&#160;)/g," ")}function _(z){return z.reduce(function(U,P,G){return U[P.key]?U[P.key].push(G):U[P.key]=[G],U},Object.create(null))}function S(z,U){return U.endInBefore<z.startInBefore&&U.endInAfter<z.startInAfter?-1:U.startInBefore>z.endInBefore&&U.startInAfter>z.endInAfter?1:0}function C(){this._root=null}C.prototype={add:function(z){var U={value:z,left:null,right:null},P=this._root;if(P)for(;;){var G=S(P.value,z);if(G===-1)if(P.left)P=P.left;else{P.left=U;break}else if(G===1)if(P.right)P=P.right;else{P.right=U;break}else break}else this._root=U},toArray:function(){function z(U,P){return U&&(z(U.left,P),P.push(U.value),z(U.right,P)),P}return z(this._root,[])}};function k(z){for(var U=z.beforeTokens,P=z.afterMap,G=null,Z=null,oe=0;oe<U.length;oe++){var ne=!1,Ce=U.length-oe;if(Z&&Ce<Z.length)break;var _e=U[oe];if(_e.key===" "){G=oe;continue}G===oe-1&&(ne=!0);var Ge=P[_e.key];Ge&&Ge.forEach(function(Me){var ge=Z?Z.length:0,W=A(z,oe,Me,ge,ne);W&&W.length>ge&&(Z=W)})}return Z}function A(z,U,P,G,Z){var oe=z.beforeTokens,ne=z.afterTokens,Ce=U+G,_e=P+G;if(!(Ce>=oe.length||_e>=ne.length)){if(G){var Ge=oe[Ce].key,Me=ne[_e].key;if(Ge!==Me)return}for(var ge=!0,W=1,J=U+W,re=P+W;ge&&J<oe.length&&re<ne.length;){var ie=oe[J].key,fe=ne[re].key;ie===fe?(W++,J=U+W,re=P+W):ge=!1}if(Z&&U>0&&P>0){var Ee=oe[U-1].key,Oe=ne[P-1].key;Ee===" "&&Oe===" "&&(U--,P--,W++)}return new y(U,P,W,z)}}function T(z,U,P,G){return{beforeTokens:z,afterTokens:U,beforeMap:_(z),afterMap:_(U),beforeIndex:P,afterIndex:G}}function B(z){for(var U=new C,P,G=[z];G.length;)if(z=G.pop(),P=k(z),P&&P.length){if(P.segmentStartInBefore>0&&P.segmentStartInAfter>0){var Z=z.beforeTokens.slice(0,P.segmentStartInBefore),oe=z.afterTokens.slice(0,P.segmentStartInAfter);G.push(T(Z,oe,z.beforeIndex,z.afterIndex))}var ne=z.beforeTokens.slice(P.segmentEndInBefore+1),Ce=z.afterTokens.slice(P.segmentEndInAfter+1),_e=z.beforeIndex+P.segmentEndInBefore+1,Ge=z.afterIndex+P.segmentEndInAfter+1;ne.length&&Ce.length&&G.push(T(ne,Ce,_e,Ge)),U.add(P)}return U.toArray()}function L(z,U){if(!z)throw new Error("Missing beforeTokens");if(!U)throw new Error("Missing afterTokens");var P=0,G=0,Z=[],oe=T(z,U,0,0),ne=B(oe);ne.push(new y(z.length,U.length,0,oe));for(var Ce=0;Ce<ne.length;Ce++){var _e=ne[Ce],Ge="none";P===_e.startInBefore?G!==_e.startInAfter&&(Ge="insert"):(Ge="delete",G!==_e.startInAfter&&(Ge="replace")),Ge!=="none"&&Z.push({action:Ge,startInBefore:P,endInBefore:Ge!=="insert"?_e.startInBefore-1:null,startInAfter:G,endInAfter:Ge!=="delete"?_e.startInAfter-1:null}),_e.length!==0&&Z.push({action:"equal",startInBefore:_e.startInBefore,endInBefore:_e.endInBefore,startInAfter:_e.startInAfter,endInAfter:_e.endInAfter}),P=_e.endInBefore+1,G=_e.endInAfter+1}var Me=[],ge={action:"none"};function W(ie){return ie.action!=="equal"||ie.endInBefore-ie.startInBefore!==0?!1:/^\s$/.test(z.slice(ie.startInBefore,ie.endInBefore+1))}for(var J=0;J<Z.length;J++){var re=Z[J];W(re)&&ge.action==="replace"||re.action==="replace"&&ge.action==="replace"?(ge.endInBefore=re.endInBefore,ge.endInAfter=re.endInAfter):(Me.push(re),ge=re)}return Me}function I(z){this.tokens=z,this.notes=z.reduce(function(U,P,G){U.notes.push({isWrappable:g(P),insertedTag:!1});var Z=!m(P)&&o(P),oe=U.tagStack[U.tagStack.length-1];return Z&&(oe&&"/"+oe.tag===Z?(U.notes[oe.position].insertedTag=!0,U.tagStack.pop()):U.tagStack.push({tag:Z,position:G})),U},{notes:[],tagStack:[]}).notes}I.prototype.combine=function(z,U){var P=this.notes,G=this.tokens.slice(),Z=G.reduce(function(oe,ne,Ce){P[Ce].insertedTag&&(G[Ce]=U(G[Ce])),oe.status===null&&(oe.status=P[Ce].isWrappable);var _e=P[Ce].isWrappable;return _e!==oe.status&&(oe.list.push({isWrappable:oe.status,tokens:G.slice(oe.lastIndex,Ce)}),oe.lastIndex=Ce,oe.status=_e),Ce===G.length-1&&oe.list.push({isWrappable:oe.status,tokens:G.slice(oe.lastIndex,Ce+1)}),oe},{list:[],status:null,lastIndex:0}).list;return Z.map(z).join("")};function V(z,U,P,G,Z){var oe=new I(U);G=G?G+"-":"";var ne=" data-"+G+'operation-index="'+P+'"';return Z&&(ne+=' class="'+Z+'"'),oe.combine(function(Ce){if(Ce.isWrappable){var _e=Ce.tokens.join("");if(_e.trim())return"<"+z+ne+">"+_e+"</"+z+">"}else return Ce.tokens.join("");return""},function(Ce){var _e=' data-diff-node="'+z+'"';return _e+=" data-"+G+'operation-index="'+P+'"',Ce.replace(/>\s*$/,_e+"$&")})}var q={equal:function(z,U,P,G,Z,oe){var ne=P.slice(z.startInAfter,z.endInAfter+1);return ne.reduce(function(Ce,_e){return Ce+_e.string},"")},insert:function(z,U,P,G,Z,oe){var ne=P.slice(z.startInAfter,z.endInAfter+1),Ce=ne.map(function(_e){return _e.string});return V("ins",Ce,G,Z,oe)},delete:function(z,U,P,G,Z,oe){var ne=U.slice(z.startInBefore,z.endInBefore+1),Ce=ne.map(function(_e){return _e.string});return V("del",Ce,G,Z,oe)},replace:function(){return q.delete.apply(null,arguments)+q.insert.apply(null,arguments)}};function K(z,U,P,G,Z){return P.reduce(function(oe,ne,Ce){return oe+q[ne.action](ne,z,U,Ce,G,Z)},"")}function me(z,U,P,G,Z){if(z===U)return z;Z?u=new RegExp("^<("+Z.replace(/\s*/g,"").replace(/,/g,"|")+")"):u=c,z=w(z),U=w(U);var oe=L(z,U);return K(z,U,oe,G,P)}me.htmlToTokens=w,me.findMatchingBlocks=B,B.findBestMatch=k,B.createMap=_,B.createToken=b,B.createSegment=T,B.getKeyForToken=x,me.calculateOperations=L,me.renderOperations=K,t!==null?t.exports=me:this.htmldiff=me}).call(Ea)})(TE);var qY=TE.exports;const KY=cO(qY),AE=(t,e,n)=>{let r="";{const o=Bo(t,n),s=Bo(e,n);r=KY(o,s,null,null,"button")}return r=r.replace(/<del[^>]*>/g,'<mark style="background:#ffa8a8;color:white;">').replace(/<\/del>/g,"</mark>").replace(/<ins[^>]*>/g,'<mark style="background:#42424266;">').replace(/<\/ins>/g,"</mark>"),r},GY={class:"border border-ed-gray rounded-[5px] p-2.5 flex-1 overflow-y-auto"},XY={class:"border border-ed-gray rounded-[5px] p-2.5 h-full"},JY={class:"border border-ed-gray rounded-[5px] p-2.5 flex-1 overflow-y-auto"},YY=ri(i.defineComponent({__name:"ArticleCompareEditor",props:{originalData:{},changedData:{},extensions:{},editorClass:{}},setup(t){const e=t,n=i.ref(!1),r=i.computed(()=>!e.originalData||!e.changedData?{comment:"",content:""}:{comment:AE(e.originalData.comment,e.changedData.comment,!0),content:AE(e.originalData.content,e.changedData.content,!0)}),{showMenuSplitter:o,menuX:s,menuY:a,commentSize:l,contentSize:u,setupSplitterListeners:c,removeSplitterListeners:f,iconSplitSelected:h,clickIconSplitter:m}=yb();i.onMounted(()=>{c()}),i.onUnmounted(()=>{f()});const g=i.ref();return Ze.onClickOutside(g,b=>{o.value=!1}),(b,y)=>{const w=vb;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",{class:i.normalizeClass(i.unref($e)("h-[600px]",b.editorClass))},[i.createVNode(i.unref(SE),{horizontal:"",onReady:i.unref(c),onResized:i.unref(c)},{default:i.withCtx(()=>[i.createVNode(i.unref(ac),{size:i.unref(l),class:"flex flex-col"},{default:i.withCtx(()=>{var x,_,S,C,k,A;return[(_=(x=b.originalData)==null?void 0:x.titleBar)!=null&&_.title?(i.openBlock(),i.createBlock(w,{key:0,"title-bar":b.originalData.titleBar,class:"text-[12px] mb-[3px]"},null,8,["title-bar"])):i.createCommentVNode("",!0),i.createElementVNode("div",GY,[i.createVNode(lc,{"editor-class":"h-full",mode:i.unref(Ye).REPORT,disabled:"","hide-toolbar":"",extensions:b.extensions,"field-name-comment":(S=b.originalData)==null?void 0:S.fieldNameComment,"field-name-content":(C=b.originalData)==null?void 0:C.fieldNameContent,comment:(k=b.originalData)==null?void 0:k.comment,"model-value":(A=b.originalData)==null?void 0:A.content},null,8,["mode","extensions","field-name-comment","field-name-content","comment","model-value"])])]}),_:1},8,["size"]),i.unref(n)?(i.openBlock(),i.createBlock(i.unref(ac),{key:0},{default:i.withCtx(()=>{var x,_,S,C;return[i.createElementVNode("div",XY,[i.createVNode(lc,{"editor-class":"h-full",mode:i.unref(Ye).REPORT,disabled:"","hide-toolbar":"",extensions:b.extensions,"field-name-comment":(x=b.changedData)==null?void 0:x.fieldNameComment,"field-name-content":(_=b.changedData)==null?void 0:_.fieldNameContent,comment:(S=b.changedData)==null?void 0:S.comment,"model-value":(C=b.changedData)==null?void 0:C.content},null,8,["mode","extensions","field-name-comment","field-name-content","comment","model-value"])])]}),_:1})):i.createCommentVNode("",!0),i.createVNode(i.unref(ac),{size:i.unref(u),class:"flex flex-col"},{default:i.withCtx(()=>{var x,_,S,C,k;return[(_=(x=b.changedData)==null?void 0:x.titleBar)!=null&&_.title?(i.openBlock(),i.createBlock(w,{key:0,"title-bar":(S=b.changedData)==null?void 0:S.titleBar,class:"text-[12px] mb-[3px]","custom-class":"bg-[#34c759]"},null,8,["title-bar"])):i.createCommentVNode("",!0),i.createElementVNode("div",JY,[i.createVNode(lc,{"editor-class":"h-full",mode:i.unref(Ye).REPORT,disabled:"","hide-toolbar":"",extensions:b.extensions,"field-name-comment":(C=b.changedData)==null?void 0:C.fieldNameComment,"field-name-content":(k=b.changedData)==null?void 0:k.fieldNameContent,comment:i.unref(r).comment,"model-value":i.unref(r).content},null,8,["mode","extensions","field-name-comment","field-name-content","comment","model-value"])])]}),_:1},8,["size"])]),_:1},8,["onReady","onResized"])],2),i.unref(o)?(i.openBlock(),i.createBlock(kE,{key:0,ref_key:"splitRef",ref:g,"icon-split-selected":i.unref(h),"menu-x":i.unref(s),"menu-y":i.unref(a),onOnChangeSplit:i.unref(m)},null,8,["icon-split-selected","menu-x","menu-y","onOnChangeSplit"])):i.createCommentVNode("",!0)],64)}}}),[["__scopeId","data-v-d4502f7a"]]),OE={"editor.remove":"Remove","editor.copy":"Copy","editor.words":"WORDS","editor.characters":"CHARACTERS","editor.default":"Default","editor.recent":"Recently Used","editor.nofill":"Remove Color","editor.format":"Format Painter","editor.close":"Close","editor.modify":"Modify","editor.preview.tooltip":"Preview","editor.draghandle.tooltip":"Click And Drag","editor.copyToClipboard":"CopyToClipboard","editor.importWord.tooltip":"Import from Word","editor.importWord.success":"Import Success","editor.importWord.fileTooLarge":"File is Too large","editor.importWord.error":"Import Failed, File not supported","editor.slash":"Press '/' for commands","editor.slash.empty":"No Result","editor.slash.format":"Format","editor.slash.insert":"Insert","editor.slash.embed":"Embed Services","editor.content":"Please input content","editor.slash.hint":"Please input content","editor.moremark":"More Text Styles","editor.size.small.tooltip":"Small","editor.size.medium.tooltip":"Medium","editor.size.large.tooltip":"Cover","editor.bold.tooltip":"Bold","editor.italic.tooltip":"Italic","editor.underline.tooltip":"Underline","editor.strike.tooltip":"Strike","editor.color.tooltip":"Color","editor.color.more":"Color Picker","editor.highlight.tooltip":"Highlight","editor.lineheight.tooltip":"Line Height","editor.heading.tooltip":"Headings","editor.heading.h1.tooltip":"Heading 1","editor.heading.h2.tooltip":"Heading 2","editor.heading.h3.tooltip":"Heading 3","editor.heading.h4.tooltip":"Heading 4","editor.heading.h5.tooltip":"Heading 5","editor.heading.h6.tooltip":"Heading 6","editor.paragraph.tooltip":"Paragraph","editor.textalign.tooltip":"Align","editor.textalign.left.tooltip":"Left","editor.textalign.center.tooltip":"Center","editor.textalign.right.tooltip":"Right","editor.textalign.justify.tooltip":"Justify","editor.indent":"Indent","editor.indent.indent":"Increase Indent","editor.indent.outdent":"Decrease Indent","editor.fontFamily.tooltip":"Font family","editor.fontFamily.default":"Default","editor.fontFamily.gulim":"Gulim","editor.fontFamily.dotum":"Dotum","editor.fontFamily.gungsuh":"Gungsuh","editor.fontSize.tooltip":"Font size","editor.fontSize.default.tooltip":"Default","editor.superscript.tooltip":"Superscript","editor.subscript.tooltip":"Subscript","editor.bulletlist.tooltip":"Bullet List","editor.bulletlist.disc.tooltip":"Disc","editor.bulletlist.circle.tooltip":"Circle","editor.bulletlist.square.tooltip":"Square","editor.orderedlist.tooltip":"Ordered List","editor.orderedlist.decimal.tooltip":"Decimal","editor.orderedlist.decimalLeadingZero.tooltip":"Decimal with leading zero","editor.orderedlist.lowerRoman.tooltip":"Lower Roman","editor.orderedlist.upperRoman.tooltip":"Upper Roman","editor.orderedlist.lowerLatin.tooltip":"Lower Latin","editor.orderedlist.upperLatin.tooltip":"Upper Latin","editor.orderedlist.tradChineseInformal.tooltip":"Trad Chinese Informal","editor.orderedlist.simpChineseFormal.tooltip":"Simp Chinese Informal","editor.tasklist.tooltip":"Task List","editor.indent.tooltip":"Indent","editor.outdent.tooltip":"Outdent","editor.columns.tooltip":"Columns","editor.link.tooltip":"Link","editor.link.unlink.tooltip":"UnLink","editor.link.open.tooltip":"Open Link","editor.link.edit.tooltip":"Edit Link","editor.link.dialog.title":"Insert Link","editor.link.dialog.link":"Link","editor.link.dialog.text":"Text","editor.link.dialog.openInNewTab":"Open In New Tab","editor.link.dialog.link.placeholder":"Link Address","editor.link.dialog.text.placeholder":"Add Description","editor.link.dialog.button.apply":"Apply","editor.image.tooltip":"Image","editor.image.menu.flipX":"Flip vertical","editor.image.menu.flipY":"Flip horizontal","editor.image.menu.size":"Set Size","editor.image.menu.size.width":"Width","editor.image.menu.size.height":"Height","editor.image.dragger.tooltip":"Click or drag the image to the area to upload","editor.image.float.left.tooltip":"Float left","editor.image.float.none.tooltip":"Float none","editor.image.float.right.tooltip":"Float right","editor.image.dialog.title":"Add an image","editor.image.dialog.tab.url":"Url","editor.image.dialog.tab.upload":"Upload","editor.image.dialog.uploading":"Uploading","editor.image.dialog.form.link":"Link","editor.image.dialog.placeholder":"Link","editor.image.dialog.form.alt":"Alt","editor.image.dialog.form.aspectRatio":"Lock original aspect ratio","editor.image.dialog.form.file":"File","editor.image.dialog.button.apply":"apply","editor.video.tooltip":"Video","editor.video.dialog.tab.upload":"Upload","editor.video.dialog.uploading":"Uploading","editor.video.dialog.title":"Embed or upload a video","editor.video.dialog.link":"link","editor.video.dialog.placeholder":"Link","editor.video.dialog.button.apply":"apply","editor.table.tooltip":"Table","editor.table.menu.insert_table":"Insert Table","editor.table.menu.insert_table.with_header_row":"With header row","editor.table.menu.insertColumnBefore":"Insert Column Before","editor.table.menu.insertColumnAfter":"Insert Column After","editor.table.menu.deleteColumn":"Delete Column","editor.table.menu.insertRowAbove":"Insert Row Above","editor.table.menu.insertRowBelow":"Insert Row Below","editor.table.menu.deleteRow":"Delete Row","editor.table.menu.mergeCells":"Merge Cells","editor.table.menu.splitCells":"Split Cells","editor.table.menu.deleteTable":"Delete Table","editor.table.menu.setCellsBgColor":"Cell Background Color","editor.blockquote.tooltip":"Blockquote","editor.horizontalrule.tooltip":"Horizontal Rule","editor.code.tooltip":"Code","editor.codeblock.tooltip":"Code Block","editor.clear.tooltip":"Clear Format","editor.undo.tooltip":"Undo","editor.redo.tooltip":"Redo","editor.fullscreen.tooltip.fullscreen":"Fullscreen","editor.fullscreen.tooltip.exit":"Fullscreen Exit","editor.imageUpload.fileTypeNotSupported":"File type not supported","editor.imageUpload.fileSizeTooBig":"File size too big, Maximum size is","editor.AI.placeholder":"Ask AI ...","editor.AI.generating":"Generating","editor.AI.insert":"Insert below selection","editor.AI.replace":"Replace selected content","editor.AI.regenerate":"Regenerate","editor.AI.close":"Close","editor.AI.stop":"Stop","editor.AI.ask":"Ask AI","editor.menubar.file":"File","editor.menubar.edit":"Edit","editor.menubar.view":"View","editor.menubar.insert":"Insert","editor.menubar.format":"Format","editor.menubar.menu.newDoc":"New Document","editor.menubar.menu.restoreLastDraft":"Restore last draft","editor.menubar.menu.print":"Print","editor.menubar.menu.cut":"Cut","editor.menubar.menu.copy":"Copy","editor.menubar.menu.paste":"Paste","editor.menubar.menu.pasteAsText":"Paste as text","editor.menubar.menu.selectAll":"Select all","editor.menubar.menu.preview":"Preview","editor.menubar.menu.spellCheck":"Spell check","editor.menubar.menu.spelling":"spelling","editor.menubar.menu.superView":"Super view","editor.menubar.menu.insertSuper":"Insert super","editor.menubar.menu.articleContent":"Article content","editor.menubar.menu.articleComment":"Article comment","editor.menubar.menu.cancel":"Cancel","editor.menubar.menu.save":"Save","editor.findAndReplace.tooltip":"Find and replace","editor.findAndReplace.find":"Find","editor.findAndReplace.replace":"Replace","editor.findAndReplace.replaceAll":"Replace All","editor.findAndReplace.caseSensitive":"Case Sensitive","editor.printer.tooltip":"Print","editor.superinput":"Super input","editor.insert.symbol":"Insert symbol","editor.check":"Check","editor.detail":"Detail","editor.inputSuper":"Input Super","editor.insertSpecial":"Special characters","editor.cut":"Cut","editor.paste":"Paste","editor.selectAll":"SelectAll","editor.delete":"Delete","editor.super.edit":"Super edit","editor.super.delete":"Super delete","editor.configPlan.edit":"Config plan edit","editor.configPlan.delete":"Config plan delete","editor.super":"Super","editor.configPlan":"Config plan","editor.insertConfigPlan":"Insert config plan"},ME={"editor.remove":"제거","editor.copy":"복사","editor.words":"낱말","editor.characters":"문자","editor.default":"기본값","editor.recent":"최근 사용됨","editor.nofill":"색상 제거","editor.format":"형식 페인터","editor.close":"닫기","editor.modify":"수정","editor.preview.tooltip":"미리보기","editor.draghandle.tooltip":"클릭하여 드래그","editor.copyToClipboard":"클립보드에 복사","editor.importWord.tooltip":"Word에서 가져오기","editor.importWord.success":"가져오기 성공","editor.importWord.fileTooLarge":"파일이 너무 큽니다","editor.importWord.error":"가져오기 실패, 파일이 지원되지 않음","editor.slash":"명령을 보려면 '/'를 누르세요.","editor.slash.empty":"결과 없음","editor.slash.format":"형식","editor.slash.insert":"삽입","editor.slash.embed":"서비스 삽입","editor.content":"내용을 입력해주세요","editor.slash.hint":"내용을 입력해주세요","editor.moremark":"추가 텍스트 스타일","editor.size.small.tooltip":"작음","editor.size.medium.tooltip":"중간","editor.size.large.tooltip":"표지","editor.bold.tooltip":"굵게","editor.italic.tooltip":"기울임꼴","editor.underline.tooltip":"밑줄","editor.strike.tooltip":"스트라이크","editor.color.tooltip":"색상","editor.color.more":"색상 선택기","editor.highlight.tooltip":"강조 표시","editor.lineheight.tooltip":"줄 높이","editor.heading.tooltip":"제목","editor.heading.h1.tooltip":"제목 1","editor.heading.h2.tooltip":"제목 2","editor.heading.h3.tooltip":"제목 3","editor.heading.h4.tooltip":"제목 4","editor.heading.h5.tooltip":"제목 5","editor.heading.h6.tooltip":"제목 6","editor.paragraph.tooltip":"단락","editor.textalign.tooltip":"정렬","editor.textalign.left.tooltip":"왼쪽","editor.textalign.center.tooltip":"가운데","editor.textalign.right.tooltip":"오른쪽","editor.textalign.justify.tooltip":"정렬","editor.indent":"들여쓰기","editor.indent.indent":"들여쓰기","editor.indent.outdent":"들여쓰기 줄이기","editor.fontFamily.tooltip":"글꼴 모음","editor.fontFamily.default":"기본값","editor.fontFamily.gulim":"굴림","editor.fontFamily.dotum":"돋움","editor.fontFamily.gungsuh":"궁서","editor.fontSize.tooltip":"글꼴 크기","editor.fontSize.default.tooltip":"기본값","editor.superscript.tooltip":"위 첨자","editor.subscript.tooltip":"아래첨자","editor.bulletlist.tooltip":"글머리 기호 목록","editor.bulletlist.disc.tooltip":"디스크","editor.bulletlist.circle.tooltip":"원","editor.bulletlist.square.tooltip":"사각형","editor.orderedlist.tooltip":"순서가 지정된 목록","editor.orderedlist.decimal.tooltip":"십진수","editor.orderedlist.decimalLeadingZero.tooltip":"앞에 0이 있는 십진수","editor.orderedlist.lowerRoman.tooltip":"하위 로마자","editor.orderedlist.upperRoman.tooltip":"상위 로마자","editor.orderedlist.lowerLatin.tooltip":"하위 라틴어","editor.orderedlist.upperLatin.tooltip":"상위 라틴어","editor.orderedlist.tradChinaInformal.tooltip":"중국어 비공식","editor.orderedlist.simpChinaFormal.tooltip":"간체 중국어 비공식","editor.tasklist.tooltip":"작업 목록","editor.indent.tooltip":"들여쓰기","editor.outdent.tooltip":"내어쓰기","editor.columns.tooltip":"열","editor.link.tooltip":"링크","editor.link.unlink.tooltip":"링크 해제","editor.link.open.tooltip":"링크 열기","editor.link.edit.tooltip":"링크 편집","editor.link.dialog.title":"링크 삽입","editor.link.dialog.link":"링크","editor.link.dialog.text":"텍스트","editor.link.dialog.openInNewTab":"새 탭에서 열기","editor.link.dialog.link.placeholder":"링크 주소","editor.link.dialog.text.placeholder":"설명 추가","editor.link.dialog.button.apply":"적용","editor.image.tooltip":"이미지","editor.image.menu.flipX":"세로 뒤집기","editor.image.menu.flipY":"가로 뒤집기","editor.image.menu.size":"크기 설정","editor.image.menu.size.width":"너비","editor.image.menu.size.height":"높이","editor.image.dragger.tooltip":"업로드할 영역으로 이미지를 클릭하거나 드래그하세요.","editor.image.float.left.tooltip":"왼쪽으로 부동","editor.image.float.none.tooltip":"부동 없음","editor.image.float.right.tooltip":"오른쪽으로 부동","editor.image.dialog.title":"이미지 추가","editor.image.dialog.tab.url":"URL","editor.image.dialog.tab.upload":"업로드","editor.image.dialog.uploading":"업로드 중","editor.image.dialog.form.link":"링크","editor.image.dialog.placeholder":"링크","editor.image.dialog.form.alt":"Alt","editor.image.dialog.form.aspectRatio":"원본 가로 세로 비율 잠금","editor.image.dialog.form.file":"파일","editor.image.dialog.button.apply":"적용","editor.video.tooltip":"비디오","editor.video.dialog.tab.upload":"업로드","editor.video.dialog.uploading":"업로드 중","editor.video.dialog.title":"동영상 삽입 또는 업로드","editor.video.dialog.link":"링크","editor.video.dialog.placeholder":"링크","editor.video.dialog.button.apply":"적용","editor.table.tooltip":"테이블","editor.table.menu.insert_table":"테이블 삽입","editor.table.menu.insert_table.with_header_row":"머리글 행 포함","editor.table.menu.insertColumnBefore":"앞에 열 삽입","editor.table.menu.insertColumnAfter":"다음에 열 삽입","editor.table.menu.deleteColumn":"열 삭제","editor.table.menu.insertRowAbove":"위에 행 삽입","editor.table.menu.insertRowBelow":"아래에 행 삽입","editor.table.menu.deleteRow":"행 삭제","editor.table.menu.mergeCells":"셀 병합","editor.table.menu.splitCells":"셀 분할","editor.table.menu.deleteTable":"테이블 삭제","editor.table.menu.setCellsBgColor":"셀 배경색","editor.blockquote.tooltip":"블록인용","editor.horizontalrule.tooltip":"수평 규칙","editor.code.tooltip":"코드","editor.codeblock.tooltip":"코드 블록","editor.clear.tooltip":"형식 지우기","editor.undo.tooltip":"실행 취소","editor.redo.tooltip":"다시 실행","editor.fullscreen.tooltip.fullscreen":"전체 화면","editor.fullscreen.tooltip.exit":"전체 화면 종료","editor.imageUpload.fileTypeNotSupported":"지원되지 않는 파일 형식","editor.imageUpload.fileSizeTooBig":"파일 크기가 너무 큽니다. 최대 크기는 다음과 같습니다.","editor.AI.placeholder":"AI에게 물어보세요...","editor.AI.geneating":"생성","editor.AI.insert":"선택 항목 아래에 삽입","editor.AI.replace":"선택한 콘텐츠 교체","editor.AI.regenerate":"재생성","editor.AI.close":"닫기","editor.AI.stop":"중지","editor.AI.ask":"AI에게 물어보세요","editor.menubar.file":"파일","editor.menubar.edit":"편집","editor.menubar.view":"보기","editor.menubar.insert":"삽입","editor.menubar.format":"형식","editor.menubar.menu.newDoc":"새 문서","editor.menubar.menu.restoreLastDraft":"마지막 초안 복원","editor.menubar.menu.print":"인쇄","editor.menubar.menu.cut":"잘라내기","editor.menubar.menu.copy":"복사","editor.menubar.menu.paste":"붙여넣기","editor.menubar.menu.pasteAsText":"텍스트로 붙여넣기","editor.menubar.menu.selectAll":"모두 선택","editor.menubar.menu.preview":"미리보기","editor.menubar.menu.spellCheck":"맞춤법 검사","editor.menubar.menu.spelling":"맞춤법","editor.menubar.menu.superView":"수퍼보기","editor.menubar.menu.insertSuper":"수퍼 넣기","editor.menubar.menu.articleContent":"앵커멘트","editor.menubar.menu.articleComment":"상세 텍스트","editor.menubar.menu.cancel":"취소","editor.menubar.menu.save":"저장","editor.findAndReplace.tooltip":"찾기 및 바꾸기","editor.findAndReplace.find":"찾기","editor.findAndReplace.replace":"바꾸기","editor.findAndReplace.replaceAll":"모두 바꾸기","editor.findAndReplace.caseSensitive":"대소문자 구분","editor.printer.tooltip":"인쇄","editor.superinput":"수퍼입력","editor.insert.symbol":"기호삽입","editor.check":"확인","editor.detail":"내용","editor.inputSuper":"수퍼 작성","editor.insertSpecial":"특수문자","editor.cut":"잘라내기","editor.paste":"붙여넣기","editor.selectAll":"모두선택","editor.delete":"삭제","editor.super.edit":"수퍼 수정","editor.super.delete":"수퍼 삭제","editor.configPlan.edit":"구성안 수정","editor.configPlan.delete":"구성안 삭제","editor.super":"수퍼","editor.configPlan":"구성안","editor.insertConfigPlan":"구성안넣기"},ZY=zB({legacy:!1,locale:"en",fallbackLocale:"en",messages:{en:OE,ko:ME}});Y3();const BE={install(t){t.use(ZY),t.component("vdc-editor",Lp)}},QY=Ze.useEventBus(Kn.RENDER_SUPER_TEXT);function NY(){QY.emit({action:"render"})}Mt.ArticleCompareEditor=YY,Mt.ArticleEditor=WY,Mt.CoreEditor=Lp,Mt.DigitalNewsEditor=jY,Mt.EditorMode=Ye,Mt.SBSEditorPlugin=BE,Mt.default=BE,Mt.enUS=OE,Mt.extension=nY,Mt.koKR=ME,Mt.nodeNames=nq,Mt.updateSuperTextView=NY,Mt.useConfigTiptap=oY,Mt.useEditor=b$,Mt.useTiptapStore=tr,Object.defineProperties(Mt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
265
+ `});default:return""}}function Z(Y){return Y.every(we=>V==null?void 0:V.extensionManager.extensions.find(ze=>ze.name===we))}i.watch(()=>r.dark,()=>Ze.useToggle(_)),i.watch(()=>w.languages,()=>{V.commands.checkSpelling()}),i.watch(()=>r.modelValue,Y=>{if(!V||Et.isEqual(G(V,r.output),Y))return;const{from:we,to:ze}=V.state.selection;V.commands.setTextSelection({from:we,to:ze}),P(),V.commands.setContent(Bo(Y,r.disabled,r.mode),!1)},{deep:!0}),i.watch(()=>r.disabled,Y=>V==null?void 0:V.setEditable(!Y)),i.watch(()=>g.value,()=>{g.value&&g.value.on("selectionUpdate",({editor:Y})=>{o("changed:selection",{editor:Y})})}),i.onUnmounted(()=>{var Y;V==null||V.destroy(),(Y=z.value)==null||Y.destroy()}),wf(bf.SAVE,()=>{localStorage.setItem("content",G(V,"html"))});const oe=i.computed(()=>{var we,ze;if(!((ze=(we=z.value)==null?void 0:we.storage)!=null&&ze.superText))return!1;const{isShowSuperViewMoblie:Y}=z.value.storage.superText;return Y});i.watch(()=>z.value,(Y,we)=>{Y&&z.value.storage.superText&&(z.value.storage.superText.isShowSuperViewMoblie=we==null?void 0:we.storage.superText.isShowSuperViewMoblie)});const ne=Y=>{var ze;const we=z.value??V;if(we){const{from:wt}=we.view.state.selection;we.commands.insertContentAt(wt,{type:"superText",attrs:{"data-id":Gi(6),"data-text":Y}})}(ze=z.value)==null||ze.commands.toggleSuperInputMoblie()},Ce=Y=>{var ze;const we=z.value??V;if(we){const{from:wt}=we.view.state.selection;we.commands.insertContentAt(wt,{type:"configPlan",attrs:{"data-id":Gi(6),"data-text":Y}})}(ze=z.value)==null||ze.commands.toggleConfigPlanInput()};function _e(Y){Y===Ye.STRAIGHT&&V.commands.focus("end"),Y===Ye.EDITOR&&V.commands.focus("end")}i.onMounted(()=>{var Y,we;_e(r.mode),(Y=V==null?void 0:V.commands)!=null&&Y.setIsEnableSuggestion&&V.commands.setIsEnableSuggestion(!1),(we=V==null?void 0:V.commands)!=null&&we.setIsMobile&&V.commands.setIsMobile(!0)}),i.watch(()=>r.mode,Y=>{_e(Y)});const{showMenuSplitter:Ge,menuX:Me,menuY:ge,commentSize:W,contentSize:J,setupSplitterListeners:re,removeSplitterListeners:ie,iconSplitSelected:fe,clickIconSplitter:Ee}=yb();i.onMounted(()=>{re()}),i.onUnmounted(()=>{ie()});const Oe=i.ref();return Ze.onClickOutside(Oe,Y=>{Ge.value=!1}),bb(V),e({editor:V}),(Y,we)=>{var Le,tt,He,N,pe,le;const ze=yE,wt=vE,$=bE,D=Dx,ae=FY,ve=CE;return i.openBlock(),i.createElementBlock(i.Fragment,null,[z.value?(i.openBlock(),i.createElementBlock("div",{key:0,id:"vdc-editor",ref_key:"editorRef",ref:T,style:i.normalizeStyle(I.value),class:i.normalizeClass(i.unref($e)("vdc-editor moblie relative w-full flex flex-col",!r.height&&"flex-1",Y.editorClass,(Y.isShowLineNumber||oe.value)&&"editor-line-number",Y.disabled&&"disabled",Y.mode!==i.unref(Ye).EDITOR&&"editor-line"))},[!Y.hideBubble&&!Y.disabled&&i.unref(V).isEditable?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[Z([i.unref(Vg)])?(i.openBlock(),i.createBlock(ze,{key:0,editor:i.unref(V)},null,8,["editor"])):i.createCommentVNode("",!0),Z([i.unref(Nu)])?(i.openBlock(),i.createBlock(wt,{key:1,editor:i.unref(V)},null,8,["editor"])):i.createCommentVNode("",!0),Z([i.unref(pl)])?(i.openBlock(),i.createBlock($,{key:2,editor:i.unref(V)},null,8,["editor"])):i.createCommentVNode("",!0),Z([i.unref(hl),i.unref(ml)])?(i.openBlock(),i.createBlock(D,{key:3,editor:i.unref(V)},null,8,["editor"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),Y.hideToolbar?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(ae,{key:1,editor:z.value,mode:Y.mode,disabled:Y.disabled,class:"mb-[3px]"},null,8,["editor","mode","disabled"])),i.createVNode(i.unref(SE),{class:i.normalizeClass(i.unref($e)("flex flex-col [&_*]:!font-inherit [&_*]:!text-font-size-inherit",k.value&&"[&_*]:!font-inherit",C.value&&"[&_*]:!text-font-size-inherit")),style:i.normalizeStyle({...A.value,height:i.unref(gn)(i.unref(B))}),horizontal:"",onReady:i.unref(re),onResized:i.unref(re)},{default:i.withCtx(()=>[Y.mode===i.unref(Ye).REPORT||Y.mode===i.unref(Ye).EDITOR&&Y.isScreenSplit?(i.openBlock(),i.createBlock(i.unref(ac),{key:0,size:i.unref(W),class:"border-none p-0 flex flex-col"},{default:i.withCtx(()=>{var be,Fe;return[(be=Y.titleBarComment)!=null&&be.title?(i.openBlock(),i.createBlock(vb,{key:0,"title-bar":Y.titleBarComment,class:"mb-[3px]"},null,8,["title-bar"])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(i.unref($e)("!overflow-y-scroll flex h-full flex-col pt-1.5 p-2.5 border border-ed-gray rounded-[5px]",((Fe=K.value)==null?void 0:Fe.isFocused)&&"border-ed-blue",Y.disabled&&"border-transparent"))},[i.createVNode(HY,{ref_key:"editorCommentRef",ref:K,mode:Y.mode,extensions:Y.extensions,"model-value":r.comment,disabled:r.disabled,"is-open-super-view":oe.value,"field-name-comment":Y.fieldNameComment,"is-show-format-control-bar":Y.isShowFormatControlBar,"onUpdate:modelValue":we[0]||(we[0]=nt=>o("update:comment",nt)),onSetEditorSelected:U},null,8,["mode","extensions","model-value","disabled","is-open-super-view","field-name-comment","is-show-format-control-bar"])],2)]}),_:1},8,["size"])):i.createCommentVNode("",!0),i.createVNode(i.unref(ac),{size:i.unref(J),class:"border-none p-0 flex flex-col"},{default:i.withCtx(()=>{var be,Fe;return[(be=Y.titleBarContent)!=null&&be.title?(i.openBlock(),i.createBlock(vb,{key:0,"title-bar":Y.titleBarContent,class:"mb-[3px]"},null,8,["title-bar"])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(i.unref($e)("flex-1 !overflow-y-auto flex flex-col pt-1.5 p-2.5 border border-ed-gray rounded-[5px]",q.value&&"border-ed-blue",Y.disabled&&"border-transparent"))},[(Fe=Y.fieldNameContent)!=null&&Fe.label?(i.openBlock(),i.createBlock(_E,{key:0,"field-name":Y.fieldNameContent,mode:Y.mode,disabled:Y.disabled,class:"mb-1"},null,8,["field-name","mode","disabled"])):i.createCommentVNode("",!0),Y.isShowFormatControlBar?(i.openBlock(),i.createBlock(ve,{key:1,editor:i.unref(V),mode:Y.mode,disabled:Y.disabled,class:"mb-[3px]"},null,8,["editor","mode","disabled"])):i.createCommentVNode("",!0),i.createVNode(EE,{editor:i.unref(V),mode:Y.mode},{default:i.withCtx(()=>[i.createVNode(i.unref(Lu),{editor:i.unref(V),spellcheck:"true",class:"flex-1 flex-col"},null,8,["editor"])]),_:1},8,["editor","mode"])],2)]}),_:1},8,["size"])]),_:1},8,["class","style","onReady","onResized"])],6)):i.createCommentVNode("",!0),i.unref(Ge)&&!Y.disabled?(i.openBlock(),i.createBlock(kE,{key:1,ref_key:"splitToastRef",ref:Oe,"icon-split-selected":i.unref(fe),"menu-x":i.unref(Me),"menu-y":i.unref(ge),onOnChangeSplit:i.unref(Ee)},null,8,["icon-split-selected","menu-x","menu-y","onOnChangeSplit"])):i.createCommentVNode("",!0),(Le=z.value)!=null&&Le.storage.superText?(i.openBlock(),i.createBlock(mp,{key:2,open:(tt=z.value)==null?void 0:tt.storage.superText.isShowSuperInputMoblie,"is-view-mode":!((He=z.value)!=null&&He.storage.superText.isShowSuperInputMoblie),editor:z.value,onClose:we[1]||(we[1]=be=>z.value.commands.toggleSuperInputMoblie()),onSave:ne},null,8,["open","is-view-mode","editor"])):i.createCommentVNode("",!0),(N=z.value)!=null&&N.storage.configPlan?(i.openBlock(),i.createBlock(mp,{key:3,open:(pe=z.value)==null?void 0:pe.storage.configPlan.isShowConfigPlanInput,"is-view-mode":!((le=z.value)!=null&&le.storage.configPlan.isShowConfigPlanInput),editor:z.value,title:Y.$t("editor.configPlan"),onClose:we[2]||(we[2]=be=>z.value.commands.toggleConfigPlanInput()),onSave:Ce},null,8,["open","is-view-mode","editor","title"])):i.createCommentVNode("",!0)],64)}}}),WY=i.defineComponent({__name:"ArticleEditor",props:{mode:{default:Ye.STRAIGHT},isMobile:{type:Boolean},superTextArea:{},modelValue:{},comment:{},fontSizeDefault:{},fontFamilyDefault:{},isOpenSuperView:{type:Boolean},output:{},dark:{type:Boolean},disabled:{type:Boolean},hideToolbar:{type:Boolean},isShowFormatControlBar:{type:Boolean},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameContent:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean},hideBubble:{type:Boolean},maxWidth:{},minHeight:{},maxHeight:{},height:{},extensions:{},editorClass:{},contentClass:{},isCompare:{type:Boolean},autoHeight:{type:Boolean},autoResize:{type:Boolean}},setup(t){const e=t;return(n,r)=>e.isMobile?(i.openBlock(),i.createBlock(lc,i.mergeProps({key:1},e,{"onUpdate:modelValue":r[2]||(r[2]=o=>n.$emit("update:modelValue",o)),"onUpdate:comment":r[3]||(r[3]=o=>n.$emit("update:comment",o))}),null,16)):(i.openBlock(),i.createBlock(Lp,i.mergeProps({key:0},e,{"onUpdate:modelValue":r[0]||(r[0]=o=>n.$emit("update:modelValue",o)),"onUpdate:comment":r[1]||(r[1]=o=>n.$emit("update:comment",o))}),null,16))}}),jY=i.defineComponent({__name:"DigitalNewsEditor",props:{mode:{default:Ye.EDITOR},isMobile:{type:Boolean},superTextArea:{},modelValue:{},comment:{},fontSizeDefault:{},fontFamilyDefault:{},isOpenSuperView:{type:Boolean},output:{},dark:{type:Boolean},disabled:{type:Boolean},hideToolbar:{type:Boolean},isShowFormatControlBar:{type:Boolean},titleBarComment:{},titleBarContent:{},fieldNameComment:{},fieldNameContent:{},isScreenSplit:{},isShowLineNumber:{type:Boolean},hideMenubar:{type:Boolean},disableBubble:{type:Boolean},hideBubble:{type:Boolean},maxWidth:{},minHeight:{},maxHeight:{},height:{},extensions:{},editorClass:{},contentClass:{},isCompare:{type:Boolean},autoHeight:{type:Boolean},autoResize:{type:Boolean}},setup(t){const e=t;return(n,r)=>{const o=Lp,s=lc;return e.isMobile?(i.openBlock(),i.createBlock(s,i.mergeProps({key:1},e,{"onUpdate:modelValue":r[1]||(r[1]=a=>n.$emit("update:modelValue",a)),"onUpdate:comment":r[2]||(r[2]=a=>n.$emit("update:comment",a))}),null,16)):(i.openBlock(),i.createBlock(o,i.mergeProps({key:0},e,{"onUpdate:modelValue":r[0]||(r[0]=a=>n.$emit("update:modelValue",a))}),null,16))}}});var TE={exports:{}};(function(t){(function(){function e(z){return z===">"}function n(z){return z==="<"}function r(z){return/^\s+$/.test(z)}function o(z){var U=z.match(/^\s*<([^!>][^>]*)>\s*$/);return!!U&&U[1].trim().split(" ")[0]}function s(z){return!o(z)}function a(z){return/^<!--/.test(z)}function l(z){return/--\>$/.test(z)}var u,c=new RegExp("^<(iframe|object|math|svg|script|video|head|style|a)");function f(z){var U=u.exec(z);return U&&U[1]}function h(z,U){return z.substring(z.length-U.length-2)==="</"+U}function m(z){return/^\s*<[^>]+\/>\s*$/.test(z)}function g(z){var U=/^<img[\s>]/.test(z);return U||s(z)||f(z)||m(z)}function b(z){return{string:z,key:x(z)}}function y(z,U,P,G){this.segment=G,this.length=P,this.startInBefore=z+G.beforeIndex,this.startInAfter=U+G.afterIndex,this.endInBefore=this.startInBefore+this.length-1,this.endInAfter=this.startInAfter+this.length-1,this.segmentStartInBefore=z,this.segmentStartInAfter=U,this.segmentEndInBefore=this.segmentStartInBefore+this.length-1,this.segmentEndInAfter=this.segmentStartInAfter+this.length-1}function w(z){for(var U="char",P="",G="",Z=[],oe=0;oe<z.length;oe++){var ne=z[oe];switch(U){case"tag":var Ce=f(P);Ce?(U="atomic_tag",G=Ce,P+=ne):a(P)?(U="html_comment",P+=ne):e(ne)?(P+=">",Z.push(b(P)),P="",r(ne)?U="whitespace":U="char"):P+=ne;break;case"atomic_tag":e(ne)&&h(P,G)?(P+=">",Z.push(b(P)),P="",G="",U="char"):P+=ne;break;case"html_comment":P+=ne,l(P)&&(P="",U="char");break;case"char":n(ne)?(P&&Z.push(b(P)),P="<",U="tag"):/\s/.test(ne)?(P&&Z.push(b(P)),P=ne,U="whitespace"):/[\w\d\#@]/.test(ne)?P+=ne:/&/.test(ne)?(P&&Z.push(b(P)),P=ne):(P+=ne,Z.push(b(P)),P="");break;case"whitespace":n(ne)?(P&&Z.push(b(P)),P="<",U="tag"):r(ne)?P+=ne:(P&&Z.push(b(P)),P=ne,U="char");break;default:throw new Error("Unknown mode "+U)}}return P&&Z.push(b(P)),Z}function x(z){var U=/^<img.*src=['"]([^"']*)['"].*>$/.exec(z);if(U)return'<img src="'+U[1]+'">';var P=/^<a.*href=['"]([^"']*)['"]/.exec(z);if(P)return'<a href="'+P[1]+'"></a>';var G=/^<object.*data=['"]([^"']*)['"]/.exec(z);if(G)return'<object src="'+G[1]+'"></object>';if(/^<(svg|math|video)[\s>]/.test(z)){var Z=z.indexOf('data-uuid="');if(Z!==-1){var oe=z.slice(0,Z),ne=z.slice(Z+44);return oe+ne}else return z}var Ce=/^<iframe.*src=['"]([^"']*)['"].*>/.exec(z);if(Ce)return'<iframe src="'+Ce[1]+'"></iframe>';var _e=/<([^\s>]+)[\s>]/.exec(z);return _e?"<"+_e[1].toLowerCase()+">":z&&z.replace(/(\s+|&nbsp;|&#160;)/g," ")}function _(z){return z.reduce(function(U,P,G){return U[P.key]?U[P.key].push(G):U[P.key]=[G],U},Object.create(null))}function S(z,U){return U.endInBefore<z.startInBefore&&U.endInAfter<z.startInAfter?-1:U.startInBefore>z.endInBefore&&U.startInAfter>z.endInAfter?1:0}function C(){this._root=null}C.prototype={add:function(z){var U={value:z,left:null,right:null},P=this._root;if(P)for(;;){var G=S(P.value,z);if(G===-1)if(P.left)P=P.left;else{P.left=U;break}else if(G===1)if(P.right)P=P.right;else{P.right=U;break}else break}else this._root=U},toArray:function(){function z(U,P){return U&&(z(U.left,P),P.push(U.value),z(U.right,P)),P}return z(this._root,[])}};function k(z){for(var U=z.beforeTokens,P=z.afterMap,G=null,Z=null,oe=0;oe<U.length;oe++){var ne=!1,Ce=U.length-oe;if(Z&&Ce<Z.length)break;var _e=U[oe];if(_e.key===" "){G=oe;continue}G===oe-1&&(ne=!0);var Ge=P[_e.key];Ge&&Ge.forEach(function(Me){var ge=Z?Z.length:0,W=A(z,oe,Me,ge,ne);W&&W.length>ge&&(Z=W)})}return Z}function A(z,U,P,G,Z){var oe=z.beforeTokens,ne=z.afterTokens,Ce=U+G,_e=P+G;if(!(Ce>=oe.length||_e>=ne.length)){if(G){var Ge=oe[Ce].key,Me=ne[_e].key;if(Ge!==Me)return}for(var ge=!0,W=1,J=U+W,re=P+W;ge&&J<oe.length&&re<ne.length;){var ie=oe[J].key,fe=ne[re].key;ie===fe?(W++,J=U+W,re=P+W):ge=!1}if(Z&&U>0&&P>0){var Ee=oe[U-1].key,Oe=ne[P-1].key;Ee===" "&&Oe===" "&&(U--,P--,W++)}return new y(U,P,W,z)}}function T(z,U,P,G){return{beforeTokens:z,afterTokens:U,beforeMap:_(z),afterMap:_(U),beforeIndex:P,afterIndex:G}}function B(z){for(var U=new C,P,G=[z];G.length;)if(z=G.pop(),P=k(z),P&&P.length){if(P.segmentStartInBefore>0&&P.segmentStartInAfter>0){var Z=z.beforeTokens.slice(0,P.segmentStartInBefore),oe=z.afterTokens.slice(0,P.segmentStartInAfter);G.push(T(Z,oe,z.beforeIndex,z.afterIndex))}var ne=z.beforeTokens.slice(P.segmentEndInBefore+1),Ce=z.afterTokens.slice(P.segmentEndInAfter+1),_e=z.beforeIndex+P.segmentEndInBefore+1,Ge=z.afterIndex+P.segmentEndInAfter+1;ne.length&&Ce.length&&G.push(T(ne,Ce,_e,Ge)),U.add(P)}return U.toArray()}function L(z,U){if(!z)throw new Error("Missing beforeTokens");if(!U)throw new Error("Missing afterTokens");var P=0,G=0,Z=[],oe=T(z,U,0,0),ne=B(oe);ne.push(new y(z.length,U.length,0,oe));for(var Ce=0;Ce<ne.length;Ce++){var _e=ne[Ce],Ge="none";P===_e.startInBefore?G!==_e.startInAfter&&(Ge="insert"):(Ge="delete",G!==_e.startInAfter&&(Ge="replace")),Ge!=="none"&&Z.push({action:Ge,startInBefore:P,endInBefore:Ge!=="insert"?_e.startInBefore-1:null,startInAfter:G,endInAfter:Ge!=="delete"?_e.startInAfter-1:null}),_e.length!==0&&Z.push({action:"equal",startInBefore:_e.startInBefore,endInBefore:_e.endInBefore,startInAfter:_e.startInAfter,endInAfter:_e.endInAfter}),P=_e.endInBefore+1,G=_e.endInAfter+1}var Me=[],ge={action:"none"};function W(ie){return ie.action!=="equal"||ie.endInBefore-ie.startInBefore!==0?!1:/^\s$/.test(z.slice(ie.startInBefore,ie.endInBefore+1))}for(var J=0;J<Z.length;J++){var re=Z[J];W(re)&&ge.action==="replace"||re.action==="replace"&&ge.action==="replace"?(ge.endInBefore=re.endInBefore,ge.endInAfter=re.endInAfter):(Me.push(re),ge=re)}return Me}function I(z){this.tokens=z,this.notes=z.reduce(function(U,P,G){U.notes.push({isWrappable:g(P),insertedTag:!1});var Z=!m(P)&&o(P),oe=U.tagStack[U.tagStack.length-1];return Z&&(oe&&"/"+oe.tag===Z?(U.notes[oe.position].insertedTag=!0,U.tagStack.pop()):U.tagStack.push({tag:Z,position:G})),U},{notes:[],tagStack:[]}).notes}I.prototype.combine=function(z,U){var P=this.notes,G=this.tokens.slice(),Z=G.reduce(function(oe,ne,Ce){P[Ce].insertedTag&&(G[Ce]=U(G[Ce])),oe.status===null&&(oe.status=P[Ce].isWrappable);var _e=P[Ce].isWrappable;return _e!==oe.status&&(oe.list.push({isWrappable:oe.status,tokens:G.slice(oe.lastIndex,Ce)}),oe.lastIndex=Ce,oe.status=_e),Ce===G.length-1&&oe.list.push({isWrappable:oe.status,tokens:G.slice(oe.lastIndex,Ce+1)}),oe},{list:[],status:null,lastIndex:0}).list;return Z.map(z).join("")};function V(z,U,P,G,Z){var oe=new I(U);G=G?G+"-":"";var ne=" data-"+G+'operation-index="'+P+'"';return Z&&(ne+=' class="'+Z+'"'),oe.combine(function(Ce){if(Ce.isWrappable){var _e=Ce.tokens.join("");if(_e.trim())return"<"+z+ne+">"+_e+"</"+z+">"}else return Ce.tokens.join("");return""},function(Ce){var _e=' data-diff-node="'+z+'"';return _e+=" data-"+G+'operation-index="'+P+'"',Ce.replace(/>\s*$/,_e+"$&")})}var q={equal:function(z,U,P,G,Z,oe){var ne=P.slice(z.startInAfter,z.endInAfter+1);return ne.reduce(function(Ce,_e){return Ce+_e.string},"")},insert:function(z,U,P,G,Z,oe){var ne=P.slice(z.startInAfter,z.endInAfter+1),Ce=ne.map(function(_e){return _e.string});return V("ins",Ce,G,Z,oe)},delete:function(z,U,P,G,Z,oe){var ne=U.slice(z.startInBefore,z.endInBefore+1),Ce=ne.map(function(_e){return _e.string});return V("del",Ce,G,Z,oe)},replace:function(){return q.delete.apply(null,arguments)+q.insert.apply(null,arguments)}};function K(z,U,P,G,Z){return P.reduce(function(oe,ne,Ce){return oe+q[ne.action](ne,z,U,Ce,G,Z)},"")}function me(z,U,P,G,Z){if(z===U)return z;Z?u=new RegExp("^<("+Z.replace(/\s*/g,"").replace(/,/g,"|")+")"):u=c,z=w(z),U=w(U);var oe=L(z,U);return K(z,U,oe,G,P)}me.htmlToTokens=w,me.findMatchingBlocks=B,B.findBestMatch=k,B.createMap=_,B.createToken=b,B.createSegment=T,B.getKeyForToken=x,me.calculateOperations=L,me.renderOperations=K,t!==null?t.exports=me:this.htmldiff=me}).call(Ea)})(TE);var qY=TE.exports;const KY=cO(qY),AE=(t,e,n)=>{let r="";{const o=Bo(t,n),s=Bo(e,n);r=KY(o,s,null,null,"button")}return r=r.replace(/<del[^>]*>/g,'<mark style="background:#ffa8a8;color:white;">').replace(/<\/del>/g,"</mark>").replace(/<ins[^>]*>/g,'<mark style="background:#42424266;">').replace(/<\/ins>/g,"</mark>"),r},GY={class:"border border-ed-gray rounded-[5px] p-2.5 flex-1 overflow-y-auto"},XY={class:"border border-ed-gray rounded-[5px] p-2.5 h-full"},JY={class:"border border-ed-gray rounded-[5px] p-2.5 flex-1 overflow-y-auto"},YY=ri(i.defineComponent({__name:"ArticleCompareEditor",props:{originalData:{},changedData:{},extensions:{},editorClass:{}},setup(t){const e=t,n=i.ref(!1),r=i.computed(()=>!e.originalData||!e.changedData?{comment:"",content:""}:{comment:AE(e.originalData.comment,e.changedData.comment,!0),content:AE(e.originalData.content,e.changedData.content,!0)}),{showMenuSplitter:o,menuX:s,menuY:a,commentSize:l,contentSize:u,setupSplitterListeners:c,removeSplitterListeners:f,iconSplitSelected:h,clickIconSplitter:m}=yb();i.onMounted(()=>{c()}),i.onUnmounted(()=>{f()});const g=i.ref();return Ze.onClickOutside(g,b=>{o.value=!1}),(b,y)=>{const w=vb;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",{class:i.normalizeClass(i.unref($e)("h-[600px]",b.editorClass))},[i.createVNode(i.unref(SE),{horizontal:"",onReady:i.unref(c),onResized:i.unref(c)},{default:i.withCtx(()=>[i.createVNode(i.unref(ac),{size:i.unref(l),class:"flex flex-col"},{default:i.withCtx(()=>{var x,_,S,C,k,A;return[(_=(x=b.originalData)==null?void 0:x.titleBar)!=null&&_.title?(i.openBlock(),i.createBlock(w,{key:0,"title-bar":b.originalData.titleBar,class:"text-[12px] mb-[3px]"},null,8,["title-bar"])):i.createCommentVNode("",!0),i.createElementVNode("div",GY,[i.createVNode(lc,{"editor-class":"h-full",mode:i.unref(Ye).REPORT,disabled:"","hide-toolbar":"",extensions:b.extensions,"field-name-comment":(S=b.originalData)==null?void 0:S.fieldNameComment,"field-name-content":(C=b.originalData)==null?void 0:C.fieldNameContent,comment:(k=b.originalData)==null?void 0:k.comment,"model-value":(A=b.originalData)==null?void 0:A.content},null,8,["mode","extensions","field-name-comment","field-name-content","comment","model-value"])])]}),_:1},8,["size"]),i.unref(n)?(i.openBlock(),i.createBlock(i.unref(ac),{key:0},{default:i.withCtx(()=>{var x,_,S,C;return[i.createElementVNode("div",XY,[i.createVNode(lc,{"editor-class":"h-full",mode:i.unref(Ye).REPORT,disabled:"","hide-toolbar":"",extensions:b.extensions,"field-name-comment":(x=b.changedData)==null?void 0:x.fieldNameComment,"field-name-content":(_=b.changedData)==null?void 0:_.fieldNameContent,comment:(S=b.changedData)==null?void 0:S.comment,"model-value":(C=b.changedData)==null?void 0:C.content},null,8,["mode","extensions","field-name-comment","field-name-content","comment","model-value"])])]}),_:1})):i.createCommentVNode("",!0),i.createVNode(i.unref(ac),{size:i.unref(u),class:"flex flex-col"},{default:i.withCtx(()=>{var x,_,S,C,k;return[(_=(x=b.changedData)==null?void 0:x.titleBar)!=null&&_.title?(i.openBlock(),i.createBlock(w,{key:0,"title-bar":(S=b.changedData)==null?void 0:S.titleBar,class:"text-[12px] mb-[3px]","custom-class":"bg-[#34c759]"},null,8,["title-bar"])):i.createCommentVNode("",!0),i.createElementVNode("div",JY,[i.createVNode(lc,{"editor-class":"h-full",mode:i.unref(Ye).REPORT,disabled:"","hide-toolbar":"",extensions:b.extensions,"field-name-comment":(C=b.changedData)==null?void 0:C.fieldNameComment,"field-name-content":(k=b.changedData)==null?void 0:k.fieldNameContent,comment:i.unref(r).comment,"model-value":i.unref(r).content},null,8,["mode","extensions","field-name-comment","field-name-content","comment","model-value"])])]}),_:1},8,["size"])]),_:1},8,["onReady","onResized"])],2),i.unref(o)?(i.openBlock(),i.createBlock(kE,{key:0,ref_key:"splitRef",ref:g,"icon-split-selected":i.unref(h),"menu-x":i.unref(s),"menu-y":i.unref(a),onOnChangeSplit:i.unref(m)},null,8,["icon-split-selected","menu-x","menu-y","onOnChangeSplit"])):i.createCommentVNode("",!0)],64)}}}),[["__scopeId","data-v-d4502f7a"]]),OE={"editor.remove":"Remove","editor.copy":"Copy","editor.words":"WORDS","editor.characters":"CHARACTERS","editor.default":"Default","editor.recent":"Recently Used","editor.nofill":"Remove Color","editor.format":"Format Painter","editor.close":"Close","editor.modify":"Modify","editor.preview.tooltip":"Preview","editor.draghandle.tooltip":"Click And Drag","editor.copyToClipboard":"CopyToClipboard","editor.importWord.tooltip":"Import from Word","editor.importWord.success":"Import Success","editor.importWord.fileTooLarge":"File is Too large","editor.importWord.error":"Import Failed, File not supported","editor.slash":"Press '/' for commands","editor.slash.empty":"No Result","editor.slash.format":"Format","editor.slash.insert":"Insert","editor.slash.embed":"Embed Services","editor.content":"Please input content","editor.slash.hint":"Please input content","editor.moremark":"More Text Styles","editor.size.small.tooltip":"Small","editor.size.medium.tooltip":"Medium","editor.size.large.tooltip":"Cover","editor.bold.tooltip":"Bold","editor.italic.tooltip":"Italic","editor.underline.tooltip":"Underline","editor.strike.tooltip":"Strike","editor.color.tooltip":"Color","editor.color.more":"Color Picker","editor.highlight.tooltip":"Highlight","editor.lineheight.tooltip":"Line Height","editor.heading.tooltip":"Headings","editor.heading.h1.tooltip":"Heading 1","editor.heading.h2.tooltip":"Heading 2","editor.heading.h3.tooltip":"Heading 3","editor.heading.h4.tooltip":"Heading 4","editor.heading.h5.tooltip":"Heading 5","editor.heading.h6.tooltip":"Heading 6","editor.paragraph.tooltip":"Paragraph","editor.textalign.tooltip":"Align","editor.textalign.left.tooltip":"Left","editor.textalign.center.tooltip":"Center","editor.textalign.right.tooltip":"Right","editor.textalign.justify.tooltip":"Justify","editor.indent":"Indent","editor.indent.indent":"Increase Indent","editor.indent.outdent":"Decrease Indent","editor.fontFamily.tooltip":"Font family","editor.fontFamily.default":"Default","editor.fontFamily.gulim":"Gulim","editor.fontFamily.dotum":"Dotum","editor.fontFamily.gungsuh":"Gungsuh","editor.fontSize.tooltip":"Font size","editor.fontSize.default.tooltip":"Default","editor.superscript.tooltip":"Superscript","editor.subscript.tooltip":"Subscript","editor.bulletlist.tooltip":"Bullet List","editor.bulletlist.disc.tooltip":"Disc","editor.bulletlist.circle.tooltip":"Circle","editor.bulletlist.square.tooltip":"Square","editor.orderedlist.tooltip":"Ordered List","editor.orderedlist.decimal.tooltip":"Decimal","editor.orderedlist.decimalLeadingZero.tooltip":"Decimal with leading zero","editor.orderedlist.lowerRoman.tooltip":"Lower Roman","editor.orderedlist.upperRoman.tooltip":"Upper Roman","editor.orderedlist.lowerLatin.tooltip":"Lower Latin","editor.orderedlist.upperLatin.tooltip":"Upper Latin","editor.orderedlist.tradChineseInformal.tooltip":"Trad Chinese Informal","editor.orderedlist.simpChineseFormal.tooltip":"Simp Chinese Informal","editor.tasklist.tooltip":"Task List","editor.indent.tooltip":"Indent","editor.outdent.tooltip":"Outdent","editor.columns.tooltip":"Columns","editor.link.tooltip":"Link","editor.link.unlink.tooltip":"UnLink","editor.link.open.tooltip":"Open Link","editor.link.edit.tooltip":"Edit Link","editor.link.dialog.title":"Insert Link","editor.link.dialog.link":"Link","editor.link.dialog.text":"Text","editor.link.dialog.openInNewTab":"Open In New Tab","editor.link.dialog.link.placeholder":"Link Address","editor.link.dialog.text.placeholder":"Add Description","editor.link.dialog.button.apply":"Apply","editor.image.tooltip":"Image","editor.image.menu.flipX":"Flip vertical","editor.image.menu.flipY":"Flip horizontal","editor.image.menu.size":"Set Size","editor.image.menu.size.width":"Width","editor.image.menu.size.height":"Height","editor.image.dragger.tooltip":"Click or drag the image to the area to upload","editor.image.float.left.tooltip":"Float left","editor.image.float.none.tooltip":"Float none","editor.image.float.right.tooltip":"Float right","editor.image.dialog.title":"Add an image","editor.image.dialog.tab.url":"Url","editor.image.dialog.tab.upload":"Upload","editor.image.dialog.uploading":"Uploading","editor.image.dialog.form.link":"Link","editor.image.dialog.placeholder":"Link","editor.image.dialog.form.alt":"Alt","editor.image.dialog.form.aspectRatio":"Lock original aspect ratio","editor.image.dialog.form.file":"File","editor.image.dialog.button.apply":"apply","editor.video.tooltip":"Video","editor.video.dialog.tab.upload":"Upload","editor.video.dialog.uploading":"Uploading","editor.video.dialog.title":"Embed or upload a video","editor.video.dialog.link":"link","editor.video.dialog.placeholder":"Link","editor.video.dialog.button.apply":"apply","editor.table.tooltip":"Table","editor.table.menu.insert_table":"Insert Table","editor.table.menu.insert_table.with_header_row":"With header row","editor.table.menu.insertColumnBefore":"Insert Column Before","editor.table.menu.insertColumnAfter":"Insert Column After","editor.table.menu.deleteColumn":"Delete Column","editor.table.menu.insertRowAbove":"Insert Row Above","editor.table.menu.insertRowBelow":"Insert Row Below","editor.table.menu.deleteRow":"Delete Row","editor.table.menu.mergeCells":"Merge Cells","editor.table.menu.splitCells":"Split Cells","editor.table.menu.deleteTable":"Delete Table","editor.table.menu.setCellsBgColor":"Cell Background Color","editor.blockquote.tooltip":"Blockquote","editor.horizontalrule.tooltip":"Horizontal Rule","editor.code.tooltip":"Code","editor.codeblock.tooltip":"Code Block","editor.clear.tooltip":"Clear Format","editor.undo.tooltip":"Undo","editor.redo.tooltip":"Redo","editor.fullscreen.tooltip.fullscreen":"Fullscreen","editor.fullscreen.tooltip.exit":"Fullscreen Exit","editor.imageUpload.fileTypeNotSupported":"File type not supported","editor.imageUpload.fileSizeTooBig":"File size too big, Maximum size is","editor.AI.placeholder":"Ask AI ...","editor.AI.generating":"Generating","editor.AI.insert":"Insert below selection","editor.AI.replace":"Replace selected content","editor.AI.regenerate":"Regenerate","editor.AI.close":"Close","editor.AI.stop":"Stop","editor.AI.ask":"Ask AI","editor.menubar.file":"File","editor.menubar.edit":"Edit","editor.menubar.view":"View","editor.menubar.insert":"Insert","editor.menubar.format":"Format","editor.menubar.menu.newDoc":"New Document","editor.menubar.menu.restoreLastDraft":"Restore last draft","editor.menubar.menu.print":"Print","editor.menubar.menu.cut":"Cut","editor.menubar.menu.copy":"Copy","editor.menubar.menu.paste":"Paste","editor.menubar.menu.pasteAsText":"Paste as text","editor.menubar.menu.selectAll":"Select all","editor.menubar.menu.preview":"Preview","editor.menubar.menu.spellCheck":"Spell check","editor.menubar.menu.spelling":"spelling","editor.menubar.menu.superView":"Super view","editor.menubar.menu.insertSuper":"Insert super","editor.menubar.menu.articleContent":"Article content","editor.menubar.menu.articleComment":"Article comment","editor.menubar.menu.cancel":"Cancel","editor.menubar.menu.save":"Save","editor.findAndReplace.tooltip":"Find and replace","editor.findAndReplace.find":"Find","editor.findAndReplace.replace":"Replace","editor.findAndReplace.replaceAll":"Replace All","editor.findAndReplace.caseSensitive":"Case Sensitive","editor.printer.tooltip":"Print","editor.superinput":"Super input","editor.insert.symbol":"Insert symbol","editor.check":"Check","editor.detail":"Detail","editor.inputSuper":"Input Super","editor.insertSpecial":"Special characters","editor.cut":"Cut","editor.paste":"Paste","editor.selectAll":"SelectAll","editor.delete":"Delete","editor.super.edit":"Super edit","editor.super.delete":"Super delete","editor.configPlan.edit":"Config plan edit","editor.configPlan.delete":"Config plan delete","editor.super":"Super","editor.configPlan":"Config plan","editor.insertConfigPlan":"Insert config plan"},ME={"editor.remove":"제거","editor.copy":"복사","editor.words":"낱말","editor.characters":"문자","editor.default":"기본값","editor.recent":"최근 사용됨","editor.nofill":"색상 제거","editor.format":"형식 페인터","editor.close":"닫기","editor.modify":"수정","editor.preview.tooltip":"미리보기","editor.draghandle.tooltip":"클릭하여 드래그","editor.copyToClipboard":"클립보드에 복사","editor.importWord.tooltip":"Word에서 가져오기","editor.importWord.success":"가져오기 성공","editor.importWord.fileTooLarge":"파일이 너무 큽니다","editor.importWord.error":"가져오기 실패, 파일이 지원되지 않음","editor.slash":"명령을 보려면 '/'를 누르세요.","editor.slash.empty":"결과 없음","editor.slash.format":"형식","editor.slash.insert":"삽입","editor.slash.embed":"서비스 삽입","editor.content":"내용을 입력해주세요","editor.slash.hint":"내용을 입력해주세요","editor.moremark":"추가 텍스트 스타일","editor.size.small.tooltip":"작음","editor.size.medium.tooltip":"중간","editor.size.large.tooltip":"표지","editor.bold.tooltip":"굵게","editor.italic.tooltip":"기울임꼴","editor.underline.tooltip":"밑줄","editor.strike.tooltip":"스트라이크","editor.color.tooltip":"색상","editor.color.more":"색상 선택기","editor.highlight.tooltip":"강조 표시","editor.lineheight.tooltip":"줄 높이","editor.heading.tooltip":"제목","editor.heading.h1.tooltip":"제목 1","editor.heading.h2.tooltip":"제목 2","editor.heading.h3.tooltip":"제목 3","editor.heading.h4.tooltip":"제목 4","editor.heading.h5.tooltip":"제목 5","editor.heading.h6.tooltip":"제목 6","editor.paragraph.tooltip":"단락","editor.textalign.tooltip":"정렬","editor.textalign.left.tooltip":"왼쪽","editor.textalign.center.tooltip":"가운데","editor.textalign.right.tooltip":"오른쪽","editor.textalign.justify.tooltip":"정렬","editor.indent":"들여쓰기","editor.indent.indent":"들여쓰기","editor.indent.outdent":"들여쓰기 줄이기","editor.fontFamily.tooltip":"글꼴 모음","editor.fontFamily.default":"기본값","editor.fontFamily.gulim":"굴림","editor.fontFamily.dotum":"돋움","editor.fontFamily.gungsuh":"궁서","editor.fontSize.tooltip":"글꼴 크기","editor.fontSize.default.tooltip":"기본값","editor.superscript.tooltip":"위 첨자","editor.subscript.tooltip":"아래첨자","editor.bulletlist.tooltip":"글머리 기호 목록","editor.bulletlist.disc.tooltip":"디스크","editor.bulletlist.circle.tooltip":"원","editor.bulletlist.square.tooltip":"사각형","editor.orderedlist.tooltip":"순서가 지정된 목록","editor.orderedlist.decimal.tooltip":"십진수","editor.orderedlist.decimalLeadingZero.tooltip":"앞에 0이 있는 십진수","editor.orderedlist.lowerRoman.tooltip":"하위 로마자","editor.orderedlist.upperRoman.tooltip":"상위 로마자","editor.orderedlist.lowerLatin.tooltip":"하위 라틴어","editor.orderedlist.upperLatin.tooltip":"상위 라틴어","editor.orderedlist.tradChinaInformal.tooltip":"중국어 비공식","editor.orderedlist.simpChinaFormal.tooltip":"간체 중국어 비공식","editor.tasklist.tooltip":"작업 목록","editor.indent.tooltip":"들여쓰기","editor.outdent.tooltip":"내어쓰기","editor.columns.tooltip":"열","editor.link.tooltip":"링크","editor.link.unlink.tooltip":"링크 해제","editor.link.open.tooltip":"링크 열기","editor.link.edit.tooltip":"링크 편집","editor.link.dialog.title":"링크 삽입","editor.link.dialog.link":"링크","editor.link.dialog.text":"텍스트","editor.link.dialog.openInNewTab":"새 탭에서 열기","editor.link.dialog.link.placeholder":"링크 주소","editor.link.dialog.text.placeholder":"설명 추가","editor.link.dialog.button.apply":"적용","editor.image.tooltip":"이미지","editor.image.menu.flipX":"세로 뒤집기","editor.image.menu.flipY":"가로 뒤집기","editor.image.menu.size":"크기 설정","editor.image.menu.size.width":"너비","editor.image.menu.size.height":"높이","editor.image.dragger.tooltip":"업로드할 영역으로 이미지를 클릭하거나 드래그하세요.","editor.image.float.left.tooltip":"왼쪽으로 부동","editor.image.float.none.tooltip":"부동 없음","editor.image.float.right.tooltip":"오른쪽으로 부동","editor.image.dialog.title":"이미지 추가","editor.image.dialog.tab.url":"URL","editor.image.dialog.tab.upload":"업로드","editor.image.dialog.uploading":"업로드 중","editor.image.dialog.form.link":"링크","editor.image.dialog.placeholder":"링크","editor.image.dialog.form.alt":"Alt","editor.image.dialog.form.aspectRatio":"원본 가로 세로 비율 잠금","editor.image.dialog.form.file":"파일","editor.image.dialog.button.apply":"적용","editor.video.tooltip":"비디오","editor.video.dialog.tab.upload":"업로드","editor.video.dialog.uploading":"업로드 중","editor.video.dialog.title":"동영상 삽입 또는 업로드","editor.video.dialog.link":"링크","editor.video.dialog.placeholder":"링크","editor.video.dialog.button.apply":"적용","editor.table.tooltip":"테이블","editor.table.menu.insert_table":"테이블 삽입","editor.table.menu.insert_table.with_header_row":"머리글 행 포함","editor.table.menu.insertColumnBefore":"앞에 열 삽입","editor.table.menu.insertColumnAfter":"다음에 열 삽입","editor.table.menu.deleteColumn":"열 삭제","editor.table.menu.insertRowAbove":"위에 행 삽입","editor.table.menu.insertRowBelow":"아래에 행 삽입","editor.table.menu.deleteRow":"행 삭제","editor.table.menu.mergeCells":"셀 병합","editor.table.menu.splitCells":"셀 분할","editor.table.menu.deleteTable":"테이블 삭제","editor.table.menu.setCellsBgColor":"셀 배경색","editor.blockquote.tooltip":"블록인용","editor.horizontalrule.tooltip":"수평 규칙","editor.code.tooltip":"코드","editor.codeblock.tooltip":"코드 블록","editor.clear.tooltip":"형식 지우기","editor.undo.tooltip":"실행 취소","editor.redo.tooltip":"다시 실행","editor.fullscreen.tooltip.fullscreen":"전체 화면","editor.fullscreen.tooltip.exit":"전체 화면 종료","editor.imageUpload.fileTypeNotSupported":"지원되지 않는 파일 형식","editor.imageUpload.fileSizeTooBig":"파일 크기가 너무 큽니다. 최대 크기는 다음과 같습니다.","editor.AI.placeholder":"AI에게 물어보세요...","editor.AI.geneating":"생성","editor.AI.insert":"선택 항목 아래에 삽입","editor.AI.replace":"선택한 콘텐츠 교체","editor.AI.regenerate":"재생성","editor.AI.close":"닫기","editor.AI.stop":"중지","editor.AI.ask":"AI에게 물어보세요","editor.menubar.file":"파일","editor.menubar.edit":"편집","editor.menubar.view":"보기","editor.menubar.insert":"삽입","editor.menubar.format":"형식","editor.menubar.menu.newDoc":"새 문서","editor.menubar.menu.restoreLastDraft":"마지막 초안 복원","editor.menubar.menu.print":"인쇄","editor.menubar.menu.cut":"잘라내기","editor.menubar.menu.copy":"복사","editor.menubar.menu.paste":"붙여넣기","editor.menubar.menu.pasteAsText":"텍스트로 붙여넣기","editor.menubar.menu.selectAll":"모두 선택","editor.menubar.menu.preview":"미리보기","editor.menubar.menu.spellCheck":"맞춤법 검사","editor.menubar.menu.spelling":"맞춤법","editor.menubar.menu.superView":"수퍼보기","editor.menubar.menu.insertSuper":"수퍼 넣기","editor.menubar.menu.articleContent":"앵커멘트","editor.menubar.menu.articleComment":"상세 텍스트","editor.menubar.menu.cancel":"취소","editor.menubar.menu.save":"저장","editor.findAndReplace.tooltip":"찾기 및 바꾸기","editor.findAndReplace.find":"찾기","editor.findAndReplace.replace":"바꾸기","editor.findAndReplace.replaceAll":"모두 바꾸기","editor.findAndReplace.caseSensitive":"대소문자 구분","editor.printer.tooltip":"인쇄","editor.superinput":"수퍼입력","editor.insert.symbol":"기호삽입","editor.check":"확인","editor.detail":"내용","editor.inputSuper":"수퍼 작성","editor.insertSpecial":"특수문자","editor.cut":"잘라내기","editor.paste":"붙여넣기","editor.selectAll":"모두선택","editor.delete":"삭제","editor.super.edit":"수퍼 수정","editor.super.delete":"수퍼 삭제","editor.configPlan.edit":"구성안 수정","editor.configPlan.delete":"구성안 삭제","editor.super":"수퍼","editor.configPlan":"구성안","editor.insertConfigPlan":"구성안넣기"},ZY=zB({legacy:!1,locale:"en",fallbackLocale:"en",messages:{en:OE,ko:ME}});Y3();const BE={install(t){t.use(ZY),t.component("vdc-editor",Lp)}},QY=Ze.useEventBus(Kn.RENDER_SUPER_TEXT);function NY(){QY.emit({action:"render"})}Mt.ArticleCompareEditor=YY,Mt.ArticleEditor=WY,Mt.CoreEditor=Lp,Mt.DigitalNewsEditor=jY,Mt.EditorMode=Ye,Mt.SBSEditorPlugin=BE,Mt.default=BE,Mt.enUS=OE,Mt.extension=nY,Mt.koKR=ME,Mt.nodeNames=nq,Mt.updateSuperTextView=NY,Mt.useConfigTiptap=oY,Mt.useEditor=b$,Mt.useTiptapStore=tr,Object.defineProperties(Mt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
266
266
  //# sourceMappingURL=vdc-editor.umd.js.map