2 lines
382 KiB
Plaintext
2 lines
382 KiB
Plaintext
/*! For license information please see editor-kit~0.b0428a0a.js.LICENSE.txt */
|
||
(self.webpackChunkdouyin_web=self.webpackChunkdouyin_web||[]).push([["23145"],{330851:function(t,e,n){"use strict";n.d(e,{u:function(){return u}});var r=n("194055"),i=n("375518"),o=n("464675"),s=n("386308");n("294484");var a=n("162114"),l=n("361087"),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="BlockElementDeserializer",e}return(0,r.d)(e,t),e.prototype.deserialize=function(t){var e,n=t.node,r=t.deltaSet,s=t.zoneId,t=t.types,s=r.get(s);if(s instanceof o.I&&!(0,a.f)(s,"\n")){;if(t.includes("text/html")&&(0,l.y1)(n)&&!((e=n).nodeType===Node.TEXT_NODE&&"\n"===e.textContent))return n.nextSibling&&(0,i.P)(n.nextSibling)&&s.insertEnter(),r;n instanceof Element&&("BR"===n.tagName?s.insertEnter():(0,i.P)(n)?!n.hasChildNodes()&&(n.nextSibling||n.previousSibling)||s.insertEnter():["span","a","b","u","i","s","strong","button","abbr","audio","cite","code","em","embed","img","input","bdi","bdo","data","del","dfn","ins","kbd","label","map","mark","meter","object","output","picture","progress","q","ruby","samp","select","slot","small","sub","sup","svg","textarea","time","var","wbr"].includes(n.tagName.toLowerCase())&&n.nextSibling&&(0,i.P)(n.nextSibling)&&s.insertEnter())}return r},e}(s.S)},604780:function(t,e,n){"use strict";n.d(e,{r:function(){return f}});var r=n(194055),i=n(269516),o=n(464675),s=n(481685),a=n(386308),l=n(361087),u=[/[\b]/g,RegExp(String.fromCharCode(8203),"g")];function c(t){var e=t;return u.forEach(function(t){return e=e.replace(t,"")}),e}function d(t){return t.replace(/\r/g," ").replace(/\xa0/g," ").replace(/\t/g," ".repeat(8))}var f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="TextNodeDeserializer",e}return(0,r.d)(e,t),e.prototype.deserialize=function(t){var e=t.node,n=t.deltaSet,r=t.zoneId,a=t.text,u=t.types;if(u.includes("text/html")){if((0,l.y1)(e)){var f=null!==(t=e.nodeValue)&&void 0!==t?t:"",h="",p=0,v=!1;if(0===f.trim().length&&"body"===(null===(t=e.parentElement)||void 0===t?void 0:t.tagName.toLowerCase()))return n.concat(new o.I({zoneId:r}));for(var g=e.parentNode;g;){if(g instanceof HTMLElement){var y=g.tagName,m=g.style;if("pre"===y.toLowerCase()){v=!0;break}if(m.whiteSpace){v=m.whiteSpace.startsWith("pre");break}}g=g.parentNode}for(var b,E,e=new s.D,S=new o.I({zoneId:r});0<f.length;)v?(b=f.includes("\n"),p=(E=f.split("\n",1)[0]).length+1,h=f.substring(p),S.insert(d(c(f=E))),f=h,b&&S.insertEnter()):(h="",f=(f=f.replace(/\r\n/g," ").replace(/[\r\n]/g," ")).replace(/\s{2,}/g,function(t){return t.replace(/[^\u00a0]+/g," ")}),S.insert(d(c(f))),f=h);return e.concat(S)}}else if(u.includes("text/plain")&&a)return(new s.D).concat((new o.I).insert(d((0,i.$)(c(a)))));return n},e}(a.S)},192219:function(t,e,n){"use strict";n.d(e,{Z:function(){return o}});var r=n(85359),i=function(){function t(){}var e=t.prototype;return e.getData=function(t,e){return t.getData(e)},e.setData=function(t,e,n){return t.setData(e,n)},e.getTypes=function(t){return t.types},t}(),o=function(){function t(t){void 0===t&&(t=new i),this.proxyClipboard=t}var e=t.prototype;return e.getTypes=function(t){return this.proxyClipboard.getTypes(t)},e.getData=function(t,e){return void 0===e&&(e="text/html"),r.Xh.modernIE?this.proxyClipboard.getData(t,"text"):this.proxyClipboard.getData(t,e)},e.setData=function(t,e){var n,o,s=e.text,a=e.html;(s||a)&&(e=null===(e=null===(e=null===(e=window.lark)||void 0===e?void 0:e.biz)||void 0===e?void 0:e.clipboard)||void 0===e?void 0:e.setContent,r.Xh.modernIE?this.proxyClipboard.setData(t,"text",a):this.proxyClipboard instanceof i&&e&&((0,r.WZ)()||r.Xh.isBytedanceApp&&r.Xh.isIPad||r.Xh.isAndroid&&a.length&&!s.length)?(n=s,o=a,window.lark.biz.clipboard.setContent({text:n,html:o})):(this.proxyClipboard.setData(t,"text/html",a),this.proxyClipboard.setData(t,"text/plain",s)))},e.setDataWithoutEvent=function(t){var e=this,n=function(i){i.preventDefault(),i.stopImmediatePropagation&&i.stopImmediatePropagation();var o=t.html,s=t.text;document.createElement("div").innerHTML=o,i=i.clipboardData||window.clipboardData,r.Xh.modernIE?e.proxyClipboard.setData(i,"text",o):(e.proxyClipboard.setData(i,"text/html",o),e.proxyClipboard.setData(i,"text/plain",s)),t.customCopyDatas&&e.setCustomData(i,t.customCopyDatas),document.removeEventListener("copy",n)},i=document.createElement("textarea");document.body.appendChild(i),document.addEventListener("copy",n),i.style.opacity="0",i.value=" ",r.Xh.mobile&&(i.readOnly=!0);var o=window.scrollX,s=window.scrollY;i.focus({preventScroll:!0}),i.select(),r.Xh.isAndroid&&window.scrollTo(o,s),r.Xh.lark&&r.Xh.isIOS?window.lark.biz.navigation.handleCopyMenuClick():document.execCommand("copy"),document.body.removeChild(i)},e.setCustomData=function(t,e){var n,i,o=this;t&&t.setData&&(r.Xh.isAndroid?(n=this.proxyClipboard.getData(t,"text/html"),i="",e.forEach(function(t){var e=t.key,t=t.data;i+='<span id="custom-clipboard-data-'+e+'" data-custom-clipboard="'+encodeURIComponent(t)+'"></span>'}),this.proxyClipboard.setData(t,"text/html",n+i)):e.forEach(function(e){o.proxyClipboard.setData(t,e.key,e.data)}))},e.getCustomData=function(t,e){if(!t||!t.setData)return"";if(r.Xh.isAndroid){var n=this.proxyClipboard.getData(t,"text/html"),n=(new DOMParser).parseFromString(n,"text/html").getElementById("custom-clipboard-data-"+e);return decodeURIComponent((null==n?void 0:n.getAttribute("data-custom-clipboard"))||"")}return this.proxyClipboard.getData(t,e)},t}()},650054:function(t,e,n){"use strict";n.d(e,{HY:function(){return a},K6:function(){return i},Z6:function(){return s},c5:function(){return o},fF:function(){return l},iC:function(){return r},mX:function(){return u}});var r="application/x-editor-kit-fragment",i="application/x-editor-kit-business-key",o={underline:"u",bold:"b",blockquote:"blockquote",italic:"i",strikethrough:"s"},s="ignore-collect",a="COPY_WITHOUT_PERMISSION",l="data-multiple-line-wrap",u="data-line"},993137:function(t,e,n){"use strict";var r,i;n.d(e,{T:function(){return r}}),(i=r=r||{}).LEAF="leaf",i.LINE="line",i.ROOT="root"},85359:function(t,e,n){"use strict";n.d(e,{WZ:function(){return s},Xh:function(){return R},vu:function(){return a}});var r=window.User&&window.User.userAgent||navigator.userAgent||"";function i(t){return(t=r.match(t))&&1<t.length&&t[1]||""}function o(){var t;if(0<(t=navigator.userAgent).indexOf("iPhone")||0<t.indexOf("iPad")||0<t.indexOf("iPhone")){var e=navigator.userAgent.match(/OS (\d+)_(\d+)_?(\d+)?/);return e?{major:+e[1],minor:+e[2]}:null}return null}function s(){var t=o();return!!t&&t.major<12}function a(){var t=navigator.userAgent.match(/Chrome\/([\d.]+)/i);return t&&t[1]?t[1]:null}var l,u,c,d=i(/(ipod|iphone|ipad)/i).toLowerCase(),f=/windows phone/i.test(r),h=/nexus\s*[0-6]\s*/i.test(r),p=/like android/i.test(r),v=!f&&/windows/i.test(r),g=/chrome|crios|crmo/i.test(r),y=/firefox|iceweasel|fxios/i.test(r),m=/safari|applewebkit/i.test(r)&&!g&&!y,b=(l=/edg([ea]|ios)\/(\d+(\.\d+)?)/i,(l=r.match(l))&&1<l.length&&l[2]||""),E=!b&&f||/msie|trident/i.test(r),S=/silk/i.test(r),I=!d&&!S&&/macintosh/i.test(r),C=/Firefox/i.test(r),L=/iPad/i.test(r),w=f&&b||/edg([ea]|ios)/i.test(r),x=/Edge/i.test(r),_=/tablet/i.test(r)&&!/tablet pc/i.test(r),T=!p&&-1<r.indexOf("Android")||-1<r.indexOf("Adr")||/OpenHarmony/.test(r),A=!_&&/[^-]mobi/i.test(r)||"iphone"===d||"ipod"===d||T||h,M=/feishu/i.test(r)||/lark/i.test(r),k=!!r.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),N=/Docs/i.test(r),R={modernIE:!1,isAndroid:T,lark:M,isIOS:k,android:T,windows:v,firefox:y,safari:m,msie:E,isMac:I,ios:!f&&d,isFF:C,isIPad:L,msedge:w,chrome:g,isEdge:x,oldIE:!1,mobile:A,isBytedanceApp:M||N,isIOSBelow12:s(),getIOSVersion:o};E&&(u="",f&&!b?u=i(/iemobile\/(\d+(\.\d+)?)/i):/msie|trident/i.test(r)&&(u=i(/(?:msie |rv:)(\d+(\.\d+)?)/i)),c=parseInt(u,10),R.oldIE=c<11,R.modernIE=11<=c)},734795:function(t,e,n){"use strict";n.d(e,{Ed:function(){return m},Ks:function(){return y},MB:function(){return l},P9:function(){return g},PI:function(){return u},Pk:function(){return E},Q0:function(){return S},SX:function(){return M},T6:function(){return s},VD:function(){return i},VI:function(){return o},WV:function(){return C},Wr:function(){return f},Z6:function(){return x},Zd:function(){return k},cH:function(){return h},e0:function(){return p},eu:function(){return v},ip:function(){return w},j4:function(){return T},lE:function(){return a},nV:function(){return c},q7:function(){return d},qT:function(){return A},r0:function(){return L},rG:function(){return _},sq:function(){return b}});var r,i,o="data-zero-space",s="",a="data-inline-wrapper",l="data-leaf",u="data-node",c="data-string",d="data-enter",f="data-faketext",h="editor-kit",p="data-ssr",v="data-fake-text",g="data-zone-id",y="data-zone-container",m=s,b="data-void",E="data-rect-container",S="data-virtual-list-placeholder";(I=i=i||{})[I.BackSpace=8]="BackSpace",I[I.Tab=9]="Tab",I[I.Clear=12]="Clear",I[I.Enter=13]="Enter",I[I.Shift=16]="Shift",I[I.Ctrl=17]="Ctrl",I[I.Alt=18]="Alt",I[I.CapsLock=20]="CapsLock",I[I.Esc=27]="Esc",I[I.Space=32]="Space",I[I.PageUp=33]="PageUp",I[I.PageDown=34]="PageDown",I[I.End=35]="End",I[I.Home=36]="Home",I[I.Left=37]="Left",I[I.Up=38]="Up",I[I.Right=39]="Right",I[I.Down=40]="Down",I[I.Insert=45]="Insert",I[I.Delete=46]="Delete",I[I.Digit0=48]="Digit0",I[I.Digit9=57]="Digit9",I[I.A=65]="A",I[I.B=66]="B",I[I.C=67]="C",I[I.D=68]="D",I[I.E=69]="E",I[I.F=70]="F",I[I.G=71]="G",I[I.H=72]="H",I[I.I=73]="I",I[I.J=74]="J",I[I.K=75]="K",I[I.L=76]="L",I[I.M=77]="M",I[I.N=78]="N",I[I.O=79]="O",I[I.P=80]="P",I[I.Q=81]="Q",I[I.R=82]="R",I[I.S=83]="S",I[I.T=84]="T",I[I.U=85]="U",I[I.V=86]="V",I[I.W=87]="W",I[I.X=88]="X",I[I.Y=89]="Y",I[I.Z=90]="Z",I[I.Meta=91]="Meta",I[I.RightMeta=92]="RightMeta",I[I.BracketRightKeyDown=93]="BracketRightKeyDown",I[I.Caret=94]="Caret",I[I.Numpad0=96]="Numpad0",I[I.Numpad9=105]="Numpad9",I[I.NumpadDot=110]="NumpadDot",I[I.F11=122]="F11",I[I.Semicolon=186]="Semicolon",I[I.Plus=187]="Plus",I[I.Minus=189]="Minus",I[I.Dot=190]="Dot",I[I.Grave=192]="Grave",I[I.Bracket=219]="Bracket",I[I.Quot=222]="Quot",I[I.Asterisk=106]="Asterisk",I[I.Slash=111]="Slash",I[I["/"]=191]="/",I[I["\\"]=220]="\\",I[I.Ime=229]="Ime";var I,C,L="ace-line",w="dirtyDomWithoutChangeset",x="ignore-collect",_="ignore-dom",T="adit-container",A="editor-kit-container",M="zone-container",k="outer-controlled-zone";(r=C=C||{})[r.FATAL=0]="FATAL",r[r.ERROR=1]="ERROR"},294484:function(){var t=Element.prototype.removeChild,e=Node.prototype.removeChild;Element.prototype.removeChild=function(e){return e.parentNode!==this&&this instanceof HTMLElement&&this.closest(".editor-kit-container")?e:t.call(this,e)},Node.prototype.removeChild=function(t){return t.parentNode!==this&&this instanceof HTMLElement&&this.closest(".editor-kit-container")?t:e.call(this,t)}},274709:function(t,e,n){"use strict";n.d(e,{X:function(){return g},j:function(){return y}});var r=RegExp("[\\u200d\ud800-\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff\\ufe0e\\ufe0f]"),i="\ud800-\udfff",o="[\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]",s="\ud83c[\udffb-\udfff]",a="(?:"+o+"|"+s+")",l="[^"+i+"]",u="(?:\ud83c[\udde6-\uddff]){2}",c="[\ud800-\udbff][\udc00-\udfff]",d=a+"?",f="[\\ufe0e\\ufe0f]?",h="(?:\\u200d(?:"+[l,u,c].join("|")+")"+(f+d)+")*",p=RegExp(s+"(?="+s+")|"+("(?:"+[""+l+o+"?",o,u,c,"["+i+"]"].join("|")+")"+(f+d+h)),"g");function v(t){var e;return(e=t,r.test(e))?t.match(p)||[]:t.split("")}function g(t){return(t.length<2?t:v(t)[0]).length}function y(t){return t.length<2?t.length:(t=v(t))[t.length-1].length}},651419:function(t,e,n){"use strict";n.d(e,{Br:function(){return l},Dg:function(){return d},J$:function(){return s},Le:function(){return o},Ve:function(){return a},ZG:function(){return u},eb:function(){return c}});var r=n(194055),i=n(980334);function o(t){return t.slice(2).toLowerCase()}function s(t){var e=/^\[object (\S+)\]/i,t=t.toString().toLocaleLowerCase();return e.test(t)?e.exec(t)[1]:""}function a(t,e){return t?e.selection._toModelRange({startContainer:t,startOffset:0,endContainer:t,endOffset:t.childNodes.length}):null}function l(t){var e=(0,i.g)(t.nativeEvent),n=e.preventDefault,r=e.stopPropagation;return e.preventDefault=function(){n.call(e),t.preventDefault()},e.stopPropagation=function(){r.call(e),t.stopPropagation()},e.currentTarget=t.currentTarget,e.target=t.target,e}var u=["select","deselect"],c=[].concat((0,r.e)(u,["enterviewport","leaveviewport"])),d=["focusevent","mouseevent","touchevent","pointerevent"]},636661:function(t,e,n){"use strict";n.d(e,{CX:function(){return i}});var r=n(253966);function i(t){try{return JSON.parse(t)}catch(t){}}Array.prototype.flat||r.Y},24453:function(t,e,n){"use strict";function r(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}n.d(e,{z:function(){return r}})},399582:function(t,e,n){"use strict";n.d(e,{N:function(){return s}});var r=n(194055),i=n(481685),o=n(464675);function s(t,e,n){var s=t.toPosition(),a=s.start,l=s.len,u=s.zoneId;if(!e.hasLineMarker())return(new i.D).concat(new o.I({zoneId:u}).retain(a).delete(l)).concat(n);var s=!(null===(c=null===(s=null===(c=n.get(u))||void 0===c?void 0:c.ops[0])||void 0===s?void 0:s.attributes)||void 0===c||!c.lmkr),c=e.hasLineMarker()&&1===t.start.offset;if(s&&c){var d=new o.I({zoneId:u}),c=e.slice(0,t.start.offset),f=c._getOps().slice(1),t=n.reduce(function(t,n){if(n.zoneId!==u||!(n instanceof o.I))return t.concat(n);var i=e._getOps()[0].attributes;return d.insertLineMarker((0,r.b)((0,r.b)({},i),n.ops[0].attributes)),f.forEach(function(t){return d.push(t)}),n.ops.slice(1).forEach(function(t){return d.push(t)}),t.concat(d)},new i.D),c=new o.I({zoneId:u}).retain(a-c.length()).delete(l+c.length());return(new i.D).concat(c).concat(t)}return(new i.D).concat(new o.I({zoneId:u}).retain(a).delete(l)).concat(n)}},864902:function(t,e,n){"use strict";function r(t){return t}n.d(e,{$e:function(){return tS},$h:function(){return tn},$u:function(){return L},$v:function(){return ty},$z:function(){return tt},Aq:function(){return N},At:function(){return td},B3:function(){return J},Bx:function(){return u},Dq:function(){return T},F6:function(){return c},G3:function(){return B},GP:function(){return I},H0:function(){return l},H6:function(){return D},Hg:function(){return tg},Jc:function(){return th},Ks:function(){return g},Kz:function(){return M},LU:function(){return O},M9:function(){return W},MY:function(){return tl},Mn:function(){return a},OX:function(){return K},PG:function(){return to},Pm:function(){return tx},Ro:function(){return ti},SI:function(){return f},Su:function(){return d},TW:function(){return H},UD:function(){return s},UG:function(){return z},UL:function(){return tu},Ue:function(){return p},V9:function(){return U},Vp:function(){return b},WN:function(){return k},X_:function(){return G},Xc:function(){return x},ZA:function(){return tw},_B:function(){return Y},_E:function(){return E},a5:function(){return Q},bx:function(){return V},dE:function(){return v},dP:function(){return j},e0:function(){return o},eb:function(){return X},f3:function(){return $},fH:function(){return h},fU:function(){return P},fk:function(){return Z},g3:function(){return R},gQ:function(){return tC},h1:function(){return _},h5:function(){return tp},hC:function(){return tI},j4:function(){return S},kA:function(){return A},l$:function(){return tE},li:function(){return m},lp:function(){return tf},m1:function(){return tm},m2:function(){return q},mo:function(){return C},nn:function(){return tL},p4:function(){return te},pK:function(){return tb},py:function(){return ts},rg:function(){return w},rl:function(){return y},sP:function(){return F},tA:function(){return tc},ul:function(){return tr},uv:function(){return i},yP:function(){return ta},yU:function(){return tv}});var i="abort",o="animationend",s="animationiteration",a="animationstart",l="blur",u="canplay",c="canplaythrough",d="cancel",f="click",h="close",p="compositionend",v="compositionstart",g="compositionupdate",y="contextmenu",m="copy",b="cut",E="dblclick",S="auxclick",I="drag",C="dragend",L="dragenter",w="dragexit",x="dragleave",_="dragover",T="dragstart",A="drop",M="durationchange",k="emptied",N="encrypted",R="ended",O="error",D="focus",z="gotpointercapture",P="input",Z="invalid",W="keydown",K="keypress",U="keyup",F="load",B="loadstart",V="loadeddata",j="loadedmetadata",H="lostpointercapture",X="mousedown",q="mousemove",Y="mouseout",G="mouseover",J="mouseup",Q="paste",$="pause",tt="play",te="playing",tn="pointercancel",tr="pointerdown",ti="pointermove",to="pointerout",ts="pointerover",ta="pointerup",tl="progress",tu="ratechange",tc="reset",td="scroll",tf="seeked",th="seeking",tp="stalled",tv="submit",tg="suspend",ty="timeupdate",tm="toggle",tb="touchcancel",tE="touchend",tS="touchmove",tI="touchstart",tC="transitionend",tL="volumechange",tw="waiting",tx="wheel"},560932:function(t,e,n){"use strict";n.d(e,{D:function(){return o}});var r=n(194055),i=n(723520),o=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.stopEvent=function(){},r.preventEvent=function(){},(0,i.uc)(r,{},e,n),r}return(0,r.d)(e,t),e}(n(775549).O)},984338:function(t,e,n){"use strict";n.d(e,{P:function(){return o}});var r=n(880001),i=n(864902),o=new function(){var t=this;this.eventTypes=new Map,this.extractEvents=function(e){return t.eventTypes.get(e.type)?new r.U(e,e.target):null},[i._B,i.X_].forEach(function(e){return t.eventTypes.set(e,!0)})}},653586:function(t,e,n){"use strict";n.d(e,{p:function(){return r}});var r=function(){}},340381:function(t,e,n){"use strict";n.d(e,{M:function(){return E}});var r=n("775549"),i=n("809472"),o=n("3627"),s=n("422639"),a=n("514516"),l=n("500122"),u=n("880001"),c=n("194055"),d=n("723520"),f=n("273150"),h=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.deltaX=0,r.deltaY=0,r.deltaZ=0,r.deltaMode=0,(0,d.uc)(r,f.TT,e,n),r}return(0,c.d)(e,t),e}(u.U),p=function(t){function e(e,n){var r=t.call(this,e,n)||this;return(0,d.uc)(r,f.a6,e,n),r}return(0,c.d)(e,t),e}(r.O),v=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.propertyName="",r.elapsedTime=0,r.pseudoElement="",(0,d.uc)(r,f.lI,e,n),r}return(0,c.d)(e,t),e}(r.O),g=n("864902"),y=[g.H0,g.Su,g.SI,g.fH,g.rl,g.li,g.Vp,g.j4,g._E,g.mo,g.Dq,g.kA,g.H6,g.fU,g.fk,g.M9,g.OX,g.V9,g.eb,g.B3,g.a5,g.f3,g.$z,g.$h,g.ul,g.yP,g.UL,g.tA,g.lp,g.yU,g.pK,g.l$,g.hC,g.nn,g.dE,g.Ks,g.Ue],m=[g.GP,g.$u,g.rg,g.Xc,g.h1,g.m2,g._B,g.X_,g.Ro,g.PG,g.py,g.At,g.m1,g.$e,g.Pm],b=[g.uv,g.e0,g.UD,g.Mn,g.Bx,g.F6,g.Kz,g.WN,g.Aq,g.g3,g.LU,g.UG,g.sP,g.bx,g.dP,g.G3,g.TW,g.p4,g.MY,g.Jc,g.h5,g.Hg,g.$v,g.gQ,g.ZA],E=new function(){var t=this;this.eventTypes=new Map,this.extractEvents=function(e){var n;if(!t.eventTypes.get(e.type))return null;switch(e.type){case g.OX:case g.M9:case g.V9:n=a.$;break;case g.H0:case g.H6:n=l.Y;break;case g.SI:case g.j4:case g._E:case g.eb:case g.m2:case g.B3:case g._B:case g.X_:case g.rl:n=u.U;break;case g.GP:case g.mo:case g.$u:case g.rg:case g.Xc:case g.h1:case g.Dq:case g.kA:case g.pK:case g.l$:case g.$e:case g.hC:n=r.O;break;case g.e0:case g.UD:case g.Mn:n=p;break;case g.gQ:n=v;break;case g.At:n=i.R;break;case g.Pm:n=h;break;case g.li:case g.Vp:case g.a5:n=o.y;break;case g.UG:case g.TW:case g.$h:case g.ul:case g.Ro:case g.PG:case g.py:case g.yP:n=r.O;break;case g.dE:case g.Ue:case g.Ks:n=s.h;break;default:n=r.O}return new n(e,e.target)},y.concat(m).concat(b).forEach(function(e){return t.eventTypes.set(e,!0)})}},3627:function(t,e,n){"use strict";n.d(e,{y:function(){return s}});var r=n(194055),i=n(723520),o=n(273150),s=function(t){function e(e,n){var r=t.call(this,e,n)||this;return(0,i.uc)(r,o.QA,e,n),r}return(0,r.d)(e,t),e}(n(560932).D)},422639:function(t,e,n){"use strict";n.d(e,{h:function(){return s}});var r=n(194055),i=n(723520),o=n(273150),s=function(t){function e(e,n){var r=t.call(this,e,n)||this;return(0,i.uc)(r,o.g8,e,n),r}return(0,r.d)(e,t),e}(n(775549).O)},775549:function(t,e,n){"use strict";n.d(e,{O:function(){return a}});var r=n("194055"),i=n("723520"),o=n("852158"),s=n("273150"),a=function(t){function e(e,n){var r=t.call(this,e,n)||this;return(0,i.uc)(r,{},e,n),r}return(0,r.d)(e,t),e}(function(){function t(t,e){this.nativeEvent=t,this.type="",(0,i.uc)(this,s.TS,t,e),t=null!==t.defaultPrevented&&void 0!==t.defaultPrevented?t.defaultPrevented:!1===t.returnValue,this.isDefaultPrevented=t?o.cI:o.ar,this.isPropagationStopped=o.ar}var e=t.prototype;return e.preventDefault=function(){this.defaultPrevented=!0,this.nativeEvent.preventDefault(),this.isDefaultPrevented=o.cI},e.stopPropagation=function(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=o.cI},t}())},500122:function(t,e,n){"use strict";n.d(e,{Y:function(){return s}});var r=n(194055),i=n(723520),o=n(273150),s=function(t){function e(e,n){var r=t.call(this,e,n)||this;return(0,i.uc)(r,o.Is,e,n),r}return(0,r.d)(e,t),e}(n(809472).R)},880001:function(t,e,n){"use strict";n.d(e,{U:function(){return s}});var r=n(194055),i=n(723520),o=n(273150),s=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.screenX=0,r.screenY=0,r.clientX=0,r.clientY=0,r.pageX=0,r.pageY=0,r.ctrlKey=!1,r.shiftKey=!1,r.altKey=!1,r.metaKey=!1,r.getModifierState=function(){return!1},r.button=0,r.buttons=0,r.relatedTarget=null,r.movementX=0,r.movementY=0,(0,i.uc)(r,o.Ay,e,n),r}return(0,r.d)(e,t),e}(n(809472).R)},809472:function(t,e,n){"use strict";n.d(e,{R:function(){return s}});var r=n(194055),i=n(723520),o=n(273150),s=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.view=null,r.detail=0,(0,i.uc)(r,o.D3,e,n),r}return(0,r.d)(e,t),e}(n(775549).O)},273150:function(t,e,n){"use strict";n.d(e,{Ay:function(){return f},D3:function(){return a},Is:function(){return y},Nf:function(){return v},QA:function(){return g},TS:function(){return i},TT:function(){return p},Y:function(){return h},a6:function(){return s},cd:function(){return m},g8:function(){return b},lI:function(){return o}});var r=n(723520),i={type:null,target:null,currentTarget:null,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},o={propertyName:null,elapsedTime:null,pseudoElement:null},s={animationName:null,elapsedTime:null,pseudoElement:null},a={view:null,detail:null},l=0,u=0,c=!1,d=!1,f={screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:null,button:null,buttons:null,relatedTarget:null,movementX:function(t){if("movementX"in t)return t.movementX;var e=l;return l=t.screenX,c?"mousemove"===t.type?t.screenX-e:0:(c=!0,0)},movementY:function(t){if("movementY"in t)return t.movementY;var e=u;return u=t.screenY,d?"mousemove"===t.type?t.screenY-e:0:(d=!0,0)}},h={dataTransfer:null},p={deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:null,deltaMode:null},v={key:null,location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:null,charCode:function(t){return"keypress"===t.type?(0,r.Hr)(t):0},keyCode:function(t){return"keydown"===t.type||"keyup"===t.type?t.keyCode:0},which:function(t){return"keypress"===t.type?(0,r.Hr)(t):"keydown"===t.type||"keyup"===t.type?t.keyCode:0}},g={clipboardData:function(t){return("clipboardData"in t?t:window).clipboardData},data:{}},y={relatedTarget:null},m={data:null,dataTransfer:null,inputType:null},b={data:null}},723520:function(t,e,n){"use strict";n.d(e,{Hr:function(){return i},uc:function(){return o}});var r=n(852158);function i(t){var e,n=t.keyCode;return"charCode"in t?0===(e=t.charCode)&&13===n&&(e=13):e=n,32<=(e=10===e?13:e)||13===e?e:0}function o(t,e,n,i){Object.keys(e).forEach(function(o){var s=e[o];(0,r.mf)(s)?t[o]=s(n):t[o]="target"===o?i:n[o]})}},559016:function(t,e,n){"use strict";var r,i;n.d(e,{r:function(){return r}}),(i=r=r||{}).DID_PASTE="didPaste",i.RESIZE="resize",i.RECT_CHANGE="rectchange",i.SELECTION_CHANGE="selectionchange",i.SELECTION_CHANGE_AND_DOM_UPDATE="editorUpdateDomSelection",i.CONTENT_WILL_CHANGE="contentWillChange",i.CONTENT_CHANGE="contentchange",i.EDITABLE_CHANGE="editablechange",i.PAINT="paint",i.COPY="copy",i.CUT="cut",i.PASTE="paste",i.WILL_DELETE_FROM_CUT="willDeleteFromCut",i.INPUT="input",i.BEFORE_INPUT="beforeinput",i.KEYDOWN="keydown",i.KEYPRESS="keypress",i.KEYUP="keyup",i.EXEC_COMMAND="execCommand",i.ERROR="error",i.DELETE_KEY="keyDelete",i.FOCUS="focus",i.BLUR="blur",i.SCROLL_END="scrollend",i.SCROLL="scroll",i.KEYBAORDCHANGE="keyboardchange",i.COMPOSITION_END="compositionend",i.COMPOSITION_START="compositionstart",i.COMPOSITION_UPDATE="compositionupdate",i.REACT_CONTEXT_UPDATE="reactContextUpdate",i.BEFORE_DOM_RENDERER_RECONCILE="beforeDomRendererReconcile",i.AFTER_DOM_RENDERER_RECONCILE="afterDomRendererReconcile",i.UNDO_DID_INIT="undoDidInit"},381624:function(t,e,n){"use strict";n.d(e,{h:function(){return tx}});var r=n("194055"),i=n("931173"),o=n("261359"),s=n("734795"),a=n("559016");n("294484");var l=n("195229"),u=n("809721"),c=n("125270"),d=n("651271"),f=n("159751"),h=n("455793"),p=n("101199");n("890710");var v=n("959679"),g=n("464675"),y=function(t,e){function n(n){var i,o,a,l,u,c,d=t.getContentState(),f=d.getZoneState(e);if(f)try{for(var h=(0,r.c)(n),p=h.next();!p.done;p=h.next()){var v=p.value;if(v.addedNodes.length)try{for(var y=(a=void 0,(0,r.c)(Array.from(v.addedNodes))),m=y.next();!m.done;m=y.next()){var b=m.value;if(b.nodeType===Node.TEXT_NODE&&b.textContent){var E,S,I=0;if(b.nextSibling){if(!(b.nextSibling instanceof HTMLElement))continue;var C=b.nextSibling;if(!(C=b.nextSibling.hasAttribute(s.PI)?C:b.nextSibling.querySelector("["+s.PI+"]")))continue;var L=t._getViewModel().getModel(C);if(!L)continue;I=L.index}else I=f.length();-1===I||null!==(E=0===I?0:f.pointToOffset({line:I-1,offset:((null===(u=f.getLine(I-1))||void 0===u?void 0:u.length())||1)-1}))&&(null!==(c=b.parentNode)&&void 0!==c&&c.removeChild(b),S=new g.I({zoneId:e}).retain(E),S=0===I?S.insert(b.textContent).insertEnter():S.insertEnter().insert(b.textContent),d.apply(S))}}}catch(t){a={error:t}}finally{try{m&&!m.done&&(l=y.return)&&l.call(y)}finally{if(a)throw a.error}}}}catch(t){i={error:t}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}}(0,p.useLayoutEffect)(function(){var r=null===(r=t.getContentState().getZoneState(e))||void 0===r?void 0:r._node;if(r){var i=function(t,e,n){return(n=new MutationObserver(n)).observe(t,e),n}(r,{childList:!0},n);return function(){i.disconnect()}}},[t,e])},m=n("457341"),b,E={left:void 0,top:void 0},S=((b={})[a.r.SELECTION_CHANGE]={onlyScrollWhenCollapsed:!0},b),I=n("672543"),C=function(){function t(t,e,n,r,i){void 0===n&&(n={}),void 0===i&&(i=[]),this.s=t,this.Se=e,this.Me=n,this.qe=r,this.we=i,this.ge=[],this.Ie={},this.init()}var e=t.prototype;return e.Pe=function(){var t=this;this.we.forEach(function(e){var n,i="string"==typeof e?S[n=e]||{}:Object.assign({},S[n=e.type],e.overideConfig),s=function(){return t.scrollIntoViewport(void 0,(0,r.b)({_event:n},i))};n!==a.r.SELECTION_CHANGE&&n!==a.r.SELECTION_CHANGE_AND_DOM_UPDATE||(s=function(){var e=t.s.selection.getSelection(t.qe);e&&t.s.isFocus()&&t.scrollIntoViewport(e.start,(0,r.b)({_event:n},i))}),e=function(e){var n=i.shouldPreventScroll,r=i.triggerAfterPaint;null!=n&&n(e)||(r?t.s.once("paint",s):s())},t.s.on(n,e,t.qe===o.S?void 0:{zoneId:t.qe}),t.ge.push(e)})},e.getScroller=function(){return this.Se},e.emitScroll=function(t){this.s.call(a.r.SCROLL,t)},e.destroy=function(){for(var t,e=0;e<this.we.length;e++){var n=this.we[e],r="string"==typeof n?n:n.type;this.s.off(r,this.ge[e])}Object.values(this.Ie).forEach(function(t){return window.clearTimeout(t)});var i=null===(t=null===(i=this.s.getContentState())||void 0===i?void 0:i.getZoneManager)||void 0===t?void 0:t.call(i);null!=i&&i.removeScrollModule(this.qe),this.Se.removeEventListener("scroll",this.emitScroll)},e.init=function(t){void 0===t&&(t=!0);var e,n=null===(n=null===(e=this.s.getContentState())||void 0===e?void 0:e.getZoneManager)||void 0===n?void 0:n.call(e);null!=n&&n.registerScrollModule(this.qe,this),t&&this.Se.addEventListener("scroll",this.emitScroll),this.Pe()},e.scrollTo=function(t){this.Se.scrollTo(t)},e.scrollBy=function(t){this.Se.scrollBy(t)},e.scrollPointIntoScrollerView=function(t,e,n,i){var o=this.s,s=this.qe;if(!o||!s)return E;var a,l={};if(!(0,I.Fl)(i))return E;try{a=(0,I.re)(e)}catch(t){return E}return o=(0,r.b)((0,r.b)({},i),{top:i.top-a.top,bottom:i.bottom-a.top,left:i.left-a.left,right:i.right-a.left}),e=(s=(0,I.AS)(n)).paddingBottom,i=s.paddingLeft,n=s.paddingRight,s=s.paddingTop,s=-o.top+s,e=o.bottom-a.clientHeight+e,s>1?l.top=a.scrollTop-s:e>1&&(l.top=a.scrollTop+e),i=-o.left+i,n=o.right-a.clientWidth+n,i>1?l.left=a.scrollLeft-i:n>1&&(l.left=a.scrollLeft+n),l},e.scrollPointIntoWindowView=function(t,e,n,r){if(!this.s)return E;var i,o={};if(!(0,I.Fl)(r))return E;try{i=(0,I.re)(e),window.visualViewport&&(i.clientHeight=window.visualViewport.height,i.clientWidth=window.visualViewport.width)}catch(t){return E}var s=(0,I.AS)(n),a=s.paddingBottom,e=s.paddingLeft,n=s.paddingRight,s=s.paddingTop,s=-r.top+s,a=r.bottom-i.clientHeight+a;return s>1?o.top=i.scrollTop-s:a>1&&(o.top=i.scrollTop+a),e=-r.left+e,n=r.right-i.clientWidth+n,e>1?o.left=i.scrollLeft-e:n>1&&(o.left=i.scrollLeft+n),o},e._scrollIntoViewport=function(t,e){var n,r=this.s,i=this.Se,s=this.qe,a=this.Me,l=(e=void 0===e?{}:e).onlyScrollWhenCollapsed,e=r.selection.getSelection();l&&!e.isCollapsed()||!t||t.zoneId!==s&&s!==o.S||(!r.getStatus("preventScrolling")&&r.isEditable()?(null!=(s=null===(e=r.virtualListManager)||void 0===e?void 0:e.getVirtualListModuleOfZone(t.zoneId))&&s.isEnabled&&s.scrollIntoViewport(t.line),e=r.rectModule.getRawCaretRect(t),s=E,i!==document.scrollingElement&&(s=this.scrollPointIntoScrollerView(t,i,(null===(n=a.getScrollerPadding)||void 0===n?void 0:n.call(a))||0,e),i.scrollTo(s)),n=document.scrollingElement||window,i=E,a.disableBodyScroll||(i=this.scrollPointIntoWindowView(t,n,(null===(t=a.getViewPortPadding)||void 0===t?void 0:t.call(a))||0,e),n.scrollTo(i)),((0,I.Yz)(s)||(0,I.Yz)(i))&&this.emitScroll()):r.setStatus("preventScrolling",!1))},e.scrollIntoViewport=function(){for(var t,e=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=(null===(t=n[1])||void 0===t?void 0:t._event)||"DEFAULT";void 0===this.Ie[o]&&(this._scrollIntoViewport.apply(this,(0,r.e)(n)),this.Ie[o]=window.setTimeout(function(){e.Ie[o]=void 0},66))},(0,r.a)([m.W],t.prototype,"getScroller",null),(0,r.a)([m.W],t.prototype,"emitScroll",null),(0,r.a)([m.W],t.prototype,"destroy",null),(0,r.a)([m.W],t.prototype,"init",null),(0,r.a)([m.W],t.prototype,"scrollTo",null),(0,r.a)([m.W],t.prototype,"scrollBy",null),(0,r.a)([m.W],t.prototype,"scrollPointIntoScrollerView",null),(0,r.a)([m.W],t.prototype,"scrollPointIntoWindowView",null),(0,r.a)([m.W],t.prototype,"_scrollIntoViewport",null),(0,r.a)([m.W],t.prototype,"scrollIntoViewport",null),t}(),L=n("52236"),w=n("149640"),x=n("945090"),_=n("87456"),T=n("283138"),A=n("818376"),M=n("454746"),k=n("471917"),N=n("24453"),R=n("527839"),O=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._node=null,e.eu=s.r0,e.tu=!1,e.iu={editable:!0},e.state=null,e}(0,r.d)(e,t);var n=e.prototype;return n.nu=function(t){this.state=t},n.shouldComponentForceUpdate=function(t,e){var n=this;if(null!=e&&e.isStateConstant)return!1;var r=t.state.clone(),i=this.ru(r).lineState;if(i!==r)return this.nu(i),this.tu=!0;if(this.state)return this.nu(null),this.tu=!0;if(this.su(this.props.state)||null!=e&&e.changes&&this.uu(e.changes))return this.tu=!0;var o=t.state;if(this.props.state!==t.state){if(this.tu=o.leaves.some(function(t){return n.ou(t,o)}),this.tu)return!0;var s=this.props.state;if(this.tu=s.leaves.some(function(t){return n.ou(t,s)}),this.tu)return!0}return t=this.props.editor.pluginManager.getPlugins(o.getZoneId()),this.tu=t.some(function(t){return!(!t.renderLine||!t.shouldForceRenderLine)&&t.shouldForceRenderLine({lineState:o})}),this.tu},n.componentDidMount=function(){var t=this.props,e=t.editor,t=t.state;this.sc(),this.cu(),this.lu(),e.callAll("lineDidMount",{lineState:t})},n.au=function(t,e,n){var r=this,i=t.hasLineMarker(),o=e.hasLineMarker();!o&&i||o&&i&&!(0,M.X)(t.getLineAttributes(),e.getLineAttributes())?n.pluginManager.getPlugins(t.getZoneId()).forEach(function(e){var n;e.renderLine&&(n={lineState:t,children:[],style:{},lineClass:r.eu,index:t.index,editable:!0},e.renderLine(n),r.eu=n.lineClass,r.iu.editable!==n.editable&&(r.iu.editable=n.editable))}):o&&!i&&(this.eu=s.r0)},n.componentDidUpdate=function(t){var e,n,r=this;this._node&&(e=(n=this.props).state,n=n.editor,this.tu||this.au(e,t.state,n),this.sc(),this.cu(),this.lu(),Promise.resolve().then(function(){!1!==r.props.editor.mounted&&r.props.editor.callAll("lineDidUpdate",{data:{prev:t.state,curr:r.props.state},isUpdate:!0})})),this.tu=!1},n.componentWillUnmount=function(){var t,e,n=this.props,i=n.editor,o=n.state,s=o.getZoneId(),n=i.getContentState().getZoneState(s),s=this.props.editor._getViewModel();s._resetNode(o),s._deleteNode(o);var a=!1;if(n)try{for(var l=(0,r.c)(n),u=l.next();!u.done;u=l.next())if(u.value===o){a=!0;break}}catch(e){t={error:e}}finally{try{u&&!u.done&&(e=l.return)&&e.call(l)}finally{if(t)throw t.error}}a||(i.callAll("lineWillUnmount",{lineState:o}),this.clear())},n.uu=function(t){for(var e=!1,n=!1,r=t.length-1;0<=r;--r){var i=t[r];if(i.type===x.U.LEAF_DELETE&&(e=i.deletes.some(function(t){return!!t.getCustomKey()})),i.type===x.U.LEAF_INSERT&&(n=!0),e&&n)break}return e&&n},n.su=function(t){var e,n=t.getNode();if(!n)throw Error("LineState._node empty when updating.");var r=(null===(e=null===(r=t.parent)||void 0===r?void 0:r.getContainer)||void 0===e?void 0:e.call(r))||null;return!!document.body.contains(r)&&!t.getEntities([["zoneId"]])[0]&&(r=t.leaves,!((n=Array.from(n.querySelectorAll("["+s.MB+"]"))).length===r.length&&!this.vu(n)&&!this.hu(t)))},n.hu=function(t){var e=t.getNode().querySelector("["+s.q7+"]"),t=t.getLinefeedLeaf();return!e||!t||e!==t.getNode()},n.vu=function(t){var e,n;try{for(var i=(0,r.c)(t),o=i.next();!o.done;o=i.next()){var a=o.value,l=a.hasAttribute(""+s.nV)?a:a.querySelector("["+s.nV+"]");if(null!=l&&l.firstChild&&l.firstChild.nodeType!==Node.TEXT_NODE)return!0}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return!1},n.clear=function(){var t=this.props,e=t.editor,n=t.state,r=e._getViewModel(),t=n.getZoneId(),t=e.getContentState().getZoneState(t);t&&t.getLineByKey(n.getKey())===n||r._deleteNode(n)},n.handleRef=function(t){t?this.nc(t):this.ic()},n.nc=function(t){this._node=t},n.ic=function(){this._node=null},n.sc=function(){var t;this._node&&(t=this.props.state,this.props.editor._getViewModel()._setNode(t,this._node))},n.cu=function(){var t,e;this._node&&(t=this._node,e=this.props.state,t.className!==this.eu&&(t.className=this.eu),!1===this.iu.editable?t.setAttribute("contenteditable","false"):"true"===t.contentEditable&&t.removeAttribute("contenteditable"),t.__index=e.index,t.__key=e.getKey(),this.state&&(this.state.setNode(t),this.state.instance=this))},n.lu=function(){var t,e,n;if(this._node){var o=this.props.editor,a=o.trace,l=(this.state||this.props.state).leaves;try{for(var u=(0,r.c)(l),c=u.next();!c.done;c=u.next()){var d=c.value,f=d.getNode();if(!f){a.add({extra:{updateLeavesNodes:l.map(function(t){return Object.keys((null===(t=t.op)||void 0===t?void 0:t.attributes)||{})}),lineKey:(this.state||this.props.state).getKey()}});var h=null===(n=d.parent)||void 0===n?void 0:n.getNode();throw o.error({level:i.W.ERROR,message:"leaf DOM is null",extra:a.export()}),a.reset(),Error("leaf DOM null,leaves: "+l.length+",child: "+(null==h?void 0:h.childNodes.length))}f.__index=d.index}}catch(e){t={error:e}}finally{try{c&&!c.done&&(e=u.return)&&e.call(u)}finally{if(t)throw t.error}}this._node.querySelectorAll("["+s.lE+"]").forEach(function(t){var e=null===(e=null==t?void 0:t.querySelector("["+s.MB+"]"))||void 0===e?void 0:e.__index;t.__index=e})}},n._u=function(){var t,e=this.props.editor;this.tu&&this.state?t=this.state:(r=this.props.state.clone(),(t=this.ru(r).lineState)!==r&&this.nu(t)),e.trace.add({extra:{lineStateMatch:t===this.state,leavesMatch:t.leaves===this.props.state.leaves,propsLeavesLen:this.props.state.leaves.length,lineStateLen:t.leaves.length}});var n=t.leaves;this.eu=s.r0;var r=[];return t.hasLineMarker()?(e=T.ZP.createElement(d.F,{key:1},this.fu(t,n)),(e=this.ju(t,e))&&r.push(e)):r=this.fu(t,n),this.du(t,r)},n.ru=function(t){var e=this.props.editor,n={lineState:t,index:t.index},t=t.getKey();return e.callAll("_editorLineStateWillRender",n),n.lineState._setKey(t),n},n.du=function(t,e){var n=this,r=this.props.editor.pluginManager.getPlugins(t.getZoneId()),o={},e=r.reduce(function(e,r){if(r.renderLine){var s={lineState:t,children:e,style:o,lineClass:n.eu,index:t.index,editable:!0};try{var a=r.renderLine(s);if(n.eu=s.lineClass,n.iu.editable!==s.editable&&(n.iu.editable=s.editable),a)return a}catch(t){return n.props.editor.error({message:r.name+" plugin renderLine failed!",level:i.W.ERROR,e:t}),e}}return e},e);return Object.keys(o).length?T.ZP.createElement(d.D,{style:o},e):e},n.ju=function(t,e){var n=t.getOps()[0],r={tokenClass:"",lineClass:this.eu,editor:this.props.editor,zoneId:t.getZoneId(),index:t.index},e=(0,A.ru)(t,n,e,r),r=e.view,e=e.renderContext;return this.eu=e.lineClass,r},n.fu=function(t,e){var n,i,o=this.props.editor,s=o.trace,a=[],l=new Map;s.add({extra:{leavesLenBefore:e.length}});try{for(var u=(0,r.c)(e),c=u.next();!c.done;c=u.next()){var d=c.value,f=d.op;s.add({extra:{op:Object.keys((null==f?void 0:f.attributes)||{})}});var h={lineClass:this.eu,class:"",text:""},p=T.ZP.createElement(R.H,{key:d.getKey(),editor:o,state:d,context:h});l.set(f,p),a.push(p)}}catch(t){n={error:t}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}return s.add({extra:{leavesLenAfter:e.length,children:a.length}}),this.yu(a,e,t,l)},n.ou=function(t,e){var n=t.op,i=t.index,t=this.props.editor;if(!n.attributes)return!1;var o=(0,r.b)({},n.attributes||{});return(0,A.CL)({attributes:o,editor:t,zoneId:e.getZoneId()}).some(function(t){if(t.renderInlineWrapper){if(null!==(n=t.shouldForceRenderLine)&&void 0!==n&&n.call(t,{lineState:e}))return!0;var n={index:i+(e.hasLineMarker()?1:0),attributes:o,lineState:e,key:""};if(t.renderInlineWrapper(n))return!0}return!1})},n.mu=function(t,e){t&&(t.__key=e)},n.yu=function(t,e,n,i){for(var o=this,a=new Map,l=n.hasLineMarker()?1:0,u=e.reduce(function(e,s,u){var c=s.index,d=s.op,f=c+l,h=o.props.editor,p=(0,r.b)({},d.attributes||{}),s=e.length?e[e.length-1]:null,c=i.get(d),c=t.indexOf(c);-1!==c&&(u=c);var h=(0,A.CL)({attributes:p,editor:h,zoneId:n.getZoneId()}),v=[],d=JSON.stringify(d.attributes?(0,k.y)(d.attributes):{}),g={index:f,attributes:p,lineState:n,key:d};return(h.forEach(function(t){!t.renderInlineWrapper||(t=t.renderInlineWrapper(g))&&v.push(t)}),0===v.length)?e:(p=g.key||d,s&&(0,N.z)(s.opWrappers,v)&&s.range[1]+1===u?(s.key+=p,s.range[1]=u):(s&&(h=s.key,d=a.has(h)?a.get(h)+1:0,a.set(h,d),s.key+=""+d),e.push({opWrappers:v,key:p,range:[u,u]})),e)},[]),c=u.length;0<=--c;)!function(){var e=u[c],n=e.opWrappers,i=e.range,a=e.key,l=(0,r._)(i,2),e=l[0],i=l[1],l=t.slice(e,i+1),l=n.reduce(function(t,e){return t=Array.isArray(t)?t:[t],v.Tm.apply(void 0,(0,r.e)([e,((e={})[s.lE]=!0,e.ref=function(t){o.mu(t,a)},e)],t))},l);l instanceof HTMLElement||(l.props.key=a),t.splice(e,i-e+1,l)}();return t},n.render=function(){var t,e=this.props.editor,n=this._u();return T.ZP.createElement(d.D,(0,r.b)({},((t={})[s.PI]=!0,t),{ref:this.handleRef,dir:e._dir||"auto",className:this.eu}),n)},(0,r.a)([m.W],e.prototype,"handleRef",null),e}(T.ZP.Component),D=function(t){function e(e){var n=t.call(this,e)||this;return n.vc=!1,n.ac={mainContentLines:[],retentiveLines:[],invisibleLines:[]},n.childrenCommonProps={editor:e.editor},n}(0,r.d)(e,t);var n=e.prototype;return n.componentWillReceiveProps=function(t){this.childrenCommonProps={editor:t.editor},this.jc(t)},n.componentDidMount=function(){var t,e;this.vc=!0,null!==(e=(t=this.props).onMount)&&void 0!==e&&e.call(t),this.hc(),this.fc()},n.componentDidUpdate=function(t){var e=this.props.editor;e.getStatus("isPainting")&&(e.setStatus("isPainting",!1),this.hc(),this.fc())},n.componentWillUnmount=function(){this.vc=!1;var t=this.props,e=t.editor,t=t.state;e._getViewModel()._resetNode(t)},n.fc=function(){var t,e,n,i,o=this.props.state,a=this.yc();try{for(var l=(0,r.c)(o.lines),u=l.next();!u.done;u=l.next()){var c=u.value,d=c.getNode();if(d&&(d.__index=c.index),!d&&a.has(c))throw Error("line DOM is null\nzoneId: "+this.props.zoneId+", line: "+c.index)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(e=l.return)&&e.call(l)}finally{if(t)throw t.error}}if(o=o.getContainer())try{for(var f=(0,r.c)(Array.from(o.children)),h=f.next();!h.done;h=f.next()){var p=h.value;p.getAttribute(s.PI)||p.getAttribute(s.Q0)||this.dc(p)}}catch(t){n={error:t}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}},n.shouldComponentForceUpdate=function(t,e){var n,i,o,s,a,l,u=e.changes,c=!0,d=this.props,f=d.editor,e=d.zoneId,f=null===(d=f.virtualListManager)||void 0===d?void 0:d.getVirtualListModuleOfZone(e),d=!!f&&f.isEnabled,e=d&&(null==f?void 0:f.getContentChangeCacheData())||null,u=(null===e?void 0:e.originalChanges)||u;try{for(var h=(0,r.c)(u),p=h.next();!p.done;p=h.next()){var v=p.value;if([x.U.LINE_DELETE,x.U.LINE_INSERT].includes(v.type)){c=!1;break}if(v.type===x.U.LINE_UPDATE){for(var g=!1,y=0;y<v.inserts.length&&!(g=(0,w.r)(v.inserts[y].state,v.deletes[y]));++y);if(g){c=!1;break}}}}catch(t){a={error:t}}finally{try{p&&!p.done&&(s=h.return)&&s.call(h)}finally{if(a)throw a.error}}if(c)return!1;l=e?(s=e.nextRenderLines,a=e.nextRetentiveLines,(0,r.e)(new Set((0,r.e)(s,a)))):t.state.lines;var t=this.props.state.lines,m=new Map;try{for(var b=(0,r.c)(t),E=b.next();!E.done;E=b.next()){var S=E.value;m.set(S.getKey(),S)}}catch(t){I={error:t}}finally{try{E&&!E.done&&(n=b.return)&&n.call(b)}finally{if(I)throw I.error}}for(var I,C,L=!1,y=0;y<l.length;++y){var _=l[y];if(L=this.mc(_))break;var T=m.get(_.getKey());if(T&&(0,w.r)(_,T)){L=!0;break}}if(!L){C=e?(I=e.prevRenderLines,C=e.prevRetentiveLines,(0,r.e)(new Set((0,r.e)(I,C)))):this.props.state.lines;try{for(var A=(0,r.c)(C),M=A.next();!M.done;M=A.next()){var k=M.value;if(L=this.mc(k))break}}catch(t){i={error:t}}finally{try{M&&!M.done&&(o=A.return)&&o.call(A)}finally{if(i)throw i.error}}}return L&&d&&null!=f&&f.beforeRendererForceUpdate(),L},n.mc=function(t){return this.props.editor.pluginManager.getLineWrapperInfo(t).hasWrapper},n.dc=function(t){var e,n,i,o=Array.from(t.querySelectorAll("["+s.PI+"]"));if(o.length){var a=o[0].__index,l=[];try{for(var u=(0,r.c)(o),c=u.next();!c.done;c=u.next()){var d=c.value.__key;d&&l.push(d)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}if(0!==l.length)for(var f=_.Gm+l.join(_.rC),h=t;h;)h.__key=f,h.__index=a,h=null!==(i=h.firstElementChild)&&void 0!==i&&i.getAttribute(s.PI)?null:h.firstElementChild}},n.hc=function(){var t=this;Promise.resolve().then(function(){var e,n,r;t.vc&&(r=Array.from(t.yc()),null!==(n=(e=t.props).onDidPaint)&&void 0!==n&&n.call(e,r.map(function(t,e){return{data:t,originIndex:e}})))})},n.jc=function(t){var e=(t=void 0===t?this.props:t).editor,n=t.zoneId,t=t.state,n=null===(e=e.virtualListManager)||void 0===e?void 0:e.getVirtualListModuleOfZone(n);this.ac.mainContentLines=null!=n&&n.isEnabled?n.getNextRenderLines():t.lines,this.ac.retentiveLines=null!=n&&n.isEnabled?n.getRetentiveLines():[],this.ac.invisibleLines=null!=n&&n.isEnabled?n.getInvisibleLines():[]},n.yc=function(){var t=this.ac,e=t.mainContentLines,n=t.retentiveLines,t=t.invisibleLines,i=new Set(t);return new Set((0,r.e)(e,n).filter(function(t){return!i.has(t)}))},n.render=function(){var t=this;this.jc();var e=this.props,n=e.editor,e=e.zoneId,n=null===(n=n.virtualListManager)||void 0===n?void 0:n.getVirtualListModuleOfZone(e),e=[];this.vc&&null!=n&&n.isEnabled&&(e=(null===(o=null===(i=null==n?void 0:n.getContentChangeCacheData)||void 0===i?void 0:i.call(n))||void 0===o?void 0:o.extraForceUpdateLines)||[]);var i=this.ac,n=i.mainContentLines,o=i.retentiveLines,i=i.invisibleLines,s=new Set(i),o=Array.from(new Set((0,r.e)(n,o,e).filter(function(t){return!s.has(t)}))).sort(function(t,e){return t.index-e.index}),e=o.map(function(e){return T.ZP.createElement(O,(0,r.b)({},t.childrenCommonProps,{state:e,key:e.getKey()}))});return(0,A.wo)(o,e,function(e){return t.props.editor.pluginManager.getLineWrapperInfo(e)}),e},e}(T.ZP.Component);function z(t){var e=t.editor,n=t.zoneId,i=t.Context,o=t.contextValue,s=t.children,t=(0,r._)((0,p.useState)(o),2),o=t[0],l=t[1];return(0,p.useEffect)(function(){function t(t){t.zoneId===n&&t.Context===i&&l(t.contextValue)}return e.on(a.r.REACT_CONTEXT_UPDATE,t),function(){e.off(a.r.REACT_CONTEXT_UPDATE,t)}},[e,n,i]),p.createElement(i.Provider,{value:o},s)}var P=n("939903"),Z=n("481685"),W=n("85359"),K=n("703671"),U=n("683208");function F(t,e){e=function(t,e){void 0===e&&(e=!1);var t=t.parentElement,n=[],r=document.scrollingElement||document.documentElement;!e&&t&&(r=t);for(var i=t;i&&i!==r;)(i.offsetHeight<i.scrollHeight||i.offsetWidth<i.scrollWidth)&&n.push([i,i.scrollTop,i.scrollLeft]),i=i.parentElement;return n.push([r,r.scrollTop,r.scrollLeft]),n}(t,e=void 0!==e&&e),t.focus({preventScroll:!0}),function(t){for(var e=0;e<t.length;e++)t[e][0].scrollTop=t[e][1],t[e][0].scrollLeft=t[e][2];t=[]}(e)}var B=n("274709"),V=n("361087"),j=n("91821"),H=function(){function t(t){var e=t.editor,t=t.range;this.fn=[],this.Sn=[],this.En=0,this.bn=null,this.s=e,t&&(this.fn.push(t),this.Sn.push(t))}var e=t.prototype;return Object.defineProperty(e,"range",{get:function(){return this.fn[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e,"prevRange",{get:function(){return this.Sn[0]},enumerable:!1,configurable:!0}),e.yn=function(t,e){this.En=t,this.bn=e},e.gn=function(){this.yn(0,null)},e.qn=function(t){return t&&(null===(t=this.s.getContentState().getZoneState(t))||void 0===t?void 0:t.getContainer())||null},e.focus=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1);var r=null===(i=this.range)||void 0===i?void 0:i.start.zoneId,i=!1;"boolean"==typeof(t=void 0!==t&&t)?(i=t,n=e):(r=t,i=e),!r||!n&&this.hasFocus(r)||(r=this.qn(r))&&(F(r,i),this.setSelection(this.fn,!0))},e.hasFocus=function(t){var e=null!=t?t:null===(e=this.range)||void 0===e?void 0:e.start.zoneId;return!!e&&this.s.isFocus(e)},e.getSelection=function(t,e){var n=this.range;return"string"==typeof t?n=this.fn.find(function(e){return e.start.zoneId===t})||null:e=t,e=e||this.s.getContentState(),n&&e.getZoneState(n.start.zoneId)?n.clone(e):n},e.getMultipleSelection=function(){var t=this;return this.fn.map(function(e){return t.s.getContentState().getZoneState(e.start.zoneId)?e.clone():e})},e.isZoneInSelection=function(t){for(var e=!1,n=0,r=this.fn.length;n<r;++n)if(this.fn[n].start.zoneId===t){e=!0;break}return e},e.Mn=function(t){var e=this.s,n=this.s.modulesContainer.get(l.h.Range),i=null;switch(typeof t.start){case"number":i=new K.L((0,r.b)((0,r.b)({},t),{editor:e})).toRange();break;case"object":i=new n((0,r.b)((0,r.b)({},t),{editor:e}))}return i},e.wn=function(t){return new(this.s.modulesContainer.get(l.h.Range))({editor:this.s,start:this.pn(t.start),end:this.pn(t.end),isBackward:t.isBackward})},e._replaceSingleRangeModel=function(t,e){void 0===e&&(e=!1);var n,r=this.Mn(t);!r||(t=-1===(n=this.fn.findIndex(function(t){return t.start.zoneId===(null==r?void 0:r.start.zoneId)}))?null:this.fn[n])&&(this.Sn=this.fn,!e&&j.W.isRangeEqual(t,r)||(r=this.wn(r),(t=this.fn.slice(0))[n]=r,this.fn=t))},e._setSelectionModel=function(t,e){var n,i,o=this;void 0===e&&(e=!1);var t=Array.isArray(t)?t:[t],s=[];try{for(var a=(0,r.c)(t),l=a.next();!l.done;l=a.next()){var u=l.value,c=this.Mn(u);c&&s.push(c)}}catch(t){n={error:t}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}this.Sn=this.fn,!e&&j.W.isRangesEqual(this.fn,s)||(s=s.map(function(t){return o.wn(t)}),this.fn=s)},e.setSelection=function(t,e){this.s.log({scope:"[Selection][setSelection]",level:"info",shouldLogToMobile:!1,force:e=void 0!==e&&e,sel:t,range:this.fn,stack:Error().stack}),this._setSelectionModel(t),this._dispatchEvent(e),e&&this.updateBrowserSelection()},e._dispatchEvent=function(t){var e=this.fn,n=this.Sn;!t&&j.W.isRangesEqual(n,e)||this.range&&this.s.call(a.r.SELECTION_CHANGE,{previousRanges:n,currentRanges:e,previous:this.prevRange,current:this.range,attributes:this.s.getContentState().getAttributes(this.range.start,this.range.end)})},e.updateBrowserSelection=function(t){if(this.s.log({scope:"[Selection][updateBrowserSelection]",level:"info",shouldLogToMobile:!1,updateDomSelectionTimes:this.En,force:t,ranges:this.fn}),this.range&&!(1<this.fn.length)){var e=this.range.toPosition(),n=this.s.getContentState().getZoneState(e.zoneId),r=W.Xh.safari&&n&&e.len===n.totalWidth()-1-(null!==(r=n.getLine(0))&&void 0!==r&&r.hasLineMarker()?1:0);if(t||!this.s.getStatus("isMouseDown")||r){if(r=this._toDOMRange(this.range)){try{this._updateDOMSelection(r)}catch(t){this.s.error({message:"[Selection][updateBrowserSelection] range:"+this.range+" _updateDOMSelection occur error",level:i.W.ERROR})}this.s.call(a.r.SELECTION_CHANGE_AND_DOM_UPDATE,{selection:this.range})}else this.s.error({message:"[Selection][updateBrowserSelection] range:"+this.range+" _toDOMRange faild",level:i.W.ERROR})}}},e.selectAll=function(t){void 0===t&&(t=o.S);var e,n,r=this.s.getContentState().getZoneState(t);r&&(e=r.getLine(0),(n=r.getLine(r.length()-1))&&e&&(t=new(this.s.modulesContainer.get(l.h.Range))({editor:this.s,start:{line:0,offset:e.hasLineMarker()?1:0,zoneId:t},end:{line:r.length()-1,offset:n.length()-1,zoneId:t}}),this.s.log({scope:"[Selection][selectAll]",level:"info",shouldLogToMobile:!1,range:t,stack:Error().stack}),this.setSelection(t),this.updateBrowserSelection()))},e.isSelectingAll=function(t){void 0===t&&(t=o.S);var e=this.getSelection(t);if(!e)return!1;var n=e.start,r=e.end,i=this.s.getContentState().getZoneState(t);return!!i&&(e=i.length()-1,t=i.getLine(0),!(!(i=i.getLine(e))||!t)&&0===n.line&&n.offset===(t.hasLineMarker()?1:0)&&r.line===e&&r.offset===i.length()-1)},e.pn=function(t){var e=this.s,n=t.zoneId,e=e.getContentState().getZoneState(n);return e?(n=e.length()-1,t.line=Math.max(0,t.line),t.line>n&&(t.line=n,t.offset=e.getLine(n).getModelText().length-1),e=e.getLine(t.line),t.offset=Math.min(e.getModelText().length-1,t.offset),t.offset<=0&&(t.offset=e.hasLineMarker()?1:0),t):t},e._handleDOMSelectionChange=function(){var t,e,n,r,i=window.getSelection();null!==i&&(this.s.log({scope:"[Selection][_handleDOMSelectionChange]",level:"info",shouldLogToMobile:!1,sel:i}),W.Xh.ios&&null===i.focusNode&&this.s.isFocus()&&(this.s.setStopUpdateSelection(!1),this.setSelection(this.getSelection(),!0)),this.s.getStatus("stopUpdateSelection")||(e=(0,V.Zj)(i,0))&&(n=e.startContainer,r=e.endContainer,t=e.collapsed,!(e=this.s.getContainer()).contains(n)||!t&&!e.contains(r)||(0,V.E_)(n)&&(0,V.E_)(r)||(n=this._toModelRange(i))&&(r=!(W.Xh.isAndroid&&!n.isCollapsed()),this.s.getStatus("isMouseDown")||(i=n.toPosition(),this.s.log("[Log]","[Selection][_handleDOMSelectionChange] selection",JSON.stringify({zoneId:i.zoneId,start:i.start,timestamp:Date.now()}))),this.setSelection(n,r))))},e.toDOMRange=function(t,e){return this._toDOMRange(t,e=void 0===e?{ignoreNormalize:!1}:e)},e._toDOMRange=function(t,e){void 0===e&&(e={ignoreNormalize:!1});var n=t.start,r=t.end,n=this.In(n),r=this.In(r);return n.node&&r.node?e.ignoreNormalize?(0,V.XM)(n,r):(t=(r=this.Tn(n,r,t)).start,r=r.end,(0,V.XM)(t,r)):null},e.Tn=function(t,e,n){var i=t.node,o=t.offset,a=e.node,l=e.offset,u=n.start,c=n.end,d=(0,V.E_)(i),f=(0,V.E_)(a),h=(null===(p=(0,V.Ju)(i))||void 0===p?void 0:p.length)||0,p=(null===(v=(0,V.Ju)(a))||void 0===v?void 0:v.length)||0,v=(0,V.x1)(i);if(!d&&!f&&i&&i===a&&t.offset===e.offset&&(m=i instanceof Element?i:i.parentElement)&&m.closest("["+s.q7+"]")){var g={node:m,offset:(null===(g=null==m?void 0:m.textContent)||void 0===g?void 0:g.length)||0};return{start:g,end:g}}if(d&&(0,V.hl)(i)&&i===a&&u<c||d&&0===o&&(0,V.hl)(i)&&f&&l===p&&(0,V.hl)(a))return{start:t,end:e};if(d&&f&&i!==a&&!(0,V.hl)(i)&&!(0,V.hl)(a)){var g=this.Cn(u.zoneId,u.line),y=this.Cn(c.zoneId,c.line);return{start:this.Dn(t,g,1),end:this.Dn(e,y,1)}}if(n.isCollapsed()&&d&&o===h){var m,b=this.Cn(u.zoneId,u.line);return(m=(E=this.Dn(t,b,1)).node instanceof Element?E.node:null===(y=E.node)||void 0===y?void 0:y.parentElement)&&m.closest("["+s.q7+"]")&&(E.offset=1),{start:E,end:E}}if(n.isCollapsed()&&d&&0===o)return b=this.Cn(u.zoneId,u.line),{start:E=this.Dn(t,b,-1),end:E};if(d&&f&&i!==a&&n.isBackward){var E,b=this.Cn(c.zoneId,c.line);return{start:t,end:E=this.Dn(e,b,1)}}return v&&f&&(null==i?void 0:i.nextSibling)===a&&(0,V.iB)(a)&&!this.s.getStatus("isMouseDown")?{start:(0,r.b)((0,r.b)({},e),{offset:0}),end:e}:d&&0===o?(b=this.Cn(u.zoneId,u.line),{start:this.Dn(t,b,-1),end:e}):f&&0===l?(b=this.Cn(c.zoneId,c.line),{start:t,end:this.Dn(e,b,-1)}):d&&o===h&&f&&n.toPosition().len<=((null===(a=(0,V.Ju)(a))||void 0===a?void 0:a.length)||0)?{start:(0,r.b)((0,r.b)({},e),{offset:0}),end:e}:d&&o===h?(b=this.Cn(u.zoneId,u.line),{start:this.Dn(t,b,1),end:e}):f&&l===p?(b=this.Cn(c.zoneId,c.line),{start:t,end:this.Dn(e,b,1)}):{start:t,end:e}},e.Dn=function(t,e,n){var i,o,a=t.node;if(!(e&&a instanceof Element))return t;var l=(0,V.U_)(e),u=l.indexOf(a),u=l[u+n]||a;if(u.hasAttribute(s.eu)){var a=(0,V.iB)(u);return a?{node:a,offset:!(0<n)&&(null===(a=a.textContent)||void 0===a?void 0:a.length)||0}:this.Dn((0,r.b)((0,r.b)({},t),{node:u}),e,1)}return W.Xh.safari&&u.hasAttribute(s.VI)&&null!==(i=u.nextElementSibling)&&void 0!==i&&i.hasAttribute(s.eu)?{node:u,offset:(null===(o=u.textContent)||void 0===o?void 0:o.length)||0}:u.closest("["+s.q7+"]")?W.Xh.safari?{node:u,offset:0}:{node:u,offset:(null===(o=u.textContent)||void 0===o?void 0:o.length)||0}:{node:u,offset:!(0<n)&&(null===(u=u.textContent)||void 0===u?void 0:u.length)||0}},e.In=function(t){var e=t.zoneId,n=t.line,r=t.offset,t=this.Cn(e,n);return t?(n=null===(e=this.s.getContentState().getZoneState(e))||void 0===e?void 0:e.getLine(n))?this.Ln(t,Math.max(r-(null!=n&&n.hasLineMarker()?1:0),0)):{node:null,offset:0}:{node:null,offset:0}},e.Ln=function(t,e){if((0,V.y1)(t))return{node:t,offset:e};if(!t||!t.querySelectorAll)return{node:t,offset:0};var n=(0,V.U_)(t),i=0;try{for(var o=(0,r.c)(n),a=o.next();!a.done;a=o.next()){var l,u,c,d,f,h,p=a.value,v=(null===(c=p.textContent)||void 0===c?void 0:c.length)||0;if(p.hasAttribute(s.eu)&&(v=(h=p.getAttribute(s.eu))?Math.min(h.length,e-i):0),!((i+=v=p.hasAttribute(s.VI)?0:v)<e))return W.Xh.safari&&p.hasAttribute(s.VI)&&null!==(d=p.nextElementSibling)&&void 0!==d&&d.hasAttribute(s.eu)?{node:p,offset:(null===(f=p.textContent)||void 0===f?void 0:f.length)||0}:{node:p,offset:Math.max(v+e-i,0)}}}catch(t){l={error:t}}finally{try{a&&!a.done&&(u=o.return)&&u.call(o)}finally{if(l)throw l.error}}return{node:t,offset:0}},e.Cn=function(t,e){var n,i,a,l,u=this.s._getViewModel(),c=null===(a=this.s.getContentState().getZoneState(t))||void 0===a?void 0:a.getLine(e);if(!c)return null;if(u=u.getView(c))return u;var d=t===o.S?this.s.getContainer():document.querySelector('[data-zone-id="'+t+'"]'),t=Array.from((null==d?void 0:d.querySelectorAll(".ace-line,["+s.Q0+"]"))||[]).filter(function(t){return t.closest("["+s.Ks+"]")===d}),f=0;try{for(var h=(0,r.c)(t),p=h.next();!p.done;p=h.next()){var v=p.value;if(f>c.index)return null;if(f===c.index)return v.hasAttribute(s.Q0)?null:v;var g=(null===(l=v.getAttribute(s.Q0))||void 0===l?void 0:l.split("-").map(function(t){return+t}))||[];g.length?f+=g[1]-g[0]+1:f++}}catch(t){n={error:t}}finally{try{p&&!p.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}return null},e.On=function(t){var e=t.start,n=t.end,r=t.isBackward,o=t.zoneId,s=this._toModelRangePoint(e,!1,o),t=this._toModelRangePoint(n,!0,o);if(!s||!t)return this.s.error({message:"[Selection][_calcModelRangeFromDom] startPoint: "+s+", endPoint: "+t,level:i.W.ERROR}),null;if(!o&&s.zoneId!==t.zoneId&&!this.s._isFixToCommonZone)return null;if(o&&s.zoneId!==t.zoneId){if(!(e=this.s.getContentState().getZoneState(o)))return null;if(n=e.length()-1,!(e=e.getLine(n)))return null;o===s.zoneId?t={line:n,offset:e.length()-1,zoneId:o}:o===t.zoneId?s={line:0,offset:0,zoneId:o}:(s={line:0,offset:0,zoneId:o},t={line:n,offset:e.length()-1,zoneId:o})}return new(this.s.modulesContainer.get(l.h.Range))({start:s,end:t,isBackward:r,editor:this.s})},e.toModelRange=function(t,e){return this._toModelRange(t,e)},e._toModelRange=function(t,e){var n=!1;if("selection"===function(t){var e=Object.prototype.toString.call(t);if(e){var n=e.split(" ")[1];if(n)return n.slice(0,-1).toLowerCase()}return""}(t)){var r=t.anchorNode,i=t.anchorOffset,o=t.focusNode,s=t.focusOffset,a=(0,V.Zj)(t,0);if(!a)return null;var l=(t=a).startContainer,u=t.startOffset,c=t.endContainer,a=t.endOffset,n=r!==l||o!==c||i!==u||s!==a}return c=t.startContainer,i=t.startOffset,u=t.endContainer,s=t.endOffset,null!=(a=this.On({start:{node:c,offset:i},end:{node:u,offset:s},isBackward:n,zoneId:e}))&&a.isCollapsed()&&!t.collapsed&&(s=(u=this.Tn({node:c,offset:i},{node:u,offset:s},a)).start,u=u.end,a=this.On({start:s,end:u,isBackward:n,zoneId:e})),a},e._toModelRangePoint=function(t,e,n){void 0===e&&(e=!1);var i,o,a,l=(0,V.KK)(t),u=l.node,c=l.offset,l=(0,V.mO)(u);if(!u||!l||!(0,V.Tl)(this.s,l,e)){if(!n)return null;var d=this.s.getContentState().getZoneState(n);if(!d)return null;var f=d.length()-1,h=d.getLine(f);return h?e?{line:f,offset:h.length()-1,zoneId:n}:{line:0,offset:0,zoneId:n}:null}f=(d=(0,V.Tl)(this.s,l,e)).getZoneId(),h=d.index,n=0,(l=u instanceof HTMLElement?(0,V.Ny)(u):(0,V.Ny)(u.parentElement))&&(c=0),l&&e&&(n=(null===(p=l.getAttribute(s.eu))||void 0===p?void 0:p.length)||0);var p=(0,V.qI)(u);if(p&&(n=c=0,l=p),!(l=l||(u instanceof HTMLElement?u.closest("["+s.nV+"]"):null===(v=u.parentElement)||void 0===v?void 0:v.closest("["+s.nV+"]")))){var v=(0,V.fr)(t),t=v?(0,V.MK)(v):0;if(v&&t){var g=Array.from(v.querySelectorAll("["+s.VI+"]"));if(g.length)try{for(var y=(0,r.c)(g),m=y.next();!m.done;m=y.next()){var b=m.value;null!==(a=b.textContent)&&void 0!==a&&a.length&&this.s.log("trace",{zerospacesLength:g.length,domInfo:(0,U.F)(b)})}}catch(t){i={error:t}}finally{try{m&&!m.done&&(o=y.return)&&o.call(y)}finally{if(i)throw i.error}}}return{line:h,offset:Math.max(t=t+(d.hasLineMarker()?1:0)+n,0),zoneId:f}}return l.hasAttribute(s.q7)&&(c=0),{line:h,offset:Math.max(d=(l&&(null===(l=this.s._getViewModel().getLeafModel(l))||void 0===l?void 0:l.start)||0)+c+n+(d.hasLineMarker()?1:0),0),zoneId:f}},e._updateDOMSelection=function(t){var e=this,n=t.startContainer,r=t.startOffset,i=t.endContainer,o=t.endOffset,s=document.getSelection();if(this.s.log({scope:"[Selection][_updateDOMSelection]",level:"info",shouldLogToMobile:!1,selection:s,preDomSelection:this.bn,updateDomSelectionTimes:this.En}),this.En>=100&&null!==this.bn&&this.bn===s)return this.En,this.range,100===this.En&&setTimeout(function(){e.gn()},200),void this.En++;if(null!==s){if(null===n||null===i)return s.removeAllRanges(),this.s.getContainer().blur(),void this.gn();this.hasFocus()||(u=this.qn(null===(l=this.range)||void 0===l?void 0:l.start.zoneId))&&F(u);var a,l=(0,V.Zj)(s,0);if(l&&this.Pn(t,l))this.gn();else{if(s.anchorNode!==s.baseNode||s.focusNode!==s.extentNode){var u=(0,V.Yr)(s,l)?{startContainer:s.extentNode,startOffset:s.extentOffset,endContainer:s.baseNode,endOffset:s.baseOffset}:{startContainer:s.baseNode,startOffset:s.baseOffset,endContainer:s.extentNode,endOffset:s.extentOffset};if(this.Pn(t,u))return void this.gn()}this.yn(this.En+1,s),s.collapse&&s.extend?n===i&&r===o?s.collapse(n,r):null!==(a=this.range)&&void 0!==a&&a.isBackward?(s.collapse(i,o),s.extend(n,r)):(s.collapse(n,r),s.extend(i,o)):((a=document.createRange()).setStart(n,r),a.setEnd(i,o),s.removeAllRanges(),s.addRange(a))}}else this.gn()},e.Pn=function(t,e){return t.startContainer===e.startContainer&&t.endContainer===e.endContainer&&t.startOffset===e.startOffset&&t.endOffset===e.endOffset},e.An=function(t,e,n,r){var i=this.Cn(t.zoneId,t.line);if(!i)return 0;var t=e.hasAttribute(s.VI)||e.hasAttribute(s.q7),o=r?null===(o=e.textContent)||void 0===o?void 0:o.slice(n):null===(a=e.textContent)||void 0===a?void 0:a.slice(0,n),a=r?1:-1,n=0;if(o&&o.length&&!t)n=(r?B.X:B.j)(o);else{i=(0,V.U_)(i),e=(0,V.Ny)(e)||e;var e=i.indexOf(e),i=r?i.slice(e+1).find(function(t){return!(0,V.x1)(t)}):i.slice(0,e).reverse().find(function(t){return!(0,V.x1)(t)});if(!i)return a;n=(0,V.Ny)(i)?(null===(e=(0,V.Ju)(i))||void 0===e?void 0:e.length)||1:(i=i.textContent||"",(r?B.X:B.j)(i))}return a*Math.max(n,1)},e.kn=function(t){var e=(0,r.b)({},t),n=t.zoneId,i=t.line,o=t.offset,s=this.s.getContentState().getZoneState(n);if(!s)return t;var a=s.getLine(i);if(!a)return t;var l=a.hasLineMarker()?1:0,u=a.length()-1,n=null===(a=this.s.virtualListManager)||void 0===a?void 0:a.getVirtualListModuleOfZone(n),c=null==n?void 0:n.getInvisibleLinesModule();if(o<l){if(0<i){for(;e.line--,null!=c&&c.isInvisible(e.line););if(!(n=s.getLine(e.line)))return t;e.offset=n.length()-1}else e.offset=l}if(u<o){if(i<s.length()-1){for(;e.line++,null!=c&&c.isInvisible(e.line););e.offset=null!==(s=s.getLine(e.line))&&void 0!==s&&s.hasLineMarker()?1:0}else e.offset=u}return e},e.handleArrowKey=function(t){var e,n,i,o,a,u,c,d,f,h,p,v,g,y,m,b,E,S,I=t.evt,C=I.keyCode,L=I.shiftKey,w=I.metaKey,x=I.altKey,_=I.ctrlKey;"keydown"===I.type&&(e=C===s.VD.Right||W.Xh.isMac&&_&&C===s.VD.F,!(m=C===s.VD.Left||W.Xh.isMac&&_&&C===s.VD.B)&&!e||w||this.s.getStatus("stopUpdateSelection")||1<this.fn.length||null===(g=window.getSelection())||(h=(0,V.Zj)(g,0))&&(p=h.startContainer,n=h.startOffset,v=h.endContainer,i=h.endOffset,o=h.collapsed,u=null==(a=p instanceof Element?p:p.parentElement)?void 0:a.hasAttribute(s.VI),b=(0,V.Eb)(a,n),d=null==(c=v instanceof Element?v:v.parentElement)?void 0:c.hasAttribute(s.VI),f=(0,V.Eb)(v,i),E=(y=this.getSelection()).start,t=y.end,w=y.isBackward,p=null===(h=(g=this.s.getContentState()).getZoneState(E.zoneId))||void 0===h?void 0:h.getLine(E.line),y=null===(v=g.getZoneState(t.zoneId))||void 0===v?void 0:v.getLine(t.line),h=E.offset===((null==p?void 0:p.length())||0)-1,v=E.offset===Number(null==p?void 0:p.hasLineMarker()),p=t.offset===((null==y?void 0:y.length())||0)-1,this.s.log({scope:"[Selection][handleArrowKey]",level:"info",shouldLogToMobile:!1,keyCode:C,selection:this.getSelection(),isStartInZeroSpace:u,isStartInFakeText:b,isEndInZeroSpace:d,isEndInFakeText:f,isStartPointInLineEnd:h,isStartPointInLineStart:v,isEndPointInLineEnd:p}),(d||p||u||h||v||b||f)&&(L&&!_&&w&&(u||h||b)&&a&&(E=this.kn((0,r.b)((0,r.b)({},E),{offset:E.offset+=this.An(E,a,n,e)}))),a&&c&&(L?(C=0===E.offset,v=0===E.line,b=t.offset===((null==y?void 0:y.length())||0)-1,g=t.line===((null===(y=g.getZoneState(t.zoneId))||void 0===y?void 0:y.length())||0)-1,y=!0,!v&&C&&m&&(o||w)?(S=this.An(E,a,n,e),1<Math.abs((m=this.kn((0,r.b)((0,r.b)({},E),{offset:E.offset+S}))).line-E.line)&&(E=m,o&&(w=!0),y=!1)):g||!b||!e||!o&&w||(S=this.An(t,c,i,e),1<Math.abs((b=this.kn((0,r.b)((0,r.b)({},t),{offset:t.offset+S}))).line-t.line)&&(t=b,o&&(w=!1),y=!1)),!_&&!w&&(d||p||f)&&y&&(t=this.kn((0,r.b)((0,r.b)({},t),{offset:t.offset+=this.An(t,c,i,e)})))):o&&(!(_&&W.Xh.windows||x&&W.Xh.isMac)||h&&e)&&(S=this.An(E,a,n,e),t=E=this.kn((0,r.b)((0,r.b)({},E),{offset:E.offset+=S}))),!L&&!o&&u&&d&&(S=this.An(E,a,n,e),t=E=this.kn((0,r.b)((0,r.b)({},E),{offset:E.offset+=S}))),w=new(this.s.modulesContainer.get(l.h.Range))({editor:this.s,start:E,end:t,isBackward:w}),this.range&&!j.W.isRangeEqual(w,this.range)&&(this.setSelection(w,!0),I.preventDefault())))))},(0,r.a)([m.W],t.prototype,"updateBrowserSelection",null),(0,r.a)([m.W],t.prototype,"_handleDOMSelectionChange",null),(0,r.a)([m.W],t.prototype,"handleArrowKey",null),t}(),X={click:"_handleClickEvent",keydown:"_handleKeyEvent",keypress:"_handleKeyEvent",keyup:"_handleKeyEvent",input:"_handleInputEvent",beforeinput:"_handleBeforeInput",compositionstart:"_handleCompositionEvent",compositionupdate:"_handleCompositionEvent",compositionend:"_handleCompositionEvent",copy:"_handleCopy",cut:"_handleCut",paste:"_handlePaste",drop:"_handleDrag",dragenter:"_handleDrag",dragover:"_handleDrag",dragleave:"_handleDrag",focus:"_handleFocusEvent",blur:"_handleFocusEvent"},q=["copy","cut","paste","keydown","keypress","keyup","beforeinput","input","drop","dragenter","dragover","dragleave","resize","compositionstart","compositionupdate","compositionend","focus","blur"],Y=n("809919"),G=n("333475"),J=n("919421"),Q=n("269516"),$=function(){function t(){this.y={},this.A={}}var e=t.prototype;return e.on=function(t,e,n){this.x(t,e,!1,n)},e.once=function(t,e,n){this.x(t,e,!0,n)},e.off=function(t,e){this.Y(t,e)},e.removeEventListener=function(t,e){this.Y(t,e)},e.trigger=function(t,e){this.J(t,e)},e.reset=function(){this.y={},this.A={}},e.removeListener=function(t,e){this.Y(t,e)},e.getListeners=function(t){var e=this.y[t];if(!e)return[];var n=[];return Object.keys(e).sort(function(t,e){return+t-+e}).forEach(function(t){n=n.concat(e[t])}),n},e.x=function(t,e,n,r){var i;void 0===n&&(n=!1),void 0===r&&(r=1e3),this.y[t]||(this.y[t]={},this.A[t]=new Set),this.A[t].has(e)||(i={listener:e,isOnce:n,priority:r},(n=this.y[t])[r]?n[r].push(i):n[r]=[i],this.A[t].add(e))},e.Y=function(t,e){var n,i;if(this.y[t])try{for(var o=(0,r.c)(Object.keys(this.y[t])),s=o.next();!s.done;s=o.next()){var a=s.value,l=this.y[t][a],u=l.findIndex(function(t){return t.listener===e});if(-1!==u){l.splice(u,1),l.length||delete this.y[t][a],this.A[t].delete(e);break}}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},e.J=function(t,e){var n=this;void 0===e&&(e=[]),this.getListeners(t).forEach(function(r){var i=r.listener;r.isOnce&&n.Y(t,i),i.apply(i,e)})},t}(),tt=n("422639"),te=n("514516"),tn=n("500122"),tr=n("880001"),ti=n("723520"),to=n("273150"),ts=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.inputType="",(0,ti.uc)(r,to.cd,e,n),r}return(0,r.d)(e,t),e}(n("560932").D),ta=n("175489"),tl="selectionchange",tu=new(function(){function t(){var t=this;this.Q=new Map,this.X=new Map,this.dispatchNativeEvent=function(e){var n=e.type,r=null;if(e.type===tl){var i=window.getSelection();if(!i||!i.rangeCount)return;r=(null===(i=i.getRangeAt(0).startContainer.parentElement)||void 0===i?void 0:i.closest("[contenteditable]"))||null}for(var o=t.Z(n,r||e.target),s=0,a=o.length;s<a;s++){var l=o[s],u=l.dom,l=l.handle;t.$(e,u,r)&&l(e)}},this.on=function(e,n,r,i){var o=void 0===i?{}:i,i=o.priority,s=void 0===i?0:i,o=o.customizedDelegateDom;t.tt(e,n,o||null);var a={dom:n,handle:r,priority:s},l=t.Q.get(n);l||t.Q.set(n,l={}),l[e]||(l[e]=[]);for(var u=0;u<l[e].length;u++)if(l[e][u].priority>s)return void l[e].splice(u,0,a);l[e].push(a)},this.off=function(e,n,r){var i=t.Q.get(n);if(i&&i[e]){for(var o=i[e].length-1;0<=o;o--)i[e][o].handle===r&&i[e].splice(o,1);i[e].length||delete i[e],Object.keys(i).length||(t.Q.delete(n),t.et(n)),t.Q.size||t.rt()}}}var e=t.prototype;return e.tt=function(t,e,n){switch(t){case"resize":r=n||window;break;case"focus":case"blur":r=n||e instanceof HTMLElement&&e.closest("[contenteditable]")||document;break;default:r=n||document}var r,i=this.X.get(r);i||(i=new Map,this.X.set(r,i)),i.has(t)||(r.addEventListener(t,this.dispatchNativeEvent),i.set(t,!0))},e.Z=function(t,e){for(var n=[];e;){var i=this.Q.get(e);i&&i[t]&&n.push.apply(n,(0,r.e)(i[t])),e=e.parentNode}return n.sort(function(t,e){return t.priority-e.priority})},e.$=function(t,e,n){if(t.defaultPrevented)return!1;if(t.type===tl){if(e instanceof HTMLElement)return e.hasAttribute("contenteditable")?e.contains(n):!(!(n=window.getSelection())||!n.rangeCount)&&e.contains(n.getRangeAt(0).startContainer);if(e instanceof Document)return e===t.target}return!(!t.target||!t.target.contains)&&(e===t.target||e.contains(t.target))},e.rt=function(){var t,e;try{for(var n=(0,r.c)(this.X.keys()),i=n.next();!i.done;i=n.next()){var o=i.value;this.et(o)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},e.et=function(t){var e,n,i=this.X.get(t);if(i){this.X.delete(t),i=(0,r.e)(i.keys());try{for(var o=(0,r.c)(i),s=o.next();!s.done;s=o.next()){var a=s.value;t.removeEventListener(a,this.dispatchNativeEvent)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}}},t}()),tc=function(){function t(){this.i=[],this.n=!1}var e=t.prototype;return e.add=function(t){this.n&&this.i.push(t)},e.start=function(){this.reset(),this.n=!0},e.reset=function(){this.n=!1,this.i=[]},e.export=function(){try{return JSON.stringify(this.i)}catch(t){return""}},t}(),td=n("162114"),tf=n("65476"),th=function(){function t(){this.be=new Map,this.pe=new Map}var e=t.prototype;return e.get=function(t){var e,n=this.be.get(t);if(!n&&!((e=t)===l.h.InputModel||e===l.h.UndoModule))throw Error("modules undefined, type is "+t);return n},e.set=function(t,e){var n=this,i=[];if("object"==typeof t)Object.keys(t).forEach(function(e){l.h[e]||l.C[e],l.C[e]?n.set(e,t[e]):n.set(e,t[e])&&i.push(e)});else if("string"==typeof t&&e){var s=this.be.get(t);if(!l.C[t]||!Array.isArray(e))return this.be.set(t,e),e!==s;var a=(0,r._)(e,2),s=a[0],a=a[1];this.setZoneModule(o.S,l.C[t],s,a)}return i},e.getZoneModule=function(t,e){var n=this.be.get(e),t=null===(e=this.pe.get(e))||void 0===e?void 0:e.get(t);return n&&t?[n,t]:null},e.setZoneModule=function(t,e,n,i){this.be.set(e,n);var o,s,a,l,u=this.pe.get(e);if(u){try{for(var c=(0,r.c)(u.values()),d=c.next();!d.done;d=c.next()){var f=d.value,h=Object.keys(f);if(h.length===Object.keys(i).length){var p=!0;try{for(var v=(a=void 0,(0,r.c)(h)),g=v.next();!g.done;g=v.next()){var y=g.value;if(f[y]!==i[y]){p=!1;break}}}catch(t){a={error:t}}finally{try{g&&!g.done&&(l=v.return)&&l.call(v)}finally{if(a)throw a.error}}if(p)return void u.set(t,f)}}}catch(t){o={error:t}}finally{try{d&&!d.done&&(s=c.return)&&s.call(c)}finally{if(o)throw o.error}}u.set(t,(0,r.b)({},i))}else this.pe.set(e,new Map([[t,(0,r.b)({},i)]]))},e.unSubscribingZone=function(t,e){(e=this.pe.get(e))&&e.delete(t)},t}(),tp=n("649146"),tv=function(){function t(){this.Xn=new WeakMap,this.th=new WeakMap,this.nh=new WeakMap}var e=t.prototype;return e._setNode=function(t,e){document.contains(e),t._node=e,this._deleteNode(t),this._deleteNode(e),this.Xn.set(t,e),this.th.set(e,t)},e._resetNode=function(t){t._node=null},e._deleteNode=function(t){var e;t instanceof HTMLElement?((e=this.th.get(t))&&this.Xn.delete(e),this.th.delete(t)):((e=this.Xn.get(t))&&this.th.delete(e),this.Xn.delete(t))},e.getModel=function(t){return this.th.get(t)},e.getView=function(t){return this.Xn.get(t)},e._setLeaf=function(t,e){this.nh.set(t,e)},e._deleteLeaf=function(t){this.nh.delete(t)},e.getLeafModel=function(t){return this.nh.get(t)},e.destroy=function(){this.Xn=new WeakMap,this.th=new WeakMap,this.nh=new WeakMap},t}();function tg(t,e,n){var r=t.parentElement;if(!e)return r;for(;r&&!(n&&r.matches(n));){;if(r.matches(e))return r;r=r.parentElement}return null}var ty=function(){function t(t){this.e=100,this.s=t}var e=t.prototype;return e.isZoneContainer=function(t){var e=!1;return this.s.getContentState().getContent().forEach(function(n){n._node===t&&(e=!0)}),e},e.getZoneFromNode=function(t){var e=null;return this.s.getContentState().getContent().forEach(function(n){var r;null!==(r=n._node)&&void 0!==r&&r.contains(t)&&(e=n.getZoneId())}),e},e.getLineStateFromNode=function(t){return null!=(t=tg(t,".ace-line",".editor-kit-container"))&&t.classList.contains(".ace-line")&&(t=this.s._getViewModel().getModel(t))||null},e.getLineStateInParentZone=function(t){var e=this.getLineStateFromNode(t);return null!==(t=null==e?void 0:e.parent)&&void 0!==t&&t.parent?e.parent.parent:null},e.getLineStateInRootZone=function(t){for(var e=0,n=this.getLineStateInParentZone(t);e<this.e&&n&&n.getZoneId()!==o.S;)e++,n=this.getLineStateInParentZone(t);return n},e.isNodeInEditor=function(t,e){return t===e||(null===(t=null==t?void 0:t.parentElement)||void 0===t?void 0:t.closest("."+s.qT))===e},e.isNodeInOuterControlledZone=function(t){return!(null===(t=null==t?void 0:t.closest("."+s.qT))||void 0===t||!t.classList.contains(""+s.Zd))},e.isNodeInInnerZone=function(t){var e="."+s.SX+":not(."+s.qT+")";return!(null==t||!t.closest(e))},t}(),tm=n("327430"),tb=function(){function t(t){this.on=new Map,this.name="rect",this.s=t}var e=t.prototype;return e.getCaretRect=function(t,e){return void 0===e&&(e=o.S),this._n(t,e)},e.getLineRect=function(t,e){return void 0===e&&(e=o.S),this._n((0,r.b)((0,r.b)({},t),{offset:void 0}),e)},e.getZoneRect=function(t,e){return void 0===e&&(e=o.S),this._n({zoneId:t},e)},e.getRawCaretRect=function(t,e){return this.jn(t,{ignoreNormalize:!1,ignoreRectContainer:null==e?void 0:e.ignoreRectContainer,ignoreMeasureDom:null==e?void 0:e.ignoreMeasureDom})},e.getRangeRect=function(t,e){return(void 0===e&&(e=o.S),e=this.s.getContentState().getZoneState(e),t=this.jn(t,{ignoreNormalize:!1}),null!=e&&e._node)?(e=(0,tm.r3)(e._node.getBoundingClientRect()),(0,r.b)((0,r.b)({},t),(0,tm.s8)(t,e))):(this.s.error({message:"zoneState._node undefined, zoneId: "+(null==e?void 0:e.getZoneId()),level:s.WV.ERROR}),t)},e.getRawRangeRect=function(t,e){return this.jn(t,{ignoreNormalize:!1,ignoreRectContainer:null==e?void 0:e.ignoreRectContainer,ignoreMeasureDom:null==e?void 0:e.ignoreMeasureDom})},e.jn=function(t,e){var n=this,r=this.s.modulesContainer.get(l.h.Range),i="zoneId"in t?new r({editor:this.s,start:t,end:t}):"toPosition"in t?t:new r({editor:this.s,start:t.start,end:t.end}),r=this.s.getContentState().getZoneState(i.start.zoneId);return r?((0,tm.xR)(r,i.start),i.start!==i.end&&(0,tm.xR)(r,i.end),t=function(){var t=n.s.selection._toDOMRange(i,{ignoreNormalize:e.ignoreNormalize});if(!t)return(0,tm.BZ)();var r,o=t.startContainer,s=t.endContainer,a=t.startOffset,l=t.endOffset,t=e.ignoreRectContainer?null:n.mn(o,s);return 0===(r=t?t.getBoundingClientRect():(t=null===(r=W.Xh.getIOSVersion())||void 0===r?void 0:r.major,W.Xh.isIOS&&t&&t<13&&(l=(a=Math.max(a-1,0))+1),r=document.createRange(),(null===(t=o.textContent)||void 0===t?void 0:t.length)===a&&i.start.offset!==i.end.offset?r.setStartAfter(o):r.setStart(o,a),r.setEnd(s,l),l=r.getClientRects(),r.collapsed&&W.Xh.safari&&1<l.length?l[1]:r.getBoundingClientRect())).bottom&&0===r.height&&0===r.left&&0===r.right&&0===r.top&&0===r.width&&0===r.x&&0===r.y&&(o instanceof HTMLElement?r=o.getBoundingClientRect():o.parentElement instanceof HTMLElement&&(r=o.parentElement.getBoundingClientRect())),(0,tm.r3)(r)},null!=(r=null===(r=this.s.virtualListManager)||void 0===r?void 0:r.getVirtualListModuleOfZone(i.start.zoneId))&&r.isEnabled&&!r.isLineNodesInRenderContent(i)?r.getRangeVirtualRect(i,t,e.ignoreMeasureDom)||(0,tm.BZ)():t()):(0,tm.BZ)()},e.getRawLineRect=function(t){var e=this.s.getContentState().getZoneState(t.zoneId);if(!e)return(0,tm.BZ)();(0,tm.xR)(e,t);var n=null===(n=this.s.virtualListManager)||void 0===n?void 0:n.getVirtualListModuleOfZone(t.zoneId);return null!=n&&n.isEnabled&&!n.isLineNodesInRenderContent(t.line)?n.getLineVirtualRect(t.line)||(0,tm.BZ)():(t=null===(t=null===(t=e.getLine(t.line))||void 0===t?void 0:t._node)||void 0===t?void 0:t.getBoundingClientRect())?(0,tm.r3)(t):(0,tm.BZ)()},e.clearCache=function(){this.on.clear()},e.clearZoneRect=function(t){var e=this,n=[];this.on.forEach(function(e,r){r.startsWith(t)&&n.push(r)}),n.forEach(function(t){return e.on.delete(t)})},e._n=function(t,e){void 0===e&&(e=o.S);var n=this.s.getContentState(),i=n.getZoneState(t.zoneId);if(!i)return(0,tm.BZ)();(0,tm.xR)(i,t);var a=this.on.get((0,tm.ah)(t,e));if(a)return a;var l=void 0===t.line,u=void 0!==t.line&&void 0===t.offset,c=void 0!==t.line&&void 0!==t.offset,d=(0,tm.BZ)(),a=(0,tm.BZ)(),n=null===(n=n.getZoneState(e))||void 0===n?void 0:n._node;if(!n)return this.s.error({message:"relativeZoneNode undefined, relativeZone: "+e,level:s.WV.ERROR}),d;if(l){if(!i._node)return this.s.error({message:"zoneState._node undefined, zoneId: "+t.zoneId,level:s.WV.ERROR}),d;d=(0,tm.r3)(i._node.getBoundingClientRect()),a=(0,tm.r3)(n.getBoundingClientRect())}else u?(d=this.getRawLineRect(t),a=(0,tm.r3)(n.getBoundingClientRect())):c&&(d=this.getRawCaretRect(t),a=(0,tm.r3)(n.getBoundingClientRect()));return l&&t.zoneId===e?d:(a=(0,r.b)((0,r.b)({},d),(0,tm.s8)(d,a)),this.on.set((0,tm.ah)(t,e),a),a)},e.mn=function(t,e){return t.parentElement&&t.parentElement===e.parentElement&&tg(t,"["+s.Pk+"]",".editor-kit-container")},t}(),tE=function(){function t(){this.undoable=!1,this.redoable=!1}var e=t.prototype;return e.setUndoDispatcher=function(t,e){},e.getNthUndoRecordFromTop=function(t){return null},e.batchedUndo=function(t){t()},e.undo=function(){},e.redo=function(){},e.mergeRecords=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n]},e.clear=function(){},e.destroy=function(){},t}(),tS=(0,i.K)(function(t){this.error(t)})(i.W.ERROR),tI=["input","beforeinput","keyup","keydown","keypress","compositionstart","compositionupdate","compositionend"],tC=function(){function t(t){var e=this;this.props=t,this.version=s.cH+"@4.145.0-alpha.12 - July 24, 2025 13:58:47",this.log=null!==(n=this.props.onLog)&&void 0!==n?n:(0,console.log),this.copyable=null===(n=this.props.copyable)||void 0===n||n,this.isSSR=null!==(n=this.props.isSSR)&&void 0!==n&&n,this.businessKey=this.props.businessKey,this.mounted=!1,this.editorUniqueId=(0,Y.D)(6),this.virtualListManager=null,this._hydrateMap=new Map,this._dir=this.props.dir,this._hackMacCompositionInput=this.props.hackMacCompositionInput,this._isRenderBrInEmptyLine=this.props.isRenderBrInEmptyLine,this._isFixToCommonZone=this.props.isFixToCommonZone,this.trace=new tc,this.h=!1,this.a=this.props.container,this.v=!!this.props.editable,this.d={bottom:0,height:0,left:0,right:0,top:0,width:0,x:0,y:0},this.f=null===(n=this.props.editable)||void 0===n||n,this.m=!1,this.j=!1,this.p=null,this.b=new WeakMap,this.togglePlaceHolder=(0,G.D)(function(t,n){var r,i,o;"string"!=typeof t?e.props.placeholder&&(r=e.getContainer(),i="",i=!1!==t&&(!0===t||e.isEmpty())?e.props.placeholder:"",(o=r.getAttribute("data-placeholder"))!==i&&(i?r.setAttribute("data-placeholder",i):o&&r.removeAttribute("data-placeholder"))):e._toggleZonePlaceHolder(t,n)},30),this.isFocus=function(t){return!!document.hasFocus()&&e.isSelectionInEditor(t)},this._handleContainerResize=(0,J.P)(function(){e.rectModule.clearCache();var t=e.getRect();e.setRect();var n=e.getRect();(0,M.X)(t,n)||e.call("editorRectChange",{prev:t,next:n})}),this.g=new $,this.dom=new ty(this),this.rectModule=new tb(this),this.S=t.fgMap,this.modulesContainer=new th,this.modulesContainer.set(t.modules);var n=this.modulesContainer.get(l.h.UndoModule);n?(this.undoModule=new n(this),this.triggerEditorEvent(a.r.UNDO_DID_INIT)):this.undoModule=new tE,this.w=new tv,this.clipboard=new td.a(this,t.proxyClipboard);var n=this.modulesContainer.get(l.h.InputModel);this.C=t.debounceFlush,n&&(this.inputModel=new n(this,{debounceFlush:t.debounceFlush})),this.q=t.contentState||this.M(this.props.initData,this.props.schema),this.D(),this.a&&(this.p=requestAnimationFrame(this.setRect)),this.k={isPerforming:!1,contentChanged:!1,preventScrolling:!1,dangerousInput:!1,stopUpdateSelection:!1,preventUpdateDomSelection:!1,isComposing:!1,isClick:!1,isMouseUp:!1,isMouseDown:!1,isSelectionChange:!1,isPainting:!1},this.initPluginManager({registerPlugin:this.props.register,plugins:this.props.plugins}),null!==(t=(n=this.q).init)&&void 0!==t&&t.call(n),this.I=null!==(n=this.props.eventDelegator)&&void 0!==n?n:tu,this.props.reactDOMServerExternal&&(h.Yn.renderToStaticMarkup=null===(n=this.props.reactDOMServerExternal)||void 0===n?void 0:n.renderToStaticMarkup)}var e=t.prototype;return Object.defineProperty(e,"scrollModule",{get:function(){var t,e;return null===(e=null===(t=null===(e=this.getContentState())||void 0===e?void 0:e.getZoneManager)||void 0===t?void 0:t.call(e))||void 0===e?void 0:e.getScrollModuleByZoneId(o.S)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"getViewPortPadding",{get:function(){return this.props.getViewPortPadding},enumerable:!1,configurable:!0}),e._registerModules=function(t){var e=this.modulesContainer.set(t);e.includes(l.h.InputModel)&&(t=this.modulesContainer.get(l.h.InputModel),this.inputModel=new t(this,{debounceFlush:this.C})),e.includes(l.h.UndoModule)&&(e=this.modulesContainer.get(l.h.UndoModule),this.undoModule=new e(this),this.triggerEditorEvent(a.r.UNDO_DID_INIT))},e.init=function(t){t=t.element,!this.a&&t&&(this.p=requestAnimationFrame(this.setRect)),this.a=t,this.a.zoneId={value:"0"},this.P(),this.T(this.a),this.L(),this.togglePlaceHolder()},e.M=function(t,e){var n,r=t instanceof g.I?(new Z.D).add(o.S,t):t;return r.get(o.S)||(t=Error(n="[Editor][constructor] invalid initDeltaSet: "+r+', initDeltaSet must has zone "0"'),this.error({e:t,message:n,level:i.W.FATAL})),new(this.modulesContainer.get(l.h.ContentState))({deltaSet:r,schema:e,modulesContainer:this.modulesContainer})},e.D=function(){var t=this,e=this.q;e._onWillApply(this._handleContentWillApply),e.onWillChange(this._handleContentWillChange),e.onChange(this._handleContentChange),e._onRefresh(function(e){t.call("_forceRefresh",e)}),e._onError(function(n){t.error((0,r.b)((0,r.b)({},n),{extra:null===(n=e._applyStackLog)||void 0===n?void 0:n.join("\n")}))})},e.initPluginManager=function(t){this.pluginManager&&this.pluginManager.destroy(),this.pluginManager=new tp.Q$(this,t)},e.call=function(t,e){var n,i=this;"error"!==t||this.h||(this.h=!0,n=null===(n=null==e?void 0:e.e)||void 0===n?void 0:n.stack,e=(0,r.b)((0,r.b)({},e),{errorStack:Error("editor oops").stack,originErrorStack:n})),this.g.getListeners(t).slice(0).forEach(function(n){var o,s=n.listener,l=n.isOnce;s.plugin?null!=e&&e.changes?(o=Object.assign((0,r.b)({},e),{changes:{},deltaSet:new Z.D}),Object.keys(null==e?void 0:e.changes).forEach(function(t){o.changes[t]=e.changes[t],o.deltaSet.add(t,e.deltaSet.get(t))}),s.call(s,o),l&&i.off(t,s)):i.selection.getMultipleSelection().forEach(function(n){n=n.start.zoneId,i.pluginManager.isPluginInZone(s.plugin,n)&&(s.call(s,e),l&&i.off(t,s))}):i.b.has(s)?(n=i.b.get(s),t===a.r.CONTENT_WILL_CHANGE?e.deltaSet.get(n)&&(s.call(s,e),l&&i.off(t,s)):t===a.r.CONTENT_CHANGE?n in e.changes&&(s.call(s,e),l&&i.off(t,s)):t===a.r.PAINT?n===(null==e?void 0:e.zoneId)&&(s.call(s,e),l&&i.off(t,s)):i.selection.isZoneInSelection(n)&&(s.call(s,e),l&&i.off(t,s))):(s.call(s,e),l&&i.g.removeEventListener(t,s))})},e.getRect=function(t){if(!t)return this.d;var e=this.getContentState().getZoneState(t);return e&&(null==(e=null!==(t=this._getViewModel().getView(e))&&void 0!==t?t:e._node)?void 0:e.getBoundingClientRect())||this.d},e.setRect=function(){this.a&&(this.d=this.a.getBoundingClientRect())},e.getRootContainer=function(){return this.a||null},e.getContainer=function(){return this.a},e.setMounted=function(t){this.mounted=t},e.getStatus=function(t){return this.k[t]},e.getDelegator=function(){return this.I},e.getFg=function(t){var e;return null===(e=this.S)||void 0===e?void 0:e[t]},e._getInlineAttributesOfPreviousPosition=function(t,e){void 0===t&&(t=!0);var n=this.q.getActiveZone(),r=n.getZoneId(),i=null!=e?e:this.selection.getSelection(r),o=(0,tf.vA)();if(!i)return o;var s=n.getLine(i.start.line);return s?(e=s.hasLineMarker()?1:0,n=i.start,o=i.start,t&&e===i.start.offset&&s.length()>e?o=new K.L({start:i.toPosition().start+1,editor:this,len:0,zoneId:r}).toRange().start:i.start.offset>e&&(n=new K.L({start:i.toPosition().start-1,editor:this,len:0,zoneId:r}).toRange().start),this.q.getAttributes(n,o)):o},e._getInlineAttributesOfNextPosition=function(t){var e=this.q.getActiveZone().getZoneId(),n=null!=t?t:this.selection.getSelection(e);if(!n||!(t=null===(r=this.q.getZoneState(e))||void 0===r?void 0:r.getLine(n.start.line)))return(0,tf.vA)();var r=n.start;return n.start.offset<t.length()&&(r=new K.L({start:n.toPosition().start+1,editor:this,len:0,zoneId:e}).toRange().start),this.q.getAttributes(n.start,r)},e.calcToggleAttribute=function(t,e,n){void 0===e&&(e="true");var i,o,s,a=(n=n||this.selection.getSelection()).start,l=a.line,u=a.zoneId,c=n.end.line,d=this.getContentState(),f=d.schema;if(null===(a=f.get(t))||void 0===a?void 0:a.lmkr){for(var a=Math.min(l,c),h=Math.max(l,c),p="",v=e,g=a;g<=h;g++){var y=d.getLineAttributes(u,g).toMap();y[t]!==e&&(p=e,v=y[t]||"")}return{key:t,originValue:v,value:p,isLineMarker:!0,lineRange:{startLine:a,endLine:h}}}if(n.isCollapsed())return{key:t,value:null,originValue:null,isCollapsed:!0};var n=this.q.getEntities(n),m="",b=e;if(n)try{for(var E=(0,r.c)(n),S=E.next();!S.done;S=E.next()){var I=S.value,C=!0,L=(0,tf.qF)(f,I.attributes),w=L&&(null===(s=f.get(L))||void 0===s?void 0:s.attributes);if(L&&w&&(C=w instanceof RegExp?w.test(t):w(t,e,L)),!("\n"===I.text||"lmkr"in I.attributes)&&C&&I.attributes[t]!==e){m=e,b=I.attributes[t]||"";break}}}catch(t){i={error:t}}finally{try{S&&!S.done&&(o=E.return)&&o.call(E)}finally{if(i)throw i.error}}return{key:t,originValue:b,value:m}},e.toggleAttribute=function(t,e,n){void 0===e&&(e="true");var r,i=(n=n||this.selection.getSelection()).start.zoneId,o=this.calcToggleAttribute(t,e,n);if(o.isLineMarker)for(var s=o.value,a=o.lineRange,l=a.startLine,u=a.endLine,c=l;c<=u;c++)this.getContentState().setLineAttributes(i,c,((r={})[t]=s,r));else o.isCollapsed?this.setInlineStyleOverride(t,e,n):(o=o.value,this.q.setAttributes(n,((n={})[t]=o,n)))},e.setInlineStyleOverride=function(t,e,n){void 0===e&&(e="true");var r=(n=n||this.selection.getSelection()).toPosition(),i=this._getInlineAttributesOfPreviousPosition().toMap();(null!==(n=this.q.getInlineStyleOverride(r,t))&&void 0!==n?n:i[t])===e?this.q._setInlineStyleOverride(r,t,""):this.q._setInlineStyleOverride(r,t,e)},e.on=function(t,e,n){var r,i;"object"==typeof n?(i=n.priority,(r=n.zoneId)&&this.b.set(e,r),this.g.on(t,e,i)):this.g.on(t,e,i=n)},e.once=function(t,e,n){var r,i;"object"==typeof n?(i=n.priority,(r=n.zoneId)&&this.b.set(e,r),this.g.once(t,e,i)):this.g.once(t,e,i=n)},e.off=function(t,e){this.b.has(e)&&this.b.delete(e),this.g.off(t,e)},e.registerCommand=function(t,e){var n=this;this.on(t,function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];n.flushInput(),n.undoModule.batchedUndo(function(){e.apply(n,t)})})},e.execCommand=function(t,e){var n=!1,r={name:t,data:e=void 0===e?{}:e,preventEvent:function(){n=!0}};this.call(a.r.EXEC_COMMAND,r),n||this.g.trigger(t,[e])},e.getContentState=function(){return this.q},e.getContent=function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.getContentState().toDeltaSet(t,e)},e.setContent=function(t,e){void 0===e&&(e={}),this.getContentState().setContent(t,Object.assign({},{type:"setContent"},e))},e.getHTML=function(){var t=this.getContent(),e={zoneId:o.S,deltaSet:t,node:this.getContainer(),customCopyDatas:[]},t=this.clipboard.serialize(e),e=document.createElement("div");return e.appendChild(t.node),e.innerHTML},e.setHTML=function(t){t=this.clipboard.deserialize({html:t},!0),this.setContent(t)},e.getText=function(){var t,e,n=this,i=[],s=this.getContentState().getZoneState(o.S);if(!s)return"";try{for(var a=(0,r.c)(s),l=a.next();!l.done;l=a.next()){var u=l.value;(u.hasLineMarker()?u.getOps().slice(1):u.getOps()).forEach(function(t){t={text:t.insert,attributes:(0,r.b)({},t.attributes)},n.pluginManager.call("editorCollectText",t),i.push(t.text)})}}catch(e){t={error:e}}finally{try{l&&!l.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return i.join("")},e.setText=function(t){t.endsWith("\n")||(t+="\n"),this.setContent(new g.I({zoneId:o.S}).insert((0,Q.$)(t)))},e.isSelectionInEditor=function(t){var e=window.getSelection();return t?!(null==(t=null===(t=this.getContentState().getZoneState(t))||void 0===t?void 0:t._node)||!t.contains((null==e?void 0:e.anchorNode)||null)||null==t||!t.contains((null==e?void 0:e.focusNode)||null)):!!(null!=e&&e.anchorNode&&e.focusNode&&this.dom.isNodeInEditor(e.anchorNode,this.getContainer())&&this.dom.isNodeInEditor(e.focusNode,this.getContainer()))||!!this.dom.isNodeInEditor(document.activeElement,this.getContainer())},e.isEmpty=function(){return!this.getStatus("isComposing")&&this.getContentState().isEmpty()},e.focusAtEnd=function(){var t,e=this.getContentState().getZoneState(o.S);e&&(t=e.getModelText().length-1,this.selection.setSelection({start:(0,r.b)({zoneId:o.S},e.offsetToPoint(t)),end:(0,r.b)({zoneId:o.S},e.offsetToPoint(t))},!0))},e.focus=function(t,e){void 0===e&&(e=!1),"boolean"==typeof(t=void 0!==t&&t)?this.selection.focus(t):this.selection.focus(t,e)},e.blur=function(){var t;null!==(t=this.getContentState().getActiveZone()._node)&&void 0!==t&&t.blur()},e.flushInput=function(){var t;null!==(t=this.inputModel)&&void 0!==t&&t._flushInput()},e.setEditable=function(t,e){this.setContentEditable(t),this.setPluginMode(t,e)},e.isInEmbed=function(){return!1},e.setContentEditable=function(t){var e,n,r;this.m?this.v=t:((r=(n=this.isEditable())!==t)&&!this.j&&null!==(e=this.getRootContainer())&&void 0!==e&&e.setAttribute("contenteditable",String(t)),r&&this.call(a.r.EDITABLE_CHANGE,{previous:n,current:t}),this.callAll("aceChangeContentediable"))},e.scrollToSelection=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(0,r.g)(this,void 0,void 0,function(){return(0,r.h)(this,function(n){return[2,null===(t=this.scrollModule)||void 0===t?void 0:t.scrollIntoViewport.apply(t,(0,r.e)(e))]})})},e.scrollTo=function(t){var e;return(0,r.g)(this,void 0,void 0,function(){return(0,r.h)(this,function(n){return[2,null===(e=this.scrollModule)||void 0===e?void 0:e.scrollTo(t)]})})},e.scrollBy=function(t){var e;return(0,r.g)(this,void 0,void 0,function(){return(0,r.h)(this,function(n){return[2,null===(e=this.scrollModule)||void 0===e?void 0:e.scrollBy(t)]})})},e.callAll=function(t,e){var n=[];return this.pluginManager.call(t,e||{},{cb:function(t,e){return n.push(e),t}}),n},e.destroy=function(){var t,e;try{this.O(),null!==(t=this.inputModel)&&void 0!==t&&t.destroy(),this.undoModule.destroy(),this.rectModule.clearCache(),this.g.reset(),this.q._clearListener(),this.R(),this.p&&cancelAnimationFrame(this.p),null!==(e=this.virtualListManager)&&void 0!==e&&e.destroy()}catch(t){this.log("[Editor][destroy]"+t)}},e.reset=function(){var t;null!==(t=this.inputModel)&&void 0!==t&&t._flushInput(!0),this.getContentState().clear(),this.callAll("reset"),this.setText(""),this.z(),this.rectModule.clearCache(),this.undoModule.clear()},e.getScrollContainer=function(){var t;return null===(t=this.scrollModule)||void 0===t?void 0:t.getScroller()},e.isEditable=function(){return!!this.f},e.isFocusOnBlock=function(t){return!1},e.getOuterContainer=function(){return this.getContainer()&&this.getContainer().parentNode},e.correctCompositionIfNecessary=function(t){this._correctCompositionIfNecessary(t)},e.getInheritAttributes=function(t){var e;return(null===(e=this.inputModel)||void 0===e?void 0:e.getInheritAttributes(t))||{}},e.U=function(t){this.F(t)},e.F=function(t){var e=t.keyCode,n=t.shiftKey,r=t.metaKey,i=t.altKey,o=t.ctrlKey;n||i||(W.Xh.isMac||W.Xh.isIPad?r:o)&&e===s.VD.A&&(e=this.selection.getSelection().start.zoneId,this.selection.selectAll(e),t.preventDefault())},e.H=function(t){var e=t.clientX,n=t.clientY,e=e-window.pageXOffset,n=n-window.pageYOffset,e=(0,P.qK)(e,n),n=e.textNode,e=e.offset;t.evtTargetSelection=this.selection._toModelRange({startContainer:n||null,endContainer:n||null,startOffset:e||0,endOffset:e||0})},e.L=function(){var t=[];W.Xh.chrome&&t.push("chrome"),W.Xh.isFF&&t.push("mozilla"),W.Xh.safari&&t.push("safari"),W.Xh.msie&&t.push("msie"),W.Xh.windows&&t.push("window");var e=(0,W.vu)();e&&88<=parseInt(e)&&t.push("chrome88"),(e=this.a.classList).add.apply(e,(0,r.e)(t))},e.R=function(){try{this.pluginManager.destroy()}catch(t){}},e.P=function(){this.on(a.r.RECT_CHANGE,this._handleEditorRectChange),this.on(a.r.COMPOSITION_UPDATE,this.togglePlaceHolder),this.on(a.r.CONTENT_CHANGE,this.togglePlaceHolder),this.on(a.r.SCROLL,this._handleEditorScroll);var t=this.getContainer(),e=this.I;W.Xh.isMac&&(W.Xh.chrome||W.Xh.safari)&&e.on("mousedown",t,this.mouseDownListenerForMac),e.on("dragover",t,this.handleDragOver),e.on("click",t,this._handleClickEvent),e.on("mouseup",document,this._handleMouseUp),e.on("mousedown",t,this._handleMouseDown)},e.O=function(){var t=this.I;this.off(a.r.RECT_CHANGE,this._handleEditorRectChange),this.off(a.r.COMPOSITION_UPDATE,this.togglePlaceHolder),this.off(a.r.CONTENT_CHANGE,this.togglePlaceHolder),this.off(a.r.SCROLL,this._handleEditorScroll);var e=this.getContainer();W.Xh.isMac&&(W.Xh.chrome||W.Xh.safari)&&t.off("mousedown",e,this.mouseDownListenerForMac),t.off("dragover",e,this.handleDragOver),t.off("click",e,this._handleClickEvent),t.off("mouseup",document,this._handleMouseUp),t.off("mousedown",e,this._handleMouseDown)},e.handleDragOver=function(t){t.preventDefault()},e.mouseDownListenerForMac=function(t){var e=this,n=this.I,r=this.getContainer(),i=function(){if(n.off("selectionchange",r,i),!(1<e.selection.getMultipleSelection().length)){var o=e.selection.getSelection();if(o)try{var s=o.start,a=o.end;s.zoneId===a.zoneId&&s.line!==a.line&&(e.selection.setSelection({start:s,end:s}),e.selection.updateBrowserSelection())}catch(n){e.log("mouseDownListenerForMac error",t)}}};2===t.button&&(n.on("selectionchange",r,i),setTimeout(function(){n.off("selectionchange",r,i)},200))},e.T=function(t){void 0!==this.props.spellCheck&&t.setAttribute("spellCheck",String(this.props.spellCheck)),void 0!==this.props.autoCorrect&&t.setAttribute("autoCorrect",this.props.autoCorrect?"on":"off"),t.classList.add(s.qT,"notranslate")},e.z=function(){var t,e,n=this.k;try{for(var i=(0,r.c)(Object.keys(n)),o=i.next();!o.done;o=i.next()){var s=o.value;this.setStatus(s,!1)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}},e._toggleZonePlaceHolder=function(t,e){var n,r;t&&(!(r=this.getContentState().getZoneState(t))||(n=r.getContainer())&&(t="",t=!1!==(null==e?void 0:e.show)&&(!0===(null==e?void 0:e.show)||r.isEmpty())?r.placeholder:"",(r=n.getAttribute("data-placeholder"))!==t&&(t?n.setAttribute("data-placeholder",t):r&&n.removeAttribute("data-placeholder"))))},e.setStatus=function(t,e){this.k[t]=e},e.transformPosition=function(t,e){var n=e.zoneId;if(t.zoneId!==n)return e;var r=e.start,i=e.len,e=t.transform(r),i=t.transform(r+i,this.props.followSelectionExclusively&&0!==i);return this.props.followSelectionExclusively&&i<e&&(i=e),new K.L({start:e,len:i-e,zoneId:n,editor:this})},e._handleEditorRectChange=function(){this.rectModule.clearCache(),this.setRect()},e._handleEditorScroll=function(){this.rectModule.clearCache()},e._getViewModel=function(){return this.w},e._correctCompositionIfNecessary=function(t){var e,n,r=this;!0===this.getStatus("isComposing")&&(e=t.type,t=t instanceof Event?t:t.nativeEvent,n=new tt.h(new CompositionEvent("compositionend"),this.getContainer()),tI.includes(e)?t instanceof KeyboardEvent&&!1===t.isComposing&&(this.triggerEditorEvent("compositionend",n),this.log("[Editor][_correctCompositionIfNecessary]\n dispatchCompositionEvent because eventType is "+e+" and isComposing is false")):(W.Xh.windows&&"blur"===e?setTimeout(function(){r.triggerEditorEvent("compositionend",n)}):this.triggerEditorEvent("compositionend",n),this.log("[Editor][_correctCompositionIfNecessary] dispatchCompositionEvent because eventType is "+e)))},e.B=function(){var t=getSelection();if(!t)return!1;var e=t.anchorNode,n=t.focusNode,r=this.dom,i=r.isNodeInOuterControlledZone,t=r.isNodeInInnerZone;return!(null!==(r=null===(r=null==e?void 0:e.parentElement)||void 0===r?void 0:r.closest("."+s.j4))&&void 0!==r&&r.closest("."+s.qT)||null!==(r=null===(r=null==n?void 0:n.parentElement)||void 0===r?void 0:r.closest("."+s.j4))&&void 0!==r&&r.closest("."+s.qT)||null!=n&&n.parentElement&&i(n.parentElement)&&!t(n.parentElement)||null!=e&&e.parentElement&&i(e.parentElement)&&!t(e.parentElement)||!this.dom.isNodeInEditor(e,this.getContainer())||!this.dom.isNodeInEditor(n,this.getContainer()))},e.__handleDOMSelectionChange=function(){this.log({scope:"[editor][_handleDOMSelectionChange]",level:"info",shouldLogToMobile:!1,status:this.k,sel:getSelection()}),this.B()&&this.selection._handleDOMSelectionChange(),this.getStatus("isMouseDown")&&this.setStatus("isSelectionChange",!0);var t=getSelection();this.getStatus("isClick")&&this.getStatus("isMouseDown")&&(this._resetCursorStatus(),!this.getStatus("stopUpdateSelection")&&this.isEditable()&&this.mounted&&null!=t&&t.focusNode&&!this.isFocusOnBlock()&&this.getContainer().contains(t.focusNode)&&this.selection.updateBrowserSelection())},e._setPlaceholder=function(t){this.props.placeholder=t,this.togglePlaceHolder()},e._handleMouseDown=function(t){if((!this.isEditable()||W.Xh.isEdge)&&!this.selection.getSelection().isCollapsed()&&1===t.button){var e=document.caretRangeFromPoint(t.x,t.y);if(!e)return;var n=this.selection._toModelRange(e);if(!n)return;var r=n.start,i=this.selection.getSelection(),n=i.start,i=i.end;n<=r&&r<=i&&this.selection._updateDOMSelection(e)}if(this.K())return this._resetCursorStatus();this.N(t),this.mounted&&t.target instanceof Node&&this.W(t.target)?this.setStatus("isMouseDown",!0):this.setStatus("isMouseDown",!1)},e.W=function(t){var e=this.dom.isNodeInOuterControlledZone(t),n=this.dom.isNodeInInnerZone(t),t=!!this.dom.isNodeInEditor(t,this.getContainer());return e?n:t},e.K=function(){return this.getStatus("isMouseUp")&&!this.getStatus("isMouseDown")},e._handleContentWillApply=function(t){t=t.options,this.getStatus("isComposing")&&this.error({message:"apply when editor in composing",level:i.W.ERROR,options:t}),this.flushInput()},e._handleContentWillChange=function(t){return this.pluginManager.call("editorWillApplyChange",t,{cb:function(e,n){return t.deltaSet=n,t}}),this.call(a.r.CONTENT_WILL_CHANGE,t),t.deltaSet},e._handleContentChange=function(t){var e,n,i,s,l,u,c=this,d=t.previous,f=t.current,h=t.options,p=this.q.getZoneState(o.S);p&&this._getViewModel()._setNode(p,this.getContainer());var v=Object.keys(t.changes).map(function(t){return null===(t=c.selection.getSelection(t,d))||void 0===t?void 0:t.toPosition(d)}).filter(Boolean),p=v.map(function(e){return t.deltaSet.get(e.zoneId)});t.deltaSet.forEach(function(t){c.rectModule.clearZoneRect(t.zoneId)});try{for(var g=(0,r.c)(Object.values(t.changes)),y=g.next();!y.done;y=g.next()){var m=y.value;try{for(var b=(i=void 0,(0,r.c)(m)),E=b.next();!E.done;E=b.next()){var S=E.value;try{for(var I=(l=void 0,(0,r.c)(S.deletes)),C=I.next();!C.done;C=I.next()){var L=C.value;S.inserts.includes(L)||this._getViewModel()._deleteNode(L)}}catch(t){l={error:t}}finally{try{C&&!C.done&&(u=I.return)&&u.call(I)}finally{if(l)throw l.error}}}}catch(t){i={error:t}}finally{try{E&&!E.done&&(s=b.return)&&s.call(b)}finally{if(i)throw i.error}}}}catch(t){e={error:t}}finally{try{y&&!y.done&&(n=g.return)&&n.call(g)}finally{if(e)throw e.error}}p.forEach(function(t,e){e=v[e],c.log("[Log]","[Editor][_handleContentChange] old selection",JSON.stringify({zoneId:e.zoneId,start:e.start,timestamp:Date.now()}));var n=t&&(0,Z.o)(null===(n=f.getZoneState(t.zoneId))||void 0===n?void 0:n.getContent());t&&e&&!n&&(e=c.transformPosition(t,e),c.log("[Log]","[Editor][_handleContentChange] new selection",JSON.stringify({zoneId:e.zoneId,start:e.start,timestamp:Date.now()})),c.selection._replaceSingleRangeModel(e))}),this.setStatus("contentChanged",!0),h.preventScrolling&&this.setStatus("preventScrolling",!0),this.call(a.r.CONTENT_CHANGE,t),this.setStatus("preventScrolling",!1),this.selection._dispatchEvent(!1)},e._handleMouseUp=function(t){this.setStatus("isMouseUp",!0),t.target instanceof Node&&this.W(t.target)||this._resetCursorStatus(),this.N(t)},e.N=function(t){var e=new tr.U(t,t.target);this.triggerEditorEvent(t.type,e)},e._handleClickEvent=function(t){var e;t.target instanceof Node&&this.W(t.target)&&(null===(e=t.target instanceof Element?t.target:t.target.parentElement)||void 0===e?void 0:e.closest("."+s.qT))===this.getContainer()?(e=getSelection(),this.log({scope:"[editor][_handleClickEvent]",level:"info",shouldLogToMobile:!1,status:this.k,sel:e}),t.target instanceof Node&&this.mounted&&this.setStatus("isClick",!0),this.getStatus("isMouseDown")&&this.getStatus("isSelectionChange")&&this.getStatus("isClick")&&(this._resetCursorStatus(),!this.getStatus("preventUpdateDomSelection")&&null!=e&&e.focusNode&&!this.isFocusOnBlock()&&this.getContainer().contains(e.focusNode)&&this.selection.updateBrowserSelection()),this.flushInput(),e=new tr.U(t,t.target),this.triggerEditorEvent(t.type,(0,r.b)({},e))):this._resetCursorStatus()},e._handleKeyEvent=function(t){var e;if(!this.isInEmbed()&&this.isEditable()){this.log({scope:"[editor][_handleKeyEvent]",level:"info",shouldLogToMobile:!1,status:this.k,evtType:t.type});var n=new te.$(t,t.target);if(!this.triggerEditorEvent(t.type,n).shouldPrevent)switch(this.U(n.nativeEvent),t.type){case"keydown":null!==(e=this.inputModel)&&void 0!==e&&e._handleKeyDown({evt:n}),this.selection.handleArrowKey({evt:n});break;case"keypress":case"keyup":null!==(e=this.inputModel)&&void 0!==e&&e._handleKeyPressAndUp({evt:n})}}},e._resetCursorStatus=function(){this.setStatus("isSelectionChange",!1),this.setStatus("isMouseUp",!1),this.setStatus("isMouseDown",!1),this.setStatus("isClick",!1)},e._handleInputEvent=function(t){"deleteContent"!==t.inputType&&"deleteContentBackward"!==t.inputType&&"deleteContentForward"!==t.inputType||this.log("trace","[Editor Event] name: "+t.type+", inputType: "+t.inputType+", cancelable: "+t.cancelable);var e=new ts(t,t.target);this.triggerEditorEvent(a.r.INPUT,e).shouldPrevent||null!==(t=this.inputModel)&&void 0!==t&&t._handleInput(e)},e._handleBeforeInput=function(t){"deleteContent"!==t.inputType&&"deleteContentBackward"!==t.inputType&&"deleteContentForward"!==t.inputType||this.log("trace","[Editor Event] name: "+t.type+", inputType: "+t.inputType+", cancelable: "+t.cancelable);var e=new ts(t,t.target);this.triggerEditorEvent(t.type,e)},e._handleCompositionEvent=function(t){"compositionupdate"!==t.type&&this.log("trace","[Editor Event] name: "+t.type);var e=new tt.h(t,t.target);this.triggerEditorEvent(t.type,e)},e._handleCopy=function(t){var e=this;this.flushInput(),this.undoModule.batchedUndo(function(){e.clipboard.onCopy(t)})},e._handleCut=function(t){var e=this;this.flushInput(),this.undoModule.batchedUndo(function(){e.clipboard.onCut(t)})},e._handlePaste=function(t){var e=this;this.flushInput(),!this.isFocusOnBlock()&&this.isEditable()&&this.undoModule.batchedUndo(function(){e.clipboard.onPaste(t)})},e._handleDrag=function(t){var e=new ta.Y(t,t.target);this.H(e),this.triggerEditorEvent(t.type,e)},e._handleFocusEvent=function(t){"focus"!==t.type||this.getStatus("isPerforming")||this.getStatus("preventUpdateDomSelection")||!this.isFocus()||!t.target||t.relatedTarget||!this.dom.isZoneContainer(t.target)||W.Xh.mobile||this.selection.updateBrowserSelection();var e=new tn.Y(t,t.target);this.triggerEditorEvent(t.type,e)},e._handleResizeEvent=function(t){i=t instanceof Event?(0,P.Yo)(this.getContainer()):{width:(t=t[0].contentRect).width,height:t.height,top:t.top,bottom:t.bottom,left:t.left,right:t.right};var e,n,i,o=this.getRect();o.width===i.width&&o.height===i.height||this.call(a.r.RESIZE,{previous:o,current:i});try{for(var s=(0,r.c)(Object.entries(i)),l=s.next();!l.done;l=s.next()){var u=(0,r._)(l.value,2),c=u[0],d=u[1];if(o[c]!==d){this.call(a.r.RECT_CHANGE,{previous:o,current:i});break}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}},e.triggerEditorEvent=function(t,e){function n(){s=!0}var r=this,o=this.g.getListeners(t),s=!1,a=!1;function l(){a=!0}e=e||{};for(var u=this,c=0;c<o.length&&"break"!==function(t){if(s)return"break";var a,t=o[t],c=t.listener,t=t.isOnce;e&&(e.stopEvent=n,e.preventEvent=l,e.evt=e);try{c.plugin?u.selection.getMultipleSelection().forEach(function(t){t=t.start.zoneId,r.pluginManager.isPluginInZone(c.plugin,t)&&c.call(c,e)}):u.b.has(c)?(a=u.b.get(c),u.selection.isZoneInSelection(a)&&(c.call(c,e),t&&u.b.delete(c))):c.call(c,e)}catch(t){u.error({e:t,message:t.message,level:i.W.ERROR})}}(c);c++);return{shouldStop:s,shouldPrevent:a}},e.setStopUpdateSelection=function(t){this.setStatus("stopUpdateSelection",t)},e.setPreventUpdateDomSelection=function(t){this.setStatus("preventUpdateDomSelection",t)},e._getAttributesOfPreviousPosition=function(){var t=this.q.getActiveZone().getZoneId(),e=this.selection.getSelection(t),n=e.start;return 0<e.start.offset&&(n=new K.L({start:e.toPosition().start-1,editor:this,len:0,zoneId:t}).toRange().start),this.q.getAttributes(n,e.start)},e._getAttributesOfNextPosition=function(){var t=this.q.getActiveZone().getZoneId(),e=this.selection.getSelection(t),n=null===(r=this.q.getZoneState(t))||void 0===r?void 0:r.getLine(e.start.line);if(!n)return(0,tf.vA)();var r=e.start;return e.start.offset<n.length()&&(r=new K.L({start:e.toPosition().start+1,editor:this,len:0,zoneId:t}).toRange().start),this.q.getAttributes(e.start,r)},e.setPluginMode=function(t,e){if(this.G)this.V={designMode:t,args:e};else{this.f=t;try{this.f?this.callAll("pluginReadWrite",e):this.callAll("pluginReadOnly",e)}catch(t){this.log("[Editor][setPluginMode] "+t)}}},e.setEditStatusLock=function(t,e){var n;(this.G=t)||!e||!this.V||(e=(n=this.V).designMode,n=n.args,this.setEditable(e,n)),t&&(this.V={designMode:this.f,args:{}})},e.setContentEditableLock=function(t){(this.m=t=void 0!==t&&t)||this.setContentEditable(this.v)},e.setContainerContentEditableLock=function(t){this.j=t=void 0!==t&&t},e.unstable_hydrate=function(t,e){this._hydrateMap.set(t,e),this._getViewModel()._setNode(t,e),e[s.e0]=!0},e._deleteHydrateTask=function(t){this._hydrateMap.delete(t),t._node&&(t._node[s.e0]=!1)},e.error=function(t){t.e||(t.e=Error(t.message)),t.affectingScope||(t.affectingScope="entire-editor"),this.call("error",t),t=(0,r.b)((0,r.b)({},t),{level:"error",shouldLogToMobile:!1}),this.log(t)},(0,r.a)([m.W],t.prototype,"setRect",null),(0,r.a)([tS],t.prototype,"calcToggleAttribute",null),(0,r.a)([tS],t.prototype,"toggleAttribute",null),(0,r.a)([tS],t.prototype,"setInlineStyleOverride",null),(0,r.a)([tS],t.prototype,"setContent",null),(0,r.a)([tS],t.prototype,"setHTML",null),(0,r.a)([tS],t.prototype,"setText",null),(0,r.a)([m.W],t.prototype,"scrollToSelection",null),(0,r.a)([m.W],t.prototype,"scrollTo",null),(0,r.a)([m.W],t.prototype,"handleDragOver",null),(0,r.a)([m.W],t.prototype,"mouseDownListenerForMac",null),(0,r.a)([m.W],t.prototype,"_handleEditorRectChange",null),(0,r.a)([m.W],t.prototype,"_handleEditorScroll",null),(0,r.a)([m.W],t.prototype,"__handleDOMSelectionChange",null),(0,r.a)([m.W],t.prototype,"_handleMouseDown",null),(0,r.a)([m.W],t.prototype,"_handleContentWillApply",null),(0,r.a)([m.W],t.prototype,"_handleContentWillChange",null),(0,r.a)([m.W],t.prototype,"_handleContentChange",null),(0,r.a)([m.W],t.prototype,"_handleMouseUp",null),(0,r.a)([m.W],t.prototype,"_handleClickEvent",null),(0,r.a)([tS],t.prototype,"_handleKeyEvent",null),(0,r.a)([tS],t.prototype,"_handleInputEvent",null),(0,r.a)([tS],t.prototype,"_handleBeforeInput",null),(0,r.a)([tS],t.prototype,"_handleCompositionEvent",null),(0,r.a)([tS],t.prototype,"_handleCopy",null),(0,r.a)([tS],t.prototype,"_handleCut",null),(0,r.a)([tS],t.prototype,"_handlePaste",null),(0,r.a)([m.W],t.prototype,"_handleDrag",null),(0,r.a)([m.W],t.prototype,"_handleFocusEvent",null),(0,r.a)([m.W],t.prototype,"_handleResizeEvent",null),(0,r.a)([tS],t.prototype,"triggerEditorEvent",null),t}(),tL=function(t){function e(e){var n=t.call(this,e)||this;return n.editableElem=null,n.r=function(){},n.o=q,n.c=function(t){var e=n.editor;e.getStatus("isPerforming")||e.getStatus("preventUpdateDomSelection")||!e.isFocus()||!t.target||t.relatedTarget||!e.dom.isZoneContainer(t.target)||W.Xh.mobile||e.selection.updateBrowserSelection()},e.editor?(n.editor=e.editor,e.copyable&&(n.editor.copyable=e.copyable),e.editable&&n.editor.setEditable(e.editable),e.isSSR&&(n.editor.isSSR=e.isSSR)):n.editor=new tC((0,r.b)((0,r.b)({},n.props),{initData:e.initData})),(e=e.listenEvents)&&(n.o=e),n.u=function(){return n.editor.call(a.r.SCROLL)},n}(0,r.d)(e,t);var n=e.prototype;return n.onMount=function(t){var e=this.editor,n=this.props;this.editableElem=t,e.init({element:t}),e.setMounted(!0),Promise.resolve().then(function(){e.callAll("editorDidMount")});var r=e.getContentState().getZoneState(o.S);null!=r&&r.length()?(r=r.getLine(0).hasLineMarker()?1:0,r=new K.L({start:r,len:0,zoneId:o.S,editor:e}),e.selection=new H({editor:e,range:r.toRange()})):e.selection=new H({editor:e}),e.togglePlaceHolder(),this._(t),null!==(t=n.onInit)&&void 0!==t&&t.call(n,e),null!==(t=n._onInitData)&&void 0!==t&&t.call(n,e)},n._=function(t){var e,n,i=this.editor,o=i.getDelegator();o.on("selectionchange",i.getContainer(),i.__handleDOMSelectionChange),o.on("resize",document.body,i._handleContainerResize),o.on("focusin",i.getContainer(),this.c),i.on(a.r.SELECTION_CHANGE,this.handleSelectionChange),i.on(a.r.ERROR,this.handleEditorError),window.addEventListener("scroll",this.u);try{for(var s=(0,r.c)(this.o),l=s.next();!l.done;l=s.next()){var u=l.value;"resize"===u?this.r=function(t,e){if(!t)return function(){};if(window.ResizeObserver){var n=new window.ResizeObserver(e);return n.observe(t),function(){n.disconnect()}}var r=document.createElement("iframe");r.setAttribute("style","\n position: absolute;\n width: 100%;\n height: 100%;\n top: -1000%;\n left: -1000%;\n user-select: none;\n visibility: hidden;\n "),r.addEventListener("resize",e);var i=t.parentElement;return i.appendChild(r),function(){i.removeChild(r),r.removeEventListener("resize",e)}}(t,this.editor._handleResizeEvent):this.props.forceListenContainer||"focus"===u||"blur"===u?o.on(u,i.getContainer(),this.handleEvent,{priority:1,customizedDelegateDom:i.getContainer()}):o.on(u,i.getContainer(),this.handleEvent,{priority:1})}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}},n.l=function(){var t,e,n=this.editor,i=n.getDelegator();n.off(a.r.SELECTION_CHANGE,this.handleSelectionChange),n.off(a.r.ERROR,this.handleEditorError);var o=n.getContainer();try{for(var s=(0,r.c)(this.o),l=s.next();!l.done;l=s.next()){var u=l.value;i.off(u,o,this.handleEvent)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}i.off("selectionchange",o,n.__handleDOMSelectionChange),this.r(),i.off("resize",document.body,n._handleContainerResize),i.off("focusin",n.getContainer(),this.c),window.removeEventListener("scroll",this.u)},n.componentDidUpdate=function(t){var e=t.editable,n=t.copyable,r=void 0===n||n,i=t.isSSR,o=void 0!==i&&i,n=this.props,t=n.editable,i=void 0===t||t,t=n.copyable,t=void 0===t||t,n=n.isSSR,n=void 0!==n&&n;i!==(void 0===e||e)&&this.editor.setEditable(i),t!==r&&(this.editor.copyable=t),n!==o&&(this.editor.isSSR=n)},n.componentWillUnmount=function(){var t=this.editor;this.l(),t._getViewModel().destroy(),t.destroy()},n.handleSelectionChange=function(){var t=this.editor.selection.getSelection();this.editor.getContentState().setActiveZone(t.start.zoneId)},n.handleEvent=function(t){var e,n,r=this.editor;r._correctCompositionIfNecessary(t),t instanceof Event&&(t.currentTarget instanceof Element&&!t.currentTarget.contains(t.target)||t.target instanceof Element&&(t.target.closest("."+s.qT)!==this.editor.getContainer()||null!==(e=t.target.closest("."+s.j4))&&void 0!==e&&e.closest("."+s.qT))||this.editor.getContainer().classList.contains(s.Zd)&&t.target instanceof Element&&!t.target.classList.contains(s.SX)&&null!==(n=t.target.closest("."+s.SX))&&void 0!==n&&n.classList.contains(s.Zd)||r[X[t.type]](t))},n.handleEditorError=function(t){var e,n;null!==(n=(e=this.props).onError)&&void 0!==n&&n.call(e,t)},n.UNSAFE_componentWillReceiveProps=function(t){t.placeholder!==this.props.placeholder&&this.editor._setPlaceholder(t.placeholder)},n.componentDidCatch=function(t){this.editor.error({e:t,level:i.W.FATAL,message:t.message})},e.defaultProps={editable:!0,placeholder:"",initData:(new Z.D).add(o.S,(new g.I).insertEnter())},(0,r.a)([m.W],e.prototype,"onMount",null),(0,r.a)([m.W],e.prototype,"handleSelectionChange",null),(0,r.a)([m.W],e.prototype,"handleEvent",null),(0,r.a)([m.W],e.prototype,"handleEditorError",null),e}(p.PureComponent),tw=function(t){var e,n,g,m,b,E,S,I,w,x,_,T,A,M,k,N,R,O=t.zoneId,P=t.editor,Z=t.style,W=t.className,K=t.editable,U=t.placeholder,F=void 0===U?"":U,B=t.root,V=void 0!==B&&B,j=t.ignoreContainerEditable,H=void 0!==j&&j,X=t.register,q=t.plugins,Y=t.scroller,G=t.scrollerOptions,U=t.contextList,B=void 0===U?[]:U,j=t.customizedProviderConstructorList,U=void 0===j?[]:j,J=t.children,Q=t.onMount,$=t.onDidPaint,j=t.isSSR,tt=(0,r.f)(t,["zoneId","editor","style","className","editable","placeholder","root","ignoreContainerEditable","register","plugins","scroller","scrollerOptions","contextList","customizedProviderConstructorList","children","onMount","onDidPaint","isSSR"]);function te(){var t,e;if(tt.modules)try{for(var n=(0,r.c)(Object.keys(tt.modules)),i=n.next();!i.done;i=n.next()){var o,s,a,l=i.value,u=tt.modules[l];u&&(s=(o=(0,r._)(u,2))[0],a=o[1],P.modulesContainer.setZoneModule(O,l,s,a))}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}}te();var tn=(n=(e={editor:P,zoneId:O,contextList:(0,r.e)([{Context:L.rU,contextValue:P}],B),customizedProviderConstructorList:U}).editor,g=e.zoneId,m=e.contextList,b=e.customizedProviderConstructorList,E=(0,p.useRef)(null),(0,p.useEffect)(function(){var t,e,i,o;if(E.current)try{for(var s=(0,r.c)(m),l=s.next();!l.done;l=s.next()){var u,c=l.value,d=c.Context,f=c.contextValue;E.current.has(d)&&E.current.get(d)!==f&&(u={zoneId:g,Context:d,contextValue:f},n.call(a.r.REACT_CONTEXT_UPDATE,u))}}catch(t){i={error:t}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}else{E.current=new WeakMap;try{for(var h=(0,r.c)(m),p=h.next();!p.done;p=h.next()){var v=p.value,d=v.Context,f=v.contextValue;E.current.set(d,f)}}catch(e){t={error:e}}finally{try{p&&!p.done&&(e=h.return)&&e.call(h)}finally{if(t)throw t.error}}}},[n,g,m]),{Provider:function(t){var e;return t=t.children,p.createElement(p.Fragment,null,m.reduce(function(t,e){var r=e.Context,e=e.contextValue;return p.createElement(z,{editor:n,zoneId:g,Context:r,contextValue:e},t)},(e=t,(0,r.e)(b).reduce(function(t,e){return e(t)},e))))}}).Provider,tr=(0,p.useRef)(null),ti=(0,p.useRef)(null),to=(0,p.useRef)(null),ts=(0,p.useCallback)(function(t){var e;!(tr.current=t)||(e=P.getContentState().getZoneState(O))&&P._getViewModel()._setNode(e,t)},[P,O]);if(!V){if(q&&X&&P.error({message:"Simultaneous usage of both plugins and register is not permissible.",level:i.W.ERROR}),q)P.pluginManager._registerV2(q,O);else if(X){P.pluginManager._resetPluginConstructorToZoneMap(O);try{for(var ta=(0,r.c)(X(P)),tl=ta.next();!tl.done;tl=ta.next()){var tu=tl.value;P.pluginManager.register(tu,O)}}catch(t){tp={error:t}}finally{try{tl&&!tl.done&&(R=ta.return)&&R.call(ta)}finally{if(tp)throw tp.error}}}}function tc(){var t;tr.current&&(V||P.pluginManager.call("zoneDidMount",{zoneId:O},{zoneId:O}),null!=Q&&Q(tr.current),null!==(t=P.getContentState().getZoneState(O))&&void 0!==t&&t.setPlaceholder(F),P._toggleZonePlaceHolder(O))}function td(t,e){void 0===e&&(e={}),!1!==P.mounted&&($&&$(t,e),P.call(a.r.PAINT,{data:t,zoneId:O}),P.selection.getSelection().start.zoneId!==O||P.getStatus("isPerforming")||P.getStatus("preventUpdateDomSelection")||P.getStatus("isComposing")||!P.isFocus()||P.selection.updateBrowserSelection(),P.setStatus("contentChanged",!1),P.call(s.ip))}var tf=function(t,e){void 0===e&&(e=!0);var n=P.getContentState().getZoneState(O);if(n)try{P.trace.start(),P.trace.add({extra:{isInitialRender:e}});var r=(0,c.Z)(D,{editor:P,zoneId:O,state:n,onMount:tc,onDidPaint:td},t,{PluginContextProvider:tn});return P.trace.reset(),r}catch(r){if(!e||null!==(e=to.current)&&void 0!==e&&e.isEnabled){if(!P.mounted)throw r;return P.error({message:"[render error] "+r.message,level:i.W.FATAL,e:r,extra:P.trace.export()}),null}return O===o.S?void 0:((0,c.a)(n),t.innerHTML="",tf(t,!1))}};(0,p.useLayoutEffect)(function(){function t(t){var e,n=t.changes,r=t.diffResult,s=t.previous,l=t.current,u=t.options;if(O in n&&O in r){P.setStatus("isPainting",!0);var f=s.getContent().get(O);if(f)try{function h(){P.call(a.r.BEFORE_DOM_RENDERER_RECONCILE,{applyType:u.type,zoneId:O})}function p(t){(0,d.r)({diffResult:t,previousState:f,ReactContextProvider:tn})}var v=function(){P.call(a.r.AFTER_DOM_RENDERER_RECONCILE,{applyType:u.type,zoneId:O})};null!==(e=to.current)&&void 0!==e&&e.isEnabled?to.current.handleContentChange({changes:n[O],previousZoneState:f,zoneDiff:r[O],applyOptions:u,contentChangeRender:p,beforeRender:h,afterRender:v}):(h(),p(r[O]),v())}catch(t){if(v={message:"[content change reconcile error]: "+(null==t?void 0:t.message),level:i.W.ERROR,e:null!==(v=null==t?void 0:t.originalError)&&void 0!==v?v:t,extra:null!=t&&t.extraInfo?JSON.stringify(t.extraInfo):""},!tr.current||O===o.S)return v.level=null!=t&&t.isFatal?i.W.FATAL:i.W.ERROR,void P.error(v);if(P.error(v),(0,c.a)(r[O].state),tr.current.innerHTML="",!(v=P.getContentState().getZoneState(O)))return;var g=tr.current;null!==(r=to.current)&&void 0!==r&&r.isEnabled?(P._getViewModel()._setNode(v,tr.current),to.current.initializeZoneRender(function(){tf(g,!1)})):(tf(g,!1),P._getViewModel()._setNode(v,tr.current))}P.getStatus("isPainting")&&P.setStatus("isPainting",!1),(l=l.getContent().get(O))&&(ti.current=l),P._toggleZonePlaceHolder(O)}}return P.on(a.r.CONTENT_CHANGE,t,{zoneId:O,priority:100}),function(){P.off(a.r.CONTENT_CHANGE,t)}},[P,O,tn,tc,td]),(0,p.useLayoutEffect)(function(){var t,e,n,o;return V&&J?tc():tr.current&&(t=tr.current,(e=P.getContentState().getZoneState(O))?(te(),(n=P.modulesContainer.getZoneModule(O,l.C.VirtualListModule))&&(n=(o=(0,r._)(n,2))[0],o=o[1],to.current=n.create((0,r.b)((0,r.b)({},o),{editor:P,zoneId:O})),to.current.setRenderInformation({ReactContextProvider:tn})),null!==(o=to.current)&&void 0!==o&&o.isEnabled?to.current.initializeZoneRender(function(){tf(t)}):tf(t),ti.current=e):P.error({message:"[render zone content failed]: ZoneState is not exist. zoneId: "+O,level:i.W.ERROR})),function(){(function(){V||P.pluginManager.call("zoneWillUnmount",{zoneId:O},{zoneId:O});var t,e,n=P.getContentState().getZoneState(O);if(null!=n&&n.instance?(0,c.a)(n):ti.current&&(0,c.a)(ti.current),tr.current&&P._getViewModel()._deleteNode(tr.current),null!==(n=to.current)&&void 0!==n&&n.destroy(),to.current=null,tt.modules)try{for(var i=(0,r.c)(Object.keys(tt.modules)),o=i.next();!o.done;o=i.next()){var s=o.value;P.modulesContainer.unSubscribingZone(O,s)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}})()}},[]);var th=(0,p.useRef)(!!J);(0,p.useLayoutEffect)(function(){var t;V&&J&&!th.current&&(t=P.getContentState().getZoneState(o.S))&&t.lines.forEach(function(t){var e=t.getNode();(0,c.a)(t),null!=e&&e.remove()}),th.current=!!J},[V,J,P]);var tp=(0,p.useMemo)(function(){if(!V||!H)return K&&!P.inputModel&&P.error({message:"InputModel is required when editable is set to true",level:i.W.FATAL}),K},[K,V,H]);if((0,p.useLayoutEffect)(function(){var t=V&&H;return t&&P.setContainerContentEditableLock(!0),function(){t&&P.setContainerContentEditableLock(!1)}},[P,V,H]),(0,p.useEffect)(function(){function t(t){var e,n,o=t.zoneId,s=t.lineArr,c=t.from,f=function(t,e,n){var r,e=t.getContentState().getZoneState(e);if(!e)return null;for(var i=e.parent;i;){if(i instanceof u.V&&(null===(r=i.parent)||void 0===r?void 0:r.getZoneId())===n)return i;i=i.parent}return null}(P,O,o);null!==(t=to.current)&&void 0!==t&&t.isEnabled&&f&&null!=s&&s.includes(f.index)?(e=P.modulesContainer.getZoneModule(O,l.C.VirtualListModule))&&(n=(0,r._)(e,2)[1],to.current.handleAncestorForceRefresh((0,r.b)((0,r.b)({},n),{zoneId:O,editor:P}))):O===o&&("input"===c&&P.error({message:"warning: force refresh view by input model",level:i.W.ERROR}),e=P.getContentState().getZoneState(O),n=ti.current,e&&n&&(ts(c=n.getContainer()),null!==(c=to.current)&&void 0!==c&&c.isEnabled&&to.current.handleForceRefresh(n,s),P.setStatus("isPainting",!0),P.call(a.r.BEFORE_DOM_RENDERER_RECONCILE,{applyType:"forceRefresh",zoneId:o}),(0,d.r)({diffResult:{state:e,changes:null},previousState:n,ReactContextProvider:tn}),P.call(a.r.AFTER_DOM_RENDERER_RECONCILE,{applyType:"forceRefresh",zoneId:o}),P.getStatus("isPainting")&&P.setStatus("isPainting",!1),ti.current=e))}return P.on("_forceRefresh",t),function(){P.off("_forceRefresh",t)}},[P,O,ts,tn]),y(P,O),S=P,I=null!==(Y=null!=Y?Y:tr.current)&&void 0!==Y&&Y,w=O,void 0===(x=G)&&(x={}),_=(0,p.useRef)(null),(0,p.useEffect)(function(){_.current&&_.current.destroy();var t=null;void 0===I||!0===I?t=document.scrollingElement||document.body:!1===I?t=null:(I instanceof Element||I instanceof Window)&&(t=I),_.current=null!==t?new C(S,t,(0,r.b)((0,r.b)({},x),{getViewPortPadding:S.getViewPortPadding}),w,null!==(t=x.scrollListenEventConfigs)&&void 0!==t?t:[{type:a.r.SELECTION_CHANGE,overideConfig:{triggerAfterPaint:!0}}]):null},[I,w,S,x]),(0,p.useEffect)(function(){return function(){var t;null!==(t=null==_?void 0:_.current)&&void 0!==t&&t.destroy()}},[]),_.current,!P.isSSR&&!j||V&&J)return p.createElement("div",{key:O,ref:ts,style:Z||{outline:"none"},className:s.SX+" "+(W||"zoneId-"+O+" ace-editor"),"data-zone-id":O,"data-zone-container":"*","data-slate-editor":"true",contentEditable:tp,suppressContentEditableWarning:!0},V&&J);if(!(G=P.getContentState().getZoneState(O)))return P.error({message:"[render zone content failed]: ZoneState is not exist. zoneId: "+O,level:i.W.ERROR}),null;return T=D,A={state:G,editor:P,zoneId:O,onMount:tc,onDidPaint:td},(M=({PluginContextProvider:tn}).PluginContextProvider)&&(0,h.RM)(M),(0,h.$i)(!0),k=(0,v.az)(T,A),M&&(0,h.RM)(null),(0,h.$i)(!1),N=document.createElement("div"),Array.isArray(k)?N.append.apply(N,(0,f.d)(k)):N.append(k),j=N.innerHTML,(0,c.a)(G),p.createElement("div",{key:O,ref:ts,style:Z||{outline:"none"},className:s.SX+" "+(W||"zoneId-"+O+" ace-editor"),"data-zone-id":O,"data-zone-container":"*","data-slate-editor":"true",contentEditable:tp,suppressContentEditableWarning:!0,dangerouslySetInnerHTML:{__html:j}})},tx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,r.d)(e,t),e.prototype.render=function(){var t=this.editor,e=this.props,n=e.style,r=e.editable,i=e.ignoreContainerEditable,o=e.className,a=e.scroller,l=e.contextList,u=e.customizedProviderConstructorList,c=e.scrollerOptions,d=e.modules,e=e.plugins;return e&&t.pluginManager._registerV2(e),d&&t._registerModules(d),!r||i||t.inputModel||t.error({message:"InputModel is required when editable is set to true",level:s.WV.FATAL}),p.createElement(L.rU.Provider,{value:t},p.createElement(tw,{root:!0,zoneId:"0",editor:t,style:n||{},className:"editor-kit-container "+(0,P.AO)()+" "+(o||""),editable:r,onMount:this.onMount,scroller:a,scrollerOptions:c,contextList:l,customizedProviderConstructorList:u}))},e}(tL)},649493:function(t,e,n){"use strict";n.d(e,{Z:function(){return O}});var r,i=n("194055"),o=n("464675");n("294484");var s=n("919421"),a=n("931173"),l=n("454746"),u=n("457341"),c=n("481685"),d=n("734795"),f=n("85359"),h=n("559016"),p=n("361087"),v=n("97930"),g=n("49483"),y=n("274709"),m=function(t){var e=t.keyCode,t=t.ctrlKey;return[d.VD.Left,d.VD.Right,d.VD.Up,d.VD.Down].includes(e)||f.Xh.isMac&&t&&e===d.VD.B||f.Xh.isMac&&t&&e===d.VD.F},b=function(t){var e=t.keyCode;return!t.charCode&&[d.VD.Shift,d.VD.Alt,d.VD.Ctrl,d.VD.CapsLock,d.VD.Meta,d.VD.BracketRightKeyDown].includes(e)},E=function(t){for(;t;){var e;if((e=t).getAttribute(d.eu)||e.getAttribute(d.Wr))return!0;if(t.className.includes(d.r0)||t.className.includes("editor-kit-container"))break;t=t.parentElement}return!1},S=function(t){return g.Uk.test(t)},I=function(t){var e=t.offset,t=t.lineText;return(0,y.j)(t.slice(0,e))},C=function(t){var e=t.offset,t=t.lineText;return(0,y.X)(t.slice(e))},L=function(t){var e=t.lineMarker;return t.offset-e},w=function(t){var e=t.offset;return t.lineText.length-1-e},x=function(t){var e=t.lineMarker,n=t.offset,r=t.lineText,t=I(t);if(1<t)return t;for(var i=n-1;e<i&&S(r[i-1]);)i--;return n-i},_=function(t){var e=t.offset,n=t.lineText,t=C(t);if(1<t)return t;for(var r=e+1;r<n.length-1&&S(n[r]);)r++;return r-e};function T(t,e,n){n=JSON.stringify({rangeStartLine:e.start.line,rangeEndLine:e.end.line,isLineStateNull:!n,isViewModelMatchedNull:!t._getViewModel().getView(n),isLineStateNodeNull:!(null!=n&&n.getNode()),zoneStateSize:(null===(n=n.parent)||void 0===n?void 0:n.length())||0}),t.error({level:d.WV.ERROR,message:"line is null while input",extra:n})}var A,M,k=((A={})[d.VD.Enter]="_handleReturnKey",A[d.VD.Delete]="_handleDeleteKey",A[d.VD.BackSpace]="_handleDeleteKey",A);(r=M=M||{}).FlushInput="flushInput",r.Composition="composition",r.DeleteForward="deleteForward",r.DeleteBackward="deleteBackward",r.DeleteToLineStart="deleteToLineStart",r.DeleteToLineEnd="deleteToLineEnd",r.DeleteEntireWordBackward="deleteEntireWordBackward",r.DeleteEntireWordForward="deleteEntireWordForward",r.DeleteRange="deleteRange",r.Return="doReturnKey",r.KeyEvent="handleKeyEvent";var N=[M.FlushInput,M.DeleteForward,M.DeleteBackward,M.Return],R=["formatBold","formatItalic","formatStrikeThrough","formatUnderline"],O=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,i.d)(e,t),e.prototype._handleReturnKey=function(t){this._flushInput();var e=this.editor,n=e.getContentState(),r=n.getActiveZone().getZoneId(),i=e.selection.getSelection(),s=i.start.line,a=i.toPosition(),l=a.start,i=a.len,a=n.getZoneState(r).getLine(s).getLineAttributes().toMap(),n={evt:t,delta:new o.I({zoneId:r}),editor:e};return e.callAll("doReturnKey",{}),e.pluginManager.call("editorWillDoReturnKey",n),r=new o.I({zoneId:r}),n.delta.ops.length?r=r.compose(n.delta):r.retain(l).delete(i).insertEnter().insertLineMarker(a),this._apply(r,{type:M.Return}),e.callAll("editorAfterDoReturnKey",{theLine:s}),t.preventDefault(),this._mergeInputRecord(),null},e}(function(){function t(t,e){var n=this;this._isFirefoxCompositionEnded=!1,this.it=null,this.st=null,this.nt=0,this.ot=[],this.C=0,this.lt=null,this.ut=-1,this.ct=null,this.ht=!1,this._t=!1,this.at=null,this.mt=!1,this._handleKeyDown=this.vt(function(t){var e,r,i,o,s,a,l,u=t.evt.nativeEvent;b(u)||(m(u)&&n._flushInput(),e=u.keyCode,l=u.ctrlKey,a=u.metaKey,s=u.altKey,r=M.KeyEvent,m(u)||n.editor.getStatus("isComposing")||(n._t=!1,i=null,e===d.VD.Enter?(i=n._handleReturnKey(u),n._t=!0):e===d.VD.BackSpace&&(l||a)?(i=n.dt(u,!0,L),r=M.DeleteToLineStart,n._t=!0):e===d.VD.Delete&&(l||a)||l&&e===d.VD.K&&(f.Xh.isMac||f.Xh.isIOS)?(i=n.dt(u,!1,w),r=M.DeleteToLineEnd,n._t=!0):e===d.VD.BackSpace&&s?(i=n.dt(u,!0,x),r=M.DeleteEntireWordBackward,n._t=!0):e===d.VD.Delete&&s?(i=n.dt(u,!1,_),r=M.DeleteEntireWordForward,n._t=!0):e===d.VD.Ime&&f.Xh.isAndroid||e===d.VD.BackSpace&&f.Xh.isIOS?(n.at=u,n.mt=!0,n._t=!1):e===d.VD.BackSpace||l&&e===d.VD.H&&(f.Xh.isMac||f.Xh.isIOS)?(i=n.dt(u,!0,I),r=M.DeleteBackward,n._t=!0):e===d.VD.Delete||l&&e===d.VD.D&&(f.Xh.isMac||f.Xh.isIOS)?(i=n.dt(u,!1,C),r=M.DeleteForward,n._t=!0):e===d.VD.Insert?n._flushInput():(e===d.VD.A||e===d.VD.E)&&l&&f.Xh.isMac&&(n._t=!0,s=(a=(t=(o=n.editor.selection).getSelection()).start).line,l=a.zoneId,a=n.editor.getContentState().getZoneState(l).getLine(s),l={line:s,offset:e===d.VD.A?a.hasLineMarker()?1:0:a.length()-1,zoneId:l},o.setSelection({start:l,end:l,isBackward:t.isBackward},!0)),n._t&&!f.Xh.ios&&(u.preventDefault(),n._t=!1),i&&(n._apply(i,{type:r}),n._mergeInputRecord())))}),this._mergeInputRecord=(0,s.P)(function(){for(var t=n.ot.length-1,e=t-1;0<=e&&0<=t;){var r=n.ot[t],i=n.ot[e];r.type===i.type&&N.includes(r.type)?(n.editor.undoModule.mergeRecords(i,r),e=(t=e)-1):e=(t=e-1)-1}n.ot=[]},1e3,{leading:!1}),this.pt=0,this.editor=t,this.C=null!==(e=e.debounceFlush)&&void 0!==e?e:0,t.on("beforeinput",this._handleBeforeInput,0),t.on("compositionstart",this._handleCompositionEvent,0),t.on("compositionupdate",this._handleCompositionEvent,0),t.on("compositionend",this._handleCompositionEvent,0),t.on("mousedown",this._handleMouseDown,0),t.on("contentchange",this._handleContentChange,0)}var e=t.prototype;return e.vt=function(t){var e=this;return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];e.editor.undoModule.batchedUndo(function(){t.apply(e,n)})}},e._handleKeyPressAndUp=function(t){var e=t.evt;this.mt=!1,this.at=null,b(e.nativeEvent)||(t=k[t=e.keyCode],E(e.target)||this.editor.isFocusOnBlock()||this[t]&&e.preventDefault())},e._handleMouseDown=function(){this._flushInput()},e._handleContentChange=function(){var t=this.editor.getContentState().contentApplyRuntime;this.ot.push(t.currentRuntime)},e._handleBeforeInput=function(t){var e=this.editor;if(!e.getStatus("isComposing")){f.Xh.ios&&this._t&&(this._t=!1,t.preventDefault());var n,r=t.inputType,o=t.data,s=void 0===o?"":o,a=t.dataTransfer,l=void 0===a?null:a,o=(0,i._)(t.nativeEvent.getTargetRanges(),1)[0],a=null!=o?o:null===(u=document.getSelection())||void 0===u?void 0:u.getRangeAt(0),u="deleteContentBackward"===r||"deleteWordBackward"===r||a&&!a.collapsed&&"insertText"===r&&""===s;if(u&&this.mt&&this.at&&(f.Xh.isAndroid||f.Xh.isIOS)||f.Xh.isIOS&&"deleteWordBackward"===r)return e.triggerEditorEvent("deleteWordBackward",t).shouldPrevent||(a=(null==(n=a?e.selection._toModelRange(a):null)?void 0:n.toPosition().len)||I,n=null,(n=this.at?this.dt(this.at,!0,a):this.ft(!0,a))&&(this._apply(n,{type:M.DeleteBackward}),this._mergeInputRecord())),t.preventDefault(),void(this._t=!0);s&&!f.Xh.mobile&&!f.Xh.isIPad&&f.Xh.safari&&/^\d+\.$/.test(s)&&"insertText"===r?t.preventDefault():r.startsWith("delete")||r.startsWith("deleteBy")||(n=getSelection(),o||null!=n&&n.isCollapsed||(o=null==n?void 0:n.getRangeAt(0)),R.includes(r)&&t.preventDefault(),n=o&&!o.collapsed,this.jt(o,n),e.callAll("editorWillHandleBeforeInput",{event:t}),("insertText"===r&&s&&-1<s.indexOf("\n")||"insertReplacementText"===r&&s||"insertReplacementText"===r&&null!=l&&l.getData("text"))&&(r=e.selection.getSelection(),e.getContentState().replaceText(r,s||(null==l?void 0:l.getData("text"))||""),t.preventDefault(),f.Xh.isAndroid&&!t.nativeEvent.cancelable&&(this._t=!0)))}},e._handleInput=function(t){var e,n,r,i=this,s=this.editor;if(this._t&&f.Xh.ios&&s.getStatus("isComposing"))this._t=!1;else if(this._t){this._t=!1;var a=s.selection.getSelection().start;return void s.triggerEditorEvent("_forceRefresh",{zoneId:a.zoneId,from:"input"})}["historyUndo","historyRedo"].includes(t.inputType)||(!f.Xh.isIPad||"deleteCompositionText"!==t.inputType||s.getStatus("isComposing")?f.Xh.android&&s.getStatus("isComposing")&&("deleteContentBackward"===t.inputType||"insertCompositionText"===t.inputType)||("deleteContentBackward"!==t.inputType?f.Xh.isFF&&this._isFirefoxCompositionEnded&&!1===t.nativeEvent.isComposing?this._isFirefoxCompositionEnded=!1:this.editor.getStatus("isComposing")||E(t.target)||s.isFocusOnBlock(t.target)||f.Xh.isIPad&&"deleteContentForward"===t.nativeEvent.inputType||(this.st&&(window.clearTimeout(this.st),this.st=null),this.nt++,n=(e=s.selection.getSelection().toPosition()).len,t=e.start,e=e.zoneId,this.editor.log("[Log]","[Input][_handleInput] selection",JSON.stringify({zoneId:e,start:t,timestamp:Date.now()})),n||!this.C?this.yt(M.FlushInput):(this.editor.setStopUpdateSelection(!0),this.st=window.setTimeout(function(){i._flushInput()},this.C))):(this._flushInput(),(n=s.selection.getSelection()).isCollapsed()?(f.Xh.isIOS||f.Xh.isIPad)&&(r=this.ft(!0,1))&&this._apply(r,{type:M.DeleteBackward}):(a=(s=n.toPosition()).start,n=s.len,s=s.zoneId,r=new o.I({zoneId:s}).retain(a).delete(n),this._apply(r,{type:M.DeleteRange})))):this.ht=!0)},e._flushInput=function(t){this.editor._resetCursorStatus(),!this.editor.getStatus("isComposing")||t?this.st&&(window.clearTimeout(this.st),this.editor.setStopUpdateSelection(!1),this.st=null,this.yt(M.FlushInput)):this.editor.log("[Input][_flushInput] _flushInput return in composition")},e.yt=function(t){var e=this.editor,n=e.selection.getSelection(),r=n.start,i=n.end,o=e._getViewModel(),s=e.getContentState(),a=s.getActiveZone().getZoneId(),l=s.getZoneState(a);if(l){var u=l.getLine(r.line),c=o.getView(u),d=Number(u.hasLineMarker()),s=u.getText(),a=s.slice(0,s.length-1);if(this.editor.getFg("isEditorKitDirtDOMRefreshEnabled")&&!c)return T(this.editor,n,u),void this.editor.getContentState()._forceRefresh(r.zoneId,[(null==u?void 0:u.index)||0],"input");n=(s=(0,p.z8)(c).join("")).replace(/\n/g,""),u=r.offset-d,a=i.offset+n.length-a.length-d,i.line>r.line&&(l=(d=l.getLine(i.line)).getText()||"",h=Number(d.hasLineMarker()),h=l.slice(0,l.length-1).length-(i.offset-h),e.getContainer().contains(c)&&n||(c=o.getView(d),u=0),a=f.Xh.isEdge?n.length:n.length-h);var h=s,s=(0,p.S3)(c).join(""),c=n.slice(u,a).replace(g.DT,""),a=this._getInheritAttributesAndsetStatus();h!==s&&r.line===i.line?(e.setStatus("dangerousInput",!0),this.Et(c,a,{refresh:!0,type:t})):0===c.length&&r.line===i.line&&r.offset===i.offset?(c=n.substr(u,this.nt),this.Et(c,a,{overtype:!0,type:t})):this.Et(c,a,{overtype:!1,type:t}),this.nt=0}},e._getInheritAttributesAndsetStatus=function(){var t=this,e=this.editor.selection.getSelection(),n=e.toPosition().zoneId,n=this.editor.pluginManager.call("editorGetInheritAttributes",{},{cb:function(t,e){return e},zoneId:n}),e=this.getInheritAttributes(e,function(){t.editor.setStatus("dangerousInput",!0)});return Object.assign({},e,n)},e.getInheritAttributes=function(t,e){var n,r,o,s=this.editor,a=s.getContentState(),l=s._getInlineAttributesOfPreviousPosition(!0,t),u=s._getInlineAttributesOfPreviousPosition(!1,t).toMap(),c=(null!=t?t:s.selection.getSelection()).toPosition(),c=a.getInlineStyleOverride(c),d={};try{for(var f=(0,i.c)(l),h=f.next();!h.done;h=f.next()){var p=(0,i._)(h.value,2),v=p[0],g=p[1],y=this.bt();if(null!=y&&y.test(v)&&(!1!==(null==(I=a.schema.get(v))?void 0:I.lineStartInherit)||v in u)){if(I&&!1===I.tailInherit&&s._getInlineAttributesOfNextPosition(t).toMap()[v]!==g){null!=I&&I.refresh&&e&&e();continue}d[v]=g}}}catch(t){m={error:t}}finally{try{h&&!h.done&&(n=f.return)&&n.call(f)}finally{if(m)throw m.error}}var m=s._getInlineAttributesOfNextPosition(t),b=this.bt();try{for(var E=(0,i.c)(m),S=E.next();!S.done;S=E.next()){var I,C=(0,i._)(S.value,2),v=C[0],g=C[1];null==b||!b.test(v)||v in d||(I=a.schema.get(v))&&I.headInherit&&(d[v]=g)}}catch(t){r={error:t}}finally{try{S&&!S.done&&(o=E.return)&&o.call(E)}finally{if(r)throw r.error}}return(0,i.b)((0,i.b)({},d),c)},e.bt=function(){if(this.it)return this.it;var t,e,n=this.editor.getContentState().schema,r=[];try{for(var o=(0,i.c)(Object.keys(n.schemas)),s=o.next();!s.done;s=o.next()){var a=s.value;n.schemas[a].mark&&r.push(a)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return r.length?(this.it=new RegExp(r.join("|")),this.it):null},e._handleReturnKey=function(t){return null},e.dt=function(t,e,n){void 0===e&&(e=!0),void 0===n&&(n=1),this.editor.log("trace","[Editor Event] name: "+t.type+", type: deleteKey");var r=Date.now();r-this.pt<5&&this.editor.error({level:a.W.ERROR,message:"[Editor Error]: delete trigger multiple times in a short period of time."}),this.pt=r,this._flushInput();var i=this.editor;if(i.triggerEditorEvent(h.r.DELETE_KEY,{e:t,isBackward:e}),t.defaultPrevented)return null;var s=i.getContentState(),l=s.getActiveZone().getZoneId(),u=i.selection.getSelection(),d=u.start,f=d.line,p=d.offset,v=u.toPosition(),r=v.start,d=v.len,u={evt:t,deltaSet:(new c.D).compose(new o.I({zoneId:l})),editor:i};if(e&&i.pluginManager.call("editorWillDoDeleteKey",u),i.callAll("aceDoDeleteKey",{editor:i,evt:t,caretLine:i.selection.getSelection().start.line}),v=[],d?(d=new o.I({zoneId:l}).retain(r).delete(d),d=u.deltaSet.compose(d),this._apply(d,{type:M.DeleteRange}),v=[!0]):e&&(p={editor:this.editor,evt:t,lineMarker:null===(s=null===(s=s.getZoneState(l))||void 0===s?void 0:s.getLine(f))||void 0===s?void 0:s.hasLineMarker(),zoneId:l,theLine:f,col:p},v=i.callAll("editorDoDeleteKey",p)),v.includes(!0))return i.callAll("editorAfterDoDeleteKey",{editor:i,theLine:f,evt:t}),null;var g=!1;return(u.deltaSet.forEach(function(t){0<t.ops.length&&(g=!0)}),g)?u.deltaSet:(n=this.ft(e,n))?u.deltaSet.compose(n):null},e.ft=function(t,e){void 0===e&&(e=1);var n=this.editor.selection.getSelection(),r=this.editor.getContentState(),i=n.start,s=i.offset,a=i.zoneId,l=n.toPosition().start,u=new o.I({zoneId:a}),c=n.start.line,d=r.getZoneState(a);if(!d)return null;var f,i=d.getLine(c),r=Number(i.hasLineMarker()),a=n.start.offset===r,d=i.length()-n.start.offset==1,n=i.nextSibling(),i=i.getModelText();return!n&&d&&!t||a&&t&&0===c?null:(t?a?u.retain(l-1-r).delete(r+1):(f="function"==typeof e?e({lineText:i,offset:s,lineMarker:r}):e,u.retain(l-f).delete(f)):d?(n=Number(n.hasLineMarker()),u.retain(l).delete(1+n)):(f="function"==typeof e?e({lineText:i,offset:s,lineMarker:r}):e,u.retain(l).delete(f)),u)},e._handleCompositionEvent=function(t){var e=t.type,n=this.editor;"compositionstart"===e?this._handleCompositionstart(t):"compositionupdate"===e?this.wt():"compositionend"===e&&this.It(t),n.callAll("aceCompositionEvent",{evt:t,editor:n}),t.stopPropagation()},e._handleCompositionstart=function(t){this.editor.setStatus("isComposing",!0);var e,n=null===(e=t.nativeEvent)||void 0===e?void 0:e.data,r=this.editor.selection.getSelection();n&&0<n.length&&r.isCollapsed()?(e=r.start,r=r.end,this.editor.selection.setSelection({start:(0,i.b)((0,i.b)({},e),{offset:e.offset-n.length}),end:r})):(o=(l=(a=(null==(o=window.getSelection())?void 0:o.isCollapsed)&&this.editor.selection.toModelRange(o))&&a.start||{}).zoneId,s=(o=(l=(a=l.line)&&o&&(null===(s=this.editor.getContentState().getZoneState(o))||void 0===s?void 0:s.getLine(a)))&&this.editor._getViewModel().getView(l))&&l&&(0,p.S3)(o).join(""),a=l&&l.getText(),s&&s===a&&this.jt());var o=this.editor;o.callAll("editorWillHandleCompositionStart",{event:t}),o.callAll("aceAfterCompositionStart"),o.setStopUpdateSelection(!0);var s=o.selection.getSelection();if(f.Xh.isAndroid&&s.isCollapsed()){var a=s.start,t=o._getViewModel(),l=o.getContentState().getActiveZone().getLine(a.line);if(this.lt=t.getView(l),this.editor.getFg("isEditorKitDirtDOMRefreshEnabled")&&!this.lt)return T(this.editor,s,l),void this.editor.getContentState()._forceRefresh(a.zoneId,[(null==l?void 0:l.index)||0],"input");this.ut=(0,p.z8)(this.lt).join("").replace(/\n/g,"").length,this.ct=s}},e.qt=function(){var t=this.editor,e=t.selection.getSelection(),n=e.start,r=t._getViewModel(),i=t.getContentState(),s=i.getActiveZone(),a=s.getZoneId(),l=s.getLine(n.line),u=r.getView(l),s=Number(l.hasLineMarker()),r=l.getText(),c=r.slice(0,r.length-1);if(this.editor.getFg("isEditorKitDirtDOMRefreshEnabled")&&!u)return T(this.editor,e,l),void this.editor.getContentState()._forceRefresh(n.zoneId,[(null==l?void 0:l.index)||0],"input");for(var d=(0,p.z8)(u).join("").replace(/\n/g,""),f=n.offset-s,h=f,v=h=-1!==this.ut&&this.ut<c.length?f-(c.length-this.ut):h,g=f-c.length,y=0;y<h;y++)if(c[y]!==d[y]){v=y;break}for(y=0;y<c.length-f;y++)if(c[c.length-y-1]!==d[d.length-y-1]){g=-y;break}t.setStatus("dangerousInput",!0),null!==(i=i.rangePointToOffset({zoneId:a,line:n.line,offset:v+s}))&&(n=c.length+g-v,s=d.slice(v,d.length+g),0!=n||0!==s.length?(s=new o.I({zoneId:a}).retain(i).delete(n).insert(s,this._getInheritAttributesAndsetStatus()),this._apply(s,{type:M.Composition})):t.__handleDOMSelectionChange())},e.wt=function(){var t;f.Xh.isAndroid&&this.lt&&(t=(0,p.z8)(this.lt).join("").replace(/\n/g,"")).length<this.ut&&(this.ut=t.length)},e.It=function(t){var e,n;if(!f.Xh.isAndroid||this.editor.getStatus("isComposing")){if(f.Xh.isIPad&&!this.editor.getStatus("isComposing")&&this.ht)return this.gt(),void(this.ht=!1);if(this.editor.setStatus("isComposing",!1),f.Xh.isFF&&(this._isFirefoxCompositionEnded=!0),this.editor.setStopUpdateSelection(!1),this.lt=null,E(t.target)||this.editor.isFocusOnBlock())return this.ut=-1,void(this.ct=null);this.editor.callAll("aceBeforeCompositionEnd");var r=this.editor.selection.getSelection(),s=null===(c=this.editor.getContentState().getActiveZone())||void 0===c?void 0:c.getLine(r.start.line);if((!t.data.includes("\n")||t.data.startsWith("\n"))&&s&&document.contains(s.getNode()))f.Xh.isAndroid&&r.isCollapsed()?(0,l.X)(r,this.ct)&&this.qt():this.yt(M.Composition);else{var a=t.data.split("\n"),u=r.toPosition(),c=u.zoneId,s=u.start,u=u.len,d=new o.I({zoneId:c}).retain(s).delete(u).insert(a[0],this.getInheritAttributes());try{for(var h=(0,i.c)(a.slice(1)),p=h.next();!p.done;p=h.next())var v=p.value,d=d.insertEnter().insert(v)}catch(t){e={error:t}}finally{try{p&&!p.done&&(n=h.return)&&n.call(h)}finally{if(e)throw e.error}}this._apply(d,{type:M.Composition}),this.gt(),this._mergeInputRecord()}f.Xh.isAndroid&&this.jt(),this.ut=-1,this.ct=null,this.editor.callAll("aceAfterCompositionEnd",{evt:t}),t.preventDefault()}},e.gt=function(){var t=this.editor.selection.getSelection().start,e=t.zoneId,t=t.line;this.editor.getContentState()._forceRefresh(e,[t],"input")},e.Et=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n={refresh:!1,overtype:!1,type:M.FlushInput});var r,i,s,a,l,u,c,d=this.editor;!t&&d.selection.getSelection().isCollapsed()||(i=(r=d.getContentState().getActiveZone()).getZoneId(),a=(c=(s=d.selection.getSelection()).toPosition()).start,u=l=c.len,c=s.start.line,(c=r.getLine(c))&&(d.getContentState()._clearInlineStyleOverride(s.toPosition()),(0<l||null!=c&&c.isEmpty())&&d.setStatus("dangerousInput",!0),0===l&&n.overtype&&(u=t.length),e=new o.I({zoneId:i}).retain(a).delete(u).insert(t,e),this._apply(e,{type:n.type}),this._mergeInputRecord()))},e.jt=function(t,e){(t=t||getSelection()||void 0)&&(t=this.editor.selection._toModelRange(t))&&!v.e.isRangeEqual(this.editor.selection.getSelection(),t)&&this.editor.selection.setSelection(t,e)},e._apply=function(t,e){return this.editor.getContentState().apply(t,e)},e.destroy=function(){this._flushInput()},(0,i.a)([u.W],t.prototype,"_handleMouseDown",null),(0,i.a)([u.W],t.prototype,"_handleContentChange",null),(0,i.a)([u.W],t.prototype,"_handleBeforeInput",null),(0,i.a)([u.W],t.prototype,"_handleInput",null),(0,i.a)([u.W],t.prototype,"_handleCompositionEvent",null),(0,i.a)([u.W],t.prototype,"_handleCompositionstart",null),t}())},945090:function(t,e,n){"use strict";var r,i,o,s;n.d(e,{A:function(){return r},U:function(){return i}}),(o=r=r||{})[o.EQUAL=0]="EQUAL",o[o.UNEQUAL=1]="UNEQUAL",o[o.UPDATE=2]="UPDATE",(s=i=i||{})[s.ZONE=0]="ZONE",s[s.LINE_UPDATE=1]="LINE_UPDATE",s[s.LINE_CONSTANT=2]="LINE_CONSTANT",s[s.LINE_INSERT=3]="LINE_INSERT",s[s.LINE_DELETE=4]="LINE_DELETE",s[s.LEAF_UPDATE=5]="LEAF_UPDATE",s[s.LEAF_CONSTANT=6]="LEAF_CONSTANT",s[s.LEAF_INSERT=7]="LEAF_INSERT",s[s.LEAF_DELETE=8]="LEAF_DELETE"},749249:function(t,e,n){"use strict";n.d(e,{M:function(){return C}});var r=n("194055"),i=n("931173"),o=n("464675"),s=n("639142"),a=n("332535"),l=n("195229"),u=n("261359"),c=n("481685"),d=n("734795");function f(t,e,n){if(void 0===n&&(n={}),!t)throw"object"==typeof n&&Object.keys(n).length&&(n=Object.entries(n).map(function(t){return(t=(0,r._)(t,2))[0]+": "+t[1]}).join(", ")),Error("Failed assertion: "+e)}var h=n("532439"),p=n("457341");function v(t){var e;throw null!==(e=t.e)&&void 0!==e?e:Error(t.message)}var g=function(){function t(){this.t=v,this.numToAttrib={},this.attribToNum={},this.nextNum=0,this.dirty=!1}var e=t.prototype;return e.putAttrib=function(t,e){var n=[String(t[0]||""),String(t[1]||"")],t=String(n);return t in this.attribToNum?this.attribToNum[t]:e?-1:(e=this.nextNum++,this.attribToNum[t]=e,this.numToAttrib[e]=n,this.dirty=!0,e)},e.getAttrib=function(t){return(t=this.numToAttrib[t])&&[t[0],t[1]]},e.updateAttrib=function(t,e){var n,r=this.getAttrib(t);r&&(n=String(r),r=String(e),null!=this.attribToNum[n]&&delete this.attribToNum[n],this.attribToNum[r]=t,this.numToAttrib[t]=e)},e.getAttribKey=function(t){return(t=this.numToAttrib[t])?t[0]:""},e.getAttribValue=function(t){return(t=this.numToAttrib[t])?t[1]:""},e.getAttribNum=function(t){return"string"!=typeof t&&(t=String(t)),this.attribToNum[t]},e.eachAttrib=function(t){for(var e in this.numToAttrib)this.numToAttrib.hasOwnProperty(e)&&t((e=this.numToAttrib[e])[0],e[1])},e.toJsonable=function(){var t,e,n={};for(t in this.numToAttrib)this.numToAttrib.hasOwnProperty(t)&&(e=this.numToAttrib[t],n[t]=[e[0],e[1]]);return{numToAttrib:n,nextNum:this.nextNum}},e.fromJsonable=function(t){for(var e in this.numToAttrib={},this.nextNum=t.nextNum,this.attribToNum={},t.numToAttrib){var n;t.numToAttrib.hasOwnProperty(e)&&(n=t.numToAttrib[e],this.attribToNum[String(n)]=Number(e),this.numToAttrib[e]=[n[0],n[1]])}try{this.checkConsistent()}catch(t){this.t({e:t,message:"[attribute-pool][fromJsonable] check consistent fail",level:d.WV.FATAL})}return this.dirty=!0,this},e.toJsonableNoCloning=function(){return{numToAttrib:this.numToAttrib,nextNum:this.nextNum}},e.fromJsonableNoCloning=function(t){for(var e in this.numToAttrib=t.numToAttrib,this.nextNum=t.nextNum,this.attribToNum={},this.numToAttrib)this.numToAttrib.hasOwnProperty(e)&&(this.attribToNum[String(this.numToAttrib[e])]=Number(e));try{this.checkConsistent()}catch(t){this.t({e:t,message:"[attribute-pool][fromJsonableNoCloning] check consistent fail",level:d.WV.FATAL})}return this},e.copy=function(){var e,n,r,i=new t;for(e in this.numToAttrib)this.numToAttrib.hasOwnProperty(e)&&(n=this.numToAttrib[e],i.numToAttrib[e]=[n[0],n[1]]);for(r in this.attribToNum)this.attribToNum.hasOwnProperty(r)&&(i.attribToNum[r]=this.attribToNum[r]);return i.nextNum=this.nextNum,i},e.checkConsistent=function(){for(var t=0;t<this.nextNum;t++)f(t in this.numToAttrib,"AttribPool: "+t+" is not in this.numToAttrib");var e,n,r,i={};for(e in this.numToAttrib)this.numToAttrib.hasOwnProperty(e)&&(f(0<=Number(e)&&Number(e)<this.nextNum,"AttribPool: "+e+" is not in range [0,"+this.nextNum+"]"),n=this.numToAttrib[e],f("[object Array]"===Object.prototype.toString.call(n),"AttribPool: attrib should be an array"),f(2===n.length,"AttribPool: attrib length should be 2"),f("string"==typeof n[0],"AttribPool: key should be string"),f("string"==typeof n[1],"AttribPool: value should be string"),f(!(String(n) in i),"AttribPool: attrib was already seen"),i[String(n)]=!0,f(this.attribToNum[String(n)]===Number(e),"AttribPool: attribToNum does not match"));for(r in this.attribToNum)this.attribToNum.hasOwnProperty(r)&&f(r in i,"AttribPool: attr was not seen")},e.setAttributes=function(t){var e=this,n=[];t instanceof c.D?t.forEach(function(t){t.forEach(function(t){t.attributes&&e.setAttributes(t.attributes)})}):t instanceof Array||(n=(0,h.L)(t)),n.forEach(function(t){return e.putAttrib(t)})},e.setOnErrorCb=function(t){this.t=t},e.resetOnErrorCb=function(){this.t=v},e.clear=function(){this.numToAttrib={},this.attribToNum={},this.nextNum=0,this.dirty=!1},(0,r.a)([p.W],t.prototype,"toJsonable",null),(0,r.a)([p.W],t.prototype,"fromJsonable",null),(0,r.a)([p.W],t.prototype,"checkConsistent",null),t}(),y=n("65476"),m=n("688148"),b=n("945090"),E=function(){function t(){this.runtimeStack=[]}var e=t.prototype;return Object.defineProperty(e,"atRuntime",{get:function(){return!!this.runtimeStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(e,"atDeepRuntime",{get:function(){return 1<this.runtimeStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(e,"currentRuntime",{get:function(){return this.runtimeStack[this.runtimeStack.length-1]},enumerable:!1,configurable:!0}),e.start=function(t,e){var n=(0,y.zs)(6);this.runtimeStack.push({id:n,type:t,options:e})},e.stop=function(){return this.runtimeStack.pop()},t}(),S=function(){function t(t){var e=this,n=t.deltaSet,r=t.schema,i=t.modulesContainer,o=t.rendererMode,t=t.contentStateFgMap;this.content=new Map,this.zt=function(){},this.Rt=u.S,this.Nt={},this._applyStackLog=[],this.rendererMode="DOM",this._getInternalZoneEntities=function(t,e,n){return[]},this.contentApplyRuntime=new E,this.schema=null!=r?r:new m.V({}),this._attributes=new g,this.modulesContainer=i,this.rendererMode=o||"DOM",this.Xt=t,null!=n&&n.forEach(function(t){var n=e.modulesContainer.get(l.h.ZoneState);e.content.set(t.zoneId,new n(t.zoneId,t,e.schema)),t.forEach(function(t){t.attributes&&e._attributes.setAttributes(t.attributes)})})}var e=t.prototype;return e.create=function(e){return new t(e)},e.getContent=function(){return this.content},e.setActiveZone=function(t){this.getZoneState(t)&&(this.Rt=t)},e.getActiveZone=function(){return this.getZoneState(this.Rt)},e[Symbol.iterator]=function(){return this.content.values()},e.getEntities=function(t,e){var n=[];if(t instanceof Array){var i=this.getZoneState(u.S);n.push.apply(n,(0,r.e)(i.getEntities(t,e,this._getInternalZoneEntities)))}else{t instanceof Function&&(e=t,t={start:{line:0,offset:0,zoneId:"0"},end:{line:o=(i=this.getZoneState(u.S)).length()-1,offset:i.getLine(o).length(),zoneId:"0"}});var o=t.start.zoneId,o=this.getZoneState(o);if(!o)return[];n.push.apply(n,(0,r.e)(o.getEntities(t,e,this._getInternalZoneEntities)))}return n},e.getContentStateFg=function(t){var e;return null!==(t=null===(e=this.Xt)||void 0===e?void 0:e[t])&&void 0!==t&&t},e.Gt=function(t){try{throw Error("invalid delta")}catch(t){}},e.apply=function(t,e){var n;if(void 0===e&&(e={}),!(this._applyStackLog.length<50))throw Error("Maximum call stack size exceeded");this._applyStackLog.push(Error().stack);try{var o=this.applyToContentState(t,e);return this.triggerChangeCbk((0,r.b)((0,r.b)({},o),{options:e}))}catch(t){return null!==(n=this._errorCbk)&&void 0!==n&&n.call(this,{message:"[contentState][apply] call applyToContentState error: "+t.message,level:i.W.ERROR}),this.contentApplyRuntime.stop()}finally{this._applyStackLog.length&&(this._applyStackLog=[])}},e.applyToContentState=function(t,e){var n,r,s=this;void 0===e&&(e={});try{this.Jt&&this.Jt({data:t,options:e})}catch(t){null!==(a=this._errorCbk)&&void 0!==a&&a.call(this,{message:"[contentState][apply] call willApplyCbk error: "+t.message,level:i.W.ERROR})}this.contentApplyRuntime.start(e.type||"editEvent",e);var a=(0,c.n)(t)?t:new c.D(((n={})[t.zoneId]=t,n)),t=this._clone(!1,a);if(a.forEach(function(t){t.forEach(function(t){"string"==typeof t.insert&&t.insert.includes(d.T6)&&s.Gt("invalid delta: insert a zero space")})}),e.isRemote||(a=(0,y.nF)(a)),!e.isRemote&&!1!==e.normalize)try{a=(0,y.qW)(this,this.schema,a)}catch(t){throw null!==(n=this._errorCbk)&&void 0!==n&&n.call(this,{message:"[contentState][apply] call normalizeDeltaSet error: "+t.message,level:i.W.ERROR}),t}if(this.Qt)try{a=this.Qt({current:this,next:this,deltaSet:a,options:e})}catch(t){null!==(r=this._errorCbk)&&void 0!==r&&r.call(this,{message:"[contentState][apply] call _willChangeCbk error: "+t.message,level:i.W.ERROR})}var l={},u={};try{a.forEach(function(t){var e=t.zoneId,n=s.getZoneState(e);if(n){var r=n.apply(t,function(t,n,r){var o={start:t,deletes:n,inserts:r};l[e]?l[e].push(o):l[e]=[o],(0,y.s7)(r)?s.Vt(e,t,n,r):null!==(n=s._errorCbk)&&void 0!==n&&n.call(s,{message:"[contentState][apply] 数据异常: "+r,level:i.W.FATAL})});if(s.content.set(e,r),"DOM"===s.rendererMode&&l[e])try{u[e]=s.Yt(l[e],r,n)}catch(t){u[e]={state:r,changes:null};null!==(r=s._errorCbk)&&void 0!==r&&r.call(s,{message:"[contentState][apply] model diff error "+((null==t?void 0:t.message)||""),level:i.W.ERROR,e:t})}t instanceof o.I&&s.ie(t)}else n=s.addZone(e,t),l[e]=[{start:0,deletes:[],inserts:n.lines}]})}catch(t){null!==(r=this._errorCbk)&&void 0!==r&&r.call(this,{message:"[contentState][apply] error "+((null==t?void 0:t.message)||""),level:i.W.FATAL,e:t})}return{changes:this.re(l),previous:t,deltaSet:a,diffResult:u}},e.triggerChangeCbk=function(t){var e=t.changes,n=t.previous,r=t.deltaSet,o=t.options,t=t.diffResult;try{this.zt&&this.zt({previous:n,current:this,deltaSet:r,changes:e,options:o,diffResult:t})}catch(e){null!==(t=this._errorCbk)&&void 0!==t&&t.call(this,{e:e,message:"[contentState][apply] call _changeCbk error: "+((null==e?void 0:e.message)||""),level:i.W.ERROR})}return this.contentApplyRuntime.stop()},e.Yt=function(t,e,n){var i,o,s=[],a=[],l=0,u=this;try{for(var c=(0,r.c)(t.entries()),d=c.next();!d.done;d=c.next()){var f=(0,r._)(d.value,2);!function(i,o){var c,d,f=o.deletes,h=o.inserts,p=o.start,v=f.reduce(function(t,e,n){return n=p-l+n,t.set(e.getKey(),[n,e]),t},new Map),g=p;try{for(var y=(N=void 0,(0,r.c)(h)),m=y.next();!m.done;m=y.next()){var E=m.value,S=E.getKey(),I=s.length?s[s.length-1]:null;if(v.has(S)){var C=v.get(S);if(!C)throw Error("The prevInsertedLine should not be empty.");var L=(0,r._)(C,2),w=L[0],x=L[1],_=u.se(E,x),g=x.index;if(v.delete(S),(null==I?void 0:I.type)===b.U.LINE_UPDATE){var T=I.retain,A=I.inserts,M=I.deletes;if(g===T+A.length){M.push(x),A.push({state:E,changes:_}),g++;continue}}s.push({originalStart:w,retain:g,deletes:[x],inserts:[{state:E,changes:_}],type:b.U.LINE_UPDATE}),g++}else{if((null==I?void 0:I.type)===b.U.LINE_INSERT&&g===(T=I.retain)+(A=I.inserts).length){A.push({state:E,changes:null}),g++;continue}s.push({retain:g,inserts:[{state:E,changes:null}],type:b.U.LINE_INSERT}),g++}}}catch(t){N={error:t}}finally{try{m&&!m.done&&(k=y.return)&&k.call(y)}finally{if(N)throw N.error}}var o=t[i+1],k=p+f.length-l,N=n.getLine(k),i=e.getLine(p+h.length);if(o){if(1<=o.start-p-f.length){if(!N)throw Error("The oldConstantLine should not be empty.");s.push({originalStart:k,retain:k,deletes:[N],inserts:[{state:i,changes:null}],type:b.U.LINE_CONSTANT})}}else N&&s.push({originalStart:k,retain:k,deletes:[N],inserts:[{state:i,changes:null}],type:b.U.LINE_CONSTANT});try{for(var R=(c=void 0,(0,r.c)(v.entries())),O=R.next();!O.done;O=R.next()){var D=(0,r._)(O.value,2),z=(0,r._)(D[1],2)[1],P=z.index,I=a.length?a[a.length-1]:null;if((null==I?void 0:I.type)===b.U.LINE_DELETE&&P===(T=I.retain)+(M=I.deletes).length){M.push(z);continue}a.push({originalStart:P,retain:P,deletes:[z],type:b.U.LINE_DELETE})}}catch(t){c={error:t}}finally{try{O&&!O.done&&(d=R.return)&&d.call(R)}finally{if(c)throw c.error}}l+=h.length-f.length}(f[0],f[1])}}catch(t){i={error:t}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(i)throw i.error}}return{state:e,changes:s=s.concat.apply(s,(0,r.e)(a))}},e.se=function(t,e){var n,i,o,s,t=t.leaves,a=e.leaves.reduce(function(t,e){return t.set(e.getKey(),e),t},new Map),l=0,u=0,c=[];try{for(var d=(0,r.c)(t),f=d.next();!f.done;f=d.next()){var h=f.value,p=h.getKey(),v=c.length?c[c.length-1]:null,g={state:h,changes:null};if(a.has(p)){var y=a.get(p);if(!y)throw Error("The reusedOldLeaf should not be empty.");var m=y.index<l,l=m?l:y.index,u=y.index;if(a.delete(p),y.op.insert!==h.op.insert){if((null==v?void 0:v.type)===b.U.LEAF_UPDATE&&(E=v.retain,S=v.inserts,I=v.deletes,u===E+S.length)){I.push(y),S.push(g),u++;continue}c.push({retain:u,deletes:[y],inserts:[g],type:b.U.LEAF_UPDATE,shouldMove:m}),u++}else{if((null==v?void 0:v.type)===b.U.LEAF_CONSTANT){var E=v.retain,S=v.inserts,I=v.deletes;if(u===E+S.length){I.push(y),S.push(g),u++;continue}}c.push({retain:u,deletes:[y],inserts:[g],type:b.U.LEAF_CONSTANT,shouldMove:m}),u++}}else{var C={state:h,changes:null};(null==v?void 0:v.type)!==b.U.LEAF_INSERT?(c.push({retain:u,inserts:[C],type:b.U.LEAF_INSERT}),u++):v.inserts.push(C)}}}catch(t){n={error:t}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}try{for(var L=(0,r.c)(a.entries()),w=L.next();!w.done;w=L.next()){var x=(0,r._)(w.value,2)[1],_=x.index;(null==(v=c.length?c[c.length-1]:null)?void 0:v.type)!==b.U.LEAF_DELETE||_!==v.retain+v.deletes.length?c.push({retain:_,deletes:[x],type:b.U.LEAF_DELETE}):v.deletes.push(x)}}catch(t){o={error:t}}finally{try{w&&!w.done&&(s=L.return)&&s.call(L)}finally{if(o)throw o.error}}return c},e.re=function(t){var e,n,i={};try{for(var o=(0,r.c)(Object.keys(t)),s=o.next();!s.done;s=o.next())!function(e){var n=t[e],r=0;i[e]=n.map(function(t){var e=t.start,n=t.deletes,t=t.inserts,e={start:e+r,deletes:n,inserts:t};return r+=n.length-t.length,e})}(s.value)}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return i},e.Vt=function(t,e,n,r){this.le&&this.le(t,e,n,r)},e._clone=function(t,e){var n,i,o=this,s=new Map;if(t||!e)try{for(var a=(0,r.c)(this.content),l=a.next();!l.done;l=a.next()){var u=(0,r._)(l.value,2),c=u[0],d=u[1];s.set(c,d.clone())}}catch(t){n={error:t}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}else s=new Map(this.content),e.forEach(function(t,e){var n=o.content.get(e);n&&s.set(e,n.clone())});return t=t?this._attributes.toJsonable():this._attributes,(t=this.create({apool:t,schema:this.schema,modulesContainer:this.modulesContainer})).content=s,t.zt=this.zt,t.Qt=this.Qt,t},e.onChange=function(t){this.zt=t},e.onWillChange=function(t){this.Qt=t},e._onMutate=function(t){this.le=t},e._onRefresh=function(t){this.oe=t},e._onError=function(t){this._errorCbk=t,this._attributes.setOnErrorCb(t)},e._onWillApply=function(t){this.Jt=t},e.getAttributes=function(t,e){var n=t.zoneId,n=this.getZoneState(n);return n?n.getAttributes(t,e):(0,y.vA)()},e.getLineAttributes=function(t,e){return(e=null===(t=this.getZoneState(t))||void 0===t?void 0:t.getLine(e))?e.getLineAttributes():(0,y.vA)()},e.getZoneState=function(t){return this.content.get(t)},e._dangerouslyReplaceAttribute=function(t,e,n,i){var o,s,a,l;try{for(var u=(0,r.c)(this),c=u.next();!c.done;c=u.next()){var d=c.value;try{for(var f=(a=void 0,(0,r.c)(d)),h=f.next();!h.done;h=f.next())h.value._getDelta().forEach(function(r){var o;(null===(o=r.attributes)||void 0===o?void 0:o[t])===e&&(delete r.attributes[t],r.attributes[n]=i)})}catch(t){a={error:t}}finally{try{h&&!h.done&&(l=f.return)&&l.call(f)}finally{if(a)throw a.error}}}}catch(t){o={error:t}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(o)throw o.error}}},e.setAttributes=function(t,e,n){void 0===n&&(n={internalZonesIncluded:!0});var s=t.start,a=s.zoneId,l=s.offset,u=s.line,d=t.end,s=d.zoneId,f=d.offset,d=d.line;if(a===s){var h=this.rangeToPosition(t);if(null!==h){if(l!==f||u!==d){if(0!==h.len){var p,v,g,y,m,b,E,S,I,C,L={},t=this.getEntities(t),w=(p=t,v=function(t){return t.start.zoneId},p.reduce(function(t,e){var n=v(e);return!t[n]&&(t[n]=[]),t[n].push(e),t},{}));for(C in w)if((n.internalZonesIncluded||a===C)&&w.hasOwnProperty(C)){var x=new o.I({zoneId:C}),_=w[C];C===a&&x.retain(h.start);try{for(var T=(b=void 0,(0,r.c)(_.entries())),A=T.next();!A.done;A=T.next()){var M,k,N,R=(0,r._)(A.value,2),O=R[0],D=R[1];(null===(I=D.attributes)||void 0===I||!I.lmkr||n.withLineMarker)&&("\n"!==D.text||n.withEnter)?(M=D.text.endsWith("\n")&&!n.withEnter?1:0,k=D.start.offset,N=D.end.offset,C===a&&(0===O&&(k=l),O===_.length-1&&0!==f&&(M=f===D.end.offset?M:0,N=f)),x.retain(N-k-M,e).retain(M)):x.retain(1)}}catch(t){b={error:t}}finally{try{A&&!A.done&&(E=T.return)&&E.call(T)}finally{if(b)throw b.error}}L[C]=x}return t=new c.D(L),this.apply(t,(0,r.b)({type:"setAttributes"},n))}try{for(var z=(0,r.c)(Object.entries(e)),P=z.next();!P.done;P=z.next()){var Z=(0,r._)(P.value,2),W=Z[0],K=Z[1];this._setInlineStyleOverride(h,W,K)}}catch(t){y={error:t}}finally{try{P&&!P.done&&(m=z.return)&&m.call(z)}finally{if(y)throw y.error}}}else try{for(var U=(0,r.c)(Object.keys(e)),F=U.next();!F.done;F=U.next()){var B=F.value;this._setInlineStyleOverride(h,B,e[B])}}catch(t){S={error:t}}finally{try{F&&!F.done&&(g=U.return)&&g.call(U)}finally{if(S)throw S.error}}}}else null!==(S=this._errorCbk)&&void 0!==S&&S.call(this,{message:"[ContentState][setAttributes] start zoneId: "+a+" not equal to end zoneId: "+s,level:i.W.ERROR})},e.setLineAttributes=function(t,e,n,i){void 0===i&&(i={});var s=null===(s=this.content.get(t))||void 0===s?void 0:s.getLine(e);if(s&&null!==(e=this.rangePointToOffset({line:e,offset:0,zoneId:t})))return(t=new o.I({zoneId:t})).retain(e),s.hasLineMarker()?t.retain(1,n):t.insertLineMarker(n),this.apply(t,(0,r.b)({type:"setLineAttributes"},i))},e.hasLineMarker=function(t){var e=t.line,t=t.zoneId;return!(null===(e=null===(t=this.content.get(t))||void 0===t?void 0:t.getLine(e))||void 0===e||!e.hasLineMarker())},e.isLineStart=function(t){return this.hasLineMarker(t)?1===t.offset:0===t.offset},e.deleteText=function(t,e){void 0===e&&(e={});var n=this.rangeToPosition(t);if(null!==n){var i=n.start,s=n.len,a=n.zoneId,t=this.getZoneState(a);if(t)return n=t.getContent().length(),t=s,n-1<=i+s&&(t=n-i-1),t=new o.I({zoneId:a}).retain(i).delete(t),this.apply(t,(0,r.b)({type:"deleteText"},e))}},e.getInsertTextDelta=function(t,e,n,r){return void 0===r&&(r={}),new o.I({zoneId:t.zoneId}).retain(e).insert(n,r)},e.insertText=function(t,e,n,i){void 0===n&&(n={}),void 0===i&&(i={});var o=this.rangePointToOffset(t);if(null!==o)return n=this.getInsertTextDelta(t,o,e,n),this.apply(n,(0,r.b)({type:"insertText"},i))},e.getReplaceTextDelta=function(t){var e=t.pos,n=t.text,r=t.attributes,i=e.start,t=e.len,e=e.zoneId;return new o.I({zoneId:e}).retain(i).delete(t).insert(n,r)},e.replaceText=function(t,e,n,i){void 0===n&&(n={}),void 0===i&&(i={});var o=this.rangeToPosition(t);if(null!==o)return n=this.getReplaceTextDelta({sel:t,pos:o,text:e,attributes:n}),this.apply(n,(0,r.b)({type:"replaceText"},i))},e.rangeToPosition=function(t){var e=t.start,n=t.end,t=this.rangePointToOffset(e),n=this.rangePointToOffset(n);return null===t||null===n?null:{start:t,len:n-t,zoneId:e.zoneId}},e.rangePointToOffset=function(t){var e=t.zoneId,n=t.line,t=t.offset,e=this.getZoneState(e);return e?e.pointToOffset({line:n,offset:t}):null},e.setInlineStyleOverride=function(t,e,n){this._setInlineStyleOverride(t,e,n)},e._setInlineStyleOverride=function(t,e,n){var r=t.zoneId,t=t.start,r=this.Nt[r]=this.Nt[r]||{};r[t]=r[t]||{},r[t][e]=n},e.getInlineStyleOverride=function(t,e){if(t){var n=t.zoneId,r=t.start;return e?null===(t=null===(t=this.Nt[n])||void 0===t?void 0:t[r])||void 0===t?void 0:t[e]:(null===(n=this.Nt[n])||void 0===n?void 0:n[r])||{}}return this.Nt},e.clearInlineStyleOverride=function(t){this._clearInlineStyleOverride(t)},e._clearInlineStyleOverride=function(t){var e;t?(e=t.zoneId,t=t.start,this.Nt[e]&&delete this.Nt[e][t]):this.Nt={}},e.ie=function(t){var e,n,i,o,s,a,l,u,c,d,f=this.getInlineStyleOverride()[t.zoneId];if(f){var h=0;try{for(var p=(0,r.c)(t.ops),v=p.next();!v.done;v=p.next()){var g=v.value;if(h+=null!==(d=null!==(u=null!==(l=g.retain)&&void 0!==l?l:g.delete)&&void 0!==u?u:null===(c=g.insert)||void 0===c?void 0:c.length)&&void 0!==d?d:0,g.delete)try{for(var y=(i=void 0,(0,r.c)(Object.keys(f))),m=y.next();!m.done;m=y.next()){var b=m.value;(C=Number(b))<=h&&h-g.delete<C&&delete f[b]}}catch(t){i={error:t}}finally{try{m&&!m.done&&(o=y.return)&&o.call(y)}finally{if(i)throw i.error}}}}catch(t){e={error:t}}finally{try{v&&!v.done&&(n=p.return)&&n.call(p)}finally{if(e)throw e.error}}try{for(var E=(0,r.c)(Object.entries(f)),S=E.next();!S.done;S=E.next()){var I=(0,r._)(S.value,2),C=I[0],L=I[1],w=t.transform(Number(C));w!==Number(C)&&(f[w]=L,delete f[C])}}catch(t){s={error:t}}finally{try{S&&!S.done&&(a=E.return)&&a.call(E)}finally{if(s)throw s.error}}}},e._forceRefresh=function(t,e,n,r){void 0===r&&(r=!0);var i=this.getZoneState(t);if(i){for(var o=i.clone(),s=0;s<e.length;s++){var a=e[s],l=o.getLine(a),u=l.clone();r&&u._refreshKey(),l._node&&(u._node=l._node.cloneNode(!0)),o._splice(a,1,[u])}this.content.set(t,o),this.oe&&this.oe({zoneId:t,lineArr:e,from:n,prevZoneState:i})}},e.toDeltaSet=function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);var n,i,o=new c.D;try{for(var s=(0,r.c)(this.content.entries()),a=s.next();!a.done;a=s.next()){var l=(0,r._)(a.value,2),u=l[0],d=l[1];o.add(u,d.getContent(t,e))}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return o},e.isEmpty=function(){var t=this.getZoneState(u.S);return!t||!(1<t.length())&&t.getLine(0).isEmpty()},e.setContent=function(t,e){void 0===e&&(e={});var n,i=new c.D,o=t instanceof c.D?t:new c.D(((n={})[t.zoneId]=t,n));this.getContent().forEach(function(t,e){var n=t.getType()===s.Ak.Content,a=(0,c.C)({zoneId:e,zoneType:t.getType()});a.delete(t.getModelText().length-(n?1:0));var l,t=a,a=(t=o.get(e)?a.concat(o.get(e)):t).ops.length-1;n&&null!==(l=t.ops[a])&&void 0!==l&&l.insert&&(l=t.ops[a].insert).endsWith("\n")&&(a=t.ops.pop(),(l=l.slice(0,-1))&&t.insert(l,(0,r.b)({},null==a?void 0:a.attributes))),i.add(e,t)}),o.forEach(function(t){i.get(t.zoneId)||i.add(t.zoneId,t)}),this.apply(i,e)},e.clear=function(){this._attributes.clear(),this._clearInlineStyleOverride()},e._clearListener=function(){this.zt=function(){},this._errorCbk=void 0,this.Jt=void 0,this.Qt=void 0,this.oe=void 0,this.le=void 0,this._attributes.resetOnErrorCb()},t}(),I=function(){function t(t){this.ii=new Map,this.ni=new Map,this.ei=new Map,this.zoneAttrs=[],this.zoneRules=new Map,this.ri=t,this.registerZoneRule("zoneId",function(t){return[t]})}var e=t.prototype;return e.registerScrollModule=function(t,e){this.ei.set(t,e)},e.getAllScrollModules=function(){return(0,r.e)(this.ei.values())},e.getScrollModuleByZoneId=function(t){return this.ei.get(t)},e.removeScrollModule=function(t){this.ei.delete(t)},Object.defineProperty(e,"zoneIdMap",{get:function(){return this.ni},enumerable:!1,configurable:!0}),Object.defineProperty(e,"lineToZoneMap",{get:function(){return this.ii},enumerable:!1,configurable:!0}),e.init=function(){var t=this;this.ri.getEntities(function(e){return t.zoneAttrs.includes(e)}).forEach(function(e){var n=e.start,r=e.attributes,i=null===(e=t.ri.getZoneState(n.zoneId))||void 0===e?void 0:e.getLine(n.line);t.zoneAttrs.forEach(function(e){var n;!r[e]||(n=t.zoneRules.get(e))&&i&&n(r[e]).forEach(function(e){t.update(e,i)})})})},e.registerZoneRule=function(t,e){this.zoneRules.set(t,e),this.zoneAttrs.push(t)},e.update=function(t,e){var n=this.ni.get(t);!n||n===e||(r=this.ii.get(n))&&delete r[t];var r=this.ii.get(e)||{};r[t]=!0,this.ii.set(e,r),this.ni.set(t,e),(t=this.ri.getZoneState(t))&&t._setParent(e)},e.removeZoneId=function(t){var e,n=this.ni.get(t);!n||(e=this.ii.get(n))&&(delete e[t],Object.keys(e).length||this.ii.delete(n)),this.ni.delete(t)},e.removeLineState=function(t){var e=this,t=this.ii.get(t);t&&Object.keys(t).forEach(function(t){e.ni.delete(t)})},e.updateLineState=function(t,e){var n=this,r=this.ii.get(t);r&&(this.ii.delete(t),this.ii.set(e,r),Object.keys(r).forEach(function(t){(t=n.ri.getZoneState(t))&&t._setParent(e)}))},e.getZoneIdsByAttributes=function(t){for(var e=0;e<t.length;e++){var n=t[e],i=(0,r._)(n,2),n=i[0],i=i[1],n=this.zoneRules.get(n);if(n)return n(i)}return[]},e._detectZoneChange=function(t,e){var n=this;void 0===e&&(e=!1);var i,o,s=[];for(a in t)t.hasOwnProperty(a)&&(o=t[a],(i=this.ni.get(a))&&a!==u.S&&this.update(a,i),o.forEach(function(t){t.inserts.forEach(function(t){var e,i=(e=(e=t).getAttributes(),n.getZoneIdsByAttributes(e));s.push.apply(s,(0,r.e)(i)),i.forEach(function(e){n.update(e,t)})})}));if(!e)for(var a in t)t.hasOwnProperty(a)&&(o=t[a]).forEach(function(t){t.deletes.forEach(function(t){(t=n.ii.get(t))&&Object.keys(t).forEach(function(t){n.removeZoneId(t)})})})},e.getAncestorZones=function(t){for(var e,n=[t],r=t;r;)(r=null===(e=this.ni.get(r))||void 0===e?void 0:e.getZoneId())&&n.push(r);return n},e.getMatchedAncestorLine=function(t,e){var n;if(t!==e){for(var r,i=t;i;){var o=this.ni.get(i),i=null===(n=this.ni.get(i))||void 0===n?void 0:n.getZoneId();if(o&&o.getZoneId()===e){r=o;break}}return r}},t}(),C=function(t){function e(e){var n=t.call(this,e)||this;return n._getInternalZoneEntities=function(t,e,i){void 0===e&&(e=[]);var o=[];return n._zoneManager.getZoneIdsByAttributes(t).reduce(function(t,o){return t.push.apply(t,(0,r.e)(n._getZoneStateEntities(o,e,i))),t},o),o},n._getZoneStateEntities=function(t,e,i){var s=n.getZoneState(t),a=[];return s||(s=new o.I({zoneId:t}).insertEnter(),s=new(n.modulesContainer.get(l.h.ZoneState))(t,s,n.schema)),a.push.apply(a,(0,r.e)(s.getEntities(e,i))),a},n._zoneManager=new I(n),n}(0,r.d)(e,t);var n=e.prototype;return n.init=function(){this._zoneManager.init()},n.create=function(t){return new e(t)},n.getZoneManager=function(){return this._zoneManager},n._clone=function(e,n){return(n=t.prototype._clone.call(this,e,n))._zoneManager.zoneAttrs=Array.from(this._zoneManager.zoneAttrs),n._zoneManager.zoneRules=new Map(this._zoneManager.zoneRules),n},n.addZone=function(t,e,n){var r;return this.content.get(t)?(null!==(r=this._errorCbk)&&void 0!==r&&r.call(this,{message:"[ContentState][addZone] zoneId:"+t+" existed",level:i.W.ERROR}),null):(e=e||new o.I({zoneId:t}).insertEnter(),e=new(this.modulesContainer.get(l.h.ZoneState))(e.zoneId,e,this.schema),this.content.set(t,e),n&&this._zoneManager.update(t,n),e)},n.removeZone=function(t){this._zoneManager.removeZoneId(t);var e=this.getZoneState(t);e&&(e=new o.I({zoneId:t}).delete(e.totalWidth()-1),this.apply(e),this.content.delete(t))},n.apply=function(t,e){var n=this.applyToContentState(t,e=void 0===e?{}:e),t=!(null===(t=e.extra)||void 0===t||!t.initContent);return this._zoneManager._detectZoneChange(n.changes,t),this.triggerChangeCbk((0,r.b)((0,r.b)({},n),{options:e}))},n.slice=function(t,n){var o,s=this,a=t.zoneId,l=n.zoneId;if(a!==l)return null!==(o=this._errorCbk)&&void 0!==o&&o.call(this,{message:"[contentState][slice] start zoneId: "+a+" not equal to end zoneId: "+l,level:i.W.ERROR}),null;if(!(l=this.content.get(a)))return null;var u=new e({apool:this._attributes.toJsonable(),schema:this.schema,modulesContainer:this.modulesContainer}),n=l.slice(t,n);return u.content.set(a,n),"0"===a&&n.getEntities([["aceTable",void 0]]).forEach(function(t){var e=(0,r._)(t.attributes.aceTable.split(" "),2),t=e[0],e=e[1];u.content.set(t,s.getZoneState(t)),u.content.set(e,s.getZoneState(e));var t=s._getRowColIds(t,e),e=t.rowIds,n=t.colIds;e.forEach(function(t){n.forEach(function(e){e="x"+t+"x"+e,u.content.set(e,s.getZoneState(e))})})}),u._zoneManager.init(),u},n.getReplaceTextDelta=function(t){var e=t.sel,n=t.pos,r=t.text,i=t.attributes,s=n.start,t=n.len,n=n.zoneId,t=new o.I({zoneId:n}).retain(s).delete(t);return this.assertPointAfterLineMarker(e.start),this.addLineMarkerAfterEnter({text:r,attributes:i,delta:t}),t},n.getInsertTextDelta=function(t,e,n,r){return void 0===r&&(r={}),e=new o.I({zoneId:t.zoneId}).retain(e),this.assertPointAfterLineMarker(t),this.addLineMarkerAfterEnter({text:n,attributes:r,delta:e}),e},n.addLineMarkerAfterEnter=function(t){var e=t.text,n=t.attributes,r=t.delta,i=e.split(s.K5);return i.forEach(function(t,e){i[e+1]?r.insert(t,n).insertEnter(n).insertLineMarker(n):r.insert(t,n)}),r},n.assertPointAfterLineMarker=function(t){if(this.hasLineMarker(t)&&0===t.offset)throw Error("Cannot insertText at the offset 0 of line, because there is a lineMarker")},n._getRowColIds=function(t,e){var n,i,o,s,t=this.getZoneState(t),e=this.getZoneState(e);if(!t||!e)return{rowIds:[],colIds:[]};var t=t.getLine(0),e=e.getLine(0),l=[],u=[];if(!t||!e)return{rowIds:l,colIds:u};try{for(var c=(0,r.c)(t),d=c.next();!d.done;d=c.next()){var f=d.value;(v=(0,a.Jg)(f))&&l.push(v)}}catch(t){n={error:t}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}try{for(var h=(0,r.c)(e),p=h.next();!p.done;p=h.next()){var v,f=p.value;(v=(0,a.Jg)(f))&&u.push(v)}}catch(t){o={error:t}}finally{try{p&&!p.done&&(s=h.return)&&s.call(h)}finally{if(o)throw o.error}}return{rowIds:l,colIds:u}},e}(S)},809721:function(t,e,n){"use strict";n.d(e,{V:function(){return p}});var r=n("194055"),i=n("532439"),o=n("167935"),s=n("471917"),a=n("481685"),l=n("639142"),u=n("734795");n("294484");var c=n("257305"),d=n("65476"),f=n("945090"),h=function(){function t(t,e){this.parent=null,this._node=null,this.instance=null,this.reactInXInstanceList=[],this.offset=0,this._keyTimes=0,this.ti="",this.op=t,this.parent=e}var e=t.prototype;return e.getKey=function(){var t=this.op.attributes;return(t?JSON.stringify((0,s.y)(t)):JSON.stringify({}))+this._keyTimes},e.getCustomKey=function(){return this.ti},e.setKeyTimes=function(t){this._keyTimes=t},e.setCustomKey=function(t){this.ti=t},e.getState=function(){return this.op},e.getViewContent=function(){return{op:this.op,index:this.index,offset:this.offset}},e.getContainer=function(){return this._node},e.getNode=function(){return this._node},e.setNode=function(t){this._node=t},t}(),p=function(){function t(t,e,n){var s,l=this;this.key="",this.parent=null,this._node=null,this._keepKey=!1,this._invisible=!1,this.ve=0,this._offsetStart=0,this._offsetEnd=0,this._e="",this.fe=0,this.je="",this.ye=0,this.leaves=[],this.de=t,n||(this.parent=e,this.me(),this._e=e.getZoneId(),this.je=this.de.ops.map(function(t){return(0,a.d)(t)?t.insert:" "}).join(""),this.fe=this.je.length,e=(0,d.vA)(),this.hasLineMarker()&&(this.ye=1,e.push.apply(e,(0,r.e)((0,i.L)(this._getOps()[0].attributes)))),this.Ee=e,this.Ee.toMap=function(){return s=s||(0,o.A)(l.Ee),(0,r.b)({},s)},this.key=(0,d.zs)(6))}var e=t.prototype;return e.me=function(){var t=this.normalizeOps();if(t){this.handleDisplayEnter(t);for(var e=0,n=new Map,r=0;r<t.length;++r){var i=t[r],o=i.attributes,a=o?JSON.stringify((0,s.y)(o)):JSON.stringify({});n.has(a)?n.set(a,n.get(a)+1):n.set(a,0),o=n.get(a),a+=o,(a=new h(i,this)).setKeyTimes(o),a.index=r,a.offset=e,e+=i.insert.length,this.leaves.push(a)}}},e.getLinefeedLeaf=function(){for(var t,e=null,n=this.leaves.length-1;0<=n;--n){var r=this.leaves[n];if(null!==(t=r.op.attributes)&&void 0!==t&&t.enter){e=r;break}}return e},e.normalizeOps=function(t){var e;return(t=void 0===t?(null===(e=this.de)||void 0===e?void 0:e.ops)||[]:t).reduce(function(t,e){var n,i=e.insert,o=e.attributes;return"string"==typeof i&&i.includes("\n")&&1<i.length?(n=i.split("\n")).forEach(function(i,o){i&&(t.push((0,r.b)((0,r.b)({},e),{insert:i})),o!==n.length-1&&t.push({attributes:(0,r.b)((0,r.b)({},null==e?void 0:e.attributes),{enter:"true"}),insert:u.Ed}))}):"\n"===i?t.push({attributes:(0,r.b)((0,r.b)({},null==e?void 0:e.attributes),{enter:"true"}),insert:u.Ed}):null!=o&&o.lmkr||t.push(e),t},[])},e.handleDisplayEnter=function(t){var e,n=this.schema;n&&(e=!0,(0,c.Z)(n)&&(e=!t.some(function(t){return!(0,c.t)(t.attributes,n)})),t=t[t.length-1],e||t.insert!==u.Ed||(t.attributes=(0,r.b)((0,r.b)({},null!==(t=t.attributes)&&void 0!==t?t:{}),{displayEnter:"false"})))},Object.defineProperty(e,"index",{get:function(){return this.ve},enumerable:!1,configurable:!0}),Object.defineProperty(e,"schema",{get:function(){var t;return null===(t=this.parent)||void 0===t?void 0:t.schema},enumerable:!1,configurable:!0}),e.getItemByIndex=function(t){return this.leaves[t]||null},e.isInvisible=function(){return this._invisible},e.isEndOfLine=function(t){return this.fe===t+1},e.compose=function(e){return(e=new t(this.de.compose(e,!1),this.parent)).ve=this.ve,e},e.clone=function(){var e=new t(null,null,!0);return e.de=this.de,e._e=this._e,e.je=this.je,e.fe=this.fe,e.ye=this.ye,e.Ee=this.Ee,e.key=this.key,e._offsetStart=this._offsetStart,e._offsetEnd=this._offsetEnd,e.ve=this.ve,e.parent=this.parent,e.instance=this.instance,e.leaves=this.leaves,e.setNode(this._node),e},e.slice=function(e,n){var r=[],i=0;return this.de.forEach(function(t){var o,s,l;null!=t&&t.insert&&"object"!=typeof t.insert&&(o=(0,a.a)(t),i<=n&&e<=i+o&&(s=Math.max(0,e-i))<(l=Math.min(o,n-i))&&r.push({insert:null==t?void 0:t.insert.slice(s,l),attributes:t.attributes}),i+=o)}),new t(this.de.create({ops:r}),this.parent)},e.getZoneId=function(){return this._e},e.getKey=function(){return this.key},e.getNode=function(){return this._node},e.getText=function(){var t=this.de.ops.map(function(t){return(0,a.d)(t)?t.insert:"*"}).join("");return this.hasLineMarker()?t.slice(1):t},e.getLineMarker=function(){return this.ye},e.getModelText=function(){return this.je},e.length=function(){return this.fe},e.getOps=function(){return this._getOps()},e.getContent=function(){return this.de},e.getContainer=function(){return this._node},e.getViewContent=function(){return this.getOps()},e.getState=function(){return this.leaves},e._getDelta=function(){return this.de},e._getOps=function(){return this.de.ops},e._setKey=function(t){this.key=t},e.setNode=function(t){this._node=t},e._setIndex=function(t){this.ve=t},e._setOffset=function(t,e){this._offsetStart=t,this._offsetEnd=e},e._refreshKey=function(){this.key=(0,d.zs)(6)},e.getAttributes=function(t,e){void 0===t&&(t=0),void 0===e&&(e=this.getModelText().length);var n,i,o,s,a=0,l=(0,d.vA)();try{for(var u=(0,r.c)(this),c=u.next();!c.done;c=u.next()){var f=c.value;if(null!=f&&f.insert&&"object"!=typeof f.insert){var h=f.insert.length,p=f.attributes;if(a+h<=t||e<=a||!p)a+=h;else{try{for(var v=(o=void 0,(0,r.c)(Object.entries(p))),g=v.next();!g.done;g=v.next()){var y=(0,r._)(g.value,2),m=y[0],b=y[1];l.push([m,b])}}catch(t){o={error:t}}finally{try{g&&!g.done&&(s=v.return)&&s.call(v)}finally{if(o)throw o.error}}a+=h}}}}catch(t){n={error:t}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}return l},e.getEntities=function(t,e,n){var r,i=0,o=this.length();return t instanceof Array?r=t:(i=t.start,(o=t.end)===i&&0<o&&i--),this._getEntities({attributes:r,start:i,end:o,matcher:e,getInternalZoneEntities:n})},e._getEntities=function(t){var e,n,i,o,s,a,l,u,c=t.attributes,d=t.start,f=t.end,h=t.allMatch,p=void 0!==h&&h,v=t.matcher,g=t.getInternalZoneEntities,y=[],m=0,b=this.ve;try{for(var E=(0,r.c)(this),S=E.next();!S.done;S=E.next()){var I=S.value;if(I.insert&&"object"!=typeof I.insert){var C=I.insert.length;if(m+C<=d||f<=m)m+=C;else{var L=!1,w=!0,x=I.attributes;if(x&&Object.keys(x).length||(x={},w=!1),v)try{for(var _=(i=void 0,(0,r.c)(Object.entries(x))),T=_.next();!T.done;T=_.next()){var A=(0,r._)(T.value,2);v(R=A[0],O=A[1])?L=!0:w=!1}}catch(t){i={error:t}}finally{try{T&&!T.done&&(o=_.return)&&o.call(_)}finally{if(i)throw i.error}}else if(null!=c&&c.length)try{for(var M=(s=void 0,(0,r.c)(Object.entries(x))),k=M.next();!k.done;k=M.next()){var N=(0,r._)(k.value,2),R=N[0],O=N[1];try{for(var D=(l=void 0,(0,r.c)(c)),z=D.next();!z.done;z=D.next()){var P=z.value,Z=void 0!==P[1];P[0]!==R||Z&&String(P[1])!==String(O)?w=!1:L=!0}}catch(t){l={error:t}}finally{try{z&&!z.done&&(u=D.return)&&u.call(D)}finally{if(l)throw l.error}}}}catch(t){s={error:t}}finally{try{k&&!k.done&&(a=M.return)&&a.call(M)}finally{if(s)throw s.error}}else w=!0;(L&&!p||w)&&y.push({start:{line:b,offset:Math.max(m,d),zoneId:this._e},end:{line:b,offset:Math.min(m+C,f),zoneId:this._e},text:I.insert.slice(Math.max(d-m,0),f-m),attributes:x}),m+=C;var W=null==g?void 0:g(Object.entries(x),c,v);W&&y.push.apply(y,(0,r.e)(W))}}}}catch(t){e={error:t}}finally{try{S&&!S.done&&(n=E.return)&&n.call(E)}finally{if(e)throw e.error}}return y},e.getLineAttributes=function(){return this.Ee},e.getOffset=function(){return{start:this._offsetStart,end:this._offsetEnd}},e.forEach=function(t){return this._getOps().forEach(t)},e[Symbol.iterator]=function(){return this._getOps().values()},e.hasLineMarker=function(){var t;return!(null===(t=null===(t=this._getOps()[0])||void 0===t?void 0:t.attributes)||void 0===t||!t.lmkr)},e.isEmpty=function(){var t=this.hasLineMarker(),e=this.length();return e-(t?1:0)==1&&this.Ee.length<=1&&this.getText()===l.K5||1===e&&t&&1===this.Ee.length||0===e},e.isTextEmpty=function(){var t=this.hasLineMarker()?1:0;return this.length()-t==1||0===this.length()},e.previousSibling=function(){return this.parent.getLine(this.ve-1)},e.nextSibling=function(){return this.parent.getLine(this.ve+1)},e.compare=function(e){if(e===this)return t.EQAUL;if(e&&e.getKey()===this.getKey()){for(var n=this.getOps(),r=e.getOps(),i=0,o=r.length;i<o;i++)if(r[i]!==n[i])return t.UPDATE;return t.EQAUL}return t.UNEQUAL},t.EQAUL=f.A.EQUAL,t.UNEQUAL=f.A.UNEQUAL,t.UPDATE=f.A.UPDATE,t}()},65476:function(t,e,n){"use strict";n.d(e,{EG:function(){return S},ky:function(){return E},nF:function(){return T},qF:function(){return L},qW:function(){return x},s7:function(){return _},vA:function(){return p},zs:function(){return v}});var r,i=n(194055),o=n(167935),s=n(332535),a=n(481685),l=n(639142),u=n(464675),c=n(852158),d=n(495907),f,h="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function p(){var t=[];return t.toMap=function(){return(0,o.A)(this)},t}function v(t){void 0===t&&(t=20);for(var e="",n=0;n<t;n++){var r=Math.floor(Math.random()*h.length);e+=h[r]}return e}function g(t,e,n){var e=t.offsetToPoint(e),r=e.line,i=e.offset,n=t.offsetToPoint(n),o=n.line,s=n.offset,a="";if(r===o)return t.getLine(r).getModelText().slice(i,s);for(var l=r;l<=o;l++){var u=t.getLine(l).getModelText();a+=l===r?u.slice(i):l===o?u.slice(0,s):u}return a}function y(t,e,n){return e=t.offsetToPoint(e),n=t.offsetToPoint(n),t.getEntities({start:e,end:n})}(r=f=f||{})[r.BLOCK=0]="BLOCK",r[r.LMKR=1]="LMKR",r[r.TEXT=2]="TEXT";var m=function(t,e){return E(t.attributes,e)?f.BLOCK:(0,s.eV)(t)?f.LMKR:f.TEXT},b=[[c.cI,c.cI,function(t,e){return!e.startsWith("\n")}],[c.ar,c.cI,c.ar],[function(t){return!t.endsWith("\n")},function(t){return!t.endsWith("\n")},c.ar]];function E(t,e){return void 0===t&&(t={}),Object.keys(t).some(function(n){var r=null===(r=e.get(n))||void 0===r?void 0:r.display;return"string"==typeof r?r===d.v.block:"function"==typeof r&&r(t[n])===d.v.block})}function S(t,e,n,r){if(r instanceof RegExp){if(t.match(r))return!0}else if(r(t,e,n))return!0;return!1}function I(t,e,n,r){var i=Object.keys(t).reduce(function(i,o){return o===e||S(o,t[o],n,r)?i[o]=t[o]:i[o]="",i},{});return t.lmkr&&(i.lmkr=t.lmkr),i}function C(t,e){var n=(0,i.b)({},t);return Object.keys(t).forEach(function(r){t[r]&&!e[r]&&delete n[r]}),n}function L(t,e){if(e)return Object.keys(e).filter(function(t){return e[t]}).find(function(e){var n;return(null===(n=t.get(e))||void 0===n?void 0:n.attributes)||(null===(e=t.get(e))||void 0===e?void 0:e.lineAttributes)})}function w(t,e,n){if(e>=t.ops.length)throw Error("getOpOffsetInDocumentWithCache index overstep");for(var r=e,i=0;0<=r;){if(n.has(r)){i+=n.get(r);break}var o=t.ops[r];(0,a.f)(o)!==l.HP.INSERT&&(i+=(0,a.a)(o)),r--}return i}function x(t,e,n){var r,o,s,c;return s=t,c=e,(r=t,o=e,n.reduce(function(t,e){if(!(e instanceof u.I))return t.concat(e);var n=r.getZoneState(e.zoneId);if(!n&&e.ops.some(function(t){return!t.insert}))throw Error("attempt to apply new ZoneDelta which is invalid");var s=!1,c=e.reduce(function(t,r,u){var c=(0,a.f)(r);return c===l.HP.DELETE?(t.push(r),t):c===l.HP.RETAIN?(s=!1,function(t,e,n,r,o){var s,u=t.ops[n];if(!u.attributes||!E(u.attributes,o))return!1;if(!(e=(s=e).ops[s.ops.length-1]))return!1;if((0,a.f)(e)===l.HP.INSERT)return!e.insert.endsWith("\n");for(var c=t.ops.slice(0,n).filter(function(t){return(0,a.f)(t)!==l.HP.INSERT});c[c.length-1]&&(0,a.f)(c[c.length-1])===l.HP.DELETE;)c.pop();return 0!==c.length&&"\n"!==g(r,(n=c.reduce(function(t,e){return t+(0,a.a)(e)},0))-1,n)&&!(0,i._)(y(r,n-1,n),1)[0].attributes.lmkr}(e,t,u,n,o)&&t.insertEnter(),t.push(r),function t(e,n,r,o,s){var u=e.ops[n],c=e.ops[r];if(!u.attributes||!E(u.attributes,s))return function(t,e,n,r){for(var o=!1,s=e+1;s<t.ops.length;){var u=(0,a.f)(t.ops[s]);if(u===l.HP.INSERT)return!1;if(u===l.HP.RETAIN)break;u===l.HP.DELETE&&(o=!0),s++}if(!o)return!1;var c=t.ops.slice(0,e+1).filter(function(t){return(0,a.f)(t)!==l.HP.INSERT}).reduce(function(t,e){return(0,a.a)(e)+t},0),d=(0,i._)(y(n,c-1,c),1)[0],f=E(d.attributes,r),h=t.ops.slice(0,s).filter(function(t){return(0,a.f)(t)!==l.HP.INSERT}).reduce(function(t,e){return(0,a.a)(e)+t},0),e=(0,i._)(y(n,h,h+1),1)[0],r=E(e.attributes,r);return f?!g(n,h,h+1).startsWith("\n"):r?!d.attributes.lmkr&&!g(n,c-1,c).endsWith("\n"):!(!d.attributes.lmkr||!e.attributes.lmkr)}(e,n,o,s);if(!c)return"\n"!==g(o,d=e.ops.filter(function(t){return(0,a.f)(t)!==l.HP.INSERT}).reduce(function(t,e){return t+(0,a.a)(e)},0),d+1);if((u=(0,a.f)(c))!==l.HP.INSERT)return u!==l.HP.RETAIN?t(e,n,r+1,o,s):"\n"!==g(o,d=e.ops.slice(0,r).filter(function(t){return(0,a.f)(t)!==l.HP.INSERT}).reduce(function(t,e){return t+(0,a.a)(e)},0),d+1);var d,c=c.insert.startsWith("\n"),n=e.ops.slice(0,n+1).filter(function(t){return(0,a.f)(t)!==l.HP.INSERT}).reduce(function(t,e){return t+(0,a.a)(e)},0),n=g(o,n-1,n).endsWith("\n");return!c&&!n}(e,u,u+1,n,o)&&t.insertEnter(),t):(!s&&function t(e,n,r,o,s){var u=e.ops[r],c=e.ops[n];if(c){var d=(0,a.f)(c);return d===l.HP.INSERT?(0,b[m(c,s)][m(u,s)])(c.insert,u.insert):d!==l.HP.RETAIN?t(e,n-1,r,o,s):(e=e.ops.slice(0,n+1).filter(function(t){return(0,a.f)(t)!==l.HP.INSERT}).reduce(function(t,e){return t+(0,a.a)(e)},0),n=(0,i._)(y(o,e-1,e),1)[0],(0,b[n=m({insert:e=g(o,e-1,e),attributes:n.attributes},s)][m(u,s)])(e,u.insert))}return!1}(e,u-1,u,n,o)&&t.insertEnter(),t.push(r),(u=function t(e,n,r,o,s){var u=e.ops[n],c=e.ops[r];if(!c){if(!o)return!1;var d=e.ops.slice().filter(function(t){return(0,a.f)(t)!==l.HP.INSERT}).reduce(function(t,e){return t+(0,a.a)(e)},0),f=(0,i._)(y(o,d,d+1),1)[0],h=g(o,d,d+1),d=m({insert:h,attributes:f.attributes},s);return(0,b[m(u,s)][d])(u.insert,h)}if((f=(0,a.f)(c))===l.HP.INSERT)return(0,b[m(u,s)][m(c,s)])(u.insert,c.insert);if(f!==l.HP.RETAIN)return f===l.HP.DELETE&&t(e,n,r+1,o,s);var e=e.ops.slice(0,r).filter(function(t){return(0,a.f)(t)!==l.HP.INSERT}).reduce(function(t,e){return t+(0,a.a)(e)},0),r=(0,i._)(y(o,e,e+1),1)[0],h=g(o,e,e+1),d=m({insert:h,attributes:r.attributes},s);return(0,b[m(u,s)][d])(u.insert,h)}(e,u,u+1,n,o))&&t.insertEnter(),s=u,t)},e.create({zoneId:e.zoneId}));return t.concat(c)},new a.D)).reduce(function(t,e){if(!(e instanceof u.I))return t.concat(e);var n=s.getZoneState(e.zoneId);if(!n&&e.ops.some(function(t){return!t.insert}))throw Error("attempt to apply new ZoneDelta which is invalid");var r=new Map,o=e.reduce(function(t,o,s){var u=(0,a.f)(o);if(u===l.HP.DELETE||!o.attributes)return t.push(o);var d,f,h=w(e,s-1,r);if(r.set(s-1,h),u===l.HP.RETAIN&&(d=h+(0,a.a)(o),(f=function(t,e,n){for(var r,o,s=[],l=t.offsetToPoint(e).line,u=t.getLine(l)._offsetStart,c=l;c<t.length();c++){var d=t.getLine(c).getOps();try{for(var f=(r=void 0,(0,i.c)(d)),h=f.next();!h.done;h=f.next()){var p,v,g=h.value,y=(0,a.a)(g),m=u+y;if(n<=u)return s;u<=n&&e<m&&(p=Math.max(e-u,0),v=Math.min(y,n-u),s.push({insert:g.insert.slice(p,v),attributes:g.attributes})),u+=y}}catch(t){r={error:t}}finally{try{h&&!h.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}}return s}(n,h,d)).forEach(function(u,h){var p,v,g=(0,i.b)((0,i.b)({},u.attributes),o.attributes),m=L(c,g);if(m&&u.attributes&&null!==(p=c.get(m))&&void 0!==p&&p.attributes&&(T=c.get(m).attributes,g=I(g,m,u.attributes[m],T)),null!=g&&g.lmkr){var b=void 0;if(h<f.length-1)b=f[h+1].attributes;else{for(var E=!1,S=s+1;S<e.ops.length;){var x=e.ops[S];if((0,a.f)(x)!==l.HP.DELETE){var _,E=!0;b=(0,a.f)(x)===l.HP.INSERT?x.attributes:(_=w(e,s,r),r.set(s,_),_=(0,i._)(y(n,_,_+1),1)[0],(0,i.b)((0,i.b)({},_.attributes),x.attributes));break}S++}E||(b=(0,i._)(y(n,d,d+1),1)[0].attributes)}var T=L(c,b);return T&&(A=c.get(T).lineAttributes)&&(g=I(g,T,b[T],A)),t.retain(u.insert.length,C(o.attributes,g))}if(m){var A=c.get(m).lineAttributes;if(0<=h)return t.retain(u.insert.length,C(o.attributes,g));for(var M=t.ops.length-1,k=void 0;0<=M;){var N=(0,a.f)(t.ops[M]);if(N!==l.HP.DELETE){k=N;break}M++}return M<0?t.retain(u.insert.length,C(o.attributes,g)):(h=t.ops[M],k===l.HP.INSERT&&null!==(v=h.attributes)&&void 0!==v&&v.lmkr?A&&(t.ops[M]={insert:h.insert,attributes:I(h.attributes,m,u.attributes[m],A)}):k===l.HP.RETAIN&&h.attributes,t.retain(u.insert.length,C(o.attributes,g)))}return t.retain(u.insert.length,C(o.attributes,g))})),u!==l.HP.INSERT)return t;var p=o.attributes,v=L(c,p);if(v&&null!==(g=c.get(v))&&void 0!==g&&g.attributes&&(p=I(p,v,p[v],c.get(v).attributes)),o.attributes.lmkr){for(var g,m=void 0,b=!1,E=s+1;E<e.ops.length;){var S=e.ops[E];if((0,a.f)(S)!==l.HP.DELETE){b=!0,m=S.attributes;break}E++}b?(u=e.ops[E],(g=(0,a.f)(u))===l.HP.INSERT&&u.attributes&&(m=u.attributes),g===l.HP.RETAIN&&!u.attributes&&n&&(m=(_=(0,i._)(y(n,h,h+1),1)[0]).attributes)):n&&(m=(_=(0,i._)(y(n,h,h+1),1)[0]).attributes),!m||(x=L(c,m))&&(T=c.get(x).lineAttributes)&&(p=I(p,x,m[x],T))}else if(v){for(var x,_,T=c.get(v).lineAttributes,A=t.ops.slice(),M=A.length-1;0<=M;){var k=A[M],N=(0,a.f)(k);if(N===l.HP.RETAIN)break;if(N===l.HP.INSERT&&k.insert&&k.insert.includes("\n")){M=-1;break}M--}0<=M&&!A[M].attributes&&T&&n&&(k=A[M],x=A.slice(0,M+1).filter(function(t){return(0,a.f)(t)!==l.HP.INSERT}).reduce(function(t,e){return t+(0,a.a)(e)},0),(_=(0,i._)(y(n,x-1,x),1)[0]).attributes.lmkr&&(v=I(_.attributes,v,o.attributes[v],T),T=1<k.retain?[{retain:k.retain-1},{retain:1,attributes:v}]:[{retain:1,attributes:v}],(v=t.ops).splice.apply(v,(0,i.e)([M,1],T))))}return t.insert(o.insert,p)},new u.I({zoneId:e.zoneId}));return t.concat(o)},new a.D)}function _(t){return!t.some(function(t){return t._getOps().map(function(t){return"string"==typeof t.insert?t.insert:" "}).join("")!==t.getModelText()})}function T(t){return t.reduce(function(t,e){return e instanceof u.I?(e=e.reduce(function(t,e){if((0,a.f)(e)!==l.HP.INSERT||!e.insert)return t.push(e);var n=e.insert.replace(/\r\n/g,"\n").replace(/\r/g,"\n").replace(/\t/g," ".repeat(8)).replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g,"");return n===e.insert?t.push(e):t.push((0,i.b)((0,i.b)({},e),{insert:n}))},new u.I({zoneId:e.zoneId})),t.concat(e)):t.concat(e)},new a.D)}},175465:function(t,e,n){"use strict";n.d(e,{i:function(){return S}});var r=n("194055");n("294484");var i=n("261359"),o=n("269516"),s=n("481685"),a=n("734795"),l=n("65476"),u=n("688148"),c=n("809721"),d=n("454746"),f=n("464675"),h=function(){function t(t){this.St=0,this.Pt=0,this.Mt=0,this.Ht=0,this.ee=0,this.kt=0,this.xt=[],this.Ct=!1,this.te=t}var e=t.prototype;return e.insert=function(t,e){var n,i,o,s,a,l,u,h,p,v,g=this;t&&(n=t,this.Ct||this.Dt(),this.te.length()-1<this.Mt&&this.Lt(),-1<n.indexOf("\n")?(a=n.split("\n"),this.Tt()?(i=this.xt.length-1,(o=this.xt[i])._keepKey&&o!==this.te.get(this.Mt)&&(o._keepKey=!1,o._refreshKey()),t=a.shift(),h=a.pop(),void 0!==t&&(v=(new f.I).retain(this.Pt).insert(t,e).insertEnter(e),s=o.slice(0,this.Pt).compose(v),this.Pt&&(s._setKey(o.getKey()),s.setNode(o.getNode())),this.St++,this.xt[i]=s),a.length&&(u=a.map(function(t){return new c.V((new f.I).insert(t,e).insertEnter(e),o.parent)}),(s=this.xt).push.apply(s,(0,r.e)(u)),this.St+=a.length),void 0!==h&&(v=(new f.I).insert(h,e),l=o.slice(this.Pt,o.length()).compose(v),h?this.xt.push(l):(a=this.te.get(this.Mt))&&l.length()===a.length()&&(0,d.X)(l._getOps(),a._getOps())?this.xt.push(a):l.length()&&this.xt.push(l),this.Pt=h.length)):(l=(p=this.At(n)).length,u=p.map(function(t){return new c.V((new f.I).insert(t,e),g.te.get(0).parent)}),p[l-1].includes("\n")||(h=this.te.get(this.Mt))&&(u[l-1]=h.compose(u[l-1]._getDelta()),this.Pt=p[l-1].length,this.St--,this.kt+=1),(l=this.xt).push.apply(l,(0,r.e)(u)),this.St+=p.length)):(p=this.Lt(),v=(new f.I).retain(this.Pt).insert(n,e),(v=this.xt[p].compose(v))._setKey(this.xt[p].getKey()),v._keepKey=!0,v.setNode(this.xt[p].getNode()),this.xt[p]=v,this.Pt+=n.length))},e.retain=function(t,e){if(t){var n=this.Ot(t),r=n.line,n=n.col;if(r>this.Mt)return this.Bt(r-this.Mt,e),void(n&&this.Ut(n,e));t&&this.Ut(t,e)}},e.Ut=function(t,e){var n,r;e&&(this.Ct||this.Dt()),this.Ct&&(this.Lt(),n=this.xt.length-1,r=this.xt[n],e=(new f.I).retain(this.Pt).retain(t,e),this.xt[n]=new c.V(r._getDelta().compose(e,!1),r.parent),this.xt[n]._setKey(r.getKey()),this.xt[n].setNode(r.getNode())),this.Pt+=t,this.Ht+=t},e.delete=function(t){if(t){var e=this.Ot(t),n=e.line,e=e.col;if(n>this.Mt)return this.Wt(n-this.Mt),void(e&&this.Zt(e));t&&this.Zt(t)}},e.close=function(){this.Ft()},e.Ot=function(t){for(var e=0,n=this.Mt,r=this.Ht,i=this.te.length(),o=n;o<i;o++){var s=this.te.get(o).length();if(e<=t+r&&t+r<e+s)return{line:o,col:t-e+r};e+=s}return e===t+r?{line:i,col:0}:{line:-1,col:-1}},e.Wt=function(t){var e,n,r;this.Ct||this.Dt(),this.Tt()?0===this.Pt?(this.kt+=t-1,this.Mt+=t,this.xt.pop()):(r=this.Kt(t-1),this.kt+=t,this.Mt+=t,e=this.xt.length-1,n=this.xt[e],(r=r.compose(n.slice(0,this.Pt)._getDelta()))._setKey(n.getKey()),r.setNode(n.getNode()),this.xt[e]=r):(this.Mt+=t,this.kt+=t),this.Ht=0},e.Zt=function(t){this.Ct||this.Dt();var e=this.Lt(),n=this.xt[e],r=(new f.I).retain(this.Pt).delete(t),r=n.compose(r);r._setKey(n.getKey()),r.setNode(n.getNode()),this.xt[e]=r,this.Ht+=t},e.Kt=function(t){var e=this.ee+this.kt;return this.te.get(e+t)},e.Bt=function(t,e){if(e){var n,r,i;this.Pt&&(i=this.Pt,this.Pt=0,this.Ct||this.Dt(),this.Lt(),n=this.xt.length-1,r=this.xt[n],i=(new f.I).retain(i).retain(r.length()-i,e),this.xt[n]=new c.V(r._getDelta().compose(i,!1),r.parent),this.xt[n]._setKey(r.getKey()),this.xt[n].setNode(r.getNode()),this.Mt++,this.St++,t--),this.Pt=0,this.Ct||this.Dt();for(var o=0;o<t;o++)this.St++,this.Mt++,this.Lt(e);this.Ht=0}else this.St+=t,this.Mt+=t,this.Pt=0,this.Ht=0,this.Ct&&this.Ft()},e.Lt=function(t){var e,n=this.te.get(this.ee+this.kt);return t&&n&&(e=(new f.I).retain(n.length(),t),(e=new c.V(n._getDelta().compose(e,!1),n.parent))._setKey(n.getKey()),e.setNode(n.getNode()),n=e),!this.Tt()&&n?(this.xt.push(n),this.kt++):t&&n&&(this.xt[this.xt.length-1]=n),this.St-this.ee},e.Dt=function(){this.Ct=!0,this.ee=this.St,this.kt=0,this.xt=[],this.Mt=this.St,0<this.Pt&&this.Lt()},e.Ft=function(){var t=this.xt.length;(0<this.kt||0<t)&&(this.$t(),this.te.splice(this.ee,this.kt,this.xt)),this.ee=this.St,this.Mt=this.St,this.kt=0,this.xt=[]},e.$t=function(){var t;this.xt.length&&(t=this.xt.length-1,this.xt[t]._getOps().length||this.xt.splice(t))},e.At=function(t){return t.match(/[^\n]*(?:\n|[^\n]$)/g)},e.Tt=function(){return this.St-this.ee<this.xt.length},t}(),p=function(){function t(t,e,n){var r=this;this.lines=[],this.parent=null,this._node=null,this.placeholder="",this.ue="",this.ce=[],this.instance=null,this.k=new Map,this.zoneId=t,this.schema=null!=n?n:new u.V({}),this._content=e.create({zoneId:t,ops:e.ops}),this.lines=[],this._content.eachLine(function(e){e=new c.V(e,r),r.lines.push(e),r.ce.push(e.length()),t===i.S&&(r.ue+=e.getModelText())}),this.he(),this.type=e.zoneType}var e=t.prototype;return t.register=function(e,n){t.mutators[e]=n},e.he=function(){var t=this,e=0;this.lines.forEach(function(n,r){var i=e+n.length();n._setOffset(e,i),n._setIndex(r),n.parent=t,e=i})},Object.defineProperty(e,"allText",{get:function(){return this.getModelText()},enumerable:!1,configurable:!0}),e.getStatus=function(t){return!!this.k.get(t)},e.setDangerousInput=function(t){this.k.set("dangerousInput",t)},e.getContainer=function(){return this._node},e.getModelText=function(){return this.lines.reduce(function(t,e){return t+e.getModelText()},"")},e.getNode=function(){return this._node?Array.from(this._node.childNodes).filter(function(t){return!(t instanceof Element&&t.getAttribute(a.Q0))}):null},e.setNode=function(t){this._node=t},e._updateAllText=function(t,e,n){var i=[];n.forEach(function(t){i.push(t.length())}),(o=this.ce).splice.apply(o,(0,r.e)([t,e.length],i));var o=this.ce.slice(0,t).reduce(function(t,e){return t+e},0),t=n.reduce(function(t,e){return t+e.getModelText()},""),n=e.reduce(function(t,e){return t+e.getModelText()},""),e=n.length;n!==t&&(e=this.ue.slice(o+e),this.ue=this.ue.slice(0,o)+t+e)},e.getType=function(){return this.type},e.slice=function(t,e){for(var n=t.line,r=t.offset,o=e.line,s=e.offset,a=this.cloneEmptyState(),l=n;l<=o;l++){var u=this.lines[l],c=n===o?u.slice(r,s):l===n?u.slice(r,u.length()):l===o?u.slice(0,s):u.slice(0,u.length());a._content=a._content.concat(c._getDelta()),a.zoneId===i.S&&(a.ue+=c.getModelText()),a.ce.push(c.length()),a._node=this._node,a.lines.push(c)}return a.he(),a},e._splice=function(t,e,n){var i;(i=this.lines).splice.apply(i,(0,r.e)([t,e],n))},e.clone=function(){var t=this.cloneEmptyState();t.ue=this.ue,t.instance=this.instance,t.parent=this.parent;for(var e=0,n=this.lines.length;e<n;e++)t.lines.push(this.lines[e].clone());return t},e.getLine=function(t){return this.lines[t]||null},e.getLineIndexOfKey=function(t){for(var e=0,n=this.lines.length;e<n;e++)if(t===this.lines[e].getKey())return e;return -1},e.getLineByKey=function(t){var e,n;try{for(var i=(0,r.c)(this.lines),o=i.next();!o.done;o=i.next()){var s=o.value;if(t===s.getKey())return s}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return null},e.getItemByIndex=function(t){return this.lines[t]||null},e.getEntities=function(t,e,n){var i=[];if(t instanceof Array)for(var o=0;o<this.length();o++)(s=this.getLine(o))&&i.push.apply(i,(0,r.e)(s.getEntities(t,e,n)));else{t instanceof Function&&(e=t,t={start:{line:0,offset:0},end:{line:u=this.length()-1,offset:this.getLine(u).length()}});for(var s,a,l,u=t.start,c=u.line,d=u.offset,u=t.end,f=u.line,h=u.offset,o=c;o<=f;o++)(s=this.getLine(o))&&(a=o===c?d:0,l=o===f?h:s.length(),i.push.apply(i,(0,r.e)(s.getEntities({start:a,end:l},e,n))))}return i},e.getAttributes=function(t,e){var n,i,o,s,e=this.getEntities({start:t,end:e},void 0,this._getInternalZoneEntities),a=(0,l.vA)();if(!e||!e.length)return a;try{for(var u=(0,r.c)(e),c=u.next();!c.done;c=u.next()){var d=c.value.attributes;if(d)try{for(var f=(o=void 0,(0,r.c)(Object.entries(d))),h=f.next();!h.done;h=f.next()){var p=(0,r._)(h.value,2),v=p[0],g=p[1];a.push([v,String(g)])}}catch(t){o={error:t}}finally{try{h&&!h.done&&(s=f.return)&&s.call(f)}finally{if(o)throw o.error}}}}catch(t){n={error:t}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}return a},e.length=function(){return this.lines.length},e.getZoneId=function(){return this._content.zoneId},Object.defineProperty(e,"content",{get:function(){return this.ae()},enumerable:!1,configurable:!0}),e.ae=function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);var n=this._content,i=n.zoneId,n=n.zoneType,o=this._content.create({zoneId:i,zoneType:n,ops:[]});return this.lines.forEach(function(n,i){var n=n._getOps(),a=n.length;n.forEach(function(n,l){var u,c;t&&(0,s.d)(n)&&(0===l&&0!==i||l===a-1)?o.insert(n.insert,n.attributes):e?(l=(0,r.b)({},n),(u=n.attributes)&&(c={},Object.keys(u).forEach(function(t){t.startsWith("clientside-")||(c[t]=u[t])}),l.attributes=c),o.ops.push(l)):o.ops.push(n)})}),o},e.getContent=function(t,e){return this.ae(t=void 0!==t&&t,e=void 0!==e&&e)},e.getViewContent=function(){return this.ae()},e.getState=function(){return this.lines},e.isEmpty=function(){var t;return!(1!==this.length()||null===(t=this.getLine(0))||void 0===t||!t.isEmpty())},e.apply=function(e,n){var s=this,a=this.lines.slice(0),l=e.zoneType,u=t.mutators[l];if(!u)throw Error("can not find zoneType of "+l+", you need call ZoneState.register("+l+") before apply");var c=this.cloneEmptyState();c.ue=this.ue,c.ce=(0,r.e)(this.ce);var d=new u({getParent:function(){return s},getZoneId:function(){return s.getZoneId()},getZoneType:function(){return l},splice:function(t,e,o){var s=a.slice(t,t+e);a.splice.apply(a,(0,r.e)([t,e],o)),c.zoneId===i.S&&c._updateAllText(t,s,o),n(t,s,o)},length:function(){return a.length},get:function(t){return a[t]},map:function(t){return a.map(function(e,n,r){return t(e,n,r)})}});return e.forEach(function(t){t.delete?d.delete(t.delete):t.retain?d.retain(t.retain,t.attributes):t.insert&&("string"==typeof t.insert&&(t.insert=(0,o.$)(t.insert)),d.insert(t.insert,t.attributes))}),d.close(),c.lines=a,c._node=this._node,c.instance=this.instance,c.he(),c.parent=this.parent,c.k=new Map(this.k),c},e.cloneEmptyState=function(){var e=this._content.create({zoneType:this.type,zoneId:this.zoneId}),e=new t(this.getZoneId(),e);return e.type=this.type,e.zoneId=this.zoneId,e._node=this._node,e.instance=this.instance,e.placeholder=this.placeholder,e.k=new Map(this.k),e},e[Symbol.iterator]=function(){return this.lines.values()},e.setPlaceholder=function(t){this.placeholder=t},e._setLine=function(t,e){this.lines[t]=e},e._setParent=function(t){this.parent=t},e._getZoneDelta=function(){return this.content},e._indexOf=function(t){return t?t.index:0},e.pointToOffset=function(t){var e=t.line,t=t.offset,e=this.getLine(e);return e?e._offsetStart+t:null},e.offsetToPoint=function(t){var e=function t(e,n,r,i){var o=Math.floor((n+r)/2);return r<n||!i.length||e>i[i.length-1]._offsetEnd||e<0?null:e>=i[o]._offsetStart&&e<=i[o]._offsetEnd?o:e>i[o]._offsetEnd?t(e,o,r,i):e<i[o]._offsetStart?t(e,n,o,i):null}(t,0,this.lines.length,this.lines),n=this.zoneId;if(null===e)return{zoneId:n,line:0,offset:0};var r=this.lines[e];return t===r._offsetEnd&&e!==this.lines.length-1?{zoneId:n,line:e+1,offset:0}:{zoneId:n,line:e,offset:t-r._offsetStart}},e.totalWidth=function(){return this.lines.reduce(function(t,e){return t+e.length()},0)},t.mutators={},t}();p.register("Z",h);var v=n("16168"),g=n("639142");n("882559");var y=function(t){function e(e){var n=t.call(this)||this;n.ops=[];var r=e.zoneId,i=e.ops,o=e.zoneType;return n.zoneId=r,n.zoneType=o,i&&i.length>0&&(n.ops=i),n}(0,v.c)(e,t);var n=e.prototype;return n.insert=function(e,n){return e?t.prototype.insert.call(this,{id:e},n,!1):this},n.create=function(t){return t.zoneType=t.zoneType||this.zoneType,new e(t)},e}(s.B),m=function(t){function e(e){return t.call(this,(0,v.a)({zoneType:g.Ak.Row},e))||this}return(0,v.c)(e,t),e}(y),b=function(t){function e(e){return t.call(this,(0,v.a)({zoneType:g.Ak.Column},e))||this}return(0,v.c)(e,t),e}(y);s.B.registerCreator(g.Ak.Row,m),s.B.registerCreator(g.Ak.Column,b);var E=function(){function t(t){this.ee=0,this.te=t}var e=t.prototype;return e.insert=function(t,e){var n=t,t=(t=this.te.get(0))||new c.V(this.ne(),this.te.getParent()),e=this.ne().retain(this.ee).insert(n.id,e),e=t.compose(e);this.te.splice(0,1,[e]),this.ee+=(0,s.a)({insert:n})},e.retain=function(t,e){e&&(e=this.ne().retain(this.ee).retain(t,e),e=this.te.get(0).compose(e),this.te.splice(0,1,[e])),this.ee+=t},e.delete=function(t){var e=this.ne(),t=this.te.get(0).compose(e.retain(this.ee).delete(t));this.te.splice(0,1,[t])},e.ne=function(){return new("R"===this.te.getZoneType()?m:b)({zoneId:this.te.getZoneId()})},e.close=function(){},t}(),S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,r.d)(e,t),e.prototype.cloneEmptyState=function(){var t=this._content.create({zoneType:this.type,zoneId:this.zoneId}),t=new e(this.getZoneId(),t,this.schema);return t.type=this.type,t.zoneId=this.zoneId,t._node=this._node,t.placeholder=this.placeholder,t},e}(p);S.register("R",E),S.register("C",E)},195229:function(t,e,n){"use strict";var r,i,o;n.d(e,{C:function(){return i},h:function(){return r}}),(o=r=r||{}).Range="Range",o.ZoneState="ZoneState",o.ContentState="ContentState",o.UndoModule="UndoModule",o.InputModel="InputModel",(i=i||{}).VirtualListModule="VirtualListModule"},672543:function(t,e,n){"use strict";function r(t){if(t instanceof Window)return{top:0,left:0,clientWidth:window.innerWidth,clientHeight:window.innerHeight,scrollTop:t.scrollY,scrollLeft:t.scrollX};if(t instanceof Element){var e=t.getBoundingClientRect();return{top:e.top,left:e.left,clientWidth:t.clientWidth,clientHeight:t.clientHeight,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}}return{top:0,left:0,clientHeight:0,clientWidth:0,scrollLeft:0,scrollTop:0}}function i(t){return"number"==typeof t?{paddingBottom:t,paddingLeft:t,paddingRight:t,paddingTop:t}:{paddingBottom:t.bottom||0,paddingTop:t.top||0,paddingLeft:t.left||0,paddingRight:t.right||0}}function o(t){return 0!==t.height||0!==t.top||0!==t.left||0!==t.right||0!==t.left}function s(t){return t.left||t.top}n.d(e,{AS:function(){return i},Fl:function(){return o},Yz:function(){return s},re:function(){return r}})},613974:function(t,e,n){"use strict";n.d(e,{$l:function(){return a},j0:function(){return d},zq:function(){return l}});var r=n(194055),i=n(809919),o=n(457341),s=n(559016),a="undo",l="redo",u=function(t){var e=t.id,n=t.type,r=t.deltaSet,t=t.selection;this.id=e,this.type=n,this.deltaSet=r,this.selection=t};function c(){}c.prototype=Object.create(Array.prototype,{clear:{value:function(){this.splice(0,this.length)}},getNthFromTop:{value:function(t){return null!==(t=this[this.length-1-(t=void 0===t?0:t)])&&void 0!==t?t:null}},getNthFromBottom:{value:function(t){return null!==(t=this[t=void 0===t?0:t])&&void 0!==t?t:null}}}),c.prototype.constructor=c;var d=function(){function t(t){this.name="undoModule",this.Oe=(0,i.D)(6),this.De=null,this.Ce=new c,this.Ne=new c,this.ke=[],this.Re=!1,this.Ae=null,this.s=t,this.Ue(),this.xe()}var e=t.prototype;return e.xe=function(){var t=this,e=this.s;e.registerCommand(a,function(){t.undo()}),e.registerCommand(l,function(){t.redo()})},e.Ue=function(){this.s.on(s.r.CONTENT_WILL_CHANGE,this.handleContentWillChange),this.s.on(s.r.CONTENT_CHANGE,this.handleContentChange),this.s.on(s.r.INPUT,this.handleInputEvent,100)},e.He=function(){this.s.off(s.r.CONTENT_WILL_CHANGE,this.handleContentWillChange),this.s.off(s.r.CONTENT_CHANGE,this.handleContentChange),this.s.off(s.r.INPUT,this.handleInputEvent)},e.handleInputEvent=function(t){var e=!1;"historyUndo"===t.nativeEvent.inputType?(this.undo(),e=!0):"historyRedo"===t.nativeEvent.inputType&&(this.redo(),e=!0),e&&(t.preventDefault(),t.stopEvent())},e.Be=function(){var t=this.s.getContentState().contentApplyRuntime;return!!t.atRuntime&&[a,l].includes(t=t.runtimeStack[0].type)},Object.defineProperty(e,"inBatching",{get:function(){return 0<this.ke.length},enumerable:!1,configurable:!0}),e.handleContentWillChange=function(){this.Ae=this.s.selection.getSelection()},e.handleContentChange=function(t){var e=t.previous,n=t.deltaSet,i=t.options,t=i.nonundoable,i=i.type;if(this.Be())return(i=(i===a?this.Ne:this.Ce).getNthFromTop(0))?void(i.selection=this.Ae):void 0;t?this.Te(n):(t=this.s.getContentState().contentApplyRuntime,this.Fe(n,e.toDeltaSet(),(0,r.b)((0,r.b)({},t.currentRuntime),{selection:this.Ae})))},e.Le=function(){this.inBatching&&this.We(this.ke[this.ke.length-1]);var t=this.Ce.getNthFromTop(0);this.ke.push((null==t?void 0:t.id)||null)},e.Ke=function(){var t;this.inBatching&&(t=this.ke.pop(),this.We(t),this.inBatching&&(this.ke.pop(),this.Le()))},e.We=function(t){var e=(0,r._)(t?this.ze(t):[-1],1)[0];void 0!==e&&((t=this.Ce.slice(e+1)).length&&this.Re&&(this.Re=!1,null!==(e=this.De)&&void 0!==e&&e.do(this.Oe)),1<t.length&&this.mergeRecords.apply(this,(0,r.e)(t)))},e.Fe=function(t,e,n){var r=n.id,i=n.type,n=n.selection,e=t.invert(e);this.Ce.push(new u({id:r,type:i,deltaSet:e,selection:n})),this.Ne.clear(),this.inBatching?this.Re=!0:null!==(n=this.De)&&void 0!==n&&n.do(this.Oe)},e.Te=function(t){this.Ge(this.Ce,t),this.Ge(this.Ne,t)},e.Ge=function(t,e){for(var n=t.length-1;0<=n;n--){var r=t[n].deltaSet;t[n].deltaSet=e.transform(r),e=r.transform(e)}},e.Je=function(t,e,n){var i;t.length&&(i=t.pop(),t=this.s.getContentState().toDeltaSet(),t=i.deltaSet.invert(t),e.push(new u((0,r.b)((0,r.b)({},i),{deltaSet:t}))),this.s.getContentState().apply(i.deltaSet,n),this.s.selection.setSelection(i.selection))},e.performUndo=function(){this.Je(this.Ce,this.Ne,{type:"undo"})},e.performRedo=function(){this.Je(this.Ne,this.Ce,{type:"redo"})},e.ze=function(t){var e,n;try{for(var i=(0,r.c)(this.Ce.entries()),o=i.next();!o.done;o=i.next()){var s=(0,r._)(o.value,2),a=s[0],l=s[1];if(l.id===t)return[a,l]}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return[]},e.Qe=function(t,e){var n=t.id,i=t.type,o=e.id,t=(0,r._)(this.ze(n),2),s=t[0],e=t[1],t=(0,r._)(this.ze(o),2),o=t[0],t=t[1];if(e&&t&&void 0!==s&&void 0!==o){var a=t.deltaSet,t=e.deltaSet;if(s<o)for(var l=o-1;s<l;l--)a=this.Ce.getNthFromBottom(l).deltaSet.transform(a);else for(l=o+1;l<s;l++)a=this.Ce.getNthFromBottom(l).deltaSet.transform(a);t=a.compose(t),this.Ce.splice(s,1,new u({id:n,type:i,deltaSet:t,selection:e.selection})),this.Ce.splice(o,1)}},e.batchedUndo=function(t){this.Le(),t(),this.Ke()},e.setUndoDispatcher=function(t,e){this.De=t,null!=e&&e.id&&(this.Oe=null==e?void 0:e.id),this.De.register((0,r.b)({id:this.Oe,undo:this.performUndo,redo:this.performRedo},e))},e.undo=function(){this.De?this.De.undo():this.performUndo()},e.redo=function(){this.De?this.De.redo():this.performRedo()},e.mergeRecords=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];try{for(var n=t.length-1;0<n;n--)this.Qe(t[n-1],t[n])}catch(t){this.s.log("mergeRecords failed",t.stack)}},Object.defineProperty(e,"undoable",{get:function(){return 0<this.Ce.length},enumerable:!1,configurable:!0}),Object.defineProperty(e,"redoable",{get:function(){return 0<this.Ne.length},enumerable:!1,configurable:!0}),e.markNonundoable=function(t){var e=(0,r._)(this.ze(t.id),1)[0];void 0!==e&&(t=(0,r._)(this.Ce.splice(e,1),1)[0].deltaSet.invert(this.s.getContentState().toDeltaSet()),this.Ge(this.Ce.slice(0,e),t))},e.getNthUndoRecordFromTop=function(t){return this.Ce.getNthFromTop(t=void 0===t?0:t)},e.getNthUndoRecordFromBottom=function(t){return this.Ce.getNthFromBottom(t=void 0===t?0:t)},e.getNthRedoRecordFromTop=function(t){return this.Ne.getNthFromTop(t=void 0===t?0:t)},e.getNthredoRecordFromBottom=function(t){return this.Ne.getNthFromBottom(t=void 0===t?0:t)},e.clearUndoStack=function(){this.Ce.clear()},e.clearRedoStack=function(){this.Ne.clear()},e.clear=function(){this.clearRedoStack(),this.clearUndoStack()},e.destroy=function(){var t;this.He(),null!==(t=this.De)&&void 0!==t&&t.unregister(this.Oe)},(0,r.a)([o.W],t.prototype,"handleInputEvent",null),(0,r.a)([o.W],t.prototype,"handleContentWillChange",null),(0,r.a)([o.W],t.prototype,"handleContentChange",null),(0,r.a)([o.W],t.prototype,"performUndo",null),(0,r.a)([o.W],t.prototype,"performRedo",null),(0,r.a)([o.W],t.prototype,"batchedUndo",null),t}()},386308:function(t,e,n){"use strict";n.d(e,{S:function(){return r}});var r=function(){function t(){}var e=t.prototype;return e.match=function(t,e){return!1},e.renderLine=function(t){return t.children},e.render=function(t){return t.children},e.serialize=function(t){return t},e.deserialize=function(t){return t.deltaSet},t}()},649146:function(t,e,n){"use strict";n.d(e,{Q$:function(){return d},gv:function(){return l},iI:function(){return u}});var r=n("194055"),i=n("639142"),o=n("734795"),s=["render","renderLine","renderWrapper","renderInlineWrapper"],a="priority";function l(t){return function(e,n,r){return e[n+"_"+a]=t,r}}function u(t,e){return(0,r.e)(t).sort(function(t,n){return c(t,e)-c(n,e)})}function c(t,e){return"number"==typeof t[e+"_"+a]?t[e+"_"+a]:1e3}var d=function(){function t(t,e){var n=this;void 0===e&&(e={}),this.s=t,this.Or=[],this.Ir=new Map,this.Ar=new Map,this.Yr=new Map,this.Nr=new Map,this.Tr=new Map;var r=e.registerPlugin,e=e.plugins;r?r(t).forEach(function(t){return n.register(t)}):this._registerV2(e||[])}var e=t.prototype;return e.Zr=function(t,e){var n=null!==(n=this.Yr.get(e=void 0===e?"all":e))&&void 0!==n?n:new Set;n.add(t),this.Yr.set(e,n)},e.Kr=function(t,e){var n=this.Yr.get(e=void 0===e?"all":e);n&&(n.delete(t),this.Yr.set(e,n))},e._resetPluginConstructorToZoneMap=function(t){this.Yr.delete(t=void 0===t?"all":t)},e.isPluginInZone=function(t,e){return(null===(e=this.Yr.get(e))||void 0===e?void 0:e.has(t.constructor))||(null===(e=this.Yr.get("all"))||void 0===e?void 0:e.has(t.constructor))},e.register=function(t,e){if(Array.isArray(t)){var n=(0,r._)(t,2),i=n[0],n=n[1];if(this.Zr(i,e),this.Tr.has(i))return;t=new i(n)}else if(i=t.constructor,this.Zr(i,e),this.Tr.has(i))return;this.Br(t)},e._registerV2=function(t,e){var n,a,l,u,c=this,d=this.Nr.get(e=void 0===e?"all":e)||[];if(d!==t){this.Nr.set(e,t);var f,h,p=(f=d,{added:(h=t).filter(function(t){var e=(0,r._)(t,1)[0];return!f.some(function(t){return e===(t=(0,r._)(t,1)[0])})}),removed:f.filter(function(t){var e=(0,r._)(t,1)[0];return!h.some(function(t){return e===(t=(0,r._)(t,1)[0])})})}),d=p.added,t=p.removed;if(0!==d.length||0!==t.length){p=this.Wr(d,e),d=this.zr(t,e),this.Fr(d,e),this.Ar.clear();var v=new Set;if("all"===e)v=new Set(t=(0,r.e)(this.s.getContentState().getContent().values()).filter(function(t){return t.getType()===i.Ak.Content}).filter(function(t){return t.instance}));else{if(!(E=this.s.getContentState().getZoneState(e)))return void this.s.error({message:"cannot find zoneState with zoneId: "+e,level:o.WV.ERROR});E.instance&&v.add(E)}if(0!==v.size){var g=function(t,e){var n,i,o,a,l=t.filter(function(t){return s.some(function(e){return t[e]})}),u=e.filter(function(t){return s.some(function(e){return t[e]})}),c=[];try{for(var d=(0,r.c)(l),f=d.next();!f.done&&"break"!==function(t){var e,n;if(!t.match)return"break";try{for(var i=(e=void 0,(0,r.c)(s)),o=i.next();!o.done&&"break"!==function(e){if(t[e]&&!u.some(function(n){return n[e]===t[e]}))return c.push(t),"break"}(o.value);o=i.next());}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}}(f.value);f=d.next());}catch(t){n={error:t}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}try{for(var h=(0,r.c)(u),p=h.next();!p.done&&"break"!==function(t){var e,n;if(!t.match)return"break";try{for(var i=(e=void 0,(0,r.c)(s)),o=i.next();!o.done&&"break"!==function(e){if(t[e]&&!l.some(function(n){return n[e]===t[e]}))return c.push(t),"break"}(o.value);o=i.next());}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}}(p.value);p=h.next());}catch(t){o={error:t}}finally{try{p&&!p.done&&(a=h.return)&&a.call(h)}finally{if(o)throw o.error}}return c}(p,d);if(0!==g.length){this.Ir.clear();var y=new Map;try{for(var m=(0,r.c)(v),b=m.next();!b.done;b=m.next()){var E=b.value;this.Ur(E,v,g,y)}}catch(t){n={error:t}}finally{try{b&&!b.done&&(a=m.return)&&a.call(m)}finally{if(n)throw n.error}}var S=[];try{for(var I=(0,r.c)(y),C=I.next();!C.done;C=I.next()){var L=(0,r._)(C.value,2),E=L[0],w=L[1];"all"!==w&&0!==w.length&&S.push({zoneId:E.getZoneId(),lineArr:w})}}catch(t){l={error:t}}finally{try{C&&!C.done&&(u=I.return)&&u.call(I)}finally{if(l)throw l.error}}Promise.resolve().then(function(){var t=c.s.getContentState();S.forEach(function(e){var n=e.zoneId,e=e.lineArr;t._forceRefresh(n,e)})})}}}}},e.Fr=function(t,e){"all"===e&&(t=u(t,"destroy"),this.call("destroy",{},{plugins:t}))},e.Ur=function(t,e,n,r,i){if(void 0===i&&(i=0),!(r.has(t)||100<i)){var o=t.parent,s=null==o?void 0:o.parent;if(s&&e.has(s)&&(this.Ur(t,e,n,r,i+1),"all"===(s=r.get(s))||null!=s&&s.includes(o.index)))return void r.set(t,"all");n=this.Hr(t,n),r.set(t,n)}},e.Wr=function(t,e){var n,i,o=[];try{for(var s=(0,r.c)(t),a=s.next();!a.done;a=s.next()){var l,u=(0,r._)(a.value,2),c=u[0],d=u[1];this.Zr(c,e),this.Tr.has(c)?o.push(this.Tr.get(c)):(l=new c((0,r.b)((0,r.b)({},d||{}),{editor:this.s})),o.push(l),this.Br(l))}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return o},e.zr=function(t,e){var n,i,s=[];try{for(var a=(0,r.c)(t),l=a.next();!l.done;l=a.next()){var u=(0,r._)(l.value,1)[0];this.Kr(u,e);var c=this.Tr.get(u);c?s.push(c):this.s.error({message:"cannot find plugin instance corresponding to the constructor",level:o.WV.ERROR})}}catch(t){n={error:t}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return s},e.Gr=function(t){return t={lineState:t,index:t.index},this.s.callAll("_editorLineStateWillRender",t),t.lineState},e.Hr=function(t,e){var n,i,o,s,a=this,t=t.lines.map(function(t){return a.Gr(t)}),l=[];try{for(var u=(0,r.c)(t),c=u.next();!c.done;c=u.next()){var d=c.value;try{for(var f=(o=void 0,(0,r.c)(e)),h=f.next();!h.done;h=f.next()){var p=h.value;if(function(t,e){var n,i,o,s;try{for(var a=(0,r.c)(e),l=a.next();!l.done;l=a.next()){var u=l.value;if(u.insert&&"object"!=typeof u.insert){var c=u.attributes||{};try{for(var d=(o=void 0,(0,r.c)(Object.entries(c))),f=d.next();!f.done;f=d.next()){var h=(0,r._)(f.value,2),p=h[0],v=h[1];if(t.match(p,v,c))return!0}}catch(t){o={error:t}}finally{try{f&&!f.done&&(s=d.return)&&s.call(d)}finally{if(o)throw o.error}}}}}catch(t){n={error:t}}finally{try{l&&!l.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}return!1}(p,d)){l.push(d.index);break}}}catch(t){o={error:t}}finally{try{h&&!h.done&&(s=f.return)&&s.call(f)}finally{if(o)throw o.error}}}}catch(t){n={error:t}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}return l},e.Br=function(t){this.Ar.clear(),this.Or.push(t),this.Tr.set(t.constructor,t)},e.call=function(t,e,n){var r=this,i=(n=void 0===n?{}:n).cb,s=void 0===i?function(t,e){return t}:i,i=n.zoneId;return(null!==(n=n.plugins)&&void 0!==n?n:this.Jr(t,i)).reduce(function(e,n){var i,a,l,u=n[t];if(u&&"function"==typeof u)try{var c=(null!==(i=e.lineState)&&void 0!==i?i:{}).leaves,d=s(e,u.call(n,e)),f=(null!==(a=d.lineState)&&void 0!==a?a:{}).leaves;return c&&(c!==f||c.length!==f.length)&&r.s.trace.add({extra:{pluginHookName:t,pluginNam:null!==(l=n.name)&&void 0!==l?l:null,leavesMatch:!1}}),d}catch(e){n="Warning: call hook failed. hook: "+t+". plugin: "+n.name,r.s.error({e:e,level:o.WV.ERROR,message:n})}return e},e)},e.Jr=function(t,e){var n=this,r=[];return this.Ar.has(t)?r=this.Ar.get(t):(r=u(this.Or,t),this.Ar.set(t,r)),e?r.filter(function(t){return n.isPluginInZone(t,e)}):r},e.getPlugins=function(t){var e=this;return void 0===t&&(t="all"),this.Or.filter(function(n){return e.isPluginInZone(n,t)})},e._matchPlugin=function(t){var e,n,i,s,a,l=t.attributeKey,u=t.value,c=t.zoneId,d=void 0===c?"all":c,f=t.attributes,c=l+u,t=this.Ir.get(c);if(!t){var h=[];try{for(var p=(0,r.c)(this.Or),v=p.next();!v.done;v=p.next()){var g=v.value;try{null!==(a=g.match)&&void 0!==a&&a.call(g,l,u,f)&&h.push(g)}catch(t){var y="Warning: call hook failed. hook: match. plugin: "+g.name;this.s.error({e:t,level:o.WV.ERROR,message:y})}}}catch(t){e={error:t}}finally{try{v&&!v.done&&(n=p.return)&&n.call(p)}finally{if(e)throw e.error}}0<h.length&&(this.Ir.set(c,h),t=h)}if(!t)return null;try{for(var m=(0,r.c)(t),b=m.next();!b.done;b=m.next())if(g=b.value,this.isPluginInZone(g,d))return g}catch(t){i={error:t}}finally{try{b&&!b.done&&(s=m.return)&&s.call(m)}finally{if(i)throw i.error}}return null},e.getPlugin=function(t,e){var n,i;try{for(var o=(0,r.c)(this.Or),s=o.next();!s.done;s=o.next()){var a=s.value;if(a.name===t)return!e||this.isPluginInZone(a,e)?a:null}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return null},e.getLineWrapperInfo=function(t){var e,n,i=t.getLineAttributes(),o=[],s=[];try{for(var a=(0,r.c)(i),l=a.next();!l.done;l=a.next()){var u=(0,r._)(l.value,2),c=u[0],d=u[1],f=this._matchPlugin({attributeKey:c,value:d,attributes:i.toMap()});null!=f&&f.renderWrapper&&(o.push(c),s.push(f.renderWrapper({lineState:t})))}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return{hasWrapper:!!o.length,key:o.join("-"),elements:s}},e.destroy=function(){this.call("destroy",{}),this.Or=[],this.Ir.clear(),this.Ar.clear(),this.Yr.clear(),this.Nr.clear(),this.Tr.clear()},t}()},688148:function(t,e,n){"use strict";n.d(e,{V:function(){return i}});var r=n(194055),i=function(){function t(t){this.schemas=t}return t.prototype.get=function(t){var e,n;if(this.schemas[t])return this.schemas[t];try{for(var i=(0,r.c)(Object.keys(this.schemas)),o=i.next();!o.done;o=i.next()){var s=o.value;if(new RegExp(s).test(t))return this.schemas[s]}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}},t}()},495907:function(t,e,n){"use strict";var r,i;n.d(e,{v:function(){return r}}),(i=r=r||{}).inline="inline",i.block="block"},91821:function(t,e,n){"use strict";n.d(e,{W:function(){return u}});var r=n("194055"),i=n("734795");n("294484");var o=n("195229"),s=n("703671"),a=n("261359"),l=function(){function t(t){var e=t.line,n=t.offset,r=t.position,t=t.zoneId,t=void 0===t?a.S:t;this._position=0,this.line=e,this.offset=n,this.zoneId=t,Object.defineProperty(this,"_position",{enumerable:!1,value:r})}return t.prototype[Symbol.toPrimitive]=function(t){return"number"===t?this._position:JSON.stringify({line:this.line,offset:this.offset,zoneId:this.zoneId})},t}(),u=function(){function t(t){var e=t.editor,n=t.start,r=t.end,i=t.isBackward,i=void 0!==i&&i,t=t.state;this.editor=e,n=this.createRangePoint(n,!1,t),t=(r=this.createRangePoint(r,!1,t))<n,this.start=t?r:n,this.end=t?n:r,this.isBackward=t||i,Object.defineProperties(this,{editor:{enumerable:!1},_start:{enumerable:!1},_end:{enumerable:!1},start:{enumerable:!0,get:function(){return this._start},set:function(t){this._start=t}},end:{enumerable:!0,get:function(){return this._end},set:function(t){this._end=t}}})}var e=t.prototype;return t.isRange=function(e){return e instanceof t},t.isPointEqual=function(t,e){var n=t.line,r=t.offset,i=t.zoneId,o=e.line,t=e.offset,e=e.zoneId;return n===o&&r===t&&i===e},t.isRangeEqual=function(e,n){var r=e.start,i=e.end,e=n.start,n=n.end;return t.isPointEqual(r,e)&&t.isPointEqual(i,n)},t.isRangesEqual=function(t,e){if(t.length!==e.length)return!1;for(var n=0,r=t.length;n<r;n++){var i=t[n],o=e[n];if(!o||!this.isRangeEqual(i,o))return!1}return!0},t.isPointLargerThan=function(t,e){var n=t.line,r=t.offset,i=t.zoneId,o=e.line,t=e.offset;return i===e.zoneId&&(o<n||n===o&&t<r)},Object.defineProperty(e,"start",{get:function(){return this._start},set:function(t){this._start=this.createRangePoint(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e,"end",{get:function(){return this._end},set:function(t){this._end=this.createRangePoint(t)},enumerable:!1,configurable:!0}),e.create=function(e){return new t(e)},e.createRangePoint=function(t,e,n){return!(e=void 0!==e&&e)&&t instanceof l?t:(e=n||this.editor.getContentState(),n=null,"rangePointToOffset"in e?n=e.rangePointToOffset(t):"pointToOffset"in e&&(n=e.pointToOffset(t)),null===n?(this.editor.error({message:"point: "+t+" can't parse to position",level:i.WV.ERROR}),new l((0,r.b)((0,r.b)({},t),{position:-1}))):new l((0,r.b)((0,r.b)({},t),{position:n})))},e.toPosition=function(t){var e=t||this.editor.getContentState(),n=null,t=null;return"rangePointToOffset"in e?(n=e.rangePointToOffset(this.start),t=e.rangePointToOffset(this.end)):"pointToOffset"in e&&(n=e.pointToOffset(this.start),t=e.pointToOffset(this.end)),null===n||null===t?(this.editor.error({message:"startOffset: "+n+", endOffset: "+t,level:i.WV.ERROR}),new s.L({editor:this.editor,start:-1,len:0,zoneId:this.start.zoneId,isBackward:this.isBackward})):new s.L({editor:this.editor,start:n,len:t-n,zoneId:this.start.zoneId,isBackward:this.isBackward})},e.isCollapsed=function(){return t.isPointEqual(this.start,this.end)},e.clone=function(t){return new(this.editor.modulesContainer.get(o.h.Range))({editor:this.editor,start:this.createRangePoint(this.start,!0,t),end:this.createRangePoint(this.end,!0,t),isBackward:this.isBackward})},e.toString=function(){return JSON.stringify(this)},t}()},703671:function(t,e,n){"use strict";n.d(e,{L:function(){return s}});var r=n(194055),i=n(261359),o=n(195229),s=function(){function t(t){var e=t.start,n=t.len,r=t.zoneId,o=void 0===r?i.S:r,r=t.isBackward,r=void 0!==r&&r,t=t.editor;this.start=e,this.len=n,this.zoneId=o,this.isBackward=r,this.editor=t,Object.defineProperty(this,"editor",{enumerable:!1})}var e=t.prototype;return t.isPosition=function(e){return e instanceof t},e.toRange=function(t){var e=this,n=e.editor,i=e.start,s=e.len,a=e.zoneId,e=(t||n.getContentState()).getZoneState(a),t=e.offsetToPoint(i),s=e.offsetToPoint(i+s);return new(this.editor.modulesContainer.get(o.h.Range))({editor:n,start:(0,r.b)((0,r.b)({},t),{zoneId:a}),end:(0,r.b)((0,r.b)({},s),{zoneId:a})})},e.isCollapsed=function(){return 0===this.len},t}()},97930:function(t,e,n){"use strict";n.d(e,{e:function(){return s}});var r=n(194055),i=n(261359),o=n(734795);n(294484);var s=function(t){function e(n){var r=n.editor,i=n.start,o=n.end,s=n.isBackward,a=void 0!==s&&s,n=i,s=o;return i.zoneId!==o.zoneId&&(n=(o=e.fixToCommonZone(r,i,o)).start,s=o.end),t.call(this,{editor:r,start:n,end:s,isBackward:a})||this}(0,r.d)(e,t);var n=e.prototype;return e.fixToCommonZone=function(t,e,n){var s=e.zoneId,a=n.zoneId;if(s===a)return{start:e,end:n};var l,u=t.getContentState().getZoneManager(),c=t.getContentState(),t=u.getAncestorZones(s),d=u.getAncestorZones(a),u=t.find(function(t){return d.includes(t)});return u?(u===s||(t=null==(s=c.getZoneState(t[t.indexOf(u)-1]))?void 0:s.parent)&&(l=(null===(l=null===(l=null==s?void 0:s._node)||void 0===l?void 0:l.getAttribute(o.Ks))||void 0===l?void 0:l.length)||0,e=(0,r.b)((0,r.b)({},e),{zoneId:u,line:t.index,offset:l+(t.hasLineMarker()?1:0)})),u===a||(c=null==(a=c.getZoneState(d[d.indexOf(u)-1]))?void 0:a.parent)&&(l=(null===(a=null===(a=null==a?void 0:a._node)||void 0===a?void 0:a.getAttribute(o.Ks))||void 0===a?void 0:a.length)||0,n=(0,r.b)((0,r.b)({},n),{zoneId:u,line:c.index,offset:l+(c.hasLineMarker()?1:0)})),{start:e,end:n}):{start:(0,r.b)((0,r.b)({},e),{zoneId:i.S}),end:(0,r.b)((0,r.b)({},n),{zoneId:i.S})}},n.clone=function(t){return new e({editor:this.editor,start:this.createRangePoint(this.start,!0,t),end:this.createRangePoint(this.end,!0,t),isBackward:this.isBackward})},e}(n(91821).W)},361087:function(t,e,n){"use strict";n.d(e,{E_:function(){return g},Eb:function(){return A},Ju:function(){return _},KK:function(){return c},MK:function(){return E},Ny:function(){return y},S3:function(){return function t(e,n){void 0===n&&(n=[]);for(var r=0,o=e.childNodes.length;r<o;r++){var s,a=e.childNodes[r];a.hasAttribute&&a.hasAttribute(i.nV)&&!a.hasAttribute(i.q7)?n.push(a.textContent):void 0!==(s=f(a))?n.push(s):a.childNodes&&t(a,n)}return n}},Tl:function(){return T},U_:function(){return p},XM:function(){return I},Yr:function(){return M},Zj:function(){return S},fr:function(){return h},hl:function(){return w},iB:function(){return x},mO:function(){return d},qI:function(){return m},x1:function(){return L},y1:function(){return a},z8:function(){return function t(e,n){void 0===n&&(n=[]);for(var r=0,i=e.childNodes.length;r<i;r++){var o,s=e.childNodes[r];s.nodeType===Node.TEXT_NODE?n.push(s.textContent):void 0!==(o=f(s))?n.push(o):s.childNodes&&t(s,n)}return n}}});var r=n(194055),i=n(734795),o=n(85359),s=function(t){return t instanceof Node},a=function(t){return s(t)&&t.nodeType===Node.TEXT_NODE},l=function(t){return s(t)&&t.nodeType===Node.ELEMENT_NODE},u=function(t,e,n){if(!(t instanceof HTMLElement)||"br"===t.tagName.toLowerCase()||!t.childNodes[e]||t.classList.contains(i.qT))return null;for(var r,o=t.childNodes,a=o[e],u=e,c=!1,d=!1;(s(r=a)&&r.nodeType===Node.COMMENT_NODE||l(a)&&0===a.childNodes.length||l(a)&&"false"===a.getAttribute("contenteditable")&&!a.getAttribute(i.eu))&&(!c||!d);)u>=o.length?(c=!0,u=e-1,n="backward"):u<0?(d=!0,u=e+1,n="forward"):(a=o[u],u+="forward"===n?1:-1);return a},c=function(t){var e=t.node,n=t.offset;if(l(e)&&e.hasChildNodes()){var r=(n=Math.min(n,e.childNodes.length))===e.childNodes.length,i=r?"backward":"forward";for(e=e.childNodes[r?n-1:n];e instanceof HTMLElement&&e.childNodes.length;)var o=r?e.childNodes.length-1:0,e=u(e,o,i);if(!e)return t;n=r&&null!=e.textContent?e.textContent.length:0}return{node:e,offset:n}};function d(t){if(!t)return null;var e=t;return(e=t.nodeType===window.Node.TEXT_NODE?t.parentNode:e)&&e.closest?e.closest("["+i.PI+"]"):null}function f(t){if(!(t instanceof HTMLElement))return"";var e=t.hasAttribute(i.eu),n=t.hasAttribute(i.VI),r=t.hasAttribute(i.Ks),o=t.hasAttribute(i.sq),s=t.hasAttribute(i.q7);return e?t.getAttribute(i.eu):n?(null===(n=t.textContent)||void 0===n?void 0:n.replace(RegExp(""+i.T6,"g"),""))||"":r?t.querySelectorAll("["+i.P9+"]").length?" ":"":s?((null===(t=t.textContent)||void 0===t?void 0:t.replace(RegExp(""+i.T6,"g"),""))||"")+"\n":o?"":void 0}function h(t){var e,n,o,s=c(t),a=s.node,l=s.offset,t=d(a);if(!a||!t)return null;(s=document.createRange()).setStart(t,0),s.setEnd(a,l),s=Array.from((l=s.cloneContents()).querySelectorAll("["+i.eu+"],["+i.VI+"],["+i.Ks+"],["+i.sq+"]"));try{for(var u=(0,r.c)(s),f=u.next();!f.done;f=u.next()){var h,p,v,g,y,m,b=f.value,E=b.parentNode;E&&(h=b.hasAttribute(i.eu),p=b.hasAttribute(i.VI),v=b.hasAttribute(i.Ks),h?(g=b.getAttribute(i.eu),(y=document.createElement("span")).setAttribute(i.eu,g),y.textContent=g,E.insertBefore(y,b),E.removeChild(b)):p?b.textContent=(null===(o=b.textContent)||void 0===o?void 0:o.replace(RegExp(""+i.T6,"g"),""))||null:v?(m=b.querySelectorAll("["+i.P9+"]"),b.textContent=m.length?" ":""):E.removeChild(b))}}catch(t){e={error:t}}finally{try{f&&!f.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}return l}function p(t){return Array.from(t.querySelectorAll("["+i.nV+"], ["+i.eu+"], ["+i.VI+"]")).filter(function(t){var e;return!(t instanceof HTMLElement&&"string"==typeof(null===(e=t.dataset)||void 0===e?void 0:e.fakeText))||(null===(t=null===(t=t.dataset)||void 0===t?void 0:t.fakeText)||void 0===t?void 0:t.length)}).filter(function(e){return e=e.parentElement&&e.parentElement.closest("["+i.eu+"]"),!t.contains(e)}).filter(function(e){return e=e.parentElement&&e.parentElement.closest("["+i.Ks+"]"),!t.contains(e)})}function v(t){if(a(t)||!t.hasChildNodes())return[t];if(g(t)){var e=x(t);if(e&&e.firstChild)return[e.firstChild]}return Array.from(t.childNodes).reduce(function(t,e){return t.push.apply(t,(0,r.e)(v(e))),t},[])}function g(t){return!!y(t)}function y(t){return b(t,"["+i.eu+"]")}function m(t){return b(t,"["+i.sq+"]")}function b(t,e){return t&&(t=t instanceof HTMLElement?t:t.parentElement)?(e=t.closest(e),t=d(t),e&&t&&t.contains(e)?e:null):null}function E(t){return t&&(t instanceof Element||t instanceof DocumentFragment)&&(function(t){t.querySelectorAll("["+i.q7+"]").forEach(function(t){t.textContent&&(t.textContent=function(t){return t.replace(RegExp(i.T6+"|\\n","g"),"")}(t.textContent))})}(t),function(t){t.querySelectorAll("."+i.Z6).forEach(function(t){t.parentElement.removeChild(t)})}(t)),(t=t.textContent)?t.length:0}function S(t,e){var n=t.anchorNode,r=t.focusNode;if(!n||!r||t.rangeCount<=e)return null;if(r=null,o.Xh.safari)try{r=t.getRangeAt(e)}catch(t){r=null}else t.getRangeAt&&(r=t.getRangeAt(e));return r||((r=document.createRange()).setStart(t.anchorNode,t.anchorOffset),r.setEnd(t.focusNode,t.focusOffset)),r}function I(t,e){var n,r,i,o=document.createRange(),s=t.node,a=t.offset,t=e.node,e=e.offset;return s&&(i=Math.min(a,(null===(n=(r=C(v(s)[0])).textContent)||void 0===n?void 0:n.length)||0),o.setStart(r,i)),t&&(a=C(v(t)[0]),r=(n=g(t))&&x(t),t=(null===(t=a.textContent)||void 0===t?void 0:t.length)||0,i=!n||r?Math.min(e,t):t,o.setEnd(a,i)),o}function C(t){return o.Xh.safari&&t instanceof HTMLElement&&"BR"===t.tagName?t.closest("span[data-leaf]"):t}function L(t){return t&&(t instanceof HTMLElement?t.hasAttribute(i.VI):null===(t=t.parentElement)||void 0===t?void 0:t.hasAttribute(i.VI))}function w(t){return!!x(t)}function x(t){return t&&t instanceof Element?t.hasAttribute(i.VI)?t:t.querySelector("["+i.VI+"]"):null}function _(t){return t&&t instanceof Element&&t.hasAttribute(""+i.eu)?t.getAttribute(""+i.eu):null}function T(t,e,n){void 0===n&&(n=!1);var o,s,a,l=t._getViewModel(),u=l.getModel(e);if(!u){var c=e.closest("["+i.Ks+"]");if(!c)return null;var d=c.querySelectorAll("["+i.PI+"],["+i.Q0+"]");if(!d.length||!(c=(null==(f=l.getModel(c))?void 0:f.getZoneId())||c.getAttribute("["+i.P9+"]")))return null;var f=f||t.getContentState().getZoneState(c),c=null===(t=t.virtualListManager)||void 0===t?void 0:t.getVirtualListModuleOfZone(c);if(null!=c&&c.isEnabled&&(c=e.getAttribute(i.Q0))){var h=c.split("-"),p=null!==(v=null==f?void 0:f.getLine(+h[0]))&&void 0!==v?v:null,v=null!==(v=null==f?void 0:f.getLine(+h[1]))&&void 0!==v?v:null;return n?v:p}var g=-1;try{for(var y=(0,r.c)(Array.from(d)),m=y.next();!m.done;m=y.next()){var b=m.value;if(b.getAttribute(i.PI)?g++:(h=null===(a=b.getAttribute(i.Q0))||void 0===a?void 0:a.split("-"))&&(g+=+h[1]-+h[0]+1),b===e){var E=null==f?void 0:f.getLine(g);if(!E)return null;u=E;break}}}catch(t){o={error:t}}finally{try{m&&!m.done&&(s=y.return)&&s.call(y)}finally{if(o)throw o.error}}}return Array.isArray(u)&&(p=u[0],v=u[u.length-1],u=n?v:p),u}function A(t,e){var n;if(!t||!(t=t instanceof HTMLElement?t:t.parentElement)||!t.textContent||e!==t.textContent.length)return!1;for(var r=t.closest("["+i.MB+"]");(null==r||!r.nextElementSibling)&&null!==(n=null==r?void 0:r.parentElement)&&void 0!==n&&n.hasAttribute(i.lE);)r=r.parentElement;return null===(t=null==r?void 0:r.nextElementSibling)||void 0===t?void 0:t.querySelector("["+i.eu+"]")}function M(t,e){return!!e&&t.focusNode===e.startContainer&&t.focusOffset===e.startOffset&&t.anchorNode===e.endContainer&&t.anchorOffset===e.endOffset}},401328:function(t,e,n){"use strict";n.d(e,{y:function(){return a}});var r=n(194055),i=n(734795),o=n(283138),s=n(651271),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,r.d)(e,t),e.prototype.render=function(){var t=this,e=this.props,n=e.data,a=e.dataSet,l=void 0===a?{}:a,u=e.className,c=e.style,d=e.editor,a=n.op,e=n.parent;return"string"!=typeof a.insert?o.ZP.createElement(o.ZP.Fragment,null):(u=(0,r.b)((0,r.b)(((n={})[i.nV]=!0,n),l),{className:u,style:c}),null!==(c=a.attributes)&&void 0!==c&&c.enter&&(u[i.q7]=!0,e.isTextEmpty()&&d._isRenderBrInEmptyLine)?o.ZP.createElement(s.q,(0,r.b)({},u,{ref:function(e){var n,r;null!==(r=null===(n=t.props)||void 0===n?void 0:n._ref)&&void 0!==r&&r.call(n,e)}})):o.ZP.createElement(s.T,(0,r.b)({},u,{ref:function(e){var n,r;null!==(r=null===(n=t.props)||void 0===n?void 0:n._ref)&&void 0!==r&&r.call(n,e)}}),a.insert))},e}(o.ZP.Component)},236836:function(t,e,n){"use strict";n.d(e,{T:function(){return g},Z:function(){return m}});var r=n("194055"),i=n("457341"),o=n("464675"),s=n("734795"),a=n("85359"),l=n("559016");n("294484");var u=n("651419"),c=n("65476"),d=n("101199"),f=n("52236"),h=n("489883"),p=d.forwardRef(function(t,e){return d.createElement("span",(0,r.b)({ref:e,"data-zero-space":!0},t),"")}),v=["editor","length","disableDefaultSelected","forwardRef","onSelect","onDeselect","onKeyDown","autoSelectOnClick"],g=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.tagName=h.K.TEXT,e.option={viewportEventEnabled:!0,selectEventEnabled:!0},e._leftZeroSpaceRef=d.createRef(),e._rightZeroSpaceRef=d.createRef(),e.eo=new WeakMap,e.handleKeyDown=function(t){if(e.props.onKeyDown)return e.props.onKeyDown(t);if(e.to()){var n=t.keyCode,r=!1;switch(!0){case n===s.VD.Enter:r=e.so();break;case[s.VD.Left,s.VD.Right,s.VD.Up,s.VD.Down].includes(n):r=e.io(t)}r&&(t.stopEvent(),t.stopPropagation(),t.preventDefault(),t.preventEvent())}},e.updateLeafModel=function(){var t,n,r,i=e._ref.current;i&&((n=null==(t=null===(r=e._ref.current)||void 0===r?void 0:r.closest("["+s.MB+"]"))?void 0:t.__leafModel)&&(e.props.editor._getViewModel()._setLeaf(i,n),e.eo.set(i,n)),n&&n.lineState&&(r=n.op,i=n.lineState,i=n.index===i.getOps().length-2,null!=r&&r.attributes&&i&&(e.no(e._leftZeroSpaceRef.current),e.no(e._rightZeroSpaceRef.current),e.to()?a.Xh.mobile||requestAnimationFrame(function(){var t;null!==(t=null===(t=e._ref.current)||void 0===t?void 0:t.closest("["+s.PI+"]"))&&void 0!==t&&t.setAttribute("contenteditable","false")}):t.style.margin="0 0.1px")))},e.ro=function(t){},e.oo=function(t){t&&(e.to()?t.style.display="block":t.style.display="auto")},e}(0,r.d)(e,t);var n=e.prototype;return Object.defineProperty(n,"_length",{get:function(){var t=this.props.length;return"number"==typeof t&&isFinite(t)?Math.max(t,1):1},enumerable:!1,configurable:!0}),n.handleDeleteKey=function(t){var e=t.e,n=t.stopEvent,r=t.preventEvent,i=t.isBackward,s=this.props.editor,a=s.selection.getSelection(),l=a.toPosition(),u=l.zoneId,c=l.start;if(a.isCollapsed()&&(this.to()||1!==this._length)){var d=this.getSelectionOfCurrentRef();if(d){var f=s.getContentState(),h=a.start,p=h.line,v=h.offset,t=i?d.end:d.start,l=p+-1*(i?1:-1),h=f.getZoneState(u);if(h){var g,p=h.getLine(p);if(this.to()&&t.line===l&&p&&v===(i?p.getLineMarker():p.length()-1)&&t.zoneId===a.start.zoneId)return n(),r(),e.preventDefault(),e.stopPropagation(),p.isTextEmpty()&&(g=new o.I({zoneId:u}),i?(p=p.getLineMarker()+1,g.retain(c-p).delete(p)):(g.retain(c).delete(1),d.start.line--,d.end.line--),f.apply(g)),void s.selection.setSelection(d,!0);t.line===a.start.line&&t.offset===a.start.offset&&(n(),r(),e.preventDefault(),e.stopPropagation(),(g=new o.I({zoneId:u})).retain(c+(i?-1*this._length:0)).delete(this._length),f.apply(g))}}}},n.so=function(){if(!this.isFocusOnMe())return!1;var t=this.getSelectionOfCurrentRef();if(!t)return!1;var e=this.editor.getContentState(),n=t.start,r=n.zoneId,t=n.line,n=null===(n=e.getZoneState(r))||void 0===n?void 0:n.getLine(t);return!!(n&&(t=e.rangePointToOffset({line:t,zoneId:r,offset:n.length()-1})))&&(n=new o.I({zoneId:r}).retain(t).insertEnterAndLineMarker(),e.apply(n),this.editor.selection.setSelection({start:t+2,len:0,zoneId:r}),!0)},n.io=function(t){var e,n=this.getSelectionOfCurrentRef();if(!n)return!1;var r=n.start,i=r.zoneId,o=r.line,a=this.editor.selection.getSelection(),l=a.start,u=a.end,c=l.line,d=l.offset,f=l.zoneId,r=u.line,a=u.offset;if(i!==f)return!1;var h={start:n.start,end:n.end},p=this.editor.getContentState().getZoneState(f);if(!p)return!1;if(this.isFocusOnMe()){switch(t.keyCode){case s.VD.Left:case s.VD.Up:h.start.line=Math.max(0,o-1),h.start.offset=(null!==(e=null===(e=p.getLine(h.start.line))||void 0===e?void 0:e.length())&&void 0!==e?e:1)-1,h.end=h.start;break;case s.VD.Right:case s.VD.Down:h.start.line=Math.min(p.length()-1,o+1),h.start.offset=null!==(e=null===(e=p.getLine(h.start.line))||void 0===e?void 0:e.getLineMarker())&&void 0!==e?e:0,h.end=h.start;break;default:return!1}return this.editor.selection.setSelection(h,!0),!0}return(c===o+1&&(t.keyCode===s.VD.Up&&this.uo(l)||t.keyCode===s.VD.Left&&d===(null===(c=null==p?void 0:p.getLine(c))||void 0===c?void 0:c.getLineMarker()))||!(r!==o-1||!(t.keyCode===s.VD.Down&&this.lo(u)||t.keyCode===s.VD.Right&&a+1===(null===(r=null==p?void 0:p.getLine(r))||void 0===r?void 0:r.length()))))&&(this.editor.selection.setSelection(h=n,!0),!0)},n.uo=function(t){var e=null===(n=this.editor.getContentState().getZoneState(t.zoneId))||void 0===n?void 0:n.getLine(t.line);if(!e)return!1;var n=e.getLineMarker(),e=this.editor.rectModule.getCaretRect(t,t.zoneId),t=this.editor.rectModule.getCaretRect({line:t.line,offset:n,zoneId:t.zoneId},t.zoneId);return e.top===t.top},n.lo=function(t){var e=null===(n=this.editor.getContentState().getZoneState(t.zoneId))||void 0===n?void 0:n.getLine(t.line);if(!e)return!1;var n=this.editor.rectModule.getCaretRect(t,t.zoneId),t=this.editor.rectModule.getCaretRect({line:t.line,offset:e.length()-1,zoneId:t.zoneId},t.zoneId);return n.bottom===t.bottom},n.isFocusOnMe=function(){var t=null===(e=this.getSelectionOfCurrentRef())||void 0===e?void 0:e.toPosition();if(!t)return!1;var e=this.editor.selection.getSelection().toPosition();return t.start===e.start&&t.len===e.len&&t.zoneId===e.zoneId},n.shouldComponentUpdate=function(){return!0},n.componentDidUpdate=function(e){t.prototype.componentDidUpdate.call(this,e),this._ref.current&&(this.handleRef(this._ref.current),this.updateLeafModel()),e=this.getZoneIdByCurrentRef(),this.props.editor.once(l.r.PAINT,this.updateLeafModel,{zoneId:e})},n.componentDidMount=function(){t.prototype.componentDidMount.call(this);var e=this.getZoneIdByCurrentRef();this.props.editor.on(l.r.DELETE_KEY,this.handleDeleteKey,{zoneId:e,priority:900}),this.props.editor.on(l.r.KEYDOWN,this.handleKeyDown,{zoneId:e,priority:900}),this.props.editor.once(l.r.PAINT,this.updateLeafModel,{zoneId:e})},n.componentWillUnmount=function(){var e;t.prototype.componentWillUnmount.call(this),this.props.editor.off(l.r.DELETE_KEY,this.handleDeleteKey),this.props.editor.off(l.r.KEYDOWN,this.handleKeyDown),this._ref&&this._ref.current&&this.props.editor._getViewModel()._deleteLeaf(this._ref.current),this.to()&&null!==(e=null===(e=this._ref.current)||void 0===e?void 0:e.closest("["+s.PI+"]"))&&void 0!==e&&e.removeAttribute("contenteditable")},n.to=function(){var t=(this._ref.current&&this.eo.get(this._ref.current)||{}).op,e=null==t?void 0:t.attributes;return!!e&&(t=this.props.editor.getContentState().schema,(0,c.ky)(e,t))},n.getZoneIdByCurrentRef=function(){var t=null!==(t=this._rightZeroSpaceRef.current)&&void 0!==t?t:this._ref.current;return(null===(t=null===(t=null==t?void 0:t.closest("["+s.P9+"]"))||void 0===t?void 0:t.dataset)||void 0===t?void 0:t.zoneId)||""},n.getSelectionOfCurrentRef=function(){if(!this._rightZeroSpaceRef.current&&!this._ref.current)return null;var t=null!==(t=this._rightZeroSpaceRef.current)&&void 0!==t?t:this._ref.current,t=(0,u.Ve)(t,this.props.editor);return t||null},n.handleMouseDown=function(t){var e;!1===this.props.autoSelectOnClick||(e=this.getSelectionOfCurrentRef())&&(a.Xh.isAndroid&&this.props.editor.getStatus("isComposing")&&this.editor._correctCompositionIfNecessary(t),this.props.editor.selection.setSelection(e),this.props.editor.selection.updateBrowserSelection(!0))},n._handleMouseDown=function(t){this.handleMouseDown(t)},n.handleRef=function(t){t&&(this._ref.current=t)},n.handleRightZeroSpaceRef=function(t){t&&(this.props.forwardRef&&(this.props.forwardRef.current=t),this._rightZeroSpaceRef.current=t,this.ro(t))},n.handleLeftZeroSpaceRef=function(t){t&&(this._leftZeroSpaceRef.current=t)},n.no=function(t){t&&(this.to()?(t.style.position="absolute",t.style.width="0px",t.style.height="0px",t.style.display="inline-block"):(t.style.position="",t.style.width="auto",t.style.height="auto",t.style.display="auto"))},n.render=function(){var t,e=this,n=Object.keys(this.props).reduce(function(t,n){return v.includes(n)||(n.startsWith("on")?t[n]=u.eb.includes((0,u.Le)(n))?void 0:e._handleSynthesisEvents:t[n]=e.props[n]),t},{});return a.Xh.ios&&(n.style=Object.assign({WebkitUserSelect:"none"},n.style)),d.createElement("span",(0,r.b)({},((t={})[s.Pk]=!0,t),{ref:this.oo}),d.createElement(p,{key:""+Math.random(),ref:this.handleLeftZeroSpaceRef}),d.createElement("span",(0,r.b)({},((t={})[s.eu]=" ".repeat(this._length),t),{contentEditable:!1,ref:this.handleRef,onMouseDown:this._handleMouseDown},n),this.props.children,this.props.disableDefaultSelected&&d.createElement(p,{ref:this.handleRightZeroSpaceRef})))},(0,r.a)([i.W],e.prototype,"handleDeleteKey",null),(0,r.a)([i.W],e.prototype,"_handleMouseDown",null),(0,r.a)([i.W],e.prototype,"handleRef",null),(0,r.a)([i.W],e.prototype,"handleRightZeroSpaceRef",null),(0,r.a)([i.W],e.prototype,"handleLeftZeroSpaceRef",null),e}(h.c),y=d.forwardRef(function(t,e){return d.createElement(g,(0,r.b)({},t,{forwardRef:e}))}),m=(0,f.eT)(y)},52236:function(t,e,n){"use strict";n.d(e,{eT:function(){return s},rU:function(){return o}});var r=n(194055),i=n(101199),o=i.createContext(null),s=function(t){return i.forwardRef(function(e,n){return i.createElement(o.Consumer,null,function(o){return o&&i.createElement(t,(0,r.b)({},e,{editor:o,ref:n}))})})}},818376:function(t,e,n){"use strict";n.d(e,{CL:function(){return f},ru:function(){return d},wo:function(){return h}});var r=n(194055),i=n(931173),o=n(734795);n(294484);var s=n(24453),a=n(959679),l=n(87456),u=n(101199),c=n(649146);function d(t,e,n,s){var l=this,c=(0,r.b)({},e.attributes||{}),d={op:e,lineState:t,attributes:c,insert:e.insert,domAttributes:{},children:n,class:s.class||"",lineClass:s.lineClass||"",style:s.style||{},key:"",index:s.index,zoneId:s.zoneId};return f({attributes:c,zoneId:s.zoneId,editor:s.editor}).forEach(function(t){var c,f,h,p;try{e.insert===o.Ed&&(null===(c=e.attributes)||void 0===c?void 0:c.enter)?t.renderLinefeed&&(p=t.renderLinefeed(d),d=(0,r.b)((0,r.b)({},d),{children:null!=p?p:n})):t.render&&(p=t.render(d),(0,u.isValidElement)(p)&&(0,a.l$)(n)&&null!==(h=null===(f=p.props)||void 0===f?void 0:f.className)&&void 0!==h&&h.includes(o.SX)&&l.props.editor.error({message:"plugin render failed! Objects are not valid as a React child: object info "+JSON.stringify({type:"symbol"==typeof n.type?Symbol.keyFor(n.type):n.type,ref:n.ref,className:n.props.className}),level:i.W.ERROR}),d=(0,r.b)((0,r.b)({},d),{children:null!=p?p:n}))}catch(e){s.editor.error({message:t.name+" plugin render failed! Index: "+s.index,level:i.W.ERROR})}}),{view:d.children,renderContext:d}}function f(t){var e=t.attributes,n=t.editor,r=t.zoneId,i=new Set;return Object.keys(e).forEach(function(t){""===e[t]||(t=n.pluginManager._matchPlugin({attributeKey:t,value:e[t],zoneId:r,attributes:e}))&&i.add(t)}),(0,c.iI)(Array.from(i),"render")}function h(t,e,n){for(var i,o=[],u=0,c=0;c<t.length;c++){var d,f=t[c];(p=n(f)).hasWrapper&&((d=o.length?o[o.length-1]:null)&&(0,s.z)(d.wrappers,p.elements)&&u+1===f.index?(u=f.index,d.wrapperKey+=""+l.rC+f.key,d.wrappedChildren.push(e[c])):(d={wrappedChildren:[e[c]],wrappers:p.elements,wrapperKey:""+l.Gm+f.key,startIndexInLines:c},u=f.index,o.push(d)))}if(o.length)for(var h=o.length;0<=--h;){var p,v=(p=o[h]).wrapperKey,g=p.startIndexInLines,y=p.wrappedChildren,m=function(t,e){var n=t.wrappers,i=t.wrapperKey;return n.reduce(function(t,e){return t=Array.isArray(t)?t:[t],a.Tm.apply(void 0,(0,r.e)([e,{ref:function(t){t&&(t.__key=i)}}],t))},e)}(p,y);m instanceof HTMLElement?m.__key=v:null!==(i=null==m?void 0:m.props)&&void 0!==i&&i.key&&(m.props.key=v),e.splice(g,y.length,m)}}},481685:function(t,e,n){"use strict";n.d(e,{p:function(){return S},a:function(){return u},b:function(){return d},d:function(){return h},f:function(){return v},B:function(){return I},C:function(){return C},D:function(){return g},i:function(){return c},k:function(){return y},n:function(){return b},o:function(){return E}});var r=n("16168"),i=n("639142"),o=n("454746");n("882559");function s(t,e){return void 0===e&&(e=!0),Object.keys(t).reduce(function(n,r){return!1!==e||t[r]?(n[r]="string"==typeof t[r]?t[r]:String(t[r]),n):n},{})}var a=function(){function t(t){this.ops=t,this.index=0,this.offset=0}var e=t.prototype;return e.hasNext=function(){return this.peekLength()<1/0},e.next=function(t){!t&&(t=1/0);var e=this.ops[this.index];if(!e)return{retain:1/0};var n=this.offset,r=u(e);if(t>=r-n?(t=r-n,this.index+=1,this.offset=0):this.offset+=t,c(e))return{delete:t};var i={};return e.attributes&&(i.attributes=e.attributes),d(e)?i.retain=t:h(e)?i.insert=e.insert.substr(n,t):i.insert=e.insert,i},e.peek=function(){return this.ops[this.index]},e.peekLength=function(){return this.ops[this.index]?u(this.ops[this.index])-this.offset:1/0},e.peekType=function(){return this.ops[this.index]?v(this.ops[this.index]):i.HP.RETAIN},e.rest=function(){if(!this.hasNext())return[];if(0===this.offset)return this.ops.slice(this.index);var t=this.offset,e=this.index,n=this.next(),r=this.ops.slice(this.index);return this.offset=t,this.index=e,[n].concat(r)},t}();function l(t){return new a(t)}function u(t){if(c(t))return t.delete;if(d(t))return t.retain;if(h(t))return t.insert.length;if(p(t))return 1;throw Error("op is unknown")}function c(t){return"number"==typeof(null==t?void 0:t.delete)}function d(t){return"number"==typeof(null==t?void 0:t.retain)}function f(t){return h(t)||p(t)}function h(t){return"string"==typeof(null==t?void 0:t.insert)}function p(t){return"object"==typeof(null==t?void 0:t.insert)}function v(t){var e;if(c(t))return i.HP.DELETE;if(d(t))return i.HP.RETAIN;if(h(e=t)||p(e))return i.HP.INSERT;throw Error("op is unknown")}var g=function(){function t(t,e){void 0===t&&(t={}),(e=null!=e?e:Object.keys(t).some(function(e){return t[e]instanceof I||!1}))?this._deltas=t:this._deltas=Object.keys(t).reduce(function(e,n){return e[n]=C(t[n]),e},{})}var e=t.prototype;return Object.defineProperty(e,"deltas",{get:function(){return this._deltas},enumerable:!1,configurable:!0}),e.get=function(t){return this._deltas[t]},e.compose=function(t,e,n){return void 0===e&&(e=!0),void 0===n&&(n=!0),this._call("compose",t,{keepEmptyAttributes:e,immutable:n})},e.concat=function(t){return this._call("concat",t)},e.invert=function(e){var n=new t;if(m(e))n=new t().add(e.zoneId,e);else if(b(e))n=e;else throw Error("DeltaSet invert data is wrong");return this.reduce(function(t,e){var r=n.get(e.zoneId)||e.create({zoneId:e.zoneId}),i=e.invert(r);return t.compose(i)},new t)},e.transform=function(e,n){var r=this;if(void 0===n&&(n=!1),m(e))return e.zoneId in this.deltas?this.deltas[e.zoneId].transform(e,n):e;if(b(e))return new t(e.reduce(function(t,e){return t[e.zoneId]=r.transform(e,n),t},{}));throw Error("DeltaSet call data is wrong")},e.delete=function(t){return delete this._deltas[t],this},e.add=function(t,e){if(m(t)){var n=t.zoneId;this._deltas[n]=t}else{if(!e)return this;var n=t;if(e.zoneId!==n)return this;this._deltas[n]=e}return this},e.replace=function(t,e){return this.delete(t).add(e.zoneId,e),this},e._call=function(e,n,r){if(m(n))return this._callDeltaFunc(e,n,r);if(b(n)){var i=new t(this.deltas);return n.forEach(function(t){i=i._callDeltaFunc(e,t,r)}),i}throw Error("DeltaSet call: data: "+n+" is not Delta or DeltaSet")},e._callDeltaFunc=function(e,n,i){var o=Object.assign({keepEmptyAttributes:!0,immutable:!0},i),s=n.zoneId,a=o.immutable?(0,r.a)({},this.deltas):this.deltas;if(this.deltas[s])a[s]=this.deltas[s][e](n,o.keepEmptyAttributes);else{var l=n.zoneType;a[s]=n.create({zoneId:s,zoneType:l})[e](n,o.keepEmptyAttributes)}return new t(a,!0)},e.reduce=function(t,e){var n=this;return Object.keys(this._deltas).map(function(t){return n._deltas[t]}).reduce(t,e)},e.forEach=function(t){var e,n;try{for(var i=(0,r.b)(Object.entries(this._deltas)),o=i.next();!o.done;o=i.next()){var s=(0,r._)(o.value,2),a=s[0],l=s[1];t(l,a)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}},t}();function y(t){return t.insert===i.F5&&t.attributes&&t.attributes.lmkr}function m(t){return Object.values(i.Ak).includes(t.zoneType)}function b(t){return void 0!==t.deltas}function E(t){var e;return!t||(null===(e=null==t?void 0:t.ops)||void 0===e?void 0:e.length)===0}function S(t){if(!t)return!0;var e=t.deltas,n=Object.keys(e);return 0===n.length||!n.some(function(t){return!E(e[t])})}var I=function(){function t(){this.ops=[]}var e=t.prototype;return t.registerCreator=function(e,n){t.creators.set(e,n)},t.getCreator=function(e){return t.creators.get(e)},e.insert=function(t,e,n){if(void 0===n&&(n=!0),"string"==typeof t&&0===t.length)return this;var r={insert:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(r.attributes=s(e,n)),this.push(r)},e.delete=function(t){return t<=0?this:this.push({delete:t})},e.retain=function(t,e){if(t<=0)return this;var n={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=s(e)),this.push(n)},e.forEach=function(t){this.ops.forEach(t)},e.eachLine=function(t,e){void 0===e&&(e=i.K5);for(var n=l(this.ops),r=0,o={},s=[];n.hasNext();){if(n.peekType()!==i.HP.INSERT)return;var a=n.peek();y(a)&&(o=a.attributes||{});var c=u(a)-n.peekLength(),d="string"==typeof a.insert?a.insert.indexOf(e,c)-c:-1;if(d<0)s.push(n.next());else{if(s.push(n.next(d+1)),!1===t(this.create({zoneId:this.zoneId,ops:s}),o,r))return;s=[],o={},r+=1}}var f=this.create({zoneId:this.zoneId,ops:s});f.length()>0&&t(f,o,r)},e.push=function(t){if(c(t)&&t.delete<=0||d(t)&&t.retain<=0||h(t)&&0===t.insert.length)return this;var e,n,i=this.ops.length,s=this.ops[i-1];if(e=t,n=(0,r.a)({},e),e.attributes&&(n.attributes=(0,r.a)({},e.attributes)),t=n,"object"==typeof s){if(c(t)&&c(s))return this.ops[i-1]={delete:s.delete+t.delete},this;if((0,o.X)(t.attributes,s.attributes)){if(h(t)&&h(s))return this.ops[i-1]={insert:s.insert+t.insert},"object"==typeof t.attributes&&(this.ops[i-1].attributes=t.attributes),this;if(d(t)&&d(s))return this.ops[i-1]={retain:s.retain+t.retain},"object"==typeof t.attributes&&(this.ops[i-1].attributes=t.attributes),this}}return i===this.ops.length?this.ops.push(t):this.ops.splice(i,0,t),this},e.compose=function(t,e){if(void 0===e&&(e=!0),!1===e){var n=t.zoneId,a=t.zoneType;t=t.reduce(function(t,n){return n.insert&&n.attributes&&(n.attributes=s(n.attributes,e)),t.push(n),t},this.create({zoneId:n,zoneType:a}))}var u=l(this.ops),f=l(t.ops),p=[],v=f.peek();if(null!=v&&d(v)&&null==v.attributes){for(var g=v.retain;u.peekType()===i.HP.INSERT&&u.peekLength()<=g;)g-=u.peekLength(),p.push(u.next());v.retain-g>0&&f.next(v.retain-g)}for(var y=this.create({zoneId:this.zoneId,zoneType:this.zoneType,ops:p});u.hasNext()||f.hasNext();)if(f.peekType()===i.HP.INSERT)y.push(f.next());else if(u.peekType()===i.HP.DELETE)y.push(u.next());else{var m=Math.min(u.peekLength(),f.peekLength()),b=u.next(m),E=f.next(m);if(c(E)&&h(b));else if(c(E)&&d(b))y.push(E);else if(d(E)){var S={};d(b)?S.retain=m:S.insert=b.insert;var I=function(t,e,n){void 0===t&&(t={}),void 0===e&&(e={}),"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var i=(0,r.a)({},e);for(var o in!n&&(i=Object.keys(i).reduce(function(t,e){return null!==i[e]&&""!==i[e]&&(t[e]=i[e]),t},{})),t)void 0!==t[o]&&void 0===e[o]&&(i[o]=t[o]);return Object.keys(i).length>0?i:void 0}(b.attributes,E.attributes,e);if(I&&(S.attributes=I),y.push(S),!f.hasNext()&&(0,o.X)(y.ops[y.ops.length-1],S)){var C=this.create({zoneId:this.zoneId,zoneType:this.zoneType,ops:u.rest()});return y.concat(C).chop()}}}return y.chop()},e.concat=function(t){var e=this.create({zoneId:this.zoneId,zoneType:this.zoneType,ops:this.ops.slice()});return t.ops.length>0&&(e.push(t.ops[0]),e.ops=e.ops.concat(t.ops.slice(1))),e},e.length=function(){return this.reduce(function(t,e){return t+u(e)},0)},e.reduce=function(t,e){return this.ops.reduce(t,e)},e.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},e.transform=function(t,e){if(void 0===e&&(e=!1),e=!!e,"number"==typeof t)return this.transformPosition(t,e);for(var n=l(this.ops),r=l(t.ops),o=this.create({zoneId:this.zoneId,zoneType:this.zoneType});n.hasNext()||r.hasNext();)if(n.peekType()===i.HP.INSERT&&(e||r.peekType()!==i.HP.INSERT))o.retain(u(n.next()));else if(r.peekType()===i.HP.INSERT)o.push(r.next());else{var s=Math.min(n.peekLength(),r.peekLength()),a=n.next(s),d=r.next(s);if(c(a))continue;c(d)?o.push(d):o.retain(s,function(t,e,n){if(void 0===t&&(t={}),void 0===e&&(e={}),void 0===n&&(n=!1),"object"!=typeof t)return e;if("object"==typeof e){if(!n)return e;var r=Object.keys(e).reduce(function(n,r){return void 0===t[r]&&(n[r]=e[r]),n},{});return Object.keys(r).length>0?r:void 0}}(a.attributes,d.attributes,e))}return o.chop()},e.transformPosition=function(t,e){void 0===e&&(e=!1),e=!!e;for(var n=l(this.ops),r=0;n.hasNext()&&r<=t;){var i=n.peekLength(),o=n.peekType();if(n.next(),"delete"===o){t-=Math.min(i,t-r);continue}"insert"===o&&(r<t||!e)&&(t+=i);r+=i}return t},e.slice=function(t,e){void 0===t&&(t=0),void 0===e&&(e=1/0);for(var n=[],r=l(this.ops),i=0;i<e&&r.hasNext();){var o=void 0;i<t?o=r.next(t-i):(o=r.next(e-i),n.push(o)),i+=u(o)}return this.create({zoneId:this.zoneId,zoneType:this.zoneType,ops:n})},e.invert=function(t){var e=this.create({zoneId:this.zoneId,zoneType:this.zoneType});return this.reduce(function(n,r){var i;if(h(i=r)||p(i))e.delete(u(r));else if(d(r)&&!r.attributes)return e.retain(r.retain),n+r.retain;else if(c(r)||d(r)&&r.attributes){var o=r.delete||r.retain;return t.slice(n,n+o).forEach(function(t){if(c(r))e.push(t);else if(d(r)&&r.attributes){var n,i,o;e.retain(u(t),(n=r.attributes,i=t.attributes,void 0===n&&(n={}),void 0===i&&(i={}),n=n||{},o=Object.keys(i).reduce(function(t,e){return i[e]!==n[e]&&void 0!==n[e]&&(t[e]=i[e]),t},{}),Object.keys(n).reduce(function(t,e){return n[e]!==i[e]&&void 0===i[e]&&(t[e]=""),t},o)))}}),n+o}return n},0),e.chop()},t.creators=new Map,t}();function C(t){var e=I.getCreator(t.zoneType);return new e(t)}},639142:function(t,e,n){"use strict";n.d(e,{Ak:function(){return s},F5:function(){return l},HP:function(){return o},K5:function(){return a}}),(r=o||(o={})).DELETE="delete",r.RETAIN="retain",r.INSERT="insert",(i=s||(s={})).Content="Z",i.Row="R",i.Column="C";var r,i,o,s,a="\n",l="*";s.Content,s.Row,s.Column},332535:function(t,e,n){"use strict";n.d(e,{Jg:function(){return o},eV:function(){return i}});var r=n(639142);function i(t){return!!(t.insert===r.F5&&t.attributes&&t.attributes.lmkr)}function o(t){return"object"==typeof t.insert&&t.insert.id}},16168:function(t,e,n){"use strict";n.d(e,{_:function(){return a},a:function(){return o},b:function(){return s},c:function(){return i}});var r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function s(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}},464675:function(t,e,n){"use strict";n.d(e,{I:function(){return s}});var r=n("16168"),i=n("639142");n("882559");var o=n("481685"),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}(0,r.c)(e,t);var n=e.prototype;return n.create=function(t){return t.zoneType=t.zoneType||this.zoneType,new e(t)},n.insert=function(e,n){return t.prototype.insert.call(this,e,n,!1)},n.insertLineMarker=function(t){void 0===t&&(t={});var e=Object.assign({lmkr:1},t);return this.insert(i.F5,e),this},n.insertEnterAndLineMarker=function(t){this.insert(i.K5,t&&t.enterAttributes?t.enterAttributes:{});var e=Object.assign({lmkr:1},t&&t.lineAttributes?t.lineAttributes:{});return this.insert(i.F5,e),this},e}(function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;n.ops=[];var r=e.zoneId,o=e.ops;return n.zoneId=r||"0",n.zoneType=i.Ak.Content,o&&o.length>0&&(n.ops=o),n}(0,r.c)(e,t);var n=e.prototype;return n.create=function(t){return t.zoneType=t.zoneType||this.zoneType,new e(t)},n.insertEnter=function(t){return void 0===t&&(t={}),this.insert(i.K5,t),this},n.insertEnterAndLineMarker=function(t){return this},n.insertLineMarker=function(t){return this},e}(o.B));o.B.registerCreator(i.Ak.Content,s)},125270:function(t,e,n){"use strict";n.d(e,{Z:function(){return a},a:function(){return l}});var r=n(159751),i=n(455793);n(101199),n(890710);var o=n(777767),s=n(959679);function a(t,e,n,a){if(!n)return;var l,u,c,d,f,h=(a||{}).PluginContextProvider;h&&(0,i.RM)(h),(0,i.aZ)("DOM"),i.L3.length=0;var p=(0,s.az)(t,e);if(h&&(0,i.RM)(null),!!p){Array.isArray(p)?n.append.apply(n,(0,r.d)(p)):n.append(p);for(var v=[];i.L3.length;){var g=(0,r.b)(null!==(l=i.L3.shift())&&void 0!==l?l:[],3),y=g[0],m=g[1],b=g[2];if(!(!b&&Array.isArray(m))){if((0,o.AL)(b))for(var E=0;E<i.L3.length;++E){var S=(0,r.b)(i.L3[E],3)[2];if((null===(c=null===(u=null==S?void 0:S.props)||void 0===u?void 0:u.state)||void 0===c?void 0:c.reactInXInstanceList)&&Array.isArray(S.props.state.reactInXInstanceList)&&S.renderContext){b.props.pluginRenderContext=S.renderContext;break}}if(null==y||y(b||m||null),null==b||b.componentDidMount(),(null===(f=null===(d=null==b?void 0:b.props)||void 0===d?void 0:d.state)||void 0===f?void 0:f.reactInXInstanceList)&&Array.isArray(b.props.state.reactInXInstanceList)){var I=b.props.state.reactInXInstanceList;I.splice.apply(I,(0,r.d)([0,I.length],v)),v.length=0}(0,o.AL)(b)&&v.push(b)}}return p}}function l(t){(function t(e){try{for(var n,i,o,s,a,l,u=(0,r.a)(e),c=u.next();!c.done;c=u.next()){var d=c.value;if(!!(null==d?void 0:d.instance)){d.instance.componentWillUnmount();var f=null===(a=d.instance.props.editor)||void 0===a?void 0:a.getFg("enableVirtualMemoryOptimize"),h=null===(l=d.instance)||void 0===l?void 0:l.state;d.instance=null,f&&d.setNode(null);var p=h||d,v=null==p?void 0:p.reactInXInstanceList;if(Array.isArray(v)){try{for(var g=(o=void 0,(0,r.a)(v)),y=g.next();!y.done;y=g.next())y.value.unmount()}catch(t){o={error:t}}finally{try{y&&!y.done&&(s=g.return)&&s.call(g)}finally{if(o)throw o.error}}f&&(p.reactInXInstanceList=[])}var m=p.getState();t(Array.isArray(m)?m:[m])}}}catch(t){n={error:t}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}})([t])}},92203:function(t,e,n){"use strict";n.d(e,{y:function(){return i}});var r=n(159751),i=function(t){function e(e){var n=t.call(this)||this;return n.props=e,n}return(0,r.c)(e,t),e.prototype.render=function(){return null},e}(function(){function t(){}var e=t.prototype;return e.componentDidMount=function(){},e.componentDidUpdate=function(t){},e.componentWillUnmount=function(){},e.shouldComponentForceUpdate=function(t,e){return!1},e.componentWillReceiveProps=function(t){},t}());i.prototype.isXComponent=!0},494403:function(t,e,n){"use strict";n.d(e,{A:function(){return d},BG:function(){return a},Br:function(){return f},D_:function(){return p},HY:function(){return i},Li:function(){return c},Nh:function(){return h},Ol:function(){return u},Ul:function(){return l},ZC:function(){return o},xv:function(){return s}});var r,i=Symbol.for("x.fragment"),o=Symbol.for("x.div"),s=Symbol.for("x.text"),a=Symbol.for("x.zero_space"),l=Symbol.for("x.ul"),u=Symbol.for("x.ol"),c=Symbol.for("x.li"),d=Symbol.for("x.a"),f=Symbol.for("x.br"),h=Symbol.for("x_element_type"),p=((r={})[o]="div",r[s]="span",r[a]="span",r[l]="ul",r[u]="ol",r[c]="li",r[d]="a",r[f]="br",r)},87456:function(t,e,n){"use strict";n.d(e,{A5:function(){return s},Gm:function(){return c},T6:function(){return u},Uu:function(){return l},rC:function(){return d}});var r,i,o,s,a,l,u="";(r=s||(s={})).ATTACH_REF="ATTACH_REF",r.DETACH_REF="DETACH_REF",r.DID_MOUNT="DID_MOUNT",r.DID_UPDATE="DID_UPDATE",r.WILL_UNMOUNT="WILL_UNMOUNT",r.REACT_IN_X_FORCE_UPDATE="REACT_IN_X_FORCE_UPDATE";var c="M-",d="-";(i=a||(a={}))[i.EQUAL=0]="EQUAL",i[i.UNEQUAL=1]="UNEQUAL",i[i.UPDATE=2]="UPDATE",(o=l||(l={}))[o.ZONE=0]="ZONE",o[o.LINE_UPDATE=1]="LINE_UPDATE",o[o.LINE_CONSTANT=2]="LINE_CONSTANT",o[o.LINE_INSERT=3]="LINE_INSERT",o[o.LINE_DELETE=4]="LINE_DELETE",o[o.LEAF_UPDATE=5]="LEAF_UPDATE",o[o.LEAF_CONSTANT=6]="LEAF_CONSTANT",o[o.LEAF_INSERT=7]="LEAF_INSERT",o[o.LEAF_DELETE=8]="LEAF_DELETE"},186331:function(t,e,n){"use strict";n.d(e,{C:function(){return o},b:function(){return i}});var r=n(494403);function i(t){return t===r.ZC||t===r.xv||t===r.BG||t===r.Ul||t===r.Ol||t===r.Li||t===r.A||t===r.Br}function o(t){return t===r.HY}},455793:function(t,e,n){"use strict";n.d(e,{$i:function(){return g},F:function(){return a},HA:function(){return l},L3:function(){return s},RM:function(){return p},WC:function(){return f},Xd:function(){return c},Yn:function(){return m},aZ:function(){return u},gS:function(){return o},hb:function(){return y},u1:function(){return d},xi:function(){return h}});var r="V-DOM",i=null,o=new WeakMap,s=[];function a(t){s.push(t)}function l(){return r}function u(t){r=t}var c=[],d=[];function f(){c.length=0}function h(){return i}function p(t){i=t}var v=!1;function g(t){t&&(r="DOM",s.length=0),v=t}function y(){return v}var m={renderToStaticMarkup:function(t){return"外部没有传入 react-dom/server's renderToStaticMarkup 方法,无法渲染 react component"}}},777767:function(t,e,n){"use strict";n.d(e,{AL:function(){return d},CR:function(){return c},I2:function(){return u}});var r=n(159751),i=n(455793),o=n(101199),s=n(378374),a=n(890710),l=n(92203),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}(0,r.c)(e,t);var n=e.prototype;return n.getComponent=function(){var t,e,n,i=this.props,a=i.reactElement,l=i.ReactContextProvider,u=i.pluginRenderContext;return t=a,e=l,n=u,function(i){function a(){var t=null!==i&&i.apply(this,arguments)||this;return t.state={renderContext:n},t}return(0,r.c)(a,i),a.prototype.render=function(){var n=Array.isArray(t)?t:[t];return o.createElement(s.x.Provider,{value:{renderContext:this.state.renderContext}},e?o.createElement.apply(o,(0,r.d)([e,null],n)):n)},a}(o.Component)},n.componentDidMount=function(){var t=this,e=this.props.container;if(!!e){var n=this.getComponent();a.render(o.createElement(n,{ref:function(e){t.reactComponentRef=e}}),e)}},n.componentWillUnmount=function(){var t=this.props.container;t&&a.unmountComponentAtNode(t)},n.unmount=function(){var t=this.props.container;t&&a.unmountComponentAtNode(t)},n.forceUpdate=function(t){var e;null===(e=this.reactComponentRef)||void 0===e||e.setState({renderContext:t})},n.render=function(){if((0,i.hb)()){var t=this.getComponent(),e=i.Yn.renderToStaticMarkup(o.createElement(t,null)),n=document.createElement("div");return n.innerHTML=e,n.firstChild}return null},e.type="ReactInX",e}(l.y);function c(t){return(null==t?void 0:t.type)===u.type}function d(t){return t&&t instanceof u}},378374:function(t,e,n){"use strict";n.d(e,{v:function(){return o},x:function(){return i}});var r=n(101199),i=r.createContext({renderContext:null}),o=function(t){return r.createElement(i.Consumer,null,function(e){return t(e.renderContext)})}},430970:function(t,e,n){"use strict";n.d(e,{x:function(){return o}});var r=n(455793);n(101199);var i=n(378374);function o(){return function(t,e,n){var o=n.value;n.value=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this,s=o.apply(n,t);return(0,i.v)(function(t){return(0,r.hb)()?s:t?o.apply(n,[t]):null})}}}},283138:function(t,e,n){"use strict";n(101199),n(890710);var r=n(651271);e.ZP=r.C},959679:function(t,e,n){"use strict";n.d(e,{az:function(){return L},l$:function(){return w},Tm:function(){return x},LM:function(){return S},GE:function(){return I}});var r,i=n("494403"),o=n("159751"),s=n("696519"),a=n("375518"),l=n("253966"),u=n("611437"),c=n("87456"),d=n("689791"),f=((r={})[i.HY]=function(){},r[i.ZC]=function(t){var e=document.createElement("div");return(0,u.T)(e,t),e},r[i.xv]=function(t){var e=t.content,n=(0,o._)(t,["content"]),r=document.createElement("span");return(0,u.T)(r,n),"string"==typeof e&&(r.textContent=e),r},r[i.BG]=function(t){var e=document.createElement("span");return(0,u.T)(e,t),e.setAttribute("data-zero-space","true"),e.textContent=c.T6,e},r[i.Ul]=function(t){var e=document.createElement("ul");return(0,u.T)(e,t),e},r[i.Ol]=function(t){var e=document.createElement("ol");return(0,u.T)(e,t),e},r[i.Li]=function(t){var e=document.createElement("li");return(0,u.T)(e,t),e},r[i.A]=d.J,r[i.Br]=function(t){var e=document.createElement("br");return(0,u.T)(e,t),e},r),h=n("455793"),p=n("101199"),v=function(t){return p.isValidElement(t)};n("890710");var g=n("777767"),y={ref:!0,children:!0},m=["key","__source","__self"],b=Symbol("type"),E=Symbol("props");function S(t,e){var n=new t(e);return e.state&&(h.gS.set(e.state.constructor,t),e.state.instance=n),{element:n.render(),instance:n}}function I(t,e,n){for(var r,i,l,u,c,d=[],p=3;p<arguments.length;p++)d[p-3]=arguments[p];var v=null,y=null;if("symbol"==typeof t){;r=t,i=e,l=null,f[r]&&(l=(0,f[r])((0,s.C)(i,m))),y=[n,v=l,null]}else if("function"==typeof t){var I=S(t,e);y=[n,v=I.element,I.instance]}if(!v||Array.isArray(v))return y&&h.L3.push(y),v;var C=d.find(function(t){return!(w(t)&&(0,g.CR)(t.type))}),L=[];try{for(var x=(0,o.a)(d.entries()),_=x.next();!_.done;_=x.next()){var T=(0,o.b)(_.value,2),A=T[0],M=T[1];if(!w(M)){L.push(M);continue}if((0,g.CR)(M.type)){var k=v,N=C?(0,a.P)(k)?document.createElement("div"):document.createElement("span"):k,R=S(M.type,(0,o.e)((0,o.e)({},M.props),{container:N})).instance,O=function(t,e){if(1===e.length&&0===t)return Math.max(h.L3.length-1,0);if(t>0){var n=e[t-1],r=h.L3.findIndex(function(t){var e=t[1];return Array.isArray(e)?e[e.length-1]===n:e===n});return r<0?Math.max(h.L3.length-1,0):r+1}for(var i=null,o=t+1;o<e.length;o++)if(!w(e[o])){i=e[o];break}if(!i)return Math.max(h.L3.length-1,0);var s=h.L3.findIndex(function(t){var e=t[1];return Array.isArray(e)?e[0]===i:e===i});return s<0?Math.max(h.L3.length-1,0):Math.max(s-1,0)}(A,d);h.L3.splice(O,0,[M.ref,null,R]),N!==k&&L.push(N)}}}catch(t){u={error:t}}finally{try{_&&!_.done&&(c=x.return)&&c.call(x)}finally{if(u)throw u.error}}return y&&h.L3.push(y),v.append.apply(v,(0,o.d)(L)),v[b]=t,v[E]=e,v}function C(t,e,n){for(var r=[],s=3;s<arguments.length;s++)r[s-3]=arguments[s];return Object.assign(e,{children:(0,o.d)(r)}),{__typeof:i.Nh,type:t,props:e,ref:n,key:null}}function L(t,e){for(var n,r,s,a,u=[],c=2;c<arguments.length;c++)u[c-2]=arguments[c];if(!(("symbol"==typeof(n=t)||"function"==typeof n)&&("symbol"!=typeof n||f[n])&&("function"!=typeof n||!n.prototype||n.prototype.isXComponent)))return null;var d=function(t){for(var e=[],n=(0,l.Y)((0,o.d)(t),1/0),r=0;r<n.length;r++){var i=n[r];if(!!i){var s=Object.prototype.toString.call(i);if(s.includes("Function"))throw Error("Function is invalid child");if((s.includes("String")||s.includes("Number")||s.includes("BigInt"))&&e.push(""+i),(s.includes("HTML")||w(i))&&e.push(i),v(i)){for(var a=[i],u=n[r+1];v(u);)a.push(u),u=n[++r+1];e.push(L(g.I2,{container:null,pluginRenderContext:null,reactElement:a,ReactContextProvider:(0,h.xi)()}))}}}return e}((r=null!==(a=null==e?void 0:e.children)&&void 0!==a?a:null,(s=(0,o.d)(u)).length?(0,o.d)(s):r?Array.isArray(r)?(0,o.d)(r):[r]:[]));if(t===i.HY)return d;var p=null;(null==e?void 0:e.ref)!==void 0&&"function"==typeof e.ref&&(p=e.ref);var m={};if(e)for(var b in e)Object.prototype.hasOwnProperty.call(e,b)&&!y[b]&&(m[b]=e[b]);return"V-DOM"===(0,h.HA)()||(0,g.CR)(t)&&!(0,h.hb)()?C.apply(void 0,(0,o.d)([t,m,p],d)):"DOM"===(0,h.HA)()?I.apply(void 0,(0,o.d)([t,m,p],d)):null}function w(t){return"object"==typeof t&&null!==t&&t.__typeof===i.Nh}function x(t,e){for(var n,r,i,s=[],a=2;a<arguments.length;a++)s[a-2]=arguments[a];return null===t?null:(t instanceof HTMLElement?(n=t[b],r=t[E],i=Array.from(t.childNodes)):(n=t.type,r=t.props,i=t.props.children),L.apply(void 0,(0,o.d)([n,(0,o.e)((0,o.e)({},r),e)],i,s)))}},548553:function(t,e,n){"use strict";n.d(e,{MA:function(){return c},Yz:function(){return s},ZA:function(){return d},_c:function(){return h},gX:function(){return f},uA:function(){return p}});var r,i,o,s,a=n(159751),l=n(683208),u=n(128168);function c(t){t.forEach(function(t){var e,n;switch(t.type){case o.TEXT:var r=t.node,i=t.text;r.firstChild&&(r.firstChild.nodeValue=i);break;case o.ATTRIBUTES:var r=t.node,c=t.attrs;if(r instanceof Text)break;try{for(var d=(0,a.a)(c),f=d.next();!f.done;f=d.next()){var h=f.value,p=h.type,v=h.key,g=h.value;if(p===s.STYLE)(0,u.A)(r.style,v,g);else{var y="className"===v?"class":v;g?r.setAttribute(y,g):r.removeAttribute(y)}}}catch(t){e={error:t}}finally{try{f&&!f.done&&(n=d.return)&&n.call(d)}finally{if(e)throw e.error}}break;case o.REMOVE:var r=t.node;r.remove();break;case o.APPEND:var r=t.node,m=t.parentNode;m.append(r);break;case o.INSERT_BEFORE:var r=t.node,m=t.parentNode,b=t.referenceNode;if(b&&!m.contains(b))throw Error("referenceNode was unexpectedly deleted and is no longer a child node of parentNode\nreferenceNode: "+(0,l.F)(b)+"\nparentNode: "+(0,l.F)(m)+"\nreferenceNodeIndex: "+b.__index);m.insertBefore(r,b)}})}function d(t){return{type:o.REMOVE,node:t}}function f(t,e,n){return n?{type:o.INSERT_BEFORE,node:t,referenceNode:n,parentNode:e}:{type:o.APPEND,node:t,parentNode:e}}function h(t,e){return{type:o.ATTRIBUTES,node:t,attrs:e}}function p(t,e){return{type:o.TEXT,node:t,text:e}}(r=o||(o={})).TEXT="TEXT",r.ATTRIBUTES="ATTRIBUTES",r.APPEND="APPEND",r.REMOVE="REMOVE",r.INSERT_BEFORE="INSERT_BEFORE",(i=s||(s={})).STYLE="STYLE",i.ATTRIBUTES="ATTRIBUTES"},611437:function(t,e,n){"use strict";n.d(e,{T:function(){return i}});var r=n(159751);function i(t,e){var n,i,o,s,a,l,u,c,d,f,h=e.on,p=void 0===h?{}:h,v=e.dataset,g=e.style,y=e.className,m=(0,r._)(e,["on","dataset","style","className"]);try{for(var b=(0,r.a)(Object.entries(m)),E=b.next();!E.done;E=b.next()){var S=(0,r.b)(E.value,2),I=S[0],C=S[1];if(I.startsWith("on")){var L=I.substring(2).toLowerCase();p[L]=C,delete m[I]}}}catch(t){n={error:t}}finally{try{E&&!E.done&&(i=b.return)&&i.call(b)}finally{if(n)throw n.error}}if(Object.keys(p).length>0)try{for(var w=(0,r.a)(Object.keys(p)),x=w.next();!x.done;x=w.next()){var L=x.value,_=p[L];try{t.addEventListener(L,_)}catch(t){throw Error("[DOM-renderer]: addEventListener failed, eventName: "+L+", handler: "+_+", msg: "+t.message)}}}catch(t){o={error:t}}finally{try{x&&!x.done&&(s=w.return)&&s.call(w)}finally{if(o)throw o.error}}if(v)try{for(var T=(0,r.a)(Object.entries(v)),A=T.next();!A.done;A=T.next()){var M=(0,r.b)(A.value,2),k=M[0],N=M[1];t.dataset[k]=""+N}}catch(t){a={error:t}}finally{try{A&&!A.done&&(l=T.return)&&l.call(T)}finally{if(a)throw a.error}}if(g){var R="";try{for(var O=(0,r.a)(Object.entries(g)),D=O.next();!D.done;D=O.next()){var z=(0,r.b)(D.value,2),k=z[0],N=z[1],P=k.replace(/[A-Z]/g,function(t){return"-"+t.toLowerCase()}),Z="number"==typeof N?N+"px":N;R+=P+":"+Z+";"}}catch(t){u={error:t}}finally{try{D&&!D.done&&(c=O.return)&&c.call(O)}finally{if(u)throw u.error}}R&&t.setAttribute("style",R)}y&&t.setAttribute("class",y);try{for(var W=(0,r.a)(Object.keys(m)),K=W.next();!K.done;K=W.next()){var U=K.value;t.setAttribute(U,e[U])}}catch(t){d={error:t}}finally{try{K&&!K.done&&(f=W.return)&&f.call(W)}finally{if(d)throw d.error}}return t}},128168:function(t,e,n){"use strict";function r(t){return t.split(";").reduce(function(t,e){if(!e.trim())return t;var n=e.split(":");return t[n[0].trim().toLowerCase().replace(/([-][a-z])/g,function(t){return t.toUpperCase().replace("-","")})]=n[1].trim(),t},{})}function i(t,e,n){"-"===e[0]?t.setProperty(e,n):null===n?t[e]="":"number"!=typeof n?t[e]=n:t[e]=n+"px"}n.d(e,{A:function(){return i},R:function(){return r}})},682647:function(t,e,n){"use strict";n.d(e,{p:function(){return p}});var r=n(144847),i=n(162114),o=n(649146),s=n(386308),a=n(283138),l=n(651271),u=n(464675),c=n(754209),d=n(323145);function f(){return{paddingLeft:"12px",color:"var(--text-caption, "+d.mg+")",borderLeft:"2px solid var(--udtoken-quote-bar-bg, "+d.xS+")"}}var h=a.ZP.createElement(l.D,{style:f(),className:"blockquote"}),p=function(t){function e(n){var r=n.editor,i=t.call(this)||this;return i.name="Blockquote",r.registerCommand(e.KEY,function(t){var n=t.value;(0,c.B)(r,e.KEY,n,!0)}),i}(0,r.d)(e,t);var n=e.prototype;return n.renderWrapper=function(){return h},n.match=function(t){return t===e.KEY},n.editorWillDoReturnKey=function(t){var n=t.delta,r=t.editor,i=r.getContentState().getActiveZone(),o=i.getZoneId(),s=r.selection.getSelection(),a=s.toPosition(),l=a.start,c=a.len,d=i.getLine(s.start.line);if(!!d){var f=d.getLineAttributes().toMap(),h=d.isTextEmpty();if(!n.ops.length&&f[e.KEY]&&!c){var p=new u.I({zoneId:o});h?(f.blockquote="",p.retain(l-1).retain(1,f)):p.retain(l).insertEnter().insertLineMarker(f),t.delta=n.compose(p)}}},n.editorWillDoDeleteKey=function(t){var n=t.deltaSet,r=t.editor,i=r.getContentState().getActiveZone(),o=i.getZoneId(),s=r.selection.getSelection(),a=i.getLine(s.start.line);if(!!a){var l=a.getLineAttributes().toMap(),c=s.toPosition(),d=c.start,f=c.len,h=1===s.start.offset;if(!n.get(o).ops.length&&l[e.KEY]&&h&&!f){l[e.KEY]="";var p=new u.I({zoneId:o}).retain(d-1).retain(1,l);t.deltaSet=n.compose(p)}}},n.serialize=function(t){return(0,i.i)(t,{tagAttribute:e.KEY,wrapNodesInfo:[{tag:e.KEY,style:(0,r.g)((0,r.g)({},f()),{margin:"0px",paddingLeft:"0px",color:d.mg,borderLeft:"2px solid "+d.xS})}]})},n.deserialize=function(t){var n=t.node,r=t.deltaSet,o=t.zoneId;if(n instanceof HTMLElement){var s=n.className,a=n.tagName;if(s.indexOf(e.KEY)>-1||"BLOCKQUOTE"===a)return(0,i.e)(r,o,{blockquote:"true"})}return r},e.KEY="blockquote",e.isFormatter=!0,e.isLineAttribute=!0,(0,r.e)([(0,o.gv)(1003)],e.prototype,"serialize",null),e}(s.S)},440050:function(t,e,n){"use strict";n.d(e,{d:function(){return d}});var r=n("144847"),i=n("559016"),o=n("162114"),s=n("650054");n("399884"),n("707574");var a=n("386308"),l=n("811492"),u=function(t){function e(e){var n=e.editor,r=t.call(this)||this;return r.name="Bold",r.editor=n,r}(0,r.d)(e,t);var n=e.prototype;return n.match=function(t){return t===e.KEY},n.render=function(t){var e=t.children;return t.style.fontWeight="bold",e},e.KEY="bold",(0,r.e)([l.P],e.prototype,"render",null),e}(a.S),c=function(t){var e=t.tagName,n=t.getAttribute("style")||"";return"B"===e||"STRONG"===e||/\bfont-weight:\s*bold\b/i.test(n)},d=function(t){function e(n){var r=t.call(this,n)||this;r.handleInput=function(t){"formatBold"===t.inputType&&(t.preventEvent(),t.preventDefault(),t.stopEvent(),r.editor.toggleAttribute(e.KEY))};var o=r.editor;return o.registerCommand(e.KEY,function(){o.toggleAttribute(e.KEY)}),o.on(i.r.INPUT,r.handleInput),r}(0,r.d)(e,t);var n=e.prototype;return n.deserialize=function(t){var e=t.node,n=t.deltaSet,r=t.zoneId;return e&&e instanceof HTMLElement&&c(e)?(0,o.d)(n,r,{bold:"true"},!1):n},n.serialize=function(t){return(0,o.w)(t,{tagAttribute:"bold",wrapTag:s.c5.bold})},e}(u)},518514:function(t,e,n){"use strict";n.d(e,{C:function(){return S}});var r=n("144847"),i=n("495907"),o=n("386308"),s=n("430970"),a=n("811492");n("399884"),n("707574");var l=n("101199"),u=/\\begin\n*\{(equation|split|align|gather|alignat|CD)\}|\\tag/,c=n("651419"),d=n("559016"),f=n("333475"),h=n("809919"),p=n("236836"),v=n("52236"),g=n("689057"),y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.handleKeyDown=function(t){if(e.props.onKeyDown)return e.props.onKeyDown(t);var n=t.keyCode,r=!1;switch(n){case g.VD.Left:case g.VD.Right:case g.VD.Up:case g.VD.Down:r=e._handleArrowKey(t)}r&&(t.stopEvent(),t.stopPropagation(),t.preventDefault(),t.preventEvent())},e._handleArrowKey=function(t){if(t.shiftKey)return!1;var n,r,i,o,s=e.editor.selection.getSelection().toPosition(),a=e.getSelectionOfCurrentRef();if(!a)return!1;var l=a.toPosition();return!(s.zoneId!==l.zoneId||!s.isCollapsed()||e.isFocusOnMe())&&(t.keyCode===g.VD.Left&&s.start===l.start+l.len?(e.editor.selection.setSelection(a,!0),null===(r=(n=e.props).onCursorMoveIn)||void 0===r||r.call(n),!0):t.keyCode===g.VD.Right&&s.start===l.start&&(e.editor.selection.setSelection(a,!0),null===(o=(i=e.props).onCursorMoveIn)||void 0===o||o.call(i),!0))},e._handleEditorSelectionChange=function(){var t,n,r,i,o,s,a=e.getSelectionOfCurrentRef();if(!a)return;var l=e.editor.selection.getSelection(a.start.zoneId),u=!l||!e._prevSel&&l.isCollapsed()||(null===(t=e._prevSel)||void 0===t?void 0:t.isCollapsed())&&l.isCollapsed();if(e._prevSel=l,u)return;var c=e.editor.getContentState().getEntities(a);if(!!(null===(n=null==c?void 0:c[0])||void 0===n?void 0:n.attributes.equation)){var d=l.start,f=l.end,h=a.start,p=a.end,v=d.zoneId===h.zoneId&&d<=h&&f>=p;v?(e._selected=!0,null===(i=(r=e.props).onSelect)||void 0===i||i.call(r)):!v&&(e._selected=!1,null===(s=(o=e.props).onDeselect)||void 0===s||s.call(o))}},e}(0,r.d)(e,t);var n=e.prototype;return n.componentDidMount=function(){t.prototype.componentDidMount.call(this),this.editor.on(d.r.SELECTION_CHANGE,this._handleEditorSelectionChange)},n.componentWillUnmount=function(){t.prototype.componentWillUnmount.call(this),this.editor.off(d.r.SELECTION_CHANGE,this._handleEditorSelectionChange)},e}(p.T),m=l.forwardRef(function(t,e){var n=(0,l.useContext)(v.rU);return n&&l.createElement(y,(0,r.g)({},t,{forwardRef:e,editor:n}))}),b=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(function(t,e){var n,i;if("string"==typeof e)t+=" "+e;else try{for(var o=(0,r.c)(Object.entries(e)),s=o.next();!s.done;s=o.next()){var a=(0,r.a)(s.value,2),l=a[0],u=a[1];!0===u&&(t+=" "+l)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return t},"")},E=function(t){var e=t.editor,n=t.length,o=t.objectID,s=t.zoneId,a=t.lineState,u=t.defaultEquation,p=t.displayMode,v=t.popoverContainer,g=t.renderEquationContent,y=(0,l.useRef)(null),E=(0,r.a)((0,l.useState)(u||""),2),S=E[0],I=E[1],C=(0,r.a)((0,l.useState)(e.isEditable()),2),L=C[0],w=C[1];(0,l.useEffect)(function(){u&&I(u)},[u]);var x=(0,r.a)((0,l.useState)(!1),2),_=x[0],T=x[1],A=(0,r.a)((0,l.useState)(!1),2),M=A[0],k=A[1],N=(0,l.useCallback)((0,f.D)(function(t){k(t)},30),[]),R=(0,l.useCallback)(function(){k(!0)},[]),O=(0,l.useCallback)(function(){k(!1)},[]),D=(0,l.useCallback)(function(){return y.current?(0,c.Ve)(y.current,e):null},[e]),z=(0,l.useCallback)(function(t){T(t);var n=D();if(!t&&n){var r=e.selection.getSelection().toPosition(),i=r.start,o=r.start+r.len,s=e.getContentState().rangeToPosition(n);s&&(s.start<i||s.start>o)&&O()}},[e,O,D]),P=(0,l.useCallback)(function(t){if(t===S)return;var n=e.getContentState(),r=D();if(!!r){var i=n.getAttributes(r.start,r.end).toMap().objectID;"string"!=typeof i&&(i=(0,h.D)(8)),n.setAttributes(r,{objectID:i,equation:t})}},[e,S,D]),Z=(0,l.useCallback)(function(t){P(t),I(t)},[P]),W=(0,l.useMemo)(function(){return g({containerEditor:e,objectID:o,zoneId:s,lineState:a,isEditMode:L&&_,displayMode:p,equation:S,mountNode:v,getEquationRange:D,onEquationChange:Z,onIsEditModeChange:L?z:null,onIsSelectedChange:N})},[e,o,s,a,p,v,L,S,_,D,Z,g,z,N]),K=(0,l.useCallback)(function(t){w(t.current)},[]);return(0,l.useEffect)(function(){return e.on(d.r.EDITABLE_CHANGE,K),function(){e.off(d.r.EDITABLE_CHANGE,K)}},[e,K]),l.createElement(m,{isEditMode:_,onCursorMoveIn:function(){T(!0)},onSelect:R,onDeselect:O,length:n,autoSelectOnClick:!1},l.createElement("div",{ref:y,className:b("editor-kit-equation-block",{"editor-kit-equation-block-selected":M||_,editable:L}),style:{width:p===i.v.block?"100%":"auto"}},W))},S=function(t){function e(e){var n=e.editor,i=e.getPopupContainer,o=e.renderEquationContent,s=t.call(this)||this;return s.name="Equation",s._editor=n,s._renderEquationContent=function(t){return o((0,r.g)((0,r.g)({},t),{containerEditor:s._editor}))},s._getPopupContainer=i,s._initPopupWrapperIfNotExist(),s}(0,r.d)(e,t);var n=e.prototype;return n.editorCollectText=function(t){var e=t.attributes.equation;return"string"!=typeof e?"":"$$"+e+"$$"},n.serialize=function(t){return t},n.deserialize=function(t){return t.deltaSet},n.match=function(t){return t===e.KEY},n.render=function(t){var n,r=t.attributes,o=t.children,s=t.index,a=t.lineState,c=t.op,d=r.equation,f=r.objectID;if("string"!=typeof d)return o;if(!t.key){if("string"==typeof f)t.key=f;else{var h=a.getOps().indexOf(c);t.key="equation-line-"+s+"-op-"+h}}var p=(n=d,u.test(n))?i.v.block:i.v.inline;return t.class+=" equation-leaf equation-display-"+p,l.createElement(E,{editor:this._editor,length:t.insert.length,objectID:f,zoneId:t.zoneId,lineState:t.lineState,defaultEquation:d,displayMode:p,popoverContainer:e.popupWrapper,renderEquationContent:this._renderEquationContent})},n._initPopupWrapperIfNotExist=function(){var t;(!e.popupWrapper||!document.contains(e.popupWrapper))&&(e.popupWrapper=document.createElement("div"),e.popupWrapper.className="editor-kit-equation-popover-wrapper",((null===(t=this._getPopupContainer)||void 0===t?void 0:t.call(this))||document.body).appendChild(e.popupWrapper))},e.KEY="equation",(0,r.e)([a.P,(0,s.x)()],e.prototype,"render",null),e}(o.S)},988957:function(t,e,n){"use strict";n.d(e,{Ec:function(){return i},Er:function(){return a},Wd:function(){return s},uc:function(){return o}});var r,i,o=4,s=20,a=["tl","tr","br","bl"];(r=i||(i={})).WRAPPER="image-wrapper",r.CONTAINER="image-container"},494315:function(t,e,n){"use strict";n.d(e,{E:function(){return E}});var r=n("144847"),i=n("85359"),o=n("559016"),s=n("993137"),a=n("649146"),l=n("386308"),u=n("430970"),c=n("464675");n("399884"),n("707574");var d=n("985189"),f=n("101199"),h=n("441642"),p=n("651419"),v=n("515979"),g=n("988957"),y=function(){function t(t){var e=this;this.editor=t,this.canDrag=!1,this.pointX=0,this.pointY=0,this.pageX=0,this.pageY=0,this.diffX=0,this.diffY=0,this.body=document.body,this.isMoved=!1,this.oriScrollTop=0,this.events=new Map,this.bind=function(){document.addEventListener("mousemove",e.handleMouseMove),document.addEventListener("mousedown",e.handleMouseDown),document.addEventListener("mouseup",e.handleMouseUp),e.editor.once(o.r.PAINT,e.bindScrollEvent)},this.bindScrollEvent=function(){var t=e.editor.getScrollContainer();if(!!t)t.addEventListener("scroll",e.handleScroll)},this.isSameInstance=function(t){return e.editor.getContainer().contains(t)},this.handleMouseDown=function(t){if(!(t.target instanceof HTMLElement)||!e.editor.isEditable()||!e.isSameInstance(t.target)||!(null===(o=t.target)||void 0===o?void 0:o.classList.contains("point")))return;var n,i,o,s,a,l=e.editor.getScrollContainer(),u=null===(s=t.target.closest(".image-wrapper"))||void 0===s?void 0:s.querySelector("img");if(!u)return;if(e.image=u,!e.image.closest(".unresize")){var c=e.image.closest(".ace-line");e.oriScrollTop=null!==(a=null==l?void 0:l.scrollTop)&&void 0!==a?a:0,e.resizeImageLineKey=null,e.direction=t.target.getAttribute("data-direction"),e.imageWidth=e.image.clientWidth,e.imageHeight=e.image.clientHeight,e.imageMaxWidth=c.clientWidth,e.imageMaxWidth=e.imageMaxWidth&&e.imageMaxWidth-g.uc,e.uuid=e.image.getAttribute("data-uuid"),e.canDrag=!0,e.pointX=t.pageX,e.pointY=t.pageY,e.alignment="left";try{for(var d=(0,r.c)([["align-left","left"],["align-center","center"],["align-right","right"]]),f=d.next();!f.done;f=d.next()){var h=(0,r.a)(f.value,2),p=h[0],v=h[1];c.classList.contains(p)&&(e.alignment=v)}}catch(t){n={error:t}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}return e.direction&&["tl","br"].includes(e.direction)?e.body.classList.add("keep-nwse-cursor"):e.direction&&["tr","bl"].includes(e.direction)&&e.body.classList.add("keep-nesw-cursor"),t.preventDefault(),!1}},this.applyDynamicResize=function(t){var n=t.pageX,r=t.pageY,i=t.target,o=t.scrollTop;if(!!e.direction&&!!e.imageWidth&&!!e.uuid&&!!e.alignment&&!!e.imageHeight&&!!e.imageMaxWidth){var s=o-e.oriScrollTop;e.diffX=n-e.pointX,e.diffY=r-e.pointY+s,e.isMoved=!0;var a={width:e.imageWidth,height:e.imageHeight},l={x:e.diffX,y:e.diffY};(0,h.jB)({direction:e.direction,alignment:e.alignment,imageSize:a,moveVector:l,imageMaxWidth:e.imageMaxWidth,uuid:e.uuid});var u=i;if(!e.resizeImageLineKey){for(;u&&u!==document.body&&!(u.id&&/magicdomid/.test(u.id));){;u=u.parentElement}e.resizeImageLineKey=i&&i.id}}},this.handleScroll=(0,v.Z)(function(t){var n,r=t.target;if(!!r&&!!e.canDrag&&!!e.pageX&&!!e.pageY&&!!e.isSameInstance(r)){var i=e.editor.getScrollContainer();e.applyDynamicResize({pageX:e.pageX,pageY:e.pageY,target:r,scrollTop:null!==(n=null==i?void 0:i.scrollTop)&&void 0!==n?n:0})}},16),this.handleMouseMove=(0,v.Z)(function(t){var n,r=t.target;if(!!r&&!!e.canDrag&&!!e.isSameInstance(r)){var i=e.editor.getScrollContainer();e.pageX=t.pageX,e.pageY=t.pageY,e.applyDynamicResize({pageX:e.pageX,pageY:e.pageY,target:r,scrollTop:null!==(n=null==i?void 0:i.scrollTop)&&void 0!==n?n:0})}},16),this.handleMouseUp=function(){e.resizeImageLineKey=null,e.canDrag=!1,e.isMoved&&e.uuid&&(e.body.classList.remove("keep-nwse-cursor"),e.body.classList.remove("keep-nesw-cursor"),e.handleResize()),e.isMoved=!1},this.clearTempStyle=function(){if(!!e.uuid){var t,n=document.querySelector("#"+(0,h.tf)(e.uuid));null===(t=null==n?void 0:n.parentNode)||void 0===t||t.removeChild(n)}}}var e=t.prototype;return e.unbind=function(){document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mousedown",this.handleMouseDown),document.removeEventListener("mouseup",this.handleMouseUp);var t=this.editor.getScrollContainer();t&&t.removeEventListener("scroll",this.handleScroll),this.events.clear()},e.handleResize=function(){if(!this.uuid)return;var t,e,n=this.editor.getContainer().querySelector((0,h.MO)(this.uuid));if(!n)return;var i=(0,p.Ve)(n,this.editor);if(!i)return;var s=n.clientWidth,a=i.start.zoneId,l=this.editor.getContentState().getZoneState(a);if(!l)return;var u=l.getEntities(i);if(!!u.length){var c=this.events.get("resize");if(null==c?void 0:c.length)try{for(var d=(0,r.c)(c),f=d.next();!f.done;f=d.next())(0,f.value)((0,r.g)((0,r.g)({},u[0]),{attributes:(0,r.g)((0,r.g)({},u[0].attributes),{width:s})}))}catch(e){t={error:e}}finally{try{f&&!f.done&&(e=d.return)&&e.call(d)}finally{if(t)throw t.error}}this.editor.once(o.r.PAINT,this.clearTempStyle)}},e.onResize=function(t){var e=this.events.get("resize")||[];e.push(t),this.events.set("resize",e)},t}(),m=n("236836"),b=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state={selected:!1},e.handleSelect=function(){e.setState({selected:!0})},e.handleDeSelect=function(){e.setState({selected:!1})},e}(0,r.d)(e,t);var n=e.prototype;return n.componentDidUpdate=function(){var t,e,n=this.props,r=n.editor,i=n.lineState;if(!r||!i)return;var o=i.getZoneId(),s=null===(t=r.virtualListManager)||void 0===t?void 0:t.getVirtualListModuleOfZone(o);if(!!(null==s?void 0:s.isEnabled)){var a=null===(e=i.getNode())||void 0===e?void 0:e.querySelector("img");a&&!a.complete&&a.addEventListener("load",function(){s.notifyInnerNodeLayoutUpdate(i)},{once:!0})}},n.render=function(){var t=this.props,e=t.uuid,n=t.src,r=t.alt,i=t.width,o=t.height,s=!1===t.resizeable?"unresize":"";return(0,f.createElement)(m.Z,{key:e,onSelect:this.handleSelect,onDeselect:this.handleDeSelect,className:g.Ec.CONTAINER+" "+s,disableDefaultSelected:!0},(0,f.createElement)("span",{className:g.Ec.WRAPPER+" "+(this.state.selected?"selected":"")},g.Er.map(function(t){return(0,f.createElement)("span",{key:t,className:"point "+t+" n-icon-dragable","data-direction":t})}),(0,f.createElement)("img",{style:{width:i?i+"px":"100%",height:o?o+"px":"100%"},src:(n||"").replace(/"/g,"""),"data-uuid":e,"data-resizeable":s,alt:r})))},e}(f.Component),E=function(t){function e(n){var s=t.call(this)||this;s.name="Image",s.uploadInput=(0,h.pp)(),s.canResetSelection=!0,s.handleUploadImage=function(){s.uploadInput.click()},s.handleInputChange=function(t){if(!t.target)return;var e=t.target,n=e.files;if(!n||!!(0,h.XR)(n)){if(n){var r=s.editor.selection.getSelection().toPosition();s.insertImage(r,n)}e.value=""}},s.handleKeyDown=function(t){if(i.Xh.mobile&&"Backspace"===t.key){var e=s.editor,n=e.selection.getSelection();if(n.isCollapsed()){var r=n.start.line-1,o=s.editor.getContentState().getActiveZone().getLine(r);if(o&&(0,h.VB)(o)&&0===n.start.offset){var a=o.getOffset(),l=a.start,u=a.end,d=new c.I({zoneId:o.getZoneId()}).retain(l).delete(u-l);e.getContentState().apply(d),t.preventDefault(),t.preventEvent(),t.stopEvent()}}}},s.handleSelectionChange=function(t){if(!!s.canResetSelection){var e=t.current,n=e.start,r=e.end;if(n.line!==r.line){var i=(0,h.uf)(e,s.editor),o=i.start,a=i.end;if(!o&&!a)return;s.fixSelectionOnImageLine(i,e,s.editor)}}},s.fixSelectionOnImageLine=function(t,e,n){if(!s.canResetSelection)return;s.canResetSelection=!1;var r=e.start,i=e.end,o=e.isBackward,a=r.zoneId,l=t.start,u=t.end,c=n.getContentState().getZoneState(a),d=c.getLine(r.line),f=c.getLine(i.line),h=r,p=i,v=!1;if(d&&l&&(h={line:r.line,offset:0,zoneId:a},v=!0),f&&u&&(p={line:i.line,offset:f.length()-1,zoneId:a},v=!0),!!v)n.selection.setSelection({start:h,end:p,isBackward:o}),n.selection.updateBrowserSelection(!0),s.canResetSelection=!0},s.updateImageAttributes=function(t){var n,i,o=t.start,a=t.end,l=s.editor.getContentState(),u=l.getZoneState(o.zoneId);if(!u)return;var d=u.pointToOffset(o),f=u.pointToOffset(a);if(null!==d&&null!==f){var h=(0,r.g)((0,r.g)((0,r.g)({},s.oldDataToNewData(t.attributes)),t.attributes),((n={})[e.KEY]="true",n)),p=Object.keys(h).reduce(function(t,e){return t[e]=h[e].toString(),t},{}),v=new c.I({zoneId:o.zoneId}).retain(d).retain(f-d,(0,r.g)(((i={})[e.KEY]="true",i),p));l.apply(v)}},s.deserialize=function(t){var n,r,i=t.node,o=t.deltaSet,s=t.zoneId;return(null===(r=null==i?void 0:i.tagName)||void 0===r?void 0:r.toUpperCase())==="IMG"?o.concat(new c.I({zoneId:s}).insert(" ",((n={alt:i.getAttribute("alt")||""})[e.KEY]="true",n.src=i.getAttribute("src")||"",n.uuid=(0,h.xo)(),n.width=i.getAttribute("width")||"",n))):o},s.options=n;var a=n.editor;return s.editor=a,s.event=new y(s.editor),s.event.bind(),s.uploadInput.addEventListener("change",s.handleInputChange),s.event.onResize(s.updateImageAttributes),a.registerCommand(e.KEY,s.handleUploadImage),a.on(o.r.PASTE,s.handlePaste),a.on(o.r.KEYDOWN,s.handleKeyDown),a.on(o.r.SELECTION_CHANGE,s.handleSelectionChange),s}(0,r.d)(e,t);var n=e.prototype;return n.match=function(t){return t===e.KEY},n.handlePaste=function(t){if(!(0,h.$p)(t.nativeEvent))return;var e,n=null===(e=t.nativeEvent.clipboardData)||void 0===e?void 0:e.files;if(!!(null==n?void 0:n.length)){var r=this.editor.selection.getSelection().toPosition();this.insertImage(r,n)}},n.insertImage=function(t,n){if(this.options.onInsertImage){this.options.onInsertImage(t,n);return}var i,o,s=this.editor.getContentState(),a=t.zoneId,l=t.len,u=t.start,d=t.toRange().start.line,f=s.getActiveZone().getLine(d);if(!!f){var p=0!==d&&f.isEmpty(),v=new c.I({zoneId:a}).retain(u).delete(l);p||v.insertEnter();try{for(var g=(0,r.c)(Array.from(n)),y=g.next();!y.done;y=g.next()){var m=y.value;!function(t){var n,i={uuid:(0,h.xo)(),src:window.URL.createObjectURL(t)},o=Object.keys(i).reduce(function(t,e){return t[e]=i[e].toString(),t},{});v.insert(" ",(0,r.g)(((n={})[e.KEY]="true",n),o)).insertEnter()}(m)}}catch(t){i={error:t}}finally{try{y&&!y.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}s.apply(v)}},n.editorWillCopy=function(t){(0,h.tZ)(t.deltaSet)},n.editorWillPaste=function(t){var e,n=t.deltaSet,r=t.zoneId;(0,h.tZ)(n);var i=n.deltas,o=i[0].ops[i[0].ops.length-1];if(!!(null===(e=null==o?void 0:o.attributes)||void 0===e?void 0:e.image)){var s=new c.I({zoneId:r}).insertEnter();t.deltaSet=n.concat(s)}},n.serialize=function(t){var n,i,o=t.node,a=t.op,l=t.type;if(!(null==a?void 0:a.attributes))return t;var u=this.oldDataToNewData(a.attributes);if((null==u?void 0:u[e.KEY])&&l===s.T.LEAF){var c=new DOMParser().parseFromString("<img>","text/html").querySelector("img");c.setAttribute("src",u.src);try{for(var d=(0,r.c)(Object.entries(u)),f=d.next();!f.done;f=d.next()){var h=(0,r.a)(f.value,2),p=h[0],v=h[1];c.setAttribute(p,String(v))}}catch(t){n={error:t}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}return c.appendChild(o),Object.assign(t,{node:c})}return t},n.oldDataToNewData=function(t){var n;if(!t[e.KEY]||"true"===t[e.KEY])return t;try{var i=JSON.parse(t[e.KEY]);t=(0,r.g)((0,r.g)({},i.attributes),((n={})[e.KEY]="true",n.src=i.src,n.uuid=(0,h.xo)(),n))}catch(t){}return t},n.lineDidMount=function(t){var n,r=t.lineState;if(!r.getAttributes().toMap()[e.KEY])return;var i=r.getZoneId(),o=null===(n=this.editor.virtualListManager)||void 0===n?void 0:n.getVirtualListModuleOfZone(i);if(!(null==o?void 0:o.isEnabled))return;var s=r.getNode();if(!!s){var a=s.querySelector("img");a?a.addEventListener("load",function(){o.notifyInnerNodeLayoutUpdate(r)},{once:!0}):setTimeout(function(){var t=s.querySelector("img");null==t||t.addEventListener("load",function(){o.notifyInnerNodeLayoutUpdate(r)},{once:!0})})}},n.render=function(t){var e=this.oldDataToNewData(t.attributes);return t.key=e.uuid,f.createElement(b,(0,r.g)({},e,{resizeable:this.options.resizeable,src:e.src,editor:this.editor,lineState:t.lineState}))},n.destroy=function(){this.event.unbind(),this.uploadInput.removeEventListener("change",this.handleInputChange),this.editor.off(o.r.PASTE,this.handlePaste),this.editor.off(o.r.KEYDOWN,this.handleKeyDown),this.editor.off(o.r.SELECTION_CHANGE,this.handleSelectionChange),(0,h.aj)(this.uploadInput)},e.KEY="image",(0,r.e)([d.MR],e.prototype,"handlePaste",null),(0,r.e)([(0,a.gv)(999)],e.prototype,"serialize",null),(0,r.e)([(0,a.gv)(999),(0,u.x)()],e.prototype,"render",null),e}(l.S)},243415:function(t,e,n){"use strict";n.d(e,{T:function(){return u}});var r=n("144847"),i=n("559016"),o=n("162114"),s=n("650054");n("399884"),n("707574");var a=n("386308"),l=n("811492"),u=function(t){function e(n){var r=t.call(this,n)||this;r.handleInput=function(t){"formatItalic"===t.inputType&&(t.preventEvent(),t.preventDefault(),t.stopEvent(),r.editor.toggleAttribute(e.KEY))};var o=r.editor;return o.registerCommand(e.KEY,function(){o.toggleAttribute(e.KEY)}),o.on(i.r.INPUT,r.handleInput),r}(0,r.d)(e,t);var n=e.prototype;return n.deserialize=function(t){var e=t.node,n=t.deltaSet,r=t.zoneId;if(e instanceof HTMLElement){var i=e.tagName,s=e.getAttribute("style")||"";if("I"===i||"EM"===i||/\bfont-style:\s*italic\b/i.test(s))return(0,o.d)(n,r,{italic:"true"},!1)}return n},n.serialize=function(t){return(0,o.w)(t,{tagAttribute:"italic",wrapTag:s.c5.italic})},e}(function(t){function e(e){var n=e.editor,r=t.call(this)||this;return r.name="Italic",r.editor=n,r}(0,r.d)(e,t);var n=e.prototype;return n.match=function(t){return t===e.KEY},n.render=function(t){var e=t.children;return t.style.fontStyle="italic",e},e.KEY="italic",(0,r.e)([l.P],e.prototype,"render",null),e}(a.S))},797925:function(t,e,n){"use strict";n.d(e,{W:function(){return a}});var r=n(144847),i=n(386308);n(399884);var o=n(390485);n(707574);var s="";o.Z.isMac||o.Z.isIPad?s="mac":o.Z.isWindows?s="windows":o.Z.isLinux&&(s="linux");var a=function(t){function e(e){var n=e.editor,r=e.shortcutsMap,i=t.call(this)||this;return i.name="KeyboardShortcuts",i.handleKeydown=function(t){var e=i.getHotKeyName(t.nativeEvent);if(e){var n=e.key,r=e.value;return i.editor.execCommand(n,r?{value:r}:void 0),t.preventDefault(),t.stopPropagation(),!0}return!1},i.editor=n,i.shortcutToCommandMap=i.normalizeShortCutsMap(r),i.editor.on("keydown",i.handleKeydown),i}(0,r.d)(e,t);var n=e.prototype;return n.getShortCutID=function(t){var e=t.metaKey,n=t.altKey,r=t.shiftKey,i=t.ctrlKey,o=t.keyCode;return[e?"meta":"",n?"alt":"",r?"shift":"",i?"ctrl":"",null!=o?o:""].filter(Boolean).join("-")},n.normalizeShortCutsMap=function(t){var e,n,i,o,a={};try{for(var l=(0,r.c)(t),u=l.next();!u.done;u=l.next()){var c=u.value,d=c.key,f=c.value,h=c.shortcut,p=void 0;p=Array.isArray(h)?h:[h];try{for(var v=(i=void 0,(0,r.c)(p)),g=v.next();!g.done;g=v.next()){var y=g.value[s];if(!!y)a[this.getShortCutID(y)]={key:d,value:f}}}catch(t){i={error:t}}finally{try{g&&!g.done&&(o=v.return)&&o.call(v)}finally{if(i)throw i.error}}}}catch(t){e={error:t}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}return a},n.getHotKeyName=function(t){var e=this.getShortCutID(t);return this.shortcutToCommandMap[e]},e}(i.S)},444902:function(t,e,n){"use strict";n.d(e,{C:function(){return i},U:function(){return p}});var r,i,o=n(144847),s=n(97930),a=n(570930);n(399884);var l=n(390485);n(707574),n(741704);var u=n(372321),c=l.Z.isEdge,d=l.Z.isAndroid&&!l.Z.isX5,f=["align","heading","aceTable","list","blockquote","lmkr","origin-start","insertorder","text-indent","start","origin-start","lang"],h="horizontal-line";(r=i||(i={})).heading="heading",r.blockQuote="blockQuote",r.ul="ul",r.ol="ol",r.codeBlock="codeBlock",r.checkbox="checkbox",r.horizontal="horizontal",r.bold="bold",r.inlineCode="inlineCode",r.italic="italic",r.underline="underline",r.strikethrough="strikethrough";var p=function(){function t(t){var e=this;this.options=t,this.name="Markdown",this.isMarkdownMatch=!1,this.markdownMap={heading:{regExp:/^(#{1,3}\s)(\S*|\S+[\s\S]*)$/,match:function(t){var e=this.regExp.exec(t);return e?{key:"heading",value:"h"+(e[1].length-1),type:"line",replaceLen:e[1].length,active:"heading-h"+(e[1].length-1)}:null}},blockQuote:{regExp:/^(>\s)(\S*|\S+[\s\S]*)$/,match:function(t){var e=this.regExp.exec(t);return e?{key:"blockquote",value:"true",type:"line",replaceLen:e[1].length,active:"reference"}:null}},ul:{regExp:/^([*]+\s)(\S*|\S+[\s\S]*)$|^([-]+\s)(\S*|\S+[\s\S]*)$/,match:function(t){var e=this.regExp.exec(t);if(!e)return null;var n=e[1]||e[3];return{key:"list",value:"bullet"+(n.length-1),type:"line",replaceLen:n.length,active:"list-bullet"}}},ol:{regExp:/^([1-9][0-9]*\.\s)(\S*|\S+[\s\S]*)$/,match:function(t){var e=this.regExp.exec(t);return e?{key:"list",value:"number1",type:"line",replaceLen:e[1].length,start:parseInt(e[1],10),active:"list-number"}:null}},checkbox:{regExp:/^((\[\]\s)|(\u3010\u3011\s))(\S*|\S+[\s\S]*)$/,match:function(t){var e=this.regExp.exec(t);return e?{key:"list",value:"check1",type:"line",replaceLen:e[1].length,active:"checkbox"}:null}},horizontal:{regExp:/^---$|^\*\*\*$/,match:function(t){var e=this.regExp.exec(t);return e?{name:h,value:"true",type:"inline",replaceRight:!1,execLen:3,replaceLen:e[0].length,startReplacePos:e.index,endReplacePos:e.index+e[0].length,textLen:0,active:"insertseparator"}:null},doInsert:function(t){t.editor.execCommand(h)}},bold:{regExp:/\*\*(\S|\S.*\S)\*\*\s/,match:function(t){var e=this.regExp.exec(t);if(!e)return null;var n=e[1];return n&&/[^_|^*]/.test(n)?{type:"inline",name:"bold",value:"true",replaceRight:!0,execLen:2,replaceLen:e.index+n.length+5,startReplacePos:e.index,endReplacePos:e.index+n.length,textLen:n.length,active:"bold"}:null}},italic:{regExp:/\*([^*\s]|[^*\s].*[^*\s])\*\s/,match:function(t){var e=this.regExp.exec(t);if(!e)return null;var n=e[1];return n&&/[^_|^*]/.test(n)?{type:"inline",name:"italic",value:"true",replaceRight:!0,execLen:1,replaceLen:e.index+n.length+3,startReplacePos:e.index,endReplacePos:e.index+n.length,textLen:n.length,active:"italic"}:null}},underline:{regExp:/~([^\s~]|[^\s~].*[^\s~])~\s/,match:function(t){var e=this.regExp.exec(t);if(!e)return null;var n=e[1];return(null==n?void 0:n.length)?{type:"inline",name:"underline",value:"true",replaceRight:!0,execLen:1,replaceLen:e.index+n.length+3,startReplacePos:e.index,endReplacePos:e.index+n.length,textLen:n.length,active:"underline"}:null}},strikethrough:{regExp:/~~(\S|\S.*\S)~~\s/,match:function(t){var e=this.regExp.exec(t);if(!e)return null;var n=e[1];return n&&/[^~]/.test(n)?{type:"inline",name:"strikethrough",value:"true",replaceRight:!0,execLen:2,replaceLen:e.index+n.length+5,startReplacePos:e.index,endReplacePos:e.index+n.length,textLen:n.length,active:"strikethrough"}:null}}},this.handleInput=function(t){e.isMarkdownMatch&&" "===t.data&&(t.preventDefault(),t.nativeEvent.stopImmediatePropagation(),e.isMarkdownMatch=!1)},this.handleKeyEventWithBatchUndo=function(t){var n=t.evt;e.editor.undoModule.batchedUndo(function(){return e.handleKeyEvent({evt:n})})},this.handleKeyEvent=function(t){var n,r,i,a,d,f,h,p,v,g,y,m=t.evt,b=e.editor,E=m.keyCode,S=m.key,I=m.type,C=b.getStatus("isComposing");if(!(e.options.markdownOptions.ignoreFirstLine&&e.inTitleLine())&&!!b.selection.getSelection().isCollapsed()){var L=!C&&e.lastInternationalComposition&&l.Z.isSafari;if(" "===S&&(C||L)&&"keydown"===I)return e.shouldContinue=!1,!1;if("keyup"===I&&!e.shouldContinue)return e.shouldContinue=!0,!1;e.lastInternationalComposition=C;var w="";if(e.lastKeydownStatus=e.keydownStatus,e.keydownStatus=e.isInKeydownStatusWithoutKeycode(m),!l.Z.isSafari&&e.keydownStatus||!c&&C||C&&c&&"keyup"!==I||90===E||E>=65&&E<=90||m.nativeEvent.which>=37&&m.nativeEvent.which<=40)return!1;var x=e.isSpecialKey(m),_=32===E||" "===S;if(!x&&!_||8===E)return!1;var T=b.selection.getSelection(),A=T.start,M=T.end,k=A.zoneId,N=M.offset,R="";if((!e.keydownStatus&&e.lastKeydownStatus||l.Z.isX5)&&"keyup"===I){if(null===A)return!1;b.flushInput();var O=b.selection.getSelection().start;if(y=O.line,e.getLineListType(O.zoneId,y).indexOf("code")>-1)return;if((g=null===(i=b.getContentState().getZoneState(O.zoneId))||void 0===i?void 0:i.getLine(y))&&(c&&C||l.Z.isMobile)){var D=g.getText();w=D.slice(0,D.length-1)}}else{var z=b.selection.getSelection().start;if("keydown"!==I||null===z||l.Z.isX5)return!1;b.flushInput();var P=b.selection.getSelection(),O=P.start,Z=P.end;if(!Z)return!1;if(N=Z.offset,y=O.line,e.getLineListType(O.zoneId,y).indexOf("code")>-1||!b.selection.getSelection().isCollapsed())return;var W=Z.offset;w=(g=null===(a=b.getContentState().getZoneState(O.zoneId))||void 0===a?void 0:a.getLine(y))?g.getText().substr(0,W-(g.hasLineMarker()?1:0))+R:"",(!e.isInKeydownStatusWithoutKeycode(m)||!w.endsWith(S))&&(R="spacebar"===S.toLowerCase()?" ":S),w+=R}for(var K in e.markdownMap)if(e.markdownMap.hasOwnProperty(K)){var U=e.markdownMap[K],F=U.match(w);if(F){if(e.isMarkdownMatch=!0,c&&C){b.flushInput();var B=b.selection.getSelection(),V=B.start,j=B.end;g=null===(d=b.getContentState().getZoneState(V.zoneId))||void 0===d?void 0:d.getLine(y),N=j.offset}R&&(m.preventDefault(),e.editor.undoModule.batchedUndo(function(){e.performText(R)}),R="");var H=b.selection.getSelection(),X=H.start,q=H.end,Y=(null==g?void 0:g.hasLineMarker())?1:0,G=Y+F.replaceLen,J=q.offset>G&&G>N;if(G!==q.offset&&!J)continue;if("line"===F.type){var Q=null===(h=null===(f=b.getContentState().getZoneState(X.zoneId))||void 0===f?void 0:f.getLine(y))||void 0===h?void 0:h.getLineAttributes().toMap()[F.key];if(!Q||Q&&Q!==F.value){var $=b.selection.getSelection().start.zoneId,tt=b.pluginManager.getPlugin("List"),te={start:{line:y,offset:Y,zoneId:$},end:{line:y,offset:Y+F.replaceLen,zoneId:$}},tn=b.getContentState(),tr=tn.getEntities(te).reduce(function(t,e){return t=(0,o.g)((0,o.g)({},t),e.attributes)},{});if(tn.deleteText(te),tn.setAttributes({start:te.start,end:te.start},tr),F.value.indexOf("code")>-1);else if(F.start){var ti=e.getTabLevel(F.value,b,y);if(ti&&(F.value="number"+ti,b.getContentState().setLineAttributes($,y,{"text-indent":""})),!tt)return;var to=(0,u.m)(b,b.selection.getSelection(),y);tt.bulkInsertOList($,[y],((r={})[y]=to,r),F.start)}else{var ti=e.getTabLevel(F.value,b,y);if(ti){var ts=ti+F.replaceLen-2;F.value="bullet"+ts,b.getContentState().setLineAttributes($,y,{"text-indent":""})}b.getContentState().setLineAttributes($,y,((n={})[F.key]=F.value,n))}}}else if("inline"===F.type){var ta=(null===(v=null===(p=b.getContentState().getZoneState(k))||void 0===p?void 0:p.getLine(y))||void 0===v?void 0:v.hasLineMarker())?1:0,tl=[y,ta+F.startReplacePos],tu=[y,ta+F.endReplacePos];b.getContentState().deleteText({start:{line:y,offset:tl[1],zoneId:k},end:{line:y,offset:tl[1]+F.execLen,zoneId:k}}),F.replaceRight?(b.getContentState().deleteText({start:{line:y,offset:tu[1],zoneId:k},end:{line:y,offset:tu[1]+F.execLen,zoneId:k}}),b.toggleAttribute(F.name,"true",new s.e({editor:b,start:{line:y,offset:ta+F.startReplacePos,zoneId:k},end:{line:y,offset:ta+F.startReplacePos+F.textLen,zoneId:k}}))):U.doInsert&&U.doInsert({editor:b})}return}}}},this.getLineListType=function(t,n){return e.getLineAttributes(t,n,"list")},this.getLineAttributes=function(t,n,r){var i,o=null===(i=e.editor.getContentState().getZoneState(t))||void 0===i?void 0:i.getLine(n);return o&&o.getLineAttributes().toMap()[r]||""};var n=t.editor,r=t.markdownOptions,i=r.markdownMap;this.shouldContinue=!0,this.lastInternationalComposition=!1,this.lastKeydownStatus=!1,this.keydownStatus=!1,this.markdownMap=(0,a.Z)((0,o.g)((0,o.g)({},this.markdownMap),void 0===i?{}:i),r.types),this.editor=n,this.handleKeyEventWithBatchUndo.plugin=this,this.handleInput.plugin=this,this.editor.on("keydown",this.handleKeyEventWithBatchUndo),this.editor.on("keyup",this.handleKeyEventWithBatchUndo),l.Z.isSafari&&n.on("beforeinput",this.handleInput)}var e=t.prototype;return e.destroy=function(){this.editor.off("keydown",this.handleKeyEventWithBatchUndo),this.editor.off("keyup",this.handleKeyEventWithBatchUndo),l.Z.isSafari&&this.editor.off("beforeinput",this.handleInput)},e.inTitleLine=function(){var t=this.editor.selection.getSelection().start;return 0===t.line&&"0"===t.zoneId||!1},e.isSpecialKey=function(t){var e=t.key,n=t.keyCode;if(!t.nativeEvent)return!1;var r=t.nativeEvent.code,i=this.editor;if(!i)return!1;if((c&&i.getStatus("isComposing")||d)&&229===n)return!0;var o=t.metaKey||t.ctrlKey;return"~"===e||"`"===e||192===n||("*"===e||"8"===e)&&!o||"-"===e||189===n||"Minus"===r},e.isInKeydownStatusWithoutKeycode=function(t){var e="keydown"===t.type,n=229===t.keyCode;return e&&n},e.getTabLevel=function(t,e,n){var r=/bullet[0-9]+/.exec(t),i=e.getContentState().getActiveZone().getZoneId(),o="number1"===t;if(!r&&!o)return!1;var s=this.getLineAttributes(i,n,"text-indent");if(!s)return!1;var a=/([a-z]+)([0-9]+)/.exec(this.getLineListType(i,n)),l=0;return a&&(l=Number(a[2])),s&&(l+=2),l},e.performText=function(t){for(var e=this.editor,n=e.getContentState(),r=e.selection.getSelection(),i=r.start,s=r.end,a=s.offset,l=1===a?[]:n.getAttributes((0,o.g)((0,o.g)({},s),{offset:a-1}),(0,o.g)((0,o.g)({},s),{offset:a-1})),u={},c=0;c<l.length;++c)!f.includes(l[c][0])&&(u[l[c][0]]=l[c][1]);n.replaceText({start:i,end:s},t,u,{type:""})},t}()},120161:function(t,e,n){"use strict";n.d(e,{f:function(){return i}});var r=n(101201);function i(t){return void 0===t&&(t={}),Object.keys(t).every(function(t){return r.$.includes(t)})}n(399884),n(707574)},539606:function(t,e,n){"use strict";var r=n(144847),i=n(101199),o=n(332907),s=n(305863),a=n(966348),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,r.d)(e,t),e.prototype.render=function(){var t=this.props,e=t.dropdownProps,n=t.buttonContent,l=t.buttonProps;return i.createElement(o.L,(0,r.g)({},e),i.createElement(s.zx,(0,r.g)({type:"text",endIcon:i.createElement(a.Z,null)},void 0===l?{}:l),n))},e}(i.Component);e.Z=l},648352:function(t,e,n){"use strict";var r=n(101199),i=n(469935),o=n.n(i),s=n(70721),a=n(876979),l=n(361147),u="ud__color-picker-swatches-cell-active";e.Z=function(t){var e=t.backgroundPlate,n=t.fontPlate,i=t.fontColor,c=t.bgColor,d=t.onBGColorChange,f=t.onFontColorChange,h=t.i18n,p=t.disabled,v=function(t){return!!t[0].length};return r.createElement("div",{className:"editor-kit-toolbar-v2-color_plate"},v(n)&&r.createElement("div",{className:"editor-kit-toolbar-v2-color_plate-color_region"},r.createElement("div",{className:"editor-kit-toolbar-v2-color_plate-title"},h["toolbar.color.font"]),r.createElement(s.x,{value:i,onChange:function(t){return null==f?void 0:f(t)}},n.map(function(t,e){return r.createElement(a.T,{className:"editor-kit-toolbar-v2-color_plate-color_row",key:e,size:8,inline:!1},t.map(function(t){var e;return r.createElement(l.u,{className:o()("font_block","editor-kit-toolbar-v2-color_plate-color_block",((e={"preserve-svg":!t})[u]=t===i,e)),"plugin-key":"fontcolor","plugin-value":null!=t?t:"","plugin-disabled":null==p?void 0:p.toString(),key:null!=t?t:"",color:t,style:{color:t}})}))}))),v(e)&&r.createElement("div",{className:"editor-kit-toolbar-v2-color_plate-color_region"},r.createElement("div",{className:"editor-kit-toolbar-v2-color_plate-title"},h["toolbar.color.background"]),r.createElement(s.x,{value:c,onChange:function(t){return null==d?void 0:d(t)}},e.map(function(t,e){return r.createElement(a.T,{className:"editor-kit-toolbar-v2-color_plate-color_row",key:e,size:8,inline:!1},t.map(function(t){var e;return r.createElement(l.u,{"plugin-key":"backgroundcolor","plugin-value":null!=t?t:"","plugin-disabled":null==p?void 0:p.toString(),className:o()("editor-kit-toolbar-v2-color_plate-color_block",((e={"preserve-svg":!t})[u]=t===c,e)),key:null!=t?t:"",color:t})}))}))))}},82386:function(t,e,n){"use strict";n.d(e,{E:function(){return o},Q:function(){return s}});var r=n(144847),i=function(t){return parseInt(t.repeat(2/t.length),16)},o=function(t,e){if(void 0===e&&(e=1),n=t,!/^#([A-Fa-f0-9]{3,4}){1,2}$/.test(n))throw Error("Invalid HEX: "+t);var n,o,s,a,l,u=Math.floor((t.length-1)/3);var c=(o=t.slice(1),s=u,o.match(RegExp(".{"+s+"}","g"))||[]),d=(0,r.a)(c.map(i),4);return"rgba("+d[0]+", "+d[1]+", "+d[2]+", "+(a=d[3],l=e,void 0!==a?a/255:"number"!=typeof l||l<0||l>1?1:l).toFixed(3)+")"};function s(t){return t.map(function(t){return t.map(function(t){return t?t.startsWith("#")?o(t):t:void 0})})}},846673:function(t,e,n){"use strict";n.d(e,{KL:function(){return H},P6:function(){return F},T$:function(){return q},VV:function(){return X},Xb:function(){return z},cO:function(){return Z},d2:function(){return V},gM:function(){return j},xU:function(){return W},z0:function(){return D}});var r=n(144847);n(399884);var i=n(390485);n(707574);var o=n(109773),s=n(16810),a=n(956685),l=n(38952),u=n(151912),c=n(572280),d=n(740595),f=n(580369),h=n(375258),p=n(813149),v=n(941277),g=n(661749),y=n(535593),m=n(622265),b=n(145501),E=n(30638),S=n(939764),I=n(389125),C=n(880270),L=n(475973),w=n(429118),x=n(220435),_=n(261148),T=n(818538),A=n(392390),M=n(926916),k=n(307259),N=i.Z.isWindows?"Ctrl":"⌘",R=i.Z.isWindows?"Alt":"Option",O=i.Z.isWindows?N+"+Y":N+"+Shift+Z",D=3,z=[o.Z,s.Z,a.Z,l.Z,u.Z,c.Z,d.Z],P=Array.from({length:6}).map(function(t,e){return[z[e+1],"h"+(e+1),N+"+"+R+"+"+(e+1),"#".repeat(e+1)+" Space","heading","h"+(e+1)]}),Z=(0,r.f)([[f.Z,"bold",N+"+B","**Text** Space","bold"],[h.Z,"italic",N+"+I","*Text* Space","italic"],[p.Z,"underline",N+"+U","~Text~ Space","underline"],[v.Z,"undo",N+"+Z",void 0,"undo"],[g.Z,"redo",O,void 0,"redo"],[y.Z,"strikethrough",N+"+Shift+X","~~Text~~ Space","strikethrough"],[m.Z,"blockquote",N+"+Shift+>","> Space","blockquote","true"],[b.Z,"unorderlist",N+"+Shift+8","- Space","list","bullet"],[E.Z,"orderlist",N+"+Shift+7","1. Space","list","number"],[S.Z,"checkbox",N+"+"+R+"+T","[] Space","list","check"],[I.Z,"text-indent",N+"+]",void 0,"indentRight","true"],[C.Z,"align-center",N+"+Shift+E",void 0,"align","center"],[L.Z,"align-left",N+"+Shift+L",void 0,"align","left"],[w.Z,"align-right",N+"+Shift+R",void 0,"align","right"],[x.Z,"horizontal-line",N+"+"+R+"+S",void 0,"horizontal-line"],[_.Z,"image","",void 0,"image"],[T.Z,"hyperlink",N+"+K",void 0,"hyperlink"],[A.Z,"table",N+"+"+R+"+A",void 0,"table"],[M.Z,"codeblock",N+"+"+R+"+C",void 0,"codeblock"],[k.Z,"video","",void 0,"video"]],P),W=[{size:"0.85em",text:"small"},{size:"1em",text:"normal",isDefault:!0},{size:"1.15em",text:"large"},{size:"1.43em",text:"max"}],K=["monospace",'"Aril black", sans-serif','"Arial narrow", sans-serif',"arial, helvetica, sans-serif",'"comic sans ms", sans-serif',"Garamond, serif","Georgia, serif","Tahoma, sans-serif",'"Trebuchet MS", sans-serif',"Verdana, sans-serif",'"Times new Roman", serif'],U=["Fixed width","Wide font","Narrow font","Sans-Serif","comic sans ms","Garamond","Georgia","Tahoma","Trebuchet MS","Verdana","Serif"],F=Array.from({length:K.length}).map(function(t,e){return{font:K[e],text:U[e],style:{fontFamily:K[e]}}});F[3].isDefault=!0;var B=["固定宽度","宽字体","窄字体","Sans-Serif","comic sans ms","Garamond","Georgia","Tahoma","Trebuchet MS","Verdana","Serif"],V=Array.from({length:K.length}).map(function(t,e){return{font:K[e],text:B[e],style:{fontFamily:K[e]}}});V[3].isDefault=!0;var j=[{font:"simsun, STSong, serif",text:"宋体",style:{fontFamily:"simsun, STSong, serif"},isDefault:!0},{font:"simhei, STHeiti, sans-serif",text:"黑体",style:{fontFamily:"simhei, STHeiti, sans-serif"}},{font:"nsimsun, monospace",text:"新宋",style:{fontFamily:"nsimsun, monospace"}}],H=[{font:'"ms pgothic", sans-serif',text:"Pゴシック",style:{fontFamily:'"ms pgothic", sans-serif'},isDefault:!0},{font:'"ms pmincho", serif',text:"P明朝",style:{fontFamily:'"ms pmincho", serif'}},{font:'"ms gothic", monospace',text:"ゴシック",style:{fontFamily:'"ms gothic", monospace'}}],X=[[void 0,"#dee0e3cc","#fbbfbc","#fed4a4cc","#fff67acc","#b7edb1cc","#bacefdb3","#cdb2fab3"],["#f2f3f5","#bbbfc4","#f76964","#ffa53d","#ffe928","#62d256","#4e83fd8c","#935af68c"]],q=[[void 0,"#646a73","#d83931","#de7802","#dc9b04","#2ea121","#245bdb","#6425d0"]]},263543:function(t,e,n){"use strict";n.d(e,{o:function(){return td}});var r=n("144847");n("399884"),n("707574");var i=n("457341"),o=n("101199"),s=n("469935"),a=n.n(s),l=n("890710"),u=n("559016"),c=n("91821"),d=n("919421"),f=n("672543"),h=n("846673"),p=n("48281"),v=n("764675"),g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,r.d)(e,t),e.prototype.render=function(){var t=this.props,e=t.icon,n=t.disabled,i=t.highlighted,s=t.pluginKey,a=t.pluginValue,l=t.tooltipText,u=t.extra,c=o.createElement(p.h,(0,r.g)({color:i?"primary":void 0,disabled:n,size:"medium","plugin-key":s,"plugin-value":a,"plugin-disabled":null==n?void 0:n.toString(),icon:e},void 0===u?{}:u));return l?o.createElement(v.Z,{text:l},c):c},e}(o.PureComponent),y=(0,r.a)(h.cO.map(function(t){var e=(0,r.a)(t,6),n=e[0],i=e[1],s=e[2],a=e[3],l=e[4],u=e[5];return(0,o.memo)(function(t){var e=t.activeAttr,c=t.i18n,d=t.disabledKeys,f=t.extra,h=void 0===f?{}:f,p=h.tooltipOverride,v=(0,r.h)(h,["tooltipOverride"]),y=null!=p?p:(c["toolbar."+i]||i)+(s?" ("+s+")":"")+(a?"\n"+a:"");return o.createElement(g,{highlighted:void 0===u?l in e:e[l]===u,disabled:d.includes(l),tooltipText:y,icon:o.createElement(n,null),pluginKey:l,pluginValue:u,extra:v})},function(t,e){return void 0===u?l in t.activeAttr==l in e.activeAttr&&t.disabledKeys.includes(l)===e.disabledKeys.includes(l):t.activeAttr[l]===u==(e.activeAttr[l]===u)&&t.disabledKeys.includes(l)===e.disabledKeys.includes(l)})}),23),m=y[0],b=y[1],E=y[2],S=y[3],I=y[4],C=y[5],L=y[6],w=y[7],x=y[8],_=y[9],T=y[10],A=y[11],M=y[12],k=y[13],N=y[14],R=y[15],O=y[16],D=y[17],z=y[18],P=y[19],Z=y[20],W=y[21],K=y[22],U=n("498014"),F=n("539606"),B="fontsize",V=h.xU.find(function(t){return t.isDefault}),j=(0,o.memo)(function(t){var e,n=t.activeAttr,r=t.disabledKeys,i=t.i18n,s=r.includes(B),a=(0,o.useMemo)(function(){return o.createElement(U.v,null,h.xU.map(function(t){return o.createElement(U.v.Item,{key:t.text,"plugin-key":B,"plugin-disabled":null==s?void 0:s.toString(),"plugin-value":t.size},o.createElement("span",{style:{fontSize:t.size}},i["toolbar.font-size-"+t.text]))}))},[i,s]),l=n[B]||(null==V?void 0:V.size),u=null===(e=h.xU.find(function(t){return t.size===l}))||void 0===e?void 0:e.text;return o.createElement(F.Z,{buttonContent:i["toolbar.font-size-"+u],dropdownProps:{overlay:a,disabled:s}})},function(t,e){return t.disabledKeys.includes(B)===e.disabledKeys.includes(B)&&t.i18n===e.i18n&&t.activeAttr[B]===e.activeAttr[B]}),H="align",X=["left","center","right"],q=(0,o.memo)(function(t){var e=t.activeAttr,n=t.disabledKeys,r=t.i18n,i=n.includes(H),s=(0,o.useMemo)(function(){return o.createElement(U.v,null,X.map(function(t){return o.createElement(U.v.Item,{key:t,"plugin-key":H,"plugin-disabled":null==i?void 0:i.toString(),"plugin-value":t},o.createElement("span",null,r["toolbar.align-"+t]))}))},[r,i]),a=e[H]||X[0];return o.createElement(F.Z,{buttonContent:r["toolbar.align-"+a],dropdownProps:{overlay:s,disabled:i}})},function(t,e){return t.disabledKeys.includes(H)===e.disabledKeys.includes(H)&&t.i18n===e.i18n&&t.activeAttr[H]===e.activeAttr[H]}),Y="heading",G=(0,o.memo)(function(t){var e=t.activeAttr,n=t.disabledKeys.includes(Y),r=(0,o.useMemo)(function(){return o.createElement(U.v,null,h.Xb.slice(0,h.z0+1).map(function(t,e){return o.createElement(U.v.Item,{key:e,"plugin-key":Y,"plugin-disabled":null==n?void 0:n.toString(),"plugin-value":0===e?void 0:"h"+e},o.createElement(t,null))}))},[n]),i=Number((e[Y]||"h0").slice(1))||0,s=h.Xb[i];return o.createElement(F.Z,{buttonContent:o.createElement(s,null),dropdownProps:{overlay:r,disabled:n}})},function(t,e){return t.disabledKeys.includes(Y)===e.disabledKeys.includes(Y)&&t.activeAttr[Y]===e.activeAttr[Y]}),J=n("454746");function Q(t,e){return"string"==typeof t?t:"function"==typeof t?t(e):void 0}var $="fontfamily",tt=(0,o.memo)(function(t){var e=t.activeAttr,n=t.disabledKeys,i=t.i18n,s=t.extra,a=void 0===s?{}:s,l=a.language,u=void 0===l?"EN":l,c=a.env,d=void 0===c?"EN":c,f=a.fontFamilies,p=n.includes($),v=(0,o.useMemo)(function(){if(f)t=f;else switch(u){case"ZH":t=h.gM;break;case"EN":t="CN"===d?h.d2:h.P6;break;case"JP":t=h.KL;break;default:t=h.P6}var t,e=t.find(function(t){return t.isDefault}),n=t.reduce(function(t,e){var n;return(0,r.g)((0,r.g)({},t),((n={})[e.font]=Q(e.text,i),n))},{});return{fontFamilies:t,defaultFont:e,mapFont2Name:n}},[u,d,f,i]),g=v.fontFamilies,y=v.defaultFont,m=v.mapFont2Name,b=e[$]||(null==y?void 0:y.font),E=m[b]||Q(null==y?void 0:y.text,i)||"default",S=o.createElement(U.v,{selectedKeys:[String(b)]},g.map(function(t){var e;return o.createElement(U.v.Item,{key:String(t.font),"plugin-key":$,"plugin-disabled":null==p?void 0:p.toString(),"plugin-value":t.font},o.createElement("span",{style:{fontFamily:(null===(e=t.style)||void 0===e?void 0:e.fontFamily)||t.font}},Q(t.text,i)))}));return o.createElement(F.Z,{buttonContent:o.createElement("span",{style:{fontFamily:E===Q(null==y?void 0:y.text,i)?null==y?void 0:y.font:b}},E),dropdownProps:{overlay:S,disabled:p}})},function(t,e){return t.disabledKeys.includes($)===e.disabledKeys.includes($)&&t.i18n===e.i18n&&t.activeAttr[$]===e.activeAttr[$]&&(0,J.X)(t.extra,e.extra)}),te={DIVIDER:function(){return o.createElement("div",{className:"editor-kit-toolbar-v2-divider"})},Bold:m,Italic:b,Underline:E,Undo:S,Redo:I,Strikethrough:C,Blockquote:L,UnorderedList:w,OrderedList:x,Checkbox:_,Indent:T,AlignCenter:A,AlignLeft:M,AlignRight:k,HorizontalLine:N,Image:R,Hyperlink:O,Table:D,CodeBlock:z,Video:P,H1:Z,H2:W,H3:K,FontSizeDropdown:j,AlignDropdown:q,HeadingDropdown:G,FontFamilyDropdown:tt,ColorPicker:n("179087").Z};function tn(t){if("string"==typeof t)return te[t];if(!function(t){var e=t.type;return void 0!==e&&("string"==typeof e||!1)}(t))return t;var e=te[t.type];return function(n){var i;return o.createElement(e,(0,r.g)({},n,{extra:(0,r.g)({tooltipOverride:(null===(i=t.getTooltipFromI18N)||void 0===i?void 0:i.call(t,n.i18n))||t.tooltip},t.extraPropsToBuiltinComp||{})}))}}var tr=function(t){return t!==document.scrollingElement&&t?(0,f.re)(t):{top:0,left:0,clientHeight:0,clientWidth:0,scrollLeft:0,scrollTop:0}},ti=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.wrapperRef=o.createRef(),e}(0,r.d)(e,t);var n=e.prototype;return n.getWrapperClassName=function(){},n.getWrapperStyle=function(){return{}},n.componentDidMount=function(){this.bindEvent()},n.componentWillUnmount=function(){this.unbindEvent()},n.bindEvent=function(){var t=this.props.editor;t.on(u.r.SELECTION_CHANGE,this.update),t.on(u.r.EXEC_COMMAND,this.update)},n.unbindEvent=function(){var t=this.props.editor;t.off(u.r.SELECTION_CHANGE,this.update),t.off(u.r.EXEC_COMMAND,this.update)},n.update=function(){this.forceUpdate()},n.getRenderInfo=function(){var t,e,n=this.props,i=n.getSelectionInfo,o=n.getI18n,s=i(),a=s.activeAttrMap,l=s.disabledKeys,u=o(),c=Object.keys(a);try{for(var d=(0,r.c)(c),f=d.next();!f.done;f=d.next()){var h=f.value;if(h.startsWith("list-")){var p=a[h];delete a[h];var v=h.substring(5);!a[v]&&(a[v]=p)}}}catch(e){t={error:e}}finally{try{f&&!f.done&&(e=d.return)&&e.call(d)}finally{if(t)throw t.error}}return{activeAttr:a,disabledKeys:l,i18n:u}},Object.defineProperty(n,"convertedComponents",{get:function(){return!this._convertedComponents&&(this._convertedComponents=this.props.items.map(tn)),this._convertedComponents},enumerable:!1,configurable:!0}),n.render=function(){var t=this.props.handleWrapperClick;return o.createElement("div",{className:a()("editor-kit-toolbar-v2-wrapper",this.getWrapperClassName()),ref:this.wrapperRef,style:this.getWrapperStyle(),onClick:function(e){e.persist(),t(e.target)},onMouseDown:function(t){t.preventDefault()}},this.renderContent())},(0,r.e)([i.W],e.prototype,"update",null),e}(o.PureComponent),to="floattoolbar",ts=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.state={isVisible:!1,animateDirection:"none",scrollReccord:null,positionLeft:0,positionTop:0,scrollStatus:null},e.floatConfig=(0,r.g)({shouldFollowScroll:!0,shouldFollowSelection:!0},e.props.floatConfig||{}),e.editor=e.props.editor,e.listenToScroll=(0,d.P)(e._listenToScroll,50,{leading:!0,trailing:!0}),e.throttledShowAtCurrentSelection=(0,d.P)(function(){return e.showAtCurrentSelection()},100),e.checkIfNeedToHideToolbar=(0,d.P)(e._checkIfNeedToHideToolbar,100,{leading:!0,trailing:!1}),e.checkIfNeedToShowToolbar=(0,d.P)(e._checkIfNeedToShowToolbar,100,{leading:!0,trailing:!0}),e.setPosition=function(t,n){var i=t.left,o=t.top;return void 0===n&&(n={}),(0,r._)(e,void 0,void 0,function(){var t,e,s,a,l,u,c,d,h,p,v,g,y,m,b,E,S,I,C,L,w=this;return(0,r.b)(this,function(x){var _,T,A,M,k,N,R,O,D,z,P,Z,W,K,U,F,B,V,j,H,X,q,Y,G,J;if(!(t=this.wrapperRef.current))return[2];return s=(e=(0,r.g)({anchor:"topLeft",offset:{}},n)).anchor,a=e.offset,l=e.ignoreBoundary,c=(u=t.getBoundingClientRect()).height,d=u.width,h=u.left,p=u.top,"center"===s?(v=void 0===o?p:o-c/2,g=void 0===i?h:i-d/2):"topLeft"===s&&(v=null!=o?o:p,g=null!=i?i:h),m=void 0===(y=a.left)?0:y,E=void 0===(b=a.top)?0:b,_={left:g+m,top:v+E},T=t,A=null===(L=this.props.floatConfig)||void 0===L?void 0:L.boundary,M=this.editor.getViewPortPadding,k=l,O=(R=T.getBoundingClientRect()).height,D=R.width,P=(z=(0,f.AS)(null!==(N=null==M?void 0:M())&&void 0!==N?N:0)).paddingBottom,Z=z.paddingLeft,W=z.paddingRight,K=z.paddingTop,F=(U=function(t){var e,n,r,i;return(void 0===t&&(t=!1),"boolean"==typeof t)?{ignoreTop:t,ignoreLeft:t,ignoreRight:t,ignoreBottom:t}:{ignoreTop:null!==(e=t.top)&&void 0!==e&&e,ignoreLeft:null!==(n=t.left)&&void 0!==n&&n,ignoreRight:null!==(r=t.right)&&void 0!==r&&r,ignoreBottom:null!==(i=t.bottom)&&void 0!==i&&i}}(k)).ignoreBottom,B=U.ignoreLeft,V=U.ignoreRight,j=U.ignoreTop,H=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return{top:Math.max.apply(Math,(0,r.f)(t.map(function(t){var e;return null!==(e=t.top)&&void 0!==e?e:-1/0}))),left:Math.max.apply(Math,(0,r.f)(t.map(function(t){var e;return null!==(e=t.left)&&void 0!==e?e:-1/0}))),right:Math.min.apply(Math,(0,r.f)(t.map(function(t){var e;return null!==(e=t.right)&&void 0!==e?e:1/0}))),bottom:Math.min.apply(Math,(0,r.f)(t.map(function(t){var e;return null!==(e=t.bottom)&&void 0!==e?e:1/0})))}}({bottom:F?1/0:window.innerHeight-P,right:V?1/0:window.innerWidth-W,top:j?-1/0:K,left:B?-1/0:Z},function(t){return void 0===t?{bottom:1/0,left:-1/0,right:1/0,top:-1/0}:"function"==typeof t?t().getBoundingClientRect():t.getBoundingClientRect()}(A)),X=(0,r.g)({},_),q=H.top+5-_.top,Y=H.left+5-_.left,G=_.left+D-H.right+5,(J=_.top+O-H.bottom+5)>0&&(X.top=_.top-J),G>0&&(X.left=_.left-G),q>0&&(X.top=_.top+q),Y>0&&(X.left=_.left+Y),I=(S=X).left,C=S.top,[2,new Promise(function(t){w.setState({positionLeft:I,positionTop:C},t)})]})})},e.setVisibility=function(t,n){var r=e.state,i=r.scrollStatus,o=r.scrollReccord;!1===t&&null!==o&&null!==i&&e.setState({scrollReccord:null,scrollStatus:null});var s=(null==n?void 0:n.animateDirection)||"none";return e.state.isVisible===t&&e.state.animateDirection===s?Promise.resolve():new Promise(function(n){e.setState({isVisible:t,animateDirection:s},n)})},e.showAtPosition=function(t,n){return void 0===n&&(n={}),(0,r._)(e,void 0,void 0,function(){return(0,r.b)(this,function(e){switch(e.label){case 0:return[4,this.setPosition(t,n)];case 1:return e.sent(),[4,this.setVisibility(!0,n)];case 2:return e.sent(),this.floatConfig.shouldFollowScroll&&!n._bypassScrollStatusCheck&&this.checkAndSetScrollStatus(),[2]}})})},e.getPosition=function(){var t=e.state,n=t.isVisible,r=t.positionLeft,i=t.positionTop;return n?{left:r,top:i}:null},e.setItems=function(t){e._convertedComponents=t.map(tn),e.forceUpdate()},e}(0,r.d)(e,t);var n=e.prototype;return n.componentDidMount=function(){t.prototype.componentDidMount.call(this);var e,n=this.floatConfig,r=n.onMount,i=n.shouldFollowScroll,o=n.shouldFollowSelection;r&&r({getPosition:this.getPosition,setPosition:this.setPosition,setVisibility:this.setVisibility,showAtPosition:this.showAtPosition,setItems:this.setItems}),i&&(null===(e=this.editor.getScrollContainer())||void 0===e||e.addEventListener("scroll",this.listenToScroll),window.addEventListener("scroll",this.listenToScroll)),o&&this.bindSelectionHandlers(),this.bindEditorCalls(),window.addEventListener("resize",this.throttledShowAtCurrentSelection)},n.bindSelectionHandlers=function(){var t=this,e=function(){return t._checkIfNeedToShowToolbar("mouseup")},n=function(){return t.checkIfNeedToShowToolbar("mousemove")};document.addEventListener("mouseup",e),document.addEventListener("touchend",e),document.addEventListener("mousemove",n),this.editor.on(u.r.SELECTION_CHANGE,this.checkIfNeedToHideToolbar),this.unbindSelectionHandlers=function(){document.removeEventListener("mouseup",e),document.removeEventListener("touchend",e),document.removeEventListener("mousemove",n),t.editor.off(u.r.SELECTION_CHANGE,t.checkIfNeedToHideToolbar)}},n.bindEditorCalls=function(){var t=this,e=this.editor,n=["setPosition","setVisibility","showAtPosition","getPosition","setItems"],i=n.map(function(e){return function(n){return t[e].apply(t,(0,r.f)(n))}});n.forEach(function(t,n){e.registerCommand(to+"-"+t,i[n])}),this.unbindEditorCalls=function(){n.forEach(function(t,n){e.off(to+"-"+t,i[n])})}},n.componentWillUnmount=function(){t.prototype.componentWillUnmount.call(this);var e,n,r,i=this.floatConfig,o=i.shouldFollowScroll,s=i.shouldFollowSelection;o&&(null===(e=this.editor.getScrollContainer())||void 0===e||e.removeEventListener("scroll",this.listenToScroll),window.removeEventListener("scroll",this.listenToScroll)),s&&(null===(n=this.unbindSelectionHandlers)||void 0===n||n.call(this)),null===(r=this.unbindEditorCalls)||void 0===r||r.call(this),window.removeEventListener("resize",this.throttledShowAtCurrentSelection)},n.getWrapperStyle=function(){var t=this.state,e=t.positionLeft;return{top:t.positionTop,left:e}},n.getWrapperClassName=function(){var t=this.state,e=t.isVisible,n=t.animateDirection,r=t.scrollReccord;return a()("editor_toolbar-float","toolbar-animation-"+n,{"editor_toolbar-is_visible":e,"editor_toolbar-transition_top":null!==r})},n._listenToScroll=function(){return(0,r._)(this,void 0,void 0,function(){var t,e,n,i,o,s,a,l;return(0,r.b)(this,function(r){switch(r.label){case 0:if(!this.state.isVisible)return[2];return[4,this.checkAndSetScrollStatus()];case 1:if(r.sent(),e=(t=this.state).scrollStatus,n=t.scrollReccord,"pending"===e||null===e||null===n)return[2];return i=n.positionTopShot,o=n.scrollerScrollTop,s=n.windowScrollTop,a=tr(this.editor.getScrollContainer()||window).scrollTop,l=o+s+i-window.pageYOffset-a,this.setPosition({top:l},{ignoreBoundary:{top:!0,bottom:!0}}),[2]}})})},n.fixToolbar=function(){var t=this;return new Promise(function(e){t.setState({scrollStatus:"fixed",scrollReccord:{positionTopShot:t.state.positionTop,scrollerScrollTop:tr(t.editor.getScrollContainer()).scrollTop,windowScrollTop:window.pageYOffset}},e)})},n.checkAndSetScrollStatus=function(){var t=this;return new Promise(function(e){var n=t.state.scrollStatus,r=t.checkIfToolbarOverlapsWithSelection();if(null===n)return"overlapped"===r?t.setState({scrollStatus:"pending"},e):t.showAtCurrentSelection({_bypassScrollStatusCheck:!0,ignoreBoundary:{top:!0,bottom:!0},animateDirection:"none"},{isBackward:"above-selection"===r}).then(t.fixToolbar).then(e);if("pending"!==n)return e();return"overlapped"===r?e():t.showAtCurrentSelection({_bypassScrollStatusCheck:!0,ignoreBoundary:{top:!0,bottom:!0},animateDirection:"none"},{isBackward:"above-selection"===r}).then(t.fixToolbar).then(e)})},n.checkIfToolbarOverlapsWithSelection=function(){var t=this.wrapperRef.current;if(!t)return"above-selection";var e=this.editor.selection.getSelection(),n=this.editor.rectModule.getRawCaretRect(e.start),r=this.editor.rectModule.getRawCaretRect(e.end),i=Math.min(n.top,r.top)-5,o=Math.max(n.bottom,r.bottom)+5,s=t.getBoundingClientRect(),a=s.bottom,l=s.top;return a<i?"above-selection":l>o?"below-selection":"overlapped"},n._checkIfNeedToShowToolbar=function(t){if(!(this.state.isVisible||"mousemove"===t&&this.editor.getStatus("isMouseDown")))this.showAtCurrentSelection()},n.showAtCurrentSelection=function(t,e){var n,i,o;return void 0===t&&(t={}),void 0===e&&(e={}),(0,r._)(this,void 0,void 0,function(){var s,a,l,u,c,d,f,h,p,v,g,y;return(0,r.b)(this,function(m){return(a=(s=this.editor).selection.getSelection()).isCollapsed()?[2]:(l=null!==(n=e.isBackward)&&void 0!==n?n:a.isBackward,u=a.end,c=a.start,d=l?c:u,h=(f=s.rectModule.getRawCaretRect(d)).left,p=f.top,g={left:h,top:p+(v=f.height)/2},y=v/2+(null!==(o=null===(i=this.wrapperRef.current)||void 0===i?void 0:i.getBoundingClientRect().height)&&void 0!==o?o:0)/2+10,l&&(y*=-1),[2,this.showAtPosition(g,(0,r.g)({anchor:"center",offset:{top:y},animateDirection:l?"bottom-to-top":"top-to-bottom"},t))])})})},n._checkIfNeedToHideToolbar=function(t){var e=t.previous,n=t.current;if(!c.W.isRangeEqual(e,n))this.setVisibility(!1)},n.renderContent=function(){var t=this.getRenderInfo();return o.createElement(o.Fragment,null,this.convertedComponents.map(function(e,n){return o.createElement(e,(0,r.g)({key:n},t))}))},(0,r.e)([i.W],e.prototype,"_listenToScroll",null),(0,r.e)([i.W],e.prototype,"fixToolbar",null),(0,r.e)([i.W],e.prototype,"_checkIfNeedToShowToolbar",null),(0,r.e)([i.W],e.prototype,"showAtCurrentSelection",null),(0,r.e)([i.W],e.prototype,"_checkIfNeedToHideToolbar",null),e}(ti),ta=n("65476"),tl=n("386308"),tu=n("809919");function tc(t){return(0,r.f)(t).reduce(function(t,e){var n=(0,r.a)(e,2),i=n[0],o=n[1];return t[i]=o,t},{})}var td=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="FloatToolbar",e}return(0,r.d)(e,t),e.prototype.renderReact=function(){l.render(o.createElement(ts,(0,r.g)({key:this.reactKey},this._options,{getSelectionInfo:this.getSelectionInfo,handleWrapperClick:this.handleWrapperClick})),this.mountPoint)},(0,r.e)([i.W],e.prototype,"renderReact",null),e}(function(t){function e(e){var n=t.call(this)||this;return n._options=e,n._mountPoint=null,n.reactKey=(0,tu.D)(),n.editor=e.editor,n}(0,r.d)(e,t);var n=e.prototype;return Object.defineProperty(n,"mountPoint",{get:function(){if(!this._mountPoint){var t=this._options.toolbarId||"editor-toolbar_"+(0,tu.D)(),e=document.getElementById(t);!e&&((e=document.createElement("div")).setAttribute("id",t),document.body.appendChild(e)),this._mountPoint=e}return this._mountPoint},enumerable:!1,configurable:!0}),n.clearMountPoint=function(){if(!!this._mountPoint)this._mountPoint.remove(),this._mountPoint=null},n.handleWrapperClick=function(t){for(var e=this,n=t,r=null,i=null;n&&n!==this.mountPoint;){if(r=null==n?void 0:n.getAttribute("plugin-key")){if((null==n?void 0:n.getAttribute("plugin-disabled"))==="true")return;i=null==n?void 0:n.getAttribute("plugin-value");break}n=n.parentElement}if(!!r){if(/\[.+\]/.test(r))try{for(var o=JSON.parse(r),s=JSON.parse(i||"[]").map(function(t){return null===t?void 0:t}),a=0;a<o.length;a++)this.editor.execCommand(o[a],{value:s[a]})}catch(t){}else this.editor.execCommand(r,null===i?void 0:{value:i});this.editor.once("paint",function(){return e.renderReact(!0)})}},n.editorDidMount=function(){this.renderReact(!0)},n.destroy=function(){this.clearMountPoint()},n.getMultipleLineAttributes=function(t){for(var e=t.start,n=t.end,r=Math.min(e.line,n.line),i=Math.max(e.line,n.line),o=[],s=r;s<=i;s++)o.push(this.editor.getContentState().getLineAttributes(e.zoneId,s));return o},n.getSelectionInfo=function(){var t,e,n,i,o,s,a,l=this.editor,u=new Map,c=new Map,d=l.selection.getSelection(),f=d.start,h=d.end,p=l.getContentState().getEntities({start:f,end:h}),v=l.getContentState().schema;if(p.length){u=new Map(Object.entries(p[0].attributes));try{for(var g=(0,r.c)(p),y=g.next();!y.done;y=g.next()){var m=y.value;if(!m.attributes){u=new Map;break}var b=m.attributes,E=m.text,S=(0,ta.qF)(v,b),I=S?null===(a=v.get(S))||void 0===a?void 0:a.attributes:void 0;try{for(var C=(n=void 0,(0,r.c)(u.entries())),L=C.next();!L.done;L=C.next()){var w=(0,r.a)(L.value,2),x=w[0],_=w[1],T=!0;I&&(T=(0,ta.EG)(x,_,_,I)),T&&_!==b[x]&&!b.lmkr&&"\n"!==E&&u.delete(x)}}catch(t){n={error:t}}finally{try{L&&!L.done&&(i=C.return)&&i.call(C)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{y&&!y.done&&(e=g.return)&&e.call(g)}finally{if(t)throw t.error}}}var A=this.getMultipleLineAttributes({start:f,end:h});A.length&&(c=new Map(Object.entries(A[0].toMap())),A.forEach(function(t){var e,n,i=t.toMap();try{for(var o=(0,r.c)(c.entries()),s=o.next();!s.done;s=o.next()){var a=(0,r.a)(s.value,2),l=a[0],u=a[1];i[l]!==u&&c.delete(l)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}}));var M=this.editor.getContentState().getInlineStyleOverride(d.toPosition()),k=Object.assign(tc(u.entries()),tc(c.entries()),M);try{for(var N=(0,r.c)(Object.entries(k)),R=N.next();!R.done;R=N.next()){var O=(0,r.a)(R.value,2),D=O[0],z=O[1];""===z&&delete k[D]}}catch(t){o={error:t}}finally{try{R&&!R.done&&(s=N.return)&&s.call(N)}finally{if(o)throw o.error}}var P=[];return this._options.getDisabledPluginKeys&&(P=this._options.getDisabledPluginKeys({entities:p,selection:d})),{activeAttrMap:k,disabledKeys:P}},(0,r.e)([i.W],e.prototype,"handleWrapperClick",null),(0,r.e)([i.W],e.prototype,"getSelectionInfo",null),e}(tl.S))},48201:function(t,e,n){"use strict";var r,i;n.d(e,{_:function(){return r}}),(i=r||(r={})).Bold="Bold",i.Italic="Italic",i.Underline="Underline",i.Undo="Undo",i.Redo="Redo",i.Strikethrough="Strikethrough",i.Blockquote="Blockquote",i.UnorderedList="UnorderedList",i.OrderedList="OrderedList",i.Checkbox="Checkbox",i.Indent="Indent",i.H1="H1",i.H2="H2",i.H3="H3",i.AlignCenter="AlignCenter",i.AlignLeft="AlignLeft",i.AlignRight="AlignRight",i.HorizontalLine="HorizontalLine",i.Hyperlink="Hyperlink",i.Image="Image",i.Table="Table",i.CodeBlock="CodeBlock",i.Video="Video",i.DIVIDER="DIVIDER",i.ColorPicker="ColorPicker",i.FontSizeDropdown="FontSizeDropdown",i.AlignDropdown="AlignDropdown",i.HeadingDropdown="HeadingDropdown",i.FontFamilyDropdown="FontFamilyDropdown"},144847:function(t,e,n){"use strict";n.d(e,{_:function(){return l},a:function(){return d},b:function(){return u},c:function(){return c},d:function(){return i},e:function(){return a},f:function(){return f},g:function(){return o},h:function(){return s},i:function(){return h}});var r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n],e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function s(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&0>e.indexOf(r)&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)0>e.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function a(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s}function l(t,e,n,r){return new(n||(n=Promise))(function(i,o){function s(t){try{l(r.next(t))}catch(t){o(t)}}function a(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):((e=t.value)instanceof n?e:new n(function(t){t(e)})).then(s,a)}l((r=r.apply(t,e||[])).next())})}function u(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=(i=s.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function c(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function d(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function f(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(d(arguments[e]));return t}function h(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}},372321:function(t,e,n){"use strict";n.d(e,{m:function(){return te},J:function(){return tf},b:function(){return G},l:function(){return tt}});var r,i,o,s,a,l=n("144847"),u=n("97930"),c=n("162114"),d=n("65476"),f=n("559016"),h=n("993137"),p=n("650054"),v=n("809721"),g=n("175465"),y=n("649146"),m=n("386308"),b=n("283138"),E=n("651271"),S=n("464675"),I=n("481685"),C=n("899454"),L=n("397663"),w=n("708180"),x=n("689057"),_=n("154463"),T=n("390485"),A=/(?:^| )ol-id([0-9a-zA-Z]+)/,M=/^[0-9a-zA-Z]+$/,k=/(number)([0-9]+)/,N=/([a-z]+)([0-9]+)/;(r=s||(s={}))[r.UP=0]="UP",r[r.DOWN=1]="DOWN";var R=["lang","start","origin-start","ol-id","text-indent"],O=["bold","italic","underline","strikethrough","fontsize","fontcolor","fontfamily","fontweight","backgroundcolor"].map(function(t){return"list-"+t}),D=n("741704"),z=n.n(D),P=n("816329"),Z={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},W=/[\x00-\x2F\x3A-\x40\x5B-\x60\x7B-\xFF]/gm;function K(t){return t&&t.replace(W,function(t){return Z[t]||"&#x"+("00"+t.charCodeAt(0).toString(16)).slice(-2)+";"})}var U=n("809919");function F(t){var e={};return function(n){var r=e[n];return null==r&&(r=e[n]=t(n)),r}}var B=F(function(t){return t<1?"":(function(t){for(var e="";t>=0;)e=String.fromCharCode(t%26+65)+e,t=Math.floor(t/26)-1;return e})(t-1).toLowerCase()}),V=F(function(t){if(t<1)return"";if(t>1e4)return String(t);var e,n,r={m:1e3,cm:900,d:500,cd:400,c:100,xc:90,l:50,xl:40,x:10,ix:9,v:5,iv:4,i:1},i="";try{for(var o=(0,l.c)(Object.keys(r)),s=o.next();!s.done;s=o.next()){for(var a=s.value;t>=r[a];)i+=a,t-=r[a]}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return i});function j(){return(0,U.D)(8)}var H="bullet",X="number";(i=a||(a={}))[i.BULLET=0]="BULLET",i[i.ORDER=1]="ORDER",i[i.INDENT=2]="INDENT";var q="clientside-remove-text-indent",Y=function(t){function e(n){var r=t.call(this)||this;return r.name="List",r.pasteLineNum=-1,r.willRenumberArr=[],r.needRenumberList=!1,r.olIdMap={},r.deserializeOlID="",r.serializeOlID="",r.prevListType=-1,r.prefixAttributes=O,r.relativeAttrKeys=R.concat(O),r.zoneShouldRemoveTextIndent=null,r.handleDeleteKey=function(t){var e=t.isBackward,n=r.editor.selection.getSelection(),i=n.start,o=r.editor.getContentState().getActiveZone().getLine(i.line);if(!o)return;var s=o.getLineAttributes().toMap();if(!!(e&&n.isCollapsed()&&s.list&&n.start.offset===o.getLineMarker()))r.handleEditorWillDoDeleteKey(),t.stopEvent(),t.preventEvent(),t.e.preventDefault()},r.handleWillDeleteFromCut=function(t){var e=r.editor,n=e.selection.getSelection(),i=n.start,o=n.end,s=i.zoneId,a="",l="";a=J(e,s,i.line);var u=e.getContentState().getZoneState(s);u&&i.line!==u.length()-1&&(l=J(e,s,o.line+1)),(a||l)&&(r.cutList(),t.preventEvent())},r.cutList=function(){var t=r.editor;t.undoModule.batchedUndo(function(){var e=r.renumberList,n=r.deleteNumberList,i=t.selection.getSelection(),o=i.start,s=i.end,a=o.line,l=t.getContentState(),c=l.hasLineMarker(o)?1:0,d=o;(0,P.Q)(s,l)&&function(t,e){var n=t.zoneId,r=t.line,i=t.offset;if(i>1)return!1;var o=e.getZoneState(n);if(!o)throw Error("isStartOfLine execute error: zoneId "+n+" does not exist.");var s=o.getLine(r);if(!s)throw Error("isStartOfLine execute error: zoneId "+n+" line "+r+" does not exist.");return i===(s.hasLineMarker()?1:0)}(o,l)&&(d={zoneId:o.zoneId,line:a,offset:c});var f=n(new u.e({start:d,end:s,editor:t}));t.getContentState().deleteText({start:d,end:s});var h=t.selection.getSelection().start,p=h.zoneId,v=h.line;-1!==v&&f.forEach(function(t){"number"==typeof t&&null===e(p,v+1)?e(p,v):e(p,v,t,!1)})})},r.caretColumn=function(){return r.editor.selection.getSelection().start.offset},r.deleteNumberList=function(t,e){void 0===e&&(e=[]);var n=r.editor,i=(t=t||n.selection.getSelection()).start,o=t.end,s=i.zoneId,a=i.line,l=o.line,u=n.getContentState().getZoneState(s);if(!u)return e;var c=u.getLine(a);if(t.isCollapsed()&&r.caretColumn()===(c.hasLineMarker()?1:0)){var d=t.start.line>1?J(n,s,t.start.line-1):"",f=t.start.line<u.length()?J(n,s,t.start.line+1):"";if(d.indexOf("code")>-1&&f.indexOf("code")>-1)return e.push(Number(t.start.line)),e}for(var h=a;h<=l;h++){var p=J(n,s,h);if(-1!==p.indexOf("code")){e.push(Number(h));continue}if(-1!==p.indexOf(X)){var v=u.getLine(h).getLineAttributes().toMap()["ol-id"];if(v&&!e.includes(v))e.push(v);else if(!v){var g=j();r.renumberList(s,h,g,!0),e.push(g)}}}return e},r.handleDidPaste=function(){if(r.zoneShouldRemoveTextIndent){var t,e,n,i,o=r.editor.getContentState(),s=null===(i=o.getZoneState(r.zoneShouldRemoveTextIndent))||void 0===i?void 0:i.getEntities([[q,"true"]]);if(s)try{for(var a=(0,l.c)(s),u=a.next();!u.done;u=a.next()){var c=u.value;o.setLineAttributes(c.start.zoneId,c.start.line,((n={"text-indent":""})[q]="",n))}}catch(e){t={error:e}}finally{try{u&&!u.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}r.zoneShouldRemoveTextIndent=null}var d=r.editor.selection.getSelection(),f=d.start,h=d.end;r.doFixNewInsertNodeListError(r.pasteLineNum,Math.max(f.line-r.pasteLineNum,1)),r.mergeListIfNecessary(f.zoneId,f.line,h.line),r.renumberList(f.zoneId,r.pasteLineNum)},r.handleContentChange=function(t){var e=t.changes,n=t.options;if(!n.isRemote&&"setContent"!==n.type&&!!r.needRenumberList)Object.values(e).forEach(function(t){var e=0;t.forEach(function(n){var i=n.start,o=n.inserts,s=n.deletes;(o.length>1||s.length>1||t.length>1)&&r.doFixNewInsertNodeListError(i+e,o.length),s.length&&s.forEach(function(t){var e;(null===(e=t.getLineAttributes().toMap().list)||void 0===e?void 0:e.includes("number"))&&r.handleDeleteListLine(t.index)}),e+=o.length-s.length})})},r.handleCompositionEnd=function(t){var n,i=r.editor.selection.getSelection();if(t.data.length>0||!i.isCollapsed())return;var o=i.start,s=o.zoneId,a=o.line,l=r.editor.getContentState(),u=null===(n=l.getZoneState(s))||void 0===n?void 0:n.getLine(a);if(!(null==u?void 0:u.isTextEmpty()))return;var c=u.getLineAttributes().toMap();if(e.KEY in c)l._forceRefresh(s,[a])},r.doFixNewInsertNodeListError=function(t,e){if(!!r.needRenumberList)for(var n,i,o=r.renumberList,s=r.editor.getContentState().getActiveZone().getZoneId(),a="",l="",u=0;u<e;++u){var c=t+u,d=J(r.editor,s,c),f=J(r.editor,s,c+1),h=d.indexOf(X)>-1,p=d.indexOf("code")>-1,v=f.indexOf("code")>-1,g=h&&(null===(i=null===(n=r.editor.getContentState().getZoneState(s))||void 0===n?void 0:n.getLine(c))||void 0===i?void 0:i.getLineAttributes().toMap()["ol-id"])||"";if(h&&g!==a){var y=""===g?a:"",m=r.needRenumberList;r.needRenumberList=!1,y?o(s,c,y,!0):o(s,c),r.needRenumberList=m}var b=l.indexOf("code")>-1;p&&!b&&o(s,c),!p&&v&&o(s,c+1),l=d,a=g}},r.doInsertOrderedList=function(){r.editor.undoModule.batchedUndo(function(){r.doInsertList({attribKey:"list",attribValue:X})})},r.doInsertUnorderedList=function(){r.editor.undoModule.batchedUndo(function(){r.doInsertList({attribKey:"list",attribValue:H})})},r.doInsertList=function(t){var e=t.attribKey,n=t.attribValue,i=t.range,o=t.isAllHasAttrib,s=t.clickZone,a=r.editor;if(i=i||a.selection.getSelection(),void 0===o){var l=function(t,e,n,r){var i=t.getContentState();return e.every(function(t){for(var e=t.start,o=t.end,s=e.zoneId,a=e.line,l=o.line,u=a;u<=l;u++){var c=i.getLineAttributes(s,u).toMap()[n];if(!c||c.slice(0,r.length)!==r){var d=i.getZoneState(s);if(!d)return!1;for(var f=d.getLine(u).getAttributes(),h=!1,p=0,v=f.length;p<v;++p){var g=f[p][0];if("sheet-id"===g||"horizontal-line"===g||"aceTable"===g){h=!0;break}}if(h)continue;return!1}}return!0})}(a,[i],e,n);return r.doInsertList({attribKey:e,attribValue:n,range:i,isAllHasAttrib:l,clickZone:s})}var u=i.start,c=i.end,d=n.replace(/^([a-z]+)\d*$/g,"$1"),f=u.line,h=c.line,p=u.zoneId,v=[],g=r.getClosetListNumberId(p,d,i)||j(),y=a.getContentState().getZoneState(p);if(!!y){for(var m=f;m<=h;m++){if("code"===d){v.push([m,o?"":"code1",""]);continue}var b=0,E="",S=y.getLine(m).getLineAttributes().toMap()["text-indent"],I=J(a,p,m),C=tt(I);C&&(E=C[1],b=Number(C[2])),S&&(b+=2),E=I||S,o&&(b-=1),C&&"indent"===C[1]&&!S&&(b+=1);var L=E?d+b:d+"1",w=b>0?"indent"+b:"",x=o&&!s?w:L;v.push([m,x,S,g])}var _=v.filter(function(t){var e,n=t[0],r=null===(e=y.getLine(n))||void 0===e?void 0:e._node;return!r||!(r.className.indexOf("IGNORE_LIST")>-1)}).map(function(t){return t[0]}),T=v.reduce(function(t,e){return t[e[0]]=e[1],t},{}),A=v[0][1];k.exec(A)?r.bulkInsertOList(p,_,T):r.setMultiLinesListType(p,_,T,g);var M=v.filter(function(t){return t[2]}).map(function(t){return t[0]});r.setAttributeOnMultiLines(p,M,{"text-indent":""}),r.renumberList(p,h+1)}},r.registerCommand=function(){var t=r.editor;t.registerCommand(e.KEY,function(t){var e=t.value;e===X?r.doInsertOrderedList():e===H&&r.doInsertUnorderedList()}),t.registerCommand(w.P.INDENT_LEFT,function(){(0,_.u)(t,X,!1),(0,_.u)(t,H,!1);var e=r.indexOfListLineInRange(),n=r.editor.selection.getSelection().start,i=n.zoneId,o=n.line;e>-1?r.renumberList(i,e):r.renumberList(i,o+1)}),t.registerCommand(w.P.INDENT_RIGHT,function(){(0,_.u)(t,X,!0),(0,_.u)(t,H,!0);var e=r.indexOfListLineInRange();if(e>-1){var n=r.editor.selection.getSelection().start;r.renumberList(n.zoneId,e)}})},r.deserialize=function(t){var e,n,i=t.node,o=t.deltaSet,s=t.zoneId,a=o;if(i instanceof HTMLElement){var l=i.tagName,u=i.className,d=A.exec(u);if(d&&(a=(0,c.e)(a,s,{"ol-id":d[1]})),"ol"===l.toLowerCase()&&((null===(e=i.parentElement)||void 0===e?void 0:e.tagName.toLowerCase())==="body"||!(null===(n=i.parentElement)||void 0===n?void 0:n.closest("ol")))&&(r.deserializeOlID=j()),"li"===l.toLowerCase()){var f=function(t){var e=null,n=t,r=t.dataset.list;if("LI"===t.tagName&&r){if(/bullet/.test(r))return"bullet";if(/number/.test(r))return"number"}for(;n;){if("UL"===n.tagName){e="bullet";break}if("OL"===n.tagName){e="number";break}n=n.parentElement}return e}(i),h=function(t){var e=0,n=t.parentElement;if("LI"===t.tagName&&t.dataset.list&&/number/.test(t.dataset.list)){var r=tl(t.dataset.list);if(r)return r}for(;n;)["OL","UL"].includes(n.tagName)&&e++,n=n.parentElement;return e}(i),p=String(function(t){var e=t.parentElement;if(e&&"OL"===e.tagName&&"LI"===t.tagName)return(e.start||1)+Array.from(e.children).filter(function(t){return"LI"===t.tagName}).indexOf(t);for(;e;){if("OL"===e.tagName&&e.start)return e.start;e=e.parentElement}return 1}(i)),v=i.getAttribute("data-ol-id"),g=r.deserializeOlID;v&&(!r.olIdMap[v]&&(r.olIdMap[v]=j()),g=r.olIdMap[v]);var y=function(t){for(var e=null,n=t;n;){var r=/(?:^| )list-([a-z]+[0-9]+)\b/.exec(n.className);if(r&&r[1]){e=r[1];break}n=n.parentElement}var i="",o="";if(t&&"LI"===t.tagName){var s=t.dataset.list,a=void 0===s?"":s;/bullet/.test(a)?i="bullet":/number/.test(a)&&(i="number");var l=a.match(/\d+/);if(l){if(!i)return null;e=i+(o=l[0])}}if(i&&e&&!o){var l=e.match(/\d+/);l&&(e=i+l[0])}return e}(i);(h>=1&&f||y)&&tf(a,s,{list:y||""+f+h,start:p,"origin-start":p}),"number"===f&&tf(a,s,{"ol-id":g})}}return a},r.UNSAFE_editorNormalizePasteNode=function(t){var e,n,i=t.data.node,o=r.editor,a=o.selection.getSelection().start,l=a.line,u=a.offset,c=z()(i).find(">:not(meta)"),d=1===c.length,f=z()(i).find("ul, ol");if(u>0&&d&&f[0]&&c.hasClass("list-div")){var h=z()("<div/>");h.html(f.html());for(var p=0;p<f[0].attributes.length;p++){var v=f[0].attributes[p];h.attr(v.name,v.value)}h.removeClass("bullet1 number1"),h.html(h.find("li")[0].innerHTML),f.replaceWith(h)}Array.from(i.querySelectorAll("ul,ol")).forEach(function(t){Array.from(t.childNodes).forEach(function(t){t.nodeType===Node.TEXT_NODE&&t.parentNode&&t.parentNode.removeChild(t)})});var g=z()(i).find("ol");if(g.length<=0)return;for(var y=g[0],m=g[0];y.previousSibling&&"meta"!==th(y.previousSibling);)y=y.previousSibling;for(;m.nextSibling;)m=m.nextSibling;if(!y||!m)return;var b=o.getContentState().getZoneState(a.zoneId);if(!!b){var E=null===(e=b.getLine(l-1))||void 0===e?void 0:e.getLineAttributes().toMap()["ol-id"],S=b.getLine(l).getLineAttributes().toMap()["ol-id"],I=null===(n=b.getLine(l+1))||void 0===n?void 0:n.getLineAttributes().toMap()["ol-id"],C="ol"===th(y),L="ol"===th(m);if(!C&&!L){r.assignListId(g,j());return}if(C&&(E||S))r.assignListId(g,E||S);else if(L&&I)r.assignListId(g,I,!0);else{var w=r.getLevelAndOrderFromOl(y),x=w.level,_=w.order,T=to(o,l).upwardClosestOListInfo;if(T)r.assignListId(g,T.listId);else{var A=ti(o,s.UP,l,x,_);if(A){r.assignListId(g,A.listId);return}r.assignListId(g,j())}}}},r.editorWillPaste=function(t){var e,n,i,o,a,u,f=t.deltaSet,h=t.zoneId,p=t.isInternalPaste,v=t.lineState,g=r.editor.selection.getSelection().start,y=r.editor.getContentState().getActiveZone(),m=g.line;r.pasteLineNum=m;var b=r.editor.getContentState().schema,E=f.get(h),I=E.ops[0],C=I&&(0,d.ky)(I.attributes,b),L=I&&(I.attributes||{}).lmkr,w=L&&(I.attributes.list||I.attributes.blockquote);if(v&&v.getLineAttributes().toMap()["text-indent"]&&L&&I.attributes.list&&!I.attributes["text-indent"]&&(r.zoneShouldRemoveTextIndent=g.zoneId,I.attributes[q]="true"),v&&r.isListLine(v)&&!(0,c.g)(E,"\n")){if(C||w);else{var x=new S.I({zoneId:h});E.eachLine(function(t,e,n){if(0===n){x=x.concat(t);return}var r=e.lmkr?e:{},i=e.lmkr?t.ops.slice(1):t.ops;x=x.insertLineMarker((0,l.g)((0,l.g)({},r),v.getLineAttributes().toMap())).concat(new S.I({zoneId:h,ops:i}))}),f.replace(h,x)}}if(p){var _=!1,T=null,A=!1,M=null;f.forEach(function(t){if(t.zoneId===h&&t instanceof S.I){var e=0;t.eachLine(function(t,n,r){e=r}),t.eachLine(function(t,n,r){if(!!n["ol-id"])0===r&&(_=!0,T=n),r===e&&(A=!0,M=n)})}});var N=null===(a=y.getLine(m-1))||void 0===a?void 0:a.getLineAttributes().toMap()["ol-id"],R=y.getLine(m).getLineAttributes().toMap()["ol-id"],O=null===(u=y.getLine(m+1))||void 0===u?void 0:u.getLineAttributes().toMap()["ol-id"],D=function(t){var e="string"==typeof t?{}:(0,l.g)({},t);f.forEach(function(n){if(n.zoneId===h&&n instanceof S.I){var r=(0,c.r)(n,function(t){return"ol-id"===t.key},function(n){var r,i=n.key,o=n.value,s="string"==typeof t?t:null!==(r=e[o])&&void 0!==r?r:j();return!e[o]&&(e[o]=s),{key:i,value:s}});f.replace(h,r)}})};if(_||A){if(_&&(N||R))D(((i={})[T["ol-id"]]=N||R,i));else if(A&&O)D(((o={})[M["ol-id"]]=O,o));else{var z=T||{list:"number1",start:"1"},P=z.list,Z=z.start,W=parseInt(k.exec(void 0===P?"number1":P)[2],10),K=parseInt(void 0===Z?"1":Z,10)||1,U=to(r.editor,m).upwardClosestOListInfo;if(U)D(U.listId);else{var F=ti(r.editor,s.UP,m,W,K);D(F?F.listId:{})}}}else D({})}var B=(e=f.get(h),n={},e.eachLine(function(t,e,r){return 0!==r||(n=e,!1)}),"list"in n),V=f.get(h),H=function(){var t=y.getLine(g.line);if(!t)return;var e=t.getLineAttributes().toMap().list;if(!B||!e)return;var n=[];if(V.eachLine(function(t,e){var r=e.list&&Number(e.list.slice(-1));if(!!r)n.push(r)}),!n.length)return;var r=Number(e.slice(-1))||Math.min.apply(Math,(0,l.f)(n)),i=!e&&1===r,o=e&&r+Math.min.apply(Math,(0,l.f)(n))-n[0]<1;if(!i&&!o)return[r,!!e]}();if(H){var X=0,Y=new S.I({zoneId:h});V.eachLine(function(t,e,n){var r=tt(e.list),i=r&&r[1],o=r&&Number(r[2]),s=(0,l.a)(H,2),a=s[0],u=s[1];if(!i||!o){Y=Y.concat(t);return}var c="";u?(0===n&&(X=a-o),c=0===n?""+i+a:""+i+(o+X)):(o!==a&&(X=o-a),c=o===a?i+"1":""+i+(X+1)),Y=Y.insert("*",(0,l.g)((0,l.g)({},t.ops[0].attributes),{list:c})).concat(new S.I({zoneId:h,ops:t.ops.slice(1)}))}),f.replace(h,Y)}return f},r.addListAttrToDeltaSet=function(t,e){if(!(t&&r.isListLine(t)))return e;var n=new I.D,i=t.getLineAttributes().toMap();return e.forEach(function(e,r){if(r!==t.getZoneId()||!(e instanceof S.I)){n=n.concat(e);return}var o=new S.I({zoneId:r});e.eachLine(function(t){t.ops.forEach(function(t,e){if(0!==e){o.push(t);return}var n=t.attributes||{};if("*"===t.insert&&t.attributes&&t.attributes.lmkr){var r=t.attributes.list;o.insert("*",r?n:(0,l.g)((0,l.g)({},n),i))}else o.insertLineMarker(i).push(t)})}),n=n.concat(o)}),n},r.isListLine=function(t){return t.hasLineMarker()&&t.getLineAttributes().toMap().list},r.addListId=function(t,e){if(!!e)z()(t).removeClass(function(t,e){return(e.match(/ol-id([\w]{8})/g)||[]).join(" ")}),z()(t).addClass("ol-id"+e)},r.renderLine=function(t){var e,n,i=t.children,o=t.lineState,s="",a=o.getLineAttributes().toMap();try{for(var u=(0,l.c)(Object.entries(a)),c=u.next();!c.done;c=u.next()){var d=(0,l.a)(c.value,2),f=d[0],h=d[1];if(["list","start","origin-start"].includes(f)||"ol-id"===f&&M.test(h)){var p=s?" ":"",v=f+":"+h;s+=""+p+v}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}var g=/(?:^| )list:(\S+)/.exec(s),y=/(?:^| )ol-id:(\S+)/.exec(s);if(y){var p=t.lineClass?" ":"";t.lineClass+=p+"ol-id"+y[1]}if(g){var m=g[1];if(m){var S="list-div",I=K(m),C=/(?:^| )start:(\S+)/.exec(s)||["start:1","1"],L=parseInt(C[1],10),w=r.getLiStyleFromLineState(o),x=void 0!==w.fontSize?"font-size-"+String(w.fontSize).replace(/\s/g,""):void 0;if(I.indexOf("code")>-1)return S+=" list-code",1===L&&(S+=" list-code-start"),t.lineClass+=" "+S,b.ZP.createElement("code",{start:""+L,className:"list-"+I,spellcheck:"false"},t.children);if(0>I.indexOf(X)){if(I.indexOf("check")>-1||I.indexOf("done")>-1)return i;t.lineClass+=" "+S;var _=I.indexOf("indent")>-1?"indent":"bullet";return b.ZP.createElement(E.B,{className:"list-"+I+" r-list r-list-"+_},b.ZP.createElement(E.n,{style:w,className:x},t.children))}else{if(!C)return t.lineClass+=" "+S,b.ZP.createElement(E.O,{className:"list-"+I+" r-list r-list-number"},b.ZP.createElement(E.o,{style:w,className:x},t.children));1===L&&(S+=" list-start-"+I);var T=/(?:^| )origin-start:(\S+)/.exec(s),A=tp(L,Number(tt(I)[2]));if(!T)return t.lineClass+=" "+S,b.ZP.createElement(E.O,{start:""+L,"data-start":""+L,className:"list-"+I+" r-list r-list-number"},b.ZP.createElement(E.o,{start:""+A,"data-start":""+A,style:w,className:x},t.children));var k=K(T[1]);return t.lineClass+=" "+S,b.ZP.createElement(E.O,{"data-origin-start":""+k,start:""+k,"data-start":""+k,className:"list-"+I+" r-list r-list-number"},b.ZP.createElement(E.o,{start:""+A,"data-start":""+A,style:w,className:x},t.children))}}}return i},r.handleKeydown=function(t){var e=t.evt;if(!r.editor)return;var n=r.editor.selection.getSelection(),i=n.start,o=n.end,s=r.editor.getContentState(),a=s.getActiveZone(),l=a.getZoneId();if(!i||!o)return;var u=o.line,c=o.offset,d=a.getLine(u);e.keyCode===x.VD.Delete&&"Delete"===e.key&&n.isCollapsed()&&d&&c===d.getModelText().length&&r.mergeList(l,u+2,u);var f=e.type,h=e.keyCode,p=e.shiftKey,v=e.ctrlKey,g=e.metaKey;if(!T.Z.isSafari||"keydown"!==f)return;if((h===x.VD.Up||h===x.VD.Down)&&!(v||g)){var y=h===x.VD.Up,m=n.isBackward,b=y?Math.max((p,i.line-1),0):Math.min((p&&m?i.line:o.line)+1,a.length()-1);if(!a.getLine(b).getLineAttributes().toMap().list)return;var E=a.getLine(b),S=E.hasLineMarker()?1:0,I=E.length()-1,C=p&&!m?i:{zoneId:l,line:b,offset:S},L=p&&m?o:{zoneId:l,line:b,offset:S};I===S&&(r.editor.selection.setSelection({start:C,end:L}),e.preventDefault())}if(!!s.getLineAttributes(l,i.line).toMap().list&&!!n.isCollapsed()){if(h===x.VD.Left&&(0,x.qT)(e.nativeEvent)){var w=a.getLine(i.line).hasLineMarker()?1:0,b=i.line,_={zoneId:l,line:b,offset:w};e.shiftKey?r.editor.selection.setSelection({end:o,start:_}):r.editor.selection.setSelection({end:_,start:_}),e.preventDefault()}}},r.setListAttributeOnMultiLines=function(t,e,n,i){void 0===i&&(i={type:"setLineAttributes"});var o=r.editor.getContentState();e.forEach(function(e){o.setLineAttributes(t,e,{list:n[e]},i)})},r.setLineListType=function(t,e,n,i){var o,s,a,l,u={},c=r.editor,d=r.renumberList,f=c.getContentState(),h=c.selection.getSelection();""===n?(l=!1,a=null===(s=null===(o=f.getZoneState(t))||void 0===o?void 0:o.getLine(e))||void 0===s?void 0:s.getLineAttributes().toMap()["ol-id"],r.relativeAttrKeys.concat("list").forEach(function(n){var r;f.setLineAttributes(t,e,((r={})[n]="",r))})):(u.list=n,n.indexOf(X)>-1&&(a=i||r.getClosetListNumberId(t,n,h)||j())&&(u["ol-id"]=a),f.setLineAttributes(t,e,u)),d(t,e,a,l)},r.setLineListTypeWithStart=function(t,e,n,i,o,s){var a,l=r.editor,u=l.getContentState(),c=u.getZoneState(t);if(!!c){var d=l.selection.getSelection(),f=s||r.getClosetListNumberId(t,n,d)||j();if(!i){r.setLineListType(t,e,n,f);return}i=String(i),n?o?u.setLineAttributes(t,e,{list:n,start:i,"origin-start":i,"ol-id":f}):u.setLineAttributes(t,e,{list:n,start:i,"ol-id":f}):(f=c.getLine(e).getLineAttributes().toMap()["ol-id"],a=!1,r.setLineListType(t,e,"")),r.renumberList(t,e,f,a)}},r.unNumberType=function(t){return"indent"===t||t===H||"check"===t||"done"===t},r.findClosetList=function(t,e,n){var i=e,o="up",s=r.editor.getContentState(),a=[],l=s.getZoneState(t);if(!l)return a;for(var u=l.length(),c=J(r.editor,t,e);i-1>=0&&r.compatibleList(t,i-1,n,o,a);){;i--}for(i=e,c&&n&&a.push(i),o="down";i+1<=u&&r.compatibleList(t,i+1,n,o,a);){;i++}return a},r.compatibleList=function(t,e,n,i,o){var s,a=r.unNumberType,l=J(r.editor,t,e),u=!1;if(!l)return null;var c=tt(l);if("code"===n)return a(c[1])||n!==c[1]?null:("up"===i?o.unshift(e):"down"===i&&o.push(e),!0);if("oldNumber"===n&&c[1]===X){var d=null===(s=r.editor.getContentState().getZoneState(t))||void 0===s?void 0:s.getLine(e);return!d||(u=d.getLineAttributes().toMap()["ol-id"])?null:("up"===i?o.unshift(e):"down"===i&&o.push(e),!0)}return null},r.renumberList=function(t,e,n,i){var o,s=r.editor,a=r.unNumberType,u=[],c=!1===i,d="",f=J(s,t,e),h=!!n;if(!f&&!h)return null;var p=tt(f);if(h&&(p=tt("number1")),a(p[1])&&!c)return null;var v=null===(o=r.editor.getContentState().getZoneState(t))||void 0===o?void 0:o.getLine(e).getLineAttributes().toMap()["ol-id"],g=n||v,y=[];if("code"===p[1]?d="code":p[1]===X&&!c&&(d="oldNumber"),""!==d&&(y=r.findClosetList(t,e,d)),0!==y.length&&"oldNumber"===d&&(y=y.map(function(n){if(n===e)return v===g?null:n;var r=tn(s,t,n);return r&&r.listId===g?null:n}).filter(function(t){return null!==t}).sort(function(t,e){return t-e}),r.setAttributeOnMultiLines(t,y,{"ol-id":g})),i&&s.getContentState().setLineAttributes(t,e,{"ol-id":g}),g){var m=r.editor.getContentState().getZoneState(t);(m?(0,l.f)(Array(m.length())).map(function(e,n){return tn(s,t,n)}):[]).forEach(function(t,e){t&&t.listType.indexOf(X)>-1&&t.listId===g&&u.push(e)})}var b=[];return 0!==u.length?b=u:0!==y.length&&(b=y),b.length&&r.performRenumberList(t,b,p,false),null},r.performRenumberList=function(t,e,n,i){var o=r.editor,s=new S.I({zoneId:t}),a=0,l=function(e,i,u){for(var c,d,f=e[a],h=-1,p=J(o,t,f);p;){d=Number((p=tt(p))[2]);var v=r.editor.getContentState().getZoneState(t),g=v.getLine(f).getLineAttributes().toMap(),y=g["text-indent"],m=g.start;if(isNaN(d)||r.unNumberType(p[1])){if("code"===n[1]||d<i)return f;a++}else if(d===i){if(-1===h){c=Number(g["origin-start"]);h=Number(u?m:c||1)}var b={start:String(h)};if(h!==c&&c&&(b["origin-start"]=""),Number(h)!==Number(m)){y&&(b["text-indent"]="");var E=v.pointToOffset({line:f,offset:0});null!==E&&(s=s.compose(new S.I({zoneId:t}).retain(E).retain(1,b)))}if(h=+h+1,f=e[++a],a===e.length)return e[a]}else if(d<i)break;else f=l(e,i+1,u);p=a<e.length?J(o,t,e[a]):""}return f};l(e,1,i),r.editor.getContentState().apply(s)},r.getOlIdForNewList=function(t){var e=r.editor,n=(t||e.selection.getSelection()).end,i=n.line+1,o=e.getContentState().getZoneState(n.zoneId);if(!!o){var s=o.getLine(i).getLineAttributes().toMap().start;return"1"===s?s["ol-id"]:void 0}},r.getClosetListNumberId=function(t,e,n,i,o){if(-1!==e.indexOf(X)){var s,a,l,u=r.editor,c=n||u.selection.getSelection(),d=c.start,f=c.end,h=d.line,p=f.line,v=u.getContentState().getZoneState(d.zoneId);return v?h<1&&h===p&&0===t?"":i?l=v.getLine(h).getLineAttributes().toMap()["ol-id"]:l=o&&o.editOneAfterOlList?r.getOlIdForNewList(n):(l=h>1?null===(s=v.getLine(h-1))||void 0===s?void 0:s.getLineAttributes().toMap()["ol-id"]:"")||(null===(a=v.getLine(h+1))||void 0===a?void 0:a.getLineAttributes().toMap()["ol-id"])||"":void 0}},r.editor=n.editor,r.registerCommand(),r.editor.on(f.r.DID_PASTE,r.handleDidPaste),r.editor.on(f.r.WILL_DELETE_FROM_CUT,r.handleWillDeleteFromCut),r.editor.on(f.r.CONTENT_CHANGE,r.handleContentChange),r.editor.on(f.r.COMPOSITION_END,r.handleCompositionEnd),r.editor.on("keydown",r.handleKeydown),r.editor.on(f.r.DELETE_KEY,r.handleDeleteKey,890),r.needRenumberList=n.needRenumberList||!0,r}(0,l.d)(e,t);var n=e.prototype;return n.destroy=function(){this.editor.off(f.r.DID_PASTE,this.handleDidPaste),this.editor.off(f.r.WILL_DELETE_FROM_CUT,this.handleWillDeleteFromCut),this.editor.off(f.r.CONTENT_CHANGE,this.handleContentChange),this.editor.off(f.r.COMPOSITION_END,this.handleCompositionEnd),this.editor.off("keydown",this.handleKeydown),this.editor.off(f.r.DELETE_KEY,this.handleDeleteKey),this.editor=null},n.indexOfListLineInRange=function(){for(var t,e,n=this.editor,r=n.selection.getSelection(),i=r.start,o=r.end,s=i.line;s<=o.line;s++){var a=n.getContentState().getLineAttributes(i.zoneId,s).toMap();if((null===(t=a.list)||void 0===t?void 0:t.indexOf(X))>-1||(null===(e=a.list)||void 0===e?void 0:e.indexOf(H))>-1)return s}return -1},n.getListWrapInfo=function(t,e){var n=e.level,r=e.style,i=e.start,o=Array.from({length:n},function(){var e={tag:t,attributes:{}};return r&&(e.style=(0,l.g)({},r)),e});return i&&o[n-1]&&(o[n-1].attributes.start=String(i)),o},n.serialize=function(t){var n,r,i=t.zoneId,o=t.type,s=t.node,u=t.lineAttributes,d=t.lineDelta,f=u&&u.list||"",y=tl(f),m=function(t){return t.split("bullet")[1]}(f),b=function(t){return t.split("indent")[1]}(f),E=-1;if(o===h.T.LINE&&f&&(y||m||/check|done/.test(f)||b)){var S=!1,I=document.createElement(b?"div":"li");I.classList.add("temp-li"),I.setAttribute(p.mX,"true"),I.style.lineHeight="1.6",I.style.marginTop="0px",I.style.marginBottom="0px",I.style.paddingLeft="0px",!b&&(I.style.display="list-item"),y?(I.style.listStyleType=tu[(+y-1)%tu.length],E=a.ORDER):m?(I.style.listStyleType=tc[(+m-1)%tc.length],E=a.BULLET):b&&(E=a.INDENT),u&&(u.list&&(I.dataset.list=u.list,I.classList.add(u.list)),u["ol-id"]&&(I.dataset.olId=u["ol-id"],S=(0,l.a)(function(t){return t.split(":")}(this.serializeOlID),1)[0]!==u["ol-id"],this.serializeOlID=function(t,e){return t+":"+e}(u["ol-id"],y)),u.start&&y&&!b&&(I.dataset.start=tp(Number(u.start),Number(y))),this.prevListType!==E&&(S=!0),this.prevListType=E);var C={};if(d){var L=new v.V(d,new g.i(i,d,this.editor.getContentState().schema));C=this.getLiStyleFromLineState(L)}try{for(var w=(0,l.c)(Object.entries(C)),x=w.next();!x.done;x=w.next()){var _=(0,l.a)(x.value,2),T=_[0],A=_[1];if(I.style[T]=A,"fontSize"===T){var M=String(A).replace(/\s/g,"");I.classList.add("font-size-"+M)}}}catch(t){n={error:t}}finally{try{x&&!x.done&&(r=w.return)&&r.call(w)}finally{if(n)throw n.error}}I.appendChild(s);var k=function(t){if(t instanceof HTMLElement){var e=t.dataset.list||"",n=/(number|bullet|check|done|indent)(\d+)/;if(n.test(e)){var r=n.exec(e),i=r[1],o=Number(r[2]);return"number"===i?{type:"ol",level:o}:"indent"===i?{type:"div",level:o}:{type:"ul",level:o}}}throw Error("unkonw list node")}(I),N=k.type,R=k.level,O={margin:"0px 0px 0px 24px",paddingLeft:"0px"};b&&(O.marginLeft="24px"),!b&&(O.listStylePosition="inside");var D=this.getListWrapInfo(N,{level:R,start:Number(null==u?void 0:u.start)||1,style:O});return D.length>0&&(!b&&Object.assign(D[0].style,{margin:"0px"}),Object.assign(D[D.length-1],{split:S})),(0,c.i)(Object.assign(t,{node:I}),{wrapNodesInfo:D,tagAttribute:e.KEY})}return t},n.assignListId=function(t,e,n){var r=this;void 0===n&&(n=!1),(n?z()(t.get().reverse()):t).each(function(t,n){return r.addListId(n,0===t?e:j())})},n.getLevelAndOrderFromOl=function(t){var e=/list-number([0-9]+)/.exec(t.className),n=z()(t).attr("start");return{level:e?parseInt(e[1],10):1,order:n?parseInt(n,10):1}},n.getLiStyleFromLineState=function(t){var n,r,i,o,s,a,u={};if(t.isTextEmpty()){var c=t.getZoneId(),d=t.getOffset().start+t.getLineMarker(),f=this.editor.getContentState().getInlineStyleOverride({zoneId:c,start:d});if(f)try{for(var h=(0,l.c)(Object.entries(f)),p=h.next();!p.done;p=h.next()){var v=(0,l.a)(p.value,2),g=v[0],y=v[1];if(g in e.PREFIX_STYLE_INHERIT){var m=(0,l.a)(e.PREFIX_STYLE_INHERIT[g],2),b=m[0],E=m[1];u[b]=E||y}}}catch(t){n={error:t}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}return u}try{for(var S=(0,l.c)(Object.entries(e.PREFIX_STYLE_INHERIT)),I=S.next();!I.done;I=S.next()){var C=(0,l.a)(I.value,2),L=C[0],w=C[1],x=t.getEntities([[L,void 0]]);if(!!x.length){var _=!0,T=void 0,A=t.length()-(t.getModelText().endsWith("\n")?1:0);try{for(var M=(s=void 0,(0,l.c)(x.entries())),k=M.next();!k.done;k=M.next()){var N=(0,l.a)(k.value,2),R=N[0],O=N[1],D="lmkr"in O.attributes?0:t.getLineMarker(),z=O.end.offset-(O.text.endsWith("\n")?1:0);if(0===R&&O.start.offset!==D||R===x.length-1&&z!==A||T&&T.end.offset!==O.start.offset){_=!1;break}T=O}}catch(t){s={error:t}}finally{try{k&&!k.done&&(a=M.return)&&a.call(M)}finally{if(s)throw s.error}}_&&(u[w[0]]=w[1]||x[0].attributes[L])}}}catch(t){i={error:t}}finally{try{I&&!I.done&&(o=S.return)&&o.call(S)}finally{if(i)throw i.error}}return u},n.shouldForceRenderLine=function(t){var e=t.lineState.getLineAttributes().toMap();if(!e.list)return!1;var n=tt(e.list);return!![X,H,"check","done","indent"].includes((null==n?void 0:n[1])||"")||!1},n.editorAfterDoDeleteKey=function(t){var e=this.editor.getContentState().getActiveZone().getZoneId();this.mergeListIfNecessary(e,t.theLine),this.handleDeleteListLine(t.theLine)},n.editorAfterDoReturnKey=function(t){this.handleDeleteListLine(t.theLine)},n.handleDeleteListLine=function(t){var e=this.editor;if(!!e){var n=this.renumberList,r=e.selection.getSelection().start;this.willRenumberArr.forEach(function(e){"number"==typeof e&&null===n(r.zoneId,t+1)?n(r.zoneId,t):n(r.zoneId,t,e,!1)}),this.willRenumberArr=[]}},n.editorKeyDown=function(t){var e=t.evt,n=e.keyCode,r=this.editor.selection.getSelection(),i=r.start,o=i.line,s=i.zoneId;!e.shiftKey&&n===x.VD.Tab&&!("0"===s&&0===o)&&this.mergeToParentListIfNecessary(r)},n.bulkInsertOList=function(t,e,n,r){var i,o,a=this.editor;if(!!a&&0!==e.length){var l=this.editor.getContentState();e.sort(function(t,e){return t-e});var u=e[0],c=e[e.length-1],d=j();if(l.setLineAttributes(t,u,{"origin-start":""+(r||1)}),this.setMultiLinesListType(t,e,n,d),1===r){var f=ti(a,s.UP,u);if(f)this.mergeList(t,f.lineNum,u);else{var h=to(a,u,c),p=h.upwardClosestOListInfo,v=h.downwardClosestOListInfo;p&&v&&this.mergeList(t,u,v.lineNum)}(null===(o=null===(i=l.getZoneState(t))||void 0===i?void 0:i.getLine(c+1))||void 0===o?void 0:o.getLineAttributes().toMap()["ol-id"])&&this.mergeList(t,c+1,c)}else this.mergeListIfNecessary(t,u,c)}},n.mergeList=function(t,e,n){var r=this,i=this.editor;if(!i)return Promise.resolve(null);var o=i.selection.getSelection(),a=i.getContentState();if(!Q(i,o,e)||!Q(i,o,n))return Promise.resolve(null);var u=tn(i,t,e),c=tn(i,t,n);if(u&&c&&u.listId!==c.listId){var d=u.listId,f=(0,l.f)([n],ta(i,o,n,c.listId,s.UP),ta(i,o,n,c.listId,s.DOWN)).sort(function(t,e){return t-e});return new Promise(function(i){if(!r.editor)return i(null);var l={type:"mergeList"};r.setAttributeOnMultiLines(t,f,{"ol-id":d},l),f[0]>e?a.setLineAttributes(t,f[0],{"origin-start":""},l):(a.setLineAttributes(t,e,{"origin-start":""},l),!function(t,e,n){return!!Q(t,e,n)&&0===ta(t,e,n,tn(t,e.start.zoneId,n).listId,s.UP).length}(r.editor,o,f[0])&&a.setLineAttributes(t,f[0],{"origin-start":""},l)),r.renumberList(t,n),i(d)})}return Promise.resolve(null)},n.mergeListIfNecessary=function(t,e,n){return(0,l._)(this,void 0,void 0,function(){var r,i,o,a,u,c,d,f,h,p,v,g,y,m;return(0,l.b)(this,function(l){switch(l.label){case 0:if(!(r=this.editor))return[2];if(i=r.selection.getSelection(),o=n||e,!Q(r,i,e)||!Q(r,i,o))return[2];if(a=ts(r,e).listId,u=ts(r,e-1),c=ts(r,o+1),d=ti(r,s.UP,e),f=ti(r,s.DOWN,o),h=u||d,p=c||f,v=!1,!(h&&h.listId!==a))return[3,2];return[4,this.mergeList(t,h.lineNum,e)];case 1:a=l.sent()||a,v=!0,l.label=2;case 2:if(!(p&&p.listId!==a))return[3,4];return[4,this.mergeList(t,p.lineNum,o)];case 3:a=l.sent()||a,v=!0,l.label=4;case 4:if(v)return[2,Promise.resolve()];if(y=(g=to(r,e,o)).upwardClosestOListInfo,m=g.downwardClosestOListInfo,!(y&&m))return[3,7];return[4,this.mergeList(t,y.lineNum,e)];case 5:return l.sent(),[4,this.mergeList(t,m.lineNum,o)];case 6:l.sent(),l.label=7;case 7:return[2]}})})},n.mergeToParentListIfNecessary=function(t){for(var e=this,n=t.start,r=t.end,i=n.zoneId,o={},a=n.line;a<=r.line;a++){var u=tn(this.editor,i,a);if(!(!u||void 0===u.listId||o[u.listId]||1>=$(u.listType)))o[u.listId]=a}Object.entries(o).forEach(function(t){var n=(0,l.a)(t,2),r=(n[0],n[1]),o=J(e.editor,i,r),a=tr(e.editor,r,s.UP,$(o),!0,!0);a&&e.mergeList(i,a.lineNum,r)})},n.handleEditorWillDoDeleteKey=function(){var t=this.editor,e=t.getContentState(),n=e.getActiveZone(),r=n.getZoneId(),i=t.selection.getSelection(),o=i.start,s=n.getLine(o.line),a=s.getLineAttributes().toMap(),l=a["ol-id"];if(!a.list)return;var u=i.toPosition(),c=u.start,d=u.len,f=Number(s.hasLineMarker()),h=tt(a.list);if(!d&&o.offset-f==0&&!!h){var p=new S.I({zoneId:r}),v=h[1],g=Number(h[2]);v===X?(a["origin-start"]="",a.start="",a["ol-id"]="",a.list="indent"+g,p.retain(c-1).retain(1,a)):"code"===v?p.retain(c-2).delete(2):(a.list="",p.retain(c-1).retain(1,a)),e.apply(p),this.willRenumberArr=[l]}},n.editorWillDoReturnKey=function(t){var e=t.evt,n=t.delta,r=t.editor,i=r.getContentState(),o=i.getActiveZone(),s=o.getZoneId(),a=r.selection.getSelection(),u=a.start.line,c=o.getLine(u),d=c.getLineAttributes().toMap(),f=a.toPosition(),h=f.start,p=f.len;if(!d.list||p)return;var v=tt(d.list);if(!!v){var g=v[1],y=Number(v[2]),m=c.isTextEmpty(),b=1===a.start.offset,E=e.shiftKey,I=new S.I({zoneId:s});if([X,H,"check","done","indent"].includes(g)){if(m)1===y?["list","start","origin-start","ol-id"].forEach(function(t){d[t]=""}):d.list=g+(y-1),I.retain(h-1).retain(1,d);else{E&&(d.list="indent"+y,["start","origin-start","ol-id"].forEach(function(t){d[t]=""}));var C=this.findLastListLine(o,u);if("indent"===g&&!E&&C){var L=C.type,w=C.start,x=C.olId;L[1]===X&&(d.list=L[0],d.start=String(w+1),d["ol-id"]=x),d.list=L[1]+L[2]}I.retain(h).insertEnter().insertLineMarker(d),"done"===g&&(I=b?I.compose(new S.I({zoneId:s}).retain(Math.max(h-1,0)).retain(1,(0,l.g)((0,l.g)({},d),{list:"check"+y}))):I.compose(new S.I({zoneId:s}).retain(h+1).retain(1,(0,l.g)((0,l.g)({},d),{list:"check"+y}))))}}var _=c.previousSibling();if("code"===g&&_){if(0===u)I.retain(h).insertEnter().insertLineMarker(d);else{var T=o.getLineIndexOfKey(_.getKey()),A=_.isEmpty(),M=i.rangeToPosition({start:{line:T,offset:0,zoneId:s},end:{line:T,offset:0,zoneId:s}});if(null===M)return;var k=M.start,N=_.getLineAttributes().toMap(),R="code1"===N.list;if(m&&A&&R){["list","start","insertorder","lang"].forEach(function(t){N[t]="",d[t]=""});var O=new S.I({zoneId:s}).retain(k).retain(1,N);I=I.retain(h-1).retain(1,d).compose(O)}else I.retain(h).insertEnter().insertLineMarker(d)}}t.delta=n.compose(I),this.willRenumberArr=this.deleteNumberList(a)}},n.findLastListLine=function(t,e){for(var n=e,r="";n-1>=0;){var i=t.getLine(n-1).getLineAttributes().toMap();if(!(r=i.list))break;if((r=tt(r))[1]===H||r[1]===X||"check"===r[1]||"done"===r[1])return{line:--n,type:"done"===r[1]?{0:"check"+r[2],1:"check",2:r[2]}:r,start:r[1]===X?parseInt(i.start,10)||1:null,olId:i["ol-id"]};n--}return null},n.setMultiLinesListType=function(t,e,n,r){var i,o=this,s=n[e[0]];if(!e.length||!this.editor)return;var a=this.editor.getContentState().getZoneState(t);if(!!a){var l=this.editor.selection.getSelection(),u=new Map;e.forEach(function(t){var e=a.getLine(t).getLineAttributes().toMap()["ol-id"];!u.has(e)&&e&&u.set(e,!0)}),""===s||/indent/.test(s)?(this.setListAttributeOnMultiLines(t,e,n),this.setAttributeOnMultiLines(t,e,{start:"","origin-start":"",lang:"","ol-id":""})):(e=e.filter(function(e){return td(o.editor,t,e,[["horizontal-line","true"],["sheet-id",""],["aceTable",""]])}),s.indexOf(X)>-1?(i=r||this.getClosetListNumberId(t,s,l)||j(),this.setAttributeOnMultiLines(t,e,{"ol-id":i})):this.setAttributeOnMultiLines(t,e,{"ol-id":""}),this.setListAttributeOnMultiLines(t,e,n)),u.forEach(function(n,r){o.renumberList(t,e[0],r)}),this.renumberList(t,e[0],i)}},n.setAttributeOnMultiLines=function(t,e,n,r){if(void 0===n&&(n={}),void 0===r&&(r={type:"setLineAttributes"}),!!Array.isArray(e)&&!!e.length){var i=this.editor.getContentState();e.forEach(function(e){i.setLineAttributes(t,e,n,r)})}},e.KEY="list",e.PREFIX_STYLE_INHERIT={bold:["fontWeight","bold"],italic:["fontStyle","italic"],fontsize:["fontSize"],fontcolor:["fontColor"],fontfamily:["fontFamily"]},(0,l.e)([(0,y.gv)(1001)],e.prototype,"serialize",null),e}(m.S),G=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,l.d)(e,t),e}(Y);function J(t,e,n){return function(t,e,n,r){var i,o=null===(i=t.getContentState().getZoneState(e))||void 0===i?void 0:i.getLine(n);return o&&o.getLineAttributes().toMap()[r]||""}(t,e,n,"list")}o=Y,(0,l.d)(function(){return null!==o&&o.apply(this,arguments)||this},o);function Q(t,e,n){var r=tn(t,e.start.zoneId,n);return!!(r&&k.exec(r.listType))}function $(t){var e=k.exec(t);return e?parseInt(e[2],10):null}function tt(t){var e=N.exec(t);return e?e:t.startsWith("number")?N.exec("number1"):t.startsWith("bullet")?N.exec("bullet1"):e}function te(t,e,n,r){void 0===r&&(r="number1");var i=function(t,e,n){var r,i,o=e.start.zoneId,s=null===(i=null===(r=t.getContentState().getZoneState(o))||void 0===r?void 0:r.getLine(n))||void 0===i?void 0:i.getLineAttributes().toMap()["text-indent"];if(!s)return!1;var a=N.exec(J(t,o,n)),l=0;return a&&(l=Number(a[2])),s&&(l+=2),l}(t,e,n);return i?"number"+i:r}function tn(t,e,n){var r,i=null===(r=t.getContentState().getZoneState(e))||void 0===r?void 0:r.getLine(n);if(!i)return null;var o=i.getLineAttributes(),s=o.reduce(function(t,e){var n=(0,l.a)(e,2),r=n[0],i=n[1];return r===G.KEY?t.listType=i:"ol-id"===r&&(t.listId=i),t},{});return s.listType?s:null}function tr(t,e,n,r,i,o){void 0===o&&(o=!1);var a,l,u=t.getContentState().getActiveZone(),c=u.getZoneId(),d=u.length(),f=((a={})[s.UP]=-1,a[s.DOWN]=1,a);for(e+=f[n];e>=0&&e<d;e+=f[n]){var h=tn(t,c,e);if(o&&!h)break;var p=h||{},v=p.listId,g=void 0===v?"":v,y=p.listType,m=$(void 0===y?"":y);if(!!m){if((l=l||g)&&g!==l||r&&!i&&m<r)break;if(void 0===r||i&&m<r||!i&&m===r)return{zoneId:c,listId:g,lineNum:e,order:parseInt(u.getLine(e).getLineAttributes().toMap().start,10),level:m}}}return null}function ti(t,e,n,r,i){var o,a=r&&i?{level:r,order:i}:ts(t,n);if(!a)return null;var l=a.level,u=a.order;if(l>1&&e===s.UP){var c=tr(t,n,e,l,!0);if(c||1===u)return c}var d=tr(t,n,e,l);if(!d)return null;var f=((o={})[s.UP]=-1,o[s.DOWN]=1,o);return d.order===u+f[e]?d:null}function to(t,e,n){var r=n||e,i=tr(t,e,s.UP),o=tr(t,r,s.DOWN);return i&&o&&i.listId===o.listId?{upwardClosestOListInfo:i,downwardClosestOListInfo:o}:{}}function ts(t,e,n){var r=t.getContentState(),i=null!=n?n:r.getActiveZone().getZoneId(),o=r.getZoneState(i);if(!o)return null;var s=tn(t,i,e)||{},a=s.listId,l=s.listType,u=k.exec(void 0===l?"":l);return u?{zoneId:i,listId:void 0===a?"":a,lineNum:e,order:parseInt(o.getLine(e).getLineAttributes().toMap().start,10),level:parseInt(u[2],10)}:null}function ta(t,e,n,r,i){var o,a=e.start,l=t.getContentState().getZoneState(a.zoneId),u=[];if(!l)return u;var c=/(number)([0-9]+)/,d=l.length(),f=((o={})[s.UP]=-1,o[s.DOWN]=1,o);for(n+=f[i];n>=0&&n<=d;n+=f[i]){var h=tn(t,a.zoneId,n)||{},p=h.listType,v=void 0===p?"":p,g=h.listId,y=void 0===g?"":g;if(c.exec(v)){if(y!==r)break;u.push(n)}}return u}function tl(t){return t.split("number")[1]}var tu=["decimal","lower-alpha","lower-roman"],tc=["disc","circle","square"],td=function(t,e,n,r,i){void 0===r&&(r=[]),void 0===i&&(i=!1);var o=t.getContentState().getZoneState(e).getLine(n).getAttributes(),s=i?C.Z:function(t,e){return t[0]===e[0]};return(0,L.Z)(r,o,s).length<=0};function tf(t,e,n){var r=t.get(e);if(r instanceof S.I){var i=r.ops[0],o=new S.I({zoneId:e});"*"===i.insert&&i.attributes&&i.attributes.lmkr?o.retain(1,(0,l.g)((0,l.g)({},i.attributes),n)):o.insertLineMarker(n),t.replace(e,r.compose(o))}}function th(t){return t&&(t.tagName||"").toLowerCase()}function tp(t,e){var n=""+t;switch(e%3){case 0:n=V(t);break;case 2:n=B(t)}return n}},708180:function(t,e,n){"use strict";var r,i;n.d(e,{P:function(){return r}}),(i=r||(r={})).INDENT_LEFT="indentLeft",i.INDENT_RIGHT="indentRight"},101201:function(t,e,n){"use strict";n.d(e,{$:function(){return r}});var r=["author","lmkr","lineguid","insertorder"]},689057:function(t,e,n){"use strict";n.d(e,{VD:function(){return r},qT:function(){return s}}),n(399884);var r,i,o=n(390485);function s(t){return o.Z.isMac||o.Z.isSafari?t.metaKey&&!t.altKey:t.ctrlKey&&!t.altKey}n(707574),(i=r||(r={}))[i.BackSpace=8]="BackSpace",i[i.Tab=9]="Tab",i[i.Clear=12]="Clear",i[i.Enter=13]="Enter",i[i.Shift=16]="Shift",i[i.Ctrl=17]="Ctrl",i[i.Alt=18]="Alt",i[i.Esc=27]="Esc",i[i.Space=32]="Space",i[i.PageUp=33]="PageUp",i[i.PageDown=34]="PageDown",i[i.End=35]="End",i[i.Home=36]="Home",i[i.Left=37]="Left",i[i.Up=38]="Up",i[i.Right=39]="Right",i[i.Down=40]="Down",i[i.Delete=46]="Delete",i[i.Digit0=48]="Digit0",i[i.Digit9=57]="Digit9",i[i.A=65]="A",i[i.B=66]="B",i[i.C=67]="C",i[i.D=68]="D",i[i.E=69]="E",i[i.F=70]="F",i[i.G=71]="G",i[i.H=72]="H",i[i.I=73]="I",i[i.J=74]="J",i[i.K=75]="K",i[i.L=76]="L",i[i.M=77]="M",i[i.N=78]="N",i[i.O=79]="O",i[i.P=80]="P",i[i.Q=81]="Q",i[i.R=82]="R",i[i.S=83]="S",i[i.T=84]="T",i[i.U=85]="U",i[i.V=86]="V",i[i.W=87]="W",i[i.X=88]="X",i[i.Y=89]="Y",i[i.Z=90]="Z",i[i.Meta=91]="Meta",i[i.RightMeta=92]="RightMeta",i[i.Caret=94]="Caret",i[i.Numpad0=96]="Numpad0",i[i.Numpad9=105]="Numpad9",i[i.NumpadDot=110]="NumpadDot",i[i.F6=117]="F6",i[i.F11=122]="F11",i[i.Semicolon=186]="Semicolon",i[i.Plus=187]="Plus",i[i.Minus=189]="Minus",i[i.Dot=190]="Dot",i[i.Grave=192]="Grave",i[i.Bracket=219]="Bracket",i[i.Quot=222]="Quot",i[i.Asterisk=106]="Asterisk",i[i.Slash=111]="Slash",i[i["/"]=191]="/",i[i["\\"]=220]="\\",i[i.Ime=229]="Ime",r.Up,r.Down,r.Left,r.Right,r.C,r.V,r.X},754209:function(t,e,n){"use strict";n.d(e,{B:function(){return i}});var r=n(144847),i=function(t,e,n,i){void 0===n&&(n=""),void 0===i&&(i=!1);var o,s,a,l,u=t.selection.getSelection(),c=u.start,d=u.end,f=Math.min(c.line,d.line),h=Math.max(c.line,d.line);if(i){for(var p="",v=f;v<=h;v++)t.getContentState().getLineAttributes(c.zoneId,v).toMap()[e]!==n&&(p=n);for(var v=f;v<=h;v++)t.getContentState().setLineAttributes(c.zoneId,v,((o={})[e]=p,o))}else{var p="",g=t.getContentState().getEntities({start:c,end:d});try{for(var y=(0,r.c)(g),m=y.next();!m.done;m=y.next())m.value.attributes[e]!==n&&(p=n)}catch(t){s={error:t}}finally{try{m&&!m.done&&(a=y.return)&&a.call(y)}finally{if(s)throw s.error}}t.getContentState().setAttributes({start:c,end:d},((l={})[e]=p,l))}}},532439:function(t,e,n){"use strict";n.d(e,{L:function(){return i}});var r=n(455393);function i(t){var e,n,i=[];try{for(var o=(0,r._)(Object.entries(t)),s=o.next();!s.done;s=o.next()){var a=(0,r.a)(s.value,2),l=a[0],u=a[1];i.push([l,u])}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return i}},457341:function(t,e,n){"use strict";function r(t,e,n){var r=null==n?void 0:n.value;return{configurable:!0,get:function(){if(this===t.prototype||this.hasOwnProperty(e)||"function"!=typeof r)return r;var n=r.bind(this);return Object.defineProperty(this,e,{value:n,configurable:!0,writable:!0}),n}}}n.d(e,{W:function(){return r}})},931173:function(t,e,n){"use strict";var r,i;function o(t){return function(e){return function(n,r,i){var o=i.value;i.value=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{return o.apply(this,n)}catch(n){t&&t.call(this,{e:n,level:e,message:n.message})}}}}}n.d(e,{K:function(){return o},W:function(){return r}}),(i=r||(r={}))[i.FATAL=0]="FATAL",i[i.ERROR=1]="ERROR"},261359:function(t,e,n){"use strict";n.d(e,{S:function(){return r}});var r="0"},333475:function(t,e,n){"use strict";function r(t,e,n){var r,i,o,s,a,l,u=0,c=!1,d=!1,f=!0,h=!e&&0!==e&&"function"==typeof window.requestAnimationFrame;if("function"!=typeof t)throw TypeError("Expected a function");function p(e){var n=r,o=i;return r=i=void 0,u=e,s=t.apply(o,n)}function v(t,e){return h?(window.cancelAnimationFrame(a),window.requestAnimationFrame(t)):setTimeout(t,e)}e=+e||0,"object"==typeof n&&(c=!!n.leading,o=(d="maxWait"in n)?Math.max(+n.maxWait||0,e):o,f="trailing"in n?!!n.trailing:f);function g(t){var n=t-l,r=t-u;return void 0===l||n>=e||n<0||d&&r>=o}function y(){var t,n,r,i,s=Date.now();if(g(s))return m(s);a=v(y,(n=(t=s)-l,r=t-u,i=e-n,d?Math.min(i,o-r):i))}function m(t){return(a=void 0,f&&r)?p(t):(r=i=void 0,s)}function b(){for(var t,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var f=Date.now(),h=g(f);if(r=n,i=this,l=f,h){if(void 0===a){;return u=t=l,a=v(y,e),c?p(t):s}if(d)return a=v(y,e),p(l)}return void 0===a&&(a=v(y,e)),s}return b.cancel=function(){void 0!==a&&!function(t){if(h)return window.cancelAnimationFrame(t);clearTimeout(t)}(a),u=0,r=l=i=a=void 0},b.flush=function(){return void 0===a?s:m(Date.now())},b.pending=function(){return void 0!==a},b}n.d(e,{D:function(){return r}})},253966:function(t,e,n){"use strict";n.d(e,{Y:function(){return l}});var r=n("455393"),i=n("61414"),o=n("692912"),s=Symbol.isConcatSpreadable;function a(t){var e;return Array.isArray(t)||(e=t,(0,o.y)(e)&&"[object Arguments]"===(0,i.h)(e))||!!(t&&t[s])}function l(t,e){return(null==t?0:t.length)?function t(e,n,i,o,s){var l,u;if(void 0===i&&(i=a),void 0===o&&(o=!1),void 0===s&&(s=[]),null==e)return s;try{for(var c=(0,r._)(e),d=c.next();!d.done;d=c.next()){var f=d.value;n>0&&i(f)?n>1?t(f,n-1,i,o,s):s.push.apply(s,(0,r.b)(f)):!o&&(s[s.length]=f)}}catch(t){l={error:t}}finally{try{d&&!d.done&&(u=c.return)&&u.call(c)}finally{if(l)throw l.error}}return s}(t,e=void 0===e?1:+e):[]}},454746:function(t,e,n){"use strict";n.d(e,{X:function(){return l}});var r=n(61414),i=n(692912),o=Symbol.prototype.valueOf;function s(t,e){return t===e||t!=t&&e!=e}function a(t){return null==t}function l(t,e){return function t(e,n,a,l){if(e===n)return!0;if(null==(u=e)||null==(c=n)||!(0,i.y)(e)&&!(0,i.y)(n)&&"function"!=typeof e)return s(e,n);var u,c,d=(0,r.h)(e),f=(0,r.h)(n);if(d!==f)return!1;var h=a.indexOf(e);if(h===l.indexOf(n)&&h>=0)return!0;if(a.push(e),l.push(n),("[object Array]"===d?e.length:Object.keys(e).length)!==("[object Array]"===f?n.length:Object.keys(n).length))return!1;if("[object Array]"===d){for(var p=0;p<e.length;p++)if(!t(e[p],n[p],a.slice(),l.slice()))return!1;return!0}if("[object Object]"===d){for(var v in e)if(e.hasOwnProperty(v)&&!1===t(e[v],n[v],a.slice(),l.slice()))return!1;return!0}if("[object Function]"===d)return e.toString()===n.toString();if(["[object Number]","[object Boolean]","[object Date]"].includes(d))return s(+e,+n);else if("[object String]"===d)return""+e==""+n;else if("[object Symbol]"===d&&o)return o.call(e)===o.call(n);return!1}(t,e,[],[])}},375518:function(t,e,n){"use strict";function r(t){if(["div","p","blockquote","li","h1","h2","h3","h4","h5","h6","ol","table","td","th","tr","ul","address","article","canvas","dd","dl","dt","fieldset","figcaption","figure","footer","form","header","iframe","main","nav","output","pre","section","video"].includes(t.nodeName.toLowerCase()))return!(t instanceof HTMLElement)||!(t.style.display&&"inline"===t.style.display);return!1}n.d(e,{P:function(){return r}})},692912:function(t,e,n){"use strict";function r(t){return"object"==typeof t&&null!==t}n.d(e,{y:function(){return r}})},269516:function(t,e,n){"use strict";function r(t){return t.replace(/\r\n/g,"\n").replace(/\r/g,"\n")}n.d(e,{$:function(){return r}})},696519:function(t,e,n){"use strict";function r(t,e){return null===t?{}:Array.isArray(e)&&e.length?Object.keys(t).filter(function(t){return!e.includes(t)}).reduce(function(e,n){return e[n]=t[n],e},{}):t}n.d(e,{C:function(){return r}})},471917:function(t,e,n){"use strict";function r(t){return t?Object.keys(t).sort().reduce(function(e,n){return e[n]=t[n],e},{}):null}n.d(e,{y:function(){return r}})},683208:function(t,e,n){"use strict";function r(t){if(t.nodeType!==Node.ELEMENT_NODE||!(t instanceof HTMLElement))return"";try{return JSON.stringify(["className","tagName","dataset"].reduce(function(e,n){return e[n]=t[n],e},{}))}catch(t){return""}}n.d(e,{F:function(){return r}})},919421:function(t,e,n){"use strict";n.d(e,{P:function(){return i}});var r=n(333475);function i(t,e,n){var i=!0,o=!0;if("function"!=typeof t)throw TypeError("Expected a function");return"object"==typeof n&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),(0,r.D)(t,e,{leading:i,trailing:o,maxWait:e})}},455393:function(t,e,n){"use strict";function r(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function i(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function o(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(i(arguments[e]));return t}n.d(e,{_:function(){return r},a:function(){return i},b:function(){return o}})}}]); |