@wangeditor-next/core 1.7.3 → 1.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/src/config/interface.d.ts +1 -1
- package/dist/core/src/create/create-editor.d.ts +1 -1
- package/dist/core/src/editor/dom-editor.d.ts +5 -5
- package/dist/core/src/editor/interface.d.ts +1 -1
- package/dist/core/src/menus/bar/HoverBar.d.ts +1 -1
- package/dist/core/src/menus/bar/Toolbar.d.ts +1 -1
- package/dist/core/src/menus/bar-item/index.d.ts +1 -1
- package/dist/core/src/menus/interface.d.ts +1 -1
- package/dist/core/src/parse-html/index.d.ts +3 -3
- package/dist/core/src/render/index.d.ts +2 -2
- package/dist/core/src/to-html/index.d.ts +2 -2
- package/dist/core/src/upload/interface.d.ts +1 -1
- package/dist/core/src/utils/dom.d.ts +1 -1
- package/dist/core/src/utils/hotkeys.d.ts +3 -3
- package/dist/core/src/utils/ua.d.ts +1 -1
- package/dist/core/src/utils/vdom.d.ts +1 -1
- package/dist/css/style.css +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -4
- package/CHANGELOG.md +0 -814
- package/LICENSE +0 -21
package/dist/index.esm.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{Editor as e,Operation as t,Path as n,Node as r,Range as o,Element as i,Text as a,Transforms as s,Point as l,createEditor as u}from"slate";import c from"lodash.toarray";import f,{css as d,append as h,addClass as p,removeClass as g,hasClass as v,on as y,focus as m,attr as b,removeAttr as w,hide as x,show as S,offset as k,width as E,height as O,parent as C,parents as T,is as N,dataset as L,val as M,text as P,html as D,children as R,remove as j,find as A,each as I,empty as F}from"dom7";import B from"lodash.foreach";import"nanoid";import _ from"lodash.throttle";import{init as $,classModule as W,propsModule as V,styleModule as z,datasetModule as H,eventListenersModule as U,attributesModule as K,jsx as q,h as G}from"snabbdom";import J from"lodash.camelcase";import{isKeyHotkey as Y,isHotkey as X}from"is-hotkey";import Q from"lodash.debounce";import Z from"lodash.clonedeep";import ee from"@uppy/core";import te from"@uppy/xhr-upload";var ne="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function re(e){var t={exports:{}};return e(t,t.exports),t.exports}var oe,ie,ae=function(e){return e&&e.Math==Math&&e},se=ae("object"==typeof globalThis&&globalThis)||ae("object"==typeof window&&window)||ae("object"==typeof self&&self)||ae("object"==typeof ne&&ne)||function(){return this}()||Function("return this")(),le=function(e){try{return!!e()}catch(e){return!0}},ue=!le((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),ce=Function.prototype.call,fe=ce.bind?ce.bind(ce):function(){return ce.apply(ce,arguments)},de={}.propertyIsEnumerable,he=Object.getOwnPropertyDescriptor,pe=he&&!de.call({1:2},1)?function(e){var t=he(this,e);return!!t&&t.enumerable}:de,ge={f:pe},ve=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},ye=Function.prototype,me=ye.bind,be=ye.call,we=me&&me.bind(be),xe=me?function(e){return e&&we(be,e)}:function(e){return e&&function(){return be.apply(e,arguments)}},Se=xe({}.toString),ke=xe("".slice),Ee=function(e){return ke(Se(e),8,-1)},Oe=se.Object,Ce=xe("".split),Te=le((function(){return!Oe("z").propertyIsEnumerable(0)}))?function(e){return"String"==Ee(e)?Ce(e,""):Oe(e)}:Oe,Ne=se.TypeError,Le=function(e){if(null==e)throw Ne("Can't call method on "+e);return e},Me=function(e){return Te(Le(e))},Pe=function(e){return"function"==typeof e},De=function(e){return"object"==typeof e?null!==e:Pe(e)},Re=function(e,t){return arguments.length<2?(n=se[e],Pe(n)?n:void 0):se[e]&&se[e][t];var n},je=xe({}.isPrototypeOf),Ae=Re("navigator","userAgent")||"",Ie=se.process,Fe=se.Deno,Be=Ie&&Ie.versions||Fe&&Fe.version,_e=Be&&Be.v8;_e&&(ie=(oe=_e.split("."))[0]>0&&oe[0]<4?1:+(oe[0]+oe[1])),!ie&&Ae&&(!(oe=Ae.match(/Edge\/(\d+)/))||oe[1]>=74)&&(oe=Ae.match(/Chrome\/(\d+)/))&&(ie=+oe[1]);var $e=ie,We=!!Object.getOwnPropertySymbols&&!le((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&$e&&$e<41})),Ve=We&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ze=se.Object,He=Ve?function(e){return"symbol"==typeof e}:function(e){var t=Re("Symbol");return Pe(t)&&je(t.prototype,ze(e))},Ue=se.String,Ke=function(e){try{return Ue(e)}catch(e){return"Object"}},qe=se.TypeError,Ge=function(e){if(Pe(e))return e;throw qe(Ke(e)+" is not a function")},Je=function(e,t){var n=e[t];return null==n?void 0:Ge(n)},Ye=se.TypeError,Xe=Object.defineProperty,Qe=function(e,t){try{Xe(se,e,{value:t,configurable:!0,writable:!0})}catch(n){se[e]=t}return t},Ze="__core-js_shared__",et=se[Ze]||Qe(Ze,{}),tt=re((function(e){(e.exports=function(e,t){return et[e]||(et[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.19.3",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),nt=se.Object,rt=function(e){return nt(Le(e))},ot=xe({}.hasOwnProperty),it=Object.hasOwn||function(e,t){return ot(rt(e),t)},at=0,st=Math.random(),lt=xe(1..toString),ut=function(e){return"Symbol("+(void 0===e?"":e)+")_"+lt(++at+st,36)},ct=tt("wks"),ft=se.Symbol,dt=ft&&ft.for,ht=Ve?ft:ft&&ft.withoutSetter||ut,pt=function(e){if(!it(ct,e)||!We&&"string"!=typeof ct[e]){var t="Symbol."+e;We&&it(ft,e)?ct[e]=ft[e]:ct[e]=Ve&&dt?dt(t):ht(t)}return ct[e]},gt=se.TypeError,vt=pt("toPrimitive"),yt=function(e,t){if(!De(e)||He(e))return e;var n,r=Je(e,vt);if(r){if(void 0===t&&(t="default"),n=fe(r,e,t),!De(n)||He(n))return n;throw gt("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var n,r;if("string"===t&&Pe(n=e.toString)&&!De(r=fe(n,e)))return r;if(Pe(n=e.valueOf)&&!De(r=fe(n,e)))return r;if("string"!==t&&Pe(n=e.toString)&&!De(r=fe(n,e)))return r;throw Ye("Can't convert object to primitive value")}(e,t)},mt=function(e){var t=yt(e,"string");return He(t)?t:t+""},bt=se.document,wt=De(bt)&&De(bt.createElement),xt=function(e){return wt?bt.createElement(e):{}},St=!ue&&!le((function(){return 7!=Object.defineProperty(xt("div"),"a",{get:function(){return 7}}).a})),kt=Object.getOwnPropertyDescriptor,Et={f:ue?kt:function(e,t){if(e=Me(e),t=mt(t),St)try{return kt(e,t)}catch(e){}if(it(e,t))return ve(!fe(ge.f,e,t),e[t])}},Ot=se.String,Ct=se.TypeError,Tt=function(e){if(De(e))return e;throw Ct(Ot(e)+" is not an object")},Nt=se.TypeError,Lt=Object.defineProperty,Mt={f:ue?Lt:function(e,t,n){if(Tt(e),t=mt(t),Tt(n),St)try{return Lt(e,t,n)}catch(e){}if("get"in n||"set"in n)throw Nt("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},Pt=ue?function(e,t,n){return Mt.f(e,t,ve(1,n))}:function(e,t,n){return e[t]=n,e},Dt=xe(Function.toString);Pe(et.inspectSource)||(et.inspectSource=function(e){return Dt(e)});var Rt,jt,At,It=et.inspectSource,Ft=se.WeakMap,Bt=Pe(Ft)&&/native code/.test(It(Ft)),_t=tt("keys"),$t=function(e){return _t[e]||(_t[e]=ut(e))},Wt={},Vt="Object already initialized",zt=se.TypeError,Ht=se.WeakMap;if(Bt||et.state){var Ut=et.state||(et.state=new Ht),Kt=xe(Ut.get),qt=xe(Ut.has),Gt=xe(Ut.set);Rt=function(e,t){if(qt(Ut,e))throw new zt(Vt);return t.facade=e,Gt(Ut,e,t),t},jt=function(e){return Kt(Ut,e)||{}},At=function(e){return qt(Ut,e)}}else{var Jt=$t("state");Wt[Jt]=!0,Rt=function(e,t){if(it(e,Jt))throw new zt(Vt);return t.facade=e,Pt(e,Jt,t),t},jt=function(e){return it(e,Jt)?e[Jt]:{}},At=function(e){return it(e,Jt)}}var Yt={set:Rt,get:jt,has:At,enforce:function(e){return At(e)?jt(e):Rt(e,{})},getterFor:function(e){return function(t){var n;if(!De(t)||(n=jt(t)).type!==e)throw zt("Incompatible receiver, "+e+" required");return n}}},Xt=Function.prototype,Qt=ue&&Object.getOwnPropertyDescriptor,Zt=it(Xt,"name"),en={EXISTS:Zt,PROPER:Zt&&"something"===function(){}.name,CONFIGURABLE:Zt&&(!ue||ue&&Qt(Xt,"name").configurable)},tn=re((function(e){var t=en.CONFIGURABLE,n=Yt.get,r=Yt.enforce,o=String(String).split("String");(e.exports=function(e,n,i,a){var s,l=!!a&&!!a.unsafe,u=!!a&&!!a.enumerable,c=!!a&&!!a.noTargetGet,f=a&&void 0!==a.name?a.name:n;Pe(i)&&("Symbol("===String(f).slice(0,7)&&(f="["+String(f).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!it(i,"name")||t&&i.name!==f)&&Pt(i,"name",f),(s=r(i)).source||(s.source=o.join("string"==typeof f?f:""))),e!==se?(l?!c&&e[n]&&(u=!0):delete e[n],u?e[n]=i:Pt(e,n,i)):u?e[n]=i:Qe(n,i)})(Function.prototype,"toString",(function(){return Pe(this)&&n(this).source||It(this)}))})),nn=Math.ceil,rn=Math.floor,on=function(e){var t=+e;return t!=t||0===t?0:(t>0?rn:nn)(t)},an=Math.max,sn=Math.min,ln=function(e,t){var n=on(e);return n<0?an(n+t,0):sn(n,t)},un=Math.min,cn=function(e){return e>0?un(on(e),9007199254740991):0},fn=function(e){return cn(e.length)},dn=function(e){return function(t,n,r){var o,i=Me(t),a=fn(i),s=ln(r,a);if(e&&n!=n){for(;a>s;)if((o=i[s++])!=o)return!0}else for(;a>s;s++)if((e||s in i)&&i[s]===n)return e||s||0;return!e&&-1}},hn={includes:dn(!0),indexOf:dn(!1)},pn=hn.indexOf,gn=xe([].push),vn=function(e,t){var n,r=Me(e),o=0,i=[];for(n in r)!it(Wt,n)&&it(r,n)&&gn(i,n);for(;t.length>o;)it(r,n=t[o++])&&(~pn(i,n)||gn(i,n));return i},yn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],mn=yn.concat("length","prototype"),bn={f:Object.getOwnPropertyNames||function(e){return vn(e,mn)}},wn={f:Object.getOwnPropertySymbols},xn=xe([].concat),Sn=Re("Reflect","ownKeys")||function(e){var t=bn.f(Tt(e)),n=wn.f;return n?xn(t,n(e)):t},kn=function(e,t){for(var n=Sn(t),r=Mt.f,o=Et.f,i=0;i<n.length;i++){var a=n[i];it(e,a)||r(e,a,o(t,a))}},En=/#|\.prototype\./,On=function(e,t){var n=Tn[Cn(e)];return n==Ln||n!=Nn&&(Pe(t)?le(t):!!t)},Cn=On.normalize=function(e){return String(e).replace(En,".").toLowerCase()},Tn=On.data={},Nn=On.NATIVE="N",Ln=On.POLYFILL="P",Mn=On,Pn=Et.f,Dn=function(e,t){var n,r,o,i,a,s=e.target,l=e.global,u=e.stat;if(n=l?se:u?se[s]||Qe(s,{}):(se[s]||{}).prototype)for(r in t){if(i=t[r],o=e.noTargetGet?(a=Pn(n,r))&&a.value:n[r],!Mn(l?r:s+(u?".":"#")+r,e.forced)&&void 0!==o){if(typeof i==typeof o)continue;kn(i,o)}(e.sham||o&&o.sham)&&Pt(i,"sham",!0),tn(n,r,i,e)}},Rn=Object.keys||function(e){return vn(e,yn)},jn=le((function(){Rn(1)}));Dn({target:"Object",stat:!0,forced:jn},{keys:function(e){return Rn(rt(e))}});var An={};An[pt("toStringTag")]="z";var In="[object z]"===String(An),Fn=pt("toStringTag"),Bn=se.Object,_n="Arguments"==Ee(function(){return arguments}()),$n=In?Ee:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Bn(e),Fn))?n:_n?Ee(t):"Object"==(r=Ee(t))&&Pe(t.callee)?"Arguments":r},Wn=In?{}.toString:function(){return"[object "+$n(this)+"]"};In||tn(Object.prototype,"toString",Wn,{unsafe:!0});var Vn={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},zn=xt("span").classList,Hn=zn&&zn.constructor&&zn.constructor.prototype,Un=Hn===Object.prototype?void 0:Hn,Kn=xe(xe.bind),qn=function(e,t){return Ge(e),void 0===t?e:Kn?Kn(e,t):function(){return e.apply(t,arguments)}},Gn=Array.isArray||function(e){return"Array"==Ee(e)},Jn=function(){},Yn=[],Xn=Re("Reflect","construct"),Qn=/^\s*(?:class|function)\b/,Zn=xe(Qn.exec),er=!Qn.exec(Jn),tr=function(e){if(!Pe(e))return!1;try{return Xn(Jn,Yn,e),!0}catch(e){return!1}},nr=!Xn||le((function(){var e;return tr(tr.call)||!tr(Object)||!tr((function(){e=!0}))||e}))?function(e){if(!Pe(e))return!1;switch($n(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return er||!!Zn(Qn,It(e))}:tr,rr=pt("species"),or=se.Array,ir=function(e,t){return new(function(e){var t;return Gn(e)&&(t=e.constructor,(nr(t)&&(t===or||Gn(t.prototype))||De(t)&&null===(t=t[rr]))&&(t=void 0)),void 0===t?or:t}(e))(0===t?0:t)},ar=xe([].push),sr=function(e){var t=1==e,n=2==e,r=3==e,o=4==e,i=6==e,a=7==e,s=5==e||i;return function(l,u,c,f){for(var d,h,p=rt(l),g=Te(p),v=qn(u,c),y=fn(g),m=0,b=f||ir,w=t?b(l,y):n||a?b(l,0):void 0;y>m;m++)if((s||m in g)&&(h=v(d=g[m],m,p),e))if(t)w[m]=h;else if(h)switch(e){case 3:return!0;case 5:return d;case 6:return m;case 2:ar(w,d)}else switch(e){case 4:return!1;case 7:ar(w,d)}return i?-1:r||o?o:w}},lr={forEach:sr(0),map:sr(1),filter:sr(2),some:sr(3),every:sr(4),find:sr(5),findIndex:sr(6),filterReject:sr(7)},ur=function(e,t){var n=[][e];return!!n&&le((function(){n.call(null,t||function(){throw 1},1)}))},cr=lr.forEach,fr=ur("forEach")?[].forEach:function(e){return cr(this,e,arguments.length>1?arguments[1]:void 0)},dr=function(e){if(e&&e.forEach!==fr)try{Pt(e,"forEach",fr)}catch(t){e.forEach=fr}};for(var hr in Vn)Vn[hr]&&dr(se[hr]&&se[hr].prototype);
|
|
1
|
+
import{Transforms as e,Editor as t,Operation as n,Path as r,Node as o,Range as i,Element as a,Text as s,Point as c,createEditor as l}from"slate";import u from"lodash.toarray";import f,{css as d,append as h,addClass as p,removeClass as g,hasClass as v,on as y,focus as m,attr as b,removeAttr as w,hide as x,show as S,offset as E,width as O,height as k,parent as C,parents as T,is as N,dataset as L,val as M,text as P,html as D,children as R,remove as j,find as A,each as I,empty as F}from"dom7";import B from"lodash.foreach";import"nanoid";import _ from"lodash.throttle";import{init as $,classModule as W,propsModule as V,styleModule as z,datasetModule as H,eventListenersModule as U,attributesModule as K,jsx as q,h as G}from"snabbdom";import J from"lodash.camelcase";import{isKeyHotkey as Y,isHotkey as X}from"is-hotkey";import Q from"lodash.debounce";import Z from"lodash.clonedeep";import ee from"@uppy/core";import te from"@uppy/xhr-upload";var ne="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function re(e){var t={exports:{}};return e(t,t.exports),t.exports}var oe,ie,ae=function(e){return e&&e.Math===Math&&e},se=ae("object"==typeof globalThis&&globalThis)||ae("object"==typeof window&&window)||ae("object"==typeof self&&self)||ae("object"==typeof ne&&ne)||ae("object"==typeof ne&&ne)||function(){return this}()||Function("return this")(),ce=function(e){try{return!!e()}catch(e){return!0}},le=!ce((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})),ue=!ce((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),fe=Function.prototype.call,de=ue?fe.bind(fe):function(){return fe.apply(fe,arguments)},he={}.propertyIsEnumerable,pe=Object.getOwnPropertyDescriptor,ge=pe&&!he.call({1:2},1)?function(e){var t=pe(this,e);return!!t&&t.enumerable}:he,ve={f:ge},ye=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},me=Function.prototype,be=me.call,we=ue&&me.bind.bind(be,be),xe=ue?we:function(e){return function(){return be.apply(e,arguments)}},Se=xe({}.toString),Ee=xe("".slice),Oe=function(e){return Ee(Se(e),8,-1)},ke=Object,Ce=xe("".split),Te=ce((function(){return!ke("z").propertyIsEnumerable(0)}))?function(e){return"String"===Oe(e)?Ce(e,""):ke(e)}:ke,Ne=function(e){return null==e},Le=TypeError,Me=function(e){if(Ne(e))throw new Le("Can't call method on "+e);return e},Pe=function(e){return Te(Me(e))},De="object"==typeof document&&document.all,Re=void 0===De&&void 0!==De?function(e){return"function"==typeof e||e===De}:function(e){return"function"==typeof e},je=function(e){return"object"==typeof e?null!==e:Re(e)},Ae=function(e,t){return arguments.length<2?(n=se[e],Re(n)?n:void 0):se[e]&&se[e][t];var n},Ie=xe({}.isPrototypeOf),Fe=se.navigator,Be=Fe&&Fe.userAgent,_e=Be?String(Be):"",$e=se.process,We=se.Deno,Ve=$e&&$e.versions||We&&We.version,ze=Ve&&Ve.v8;ze&&(ie=(oe=ze.split("."))[0]>0&&oe[0]<4?1:+(oe[0]+oe[1])),!ie&&_e&&(!(oe=_e.match(/Edge\/(\d+)/))||oe[1]>=74)&&(oe=_e.match(/Chrome\/(\d+)/))&&(ie=+oe[1]);var He=ie,Ue=se.String,Ke=!!Object.getOwnPropertySymbols&&!ce((function(){var e=Symbol("symbol detection");return!Ue(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&He&&He<41})),qe=Ke&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ge=Object,Je=qe?function(e){return"symbol"==typeof e}:function(e){var t=Ae("Symbol");return Re(t)&&Ie(t.prototype,Ge(e))},Ye=String,Xe=function(e){try{return Ye(e)}catch(e){return"Object"}},Qe=TypeError,Ze=function(e){if(Re(e))return e;throw new Qe(Xe(e)+" is not a function")},et=function(e,t){var n=e[t];return Ne(n)?void 0:Ze(n)},tt=TypeError,nt=Object.defineProperty,rt=function(e,t){try{nt(se,e,{value:t,configurable:!0,writable:!0})}catch(n){se[e]=t}return t},ot=re((function(e){var t="__core-js_shared__",n=e.exports=se[t]||rt(t,{});(n.versions||(n.versions=[])).push({version:"3.38.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.1/LICENSE",source:"https://github.com/zloirock/core-js"})})),it=function(e,t){return ot[e]||(ot[e]=t||{})},at=Object,st=function(e){return at(Me(e))},ct=xe({}.hasOwnProperty),lt=Object.hasOwn||function(e,t){return ct(st(e),t)},ut=0,ft=Math.random(),dt=xe(1..toString),ht=function(e){return"Symbol("+(void 0===e?"":e)+")_"+dt(++ut+ft,36)},pt=se.Symbol,gt=it("wks"),vt=qe?pt.for||pt:pt&&pt.withoutSetter||ht,yt=function(e){return lt(gt,e)||(gt[e]=Ke&<(pt,e)?pt[e]:vt("Symbol."+e)),gt[e]},mt=TypeError,bt=yt("toPrimitive"),wt=function(e,t){if(!je(e)||Je(e))return e;var n,r=et(e,bt);if(r){if(void 0===t&&(t="default"),n=de(r,e,t),!je(n)||Je(n))return n;throw new mt("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var n,r;if("string"===t&&Re(n=e.toString)&&!je(r=de(n,e)))return r;if(Re(n=e.valueOf)&&!je(r=de(n,e)))return r;if("string"!==t&&Re(n=e.toString)&&!je(r=de(n,e)))return r;throw new tt("Can't convert object to primitive value")}(e,t)},xt=function(e){var t=wt(e,"string");return Je(t)?t:t+""},St=se.document,Et=je(St)&&je(St.createElement),Ot=function(e){return Et?St.createElement(e):{}},kt=!le&&!ce((function(){return 7!==Object.defineProperty(Ot("div"),"a",{get:function(){return 7}}).a})),Ct=Object.getOwnPropertyDescriptor,Tt={f:le?Ct:function(e,t){if(e=Pe(e),t=xt(t),kt)try{return Ct(e,t)}catch(e){}if(lt(e,t))return ye(!de(ve.f,e,t),e[t])}},Nt=le&&ce((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Lt=String,Mt=TypeError,Pt=function(e){if(je(e))return e;throw new Mt(Lt(e)+" is not an object")},Dt=TypeError,Rt=Object.defineProperty,jt=Object.getOwnPropertyDescriptor,At="enumerable",It="configurable",Ft="writable",Bt={f:le?Nt?function(e,t,n){if(Pt(e),t=xt(t),Pt(n),"function"==typeof e&&"prototype"===t&&"value"in n&&Ft in n&&!n[Ft]){var r=jt(e,t);r&&r[Ft]&&(e[t]=n.value,n={configurable:It in n?n[It]:r[It],enumerable:At in n?n[At]:r[At],writable:!1})}return Rt(e,t,n)}:Rt:function(e,t,n){if(Pt(e),t=xt(t),Pt(n),kt)try{return Rt(e,t,n)}catch(e){}if("get"in n||"set"in n)throw new Dt("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},_t=le?function(e,t,n){return Bt.f(e,t,ye(1,n))}:function(e,t,n){return e[t]=n,e},$t=Function.prototype,Wt=le&&Object.getOwnPropertyDescriptor,Vt=lt($t,"name"),zt={EXISTS:Vt,PROPER:Vt&&"something"===function(){}.name,CONFIGURABLE:Vt&&(!le||le&&Wt($t,"name").configurable)},Ht=xe(Function.toString);Re(ot.inspectSource)||(ot.inspectSource=function(e){return Ht(e)});var Ut,Kt,qt,Gt=ot.inspectSource,Jt=se.WeakMap,Yt=Re(Jt)&&/native code/.test(String(Jt)),Xt=it("keys"),Qt=function(e){return Xt[e]||(Xt[e]=ht(e))},Zt={},en="Object already initialized",tn=se.TypeError,nn=se.WeakMap;if(Yt||ot.state){var rn=ot.state||(ot.state=new nn);rn.get=rn.get,rn.has=rn.has,rn.set=rn.set,Ut=function(e,t){if(rn.has(e))throw new tn(en);return t.facade=e,rn.set(e,t),t},Kt=function(e){return rn.get(e)||{}},qt=function(e){return rn.has(e)}}else{var on=Qt("state");Zt[on]=!0,Ut=function(e,t){if(lt(e,on))throw new tn(en);return t.facade=e,_t(e,on,t),t},Kt=function(e){return lt(e,on)?e[on]:{}},qt=function(e){return lt(e,on)}}var an={set:Ut,get:Kt,has:qt,enforce:function(e){return qt(e)?Kt(e):Ut(e,{})},getterFor:function(e){return function(t){var n;if(!je(t)||(n=Kt(t)).type!==e)throw new tn("Incompatible receiver, "+e+" required");return n}}},sn=re((function(e){var t=zt.CONFIGURABLE,n=an.enforce,r=an.get,o=String,i=Object.defineProperty,a=xe("".slice),s=xe("".replace),c=xe([].join),l=le&&!ce((function(){return 8!==i((function(){}),"length",{value:8}).length})),u=String(String).split("String"),f=e.exports=function(e,r,f){"Symbol("===a(o(r),0,7)&&(r="["+s(o(r),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),f&&f.getter&&(r="get "+r),f&&f.setter&&(r="set "+r),(!lt(e,"name")||t&&e.name!==r)&&(le?i(e,"name",{value:r,configurable:!0}):e.name=r),l&&f&<(f,"arity")&&e.length!==f.arity&&i(e,"length",{value:f.arity});try{f&<(f,"constructor")&&f.constructor?le&&i(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var d=n(e);return lt(d,"source")||(d.source=c(u,"string"==typeof r?r:"")),e};Function.prototype.toString=f((function(){return Re(this)&&r(this).source||Gt(this)}),"toString")})),cn=function(e,t,n,r){r||(r={});var o=r.enumerable,i=void 0!==r.name?r.name:t;if(Re(n)&&sn(n,i,r),r.global)o?e[t]=n:rt(t,n);else{try{r.unsafe?e[t]&&(o=!0):delete e[t]}catch(e){}o?e[t]=n:Bt.f(e,t,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return e},ln=Math.ceil,un=Math.floor,fn=Math.trunc||function(e){var t=+e;return(t>0?un:ln)(t)},dn=function(e){var t=+e;return t!=t||0===t?0:fn(t)},hn=Math.max,pn=Math.min,gn=function(e,t){var n=dn(e);return n<0?hn(n+t,0):pn(n,t)},vn=Math.min,yn=function(e){var t=dn(e);return t>0?vn(t,9007199254740991):0},mn=function(e){return yn(e.length)},bn=function(e){return function(t,n,r){var o=Pe(t),i=mn(o);if(0===i)return!e&&-1;var a,s=gn(r,i);if(e&&n!=n){for(;i>s;)if((a=o[s++])!=a)return!0}else for(;i>s;s++)if((e||s in o)&&o[s]===n)return e||s||0;return!e&&-1}},wn={includes:bn(!0),indexOf:bn(!1)},xn=wn.indexOf,Sn=xe([].push),En=function(e,t){var n,r=Pe(e),o=0,i=[];for(n in r)!lt(Zt,n)&<(r,n)&&Sn(i,n);for(;t.length>o;)lt(r,n=t[o++])&&(~xn(i,n)||Sn(i,n));return i},On=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],kn=On.concat("length","prototype"),Cn={f:Object.getOwnPropertyNames||function(e){return En(e,kn)}},Tn={f:Object.getOwnPropertySymbols},Nn=xe([].concat),Ln=Ae("Reflect","ownKeys")||function(e){var t=Cn.f(Pt(e)),n=Tn.f;return n?Nn(t,n(e)):t},Mn=function(e,t,n){for(var r=Ln(t),o=Bt.f,i=Tt.f,a=0;a<r.length;a++){var s=r[a];lt(e,s)||n&<(n,s)||o(e,s,i(t,s))}},Pn=/#|\.prototype\./,Dn=function(e,t){var n=jn[Rn(e)];return n===In||n!==An&&(Re(t)?ce(t):!!t)},Rn=Dn.normalize=function(e){return String(e).replace(Pn,".").toLowerCase()},jn=Dn.data={},An=Dn.NATIVE="N",In=Dn.POLYFILL="P",Fn=Dn,Bn=Tt.f,_n=function(e,t){var n,r,o,i,a,s=e.target,c=e.global,l=e.stat;if(n=c?se:l?se[s]||rt(s,{}):se[s]&&se[s].prototype)for(r in t){if(i=t[r],o=e.dontCallGetSet?(a=Bn(n,r))&&a.value:n[r],!Fn(c?r:s+(l?".":"#")+r,e.forced)&&void 0!==o){if(typeof i==typeof o)continue;Mn(i,o)}(e.sham||o&&o.sham)&&_t(i,"sham",!0),cn(n,r,i,e)}},$n=Object.keys||function(e){return En(e,On)},Wn=ce((function(){$n(1)}));_n({target:"Object",stat:!0,forced:Wn},{keys:function(e){return $n(st(e))}});var Vn={};Vn[yt("toStringTag")]="z";var zn="[object z]"===String(Vn),Hn=yt("toStringTag"),Un=Object,Kn="Arguments"===Oe(function(){return arguments}()),qn=zn?Oe:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Un(e),Hn))?n:Kn?Oe(t):"Object"===(r=Oe(t))&&Re(t.callee)?"Arguments":r},Gn=zn?{}.toString:function(){return"[object "+qn(this)+"]"};zn||cn(Object.prototype,"toString",Gn,{unsafe:!0});var Jn={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Yn=Ot("span").classList,Xn=Yn&&Yn.constructor&&Yn.constructor.prototype,Qn=Xn===Object.prototype?void 0:Xn,Zn=function(e){if("Function"===Oe(e))return xe(e)},er=Zn(Zn.bind),tr=function(e,t){return Ze(e),void 0===t?e:ue?er(e,t):function(){return e.apply(t,arguments)}},nr=Array.isArray||function(e){return"Array"===Oe(e)},rr=function(){},or=Ae("Reflect","construct"),ir=/^\s*(?:class|function)\b/,ar=xe(ir.exec),sr=!ir.test(rr),cr=function(e){if(!Re(e))return!1;try{return or(rr,[],e),!0}catch(e){return!1}},lr=function(e){if(!Re(e))return!1;switch(qn(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return sr||!!ar(ir,Gt(e))}catch(e){return!0}};lr.sham=!0;var ur=!or||ce((function(){var e;return cr(cr.call)||!cr(Object)||!cr((function(){e=!0}))||e}))?lr:cr,fr=yt("species"),dr=Array,hr=function(e,t){return new(function(e){var t;return nr(e)&&(t=e.constructor,(ur(t)&&(t===dr||nr(t.prototype))||je(t)&&null===(t=t[fr]))&&(t=void 0)),void 0===t?dr:t}(e))(0===t?0:t)},pr=xe([].push),gr=function(e){var t=1===e,n=2===e,r=3===e,o=4===e,i=6===e,a=7===e,s=5===e||i;return function(c,l,u,f){for(var d,h,p=st(c),g=Te(p),v=mn(g),y=tr(l,u),m=0,b=f||hr,w=t?b(c,v):n||a?b(c,0):void 0;v>m;m++)if((s||m in g)&&(h=y(d=g[m],m,p),e))if(t)w[m]=h;else if(h)switch(e){case 3:return!0;case 5:return d;case 6:return m;case 2:pr(w,d)}else switch(e){case 4:return!1;case 7:pr(w,d)}return i?-1:r||o?o:w}},vr={forEach:gr(0),map:gr(1),filter:gr(2),some:gr(3),every:gr(4),find:gr(5),findIndex:gr(6),filterReject:gr(7)},yr=function(e,t){var n=[][e];return!!n&&ce((function(){n.call(null,t||function(){return 1},1)}))},mr=vr.forEach,br=yr("forEach")?[].forEach:function(e){return mr(this,e,arguments.length>1?arguments[1]:void 0)},wr=function(e){if(e&&e.forEach!==br)try{_t(e,"forEach",br)}catch(t){e.forEach=br}};for(var xr in Jn)Jn[xr]&&wr(se[xr]&&se[xr].prototype);
|
|
2
2
|
/*!
|
|
3
3
|
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
6
6
|
* Released under the MIT License.
|
|
7
7
|
*/
|
|
8
|
-
function pr(e){return"[object Object]"===Object.prototype.toString.call(e)}dr(Un);var gr={isHistory(e){return!1!==pr(n=e)&&(void 0===(r=n.constructor)||!1!==pr(o=r.prototype)&&!1!==o.hasOwnProperty("isPrototypeOf"))&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(0===e.redos.length||t.isOperationList(e.redos[0]))&&(0===e.undos.length||t.isOperationList(e.undos[0]));var n,r,o}},vr=new WeakMap,yr=new WeakMap,mr={isHistoryEditor:t=>gr.isHistory(t.history)&&e.isEditor(t),isMerging:e=>yr.get(e),isSaving:e=>vr.get(e),redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var n=mr.isMerging(e);yr.set(e,!1),t(),yr.set(e,n)},withoutSaving(e,t){var n=mr.isSaving(e);vr.set(e,!1),t(),vr.set(e,n)}},br=(e,t)=>"set_selection"===e.type||(!(!t||"insert_text"!==e.type||"insert_text"!==t.type||e.offset!==t.offset+t.text.length||!n.equals(e.path,t.path))||!(!t||"remove_text"!==e.type||"remove_text"!==t.type||e.offset+e.text.length!==t.offset||!n.equals(e.path,t.path))),wr=(e,t)=>"set_selection"!==e.type||null!=e.properties&&null!=e.newProperties,xr=(e,t)=>!(!t||"set_selection"!==e.type||"set_selection"!==t.type),Sr=e=>"set_selection"!==e.type,kr=se.String,Er=function(e){if("Symbol"===$n(e))throw TypeError("Cannot convert a Symbol value to a string");return kr(e)},Or=function(){var e=Tt(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},Cr=en.PROPER,Tr="toString",Nr=RegExp.prototype,Lr=Nr[Tr],Mr=xe(Or),Pr=le((function(){return"/a/b"!=Lr.call({source:"a",flags:"b"})})),Dr=Cr&&Lr.name!=Tr;(Pr||Dr)&&tn(RegExp.prototype,Tr,(function(){var e=Tt(this),t=Er(e.source),n=e.flags;return"/"+t+"/"+Er(void 0===n&&je(Nr,e)&&!("flags"in Nr)?Mr(e):n)}),{unsafe:!0});var Rr=function(e,t,n){var r,o;Tt(e);try{if(!(r=Je(e,"return"))){if("throw"===t)throw n;return n}r=fe(r,e)}catch(e){o=!0,r=e}if("throw"===t)throw n;if(o)throw r;return Tt(r),n},jr=function(e,t,n,r){try{return r?t(Tt(n)[0],n[1]):t(n)}catch(t){Rr(e,"throw",t)}},Ar={},Ir=pt("iterator"),Fr=Array.prototype,Br=function(e){return void 0!==e&&(Ar.Array===e||Fr[Ir]===e)},_r=function(e,t,n){var r=mt(t);r in e?Mt.f(e,r,ve(0,n)):e[r]=n},$r=pt("iterator"),Wr=function(e){if(null!=e)return Je(e,$r)||Je(e,"@@iterator")||Ar[$n(e)]},Vr=se.TypeError,zr=function(e,t){var n=arguments.length<2?Wr(e):t;if(Ge(n))return Tt(fe(n,e));throw Vr(Ke(e)+" is not iterable")},Hr=se.Array,Ur=pt("iterator"),Kr=!1;try{var qr=0,Gr={next:function(){return{done:!!qr++}},return:function(){Kr=!0}};Gr[Ur]=function(){return this},Array.from(Gr,(function(){throw 2}))}catch(e){}var Jr=function(e,t){if(!t&&!Kr)return!1;var n=!1;try{var r={};r[Ur]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},Yr=!Jr((function(e){Array.from(e)}));Dn({target:"Array",stat:!0,forced:Yr},{from:function(e){var t=rt(e),n=nr(this),r=arguments.length,o=r>1?arguments[1]:void 0,i=void 0!==o;i&&(o=qn(o,r>2?arguments[2]:void 0));var a,s,l,u,c,f,d=Wr(t),h=0;if(!d||this==Hr&&Br(d))for(a=fn(t),s=n?new this(a):Hr(a);a>h;h++)f=i?o(t[h],h):t[h],_r(s,h,f);else for(c=(u=zr(t,d)).next,s=n?new this:[];!(l=fe(c,u)).done;h++)f=i?jr(u,o,[l.value,h],!0):l.value,_r(s,h,f);return s.length=h,s}});var Xr,Qr=ue?Object.defineProperties:function(e,t){Tt(e);for(var n,r=Me(t),o=Rn(t),i=o.length,a=0;i>a;)Mt.f(e,n=o[a++],r[n]);return e},Zr=Re("document","documentElement"),eo="prototype",to="script",no=$t("IE_PROTO"),ro=function(){},oo=function(e){return"<"+to+">"+e+"</"+to+">"},io=function(e){e.write(oo("")),e.close();var t=e.parentWindow.Object;return e=null,t},ao=function(){try{Xr=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;ao="undefined"!=typeof document?document.domain&&Xr?io(Xr):(t=xt("iframe"),n="java"+to+":",t.style.display="none",Zr.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(oo("document.F=Object")),e.close(),e.F):io(Xr);for(var r=yn.length;r--;)delete ao[eo][yn[r]];return ao()};Wt[no]=!0;var so=Object.create||function(e,t){var n;return null!==e?(ro[eo]=Tt(e),n=new ro,ro[eo]=null,n[no]=e):n=ao(),void 0===t?n:Qr(n,t)},lo=pt("unscopables"),uo=Array.prototype;null==uo[lo]&&Mt.f(uo,lo,{configurable:!0,value:so(null)});var co=function(e){uo[lo][e]=!0},fo=hn.includes;Dn({target:"Array",proto:!0},{includes:function(e){return fo(this,e,arguments.length>1?arguments[1]:void 0)}}),co("includes");var ho=xe([].join),po=Te!=Object,go=ur("join",",");Dn({target:"Array",proto:!0,forced:po||!go},{join:function(e){return ho(Me(this),void 0===e?",":e)}});var vo=pt("species"),yo=function(e){return $e>=51||!le((function(){var t=[];return(t.constructor={})[vo]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},mo=lr.map,bo=yo("map");Dn({target:"Array",proto:!0,forced:!bo},{map:function(e){return mo(this,e,arguments.length>1?arguments[1]:void 0)}});var wo=!le((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),xo=$t("IE_PROTO"),So=se.Object,ko=So.prototype,Eo=wo?So.getPrototypeOf:function(e){var t=rt(e);if(it(t,xo))return t[xo];var n=t.constructor;return Pe(n)&&t instanceof n?n.prototype:t instanceof So?ko:null};Dn({target:"Reflect",stat:!0},{get:function e(t,n){var r,o,i=arguments.length<3?t:arguments[2];return Tt(t)===i?t[n]:(r=Et.f(t,n))?function(e){return void 0!==e&&(it(e,"value")||it(e,"writable"))}(r)?r.value:void 0===r.get?void 0:fe(r.get,i):De(o=Eo(t))?e(o,n,i):void 0}});var Oo=se.RegExp,Co=le((function(){var e=Oo("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),To=Co||le((function(){return!Oo("a","y").sticky})),No={BROKEN_CARET:Co||le((function(){var e=Oo("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:To,UNSUPPORTED_Y:Co},Lo=se.RegExp,Mo=le((function(){var e=Lo(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Po=se.RegExp,Do=le((function(){var e=Po("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Ro=Yt.get,jo=tt("native-string-replace",String.prototype.replace),Ao=RegExp.prototype.exec,Io=Ao,Fo=xe("".charAt),Bo=xe("".indexOf),_o=xe("".replace),$o=xe("".slice),Wo=function(){var e=/a/,t=/b*/g;return fe(Ao,e,"a"),fe(Ao,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),Vo=No.BROKEN_CARET,zo=void 0!==/()??/.exec("")[1];(Wo||zo||Vo||Mo||Do)&&(Io=function(e){var t,n,r,o,i,a,s,l=this,u=Ro(l),c=Er(e),f=u.raw;if(f)return f.lastIndex=l.lastIndex,t=fe(Io,f,c),l.lastIndex=f.lastIndex,t;var d=u.groups,h=Vo&&l.sticky,p=fe(Or,l),g=l.source,v=0,y=c;if(h&&(p=_o(p,"y",""),-1===Bo(p,"g")&&(p+="g"),y=$o(c,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==Fo(c,l.lastIndex-1))&&(g="(?: "+g+")",y=" "+y,v++),n=new RegExp("^(?:"+g+")",p)),zo&&(n=new RegExp("^"+g+"$(?!\\s)",p)),Wo&&(r=l.lastIndex),o=fe(Ao,h?n:l,y),h?o?(o.input=$o(o.input,v),o[0]=$o(o[0],v),o.index=l.lastIndex,l.lastIndex+=o[0].length):l.lastIndex=0:Wo&&o&&(l.lastIndex=l.global?o.index+o[0].length:r),zo&&o&&o.length>1&&fe(jo,o[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(o[i]=void 0)})),o&&d)for(o.groups=a=so(null),i=0;i<d.length;i++)a[(s=d[i])[0]]=o[s[1]];return o});var Ho=Io;Dn({target:"RegExp",proto:!0,forced:/./.exec!==Ho},{exec:Ho});var Uo,Ko=pt("match"),qo=function(e){var t;return De(e)&&(void 0!==(t=e[Ko])?!!t:"RegExp"==Ee(e))},Go=se.TypeError,Jo=function(e){if(qo(e))throw Go("The method doesn't accept regular expressions");return e},Yo=pt("match"),Xo=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Yo]=!1,"/./"[e](t)}catch(e){}}return!1},Qo=Et.f,Zo=xe("".endsWith),ei=xe("".slice),ti=Math.min,ni=Xo("endsWith"),ri=!(ni||(Uo=Qo(String.prototype,"endsWith"),!Uo||Uo.writable));Dn({target:"String",proto:!0,forced:!ri&&!ni},{endsWith:function(e){var t=Er(Le(this));Jo(e);var n=arguments.length>1?arguments[1]:void 0,r=t.length,o=void 0===n?r:ti(cn(n),r),i=Er(e);return Zo?Zo(t,i,o):ei(t,o-i.length,o)===i}});var oi=xe("".indexOf);Dn({target:"String",proto:!0,forced:!Xo("includes")},{includes:function(e){return!!~oi(Er(Le(this)),Er(Jo(e)),arguments.length>1?arguments[1]:void 0)}});var ii,ai,si,li=xe("".charAt),ui=xe("".charCodeAt),ci=xe("".slice),fi=function(e){return function(t,n){var r,o,i=Er(Le(t)),a=on(n),s=i.length;return a<0||a>=s?e?"":void 0:(r=ui(i,a))<55296||r>56319||a+1===s||(o=ui(i,a+1))<56320||o>57343?e?li(i,a):r:e?ci(i,a,a+2):o-56320+(r-55296<<10)+65536}},di={codeAt:fi(!1),charAt:fi(!0)},hi=pt("iterator"),pi=!1;[].keys&&("next"in(si=[].keys())?(ai=Eo(Eo(si)))!==Object.prototype&&(ii=ai):pi=!0);var gi=null==ii||le((function(){var e={};return ii[hi].call(e)!==e}));gi&&(ii={}),Pe(ii[hi])||tn(ii,hi,(function(){return this}));var vi={IteratorPrototype:ii,BUGGY_SAFARI_ITERATORS:pi},yi=Mt.f,mi=pt("toStringTag"),bi=function(e,t,n){e&&!it(e=n?e:e.prototype,mi)&&yi(e,mi,{configurable:!0,value:t})},wi=vi.IteratorPrototype,xi=function(){return this},Si=se.String,ki=se.TypeError,Ei=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=xe(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return Tt(n),function(e){if("object"==typeof e||Pe(e))return e;throw ki("Can't set "+Si(e)+" as a prototype")}(r),t?e(n,r):n.__proto__=r,n}}():void 0),Oi=en.PROPER,Ci=en.CONFIGURABLE,Ti=vi.IteratorPrototype,Ni=vi.BUGGY_SAFARI_ITERATORS,Li=pt("iterator"),Mi="keys",Pi="values",Di="entries",Ri=function(){return this},ji=function(e,t,n,r,o,i,a){!function(e,t,n,r){var o=t+" Iterator";e.prototype=so(wi,{next:ve(+!r,n)}),bi(e,o,!1),Ar[o]=xi}(n,t,r);var s,l,u,c=function(e){if(e===o&&g)return g;if(!Ni&&e in h)return h[e];switch(e){case Mi:case Pi:case Di:return function(){return new n(this,e)}}return function(){return new n(this)}},f=t+" Iterator",d=!1,h=e.prototype,p=h[Li]||h["@@iterator"]||o&&h[o],g=!Ni&&p||c(o),v="Array"==t&&h.entries||p;if(v&&(s=Eo(v.call(new e)))!==Object.prototype&&s.next&&(Eo(s)!==Ti&&(Ei?Ei(s,Ti):Pe(s[Li])||tn(s,Li,Ri)),bi(s,f,!0)),Oi&&o==Pi&&p&&p.name!==Pi&&(Ci?Pt(h,"name",Pi):(d=!0,g=function(){return fe(p,this)})),o)if(l={values:c(Pi),keys:i?g:c(Mi),entries:c(Di)},a)for(u in l)(Ni||d||!(u in h))&&tn(h,u,l[u]);else Dn({target:t,proto:!0,forced:Ni||d},l);return h[Li]!==g&&tn(h,Li,g,{name:o}),Ar[t]=g,l},Ai=di.charAt,Ii="String Iterator",Fi=Yt.set,Bi=Yt.getterFor(Ii);ji(String,"String",(function(e){Fi(this,{type:Ii,string:Er(e),index:0})}),(function(){var e,t=Bi(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=Ai(n,r),t.index+=e.length,{value:e,done:!1})}));var _i=Function.prototype,$i=_i.apply,Wi=_i.bind,Vi=_i.call,zi="object"==typeof Reflect&&Reflect.apply||(Wi?Vi.bind($i):function(){return Vi.apply($i,arguments)}),Hi=pt("species"),Ui=RegExp.prototype,Ki=function(e,t,n,r){var o=pt(e),i=!le((function(){var t={};return t[o]=function(){return 7},7!=""[e](t)})),a=i&&!le((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[Hi]=function(){return n},n.flags="",n[o]=/./[o]),n.exec=function(){return t=!0,null},n[o](""),!t}));if(!i||!a||n){var s=xe(/./[o]),l=t(o,""[e],(function(e,t,n,r,o){var a=xe(e),l=t.exec;return l===Ho||l===Ui.exec?i&&!o?{done:!0,value:s(t,n,r)}:{done:!0,value:a(n,t,r)}:{done:!1}}));tn(String.prototype,e,l[0]),tn(Ui,o,l[1])}r&&Pt(Ui[o],"sham",!0)},qi=di.charAt,Gi=function(e,t,n){return t+(n?qi(e,t).length:1)},Ji=Math.floor,Yi=xe("".charAt),Xi=xe("".replace),Qi=xe("".slice),Zi=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,ea=/\$([$&'`]|\d{1,2})/g,ta=function(e,t,n,r,o,i){var a=n+e.length,s=r.length,l=ea;return void 0!==o&&(o=rt(o),l=Zi),Xi(i,l,(function(i,l){var u;switch(Yi(l,0)){case"$":return"$";case"&":return e;case"`":return Qi(t,0,n);case"'":return Qi(t,a);case"<":u=o[Qi(l,1,-1)];break;default:var c=+l;if(0===c)return i;if(c>s){var f=Ji(c/10);return 0===f?i:f<=s?void 0===r[f-1]?Yi(l,1):r[f-1]+Yi(l,1):i}u=r[c-1]}return void 0===u?"":u}))},na=se.TypeError,ra=function(e,t){var n=e.exec;if(Pe(n)){var r=fe(n,e,t);return null!==r&&Tt(r),r}if("RegExp"===Ee(e))return fe(Ho,e,t);throw na("RegExp#exec called on incompatible receiver")},oa=pt("replace"),ia=Math.max,aa=Math.min,sa=xe([].concat),la=xe([].push),ua=xe("".indexOf),ca=xe("".slice),fa="$0"==="a".replace(/./,"$0"),da=!!/./[oa]&&""===/./[oa]("a","$0");Ki("replace",(function(e,t,n){var r=da?"$":"$0";return[function(e,n){var r=Le(this),o=null==e?void 0:Je(e,oa);return o?fe(o,e,r,n):fe(t,Er(r),e,n)},function(e,o){var i=Tt(this),a=Er(e);if("string"==typeof o&&-1===ua(o,r)&&-1===ua(o,"$<")){var s=n(t,i,a,o);if(s.done)return s.value}var l=Pe(o);l||(o=Er(o));var u=i.global;if(u){var c=i.unicode;i.lastIndex=0}for(var f=[];;){var d=ra(i,a);if(null===d)break;if(la(f,d),!u)break;""===Er(d[0])&&(i.lastIndex=Gi(a,cn(i.lastIndex),c))}for(var h,p="",g=0,v=0;v<f.length;v++){for(var y=Er((d=f[v])[0]),m=ia(aa(on(d.index),a.length),0),b=[],w=1;w<d.length;w++)la(b,void 0===(h=d[w])?h:String(h));var x=d.groups;if(l){var S=sa([y],b,m,a);void 0!==x&&la(S,x);var k=Er(zi(o,void 0,S))}else k=ta(y,a,m,b,x,o);m>=g&&(p+=ca(a,g,m)+k,g=m+y.length)}return p+ca(a,g)}]}),!!le((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!fa||da);var ha,pa=/"/g,ga=xe("".replace);Dn({target:"String",proto:!0,forced:(ha="anchor",le((function(){var e=""[ha]('"');return e!==e.toLowerCase()||e.split('"').length>3})))},{anchor:function(e){return t="a",n="name",r=e,o=Er(Le(this)),i="<"+t,""!==n&&(i+=" "+n+'="'+ga(Er(r),pa,""")+'"'),i+">"+o+"</"+t+">";var t,n,r,o,i}});var va=function(e,t){return va=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},va(e,t)};function ya(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}va(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var ma=function(){return ma=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ma.apply(this,arguments)};function ba(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function wa(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function xa(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var Sa=0,ka=function(){this.id=""+Sa++},Ea="Array Iterator",Oa=Yt.set,Ca=Yt.getterFor(Ea),Ta=ji(Array,"Array",(function(e,t){Oa(this,{type:Ea,target:Me(e),index:0,kind:t})}),(function(){var e=Ca(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values");Ar.Arguments=Ar.Array,co("keys"),co("values"),co("entries");var Na=function(e,t,n){for(var r in t)tn(e,r,t[r],n);return e},La=se.Array,Ma=Math.max,Pa=function(e,t,n){for(var r=fn(e),o=ln(t,r),i=ln(void 0===n?r:n,r),a=La(Ma(i-o,0)),s=0;o<i;o++,s++)_r(a,s,e[o]);return a.length=s,a},Da=bn.f,Ra="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],ja={f:function(e){return Ra&&"Window"==Ee(e)?function(e){try{return Da(e)}catch(e){return Pa(Ra)}}(e):Da(Me(e))}},Aa=le((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),Ia=Object.isExtensible,Fa=le((function(){Ia(1)}))||Aa?function(e){return!!De(e)&&((!Aa||"ArrayBuffer"!=Ee(e))&&(!Ia||Ia(e)))}:Ia,Ba=!le((function(){return Object.isExtensible(Object.preventExtensions({}))})),_a=re((function(e){var t=Mt.f,n=!1,r=ut("meta"),o=0,i=function(e){t(e,r,{value:{objectID:"O"+o++,weakData:{}}})},a=e.exports={enable:function(){a.enable=function(){},n=!0;var e=bn.f,t=xe([].splice),o={};o[r]=1,e(o).length&&(bn.f=function(n){for(var o=e(n),i=0,a=o.length;i<a;i++)if(o[i]===r){t(o,i,1);break}return o},Dn({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:ja.f}))},fastKey:function(e,t){if(!De(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!it(e,r)){if(!Fa(e))return"F";if(!t)return"E";i(e)}return e[r].objectID},getWeakData:function(e,t){if(!it(e,r)){if(!Fa(e))return!0;if(!t)return!1;i(e)}return e[r].weakData},onFreeze:function(e){return Ba&&n&&Fa(e)&&!it(e,r)&&i(e),e}};Wt[r]=!0})),$a=se.TypeError,Wa=function(e,t){this.stopped=e,this.result=t},Va=Wa.prototype,za=function(e,t,n){var r,o,i,a,s,l,u,c=n&&n.that,f=!(!n||!n.AS_ENTRIES),d=!(!n||!n.IS_ITERATOR),h=!(!n||!n.INTERRUPTED),p=qn(t,c),g=function(e){return r&&Rr(r,"normal",e),new Wa(!0,e)},v=function(e){return f?(Tt(e),h?p(e[0],e[1],g):p(e[0],e[1])):h?p(e,g):p(e)};if(d)r=e;else{if(!(o=Wr(e)))throw $a(Ke(e)+" is not iterable");if(Br(o)){for(i=0,a=fn(e);a>i;i++)if((s=v(e[i]))&&je(Va,s))return s;return new Wa(!1)}r=zr(e,o)}for(l=r.next;!(u=fe(l,r)).done;){try{s=v(u.value)}catch(e){Rr(r,"throw",e)}if("object"==typeof s&&s&&je(Va,s))return s}return new Wa(!1)},Ha=se.TypeError,Ua=function(e,t){if(je(t,e))return e;throw Ha("Incorrect invocation")},Ka=function(e,t,n){var r,o;return Ei&&Pe(r=t.constructor)&&r!==n&&De(o=r.prototype)&&o!==n.prototype&&Ei(e,o),e},qa=function(e,t,n){var r=-1!==e.indexOf("Map"),o=-1!==e.indexOf("Weak"),i=r?"set":"add",a=se[e],s=a&&a.prototype,l=a,u={},c=function(e){var t=xe(s[e]);tn(s,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(o&&!De(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return o&&!De(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(o&&!De(e))&&t(this,0===e?0:e)}:function(e,n){return t(this,0===e?0:e,n),this})};if(Mn(e,!Pe(a)||!(o||s.forEach&&!le((function(){(new a).entries().next()})))))l=n.getConstructor(t,e,r,i),_a.enable();else if(Mn(e,!0)){var f=new l,d=f[i](o?{}:-0,1)!=f,h=le((function(){f.has(1)})),p=Jr((function(e){new a(e)})),g=!o&&le((function(){for(var e=new a,t=5;t--;)e[i](t,t);return!e.has(-0)}));p||((l=t((function(e,t){Ua(e,s);var n=Ka(new a,e,l);return null!=t&&za(t,n[i],{that:n,AS_ENTRIES:r}),n}))).prototype=s,s.constructor=l),(h||g)&&(c("delete"),c("has"),r&&c("get")),(g||d)&&c(i),o&&s.clear&&delete s.clear}return u[e]=l,Dn({global:!0,forced:l!=a},u),bi(l,e),o||n.setStrong(l,e,r),l},Ga=_a.getWeakData,Ja=Yt.set,Ya=Yt.getterFor,Xa=lr.find,Qa=lr.findIndex,Za=xe([].splice),es=0,ts=function(e){return e.frozen||(e.frozen=new ns)},ns=function(){this.entries=[]},rs=function(e,t){return Xa(e.entries,(function(e){return e[0]===t}))};ns.prototype={get:function(e){var t=rs(this,e);if(t)return t[1]},has:function(e){return!!rs(this,e)},set:function(e,t){var n=rs(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=Qa(this.entries,(function(t){return t[0]===e}));return~t&&Za(this.entries,t,1),!!~t}};var os,is={getConstructor:function(e,t,n,r){var o=e((function(e,o){Ua(e,i),Ja(e,{type:t,id:es++,frozen:void 0}),null!=o&&za(o,e[r],{that:e,AS_ENTRIES:n})})),i=o.prototype,a=Ya(t),s=function(e,t,n){var r=a(e),o=Ga(Tt(t),!0);return!0===o?ts(r).set(t,n):o[r.id]=n,e};return Na(i,{delete:function(e){var t=a(this);if(!De(e))return!1;var n=Ga(e);return!0===n?ts(t).delete(e):n&&it(n,t.id)&&delete n[t.id]},has:function(e){var t=a(this);if(!De(e))return!1;var n=Ga(e);return!0===n?ts(t).has(e):n&&it(n,t.id)}}),Na(i,n?{get:function(e){var t=a(this);if(De(e)){var n=Ga(e);return!0===n?ts(t).get(e):n?n[t.id]:void 0}},set:function(e,t){return s(this,e,t)}}:{add:function(e){return s(this,e,!0)}}),o}},as=Yt.enforce,ss=!se.ActiveXObject&&"ActiveXObject"in se,ls=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},us=qa("WeakMap",ls,is);if(Bt&&ss){os=is.getConstructor(ls,"WeakMap",!0),_a.enable();var cs=us.prototype,fs=xe(cs.delete),ds=xe(cs.has),hs=xe(cs.get),ps=xe(cs.set);Na(cs,{delete:function(e){if(De(e)&&!Fa(e)){var t=as(this);return t.frozen||(t.frozen=new os),fs(this,e)||t.frozen.delete(e)}return fs(this,e)},has:function(e){if(De(e)&&!Fa(e)){var t=as(this);return t.frozen||(t.frozen=new os),ds(this,e)||t.frozen.has(e)}return ds(this,e)},get:function(e){if(De(e)&&!Fa(e)){var t=as(this);return t.frozen||(t.frozen=new os),ds(this,e)?hs(this,e):t.frozen.get(e)}return hs(this,e)},set:function(e,t){if(De(e)&&!Fa(e)){var n=as(this);n.frozen||(n.frozen=new os),ds(this,e)?ps(this,e,t):n.frozen.set(e,t)}else ps(this,e,t);return this}})}var gs=pt("iterator"),vs=pt("toStringTag"),ys=Ta.values,ms=function(e,t){if(e){if(e[gs]!==ys)try{Pt(e,gs,ys)}catch(t){e[gs]=ys}if(e[vs]||Pt(e,vs,t),Vn[t])for(var n in Ta)if(e[n]!==Ta[n])try{Pt(e,n,Ta[n])}catch(t){e[n]=Ta[n]}}};for(var bs in Vn)ms(se[bs]&&se[bs].prototype,bs);ms(Un,"DOMTokenList");var ws=new WeakMap,xs=new WeakMap,Ss=new WeakMap,ks=new WeakMap,Es=new WeakMap,Os=new WeakMap,Cs=new WeakMap,Ts=new WeakMap,Ns=new WeakMap,Ls=new WeakMap,Ms=new WeakMap,Ps=new WeakMap,Ds=new WeakMap,Rs=new WeakMap,js=new WeakMap,As=new WeakMap,Is=new WeakMap,Fs=new WeakMap,Bs=new WeakMap,_s=new WeakMap,$s=new WeakMap,Ws=new WeakMap,Vs=new WeakMap,zs=new WeakMap,Hs=new WeakMap,Us=lr.find,Ks="find",qs=!0;Ks in[]&&Array(1)[Ks]((function(){qs=!1})),Dn({target:"Array",proto:!0,forced:qs},{find:function(e){return Us(this,e,arguments.length>1?arguments[1]:void 0)}}),co(Ks),Dn({global:!0},{globalThis:se});const Gs=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","isindex","keygen","link","menuitem","meta","nextid","param","source","track","wbr"];var Js,Ys,Xs,Qs,Zs=se.Promise,el=pt("species"),tl=function(e){var t=Re(e),n=Mt.f;ue&&t&&!t[el]&&n(t,el,{configurable:!0,get:function(){return this}})},nl=se.TypeError,rl=pt("species"),ol=function(e,t){var n,r=Tt(e).constructor;return void 0===r||null==(n=Tt(r)[rl])?t:function(e){if(nr(e))return e;throw nl(Ke(e)+" is not a constructor")}(n)},il=xe([].slice),al=/(?:ipad|iphone|ipod).*applewebkit/i.test(Ae),sl="process"==Ee(se.process),ll=se.setImmediate,ul=se.clearImmediate,cl=se.process,fl=se.Dispatch,dl=se.Function,hl=se.MessageChannel,pl=se.String,gl=0,vl={},yl="onreadystatechange";try{Js=se.location}catch(e){}var ml=function(e){if(it(vl,e)){var t=vl[e];delete vl[e],t()}},bl=function(e){return function(){ml(e)}},wl=function(e){ml(e.data)},xl=function(e){se.postMessage(pl(e),Js.protocol+"//"+Js.host)};ll&&ul||(ll=function(e){var t=il(arguments,1);return vl[++gl]=function(){zi(Pe(e)?e:dl(e),void 0,t)},Ys(gl),gl},ul=function(e){delete vl[e]},sl?Ys=function(e){cl.nextTick(bl(e))}:fl&&fl.now?Ys=function(e){fl.now(bl(e))}:hl&&!al?(Qs=(Xs=new hl).port2,Xs.port1.onmessage=wl,Ys=qn(Qs.postMessage,Qs)):se.addEventListener&&Pe(se.postMessage)&&!se.importScripts&&Js&&"file:"!==Js.protocol&&!le(xl)?(Ys=xl,se.addEventListener("message",wl,!1)):Ys=yl in xt("script")?function(e){Zr.appendChild(xt("script"))[yl]=function(){Zr.removeChild(this),ml(e)}}:function(e){setTimeout(bl(e),0)});var Sl,kl,El,Ol,Cl,Tl,Nl,Ll,Ml={set:ll,clear:ul},Pl=/ipad|iphone|ipod/i.test(Ae)&&void 0!==se.Pebble,Dl=/web0s(?!.*chrome)/i.test(Ae),Rl=Et.f,jl=Ml.set,Al=se.MutationObserver||se.WebKitMutationObserver,Il=se.document,Fl=se.process,Bl=se.Promise,_l=Rl(se,"queueMicrotask"),$l=_l&&_l.value;$l||(Sl=function(){var e,t;for(sl&&(e=Fl.domain)&&e.exit();kl;){t=kl.fn,kl=kl.next;try{t()}catch(e){throw kl?Ol():El=void 0,e}}El=void 0,e&&e.enter()},al||sl||Dl||!Al||!Il?!Pl&&Bl&&Bl.resolve?((Nl=Bl.resolve(void 0)).constructor=Bl,Ll=qn(Nl.then,Nl),Ol=function(){Ll(Sl)}):sl?Ol=function(){Fl.nextTick(Sl)}:(jl=qn(jl,se),Ol=function(){jl(Sl)}):(Cl=!0,Tl=Il.createTextNode(""),new Al(Sl).observe(Tl,{characterData:!0}),Ol=function(){Tl.data=Cl=!Cl}));var Wl,Vl,zl,Hl,Ul=$l||function(e){var t={fn:e,next:void 0};El&&(El.next=t),kl||(kl=t,Ol()),El=t},Kl=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=Ge(t),this.reject=Ge(n)},ql={f:function(e){return new Kl(e)}},Gl=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Jl="object"==typeof window,Yl=Ml.set,Xl=pt("species"),Ql="Promise",Zl=Yt.getterFor(Ql),eu=Yt.set,tu=Yt.getterFor(Ql),nu=Zs&&Zs.prototype,ru=Zs,ou=nu,iu=se.TypeError,au=se.document,su=se.process,lu=ql.f,uu=lu,cu=!!(au&&au.createEvent&&se.dispatchEvent),fu=Pe(se.PromiseRejectionEvent),du="unhandledrejection",hu=!1,pu=Mn(Ql,(function(){var e=It(ru),t=e!==String(ru);if(!t&&66===$e)return!0;if($e>=51&&/native code/.test(e))return!1;var n=new ru((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};return(n.constructor={})[Xl]=r,!(hu=n.then((function(){}))instanceof r)||!t&&Jl&&!fu})),gu=pu||!Jr((function(e){ru.all(e).catch((function(){}))})),vu=function(e){var t;return!(!De(e)||!Pe(t=e.then))&&t},yu=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;Ul((function(){for(var r=e.value,o=1==e.state,i=0;n.length>i;){var a,s,l,u=n[i++],c=o?u.ok:u.fail,f=u.resolve,d=u.reject,h=u.domain;try{c?(o||(2===e.rejection&&xu(e),e.rejection=1),!0===c?a=r:(h&&h.enter(),a=c(r),h&&(h.exit(),l=!0)),a===u.promise?d(iu("Promise-chain cycle")):(s=vu(a))?fe(s,a,f,d):f(a)):d(r)}catch(e){h&&!l&&h.exit(),d(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&bu(e)}))}},mu=function(e,t,n){var r,o;cu?((r=au.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),se.dispatchEvent(r)):r={promise:t,reason:n},!fu&&(o=se["on"+e])?o(r):e===du&&function(e,t){var n=se.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))}("Unhandled promise rejection",n)},bu=function(e){fe(Yl,se,(function(){var t,n=e.facade,r=e.value;if(wu(e)&&(t=Gl((function(){sl?su.emit("unhandledRejection",r,n):mu(du,n,r)})),e.rejection=sl||wu(e)?2:1,t.error))throw t.value}))},wu=function(e){return 1!==e.rejection&&!e.parent},xu=function(e){fe(Yl,se,(function(){var t=e.facade;sl?su.emit("rejectionHandled",t):mu("rejectionhandled",t,e.value)}))},Su=function(e,t,n){return function(r){e(t,r,n)}},ku=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,yu(e,!0))},Eu=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw iu("Promise can't be resolved itself");var r=vu(t);r?Ul((function(){var n={done:!1};try{fe(r,t,Su(Eu,n,e),Su(ku,n,e))}catch(t){ku(n,t,e)}})):(e.value=t,e.state=1,yu(e,!1))}catch(t){ku({done:!1},t,e)}}};if(pu&&(ou=(ru=function(e){Ua(this,ou),Ge(e),fe(Wl,this);var t=Zl(this);try{e(Su(Eu,t),Su(ku,t))}catch(e){ku(t,e)}}).prototype,(Wl=function(e){eu(this,{type:Ql,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Na(ou,{then:function(e,t){var n=tu(this),r=n.reactions,o=lu(ol(this,ru));return o.ok=!Pe(e)||e,o.fail=Pe(t)&&t,o.domain=sl?su.domain:void 0,n.parent=!0,r[r.length]=o,0!=n.state&&yu(n,!1),o.promise},catch:function(e){return this.then(void 0,e)}}),Vl=function(){var e=new Wl,t=Zl(e);this.promise=e,this.resolve=Su(Eu,t),this.reject=Su(ku,t)},ql.f=lu=function(e){return e===ru||e===zl?new Vl(e):uu(e)},Pe(Zs)&&nu!==Object.prototype)){Hl=nu.then,hu||(tn(nu,"then",(function(e,t){var n=this;return new ru((function(e,t){fe(Hl,n,e,t)})).then(e,t)}),{unsafe:!0}),tn(nu,"catch",ou.catch,{unsafe:!0}));try{delete nu.constructor}catch(e){}Ei&&Ei(nu,ou)}function Ou(e){Promise.resolve().then(e)}Dn({global:!0,wrap:!0,forced:pu},{Promise:ru}),bi(ru,Ql,!1),tl(Ql),zl=Re(Ql),Dn({target:Ql,stat:!0,forced:pu},{reject:function(e){var t=lu(this);return fe(t.reject,void 0,e),t.promise}}),Dn({target:Ql,stat:!0,forced:pu},{resolve:function(e){return function(e,t){if(Tt(e),De(t)&&t.constructor===e)return t;var n=ql.f(e);return(0,n.resolve)(t),n.promise}(this,e)}}),Dn({target:Ql,stat:!0,forced:gu},{all:function(e){var t=this,n=lu(t),r=n.resolve,o=n.reject,i=Gl((function(){var n=Ge(t.resolve),i=[],a=0,s=1;za(e,(function(e){var l=a++,u=!1;s++,fe(n,t,e).then((function(e){u||(u=!0,i[l]=e,--s||r(i))}),o)})),--s||r(i)}));return i.error&&o(i.value),n.promise},race:function(e){var t=this,n=lu(t),r=n.reject,o=Gl((function(){var o=Ge(t.resolve);za(e,(function(e){fe(o,t,e).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}});var Cu=function(e){return Object.prototype.toString.call(e)};d&&(f.fn.css=d),h&&(f.fn.append=h),p&&(f.fn.addClass=p),g&&(f.fn.removeClass=g),v&&(f.fn.hasClass=v),y&&(f.fn.on=y),m&&(f.fn.focus=m),b&&(f.fn.attr=b),w&&(f.fn.removeAttr=w),x&&(f.fn.hide=x),S&&(f.fn.show=S),k&&(f.fn.offset=k),E&&(f.fn.width=E),O&&(f.fn.height=O),C&&(f.fn.parent=C),T&&(f.fn.parents=T),N&&(f.fn.is=N),L&&(f.fn.dataset=L),M&&(f.fn.val=M),P&&(f.fn.text=P),D&&(f.fn.html=D),R&&(f.fn.children=R),j&&(f.fn.remove=j),A&&(f.fn.find=A),I&&(f.fn.each=I),F&&(f.fn.empty=F);var Tu,Nu=function(e){return"[object HTMLDocument]"===Cu(e)},Lu=function(e){return"[object ShadowRoot]"===Cu(e)},Mu=function(e){return"[object DataTransfer]"===Cu(e)},Pu=/\[object HTML([A-Z][a-z]*)*Element\]/,Du=function(e){return Pu.test(Cu(e))},Ru=globalThis.Node,ju=globalThis.Comment,Au=globalThis.Element,Iu=globalThis.Text,Fu=globalThis.Range,Bu=globalThis.Selection,_u=globalThis.StaticRange,$u=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||null},Wu=function(e){return zu(e)&&8===e.nodeType},Vu=function(e){return zu(e)&&1===e.nodeType},zu=function(e){return null!=e&&"number"==typeof e.nodeType},Hu=function(e){return"[object Selection]"===Cu(e)},Uu=function(e){return zu(e)&&3===e.nodeType},Ku=function(e){return e.clipboardData&&""!==e.clipboardData.getData("text/plain")&&1===e.clipboardData.types.length},qu=function(e){var t,n=wa(e,2),r=n[0],o=n[1];if(Vu(r)&&r.childNodes.length){var i=o===r.childNodes.length,a=i?o-1:o;for(r=(t=wa(Yu(r,a,i?"backward":"forward"),2))[0],i=(a=t[1])<o;Vu(r)&&r.childNodes.length;){var s=i?r.childNodes.length-1:0;r=Xu(r,s,i?"backward":"forward")}o=i&&null!=r.textContent?r.textContent.length:0}return[r,o]},Gu=function(){return!(!window.document.activeElement||!window.document.activeElement.shadowRoot)},Ju=function(e){var t,n,r;return null!==(t=window.document.getElementById(e))&&void 0!==t?t:(null===(r=null===(n=window.document.activeElement)||void 0===n?void 0:n.shadowRoot)||void 0===r?void 0:r.getElementById(e))||null},Yu=function(e,t,n){for(var r=e.childNodes,o=r[t],i=t,a=!1,s=!1;(Wu(o)||Vu(o)&&0===o.childNodes.length||Vu(o)&&"false"===o.getAttribute("contenteditable"))&&(!a||!s);)i>=r.length?(a=!0,i=t-1,n="backward"):i<0?(s=!0,i=t+1,n="forward"):(o=r[i],t=i,i+="forward"===n?1:-1);return[o,t]},Xu=function(e,t,n){return wa(Yu(e,t,n),1)[0]},Qu=function(e){var t,n,r="";if(Uu(e)&&e.nodeValue)return e.nodeValue;if(Vu(e)){try{for(var o=ba(Array.from(e.childNodes)),i=o.next();!i.done;i=o.next()){var a=i.value;r+=Qu(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}var s=getComputedStyle(e).getPropertyValue("display");"block"!==s&&"list"!==s&&"table-row"!==s&&"BR"!==e.tagName||(r+="\n")}return r};function Zu(e){var t=[];t.push(e);for(var n=0;t.length>0;){var r=t.pop();if(null==r)break;if(++n>1e4)break;var o=r.nodeName;if(1===r.nodeType){var i=o.toLowerCase();if(Gs.includes(i)||"iframe"===i||"video"===i)return r;var a=r.children||[],s=a.length;if(s)for(var l=s-1;l>=0;l--)t.push(a[l])}}return null}function ec(e,t){if(!Du(e)||"true"!==e.dataset.slateVoid)for(var n=e.childNodes,r=n.length;r--;){var o=n[r],i=o.nodeType;3==i?t(o,e):1!=i&&9!=i&&11!=i||ec(o,t)}}function tc(e){if(0===e.length)return"";var t=e[0];return t.nodeType!==Tu.ELEMENT_NODE?"":t.tagName.toLowerCase()}!function(e){e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"}(Tu||(Tu={})),void 0!==globalThis.navigator&&void 0!==globalThis.window&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&globalThis.window.MSStream;var nc="undefined"!=typeof navigator&&/Mac OS X/.test(navigator.userAgent),rc="undefined"!=typeof navigator&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);"undefined"!=typeof navigator&&/^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent);var oc="undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),ic="undefined"!=typeof navigator&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),ac="undefined"!=typeof navigator&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),sc="undefined"!=typeof navigator&&/Chrome/i.test(navigator.userAgent);"undefined"!=typeof navigator&&/.*QQBrowser/.test(navigator.userAgent);var lc=!ac&&!ic&&"undefined"!=typeof globalThis&&globalThis.InputEvent&&"function"==typeof globalThis.InputEvent.prototype.getTargetRanges,uc={getWindow:function(e){var t=$s.get(e);if(!t)throw new Error("Unable to find a host window element for this editor");return t},findKey:function(e,t){var n=_s.get(t);return n||(n=new ka,_s.set(t,n)),n},setNewKey:function(e){var t=new ka;_s.set(e,t)},findPath:function(t,n){for(var r=[],o=n;;){var i=js.get(o);if(null==i){if(e.isEditor(o))return r;break}var a=Rs.get(o);if(null==a)break;r.unshift(a),o=i}throw new Error("Unable to find the path for Slate node: "+JSON.stringify(n))},findDocumentOrShadowRoot:function(e){if(e.isDestroyed)return window.document;var t=uc.toDOMNode(e,e),n=t.getRootNode();return(Nu(n)||Lu(n))&&null!=Reflect.get(n,"getSelection")?n:t.ownerDocument},getParentNode:function(e,t){return js.get(t)||null},getParentsNodes:function(e,t){for(var n=[],r=t;r!==e&&null!=r;){var o=uc.getParentNode(e,r);if(null==o)break;n.push(o),r=o}return n},getTopNode:function(e,t){var n=[uc.findPath(e,t)[0]];return r.get(e,n)},toDOMNode:function(t,n){var r;if(e.isEditor(n))r=As.get(t);else{var o=uc.findKey(t,n);r=Fs.get(o)}if(!r)throw new Error("Cannot resolve a DOM node from Slate node: "+JSON.stringify(n));return r},hasDOMNode:function(e,t,n){void 0===n&&(n={});var r,o=n.editable,i=void 0!==o&&o,a=uc.toDOMNode(e,e);try{r=Vu(t)?t:t.parentElement}catch(e){if(!e.message.includes('Permission denied to access property "nodeType"'))throw e}return!!r&&(r.closest("[data-slate-editor]")===a&&(!i||r.isContentEditable||!!r.getAttribute("data-slate-zero-width"))||!!r.getAttribute("data-slate-string"))},toDOMRange:function(e,t){var n=t.anchor,r=t.focus,i=o.isBackward(t),a=uc.toDOMPoint(e,n),s=o.isCollapsed(t)?a:uc.toDOMPoint(e,r),l=uc.getWindow(e).document.createRange(),u=wa(i?s:a,2),c=u[0],f=u[1],d=wa(i?a:s,2),h=d[0],p=d[1],g=!!(Vu(c)?c:c.parentElement).getAttribute("data-slate-zero-width"),v=!!(Vu(h)?h:h.parentElement).getAttribute("data-slate-zero-width");return l.setStart(c,g?1:f),l.setEnd(h,v?1:p),l},toDOMPoint:function(t,n){var r,o,i,a=wa(e.node(t,n.path),1)[0],s=uc.toDOMNode(t,a);e.void(t,{at:n})&&(n={path:n.path,offset:0});var l=Array.from(s.querySelectorAll("[data-slate-string], [data-slate-zero-width]")),u=0;try{for(var c=ba(l),f=c.next();!f.done;f=c.next()){var d=f.value,h=d.childNodes[0];if(null!=h&&null!=h.textContent){var p=h.textContent.length,g=d.getAttribute("data-slate-length"),v=u+(null==g?p:parseInt(g,10));if(n.offset<=v){i=[h,Math.min(p,Math.max(0,n.offset-u))];break}u=v}}}catch(e){r={error:e}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}if(!i)throw new Error("Cannot resolve a DOM point from Slate point: "+JSON.stringify(n));return i},toSlateNode:function(e,t){var n=Vu(t)?t:t.parentElement;n&&!n.hasAttribute("data-slate-node")&&(n=n.closest("[data-slate-node]"));var r=n?Is.get(n):null;if(!r)throw new Error("Cannot resolve a Slate node from DOM node: "+n);return r},findEventRange:function(t,n){"nativeEvent"in n&&(n=n.nativeEvent);var r=n.clientX,o=n.clientY,i=n.target;if(null==r||null==o)throw new Error("Cannot resolve a Slate range from a DOM event: "+n);var a,s=uc.toSlateNode(t,n.target),l=uc.findPath(t,s);if(e.isVoid(t,s)){var u=i.getBoundingClientRect(),c=t.isInline(s)?r-u.left<u.left+u.width-r:o-u.top<u.top+u.height-o,f=e.point(t,l,{edge:c?"start":"end"}),d=c?e.before(t,f):e.after(t,f);if(d)return e.range(t,d)}var h=this.getWindow(t).document;if(h.caretRangeFromPoint)a=h.caretRangeFromPoint(r,o);else{var p=h.caretPositionFromPoint(r,o);p&&((a=h.createRange()).setStart(p.offsetNode,p.offset),a.setEnd(p.offsetNode,p.offset))}if(!a)throw new Error("Cannot resolve a Slate range from a DOM event: "+n);return uc.toSlateRange(t,a,{exactMatch:!1,suppressThrow:!1})},toSlateRange:function(t,n,r){var i,a,s,l,u,c=r.exactMatch,f=r.suppressThrow;if((Hu(n)?n.anchorNode:n.startContainer)&&(Hu(n)?(i=n.anchorNode,a=n.anchorOffset,s=n.focusNode,l=n.focusOffset,u=sc&&Gu()?n.anchorNode===n.focusNode&&n.anchorOffset===n.focusOffset:n.isCollapsed):(i=n.startContainer,a=n.startOffset,s=n.endContainer,l=n.endOffset,u=n.collapsed)),null==i||null==s||null==a||null==l)throw new Error("Cannot resolve a Slate range from DOM range: "+n);var d=uc.toSlatePoint(t,[i,a],{exactMatch:c,suppressThrow:f});if(!d)return null;var h=u?d:uc.toSlatePoint(t,[s,l],{exactMatch:c,suppressThrow:f});if(!h)return null;var p={anchor:d,focus:h};return o.isExpanded(p)&&o.isForward(p)&&Vu(s)&&e.void(t,{at:p.focus,mode:"highest"})&&(p=e.unhangRange(t,p,{voids:!0})),p},toSlatePoint:function(e,t,n){var r,o=n.exactMatch,i=n.suppressThrow,a=wa(o?t:qu(t),2),s=a[0],l=a[1],u=s.parentNode,f=null,d=0;if(u){var h=u.closest('[data-slate-void="true"]'),p=u.closest("[data-slate-leaf]"),g=null;if(p){f=p.closest('[data-slate-node="text"]');var v=uc.getWindow(e).document.createRange();v.setStart(f,0),v.setEnd(s,l);var y=v.cloneContents();xa(xa([],wa(c(y.querySelectorAll("[data-slate-zero-width]")))),wa(c(y.querySelectorAll("[contenteditable=false]")))).forEach((function(e){e.parentNode.removeChild(e)})),d=y.textContent.length,g=f}else h&&((p=h.querySelector("[data-slate-leaf]"))?(f=p.closest('[data-slate-node="text"]'),d=(g=p).textContent.length,g.querySelectorAll("[data-slate-zero-width]").forEach((function(e){d-=e.textContent.length}))):d=1);g&&d===g.textContent.length&&(u.hasAttribute("data-slate-zero-width")||rc&&(null===(r=g.textContent)||void 0===r?void 0:r.endsWith("\n")))&&d--}if(!f){if(i)return null;throw new Error("Cannot resolve a Slate point from DOM point: "+t)}var m=uc.toSlateNode(e,f);return{path:uc.findPath(e,m),offset:d}},hasRange:function(t,n){var r=n.anchor,o=n.focus;return e.hasPath(t,r.path)&&e.hasPath(t,o.path)},getNodeType:function(e){return i.isElement(e)?e.type:""},checkNodeType:function(e,t){return this.getNodeType(e)===t},getNodesStr:function(e){return e.map((function(e){return r.string(e)})).join("")},getSelectedElems:function(t){var n,r,o=[],a=e.nodes(t,{universal:!0});try{for(var s=ba(a),l=s.next();!l.done;l=s.next()){var u=wa(l.value,1)[0];i.isElement(u)&&o.push(u)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},getSelectedNodeByType:function(t,n){var r=this,o=wa(e.nodes(t,{match:function(e){return r.checkNodeType(e,n)},universal:!0}),1),i=o[0];return null==i?null:i[0]},getSelectedTextNode:function(t){var n=wa(e.nodes(t,{match:function(e){return a.isText(e)},universal:!0}),1),r=n[0];return null==r?null:r[0]},isNodeSelected:function(t,n){var r=wa(e.nodes(t,{match:function(e){return e===n},universal:!0}),1),o=r[0];return null!=o&&wa(o,1)[0]===n},isSelectionAtLineEnd:function(t,n){var r=t.selection;return!!r&&(e.isEnd(t,r.anchor,n)||e.isEnd(t,r.focus,n))},getTextarea:function(e){var t=ws.get(e);if(null==t)throw new Error("Cannot find textarea instance by editor");return t},getToolbar:function(e){return ks.get(e)||null},getHoverbar:function(e){return Os.get(e)||null},normalizeContent:function(e){e.children.forEach((function(t,n){e.normalizeNode([t,[n]])}))},getLeftLengthOfMaxLength:function(e){var t=e.getConfig(),n=t.maxLength,r=t.onMaxLength;if("number"!=typeof n||n<=0)return 1/0;var o=n-e.getText().replace(/\r|\n|(\r\n)/g,"").length;return o<=0&&r&&r(e),o},cleanExposedTexNodeInSelectionBlock:function(t){var n,r,o,a,s=uc.getTextarea(t).$textArea,l=null==s?void 0:s[0].childNodes;if(l)try{for(var u=ba(Array.from(l)),c=u.next();!c.done;c=u.next()){var d=c.value;if(3!==d.nodeType)break;d.remove()}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}var h=e.nodes(t,{match:function(e){return!(!i.isElement(e)||t.isInline(e))},universal:!0});try{for(var p=ba(h),g=p.next();!g.done;g=p.next()){var v=g.value;if(null!=v){var y=v[0];ec(uc.toDOMNode(t,y),(function(e,t){var n=f(t);n.attr("data-slate-string")||n.attr("data-slate-zero-width")||n.attr("data-w-e-reserve")||t.removeChild(e)}))}}}catch(e){o={error:e}}finally{try{g&&!g.done&&(a=p.return)&&a.call(p)}finally{if(o)throw o.error}}},isLastNode:function(e,t){var n=e.children||[];return n[n.length-1]===t},genEmptyParagraph:function(){return{type:"paragraph",children:[{text:""}]}},isSelectedVoidNode:function(t){var n,r,o=e.nodes(t,{match:function(e){return t.isVoid(e)}}),i=0;try{for(var a=ba(o),s=a.next();!s.done;s=a.next()){s.value;i++}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i>0},isSelectedEmptyParagraph:function(e){var t=e.selection;if(null==t)return!1;if(o.isExpanded(t))return!1;var n=uc.getSelectedNodeByType(e,"paragraph");if(null===n)return!1;var r=n.children;return 1===r.length&&(""===r[0].text||void 0)},isEmptyPath:function(t,n){var r=e.node(t,n);if(null==r)return!1;var o=wa(r,1)[0].children;if(1===o.length&&""===o[0].text)return!0;return!1}},cc=1,fc={};var dc={};function hc(e,t){var n=e.key,r=e.factory,o=e.config,i=ma(ma({},o),t||{});if(null!=dc[n])throw new Error("Duplicated key '"+n+"' in menu items");dc[n]=r,function(e,t){null!=t&&(fc[e]=t)}(n,i)}var pc=lr.filter,gc=yo("filter");Dn({target:"Array",proto:!0,forced:!gc},{filter:function(e){return pc(this,e,arguments.length>1?arguments[1]:void 0)}});var vc="\t\n\v\f\r \u2028\u2029\ufeff",yc=xe("".replace),mc="["+vc+"]",bc=RegExp("^"+mc+mc+"*"),wc=RegExp(mc+mc+"*$"),xc=function(e){return function(t){var n=Er(Le(t));return 1&e&&(n=yc(n,bc,"")),2&e&&(n=yc(n,wc,"")),n}},Sc={start:xc(1),end:xc(2),trim:xc(3)},kc=en.PROPER,Ec=Sc.trim;Dn({target:"String",proto:!0,forced:function(e){return le((function(){return!!vc[e]()||"
"!=="
"[e]()||kc&&vc[e].name!==e}))}("trim")},{trim:function(){return Ec(this)}});var Oc=[];function Cc(e){Oc.push(e)}var Tc={};function Nc(e){var t=e.type,n=e.elemToHtml;Tc[t||""]=n}function Lc(e,t,n){var r=n.isInline(e)?"span":"div";return"<"+r+">"+t+"</"+r+">"}function Mc(t,n){var r=t.type,o=void 0===r?"":r,i=t.children,a=void 0===i?[]:i,s=e.isVoid(n,t),l="";s||(l=a.map((function(e){return Pc(e,n)})).join(""));var u=function(e){return Tc[e]||Lc}(o),c=u(t,l,n),f="";if(f="string"==typeof c?c:c.html||"",s||Oc.forEach((function(e){return f=e(t,f)})),"string"==typeof c)return f;var d=c.prefix,h=void 0===d?"":d,p=c.suffix,g=void 0===p?"":p;return h&&(f=h+f),g&&(f+=g),f}function Pc(e,t){return i.isElement(e)?Mc(e,t):function(e,t){var n=e.text;if(null==n)throw new Error("Current node is not slate Text "+JSON.stringify(e));var r=n;r=function(e){return e.replace(/ {2}/g," ").replace(/</g,"<").replace(/>/g,">").replace(/®/g,"®").replace(/©/g,"©").replace(/™/g,"™")}(r);var o=uc.getParentsNodes(t,e).some((function(e){return"pre"===uc.getNodeType(e)}));if(o||(r=r.replace(/\r\n|\r|\n/g,"<br>")),o&&(r=r.replace(/ /g," ")),""===r){var i=uc.getParentNode(null,e);if(!i||0!==i.children.length)return r;r="<br>"}return Oc.forEach((function(t){return r=t(e,r)})),r}(e,t)}function Dc(e){return"w-e-element-"+e}var Rc=function(e,t){var n=(t.top+t.bottom)/2;return e.top<=n&&e.bottom>=n},jc=function(e,t,n){var r=uc.toDOMRange(e,t).getBoundingClientRect(),o=uc.toDOMRange(e,n).getBoundingClientRect();return Rc(r,o)&&Rc(o,r)},Ac=["span","b","strong","i","em","s","strike","u","font","sub","sup"],Ic=[];function Fc(e){Ic.push(e)}var Bc=[];function _c(e){Bc.push(e)}var $c={};function Wc(e){var t=e.selector,n=e.parseElemHtml;$c[t]=n}var Vc=Mt.f,zc=bn.f,Hc=Yt.enforce,Uc=pt("match"),Kc=se.RegExp,qc=Kc.prototype,Gc=se.SyntaxError,Jc=xe(Or),Yc=xe(qc.exec),Xc=xe("".charAt),Qc=xe("".replace),Zc=xe("".indexOf),ef=xe("".slice),tf=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,nf=/a/g,rf=/a/g,of=new Kc(nf)!==nf,af=No.MISSED_STICKY,sf=No.UNSUPPORTED_Y,lf=ue&&(!of||af||Mo||Do||le((function(){return rf[Uc]=!1,Kc(nf)!=nf||Kc(rf)==rf||"/a/i"!=Kc(nf,"i")})));if(Mn("RegExp",lf)){for(var uf=function(e,t){var n,r,o,i,a,s,l=je(qc,this),u=qo(e),c=void 0===t,f=[],d=e;if(!l&&u&&c&&e.constructor===uf)return e;if((u||je(qc,e))&&(e=e.source,c&&(t="flags"in d?d.flags:Jc(d))),e=void 0===e?"":Er(e),t=void 0===t?"":Er(t),d=e,Mo&&"dotAll"in nf&&(r=!!t&&Zc(t,"s")>-1)&&(t=Qc(t,/s/g,"")),n=t,af&&"sticky"in nf&&(o=!!t&&Zc(t,"y")>-1)&&sf&&(t=Qc(t,/y/g,"")),Do&&(i=function(e){for(var t,n=e.length,r=0,o="",i=[],a={},s=!1,l=!1,u=0,c="";r<=n;r++){if("\\"===(t=Xc(e,r)))t+=Xc(e,++r);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:Yc(tf,ef(e,r+1))&&(r+=2,l=!0),o+=t,u++;continue;case">"===t&&l:if(""===c||it(a,c))throw new Gc("Invalid capture group name");a[c]=!0,i[i.length]=[c,u],l=!1,c="";continue}l?c+=t:o+=t}return[o,i]}(e),e=i[0],f=i[1]),a=Ka(Kc(e,t),l?this:qc,uf),(r||o||f.length)&&(s=Hc(a),r&&(s.dotAll=!0,s.raw=uf(function(e){for(var t,n=e.length,r=0,o="",i=!1;r<=n;r++)"\\"!==(t=Xc(e,r))?i||"."!==t?("["===t?i=!0:"]"===t&&(i=!1),o+=t):o+="[\\s\\S]":o+=t+Xc(e,++r);return o}(e),n)),o&&(s.sticky=!0),f.length&&(s.groups=f)),e!==d)try{Pt(a,"source",""===d?"(?:)":d)}catch(e){}return a},cf=function(e){e in uf||Vc(uf,e,{configurable:!0,get:function(){return Kc[e]},set:function(t){Kc[e]=t}})},ff=zc(Kc),df=0;ff.length>df;)cf(ff[df++]);qc.constructor=uf,uf.prototype=qc,tn(se,"RegExp",uf)}tl("RegExp");var hf=new RegExp(String.fromCharCode(160),"g");function pf(e){return e.replace(hf," ")}function gf(e,t){var n=e.length;if(n){var r=e[n-1];if(a.isText(r)){var o=Object.keys(r);if(1===o.length&&"text"===o[0])return r.text=r.text+t,!0}}return!1}function vf(e,t,n){return{type:"paragraph",children:[{text:f(e).text().replace(/\s+/gm," ")}]}}function yf(t,n){var r=function(e,t){var n=[];if(null!=e.attr("data-w-e-is-void"))return n;var r=e[0].childNodes;return 1===r.length&&"BR"===r[0].nodeName?(n.push({text:""}),n):(r.forEach((function(e){if(e.nodeType!==Tu.ELEMENT_NODE)if(e.nodeType!==Tu.TEXT_NODE);else{var r=e.textContent||"";if(""===r.trim()&&r.indexOf("\n")>=0)return;r&&(r=pf(r),gf(n,r)||n.push({text:r}))}else{if("BR"===e.nodeName)return void(gf(n,"\n")||n.push({text:"\n"}));var o=bf(f(e),t);Array.isArray(o)?o.forEach((function(e){return n.push(e)})):n.push(o)}})),n)}(t,n),o=function(e){for(var t in $c)if(e[0].matches(t))return $c[t];return vf}(t),i=o(t[0],r,n);return Array.isArray(i)||(i=[i]),i.forEach((function(o){e.isVoid(n,o)||(0===r.length&&(o.children=[{text:t.text().replace(/\s+/gm," ")}]),Bc.forEach((function(e){o=e(t[0],o,n)})))})),i}function mf(e,t){0===e.parents("pre").length&&(e[0].innerHTML=e[0].innerHTML.replace(/\s+/gm," ").replace(/<br>/g,"\n"));var n=e[0].textContent||"";n=function(e){return e.replace(/ /g," ").replace(/</g,"<").replace(/>/g,">").replace(/®/g,"®").replace(/©/g,"©").replace(/™/g,"™").replace(/"/g,'"')}(n);var r={text:n=pf(n)};return Bc.forEach((function(n){r=n(e[0],r,t)})),r}function bf(e,t){Ic.forEach((function(t){var n=t.selector,r=t.preParseHtml;e[0].matches(n)&&(e=f(r(e[0])))}));var n=tc(e);if("span"===n){if(e.attr("data-w-e-type"))return yf(e,t);if(e[0].childNodes.length>1){var r=e[0].childNodes;return Array.from(r).map((function(n){return f(e[0]).empty(),f(e[0]).append(f(n)),mf(f(e[0]),t)}))}return mf(e,t)}return"code"===n?"pre"===tc(e.parent())?yf(e,t):mf(e,t):Ac.includes(n)?mf(e,t):yf(e,t)}var wf=No.UNSUPPORTED_Y,xf=4294967295,Sf=Math.min,kf=[].push,Ef=xe(/./.exec),Of=xe(kf),Cf=xe("".slice);function Tf(e,t,n){var r=f(n);return!!r.attr(t)||(r.attr(t,"true"),e.on("destroyed",(function(){r.removeAttr(t)})),!1)}function Nf(e,t){void 0===t&&(t="");var n=[];""===t&&(t="<p><br></p>"),0!==t.indexOf("<")&&(t=t.split(/\n/).map((function(e){return"<p>"+e+"</p>"})).join(""));var r=f("<div>"+t+"</div>");return Array.from(r.children()).forEach((function(t){var r=bf(f(t),e);Array.isArray(r)?r.forEach((function(e){return n.push(e)})):n.push(r)})),n}Ki("split",(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=Er(Le(this)),o=void 0===n?xf:n>>>0;if(0===o)return[];if(void 0===e)return[r];if(!qo(e))return fe(t,r,e,o);for(var i,a,s,l=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),c=0,f=new RegExp(e.source,u+"g");(i=fe(Ho,f,r))&&!((a=f.lastIndex)>c&&(Of(l,Cf(r,c,i.index)),i.length>1&&i.index<r.length&&zi(kf,l,Pa(i,1)),s=i[0].length,c=a,l.length>=o));)f.lastIndex===i.index&&f.lastIndex++;return c===r.length?!s&&Ef(f,"")||Of(l,""):Of(l,Cf(r,c)),l.length>o?Pa(l,0,o):l}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:fe(t,this,e,n)}:t,[function(t,n){var o=Le(this),i=null==t?void 0:Je(t,e);return i?fe(i,t,o,n):fe(r,Er(o),t,n)},function(e,o){var i=Tt(this),a=Er(e),s=n(r,i,a,o,r!==t);if(s.done)return s.value;var l=ol(i,RegExp),u=i.unicode,c=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(wf?"g":"y"),f=new l(wf?"^(?:"+i.source+")":i,c),d=void 0===o?xf:o>>>0;if(0===d)return[];if(0===a.length)return null===ra(f,a)?[a]:[];for(var h=0,p=0,g=[];p<a.length;){f.lastIndex=wf?0:p;var v,y=ra(f,wf?Cf(a,p):a);if(null===y||(v=Sf(cn(f.lastIndex+(wf?p:0)),a.length))===h)p=Gi(a,p,u);else{if(Of(g,Cf(a,h,p)),g.length===d)return g;for(var m=1;m<=y.length-1;m++)if(Of(g,y[m]),g.length===d)return g;p=h=v}}return Of(g,Cf(a,h)),g}]}),!!le((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),wf);var Lf=Mt.f,Mf=_a.fastKey,Pf=Yt.set,Df=Yt.getterFor,Rf={getConstructor:function(e,t,n,r){var o=e((function(e,o){Ua(e,i),Pf(e,{type:t,index:so(null),first:void 0,last:void 0,size:0}),ue||(e.size=0),null!=o&&za(o,e[r],{that:e,AS_ENTRIES:n})})),i=o.prototype,a=Df(t),s=function(e,t,n){var r,o,i=a(e),s=l(e,t);return s?s.value=n:(i.last=s={index:o=Mf(t,!0),key:t,value:n,previous:r=i.last,next:void 0,removed:!1},i.first||(i.first=s),r&&(r.next=s),ue?i.size++:e.size++,"F"!==o&&(i.index[o]=s)),e},l=function(e,t){var n,r=a(e),o=Mf(t);if("F"!==o)return r.index[o];for(n=r.first;n;n=n.next)if(n.key==t)return n};return Na(i,{clear:function(){for(var e=a(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete t[n.index],n=n.next;e.first=e.last=void 0,ue?e.size=0:this.size=0},delete:function(e){var t=this,n=a(t),r=l(t,e);if(r){var o=r.next,i=r.previous;delete n.index[r.index],r.removed=!0,i&&(i.next=o),o&&(o.previous=i),n.first==r&&(n.first=o),n.last==r&&(n.last=i),ue?n.size--:t.size--}return!!r},forEach:function(e){for(var t,n=a(this),r=qn(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!l(this,e)}}),Na(i,n?{get:function(e){var t=l(this,e);return t&&t.value},set:function(e,t){return s(this,0===e?0:e,t)}}:{add:function(e){return s(this,e=0===e?0:e,e)}}),ue&&Lf(i,"size",{get:function(){return a(this).size}}),o},setStrong:function(e,t,n){var r=t+" Iterator",o=Df(t),i=Df(r);ji(e,t,(function(e,t){Pf(this,{type:r,target:e,state:o(e),kind:t,last:void 0})}),(function(){for(var e=i(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?"keys"==t?{value:n.key,done:!1}:"values"==t?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),n?"entries":"values",!n,!0),tl(t)}};qa("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),Rf);var jf=new Set(["doctype","!doctype","meta","script","style","link","frame","iframe","title","svg"]);function Af(e,t){e.isInline(t)?(e.insertNode(t),"link"===t.type&&e.insertFragment([{text:""}])):s.insertNodes(e,t,{mode:"highest"})}var If=function(t){var l=t,u=l.onChange,c=l.insertText,d=l.apply,h=l.deleteBackward;return l.insertText=function(e){l.getConfig().readOnly||c(e)},l.apply=function(t){var r,o,i,a,s,u,c,f,h=[];switch(t.type){case"insert_text":case"remove_text":case"set_node":try{for(var p=ba(e.levels(l,{at:t.path})),g=p.next();!g.done;g=p.next()){var v=wa(g.value,2),y=v[0],m=v[1],b=uc.findKey(l,y);h.push([m,b])}}catch(e){r={error:e}}finally{try{g&&!g.done&&(o=p.return)&&o.call(p)}finally{if(r)throw r.error}}break;case"insert_node":case"remove_node":case"merge_node":case"split_node":try{for(var w=ba(e.levels(l,{at:n.parent(t.path)})),x=w.next();!x.done;x=w.next()){var S=wa(x.value,2);y=S[0],m=S[1],b=uc.findKey(l,y);h.push([m,b])}}catch(e){i={error:e}}finally{try{x&&!x.done&&(a=w.return)&&a.call(w)}finally{if(i)throw i.error}}break;case"move_node":try{for(var k=ba(e.levels(l,{at:n.common(n.parent(t.path),n.parent(t.newPath))})),E=k.next();!E.done;E=k.next()){var O=wa(E.value,2);y=O[0],m=O[1],b=uc.findKey(l,y);h.push([m,b])}}catch(e){s={error:e}}finally{try{E&&!E.done&&(u=k.return)&&u.call(k)}finally{if(s)throw s.error}}}d(t);try{for(var C=ba(h),T=C.next();!T.done;T=C.next()){var N=wa(T.value,2);m=N[0],b=N[1],y=wa(e.node(l,m),1)[0];_s.set(y,b)}}catch(e){c={error:e}}finally{try{T&&!T.done&&(f=C.return)&&f.call(C)}finally{if(c)throw c.error}}},l.deleteBackward=function(n){if("line"!==n)return h(n);if(t.selection&&o.isCollapsed(t.selection)){var r=e.above(t,{match:function(n){return e.isBlock(t,n)},at:t.selection});if(r){var i=wa(r,2)[1],a=e.range(t,i,t.selection.anchor),u=function(t,n){var r=e.range(t,o.end(n)),i=Array.from(e.positions(t,{at:n})),a=0,s=i.length,l=Math.floor(s/2);if(jc(t,e.range(t,i[a]),r))return e.range(t,i[a],r);if(i.length<2)return e.range(t,i[i.length-1],r);for(;l!==i.length&&l!==a;)jc(t,e.range(t,i[l]),r)?s=l:a=l,l=Math.floor((a+s)/2);return e.range(t,i[s],r)}(l,a);o.isCollapsed(u)||s.delete(t,{at:u})}}},l.onChange=function(){var e=l.selection;null!=e&&Vs.set(l,e),l.emit("change"),u()},l.handleTab=function(){l.insertText(" ")},l.getHtml=function(){var e=l.children;return(void 0===e?[]:e).map((function(e){return Pc(e,l)})).join("")},l.getText=function(){var e=l.children;return(void 0===e?[]:e).map((function(e){return r.string(e)})).join("\n")},l.getSelectionText=function(){var n=l.selection;return null==n?"":e.string(t,n)},l.getElemsByType=function(t,n){var r,o;void 0===n&&(n=!1);var a=[],s=e.nodes(l,{at:[],universal:!0});try{for(var u=ba(s),c=u.next();!c.done;c=u.next()){var f=wa(c.value,1)[0];if(i.isElement(f))if(n?f.type.indexOf(t)>=0:f.type===t){var d=Dc(uc.findKey(l,f).id);a.push(ma(ma({},f),{id:d}))}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}return a},l.getElemsByTypePrefix=function(e){return l.getElemsByType(e,!0)},l.isEmpty=function(){var e=l.children,t=void 0===e?[]:e;if(t.length>1)return!1;var n=t[0];if(null==n)return!0;if(i.isElement(n)&&"paragraph"===n.type){var r=n.children,o=void 0===r?[]:r;if(o.length>1)return!1;var s=o[0];if(null==s)return!0;if(a.isText(s)&&""===s.text)return!0}return!1},l.clear=function(){s.delete(l,{at:{anchor:e.start(l,[]),focus:e.end(l,[])}}),0===l.children.length&&s.insertNodes(l,[{type:"paragraph",children:[{text:""}]}])},l.getParentNode=function(e){return uc.getParentNode(l,e)},l.dangerouslyInsertHtml=function(e,t){if(void 0===e&&(e=""),void 0===t&&(t=!1),e){var n=document.createElement("div");n.innerHTML=e;var r=Array.from(n.childNodes);if(r=r.filter((function(e){var t=e.nodeType,n=e.nodeName;return t===Tu.TEXT_NODE||t===Tu.ELEMENT_NODE&&!jf.has(n.toLowerCase())})),0!==r.length){var o=l.selection;if(null!=o){var i=null;if(uc.isSelectedEmptyParagraph(l)&&!t)i=[o.focus.path[0]];n.setAttribute("hidden","true"),document.body.appendChild(n);var a=0;r.forEach((function(e,t){var n=e.nodeType,o=e.nodeName,i=e.textContent,s=void 0===i?"":i;if(n!==Tu.TEXT_NODE)if("BR"!==o){var u=e,c=!1;if(Ac.includes(o.toLowerCase()))c=!0;else for(var d in $c)if(u.matches(d)){c=!0;break}if(c){var h=bf(f(u),l);return Array.isArray(h)?(h.forEach((function(e){return Af(l,e)})),a++):(Af(l,h),a++),void(uc.isSelectedVoidNode(l)&&l.move(1))}var p=window.getComputedStyle(u).display;if(!uc.isSelectedEmptyParagraph(l)&&p.indexOf("inline")<0){if(t>=1){var g=r[t-1];"matches"in g&&g.matches("ul:not([data-w-e-type]),ol:not([data-w-e-type])")&&l.insertBreak()}l.insertBreak()}l.dangerouslyInsertHtml(u.innerHTML,!0)}else l.insertText("\n");else{if(!s||!s.trim())return;l.insertNode({text:s})}})),a&&i&&uc.isEmptyPath(l,i)&&s.removeNodes(l,{at:i}),n.remove()}}}},l.setHtml=function(t){void 0===t&&(t="");var n=l.isDisabled(),r=l.isFocused(),o=JSON.stringify(l.selection);l.enable(),l.focus(),l.clear();var i=Nf(l,null==t?"":t);if(s.insertFragment(l,i),r||(l.deselect(),l.blur()),n&&(l.deselect(),l.disable()),l.isFocused())try{l.select(JSON.parse(o))}catch(t){l.select(e.start(l,[]))}},l},Ff=function(e){return null!=e},Bf={object:!0,function:!0,undefined:!0},_f=function(e){if(!function(e){return!!Ff(e)&&hasOwnProperty.call(Bf,typeof e)}(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(e){return!1}},$f=/^\s*class[\s{/}]/,Wf=Function.prototype.toString,Vf=function(e){return!!function(e){if("function"!=typeof e)return!1;if(!hasOwnProperty.call(e,"length"))return!1;try{if("number"!=typeof e.length)return!1;if("function"!=typeof e.call)return!1;if("function"!=typeof e.apply)return!1}catch(e){return!1}return!_f(e)}(e)&&!$f.test(Wf.call(e))},zf=function(e){return null!=e},Hf=Object.keys,Uf=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}()?Object.keys:function(e){return Hf(zf(e)?Object(e):e)},Kf=Math.max,qf=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}()?Object.assign:function(e,t){var n,r,o,i=Kf(arguments.length,2);for(e=Object(function(e){if(!zf(e))throw new TypeError("Cannot use null or undefined");return e}(e)),o=function(r){try{e[r]=t[r]}catch(e){n||(n=e)}},r=1;r<i;++r)Uf(t=arguments[r]).forEach(o);if(void 0!==n)throw n;return e},Gf=Array.prototype.forEach,Jf=Object.create,Yf=function(e){var t=Jf(null);return Gf.call(arguments,(function(e){zf(e)&&function(e,t){var n;for(n in e)t[n]=e[n]}(Object(e),t)})),t},Xf="razdwatrzy",Qf=String.prototype.indexOf,Zf="function"==typeof Xf.contains&&!0===Xf.contains("dwa")&&!1===Xf.contains("foo")?String.prototype.contains:function(e){return Qf.call(this,e,arguments[1])>-1},ed=re((function(e){var t=e.exports=function(e,t){var n,r,o,i,a;return arguments.length<2||"string"!=typeof e?(i=t,t=e,e=null):i=arguments[2],Ff(e)?(n=Zf.call(e,"c"),r=Zf.call(e,"e"),o=Zf.call(e,"w")):(n=o=!0,r=!1),a={value:t,configurable:n,enumerable:r,writable:o},i?qf(Yf(i),a):a};t.gs=function(e,t,n){var r,o,i,a;return"string"!=typeof e?(i=n,n=t,t=e,e=null):i=arguments[3],Ff(t)?Vf(t)?Ff(n)?Vf(n)||(i=n,n=void 0):n=void 0:(i=t,t=n=void 0):t=void 0,Ff(e)?(r=Zf.call(e,"c"),o=Zf.call(e,"e")):(r=!0,o=!1),a={get:t,set:n,configurable:r,enumerable:o},i?qf(Yf(i),a):a}})),td=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},nd=re((function(e,t){var n,r,o,i,a,s,l,u=Function.prototype.apply,c=Function.prototype.call,f=Object.create,d=Object.defineProperty,h=Object.defineProperties,p=Object.prototype.hasOwnProperty,g={configurable:!0,enumerable:!1,writable:!0};n=function(e,t){var n;return td(t),p.call(this,"__ee__")?n=this.__ee__:(n=g.value=f(null),d(this,"__ee__",g),g.value=null),n[e]?"object"==typeof n[e]?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},r=function(e,t){var r,i;return td(t),i=this,n.call(this,e,r=function(){o.call(i,e,r),u.call(t,this,arguments)}),r.__eeOnceListener__=t,this},o=function(e,t){var n,r,o,i;if(td(t),!p.call(this,"__ee__"))return this;if(!(n=this.__ee__)[e])return this;if("object"==typeof(r=n[e]))for(i=0;o=r[i];++i)o!==t&&o.__eeOnceListener__!==t||(2===r.length?n[e]=r[i?0:1]:r.splice(i,1));else r!==t&&r.__eeOnceListener__!==t||delete n[e];return this},i=function(e){var t,n,r,o,i;if(p.call(this,"__ee__")&&(o=this.__ee__[e]))if("object"==typeof o){for(n=arguments.length,i=new Array(n-1),t=1;t<n;++t)i[t-1]=arguments[t];for(o=o.slice(),t=0;r=o[t];++t)u.call(r,this,i)}else switch(arguments.length){case 1:c.call(o,this);break;case 2:c.call(o,this,arguments[1]);break;case 3:c.call(o,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,i=new Array(n-1),t=1;t<n;++t)i[t-1]=arguments[t];u.call(o,this,i)}},a={on:n,once:r,off:o,emit:i},s={on:ed(n),once:ed(r),off:ed(o),emit:ed(i)},l=h({},s),e.exports=t=function(e){return null==e?f(l):h(Object(e),s)},t.methods=a}));function rd(e){var t=zs.get(e);return null==t&&(t=nd(),zs.set(e,t)),t}var od=new WeakMap;function id(e,t){var n=od.get(e);null==n&&(n=new Set,od.set(e,n)),n.add(t)}var ad=function(e){var t=e;return t.on=function(e,n){var r=rd(t);if(r.on(e,n),"destroyed"===e&&id(t,n),"destroyed"!==e){var o=function(){return r.off(e,n)};r.on("destroyed",o),id(t,o)}},t.once=function(e,n){rd(t).once(e,n)},t.off=function(e,n){rd(t).off(e,n)},t.emit=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=rd(t);if(o.emit.apply(o,xa([e],wa(n))),"destroyed"===e){var i=function(e){return od.get(e)||new Set}(t);i.forEach((function(e){return o.off("destroyed",e)})),function(e){od.set(e,new Set)}(t)}},t};function sd(e){var t=uc.getTextarea(e).$textAreaContainer,n=t.width(),r=t.height(),o=t.offset();return{top:o.top,left:o.left,width:n,height:r}}function ld(e){var t={top:"0",left:"0"},n=e.selection;if(null==n)return t;var r=sd(e);if(null==r)return t;var o=r.top,i=r.left,a=r.width,s=r.height,l=uc.toDOMRange(e,n).getClientRects()[0];if(null==l)return t;l.width;var u=l.height,c={},f=l.top-o,d=l.left-i;if(d>a/2){var h=a-d;c.right=h+5+"px"}else c.left=d+5+"px";if(f>s/2){var p=s-f;c.bottom=p+5+"px"}else{var g=f+u;g<0&&(g=0),c.top=g+5+"px"}return c}function ud(e,t,n){void 0===n&&(n="modal");var r={top:"0",left:"0"};if(null==e.selection)return r;var o=i.isElement(t)&&e.isVoid(t),a=i.isElement(t)&&e.isInline(t),s=Bs.get(t);if(null==s)return r;var l=s.getBoundingClientRect(),u=l.top,c=l.left,f=l.height,d=l.width;if(o){var h=Zu(s);if(null!=h){var p=h.getBoundingClientRect();u=p.top,f=p.height}}var g=sd(e);if(null==g)return r;var v=g.top,y=g.left,m=g.width,b=g.height,w={},x=u-v,S=c-y;if("bar"===n)return w.left=S+"px",x>40?w.bottom=b-x+5+"px":w.top=x+f+5+"px",w;if("modal"===n){var k;if(o?a?S>(m-d)/2?w.right=m-S+5+"px":w.left=S+d+5+"px":w.left="20px":w.left=S+"px",o)(k=x)<0&&(k=0),w.top=k+"px";else if(x>(b-f)/2)w.bottom=b-x+5+"px";else(k=x+f)<0&&(k=0),w.top=k+5+"px";return w}throw new Error("type '"+n+"' is invalid")}function cd(e,t){Ou((function(){var n=sd(e);if(null!=n){var r,o=n.top,i=n.left,a=n.width,s=n.height,l=t.offset(),u=l.top,c=l.left,f=t.width(),d=t.height(),h=u-o,p=c-i,g=t.attr("style");if(g.indexOf("top")>=0)if((r=h+d-s)>0){var v=t.css("top"),y=parseInt(v.toString())-r;y<0&&(y=0),t.css("top",y+"px")}if(g.indexOf("bottom")>=0&&u<0){var m=t.css("bottom"),b=parseInt(m.toString())-Math.abs(u);t.css("bottom",b+"px")}if(g.indexOf("left")>=0)if((r=p+f-a)>0){var w=t.css("left"),x=parseInt(w.toString())-r;x<0&&(x=0),t.css("left",x+"px")}if(g.indexOf("right")>=0&&c<0){var S=t.css("right"),k=parseInt(S.toString())-Math.abs(c);t.css("right",k+"px")}}}))}var fd=yo("slice"),dd=pt("species"),hd=se.Array,pd=Math.max;Dn({target:"Array",proto:!0,forced:!fd},{slice:function(e,t){var n,r,o,i=Me(this),a=fn(i),s=ln(e,a),l=ln(void 0===t?a:t,a);if(Gn(i)&&(n=i.constructor,(nr(n)&&(n===hd||Gn(n.prototype))||De(n)&&null===(n=n[dd]))&&(n=void 0),n===hd||void 0===n))return il(i,s,l);for(r=new(void 0===n?hd:n)(pd(l-s,0)),o=0;s<l;s++,o++)s in i&&_r(r,o,i[s]);return r.length=o,r}});var gd=Object.assign,vd=Object.defineProperty,yd=xe([].concat),md=!gd||le((function(){if(ue&&1!==gd({b:1},gd(vd({},"a",{enumerable:!0,get:function(){vd(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=gd({},e)[n]||Rn(gd({},t)).join("")!=r}))?function(e,t){for(var n=rt(e),r=arguments.length,o=1,i=wn.f,a=ge.f;r>o;)for(var s,l=Te(arguments[o++]),u=i?yd(Rn(l),i(l)):Rn(l),c=u.length,f=0;c>f;)s=u[f++],ue&&!fe(a,l,s)||(n[s]=l[s]);return n}:gd;Dn({target:"Object",stat:!0,forced:Object.assign!==md},{assign:md});var bd=Et.f,wd=xe("".startsWith),xd=xe("".slice),Sd=Math.min,kd=Xo("startsWith"),Ed=!kd&&!!function(){var e=bd(String.prototype,"startsWith");return e&&!e.writable}();Dn({target:"String",proto:!0,forced:!Ed&&!kd},{startsWith:function(e){var t=Er(Le(this));Jo(e);var n=cn(Sd(arguments.length>1?arguments[1]:void 0,t.length)),r=Er(e);return wd?wd(t,r,n):xd(t,n,n+r.length)===r}});var Od=["props","attrs","style","dataset","on","hook"];function Cd(e){var t=e.data,n=void 0===t?{}:t,r=e.children,o=void 0===r?[]:r;Object.keys(n).forEach((function(t){var r,o,i=n[t];if("key"!==t){if(!Od.includes(t)){if(t.startsWith("data-")){var a=t.slice(5);return a=J(a),function(e,t){null==e.data&&(e.data={});var n=e.data;null==n.dataset&&(n.dataset={});Object.assign(n.dataset,t)}(e,((r={})[a]=i,r)),void delete n[t]}!function(e,t){null==e.data&&(e.data={});var n=e.data;null==n.props&&(n.props={});Object.assign(n.props,t)}(e,(o={},o[t]=i,o)),delete n[t]}}else e.key=i})),o.length>0&&o.forEach((function(e){"string"!=typeof e&&Cd(e)}))}var Td=[];function Nd(e){Td.push(e)}var Ld={};function Md(e){var t=e.type,n=e.renderElem;Ld[t||""]=n}function Pd(e,t,n){var r=n.isInline(e)?"span":"div";return q(r,null,t)}function Dd(t,n){var o,i=uc.findKey(n,t),a=n.isInline(t),s=e.isVoid(n,t),l=Dc(i.id),u={id:l,key:i.id,"data-slate-node":"element","data-slate-inline":a},c=t.type,f=t.children,d=void 0===f?[]:f,h=function(e){return Ld[e]||Pd}(c);o=s?null:d.map((function(e,r){return Id(e,r,t,n)}));var p=h(t,o,n);if(s){u["data-slate-void"]=!0;var g=a?"span":"div",v=wa(r.texts(t),1),y=wa(v[0],1)[0],m=Id(y,0,t,n),b=q(g,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},m);p=q(g,{style:{position:"relative"}},p,b),Rs.set(y,0),js.set(y,t)}return null==p.data&&(p.data={}),Object.assign(p.data,u),s||a||(p=function(e,t){var n=t;return Td.forEach((function(r){n=r(e,t)})),n}(t,p)),Ou((function(){var e=Ju(l);null!=e&&(Fs.set(i,e),Bs.set(t,e),Is.set(e,t))})),p}function Rd(e,t){return void 0===t&&(t=!1),q("span",{"data-slate-string":!0},t?e+"\n":e)}function jd(e,t){return void 0===e&&(e=0),void 0===t&&(t=!1),q("span",{"data-slate-zero-width":t?"n":"z","data-slate-length":e},"\ufeff",t?q("br",null):null)}function Ad(t,o,i){if(null==t.text)throw new Error("Current node is not slate Text "+JSON.stringify(t));var s=uc.findKey(i,t),l=i.getConfig().decorate;if(null==l)throw new Error("Can not get config.decorate");var u=uc.findPath(i,t),c=l([t,u]),f=a.decorations(t,c),d=f.map((function(a,s){var l=function(t,o,i,a,s){void 0===o&&(o=!1);var l=t.text,u=uc.findPath(s,i),c=n.parent(u);if(e.isEditor(a))throw new Error("Text node "+JSON.stringify(i)+" parent is Editor");return s.isVoid(a)?jd(r.string(a).length):""!==l||a.children[a.children.length-1]!==i||s.isInline(a)||""!==e.string(s,c)?""===l?jd():o&&"\n"===l.slice(-1)?Rd(l,!0):Rd(l):jd(0,!0)}(a,s===f.length-1,t,o,i);return l=function(e,t){var n=t;return Td.forEach((function(t){n=t(e,n)})),n}(a,l),q("span",{"data-slate-leaf":!0},l)})),h=function(e){return"w-e-text-"+e}(s.id),p=q("span",{"data-slate-node":"text",id:h,key:s.id},d);return Ou((function(){var e=Ju(h);null!=e&&(Fs.set(s,e),Bs.set(t,e),Is.set(e,t))})),p}function Id(e,t,n,r){return Rs.set(e,t),js.set(e,n),i.isElement(e)?Dd(e,r):Ad(e,n,r)}function Fd(e,t){var n,r=e.$scroll,o=function(e){return"w-e-textarea-"+e}(e.id),i=t.getConfig(),a=i.readOnly,s=i.autoFocus,l=function(e,t){return void 0===t&&(t=!1),G("div#"+e,{props:{contentEditable:!t}})}(o,a),u=t.children||[];l.children=u.map((function(e,n){var r=Id(e,n,t,t);return Cd(r),r}));var c=Ms.get(e);if(null==c&&(c=!0),c){var d=function(e){return f('<div\n id="'+e+'"\n data-slate-editor\n data-slate-node="value"\n suppressContentEditableWarning\n role="textarea"\n spellCheck="true"\n autoCorrect="true"\n autoCapitalize="true"\n ></div>')}(o);r.append(d),e.$textArea=d,n=d[0],(p=$([W,V,z,H,U,K]))(n,l),Ms.set(e,!1),Ps.set(e,p)}else{var h=Ds.get(e),p=Ps.get(e);if(null==h||null==p)return;n=h.elm,p(h,l)}if(null!=n||null!=(n=Ju(o))){if((c?s:t.isFocused())&&n.focus({preventScroll:!0}),c){var g=$u(n);g&&$s.set(t,g)}As.set(t,n),Bs.set(t,n),Is.set(n,t),Ds.set(e,l)}}function Bd(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function _d(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function $d(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var n=getComputedStyle(e,null);return _d(n.overflowY,t)||_d(n.overflowX,t)||function(e){var t=function(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}}(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)}(e)}return!1}function Wd(e,t,n,r,o,i,a,s){return i<e&&a>t||i>e&&a<t?0:i<=e&&s<=n||a>=t&&s>=n?i-e-r:a>t&&s<n||i<e&&s>n?a-t+o:0}var Vd=function(e,t){var n=window,r=t.scrollMode,o=t.block,i=t.inline,a=t.boundary,s=t.skipOverflowHiddenElements,l="function"==typeof a?a:function(e){return e!==a};if(!Bd(e))throw new TypeError("Invalid target");for(var u,c,f=document.scrollingElement||document.documentElement,d=[],h=e;Bd(h)&&l(h);){if((h=null==(c=(u=h).parentElement)?u.getRootNode().host||null:c)===f){d.push(h);break}null!=h&&h===document.body&&$d(h)&&!$d(document.documentElement)||null!=h&&$d(h,s)&&d.push(h)}for(var p=n.visualViewport?n.visualViewport.width:innerWidth,g=n.visualViewport?n.visualViewport.height:innerHeight,v=window.scrollX||pageXOffset,y=window.scrollY||pageYOffset,m=e.getBoundingClientRect(),b=m.height,w=m.width,x=m.top,S=m.right,k=m.bottom,E=m.left,O="start"===o||"nearest"===o?x:"end"===o?k:x+b/2,C="center"===i?E+w/2:"end"===i?S:E,T=[],N=0;N<d.length;N++){var L=d[N],M=L.getBoundingClientRect(),P=M.height,D=M.width,R=M.top,j=M.right,A=M.bottom,I=M.left;if("if-needed"===r&&x>=0&&E>=0&&k<=g&&S<=p&&x>=R&&k<=A&&E>=I&&S<=j)return T;var F=getComputedStyle(L),B=parseInt(F.borderLeftWidth,10),_=parseInt(F.borderTopWidth,10),$=parseInt(F.borderRightWidth,10),W=parseInt(F.borderBottomWidth,10),V=0,z=0,H="offsetWidth"in L?L.offsetWidth-L.clientWidth-B-$:0,U="offsetHeight"in L?L.offsetHeight-L.clientHeight-_-W:0,K="offsetWidth"in L?0===L.offsetWidth?0:D/L.offsetWidth:0,q="offsetHeight"in L?0===L.offsetHeight?0:P/L.offsetHeight:0;if(f===L)V="start"===o?O:"end"===o?O-g:"nearest"===o?Wd(y,y+g,g,_,W,y+O,y+O+b,b):O-g/2,z="start"===i?C:"center"===i?C-p/2:"end"===i?C-p:Wd(v,v+p,p,B,$,v+C,v+C+w,w),V=Math.max(0,V+y),z=Math.max(0,z+v);else{V="start"===o?O-R-_:"end"===o?O-A+W+U:"nearest"===o?Wd(R,A,P,_,W+U,O,O+b,b):O-(R+P/2)+U/2,z="start"===i?C-I-B:"center"===i?C-(I+D/2)+H/2:"end"===i?C-j+$+H:Wd(I,j,D,B,$+H,C,C+w,w);var G=L.scrollLeft,J=L.scrollTop;O+=J-(V=Math.max(0,Math.min(J+V/q,L.scrollHeight-P/q+U))),C+=G-(z=Math.max(0,Math.min(G+z/K,L.scrollWidth-D/K+H)))}T.push({el:L,top:V,left:z})}return T};function zd(e){return e===Object(e)&&0!==Object.keys(e).length}function Hd(e,t){var n=e.isConnected||e.ownerDocument.documentElement.contains(e);if(zd(t)&&"function"==typeof t.behavior)return t.behavior(n?Vd(e,t):[]);if(n){var r=function(e){return!1===e?{block:"end",inline:"nearest"}:zd(e)?e:{block:"start",inline:"nearest"}}(t);return function(e,t){void 0===t&&(t="auto");var n="scrollBehavior"in document.body.style;e.forEach((function(e){var r=e.el,o=e.top,i=e.left;r.scroll&&n?r.scroll({top:o,left:i,behavior:t}):(r.scrollTop=o,r.scrollLeft=i)}))}(Vd(e,r),r.behavior)}}function Ud(e,t){return zu(t)&&uc.hasDOMNode(e,t,{editable:!0})}function Kd(t,n){if(t.getConfig().readOnly)return!1;var r=qd(t,n)&&uc.toSlateNode(t,n);return e.isVoid(t,r)}function qd(e,t){return zu(t)&&uc.hasDOMNode(e,t)}function Gd(e,t,n){void 0===n&&(n=!1);var r=t.selection,i=t.getConfig(),a=uc.findDocumentOrShadowRoot(t).getSelection();if(a&&(!e.isComposing||n)&&t.isFocused()){var s="None"!==a.type;if(r||s){var l=As.get(t),u=!1;if(l.contains(a.anchorNode)&&l.contains(a.focusNode)&&(u=!0),s&&u&&r){var c=uc.toSlateRange(t,a,{exactMatch:!0,suppressThrow:!0});if(c&&o.equals(c,r)){var f=!0;if(o.isCollapsed(r)){var d=a.anchorNode,h=a.anchorOffset;if(d===l){var p=l.childNodes,g=void 0;(g=p[h])&&g.matches("table")&&(f=!1),(g=p[h-1])&&g.matches("table")&&(f=!1)}}if(f)return}}if(!r||uc.hasRange(t,r)){e.isUpdatingSelection=!0;var v=r&&uc.toDOMRange(t,r);if(v){o.isBackward(r)?a.setBaseAndExtent(v.endContainer,v.endOffset,v.startContainer,v.startOffset):a.setBaseAndExtent(v.startContainer,v.startOffset,v.endContainer,v.endOffset);var y=v.startContainer.parentElement;if(!y.closest("[data-slate-spacer]")){y.getBoundingClientRect=v.getBoundingClientRect.bind(v);var m=document.body;Hd(y,{scrollMode:"if-needed",boundary:i.scroll?l.parentElement:m,block:"end",behavior:"smooth"}),delete y.getBoundingClientRect}}else a.removeAllRanges();setTimeout((function(){v&&rc&&l.focus(),e.isUpdatingSelection=!1}))}else t.selection=uc.toSlateRange(t,a,{exactMatch:!1,suppressThrow:!1})}}}var Jd=new WeakMap,Yd=new WeakMap;var Xd={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",splitBlock:"shift?+enter",undo:"mod+z",tab:"tab",selectAll:"mod+a"},Qd={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},Zd={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},eh=function(e){var t=Xd[e],n=Qd[e],r=Zd[e],o=t&&Y(t),i=n&&Y(n),a=r&&Y(r);return function(e){return!(!o||!o(e))||(!!(nc&&i&&i(e))||!(nc||!a||!a(e)))}},th={isBold:eh("bold"),isCompose:eh("compose"),isMoveBackward:eh("moveBackward"),isMoveForward:eh("moveForward"),isDeleteBackward:eh("deleteBackward"),isDeleteForward:eh("deleteForward"),isDeleteLineBackward:eh("deleteLineBackward"),isDeleteLineForward:eh("deleteLineForward"),isDeleteWordBackward:eh("deleteWordBackward"),isDeleteWordForward:eh("deleteWordForward"),isExtendBackward:eh("extendBackward"),isExtendForward:eh("extendForward"),isExtendLineBackward:eh("extendLineBackward"),isExtendLineForward:eh("extendLineForward"),isItalic:eh("italic"),isMoveLineBackward:eh("moveLineBackward"),isMoveLineForward:eh("moveLineForward"),isMoveWordBackward:eh("moveWordBackward"),isMoveWordForward:eh("moveWordForward"),isRedo:eh("redo"),isSplitBlock:eh("splitBlock"),isTransposeCharacter:eh("transposeCharacter"),isUndo:eh("undo"),isTab:eh("tab"),isSelectAll:eh("selectAll")};function nh(e){e.preventDefault()}var rh={beforeinput:function(t,n,r){var i=t,a=r.getConfig().readOnly;if(lc&&!a&&Ud(r,i.target)){var l=r.selection,u=i.inputType,c=i.dataTransfer||i.data||void 0;if("insertCompositionText"!==u&&"deleteCompositionText"!==u){if(i.preventDefault(),!u.startsWith("delete")||u.startsWith("deleteBy")){var f=wa(i.getTargetRanges(),1)[0];if(f){var d=uc.toSlateRange(r,f,{exactMatch:!1,suppressThrow:!1});l&&o.equals(l,d)||s.select(r,d)}}if(l&&o.isExpanded(l)&&u.startsWith("delete")){var h=u.endsWith("Backward")?"backward":"forward";e.deleteFragment(r,{direction:h})}else switch(u){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":e.deleteFragment(r);break;case"deleteContent":case"deleteContentForward":e.deleteForward(r);break;case"deleteContentBackward":e.deleteBackward(r);break;case"deleteEntireSoftLine":e.deleteBackward(r,{unit:"line"}),e.deleteForward(r,{unit:"line"});break;case"deleteHardLineBackward":e.deleteBackward(r,{unit:"block"});break;case"deleteSoftLineBackward":e.deleteBackward(r,{unit:"line"});break;case"deleteHardLineForward":e.deleteForward(r,{unit:"block"});break;case"deleteSoftLineForward":e.deleteForward(r,{unit:"line"});break;case"deleteWordBackward":e.deleteBackward(r,{unit:"word"});break;case"deleteWordForward":e.deleteForward(r,{unit:"word"});break;case"insertLineBreak":case"insertParagraph":e.insertBreak(r);break;case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":if("insertFromPaste"===u&&!Hs.get(r))break;Mu(c)?r.insertData(c):"string"==typeof c&&e.insertText(r,c)}}}},blur:function(e,t,n){var r=e,o=t.isUpdatingSelection,a=t.latestElement;if(!n.getConfig().readOnly&&!o&&Ud(n,r.target)){var s=uc.findDocumentOrShadowRoot(n);if(a!==s.activeElement){var l=r.relatedTarget;if(!(l===uc.toDOMNode(n,n)||Vu(l)&&l.hasAttribute("data-slate-spacer"))){if(null!=l&&zu(l)&&uc.hasDOMNode(n,l)){var u=uc.toSlateNode(n,l);if(i.isElement(u)&&!n.isVoid(u))return}if(oc){var c=s.getSelection();null==c||c.removeAllRanges()}Ws.delete(n)}}}},focus:function(e,t,n){var r=uc.toDOMNode(n,n),o=uc.findDocumentOrShadowRoot(n);t.latestElement=o.activeElement,rc&&e.target!==r?r.focus():Ws.set(n,!0)},click:function(t,o,i){if(!i.getConfig().readOnly&&qd(i,t.target)&&zu(t.target)){var a=uc.toSlateNode(i,t.target),l=uc.findPath(i,a);if(e.hasPath(i,l))if(r.get(i,l)===a){var u=e.start(i,l),c=e.end(i,l),f=e.void(i,{at:u}),d=e.void(i,{at:c});if(f&&d&&n.equals(f[1],d[1])){var h=e.range(i,u);s.select(i,h)}}}},compositionstart:function(t,n,r){if(Ud(r,t.target)){var i=r.selection;if(i&&o.isExpanded(i)&&(e.deleteFragment(r),Promise.resolve().then((function(){Gd(n,r,!0)}))),i&&(o.isExpanded(i)||o.isCollapsed(i))){var a=uc.toDOMRange(r,i).startContainer,s=a.textContent||"";Jd.set(r,s),Yd.set(r,a)}n.isComposing=!0,function(e,t){var n;t.getConfig().placeholder&&t.isEmpty()&&e.showPlaceholder&&(null===(n=e.$placeholder)||void 0===n||n.hide(),e.showPlaceholder=!1)}(n,r)}},compositionend:function(t,n,r){var s=t;if(Ud(r,s.target)){n.isComposing=!1;var l=r.selection;if(null!=l){(sc||rc)&&uc.cleanExposedTexNodeInSelectionBlock(r);for(var u=o.isBackward(l)?l.focus:l.anchor,c=wa(e.node(r,[u.path[0]]),1)[0],f=0;f<u.path.length;f++){var d=wa(e.node(r,u.path.slice(0,f+1)),1)[0];if(i.isElement(d)&&((oc||rc)&&"link"===d.type||"code"===d.type)){uc.setNewKey(c);break}}var h=s.data;if(h){if(r.getConfig().maxLength){var p=uc.getLeftLengthOfMaxLength(r);if(p<h.length)uc.toDOMRange(r,l).startContainer.textContent=Jd.get(r)||"",p>0&&e.insertText(r,h.slice(0,p)),n.changeViewState();else e.insertText(r,h)}else{var g=uc.findDocumentOrShadowRoot(r).getSelection();g&&function(t,n){if(o.isCollapsed(n)){var r=n.anchor,i=n.focus;if(2===r.path.length&&2===i.path.length&&(0===r.offset||0===i.path.offset)){var s=e.node(t,r.path),l=0===r.offset?r.path:i.path,u=[l[0],l[1]-1];if(0===l[1])return!1;var c=e.node(t,u);if(a.isText(c[0])&&a.isText(s[0]))return!0}}}(r,l)&&(r.selection=uc.toSlateRange(r,g,{exactMatch:!1,suppressThrow:!1})),e.insertText(r,h)}oc||setTimeout((function(){var e=r.selection;if(null!=e){var t=Yd.get(r);if(null!=t)uc.toDOMRange(r,e).startContainer!==t&&(t.textContent=Jd.get(r)||"")}}))}}}},compositionupdate:function(e,t,n){Ud(n,e.target)&&(t.isComposing=!0)},keydown:function(t,n,a){var l=t,u=a.selection;if(!a.getConfig().readOnly&&!n.isComposing&&Ud(a,l.target)){if(function(e,t){var n=ks.get(e),r=n&&n.getMenus(),o=Os.get(e),i=o&&o.getMenus(),a=ma(ma({},r),i);for(var s in a){var l=a[s],u=l.hotkey;if(u&&X(u,t)&&!l.isDisabled(e)){var c=l.getValue(e);l.exec(e,c)}}}(a,l),th.isTab(l))return nh(l),void a.handleTab();if(th.isRedo(l))return nh(l),void("function"==typeof a.redo&&a.redo());if(th.isUndo(l))return nh(l),void("function"==typeof a.undo&&a.undo());if(th.isMoveLineBackward(l))return nh(l),void s.move(a,{unit:"line",reverse:!0});if(th.isMoveLineForward(l))return nh(l),void s.move(a,{unit:"line"});if(th.isExtendLineBackward(l))return nh(l),void s.move(a,{unit:"line",edge:"focus",reverse:!0});if(th.isExtendLineForward(l))return nh(l),void s.move(a,{unit:"line",edge:"focus"});if(th.isMoveBackward(l))return nh(l),void(u&&o.isCollapsed(u)?s.move(a,{reverse:!0}):s.collapse(a,{edge:"start"}));if(th.isMoveForward(l))return nh(l),void(u&&o.isCollapsed(u)?s.move(a):s.collapse(a,{edge:"end"}));if(th.isMoveWordBackward(l))return nh(l),u&&o.isExpanded(u)&&s.collapse(a,{edge:"focus"}),void s.move(a,{unit:"word",reverse:!0});if(th.isMoveWordForward(l))return nh(l),u&&o.isExpanded(u)&&s.collapse(a,{edge:"focus"}),void s.move(a,{unit:"word"});if(th.isSelectAll(l))return nh(l),void a.selectAll();if(lc){if((sc||oc)&&u&&(th.isDeleteBackward(l)||th.isDeleteForward(l))&&o.isCollapsed(u)){var c=r.parent(a,u.anchor.path);if(i.isElement(c)&&e.isVoid(a,c)&&e.isInline(a,c))return l.preventDefault(),void s.delete(a,{unit:"block"})}}else{if(th.isBold(l)||th.isItalic(l)||th.isTransposeCharacter(l))return void nh(l);if(th.isSplitBlock(l))return nh(l),void e.insertBreak(a);if(th.isDeleteBackward(l))return nh(l),void(u&&o.isExpanded(u)?e.deleteFragment(a,{direction:"backward"}):e.deleteBackward(a));if(th.isDeleteForward(l))return nh(l),void(u&&o.isExpanded(u)?e.deleteFragment(a,{direction:"forward"}):e.deleteForward(a));if(th.isDeleteLineBackward(l))return nh(l),void(u&&o.isExpanded(u)?e.deleteFragment(a,{direction:"backward"}):e.deleteBackward(a,{unit:"line"}));if(th.isDeleteLineForward(l))return nh(l),void(u&&o.isExpanded(u)?e.deleteFragment(a,{direction:"forward"}):e.deleteForward(a,{unit:"line"}));if(th.isDeleteWordBackward(l))return nh(l),void(u&&o.isExpanded(u)?e.deleteFragment(a,{direction:"backward"}):e.deleteBackward(a,{unit:"word"}));if(th.isDeleteWordForward(l))return nh(l),void(u&&o.isExpanded(u)?e.deleteFragment(a,{direction:"forward"}):e.deleteForward(a,{unit:"word"}))}}},keypress:function(t,n,r){if(!lc&&!r.getConfig().readOnly&&Ud(r,t.target)){t.preventDefault();var o=t.key;e.insertText(r,o)}},copy:function(e,t,n){var r=e;if(Ud(n,r.target)){r.preventDefault();var o=r.clipboardData;null!=o&&n.setFragmentData(o)}},cut:function(t,n,i){var a=t,l=i.selection;if(!i.getConfig().readOnly&&Ud(i,a.target)){a.preventDefault();var u=a.clipboardData;if(null!=u&&(i.setFragmentData(u),l))if(o.isExpanded(l))e.deleteFragment(i);else{var c=r.parent(i,l.anchor.path);e.isVoid(i,c)&&s.delete(i)}}},paste:function(e,t,n){Hs.set(n,!0);var r=e;if(!n.getConfig().readOnly&&Ud(n,r.target)){var o=n.getConfig().customPaste;if(o)if(!1===o(n,r))return void Hs.set(n,!1);if(!lc||Ku(r)){r.preventDefault();var i=r.clipboardData;null!=i&&n.insertData(i)}}},dragover:function(t,n,r){if(qd(r,t.target)){var o=uc.toSlateNode(r,t.target);e.isVoid(r,o)&&t.preventDefault()}},dragstart:function(t,n,r){var o=t;if(qd(r,o.target)&&!r.getConfig().readOnly){var i=uc.toSlateNode(r,o.target),a=uc.findPath(r,i);if(e.isVoid(r,i)||e.void(r,{at:a,voids:!0})){var l=e.range(r,a);s.select(r,l)}var u=o.dataTransfer;null!=u&&(n.isDraggingInternally=!0,r.setFragmentData(u))}},dragend:function(e,t,n){var r=e;n.getConfig().readOnly||t.isDraggingInternally&&qd(n,r.target)&&(t.isDraggingInternally=!1)},drop:function(e,t,n){var r=e,o=r.dataTransfer;if(!n.getConfig().readOnly&&qd(n,r.target)&&null!=o&&!(lc&&oc&&o.files.length>0)){r.preventDefault();var i=n.selection,a=uc.findEventRange(n,r);s.select(n,a),t.isDraggingInternally&&(i&&s.delete(n,{at:i}),t.isDraggingInternally=!1),n.insertData(o),n.isFocused()||n.focus()}}},oh=1,ih=function(){function e(e){var t=this;this.id=oh++,this.$textArea=null,this.$progressBar=f('<div class="w-e-progress-bar"></div>'),this.$maxLengthInfo=f('<div class="w-e-max-length-info"></div>'),this.isComposing=!1,this.isUpdatingSelection=!1,this.isDraggingInternally=!1,this.latestElement=null,this.showPlaceholder=!1,this.$placeholder=null,this.latestEditorSelection=null,this.onDOMSelectionChange=_((function(){var e=t.editorInstance;!function(e,t){var n=e.isComposing,r=e.isUpdatingSelection,o=e.isDraggingInternally;if(!(t.getConfig().readOnly||n||r||o)){var i=uc.findDocumentOrShadowRoot(t),a=i.activeElement,l=uc.toDOMNode(t,t),u=i.getSelection();if(a!==l)return Ws.delete(t),void s.deselect(t);if(e.latestElement=a,Ws.set(t,!0),!u)return s.deselect(t);var c=u.anchorNode,f=u.focusNode,d=Ud(t,c)||Kd(t,c),h=Ud(t,f)||Kd(t,f);if(d&&h){var p=uc.toSlateRange(t,u,{exactMatch:!1,suppressThrow:!1});s.select(t,p)}}}(t,e)}),100);var n=f(e);if(0===n.length)throw new Error("Cannot find textarea DOM by selector '"+e+"'");this.$box=n;var r=f('<div class="w-e-text-container"></div>');r.append(this.$progressBar),r.append(this.$maxLengthInfo),n.append(r);var o=f('<div class="w-e-scroll"></div>');r.append(o),this.$scroll=o,this.$textAreaContainer=r,Ou((function(){var e=t.editorInstance,o=uc.getWindow(e);o.document.addEventListener("selectionchange",t.onDOMSelectionChange),e.on("destroyed",(function(){o.document.removeEventListener("selectionchange",t.onDOMSelectionChange)})),r.on("click",(function(){return e.hidePanelOrModal()})),e.on("change",t.changeViewState.bind(t));var i=e.getConfig(),a=i.onChange,s=i.scroll;a&&e.on("change",(function(){return a(e)})),s||(n.css("position","relative"),r.addClass("no-scroll")),t.onFocusAndOnBlur(),e.on("change",t.changeMaxLengthInfo.bind(t)),t.bindEvent()}))}return Object.defineProperty(e.prototype,"editorInstance",{get:function(){var e=xs.get(this);if(null==e)throw new Error("Can not get editor instance");return e},enumerable:!1,configurable:!0}),e.prototype.bindEvent=function(){var e=this,t=this.$textArea,n=this.$scroll,r=this.editorInstance;null!=t&&(B(rh,(function(n,o){t.on(o,(function(t){n(t,e,r)}))})),r.getConfig().scroll&&(n.css("overflow-y","auto"),n.on("scroll",_((function(){r.emit("scroll")}),100))))},e.prototype.onFocusAndOnBlur=function(){var e=this,t=this.editorInstance,n=t.getConfig(),r=n.onBlur,o=n.onFocus;this.latestEditorSelection=t.selection,t.on("change",(function(){null==e.latestEditorSelection&&null!=t.selection?setTimeout((function(){return o&&o(t)})):null!=e.latestEditorSelection&&null==t.selection&&setTimeout((function(){return r&&r(t)})),e.latestEditorSelection=t.selection}))},e.prototype.changeMaxLengthInfo=function(){var e=this.editorInstance,t=e.getConfig().maxLength;if(t){var n=t-uc.getLeftLengthOfMaxLength(e);this.$maxLengthInfo[0].innerHTML=n+"/"+t}},e.prototype.changeProgress=function(e){var t=this.$progressBar;t.css("width",e+"%"),e>=100&&setTimeout((function(){t.hide(),t.css("width","0"),t.show()}),1e3)},e.prototype.changeViewState=function(){var e=this,t=this.editorInstance;Fd(this,t),function(e,t){var n,r=t.getConfig().placeholder;if(r){var o=t.isEmpty();if(o&&!e.showPlaceholder&&!e.isComposing){if(null==e.$placeholder){var i=f('<div class="w-e-text-placeholder">'+r+"</div>");e.$textAreaContainer.append(i),e.$placeholder=i}return e.$placeholder.show(),void(e.showPlaceholder=!0)}!o&&e.showPlaceholder&&(null===(n=e.$placeholder)||void 0===n||n.hide(),e.showPlaceholder=!1)}}(this,t),Ou((function(){Gd(e,t)}))},e.prototype.destroy=function(){this.$textAreaContainer.remove()},e}();Ki("match",(function(e,t,n){return[function(t){var n=Le(this),r=null==t?void 0:Je(t,e);return r?fe(r,t,n):new RegExp(t)[e](Er(n))},function(e){var r=Tt(this),o=Er(e),i=n(t,r,o);if(i.done)return i.value;if(!r.global)return ra(r,o);var a=r.unicode;r.lastIndex=0;for(var s,l=[],u=0;null!==(s=ra(r,o));){var c=Er(s[0]);l[u]=c,""===c&&(r.lastIndex=Gi(o,cn(r.lastIndex),a)),u++}return 0===u?null:l}]}));function ah(e){if(e.removeAttr){e.removeAttr("width"),e.removeAttr("height"),e.removeAttr("fill"),e.removeAttr("class"),e.removeAttr("t"),e.removeAttr("p-id");var t=e.children();t.length&&ah(t)}}function sh(){return f('<svg viewBox="0 0 1024 1024"><path d="M498.7 655.8l-197.6-268c-8.1-10.9-0.3-26.4 13.3-26.4h395.2c13.6 0 21.4 15.4 13.3 26.4l-197.6 268c-6.6 9-20 9-26.6 0z"></path></svg>')}function lh(){return f('<div class="w-e-bar-divider"></div>')}function uh(e,t,n,r,o){if(void 0===r&&(r=""),void 0===o&&(o=!1),t){if(r){var i=nc?"cmd":"ctrl";r=r.replace("mod",i)}if(o)r&&(e.attr("data-tooltip",r),e.addClass("w-e-menu-tooltip-v5"),e.addClass("tooltip-right"));else{var a=r?n+"\n"+r:n;e.attr("data-tooltip",a),e.addClass("w-e-menu-tooltip-v5")}}}var ch=function(){function e(e,t,n){var r=this;void 0===n&&(n=!1),this.$elem=f('<div class="w-e-bar-item"></div>'),this.$button=f('<button type="button"></button>'),this.disabled=!1,this.menu=t;var o=t.tag,i=t.width;if("button"!==o)throw new Error("Invalid tag '"+o+"', expected 'button'");var a=t.title,s=t.hotkey,l=void 0===s?"":s,u=t.iconSvg,c=void 0===u?"":u,d=this.$button;if(c){var h=f(c);ah(h),d.append(h)}else d.text(a);uh(d,c,a,l,n),n&&c&&d.append(f('<span class="title">'+a+"</span>")),i&&d.css("width",i+"px"),d.attr("data-menu-key",e),this.$elem.append(d),Ou((function(){return r.init()}))}return e.prototype.init=function(){var e=this;this.setActive(),this.setDisabled(),this.$button.on("click",(function(t){t.preventDefault(),Eh(e).hidePanelOrModal(),e.disabled||(e.exec(),e.onButtonClick())}))},e.prototype.exec=function(){var e=Eh(this),t=this.menu,n=t.getValue(e);this.setIcon(),this.setTooltip(),t.exec(e,n)},e.prototype.setActive=function(){var e=Eh(this),t=this.$button,n="active";this.menu.isActive(e)?t.addClass(n):t.removeClass(n)},e.prototype.setDisabled=function(){var e=Eh(this),t=this.$button,n=this.menu.isDisabled(e);(null==e.selection||e.isDisabled())&&(n=!0),this.menu.alwaysEnable&&(n=!1);var r="disabled";n?t.addClass(r):t.removeClass(r),this.disabled=n},e.prototype.setIcon=function(){var e=Eh(this),t=this.$button;if(this.menu.getIcon){var n=this.menu.getIcon(e);if(n){t.find("svg").remove();var r=f(n);ah(r),t.append(r)}}},e.prototype.setTooltip=function(){var e=Eh(this),t=this.$button;if(this.menu.getTitle){var n=this.menu.getTitle(e),r=this.menu.iconSvg;n&&r&&uh(t,r,n)}},e.prototype.changeMenuState=function(){this.setActive(),this.setDisabled()},e}(),fh=function(e){function t(t,n,r){return void 0===r&&(r=!1),e.call(this,t,n,r)||this}return ya(t,e),t.prototype.onButtonClick=function(){},t}(ch),dh=function(){function e(e){this.isShow=!1,this.showTime=0,this.record(e)}return e.prototype.record=function(e){var t=Ts.get(e);null==t&&(t=new Set,Ts.set(e,t)),t.add(this),Ns.set(this,e)},e.prototype.renderContent=function(e){var t=this.$elem;t.empty(),t.append(e);var n=this.genSelfElem();n&&t.append(n)},e.prototype.appendTo=function(e){var t=this.$elem;e.append(t)},e.prototype.show=function(){if(!this.isShow){this.showTime=Date.now(),this.$elem.show(),this.isShow=!0;var e=Ns.get(this);e&&e.emit("modalOrPanelShow",this)}},e.prototype.hide=function(){if(this.isShow&&!(Date.now()-this.showTime<200)){this.$elem.hide(),this.isShow=!1;var e=Ns.get(this);e&&e.emit("modalOrPanelHide")}},e}(),hh=function(e){function t(t){var n=e.call(this,t)||this;return n.type="dropPanel",n.$elem=f('<div class="w-e-drop-panel"></div>'),n}return ya(t,e),t.prototype.genSelfElem=function(){return null},t}(dh),ph=function(e){function t(t,n,r){void 0===r&&(r=!1);var o=e.call(this,t,n,r)||this;if(o.dropPanel=null,o.menu=n,n.showDropPanel){var i=sh();o.$button.append(i)}return o}return ya(t,e),t.prototype.onButtonClick=function(){this.menu.showDropPanel&&this.handleDropPanel()},t.prototype.handleDropPanel=function(){var e=this.menu;if(null!=e.getPanelContentElem){var t=Eh(this);if(null==this.dropPanel){var n=new hh(t),r=e.getPanelContentElem(t);n.renderContent(r),n.appendTo(this.$elem),n.show(),this.dropPanel=n}else{var o=this.dropPanel;if(o.isShow)o.hide();else{r=e.getPanelContentElem(t);o.renderContent(r),o.show()}}var i=this.dropPanel;if(i.isShow){var a=this.$elem,s=a.offset().left,l=a.parents(".w-e-bar");s-l.offset().left>=l.width()/2?i.$elem.css({left:"none",right:"0"}):i.$elem.css({left:"0",right:"none"})}}},t}(ch),gh=function(e){function t(t,n){void 0===n&&(n=0);var r=e.call(this,t)||this;r.type="modal",r.$elem=f('<div class="w-e-modal"></div>'),r.width=0,n&&(r.width=n);var o=r.$elem;return o.on("click",(function(e){return e.stopPropagation()})),o.on("keyup",(function(e){"Escape"===e.code&&(r.hide(),t.restoreSelection())})),r}return ya(t,e),t.prototype.genSelfElem=function(){var e=this,t=f('<span class="btn-close"><svg viewBox="0 0 1024 1024"><path d="M1024 896.1024l-128 128L512 640 128 1024 0 896 384 512 0 128 128 0 512 384 896.1024 0l128 128L640 512z"></path></svg></span>'),n=Ns.get(this);return t.on("click",(function(){e.hide(),null==n||n.restoreSelection()})),t},t.prototype.setStyle=function(e){var t=this.width,n=this.$elem;n.attr("style",""),t&&n.css("width",t+"px"),n.css(e)},t}(dh);function vh(e,t,n){var r=f('<label class="babel-container"></label>');r.append("<span>"+e+"</span>");var o=f('<input type="text" id="'+t+'" placeholder="'+(n||"")+'">');return r.append(o),[r[0],o[0]]}function yh(e,t,n){var r=f('<label class="babel-container"></label>');r.append("<span>"+e+"</span>");var o=f('<textarea type="text" id="'+t+'" placeholder="'+(n||"")+'"></textarea>');return r.append(o),[r[0],o[0]]}function mh(e,t){var n=f('<div class="button-container"></div>'),r=f('<button type="button" id="'+e+'">'+t+"</button>");return n.append(r),[n[0],r[0]]}var bh=function(e){function t(t,n,r){void 0===r&&(r=!1);var o=e.call(this,t,n,r)||this;return o.$body=f("body"),o.modal=null,o.menu=n,o}return ya(t,e),t.prototype.onButtonClick=function(){this.menu.showModal&&this.handleModal()},t.prototype.getPosition=function(){var e=Eh(this),t=this.menu.getModalPositionNode(e);return i.isElement(t)?ud(e,t,"modal"):ld(e)},t.prototype.handleModal=function(){var e=Eh(this),t=this.menu;if(null==this.modal){var n=new gh(e,t.modalWidth);this.renderAndShowModal(n,!0),this.modal=n}else{(n=this.modal).isShow?n.hide():this.renderAndShowModal(n,!1)}},t.prototype.renderAndShowModal=function(e,t){void 0===t&&(t=!1);var n=Eh(this),r=this.menu;if(null!=r.getModalContentElem){var o=uc.getTextarea(n),i=uc.getToolbar(n),a=((null==i?void 0:i.getConfig())||{}).modalAppendToBody,s=r.getModalContentElem(n);if(e.renderContent(s),a)e.setStyle({left:"0",right:"0"});else{var l=this.getPosition();e.setStyle(l)}t&&(a?e.appendTo(this.$body):e.appendTo(o.$textAreaContainer)),e.show(),a||cd(n,e.$elem),setTimeout((function(){n.blur()}))}},t}(ch);var wh=function(e){function t(t,n){var r=e.call(this,t)||this;return r.type="selectList",r.$elem=f('<div class="w-e-select-list"></div>'),n&&r.$elem.css("width",n+"px"),r.$elem.on("click",(function(e){e.stopPropagation()})),r}return ya(t,e),t.prototype.renderList=function(e){var t=this.$elem;t.empty();var n=f("<ul></ul>");e.forEach((function(e){var t=e.value,r=e.text,o=e.selected,i=e.styleForRenderMenuList,a=f('<li data-value="'+t+'"></li>');if(i&&a.css(i),o){var s=f('<svg viewBox="0 0 1446 1024"><path d="M574.116299 786.736392 1238.811249 48.517862C1272.390222 11.224635 1329.414799 7.827718 1366.75664 41.450462 1403.840015 74.840484 1406.731043 132.084741 1373.10189 169.433699L655.118888 966.834607C653.072421 969.716875 650.835807 972.514337 648.407938 975.210759 615.017957 1012.29409 558.292155 1015.652019 521.195664 982.250188L72.778218 578.493306C35.910826 545.297758 32.859041 488.584019 66.481825 451.242134 99.871807 414.158803 156.597563 410.800834 193.694055 444.202665L574.116299 786.736392Z"></path></svg>');a.append(s),a.addClass("selected")}a.append(f('<span data-value="'+t+'">'+r+"</span>")),a.attr("title",r),n.append(a)})),t.append(n)},t.prototype.genSelfElem=function(){return null},t}(dh);var xh=function(){function e(e,t,n){var r=this;void 0===n&&(n=!1),this.$elem=f('<div class="w-e-bar-item"></div>'),this.$button=f('<button type="button" class="select-button"></button>'),this.disabled=!1,this.selectList=null;var o=t.tag,i=t.title,a=t.width,s=t.iconSvg,l=void 0===s?"":s,u=t.hotkey,c=void 0===u?"":u;if("select"!==o)throw new Error("Invalid tag '"+o+"', expected 'select'");var d=this.$button;a&&d.css("width",a+"px"),d.attr("data-menu-key",e),uh(d,l,i,c,n),this.$elem.append(d),this.menu=t,Ou((function(){return r.init()}))}return e.prototype.init=function(){var e=this;this.setSelectedValue(),this.$button.on("click",(function(t){t.preventDefault(),Eh(e).hidePanelOrModal(),e.trigger()}))},e.prototype.trigger=function(){var e=this,t=Eh(this);if(!t.isDisabled()&&!this.disabled){var n=this.menu;if(null==this.selectList){this.selectList=new wh(t,n.selectPanelWidth);var r=this.selectList,o=n.getOptions(t);r.renderList(o),r.appendTo(this.$elem),r.show(),r.$elem.on("click","li",(function(t){var n=t.target;if(null!=n){t.preventDefault();var r=f(n).attr("data-value");e.onChange(r)}}))}else{if((r=this.selectList).isShow)r.hide();else{o=n.getOptions(t);r.renderList(o),r.show()}}}},e.prototype.onChange=function(e){var t=Eh(this),n=this.menu;n.exec&&n.exec(t,e)},e.prototype.setSelectedValue=function(){var e=Eh(this),t=this.menu,n=t.getValue(e),r=function(e,t){for(var n=e.length,r="",o=0;o<n;o++){var i=e[o];if(i.value===t){r=i.text;break}}return r}(t.getOptions(e),n.toString()),o=this.$button,i=sh();o.empty(),o.text(r),o.append(i)},e.prototype.setDisabled=function(){var e=Eh(this),t=this.menu.isDisabled(e),n=this.$button;(null==e.selection||e.isDisabled())&&(t=!0);var r="disabled";t?n.addClass(r):n.removeClass(r),this.disabled=t},e.prototype.changeMenuState=function(){this.setSelectedValue(),this.setDisabled()},e}(),Sh=function(){function e(e){this.$elem=f('<div class="w-e-bar-item w-e-bar-item-group"></div>'),this.$container=f('<div class="w-e-bar-item-menus-container"></div>'),this.$button=f('<button type="button"></button>');var t=e.key,n=e.iconSvg,r=e.title,o=this.$elem,i=this.$button;if(n){var a=f(n);ah(a),i.append(a)}else i.text(r);i.attr("data-menu-key",t);var s=sh();i.append(s),o.append(i);var l=this.$container;o.append(l);var u=this.createObserver();this.observe(u)}return e.prototype.appendBarItem=function(e){var t=e.$elem;this.$container.append(t)},e.prototype.observe=function(e){var t=this.$container;e.observe(t[0],{childList:!0,subtree:!0,attributes:!0})},e.prototype.createObserver=function(){var e=this,t=this.$container,n=this.$button,r=new MutationObserver((function(){var o=t.find("button"),i=o.length;if(0!==i){var a=0;o.each((function(e){f(e).hasClass("disabled")&&a++})),r.disconnect(),a===i?n.addClass("disabled"):n.removeClass("disabled"),e.observe(r)}}));return r},e}(),kh=new WeakMap;function Eh(e){var t=Cs.get(e);if(null==t)throw new Error("Can not get editor instance");return t}function Oh(e,t,n){void 0===n&&(n=!1);var r=kh.get(t);if(r)return r;var o=t.tag;if("button"===o){var i=t.showDropPanel,a=t.showModal;r=i?new ph(e,t,n):a?new bh(e,t,n):new fh(e,t,n)}if("select"===o&&(r=new xh(e,t,n)),null==r)throw new Error("Invalid tag in menu "+JSON.stringify(t));return kh.set(t,r),r}function Ch(e){return Ch="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ch(e)}function Th(e){var t=function(e,t){if("object"!=Ch(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ch(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ch(t)?t:t+""}function Nh(e,t,n){return(t=Th(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lh(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach((function(t){Nh(e,t,n[t])}))}return e}function Mh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ph(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Th(r.key),r)}}function Dh(e,t,n){return t&&Ph(e.prototype,t),n&&Ph(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Rh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jh(e,t){if(t&&("object"==Ch(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Rh(e)}function Ah(e){return Ah=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ah(e)}function Ih(e,t){return Ih=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ih(e,t)}function Fh(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ih(e,t)}var Bh={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},_h=new(function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Mh(this,e),this.init(t,n)}return Dh(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||Bh,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,Lh({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),e}()),$h=function(){function e(){Mh(this,e),this.observers={}}return Dh(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.observers[e]&&[].concat(this.observers[e]).forEach((function(e){e.apply(void 0,n)}));this.observers["*"]&&[].concat(this.observers["*"]).forEach((function(t){t.apply(t,[e].concat(n))}))}}]),e}();function Wh(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function Vh(e){return null==e?"":""+e}function zh(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}for(var i="string"!=typeof t?[].concat(t):t.split(".");i.length>1;){if(o())return{};var a=r(i.shift());!e[a]&&n&&(e[a]=new n),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return o()?{}:{obj:e,k:r(i.shift())}}function Hh(e,t,n){var r=zh(e,t,Object);r.obj[r.k]=n}function Uh(e,t){var n=zh(e,t),r=n.obj,o=n.k;if(r)return r[o]}function Kh(e,t,n){var r=Uh(e,n);return void 0!==r?r:Uh(t,n)}function qh(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):qh(e[r],t[r],n):e[r]=t[r]);return e}function Gh(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Jh={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function Yh(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return Jh[e]})):e}var Xh="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1;function Qh(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),o=e,i=0;i<r.length;++i){if(!o)return;if("string"==typeof o[r[i]]&&i+1<r.length)return;if(void 0===o[r[i]]){for(var a=2,s=r.slice(i,i+a).join(n),l=o[s];void 0===l&&r.length>i+a;)a++,l=o[s=r.slice(i,i+a).join(n)];if(void 0===l)return;if("string"==typeof l)return l;if(s&&"string"==typeof l[s])return l[s];var u=r.slice(i+a).join(n);return u?Qh(l,u,n):void 0}o=o[r[i]]}return o}}var Zh=function(){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return Mh(this,e),n=jh(this,Ah(e).call(this)),Xh&&$h.call(Rh(n)),n.data=t||{},n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),void 0===n.options.ignoreJSONStructure&&(n.options.ignoreJSONStructure=!0),n}return Fh(e,$h),Dh(e,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."));var s=Uh(this.data,a);return s||!i||"string"!=typeof n?s:Qh(this.data&&this.data[e]&&this.data[e][t],n,o)}},{key:"addResource",value:function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(r=t,t=(a=e.split("."))[1]),this.addNamespaces(t),Hh(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in n)"string"!=typeof n[o]&&"[object Array]"!==Object.prototype.toString.apply(n[o])||this.addResource(e,t,o,n[o],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var s=Uh(this.data,a)||{};r?qh(s,n,o):s=Lh({},s,n),Hh(this.data,a,s),i.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?Lh({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),e}(),ep={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,o){var i=this;return e.forEach((function(e){i.processors[e]&&(t=i.processors[e].process(t,n,r,o))})),t}},tp={},np=function(){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Mh(this,e),n=jh(this,Ah(e).call(this)),Xh&&$h.call(Rh(n)),function(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,Rh(n)),n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=_h.create("translator"),n}return Fh(e,$h),Dh(e,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS;if(n&&e.indexOf(n)>-1){var i=e.match(this.interpolator.nestingRegexp);if(i&&i.length>0)return{key:e,namespaces:o};var a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(o=a.shift()),e=a.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}},{key:"translate",value:function(t,n,r){var o=this;if("object"!==Ch(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);var i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,a=this.extractFromKey(t[t.length-1],n),s=a.key,l=a.namespaces,u=l[l.length-1],c=n.lng||this.language,f=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&"cimode"===c.toLowerCase()){if(f){var d=n.nsSeparator||this.options.nsSeparator;return u+d+s}return s}var h=this.resolve(t,n),p=h&&h.res,g=h&&h.usedKey||s,v=h&&h.exactUsedKey||s,y=Object.prototype.toString.apply(p),m=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject;if(b&&p&&("string"!=typeof p&&"boolean"!=typeof p&&"number"!=typeof p)&&["[object Number]","[object Function]","[object RegExp]"].indexOf(y)<0&&("string"!=typeof m||"[object Array]"!==y)){if(!n.returnObjects&&!this.options.returnObjects)return this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,p,Lh({},n,{ns:l})):"key '".concat(s," (").concat(this.language,")' returned an object instead of string.");if(i){var w="[object Array]"===y,x=w?[]:{},S=w?v:g;for(var k in p)if(Object.prototype.hasOwnProperty.call(p,k)){var E="".concat(S).concat(i).concat(k);x[k]=this.translate(E,Lh({},n,{joinArrays:!1,ns:l})),x[k]===E&&(x[k]=p[k])}p=x}}else if(b&&"string"==typeof m&&"[object Array]"===y)(p=p.join(m))&&(p=this.extendTranslation(p,t,n,r));else{var O=!1,C=!1,T=void 0!==n.count&&"string"!=typeof n.count,N=e.hasDefaultValue(n),L=T?this.pluralResolver.getSuffix(c,n.count):"",M=n["defaultValue".concat(L)]||n.defaultValue;!this.isValidLookup(p)&&N&&(O=!0,p=M),this.isValidLookup(p)||(C=!0,p=s);var P=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&C?void 0:p,D=N&&M!==p&&this.options.updateMissing;if(C||O||D){if(this.logger.log(D?"updateKey":"missingKey",c,u,s,D?M:p),i){var R=this.resolve(s,Lh({},n,{keySeparator:!1}));R&&R.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var j=[],A=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&A&&A[0])for(var I=0;I<A.length;I++)j.push(A[I]);else"all"===this.options.saveMissingTo?j=this.languageUtils.toResolveHierarchy(n.lng||this.language):j.push(n.lng||this.language);var F=function(e,t,r){o.options.missingKeyHandler?o.options.missingKeyHandler(e,u,t,D?r:P,D,n):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(e,u,t,D?r:P,D,n),o.emit("missingKey",e,u,t,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?j.forEach((function(e){o.pluralResolver.getSuffixes(e).forEach((function(t){F([e],s+t,n["defaultValue".concat(t)]||M)}))})):F(j,s,M))}p=this.extendTranslation(p,t,n,h,r),C&&p===s&&this.options.appendNamespaceToMissingKey&&(p="".concat(u,":").concat(s)),(C||O)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(p))}return p}},{key:"extendTranslation",value:function(e,t,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,n,r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(Lh({},n,{interpolation:Lh({},this.options.interpolation,n.interpolation)}));var a,s=n.interpolation&&n.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;if(s){var l=e.match(this.interpolator.nestingRegexp);a=l&&l.length}var u=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(u=Lh({},this.options.interpolation.defaultVariables,u)),e=this.interpolator.interpolate(e,u,n.lng||this.language,n),s){var c=e.match(this.interpolator.nestingRegexp);a<(c&&c.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return o&&o[0]===r[0]&&!n.context?(i.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):i.translate.apply(i,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var f=n.postProcess||this.options.postProcess,d="string"==typeof f?[f]:f;return null!=e&&d&&d.length&&!1!==n.applyPostProcessor&&(e=ep.handle(d,e,t,this.options&&this.options.postProcessPassResolved?Lh({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,o,i,a=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var l=a.extractFromKey(e,s),u=l.key;n=u;var c=l.namespaces;a.options.fallbackNS&&(c=c.concat(a.options.fallbackNS));var f=void 0!==s.count&&"string"!=typeof s.count,d=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,h=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);c.forEach((function(e){a.isValidLookup(t)||(i=e,!tp["".concat(h[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(i)&&(tp["".concat(h[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(h.join(", "),'" won\'t get resolved as namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach((function(n){if(!a.isValidLookup(t)){o=n;var i,l,c=u,h=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(h,u,n,e,s);else f&&(i=a.pluralResolver.getSuffix(n,s.count)),f&&d&&h.push(c+i),d&&h.push(c+="".concat(a.options.contextSeparator).concat(s.context)),f&&h.push(c+=i);for(;l=h.pop();)a.isValidLookup(t)||(r=l,t=a.getResource(n,e,l,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}]),e}();function rp(e){return e.charAt(0).toUpperCase()+e.slice(1)}var op=function(){function e(t){Mh(this,e),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=_h.create("languageUtils")}return Dh(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=rp(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=rp(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=rp(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(e)}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],i=function(e){e&&(n.isSupportedCode(e)?o.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),r.forEach((function(e){o.indexOf(e)<0&&i(n.formatLanguageCode(e))})),o}}]),e}(),ip=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],ap={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}};var sp=function(){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Mh(this,e),this.languageUtils=t,this.options=r,this.logger=_h.create("pluralResolver"),this.rules=(n={},ip.forEach((function(e){e.lngs.forEach((function(t){n[t]={numbers:e.nr,plurals:ap[e.fc]}}))})),n)}return Dh(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){return this.getSuffixes(e).map((function(e){return t+e}))}},{key:"getSuffixes",value:function(e){var t=this,n=this.getRule(e);return n?n.numbers.map((function(n){return t.getSuffix(e,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=this,r=this.getRule(e);if(r){var o=r.noAbs?r.plurals(t):r.plurals(Math.abs(t)),i=r.numbers[o];this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var a=function(){return n.options.prepend&&i.toString()?n.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):a():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),lp=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Mh(this,e),this.logger=_h.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return Dh(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:Yh,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?Gh(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?Gh(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?Gh(t.nestingPrefix):t.nestingPrefixEscaped||Gh("$t("),this.nestingSuffix=t.nestingSuffix?Gh(t.nestingSuffix):t.nestingSuffixEscaped||Gh(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var o,i,a,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(e){return e.replace(/\$/g,"$$$$")}var c=function(e){if(e.indexOf(s.formatSeparator)<0){var o=Kh(t,l,e);return s.alwaysFormat?s.format(o,void 0,n,Lh({},r,t,{interpolationkey:e})):o}var i=e.split(s.formatSeparator),a=i.shift().trim(),u=i.join(s.formatSeparator).trim();return s.format(Kh(t,l,a),u,n,Lh({},r,t,{interpolationkey:a}))};this.resetRegExp();var f=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,d=r&&r.interpolation&&r.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables,h=[{regex:this.regexpUnescape,safeValue:function(e){return u(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?u(s.escape(e)):u(e)}}];return h.forEach((function(t){for(a=0;o=t.regex.exec(e);){if(void 0===(i=c(o[1].trim())))if("function"==typeof f){var n=f(e,o,r);i="string"==typeof n?n:""}else{if(d){i=o[0];continue}s.logger.warn("missed to pass in variable ".concat(o[1]," for interpolating ").concat(e)),i=""}else"string"==typeof i||s.useRawValueToEscape||(i=Vh(i));var l=t.safeValue(i);if(e=e.replace(o[0],l),d?(t.regex.lastIndex+=l.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++a>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,o=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=Lh({},i);function s(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),o="{".concat(r[1]);e=r[0],o=(o=this.interpolate(o,a)).replace(/'/g,'"');try{a=JSON.parse(o),t&&(a=Lh({},t,a))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(o)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(e);){var l=[],u=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var c=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=c.shift(),l=c,u=!0}if((r=t(s.call(this,n[1].trim(),a),a))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=Vh(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),u&&(r=l.reduce((function(e,t){return o.format(e,t,i.lng,Lh({},i,{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();var up=function(){function e(t,n,r){var o,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Mh(this,e),o=jh(this,Ah(e).call(this)),Xh&&$h.call(Rh(o)),o.backend=t,o.store=n,o.services=r,o.languageUtils=r.languageUtils,o.options=i,o.logger=_h.create("backendConnector"),o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(r,i.backend,i),o}return Fh(e,$h),Dh(e,[{key:"queueLoad",value:function(e,t,n,r){var o=this,i=[],a=[],s=[],l=[];return e.forEach((function(e){var r=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!n.reload&&o.store.hasResourceBundle(e,t)?o.state[s]=2:o.state[s]<0||(1===o.state[s]?a.indexOf(s)<0&&a.push(s):(o.state[s]=1,r=!1,a.indexOf(s)<0&&a.push(s),i.indexOf(s)<0&&i.push(s),l.indexOf(t)<0&&l.push(t)))})),r||s.push(e)})),(i.length||a.length)&&this.queue.push({pending:a,loaded:{},errors:[],callback:r}),{toLoad:i,pending:a,toLoadLanguages:s,toLoadNamespaces:l}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),n&&this.store.addResourceBundle(o,i,n),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(n){!function(e,t,n,r){var o=zh(e,t,Object),i=o.obj,a=o.k;i[a]=i[a]||[],r&&(i[a]=i[a].concat(n)),r||i[a].push(n)}(n.loaded,[o],i),function(e,t){for(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}(n.pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach((function(e){a[e]||(a[e]=[]),n.loaded[e].length&&n.loaded[e].forEach((function(t){a[e].indexOf(t)<0&&a[e].push(t)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,a=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[n](e,t,(function(s,l){s&&l&&o<5?setTimeout((function(){r.read.call(r,e,t,n,o+1,2*i,a)}),i):a(s,l)})):a(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(function(r,a){r&&t.logger.warn("".concat(n,"loading namespace ").concat(i," for language ").concat(o," failed"),r),!r&&a&&t.logger.log("".concat(n,"loaded namespace ").concat(i," for language ").concat(o),a),t.loaded(e,r,a)}))}},{key:"saveMissing",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,Lh({},i,{isUpdate:o})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),e}();function cp(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function fp(){}var dp=function(){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(Mh(this,e),t=jh(this,Ah(e).call(this)),Xh&&$h.call(Rh(t)),t.options=cp(n),t.services={},t.logger=_h,t.modules={external:[]},r&&!t.isInitialized&&!n.isClone){if(!t.options.initImmediate)return t.init(n,r),jh(t,Rh(t));setTimeout((function(){t.init(n,r)}),0)}return t}return Fh(e,$h),Dh(e,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function r(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(n=t,t={}),t.whitelist&&!t.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),t.nonExplicitWhitelist&&!t.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=Lh({},{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===Ch(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===Ch(e[2])||"object"===Ch(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}},this.options,cp(t)),this.format=this.options.interpolation.format,n||(n=fp),!this.options.isClone){this.modules.logger?_h.init(r(this.modules.logger),this.options):_h.init(null,this.options);var o=new op(this.options);this.store=new Zh(this.options.resources,this.options);var i=this.services;i.logger=_h,i.resourceStore=this.store,i.languageUtils=o,i.pluralResolver=new sp(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),i.interpolator=new lp(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new up(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new np(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.length>0&&"dev"!==a[0]&&(this.options.lng=a[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var s=Wh(),l=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),s.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?l():setTimeout(l,0),s}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fp,r="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase())return n();var o=[],i=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){o.indexOf(e)<0&&o.push(e)}))};if(r)i(r);else this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(e){return i(e)}));this.options.preload&&this.options.preload.forEach((function(e){return i(e)})),this.services.backendConnector.load(o,this.options.ns,n)}else n(null)}},{key:"reloadResources",value:function(e,t,n){var r=Wh();return e||(e=this.languages),t||(t=this.options.ns),n||(n=fp),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&ep.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=Wh();this.emit("languageChanging",e);var o=function(o){e||o||!n.services.languageDetector||(o=[]);var i="string"==typeof o?o:n.services.languageUtils.getBestMatchFromCodes(o);i&&(n.language||(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i)),n.translator.language||n.translator.changeLanguage(i),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(i)),n.loadResources(i,(function(e){!function(e,o){o?(n.language=o,n.languages=n.services.languageUtils.toResolveHierarchy(o),n.translator.changeLanguage(o),n.isLanguageChangingTo=void 0,n.emit("languageChanged",o),n.logger.log("languageChanged",o)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,i)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,o=function e(t,o){var i;if("object"!==Ch(o)){for(var a=arguments.length,s=new Array(a>2?a-2:0),l=2;l<a;l++)s[l-2]=arguments[l];i=r.options.overloadTranslationOptionHandler([t,o].concat(s))}else i=Lh({},o);i.lng=i.lng||e.lng,i.lngs=i.lngs||e.lngs,i.ns=i.ns||e.ns;var u=r.options.keySeparator||".",c=n?"".concat(n).concat(u).concat(t):t;return r.t(c,i)};return"string"==typeof e?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.languages[0],o=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(r,e)||(!this.services.backendConnector.backend||!(!a(r,e)||o&&!a(i,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=Wh();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=Wh();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],o=e.filter((function(e){return r.indexOf(e)<0}));return o.length?(this.options.preload=r.concat(o),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){return new e(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}},{key:"cloneInstance",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fp,o=Lh({},this.options,n,{isClone:!0}),i=new e(o);return["store","services","language"].forEach((function(e){i[e]=t[e]})),i.services=Lh({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i.translator=new np(i.services,i.options),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];i.emit.apply(i,[e].concat(n))})),i.init(o,r),i.translator.options=i.options,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages}}}]),e}(),hp=new dp,pp="translation";function gp(e,t){hp.addResourceBundle(e,pp,t,!0,!0)}function vp(e){hp.changeLanguage(e)}function yp(e){return hp.getResourceBundle(e,pp)}function mp(e){return hp.on("languageChanged",e),function(){return hp.off("languageChanged",e)}}hp.init({lng:"zh-CN",resources:{}});var bp=hp.t.bind(hp);function wp(e,t){var n=e.selection;return null!=n&&(!o.isCollapsed(n)&&(!uc.getSelectedElems(e).some((function(t){if(e.isVoid(t))return!0;var n=t.type;return!!["pre","code","table"].includes(n)||void 0}))&&!!a.isText(t)))}var xp=function(){function t(){var e=this;this.$elem=f('<div class="w-e-bar w-e-bar-hidden w-e-hover-bar"></div>'),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null,this.isShow=!1,this.lngListen=function(){},this.changeHoverbarState=Q((function(){var t=e.isShow,n=e.getSelectedNodeAndMenuKeys()||{},r=n.node,o=void 0===r?null:r,a=n.menuKeys,s=void 0===a?[]:a;if((null!=o&&e.changeItemsState(),o&&i.isElement(o))&&(t&&e.isSamePath(o,e.prevSelectedNode)))return;e.hideAndClean(),null!=o&&(e.registerItems(s),e.setPosition(o),e.show()),e.prevSelectedNode=o}),200),Ou((function(){var t=e.getEditorInstance(),n=e.$elem;n.on("mousedown",(function(e){return e.preventDefault()}),{passive:!1}),uc.getTextarea(t).$textAreaContainer.append(n),t.on("change",e.changeHoverbarState);var r=e.hideAndClean.bind(e);t.on("scroll",r),t.on("fullScreen",r),t.on("unFullScreen",r)})),this.lngListen=mp((function(){e.menus={},e.hideAndClean(),e.getEditorInstance().deselect()}))}return t.prototype.getMenus=function(){return this.menus},t.prototype.hideAndClean=function(){var e=this.$elem;e.removeClass("w-e-bar-show").addClass("w-e-bar-hidden"),this.hoverbarItems=[],e.empty(),this.isShow=!1},t.prototype.checkPositionBottom=function(){var e=this.$elem,t=!1,n=window.innerHeight;n&&n>=360&&(n-e[0].getBoundingClientRect().bottom<360&&(t=!0));t?e.addClass("w-e-bar-bottom"):e.removeClass("w-e-bar-bottom")},t.prototype.show=function(){this.$elem.removeClass("w-e-bar-hidden").addClass("w-e-bar-show"),this.isShow=!0,this.checkPositionBottom()},t.prototype.changeItemsState=function(){var e=this;Ou((function(){e.hoverbarItems.forEach((function(e){e.changeMenuState()}))}))},t.prototype.registerItems=function(e){var t=this,n=this.$elem;e.forEach((function(e){if("|"!==e)t.registerSingleItem(e);else{var r=lh();n.append(r)}}))},t.prototype.registerSingleItem=function(e){var t=this.getEditorInstance(),n=this.menus,r=n[e];if(null==r){var o=dc[e];if(null==o)throw new Error("Not found menu item factory by key '"+e+"'");if("function"!=typeof o)throw new Error("Menu item factory (key='"+e+"') is not a function");r=o(),n[e]=r}var i=t.getMenuConfig(e);i&&void 0!==i.iconSvg&&(r.iconSvg=i.iconSvg);var a=Oh(e,r);this.hoverbarItems.push(a),Cs.set(a,t),this.$elem.append(a.$elem)},t.prototype.setPosition=function(e){var t=this.getEditorInstance(),n=this.$elem;if(n.attr("style",""),i.isElement(e)){var r=ud(t,e,"bar");return n.css(r),void cd(t,n)}if(a.isText(e)){r=ld(t);return n.css(r),void cd(t,n)}throw new Error("hoverbar.setPosition error, current selected node is not elem nor text")},t.prototype.getSelectedNodeAndMenuKeys=function(){var t=this.getEditorInstance();if(null==t.selection)return null;var n=this.getHoverbarKeysConf(),r=null,o=[],i=function(i){var a=n[i],s=a.match,l=a.menuKeys,u=void 0===l?[]:l,c=s||function(e,t){return uc.checkNodeType(t,i)},f=wa(e.nodes(t,{match:function(e){return c(t,e)},universal:!0}),1),d=f[0];if(null!=d)return r=d[0],o=u,"break"};for(var a in n){if("break"===i(a))break}return null==r||0===o.length?null:{node:r,menuKeys:o}},t.prototype.getEditorInstance=function(){var e=Es.get(this);if(null==e)throw new Error("Can not get editor instance");return e},t.prototype.getHoverbarKeysConf=function(){var e=this.getEditorInstance().getConfig().hoverbarKeys,t=void 0===e?{}:e,n=t.text;return n&&null==n.match&&(n.match=wp),t},t.prototype.isSamePath=function(e,t){if(null==e||null==t)return!1;var r=uc.findPath(null,e),o=uc.findPath(null,t);return n.equals(r,o)},t.prototype.destroy=function(){var e;this.changeHoverbarState.cancel(),this.$elem.remove(),null===(e=this.lngListen)||void 0===e||e.call(this),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null},t}();function Sp(t,n,o,a){if(Rs.set(t,n),js.set(t,o),i.isElement(t)){var s=t.children;if((void 0===s?[]:s).forEach((function(e,n){return Sp(e,n,t,a)})),e.isVoid(a,t)){var l=wa(r.texts(t),1),u=wa(l[0],1)[0];Rs.set(u,0),js.set(u,t)}}}function kp(n){var i=n.selector,a=void 0===i?"":i,c=n.config,d=void 0===c?{}:c,h=n.content,p=n.html,g=n.plugins,v=void 0===g?[]:g,y=(n=>{var r=n,{apply:o}=r;return r.history={undos:[],redos:[]},r.redo=()=>{var{history:t}=r,{redos:n}=t;if(n.length>0){var o=n[n.length-1];mr.withoutSaving(r,(()=>{e.withoutNormalizing(r,(()=>{for(var e of o)r.apply(e)}))})),t.redos.pop(),t.undos.push(o)}},r.undo=()=>{var{history:n}=r,{undos:o}=n;if(o.length>0){var i=o[o.length-1];mr.withoutSaving(r,(()=>{e.withoutNormalizing(r,(()=>{var e=i.map(t.inverse).reverse();for(var n of e)r.apply(n)}))})),n.redos.push(i),n.undos.pop()}},r.apply=e=>{var{operations:t,history:n}=r,{undos:i}=n,a=i[i.length-1],s=a&&a[a.length-1],l=xr(e,s),u=mr.isSaving(r),c=mr.isMerging(r);if(null==u&&(u=wr(e)),u){if(null==c&&(c=null!=a&&(0!==t.length||br(e,s)||l)),a&&c)l&&a.pop(),a.push(e);else{var f=[e];i.push(f)}for(;i.length>100;)i.shift();Sr(e)&&(n.redos=[])}o(e)},r})(function(e){var t=e,n=t.insertText,o=t.insertNode,i=t.insertFragment,a=t.dangerouslyInsertHtml;return t.insertText=function(e){if(t.getConfig().maxLength){var r=uc.getLeftLengthOfMaxLength(t);r<=0||(r<e.length?n(e.slice(0,r)):n(e))}else n(e)},t.insertNode=function(e){if(t.getConfig().maxLength){var n=uc.getLeftLengthOfMaxLength(t);n<=0||n<r.string(e).length||o(e)}else o(e)},t.insertFragment=function(e){if(t.getConfig().maxLength){if(e.length>0){var n=e[0];if(uc.getLeftLengthOfMaxLength(t)<r.string(n).length)return;i([n]);for(var o=1;o<e.length;o++)t.insertNode(e[o])}}else i(e)},t.dangerouslyInsertHtml=function(e,n){if(void 0===e&&(e=""),void 0===n&&(n=!1),e)if(t.getConfig().maxLength){var r=uc.getLeftLengthOfMaxLength(t);if(!(r<=0)){var o=document.createElement("div");o.innerHTML=e;var i=Array.from(o.childNodes).reduce((function(e,t){var n=t.nodeType,r=t.nodeName;return t?n===Tu.TEXT_NODE?e+(t.textContent||""):n===Tu.ELEMENT_NODE?jf.has(r.toLowerCase())?e:e+(t.textContent||""):e:e}),"");r<i.length||a(e,n)}}else a(e,n)},t}(ad(function(t){var n=t;return n.select=function(e){s.select(n,e)},n.deselect=function(){var e=n.selection,r=uc.findDocumentOrShadowRoot(n).getSelection();r&&r.rangeCount>0&&r.removeAllRanges(),e&&s.deselect(t)},n.move=function(e,n){void 0===n&&(n=!1),e&&(e<0||s.move(t,{distance:e,unit:"character",reverse:n}))},n.moveReverse=function(e){n.move(e,!0)},n.restoreSelection=function(){var e=Vs.get(n);null!=e&&(n.focus(),s.select(n,e))},n.getSelectionPosition=function(){return ld(n)},n.getNodePosition=function(e){return ud(n,e)},n.isSelectedAll=function(){var t=n.selection;if(null==t)return!1;var r=wa(o.edges(t),2),i=r[0],a=r[1],s=wa(e.edges(n,[]),2),u=s[0],c=s[1];return!(!l.equals(i,u)||!l.equals(a,c))},n.selectAll=function(){var t=e.start(n,[]),r=e.end(n,[]);s.select(n,{anchor:t,focus:r})},n}(If(function(e){var t=e;return t.getAllMenuKeys=function(){var e=[];for(var t in dc)e.push(t);return e},t.getConfig=function(){var e=Ls.get(t);if(null==e)throw new Error("Can not get editor config");return e},t.getMenuConfig=function(e){var n=t.getConfig().MENU_CONF;return(void 0===n?{}:n)[e]||{}},t.alert=function(e,n){void 0===n&&(n="info");var r=t.getConfig().customAlert;r&&r(e,n)},t}(function(t){var n=t;return n.id="wangEditor-"+cc++,n.isDestroyed=!1,n.isFullScreen=!1,n.focus=function(t){if(uc.toDOMNode(n,n).focus({preventScroll:!0}),Ws.set(n,!0),t){var r=e.end(n,[]);s.select(n,r)}else{var o=Vs.get(n);o?s.select(n,o):s.select(n,e.start(n,[]))}},n.isFocused=function(){return!!Ws.get(n)},n.blur=function(){uc.toDOMNode(n,n).blur(),s.deselect(n),Ws.set(n,!1)},n.updateView=function(){uc.getTextarea(n).changeViewState();var e=uc.getToolbar(n);e&&e.changeToolbarState();var t=uc.getHoverbar(n);t&&t.changeHoverbarState()},n.destroy=function(){if(!n.isDestroyed){var e=uc.getTextarea(n);e.destroy(),ws.delete(n),xs.delete(e);var t=uc.getToolbar(n);t&&(t.destroy(),ks.delete(n),Ss.delete(t));var r=uc.getHoverbar(n);r&&(r.destroy(),Os.delete(n),Es.delete(r)),n.isDestroyed=!0,n.emit("destroyed")}},n.scrollToElem=function(e){if(!n.getConfig().scroll){var t="编辑器禁用了 scroll ,编辑器内容无法滚动,请自行实现该功能";return t+="\nYou has disabled editor scroll, please do this yourself",void console.warn(t)}var r=f("#"+e);if(0!==r.length){var o=r[0];if(!uc.hasDOMNode(n,o))return t="Element (found by id is '"+e+"') is not in editor DOM",t+="\n 通过 id '"+e+"' 找到的 element 不在 editor DOM 之内",void console.error(t,o);var i=uc.getTextarea(n),a=i.$textAreaContainer,s=i.$scroll,l=r.offset().top,u=a.offset().top;s[0].scrollBy({top:l-u,behavior:"smooth"})}},n.showProgressBar=function(e){e<1||uc.getTextarea(n).changeProgress(e)},n.hidePanelOrModal=function(){var e=Ts.get(n);null!=e&&e.forEach((function(e){return e.hide()}))},n.enable=function(){n.getConfig().readOnly=!1,n.updateView()},n.disable=function(){n.getConfig().readOnly=!0,n.updateView()},n.isDisabled=function(){return n.getConfig().readOnly},n.toDOMNode=function(e){return uc.toDOMNode(n,e)},n.fullScreen=function(){if(!n.isFullScreen){var e=null,t=uc.getToolbar(n);t&&(e=t.$box);var r=uc.getTextarea(n).$box.parent();if(e&&e.parent()[0]!==r[0])throw new Error("Can not set full screen, cause toolbar DOM parent is not equal to textarea DOM parent\n不能设置全屏,因为 toolbar DOM 父节点和 textarea DOM 父节点不一致");r.addClass("w-e-full-screen-container");var o=r.css("z-index");r.attr("data-z-index",o.toString()),n.isFullScreen=!0,n.emit("fullScreen")}},n.unFullScreen=function(){if(n.isFullScreen){var e=uc.getTextarea(n).$box.parent();setTimeout((function(){e.removeClass("w-e-full-screen-container"),n.isFullScreen=!1,n.emit("unFullScreen")}),200)}},n.getEditableContainer=function(){return uc.getTextarea(n).$textAreaContainer[0]},n}(function(t){var n=t;return n.setFragmentData=function(t){var r=n.selection;if(r){var i=wa(o.edges(r),2),a=i[0],s=i[1],l=e.void(n,{at:a.path}),u=e.void(n,{at:s.path});if(!o.isCollapsed(r)||l){var c=uc.toDOMRange(n,r),f=c.cloneContents(),d=f.childNodes[0];if(f.childNodes.forEach((function(e){e.textContent&&""!==e.textContent.trim()&&(d=e)})),u){var h=wa(u,1)[0],p=c.cloneRange(),g=uc.toDOMNode(n,h);p.setEndAfter(g),f=p.cloneContents()}if(l&&(d=f.querySelector("[data-slate-spacer]")),Array.from(f.querySelectorAll("[data-slate-zero-width]")).forEach((function(e){var t="n"===e.getAttribute("data-slate-zero-width");e.textContent=t?"\n":""})),Uu(d)){var v=d.ownerDocument.createElement("span");v.style.whiteSpace="pre",v.appendChild(d),f.appendChild(v),d=v}var y=n.getFragment(),m=JSON.stringify(y),b=window.btoa(encodeURIComponent(m));d.setAttribute("data-slate-fragment",b),t.setData("application/x-slate-fragment",b);var w=f.ownerDocument.createElement("div");return w.appendChild(f),w.setAttribute("hidden","true"),f.ownerDocument.body.appendChild(w),t.setData("text/html",w.innerHTML),t.setData("text/plain",Qu(w)),f.ownerDocument.body.removeChild(w),t}}},n.insertData=function(e){var t,r,o=e.getData("application/x-slate-fragment");if(o){var i=decodeURIComponent(window.atob(o)),a=JSON.parse(i);n.insertFragment(a)}else{var l=e.getData("text/plain"),u=e.getData("text/html");if(u)n.dangerouslyInsertHtml(u);else{var c=uc.getLeftLengthOfMaxLength(n);if(l){var f=l.split(/\r\n|\r|\n/),d=!1;try{for(var h=ba(f),p=h.next();!p.done;p=h.next()){var g=p.value;d&&c>0&&s.splitNodes(n,{always:!0}),n.insertText(g),d=!0}}catch(e){t={error:e}}finally{try{p&&!p.done&&(r=h.return)&&r.call(h)}finally{if(t)throw t.error}}}}}},n}(u()))))))));if(a&&function(e,t){return Tf(e,"data-w-e-textarea",t)}(y,a))throw new Error("Repeated create editor by selector '"+a+"'");var m=function(e){void 0===e&&(e={});var t=Z(fc),n={},r=e.MENU_CONF,o=void 0===r?{}:r;return B(t,(function(e,t){n[t]=ma(ma({},e),o[t]||{})})),delete e.MENU_CONF,ma({scroll:!0,readOnly:!1,autoFocus:!0,decorate:function(){return[]},maxLength:0,MENU_CONF:n,hoverbarKeys:{},customAlert:function(e,t){window.alert(t+":\n"+e)}},e)}(d);Ls.set(y,m);var b=m.hoverbarKeys,w=void 0===b?{}:b;if(v.forEach((function(e){y=e(y)})),null!=p&&(y.children=Nf(y,p)),h&&h.length&&(y.children=h),0===y.children.length&&(y.children=[{type:"paragraph",children:[{text:""}]}]),uc.normalizeContent(y),a){var x=new ih(a);ws.set(y,x),xs.set(x,y),x.changeViewState(),Ou((function(){var e=x.$scroll;if(null!=e&&e.height()<300){console.warn("编辑区域高度 < 300px 这可能会导致 modal hoverbar 定位异常\nTextarea height < 300px . This may be cause modal and hoverbar position error",e)}}));var S=void 0;Object.keys(w).length>0&&(S=new xp,Es.set(S,y),Os.set(y,S)),y.on("change",(function(){y.hidePanelOrModal()})),y.on("scroll",(function(){y.hidePanelOrModal()}))}else y.children.forEach((function(e,t){return Sp(e,t,y,y)}));var k=m.onCreated,E=m.onDestroyed;return k&&y.on("created",(function(){return k(y)})),E&&y.on("destroyed",(function(){return E(y)})),Ou((function(){return y.emit("created")})),y}var Ep=yo("splice"),Op=se.TypeError,Cp=Math.max,Tp=Math.min;Dn({target:"Array",proto:!0,forced:!Ep},{splice:function(e,t){var n,r,o,i,a,s,l=rt(this),u=fn(l),c=ln(e,u),f=arguments.length;if(0===f?n=r=0:1===f?(n=0,r=u-c):(n=f-2,r=Tp(Cp(on(t),0),u-c)),u+n-r>9007199254740991)throw Op("Maximum allowed length exceeded");for(o=ir(l,r),i=0;i<r;i++)(a=c+i)in l&&_r(o,i,l[a]);if(o.length=r,n<r){for(i=c;i<u-r;i++)s=i+n,(a=i+r)in l?l[s]=l[a]:delete l[s];for(i=u;i>u-r+n;i--)delete l[i-1]}else if(n>r)for(i=u-r;i>c;i--)s=i+n-1,(a=i+r-1)in l?l[s]=l[a]:delete l[s];for(i=0;i<n;i++)l[i+c]=arguments[i+2];return l.length=u-r+n,o}});var Np=function(){function e(e,t){var n=this;this.$toolbar=f('<div class="w-e-bar w-e-bar-show w-e-toolbar"></div>'),this.menus={},this.toolbarItems=[],this.config={},this.lngListen=function(){},this.changeToolbarState=Q((function(){n.toolbarItems.forEach((function(e){e.changeMenuState()}))}),200),this.config=t;var r=f(e);if(0===r.length)throw new Error("Cannot find toolbar DOM by selector '"+e+"'");this.$box=r;var o=this.$toolbar;o.on("mousedown",(function(e){return e.preventDefault()}),{passive:!1}),r.append(o),Ou((function(){n.initToolbar(),n.lngListen=mp((function(){return n.initToolbar()})),n.getEditorInstance().on("change",n.changeToolbarState)}))}return e.prototype.getMenus=function(){return this.menus},e.prototype.getConfig=function(){return this.config},e.prototype.initToolbar=function(){this.menus={};var e=this.$toolbar;null==e||e.empty(),this.registerItems(),this.changeToolbarState()},e.prototype.registerItems=function(){var e=this,t="",n=this.$toolbar,r=this.config,o=r.toolbarKeys,i=void 0===o?[]:o,a=r.insertKeys,s=void 0===a?{index:0,keys:[]}:a,l=r.excludeKeys,u=void 0===l?[]:l,c=Z(i);s.keys.length>0&&("string"==typeof s.keys&&(s.keys=[s.keys]),s.keys.forEach((function(e,t){c.splice(s.index+t,0,e)})));var f=c.filter((function(e){if("string"==typeof e){if(u.includes(e))return!1}else if(u.includes(e.key))return!1;return!0})),d=f.length;f.forEach((function(r,o){if("|"===r){if(0===o)return;if(o+1===d)return;if("|"===t)return;var i=lh();return n.append(i),void(t=r)}if("string"==typeof r)return e.registerSingleItem(r,e),void(t=r);e.registerGroup(r),t="group"}))},e.prototype.registerGroup=function(e){var t=this,n=this.$toolbar,r=function(e){return new Sh(e)}(e),o=e.menuKeys,i=void 0===o?[]:o,a=this.config.excludeKeys,s=void 0===a?[]:a;i.forEach((function(e){s.includes(e)||t.registerSingleItem(e,r)})),n.append(r.$elem)},e.prototype.registerSingleItem=function(e,t){var n=this.getEditorInstance(),r=t instanceof Sh,o=this.menus,i=o[e];if(null==i){var a=dc[e];if(null==a)throw new Error("Not found menu item factory by key '"+e+"'");if("function"!=typeof a)throw new Error("Menu item factory (key='"+e+"') is not a function");i=a(),o[e]=i}else console.warn("Duplicated toolbar menu key '"+e+"'\n重复注册了菜单栏 menu '"+e+"'");var s=n.getMenuConfig(e);s&&void 0!==s.iconSvg&&(i.iconSvg=s.iconSvg);var l=Oh(e,i,r);(this.toolbarItems.push(l),Cs.set(l,n),r)?t.appendBarItem(l):t.$toolbar.append(l.$elem)},e.prototype.getEditorInstance=function(){var e=Ss.get(this);if(null==e)throw new Error("Can not get editor instance");return e},e.prototype.destroy=function(){var e;this.$toolbar.remove(),null===(e=this.lngListen)||void 0===e||e.call(this),this.menus={},this.toolbarItems=[]},e}();function Lp(e,t){if(null==e)throw new Error("Cannot create toolbar, because editor is null");var n=t.selector,r=t.config,o=void 0===r?{}:r;if(function(e,t){return Tf(e,"data-w-e-toolbar",t)}(e,n))throw new Error("Repeated create toolbar by selector '"+n+"'");var i=ma({toolbarKeys:[],excludeKeys:[],insertKeys:{index:0,keys:[]},modalAppendToBody:!1},o||{}),a=new Np(n,i);return Ss.set(a,e),ks.set(e,a),a}var Mp=en.EXISTS,Pp=Mt.f,Dp=Function.prototype,Rp=xe(Dp.toString),jp=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,Ap=xe(jp.exec);function Ip(e){var t=e.server,n=void 0===t?"":t,r=e.fieldName,o=void 0===r?"":r,i=e.maxFileSize,a=void 0===i?10485760:i,s=e.maxNumberOfFiles,l=void 0===s?100:s,u=e.meta,c=void 0===u?{}:u,f=e.metaWithUrl,d=void 0!==f&&f,h=e.headers,p=void 0===h?{}:h,g=e.withCredentials,v=void 0!==g&&g,y=e.timeout,m=void 0===y?1e4:y,b=e.onBeforeUpload,w=void 0===b?function(e){return e}:b,x=e.onSuccess,S=void 0===x?function(e,t){}:x,k=e.onError,E=void 0===k?function(e,t,n){console.error(e.name+" upload error",t,n)}:k,O=e.onProgress,C=void 0===O?function(e){}:O;if(!n)throw new Error("Cannot get upload server address\n没有配置上传地址");if(!o)throw new Error("Cannot get fieldName\n没有配置 fieldName");var T=n;d&&(T=function(e,t){var n=wa(e.split("#"),2),r=n[0],o=n[1],i=[];B(t,(function(e,t){i.push(t+"="+e)}));var a=i.join("&");return r=r.indexOf("?")>0?r+"&"+a:r+"?"+a,o?r+"#"+o:r}(T,c));var N=new ee({onBeforeUpload:w,restrictions:{maxFileSize:a,maxNumberOfFiles:l},meta:c}).use(te,{endpoint:T,headers:p,formData:!0,fieldName:o,bundle:!0,withCredentials:v,timeout:m});return N.on("upload-success",(function(e,t){var n=t.body,r=void 0===n?{}:n;try{S(e,r)}catch(e){console.error("wangEditor upload file - onSuccess error",e)}N.removeFile(e.id)})),N.on("progress",(function(e){e<1||C(e)})),N.on("upload-error",(function(e,t,n){try{E(e,t,n)}catch(e){console.error("wangEditor upload file - onError error",e)}N.removeFile(e.id)})),N.on("restriction-failed",(function(e,t){try{E(e,t)}catch(e){console.error("wangEditor upload file - onError error",e)}N.removeFile(e.id)})),N}ue&&!Mp&&Pp(Dp,"name",{configurable:!0,get:function(){try{return Ap(jp,Rp(this))[1]}catch(e){return""}}});export{ju as DOMComment,Au as DOMElement,Ru as DOMNode,Fu as DOMRange,Bu as DOMSelection,_u as DOMStaticRange,Iu as DOMText,uc as DomEditor,Tc as ELEM_TO_HTML_CONF,Tu as NodeType,$c as PARSE_ELEM_HTML_CONF,Bc as PARSE_STYLE_HTML_FN_LIST,Ic as PRE_PARSE_HTML_CONF_LIST,Ld as RENDER_ELEM_CONF,Td as RENDER_STYLE_HANDLER_LIST,Oc as STYLE_TO_HTML_FN_LIST,Ac as TEXT_TAGS,Np as Toolbar,kp as coreCreateEditor,Lp as coreCreateToolbar,Ip as createUploader,mh as genModalButtonElems,vh as genModalInputElems,yh as genModalTextareaElems,$u as getDefaultView,Xu as getEditableChild,Yu as getEditableChildAndIndex,Ju as getElementById,Zu as getFirstVoidChild,Qu as getPlainText,tc as getTagName,Gu as hasShadowRoot,gp as i18nAddResources,vp as i18nChangeLanguage,yp as i18nGetResources,mp as i18nListenLanguage,Wu as isDOMComment,Vu as isDOMElement,zu as isDOMNode,Hu as isDOMSelection,Uu as isDOMText,Mu as isDataTransfer,Nu as isDocument,Du as isHTMLElememt,Ku as isPlainTextOnlyPaste,Lu as isShadowRoot,qu as normalizeDOMPoint,Nc as registerElemToHtmlConf,hc as registerMenu,Wc as registerParseElemHtmlConf,_c as registerParseStyleHtmlHandler,Fc as registerPreParseHtmlConf,Md as registerRenderElemConf,Nd as registerStyleHandler,Cc as registerStyleToHtmlHandler,bp as t,ec as walkTextNodes};
|
|
8
|
+
function Sr(e){return"[object Object]"===Object.prototype.toString.call(e)}wr(Qn);var Er={isHistory(e){return!1!==Sr(t=e)&&(void 0===(r=t.constructor)||!1!==Sr(o=r.prototype)&&!1!==o.hasOwnProperty("isPrototypeOf"))&&Array.isArray(e.redos)&&Array.isArray(e.undos)&&(0===e.redos.length||n.isOperationList(e.redos[0].operations))&&(0===e.undos.length||n.isOperationList(e.undos[0].operations));var t,r,o}},Or=new WeakMap,kr=new WeakMap,Cr={isHistoryEditor:e=>Er.isHistory(e.history)&&t.isEditor(e),isMerging:e=>kr.get(e),isSaving:e=>Or.get(e),redo(e){e.redo()},undo(e){e.undo()},withMerging(e,t){var n=Cr.isMerging(e);kr.set(e,!0),t(),kr.set(e,n)},withoutMerging(e,t){var n=Cr.isMerging(e);kr.set(e,!1),t(),kr.set(e,n)},withoutSaving(e,t){var n=Cr.isSaving(e);Or.set(e,!1),t(),Or.set(e,n)}},Tr=(e,t)=>!(!t||"insert_text"!==e.type||"insert_text"!==t.type||e.offset!==t.offset+t.text.length||!r.equals(e.path,t.path))||!(!t||"remove_text"!==e.type||"remove_text"!==t.type||e.offset+e.text.length!==t.offset||!r.equals(e.path,t.path)),Nr=(e,t)=>"set_selection"!==e.type,Lr=String,Mr=function(e){if("Symbol"===qn(e))throw new TypeError("Cannot convert a Symbol value to a string");return Lr(e)},Pr=function(){var e=Pt(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},Dr=RegExp.prototype,Rr=function(e){var t=e.flags;return void 0!==t||"flags"in Dr||lt(e,"flags")||!Ie(Dr,e)?t:de(Pr,e)},jr=zt.PROPER,Ar="toString",Ir=RegExp.prototype,Fr=Ir[Ar],Br=ce((function(){return"/a/b"!==Fr.call({source:"a",flags:"b"})})),_r=jr&&Fr.name!==Ar;(Br||_r)&&cn(Ir,Ar,(function(){var e=Pt(this);return"/"+Mr(e.source)+"/"+Mr(Rr(e))}),{unsafe:!0});var $r=function(e,t,n){var r,o;Pt(e);try{if(!(r=et(e,"return"))){if("throw"===t)throw n;return n}r=de(r,e)}catch(e){o=!0,r=e}if("throw"===t)throw n;if(o)throw r;return Pt(r),n},Wr=function(e,t,n,r){try{return r?t(Pt(n)[0],n[1]):t(n)}catch(t){$r(e,"throw",t)}},Vr={},zr=yt("iterator"),Hr=Array.prototype,Ur=function(e){return void 0!==e&&(Vr.Array===e||Hr[zr]===e)},Kr=function(e,t,n){le?Bt.f(e,t,ye(0,n)):e[t]=n},qr=yt("iterator"),Gr=function(e){if(!Ne(e))return et(e,qr)||et(e,"@@iterator")||Vr[qn(e)]},Jr=TypeError,Yr=function(e,t){var n=arguments.length<2?Gr(e):t;if(Ze(n))return Pt(de(n,e));throw new Jr(Xe(e)+" is not iterable")},Xr=Array,Qr=yt("iterator"),Zr=!1;try{var eo=0,to={next:function(){return{done:!!eo++}},return:function(){Zr=!0}};to[Qr]=function(){return this},Array.from(to,(function(){throw 2}))}catch(e){}var no=function(e,t){try{if(!t&&!Zr)return!1}catch(e){return!1}var n=!1;try{var r={};r[Qr]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},ro=!no((function(e){Array.from(e)}));_n({target:"Array",stat:!0,forced:ro},{from:function(e){var t=st(e),n=ur(this),r=arguments.length,o=r>1?arguments[1]:void 0,i=void 0!==o;i&&(o=tr(o,r>2?arguments[2]:void 0));var a,s,c,l,u,f,d=Gr(t),h=0;if(!d||this===Xr&&Ur(d))for(a=mn(t),s=n?new this(a):Xr(a);a>h;h++)f=i?o(t[h],h):t[h],Kr(s,h,f);else for(s=n?new this:[],u=(l=Yr(t,d)).next;!(c=de(u,l)).done;h++)f=i?Wr(l,o,[c.value,h],!0):c.value,Kr(s,h,f);return s.length=h,s}});var oo,io=le&&!Nt?Object.defineProperties:function(e,t){Pt(e);for(var n,r=Pe(t),o=$n(t),i=o.length,a=0;i>a;)Bt.f(e,n=o[a++],r[n]);return e},ao={f:io},so=Ae("document","documentElement"),co="prototype",lo="script",uo=Qt("IE_PROTO"),fo=function(){},ho=function(e){return"<"+lo+">"+e+"</"+lo+">"},po=function(e){e.write(ho("")),e.close();var t=e.parentWindow.Object;return e=null,t},go=function(){try{oo=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;go="undefined"!=typeof document?document.domain&&oo?po(oo):(t=Ot("iframe"),n="java"+lo+":",t.style.display="none",so.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(ho("document.F=Object")),e.close(),e.F):po(oo);for(var r=On.length;r--;)delete go[co][On[r]];return go()};Zt[uo]=!0;var vo=Object.create||function(e,t){var n;return null!==e?(fo[co]=Pt(e),n=new fo,fo[co]=null,n[uo]=e):n=go(),void 0===t?n:ao.f(n,t)},yo=Bt.f,mo=yt("unscopables"),bo=Array.prototype;void 0===bo[mo]&&yo(bo,mo,{configurable:!0,value:vo(null)});var wo=function(e){bo[mo][e]=!0},xo=wn.includes,So=ce((function(){return!Array(1).includes()}));_n({target:"Array",proto:!0,forced:So},{includes:function(e){return xo(this,e,arguments.length>1?arguments[1]:void 0)}}),wo("includes");var Eo=xe([].join),Oo=Te!==Object||!yr("join",",");_n({target:"Array",proto:!0,forced:Oo},{join:function(e){return Eo(Pe(this),void 0===e?",":e)}});var ko=yt("species"),Co=function(e){return He>=51||!ce((function(){var t=[];return(t.constructor={})[ko]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},To=vr.map,No=Co("map");_n({target:"Array",proto:!0,forced:!No},{map:function(e){return To(this,e,arguments.length>1?arguments[1]:void 0)}});var Lo=!ce((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Mo=Qt("IE_PROTO"),Po=Object,Do=Po.prototype,Ro=Lo?Po.getPrototypeOf:function(e){var t=st(e);if(lt(t,Mo))return t[Mo];var n=t.constructor;return Re(n)&&t instanceof n?n.prototype:t instanceof Po?Do:null};_n({target:"Reflect",stat:!0},{get:function e(t,n){var r,o,i=arguments.length<3?t:arguments[2];return Pt(t)===i?t[n]:(r=Tt.f(t,n))?function(e){return void 0!==e&&(lt(e,"value")||lt(e,"writable"))}(r)?r.value:void 0===r.get?void 0:de(r.get,i):je(o=Ro(t))?e(o,n,i):void 0}});var jo=se.RegExp,Ao=ce((function(){var e=jo("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),Io=Ao||ce((function(){return!jo("a","y").sticky})),Fo={BROKEN_CARET:Ao||ce((function(){var e=jo("^r","gy");return e.lastIndex=2,null!==e.exec("str")})),MISSED_STICKY:Io,UNSUPPORTED_Y:Ao},Bo=se.RegExp,_o=ce((function(){var e=Bo(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)})),$o=se.RegExp,Wo=ce((function(){var e=$o("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Vo=an.get,zo=it("native-string-replace",String.prototype.replace),Ho=RegExp.prototype.exec,Uo=Ho,Ko=xe("".charAt),qo=xe("".indexOf),Go=xe("".replace),Jo=xe("".slice),Yo=function(){var e=/a/,t=/b*/g;return de(Ho,e,"a"),de(Ho,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),Xo=Fo.BROKEN_CARET,Qo=void 0!==/()??/.exec("")[1];(Yo||Qo||Xo||_o||Wo)&&(Uo=function(e){var t,n,r,o,i,a,s,c=this,l=Vo(c),u=Mr(e),f=l.raw;if(f)return f.lastIndex=c.lastIndex,t=de(Uo,f,u),c.lastIndex=f.lastIndex,t;var d=l.groups,h=Xo&&c.sticky,p=de(Pr,c),g=c.source,v=0,y=u;if(h&&(p=Go(p,"y",""),-1===qo(p,"g")&&(p+="g"),y=Jo(u,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==Ko(u,c.lastIndex-1))&&(g="(?: "+g+")",y=" "+y,v++),n=new RegExp("^(?:"+g+")",p)),Qo&&(n=new RegExp("^"+g+"$(?!\\s)",p)),Yo&&(r=c.lastIndex),o=de(Ho,h?n:c,y),h?o?(o.input=Jo(o.input,v),o[0]=Jo(o[0],v),o.index=c.lastIndex,c.lastIndex+=o[0].length):c.lastIndex=0:Yo&&o&&(c.lastIndex=c.global?o.index+o[0].length:r),Qo&&o&&o.length>1&&de(zo,o[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(o[i]=void 0)})),o&&d)for(o.groups=a=vo(null),i=0;i<d.length;i++)a[(s=d[i])[0]]=o[s[1]];return o});var Zo=Uo;_n({target:"RegExp",proto:!0,forced:/./.exec!==Zo},{exec:Zo});var ei,ti=yt("match"),ni=function(e){var t;return je(e)&&(void 0!==(t=e[ti])?!!t:"RegExp"===Oe(e))},ri=TypeError,oi=function(e){if(ni(e))throw new ri("The method doesn't accept regular expressions");return e},ii=yt("match"),ai=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[ii]=!1,"/./"[e](t)}catch(e){}}return!1},si=Tt.f,ci=Zn("".slice),li=Math.min,ui=ai("endsWith"),fi=!(ui||(ei=si(String.prototype,"endsWith"),!ei||ei.writable));_n({target:"String",proto:!0,forced:!fi&&!ui},{endsWith:function(e){var t=Mr(Me(this));oi(e);var n=arguments.length>1?arguments[1]:void 0,r=t.length,o=void 0===n?r:li(yn(n),r),i=Mr(e);return ci(t,o-i.length,o)===i}});var di=xe("".indexOf);_n({target:"String",proto:!0,forced:!ai("includes")},{includes:function(e){return!!~di(Mr(Me(this)),Mr(oi(e)),arguments.length>1?arguments[1]:void 0)}});var hi,pi,gi,vi=xe("".charAt),yi=xe("".charCodeAt),mi=xe("".slice),bi=function(e){return function(t,n){var r,o,i=Mr(Me(t)),a=dn(n),s=i.length;return a<0||a>=s?e?"":void 0:(r=yi(i,a))<55296||r>56319||a+1===s||(o=yi(i,a+1))<56320||o>57343?e?vi(i,a):r:e?mi(i,a,a+2):o-56320+(r-55296<<10)+65536}},wi={codeAt:bi(!1),charAt:bi(!0)},xi=yt("iterator"),Si=!1;[].keys&&("next"in(gi=[].keys())?(pi=Ro(Ro(gi)))!==Object.prototype&&(hi=pi):Si=!0);var Ei=!je(hi)||ce((function(){var e={};return hi[xi].call(e)!==e}));Ei&&(hi={}),Re(hi[xi])||cn(hi,xi,(function(){return this}));var Oi={IteratorPrototype:hi,BUGGY_SAFARI_ITERATORS:Si},ki=Bt.f,Ci=yt("toStringTag"),Ti=function(e,t,n){e&&!n&&(e=e.prototype),e&&!lt(e,Ci)&&ki(e,Ci,{configurable:!0,value:t})},Ni=Oi.IteratorPrototype,Li=function(){return this},Mi=String,Pi=TypeError,Di=function(e){if(function(e){return je(e)||null===e}(e))return e;throw new Pi("Can't set "+Mi(e)+" as a prototype")},Ri=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{e=function(e,t,n){try{return xe(Ze(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}(Object.prototype,"__proto__","set"),e(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return Me(n),Di(r),je(n)?(t?e(n,r):n.__proto__=r,n):n}}():void 0),ji=zt.PROPER,Ai=zt.CONFIGURABLE,Ii=Oi.IteratorPrototype,Fi=Oi.BUGGY_SAFARI_ITERATORS,Bi=yt("iterator"),_i="keys",$i="values",Wi="entries",Vi=function(){return this},zi=function(e,t,n,r,o,i,a){!function(e,t,n,r){var o=t+" Iterator";e.prototype=vo(Ni,{next:ye(+!r,n)}),Ti(e,o,!1),Vr[o]=Li}(n,t,r);var s,c,l,u=function(e){if(e===o&&g)return g;if(!Fi&&e&&e in h)return h[e];switch(e){case _i:case $i:case Wi:return function(){return new n(this,e)}}return function(){return new n(this)}},f=t+" Iterator",d=!1,h=e.prototype,p=h[Bi]||h["@@iterator"]||o&&h[o],g=!Fi&&p||u(o),v="Array"===t&&h.entries||p;if(v&&(s=Ro(v.call(new e)))!==Object.prototype&&s.next&&(Ro(s)!==Ii&&(Ri?Ri(s,Ii):Re(s[Bi])||cn(s,Bi,Vi)),Ti(s,f,!0)),ji&&o===$i&&p&&p.name!==$i&&(Ai?_t(h,"name",$i):(d=!0,g=function(){return de(p,this)})),o)if(c={values:u($i),keys:i?g:u(_i),entries:u(Wi)},a)for(l in c)(Fi||d||!(l in h))&&cn(h,l,c[l]);else _n({target:t,proto:!0,forced:Fi||d},c);return h[Bi]!==g&&cn(h,Bi,g,{name:o}),Vr[t]=g,c},Hi=function(e,t){return{value:e,done:t}},Ui=wi.charAt,Ki="String Iterator",qi=an.set,Gi=an.getterFor(Ki);zi(String,"String",(function(e){qi(this,{type:Ki,string:Mr(e),index:0})}),(function(){var e,t=Gi(this),n=t.string,r=t.index;return r>=n.length?Hi(void 0,!0):(e=Ui(n,r),t.index+=e.length,Hi(e,!1))}));var Ji=Function.prototype,Yi=Ji.apply,Xi=Ji.call,Qi="object"==typeof Reflect&&Reflect.apply||(ue?Xi.bind(Yi):function(){return Xi.apply(Yi,arguments)}),Zi=yt("species"),ea=RegExp.prototype,ta=function(e,t,n,r){var o=yt(e),i=!ce((function(){var t={};return t[o]=function(){return 7},7!==""[e](t)})),a=i&&!ce((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[Zi]=function(){return n},n.flags="",n[o]=/./[o]),n.exec=function(){return t=!0,null},n[o](""),!t}));if(!i||!a||n){var s=/./[o],c=t(o,""[e],(function(e,t,n,r,o){var a=t.exec;return a===Zo||a===ea.exec?i&&!o?{done:!0,value:de(s,t,n,r)}:{done:!0,value:de(e,n,t,r)}:{done:!1}}));cn(String.prototype,e,c[0]),cn(ea,o,c[1])}r&&_t(ea[o],"sham",!0)},na=wi.charAt,ra=function(e,t,n){return t+(n?na(e,t).length:1)},oa=Math.floor,ia=xe("".charAt),aa=xe("".replace),sa=xe("".slice),ca=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,la=/\$([$&'`]|\d{1,2})/g,ua=function(e,t,n,r,o,i){var a=n+e.length,s=r.length,c=la;return void 0!==o&&(o=st(o),c=ca),aa(i,c,(function(i,c){var l;switch(ia(c,0)){case"$":return"$";case"&":return e;case"`":return sa(t,0,n);case"'":return sa(t,a);case"<":l=o[sa(c,1,-1)];break;default:var u=+c;if(0===u)return i;if(u>s){var f=oa(u/10);return 0===f?i:f<=s?void 0===r[f-1]?ia(c,1):r[f-1]+ia(c,1):i}l=r[u-1]}return void 0===l?"":l}))},fa=TypeError,da=function(e,t){var n=e.exec;if(Re(n)){var r=de(n,e,t);return null!==r&&Pt(r),r}if("RegExp"===Oe(e))return de(Zo,e,t);throw new fa("RegExp#exec called on incompatible receiver")},ha=yt("replace"),pa=Math.max,ga=Math.min,va=xe([].concat),ya=xe([].push),ma=xe("".indexOf),ba=xe("".slice),wa="$0"==="a".replace(/./,"$0"),xa=!!/./[ha]&&""===/./[ha]("a","$0");ta("replace",(function(e,t,n){var r=xa?"$":"$0";return[function(e,n){var r=Me(this),o=Ne(e)?void 0:et(e,ha);return o?de(o,e,r,n):de(t,Mr(r),e,n)},function(e,o){var i=Pt(this),a=Mr(e);if("string"==typeof o&&-1===ma(o,r)&&-1===ma(o,"$<")){var s=n(t,i,a,o);if(s.done)return s.value}var c=Re(o);c||(o=Mr(o));var l,u=i.global;u&&(l=i.unicode,i.lastIndex=0);for(var f,d=[];null!==(f=da(i,a))&&(ya(d,f),u);){""===Mr(f[0])&&(i.lastIndex=ra(a,yn(i.lastIndex),l))}for(var h,p="",g=0,v=0;v<d.length;v++){for(var y,m=Mr((f=d[v])[0]),b=pa(ga(dn(f.index),a.length),0),w=[],x=1;x<f.length;x++)ya(w,void 0===(h=f[x])?h:String(h));var S=f.groups;if(c){var E=va([m],w,b,a);void 0!==S&&ya(E,S),y=Mr(Qi(o,void 0,E))}else y=ua(m,a,b,w,S,o);b>=g&&(p+=ba(a,g,b)+y,g=b+m.length)}return p+ba(a,g)}]}),!!ce((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!wa||xa);var Sa,Ea=/"/g,Oa=xe("".replace);_n({target:"String",proto:!0,forced:(Sa="anchor",ce((function(){var e=""[Sa]('"');return e!==e.toLowerCase()||e.split('"').length>3})))},{anchor:function(e){return t="a",n="name",r=e,o=Mr(Me(this)),i="<"+t,""!==n&&(i+=" "+n+'="'+Oa(Mr(r),Ea,""")+'"'),i+">"+o+"</"+t+">";var t,n,r,o,i}});var ka=function(e,t){return ka=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ka(e,t)};function Ca(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ka(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Ta=function(){return Ta=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ta.apply(this,arguments)};function Na(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function La(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function Ma(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var Pa=vr.find,Da="find",Ra=!0;Da in[]&&Array(1)[Da]((function(){Ra=!1})),_n({target:"Array",proto:!0,forced:Ra},{find:function(e){return Pa(this,e,arguments.length>1?arguments[1]:void 0)}}),wo(Da),_n({global:!0,forced:se.globalThis!==se},{globalThis:se});const ja=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","isindex","keygen","link","menuitem","meta","nextid","param","source","track","wbr"];var Aa=TypeError,Ia=function(e){if(e>9007199254740991)throw Aa("Maximum allowed index exceeded");return e},Fa=yt("isConcatSpreadable"),Ba=He>=51||!ce((function(){var e=[];return e[Fa]=!1,e.concat()[0]!==e})),_a=function(e){if(!je(e))return!1;var t=e[Fa];return void 0!==t?!!t:nr(e)},$a=!Ba||!Co("concat");_n({target:"Array",proto:!0,arity:1,forced:$a},{concat:function(e){var t,n,r,o,i,a=st(this),s=hr(a,0),c=0;for(t=-1,r=arguments.length;t<r;t++)if(_a(i=-1===t?a:arguments[t]))for(o=mn(i),Ia(c+o),n=0;n<o;n++,c++)n in i&&Kr(s,c,i[n]);else Ia(c+1),Kr(s,c++,i);return s.length=c,s}});var Wa,Va,za,Ha,Ua=function(e){return _e.slice(0,e.length)===e},Ka=Ua("Bun/")?"BUN":Ua("Cloudflare-Workers")?"CLOUDFLARE":Ua("Deno/")?"DENO":Ua("Node.js/")?"NODE":se.Bun&&"string"==typeof Bun.version?"BUN":se.Deno&&"object"==typeof Deno.version?"DENO":"process"===Oe(se.process)?"NODE":se.window&&se.document?"BROWSER":"REST",qa="NODE"===Ka,Ga=function(e,t,n){return n.get&&sn(n.get,t,{getter:!0}),n.set&&sn(n.set,t,{setter:!0}),Bt.f(e,t,n)},Ja=yt("species"),Ya=function(e){var t=Ae(e);le&&t&&!t[Ja]&&Ga(t,Ja,{configurable:!0,get:function(){return this}})},Xa=TypeError,Qa=function(e,t){if(Ie(t,e))return e;throw new Xa("Incorrect invocation")},Za=TypeError,es=yt("species"),ts=function(e,t){var n,r=Pt(e).constructor;return void 0===r||Ne(n=Pt(r)[es])?t:function(e){if(ur(e))return e;throw new Za(Xe(e)+" is not a constructor")}(n)},ns=xe([].slice),rs=TypeError,os=/(?:ipad|iphone|ipod).*applewebkit/i.test(_e),is=se.setImmediate,as=se.clearImmediate,ss=se.process,cs=se.Dispatch,ls=se.Function,us=se.MessageChannel,fs=se.String,ds=0,hs={},ps="onreadystatechange";ce((function(){Wa=se.location}));var gs=function(e){if(lt(hs,e)){var t=hs[e];delete hs[e],t()}},vs=function(e){return function(){gs(e)}},ys=function(e){gs(e.data)},ms=function(e){se.postMessage(fs(e),Wa.protocol+"//"+Wa.host)};is&&as||(is=function(e){!function(e,t){if(e<t)throw new rs("Not enough arguments")}(arguments.length,1);var t=Re(e)?e:ls(e),n=ns(arguments,1);return hs[++ds]=function(){Qi(t,void 0,n)},Va(ds),ds},as=function(e){delete hs[e]},qa?Va=function(e){ss.nextTick(vs(e))}:cs&&cs.now?Va=function(e){cs.now(vs(e))}:us&&!os?(Ha=(za=new us).port2,za.port1.onmessage=ys,Va=tr(Ha.postMessage,Ha)):se.addEventListener&&Re(se.postMessage)&&!se.importScripts&&Wa&&"file:"!==Wa.protocol&&!ce(ms)?(Va=ms,se.addEventListener("message",ys,!1)):Va=ps in Ot("script")?function(e){so.appendChild(Ot("script"))[ps]=function(){so.removeChild(this),gs(e)}}:function(e){setTimeout(vs(e),0)});var bs={set:is,clear:as},ws=Object.getOwnPropertyDescriptor,xs=function(){this.head=null,this.tail=null};xs.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}};var Ss,Es,Os,ks,Cs,Ts=xs,Ns=/ipad|iphone|ipod/i.test(_e)&&"undefined"!=typeof Pebble,Ls=/web0s(?!.*chrome)/i.test(_e),Ms=bs.set,Ps=se.MutationObserver||se.WebKitMutationObserver,Ds=se.document,Rs=se.process,js=se.Promise,As=function(e){if(!le)return se[e];var t=ws(se,e);return t&&t.value}("queueMicrotask");if(!As){var Is=new Ts,Fs=function(){var e,t;for(qa&&(e=Rs.domain)&&e.exit();t=Is.get();)try{t()}catch(e){throw Is.head&&Ss(),e}e&&e.enter()};os||qa||Ls||!Ps||!Ds?!Ns&&js&&js.resolve?((ks=js.resolve(void 0)).constructor=js,Cs=tr(ks.then,ks),Ss=function(){Cs(Fs)}):qa?Ss=function(){Rs.nextTick(Fs)}:(Ms=tr(Ms,se),Ss=function(){Ms(Fs)}):(Es=!0,Os=Ds.createTextNode(""),new Ps(Fs).observe(Os,{characterData:!0}),Ss=function(){Os.data=Es=!Es}),As=function(e){Is.head||Ss(),Is.add(e)}}var Bs=As,_s=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},$s=se.Promise;$s&&$s.prototype;var Ws,Vs,zs,Hs=yt("species"),Us=!1,Ks=Re(se.PromiseRejectionEvent),qs=Fn("Promise",(function(){var e=Gt($s),t=e!==String($s);if(!t&&66===He)return!0;if(!He||He<51||!/native code/.test(e)){var n=new $s((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};if((n.constructor={})[Hs]=r,!(Us=n.then((function(){}))instanceof r))return!0}return!(t||"BROWSER"!==Ka&&"DENO"!==Ka||Ks)})),Gs={CONSTRUCTOR:qs,REJECTION_EVENT:Ks,SUBCLASSING:Us},Js=TypeError,Ys=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw new Js("Bad Promise constructor");t=e,n=r})),this.resolve=Ze(t),this.reject=Ze(n)},Xs={f:function(e){return new Ys(e)}},Qs=bs.set,Zs="Promise",ec=Gs.CONSTRUCTOR,tc=Gs.REJECTION_EVENT,nc=Gs.SUBCLASSING,rc=an.getterFor(Zs),oc=an.set,ic=$s&&$s.prototype,ac=$s,sc=ic,cc=se.TypeError,lc=se.document,uc=se.process,fc=Xs.f,dc=fc,hc=!!(lc&&lc.createEvent&&se.dispatchEvent),pc="unhandledrejection",gc=function(e){var t;return!(!je(e)||!Re(t=e.then))&&t},vc=function(e,t){var n,r,o,i=t.value,a=1===t.state,s=a?e.ok:e.fail,c=e.resolve,l=e.reject,u=e.domain;try{s?(a||(2===t.rejection&&xc(t),t.rejection=1),!0===s?n=i:(u&&u.enter(),n=s(i),u&&(u.exit(),o=!0)),n===e.promise?l(new cc("Promise-chain cycle")):(r=gc(n))?de(r,n,c,l):c(n)):l(i)}catch(e){u&&!o&&u.exit(),l(e)}},yc=function(e,t){e.notified||(e.notified=!0,Bs((function(){for(var n,r=e.reactions;n=r.get();)vc(n,e);e.notified=!1,t&&!e.rejection&&bc(e)})))},mc=function(e,t,n){var r,o;hc?((r=lc.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),se.dispatchEvent(r)):r={promise:t,reason:n},!tc&&(o=se["on"+e])?o(r):e===pc&&function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}("Unhandled promise rejection",n)},bc=function(e){de(Qs,se,(function(){var t,n=e.facade,r=e.value;if(wc(e)&&(t=_s((function(){qa?uc.emit("unhandledRejection",r,n):mc(pc,n,r)})),e.rejection=qa||wc(e)?2:1,t.error))throw t.value}))},wc=function(e){return 1!==e.rejection&&!e.parent},xc=function(e){de(Qs,se,(function(){var t=e.facade;qa?uc.emit("rejectionHandled",t):mc("rejectionhandled",t,e.value)}))},Sc=function(e,t,n){return function(r){e(t,r,n)}},Ec=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,yc(e,!0))},Oc=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw new cc("Promise can't be resolved itself");var r=gc(t);r?Bs((function(){var n={done:!1};try{de(r,t,Sc(Oc,n,e),Sc(Ec,n,e))}catch(t){Ec(n,t,e)}})):(e.value=t,e.state=1,yc(e,!1))}catch(t){Ec({done:!1},t,e)}}};if(ec&&(sc=(ac=function(e){Qa(this,sc),Ze(e),de(Ws,this);var t=rc(this);try{e(Sc(Oc,t),Sc(Ec,t))}catch(e){Ec(t,e)}}).prototype,(Ws=function(e){oc(this,{type:Zs,done:!1,notified:!1,parent:!1,reactions:new Ts,rejection:!1,state:0,value:null})}).prototype=cn(sc,"then",(function(e,t){var n=rc(this),r=fc(ts(this,ac));return n.parent=!0,r.ok=!Re(e)||e,r.fail=Re(t)&&t,r.domain=qa?uc.domain:void 0,0===n.state?n.reactions.add(r):Bs((function(){vc(r,n)})),r.promise})),Vs=function(){var e=new Ws,t=rc(e);this.promise=e,this.resolve=Sc(Oc,t),this.reject=Sc(Ec,t)},Xs.f=fc=function(e){return e===ac||undefined===e?new Vs(e):dc(e)},Re($s)&&ic!==Object.prototype)){zs=ic.then,nc||cn(ic,"then",(function(e,t){var n=this;return new ac((function(e,t){de(zs,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete ic.constructor}catch(e){}Ri&&Ri(ic,sc)}_n({global:!0,constructor:!0,wrap:!0,forced:ec},{Promise:ac}),Ti(ac,Zs,!1),Ya(Zs);var kc=TypeError,Cc=function(e,t){this.stopped=e,this.result=t},Tc=Cc.prototype,Nc=function(e,t,n){var r,o,i,a,s,c,l,u=n&&n.that,f=!(!n||!n.AS_ENTRIES),d=!(!n||!n.IS_RECORD),h=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),g=tr(t,u),v=function(e){return r&&$r(r,"normal",e),new Cc(!0,e)},y=function(e){return f?(Pt(e),p?g(e[0],e[1],v):g(e[0],e[1])):p?g(e,v):g(e)};if(d)r=e.iterator;else if(h)r=e;else{if(!(o=Gr(e)))throw new kc(Xe(e)+" is not iterable");if(Ur(o)){for(i=0,a=mn(e);a>i;i++)if((s=y(e[i]))&&Ie(Tc,s))return s;return new Cc(!1)}r=Yr(e,o)}for(c=d?e.next:r.next;!(l=de(c,r)).done;){try{s=y(l.value)}catch(e){$r(r,"throw",e)}if("object"==typeof s&&s&&Ie(Tc,s))return s}return new Cc(!1)},Lc=Gs.CONSTRUCTOR||!no((function(e){$s.all(e).then(void 0,(function(){}))}));_n({target:"Promise",stat:!0,forced:Lc},{all:function(e){var t=this,n=Xs.f(t),r=n.resolve,o=n.reject,i=_s((function(){var n=Ze(t.resolve),i=[],a=0,s=1;Nc(e,(function(e){var c=a++,l=!1;s++,de(n,t,e).then((function(e){l||(l=!0,i[c]=e,--s||r(i))}),o)})),--s||r(i)}));return i.error&&o(i.value),n.promise}});var Mc=Gs.CONSTRUCTOR,Pc=$s&&$s.prototype;if(_n({target:"Promise",proto:!0,forced:Mc,real:!0},{catch:function(e){return this.then(void 0,e)}}),Re($s)){var Dc=Ae("Promise").prototype.catch;Pc.catch!==Dc&&cn(Pc,"catch",Dc,{unsafe:!0})}_n({target:"Promise",stat:!0,forced:Lc},{race:function(e){var t=this,n=Xs.f(t),r=n.reject,o=_s((function(){var o=Ze(t.resolve);Nc(e,(function(e){de(o,t,e).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}}),_n({target:"Promise",stat:!0,forced:Gs.CONSTRUCTOR},{reject:function(e){var t=Xs.f(this);return(0,t.reject)(e),t.promise}});var Rc=Gs.CONSTRUCTOR;function jc(e){Promise.resolve().then(e)}Ae("Promise"),_n({target:"Promise",stat:!0,forced:Rc},{resolve:function(e){return function(e,t){if(Pt(e),je(t)&&t.constructor===e)return t;var n=Xs.f(e);return(0,n.resolve)(t),n.promise}(this,e)}});var Ac=function(e){return Object.prototype.toString.call(e)};d&&(f.fn.css=d),h&&(f.fn.append=h),p&&(f.fn.addClass=p),g&&(f.fn.removeClass=g),v&&(f.fn.hasClass=v),y&&(f.fn.on=y),m&&(f.fn.focus=m),b&&(f.fn.attr=b),w&&(f.fn.removeAttr=w),x&&(f.fn.hide=x),S&&(f.fn.show=S),E&&(f.fn.offset=E),O&&(f.fn.width=O),k&&(f.fn.height=k),C&&(f.fn.parent=C),T&&(f.fn.parents=T),N&&(f.fn.is=N),L&&(f.fn.dataset=L),M&&(f.fn.val=M),P&&(f.fn.text=P),D&&(f.fn.html=D),R&&(f.fn.children=R),j&&(f.fn.remove=j),A&&(f.fn.find=A),I&&(f.fn.each=I),F&&(f.fn.empty=F);var Ic,Fc=function(e){return"[object HTMLDocument]"===Ac(e)},Bc=function(e){return"[object ShadowRoot]"===Ac(e)},_c=function(e){return"[object DataTransfer]"===Ac(e)},$c=/\[object HTML([A-Z][a-z]*)*Element\]/,Wc=function(e){return $c.test(Ac(e))},Vc=globalThis.Node,zc=globalThis.Comment,Hc=globalThis.Element,Uc=globalThis.Text,Kc=globalThis.Range,qc=globalThis.Selection,Gc=globalThis.StaticRange,Jc=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||null},Yc=function(e){return Qc(e)&&8===e.nodeType},Xc=function(e){return Qc(e)&&1===e.nodeType},Qc=function(e){return null!=e&&"number"==typeof e.nodeType},Zc=function(e){return"[object Selection]"===Ac(e)},el=function(e){return Qc(e)&&3===e.nodeType},tl=function(e){return e.clipboardData&&""!==e.clipboardData.getData("text/plain")&&1===e.clipboardData.types.length},nl=function(e){var t,n=La(e,2),r=n[0],o=n[1];if(Xc(r)&&r.childNodes.length){var i=o===r.childNodes.length,a=i?o-1:o;for(r=(t=La(il(r,a,i?"backward":"forward"),2))[0],i=(a=t[1])<o;Xc(r)&&r.childNodes.length;){var s=i?r.childNodes.length-1:0;r=al(r,s,i?"backward":"forward")}o=i&&null!=r.textContent?r.textContent.length:0}return[r,o]},rl=function(){return!(!window.document.activeElement||!window.document.activeElement.shadowRoot)},ol=function(e){var t,n,r;return null!==(t=window.document.getElementById(e))&&void 0!==t?t:(null===(r=null===(n=window.document.activeElement)||void 0===n?void 0:n.shadowRoot)||void 0===r?void 0:r.getElementById(e))||null},il=function(e,t,n){for(var r=e.childNodes,o=r[t],i=t,a=!1,s=!1;(Yc(o)||Xc(o)&&0===o.childNodes.length||Xc(o)&&"false"===o.getAttribute("contenteditable"))&&(!a||!s);)i>=r.length?(a=!0,i=t-1,n="backward"):i<0?(s=!0,i=t+1,n="forward"):(o=r[i],t=i,i+="forward"===n?1:-1);return[o,t]},al=function(e,t,n){return La(il(e,t,n),1)[0]},sl=function(e){var t,n,r="";if(el(e)&&e.nodeValue)return e.nodeValue;if(Xc(e)){try{for(var o=Na(Array.from(e.childNodes)),i=o.next();!i.done;i=o.next()){var a=i.value;r+=sl(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}var s=getComputedStyle(e).getPropertyValue("display");"block"!==s&&"list"!==s&&"table-row"!==s&&"BR"!==e.tagName||(r+="\n")}return r};function cl(e){var t=[];t.push(e);for(var n=0;t.length>0;){var r=t.pop();if(null==r)break;if(++n>1e4)break;var o=r.nodeName;if(1===r.nodeType){var i=o.toLowerCase();if(ja.includes(i)||"iframe"===i||"video"===i)return r;var a=r.children||[],s=a.length;if(s)for(var c=s-1;c>=0;c--)t.push(a[c])}}return null}function ll(e,t){if(!Wc(e)||"true"!==e.dataset.slateVoid)for(var n=e.childNodes,r=n.length;r--;){var o=n[r],i=o.nodeType;3==i?t(o,e):1!=i&&9!=i&&11!=i||ll(o,t)}}function ul(e){if(0===e.length)return"";var t=e[0];return t.nodeType!==Ic.ELEMENT_NODE?"":t.tagName.toLowerCase()}!function(e){e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE"}(Ic||(Ic={}));var fl=0,dl=function(){this.id="".concat(fl++)};void 0!==globalThis.navigator&&void 0!==globalThis.window&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&globalThis.window.MSStream;var hl="undefined"!=typeof navigator&&/Mac OS X/.test(navigator.userAgent),pl="undefined"!=typeof navigator&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent);"undefined"!=typeof navigator&&/^(?!.*Seamonkey)(?=.*Firefox\/(?:[0-7][0-9]|[0-8][0-6])(?:\.)).*/i.test(navigator.userAgent);var gl="undefined"!=typeof navigator&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),vl="undefined"!=typeof navigator&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),yl="undefined"!=typeof navigator&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),ml="undefined"!=typeof navigator&&/Chrome/i.test(navigator.userAgent);"undefined"!=typeof navigator&&/.*QQBrowser/.test(navigator.userAgent);var bl=!yl&&!vl&&"undefined"!=typeof globalThis&&globalThis.InputEvent&&"function"==typeof globalThis.InputEvent.prototype.getTargetRanges,wl=Bt.f,xl="Array Iterator",Sl=an.set,El=an.getterFor(xl),Ol=zi(Array,"Array",(function(e,t){Sl(this,{type:xl,target:Pe(e),index:0,kind:t})}),(function(){var e=El(this),t=e.target,n=e.index++;if(!t||n>=t.length)return e.target=null,Hi(void 0,!0);switch(e.kind){case"keys":return Hi(n,!1);case"values":return Hi(t[n],!1)}return Hi([n,t[n]],!1)}),"values"),kl=Vr.Arguments=Vr.Array;if(wo("keys"),wo("values"),wo("entries"),le&&"values"!==kl.name)try{wl(kl,"name",{value:"values"})}catch(e){}var Cl=!ce((function(){return Object.isExtensible(Object.preventExtensions({}))})),Tl=function(e,t,n){for(var r in t)cn(e,r,t[r],n);return e},Nl=Cn.f,Ll="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Ml={f:function(e){return Ll&&"Window"===Oe(e)?function(e){try{return Nl(e)}catch(e){return ns(Ll)}}(e):Nl(Pe(e))}},Pl=ce((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),Dl=Object.isExtensible,Rl=ce((function(){Dl(1)}))||Pl?function(e){return!!je(e)&&((!Pl||"ArrayBuffer"!==Oe(e))&&(!Dl||Dl(e)))}:Dl,jl=re((function(e){var t=Bt.f,n=!1,r=ht("meta"),o=0,i=function(e){t(e,r,{value:{objectID:"O"+o++,weakData:{}}})},a=e.exports={enable:function(){a.enable=function(){},n=!0;var e=Cn.f,t=xe([].splice),o={};o[r]=1,e(o).length&&(Cn.f=function(n){for(var o=e(n),i=0,a=o.length;i<a;i++)if(o[i]===r){t(o,i,1);break}return o},_n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Ml.f}))},fastKey:function(e,t){if(!je(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!lt(e,r)){if(!Rl(e))return"F";if(!t)return"E";i(e)}return e[r].objectID},getWeakData:function(e,t){if(!lt(e,r)){if(!Rl(e))return!0;if(!t)return!1;i(e)}return e[r].weakData},onFreeze:function(e){return Cl&&n&&Rl(e)&&!lt(e,r)&&i(e),e}};Zt[r]=!0})),Al=function(e,t,n){var r,o;return Ri&&Re(r=t.constructor)&&r!==n&&je(o=r.prototype)&&o!==n.prototype&&Ri(e,o),e},Il=function(e,t,n){var r=-1!==e.indexOf("Map"),o=-1!==e.indexOf("Weak"),i=r?"set":"add",a=se[e],s=a&&a.prototype,c=a,l={},u=function(e){var t=xe(s[e]);cn(s,e,"add"===e?function(e){return t(this,0===e?0:e),this}:"delete"===e?function(e){return!(o&&!je(e))&&t(this,0===e?0:e)}:"get"===e?function(e){return o&&!je(e)?void 0:t(this,0===e?0:e)}:"has"===e?function(e){return!(o&&!je(e))&&t(this,0===e?0:e)}:function(e,n){return t(this,0===e?0:e,n),this})};if(Fn(e,!Re(a)||!(o||s.forEach&&!ce((function(){(new a).entries().next()})))))c=n.getConstructor(t,e,r,i),jl.enable();else if(Fn(e,!0)){var f=new c,d=f[i](o?{}:-0,1)!==f,h=ce((function(){f.has(1)})),p=no((function(e){new a(e)})),g=!o&&ce((function(){for(var e=new a,t=5;t--;)e[i](t,t);return!e.has(-0)}));p||((c=t((function(e,t){Qa(e,s);var n=Al(new a,e,c);return Ne(t)||Nc(t,n[i],{that:n,AS_ENTRIES:r}),n}))).prototype=s,s.constructor=c),(h||g)&&(u("delete"),u("has"),r&&u("get")),(g||d)&&u(i),o&&s.clear&&delete s.clear}return l[e]=c,_n({global:!0,constructor:!0,forced:c!==a},l),Ti(c,e),o||n.setStrong(c,e,r),c},Fl=jl.getWeakData,Bl=an.set,_l=an.getterFor,$l=vr.find,Wl=vr.findIndex,Vl=xe([].splice),zl=0,Hl=function(e){return e.frozen||(e.frozen=new Ul)},Ul=function(){this.entries=[]},Kl=function(e,t){return $l(e.entries,(function(e){return e[0]===t}))};Ul.prototype={get:function(e){var t=Kl(this,e);if(t)return t[1]},has:function(e){return!!Kl(this,e)},set:function(e,t){var n=Kl(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=Wl(this.entries,(function(t){return t[0]===e}));return~t&&Vl(this.entries,t,1),!!~t}};var ql,Gl={getConstructor:function(e,t,n,r){var o=e((function(e,o){Qa(e,i),Bl(e,{type:t,id:zl++,frozen:null}),Ne(o)||Nc(o,e[r],{that:e,AS_ENTRIES:n})})),i=o.prototype,a=_l(t),s=function(e,t,n){var r=a(e),o=Fl(Pt(t),!0);return!0===o?Hl(r).set(t,n):o[r.id]=n,e};return Tl(i,{delete:function(e){var t=a(this);if(!je(e))return!1;var n=Fl(e);return!0===n?Hl(t).delete(e):n&<(n,t.id)&&delete n[t.id]},has:function(e){var t=a(this);if(!je(e))return!1;var n=Fl(e);return!0===n?Hl(t).has(e):n&<(n,t.id)}}),Tl(i,n?{get:function(e){var t=a(this);if(je(e)){var n=Fl(e);if(!0===n)return Hl(t).get(e);if(n)return n[t.id]}},set:function(e,t){return s(this,e,t)}}:{add:function(e){return s(this,e,!0)}}),o}},Jl=an.enforce,Yl=Object,Xl=Array.isArray,Ql=Yl.isExtensible,Zl=Yl.isFrozen,eu=Yl.isSealed,tu=Yl.freeze,nu=Yl.seal,ru=!se.ActiveXObject&&"ActiveXObject"in se,ou=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},iu=Il("WeakMap",ou,Gl),au=iu.prototype,su=xe(au.set);if(Yt)if(ru){ql=Gl.getConstructor(ou,"WeakMap",!0),jl.enable();var cu=xe(au.delete),lu=xe(au.has),uu=xe(au.get);Tl(au,{delete:function(e){if(je(e)&&!Ql(e)){var t=Jl(this);return t.frozen||(t.frozen=new ql),cu(this,e)||t.frozen.delete(e)}return cu(this,e)},has:function(e){if(je(e)&&!Ql(e)){var t=Jl(this);return t.frozen||(t.frozen=new ql),lu(this,e)||t.frozen.has(e)}return lu(this,e)},get:function(e){if(je(e)&&!Ql(e)){var t=Jl(this);return t.frozen||(t.frozen=new ql),lu(this,e)?uu(this,e):t.frozen.get(e)}return uu(this,e)},set:function(e,t){if(je(e)&&!Ql(e)){var n=Jl(this);n.frozen||(n.frozen=new ql),lu(this,e)?su(this,e,t):n.frozen.set(e,t)}else su(this,e,t);return this}})}else Cl&&ce((function(){var e=tu([]);return su(new iu,e,1),!Zl(e)}))&&Tl(au,{set:function(e,t){var n;return Xl(e)&&(Zl(e)?n=tu:eu(e)&&(n=nu)),su(this,e,t),n&&n(e),this}});var fu=yt("iterator"),du=Ol.values,hu=function(e,t){if(e){if(e[fu]!==du)try{_t(e,fu,du)}catch(t){e[fu]=du}if(Ti(e,t,!0),Jn[t])for(var n in Ol)if(e[n]!==Ol[n])try{_t(e,n,Ol[n])}catch(t){e[n]=Ol[n]}}};for(var pu in Jn)hu(se[pu]&&se[pu].prototype,pu);hu(Qn,"DOMTokenList");var gu=new WeakMap,vu=new WeakMap,yu=new WeakMap,mu=new WeakMap,bu=new WeakMap,wu=new WeakMap,xu=new WeakMap,Su=new WeakMap,Eu=new WeakMap,Ou=new WeakMap,ku=new WeakMap,Cu=new WeakMap,Tu=new WeakMap,Nu=new WeakMap,Lu=new WeakMap,Mu=new WeakMap,Pu=new WeakMap,Du=new WeakMap,Ru=new WeakMap,ju=new WeakMap,Au=new WeakMap,Iu=new WeakMap,Fu=new WeakMap,Bu=new WeakMap,_u=new WeakMap,$u={getWindow:function(e){var t=Au.get(e);if(!t)throw new Error("Unable to find a host window element for this editor");return t},findKey:function(e,t){var n=ju.get(t);return n||(n=new dl,ju.set(t,n)),n},setNewKey:function(e){var t=new dl;ju.set(e,t)},findPath:function(e,n){for(var r=[],o=n;;){var i=Lu.get(o);if(null==i){if(t.isEditor(o))return r;break}var a=Nu.get(o);if(null==a)break;r.unshift(a),o=i}throw new Error("Unable to find the path for Slate node: ".concat(JSON.stringify(n)))},findDocumentOrShadowRoot:function(e){if(e.isDestroyed)return window.document;var t=$u.toDOMNode(e,e),n=t.getRootNode();return(Fc(n)||Bc(n))&&null!=Reflect.get(n,"getSelection")?n:t.ownerDocument},getParentNode:function(e,t){return Lu.get(t)||null},getParentsNodes:function(e,t){for(var n=[],r=t;r!==e&&null!=r;){var o=$u.getParentNode(e,r);if(null==o)break;n.push(o),r=o}return n},getTopNode:function(e,t){var n=[$u.findPath(e,t)[0]];return o.get(e,n)},toDOMNode:function(e,n){var r;if(t.isEditor(n))r=Mu.get(e);else{var o=$u.findKey(e,n);r=Du.get(o)}if(!r)throw new Error("Cannot resolve a DOM node from Slate node: ".concat(JSON.stringify(n)));return r},hasDOMNode:function(e,t,n){void 0===n&&(n={});var r,o=n.editable,i=void 0!==o&&o,a=$u.toDOMNode(e,e);try{r=Xc(t)?t:t.parentElement}catch(e){if(e instanceof Error&&!e.message.includes('Permission denied to access property "nodeType"'))throw e}return!!r&&(r.closest("[data-slate-editor]")===a&&(!i||r.isContentEditable||!!r.getAttribute("data-slate-zero-width"))||!!r.getAttribute("data-slate-string"))},toDOMRange:function(e,t){var n=t.anchor,r=t.focus,o=i.isBackward(t),a=$u.toDOMPoint(e,n),s=i.isCollapsed(t)?a:$u.toDOMPoint(e,r),c=$u.getWindow(e).document.createRange(),l=La(o?s:a,2),u=l[0],f=l[1],d=La(o?a:s,2),h=d[0],p=d[1],g=!!(Xc(u)?u:u.parentElement).getAttribute("data-slate-zero-width"),v=!!(Xc(h)?h:h.parentElement).getAttribute("data-slate-zero-width");return c.setStart(u,g?1:f),c.setEnd(h,v?1:p),c},toDOMPoint:function(e,n){var r,o,i,a=La(t.node(e,n.path),1)[0],s=$u.toDOMNode(e,a);t.void(e,{at:n})&&(n={path:n.path,offset:0});var c=Array.from(s.querySelectorAll("[data-slate-string], [data-slate-zero-width]")),l=0;try{for(var u=Na(c),f=u.next();!f.done;f=u.next()){var d=f.value,h=d.childNodes[0];if(null!=h&&null!=h.textContent){var p=h.textContent.length,g=d.getAttribute("data-slate-length"),v=l+(null==g?p:parseInt(g,10));if(n.offset<=v){i=[h,Math.min(p,Math.max(0,n.offset-l))];break}l=v}}}catch(e){r={error:e}}finally{try{f&&!f.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}if(!i)throw new Error("Cannot resolve a DOM point from Slate point: ".concat(JSON.stringify(n)));return i},toSlateNode:function(e,t){var n=Xc(t)?t:t.parentElement;n&&!n.hasAttribute("data-slate-node")&&(n=n.closest("[data-slate-node]"));var r=n?Pu.get(n):null;if(!r)throw new Error("Cannot resolve a Slate node from DOM node: ".concat(n));return r},findEventRange:function(e,n){"nativeEvent"in n&&(n=n.nativeEvent);var r=n.clientX,o=n.clientY,i=n.target;if(null==r||null==o)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(n));var a,s=$u.toSlateNode(e,n.target),c=$u.findPath(e,s);if(t.isVoid(e,s)){var l=i.getBoundingClientRect(),u=e.isInline(s)?r-l.left<l.left+l.width-r:o-l.top<l.top+l.height-o,f=t.point(e,c,{edge:u?"start":"end"}),d=u?t.before(e,f):t.after(e,f);if(d)return t.range(e,d)}var h=this.getWindow(e).document;if(h.caretRangeFromPoint)a=h.caretRangeFromPoint(r,o);else{var p=h.caretPositionFromPoint(r,o);p&&((a=h.createRange()).setStart(p.offsetNode,p.offset),a.setEnd(p.offsetNode,p.offset))}if(!a)throw new Error("Cannot resolve a Slate range from a DOM event: ".concat(n));return $u.toSlateRange(e,a,{exactMatch:!1,suppressThrow:!1})},toSlateRange:function(e,n,r){var o,a,s,c,l,u=r.exactMatch,f=r.suppressThrow;if((Zc(n)?n.anchorNode:n.startContainer)&&(Zc(n)?(o=n.anchorNode,a=n.anchorOffset,s=n.focusNode,c=n.focusOffset,l=ml&&rl()?n.anchorNode===n.focusNode&&n.anchorOffset===n.focusOffset:n.isCollapsed):(o=n.startContainer,a=n.startOffset,s=n.endContainer,c=n.endOffset,l=n.collapsed)),null==o||null==s||null==a||null==c)throw new Error("Cannot resolve a Slate range from DOM range: ".concat(n));var d=$u.toSlatePoint(e,[o,a],{exactMatch:u,suppressThrow:f});if(!d)return null;var h=l?d:$u.toSlatePoint(e,[s,c],{exactMatch:u,suppressThrow:f});if(!h)return null;var p={anchor:d,focus:h};return i.isExpanded(p)&&i.isForward(p)&&Xc(s)&&t.void(e,{at:p.focus,mode:"highest"})&&(p=t.unhangRange(e,p,{voids:!0})),p},toSlatePoint:function(e,t,n){var r,o=n.exactMatch,i=n.suppressThrow,a=La(o?t:nl(t),2),s=a[0],c=a[1],l=s.parentNode,f=null,d=0;if(l){var h=l.closest('[data-slate-void="true"]'),p=l.closest("[data-slate-leaf]"),g=null;if(p){f=p.closest('[data-slate-node="text"]');var v=$u.getWindow(e).document.createRange();v.setStart(f,0),v.setEnd(s,c);var y=v.cloneContents();Ma(Ma([],La(u(y.querySelectorAll("[data-slate-zero-width]"))),!1),La(u(y.querySelectorAll("[contenteditable=false]"))),!1).forEach((function(e){e.parentNode.removeChild(e)})),d=y.textContent.length,g=f}else h&&((p=h.querySelector("[data-slate-leaf]"))?(f=p.closest('[data-slate-node="text"]'),d=(g=p).textContent.length,g.querySelectorAll("[data-slate-zero-width]").forEach((function(e){d-=e.textContent.length}))):d=1);g&&d===g.textContent.length&&(l.hasAttribute("data-slate-zero-width")||pl&&(null===(r=g.textContent)||void 0===r?void 0:r.endsWith("\n")))&&(d-=1)}if(!f){if(i)return null;throw new Error("Cannot resolve a Slate point from DOM point: ".concat(t))}var m=$u.toSlateNode(e,f);return{path:$u.findPath(e,m),offset:d}},hasRange:function(e,n){var r=n.anchor,o=n.focus;return t.hasPath(e,r.path)&&t.hasPath(e,o.path)},getNodeType:function(e){return a.isElement(e)?e.type:""},checkNodeType:function(e,t){return this.getNodeType(e)===t},getNodesStr:function(e){return e.map((function(e){return o.string(e)})).join("")},getSelectedElems:function(e){var n,r,o=[],i=t.nodes(e,{universal:!0});try{for(var s=Na(i),c=s.next();!c.done;c=s.next()){var l=La(c.value,1)[0];a.isElement(l)&&o.push(l)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return o},getSelectedNodeByType:function(e,n){var r=this,o=La(t.nodes(e,{match:function(e){return r.checkNodeType(e,n)},universal:!0}),1),i=o[0];return null==i?null:i[0]},getSelectedTextNode:function(e){var n=La(t.nodes(e,{match:function(e){return s.isText(e)},universal:!0}),1),r=n[0];return null==r?null:r[0]},isNodeSelected:function(e,n){var r=La(t.nodes(e,{match:function(e){return e===n},universal:!0}),1),o=r[0];return null!=o&&La(o,1)[0]===n},isSelectionAtLineEnd:function(e,n){var r=e.selection;return!!r&&(t.isEnd(e,r.anchor,n)||t.isEnd(e,r.focus,n))},getTextarea:function(e){var t=gu.get(e);if(null==t)throw new Error("Cannot find textarea instance by editor");return t},getToolbar:function(e){return mu.get(e)||null},getHoverbar:function(e){return wu.get(e)||null},normalizeContent:function(e){e.children.forEach((function(t,n){e.normalizeNode([t,[n]])}))},getLeftLengthOfMaxLength:function(e){var t=e.getConfig(),n=t.maxLength,r=t.onMaxLength;if("number"!=typeof n||n<=0)return 1/0;var o=n-e.getText().replace(/\r|\n|(\r\n)/g,"").length;return o<=0&&r&&r(e),o},cleanExposedTexNodeInSelectionBlock:function(e){var n,r,o,i,s=$u.getTextarea(e).$textArea,c=null==s?void 0:s[0].childNodes;if(c)try{for(var l=Na(Array.from(c)),u=l.next();!u.done;u=l.next()){var d=u.value;if(3!==d.nodeType)break;d.remove()}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}var h=t.nodes(e,{match:function(t){return!(!a.isElement(t)||e.isInline(t))},universal:!0});try{for(var p=Na(h),g=p.next();!g.done;g=p.next()){var v=g.value;if(null!=v){var y=v[0];ll($u.toDOMNode(e,y),(function(e,t){var n=f(t);n.attr("data-slate-string")||n.attr("data-slate-zero-width")||n.attr("data-w-e-reserve")||t.removeChild(e)}))}}}catch(e){o={error:e}}finally{try{g&&!g.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}},isLastNode:function(e,t){var n=e.children||[];return n[n.length-1]===t},genEmptyParagraph:function(){return{type:"paragraph",children:[{text:""}]}},isSelectedVoidNode:function(e){var n,r,o=t.nodes(e,{match:function(t){return e.isVoid(t)}}),i=0;try{for(var a=Na(o),s=a.next();!s.done;s=a.next()){s.value&&(i+=1)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i>0},isSelectedEmptyParagraph:function(e){var t=e.selection;if(null==t)return!1;if(i.isExpanded(t))return!1;var n=$u.getSelectedNodeByType(e,"paragraph");if(null===n)return!1;var r=n.children;return 1===r.length&&(""===r[0].text||void 0)},isEmptyPath:function(e,n){var r=t.node(e,n);if(null==r)return!1;var o=La(r,1)[0].children;if(1===o.length&&""===o[0].text)return!0;return!1}},Wu=1,Vu={};var zu={};function Hu(e,t){var n=e.key,r=e.factory,o=e.config,i=Ta(Ta({},o),t||{});if(null!=zu[n])throw new Error("Duplicated key '".concat(n,"' in menu items"));zu[n]=r,function(e,t){null!=t&&(Vu[e]=t)}(n,i)}var Uu=vr.filter,Ku=Co("filter");_n({target:"Array",proto:!0,forced:!Ku},{filter:function(e){return Uu(this,e,arguments.length>1?arguments[1]:void 0)}});var qu="\t\n\v\f\r \u2028\u2029\ufeff",Gu=xe("".replace),Ju=RegExp("^["+qu+"]+"),Yu=RegExp("(^|[^"+qu+"])["+qu+"]+$"),Xu=function(e){return function(t){var n=Mr(Me(t));return 1&e&&(n=Gu(n,Ju,"")),2&e&&(n=Gu(n,Yu,"$1")),n}},Qu={start:Xu(1),end:Xu(2),trim:Xu(3)},Zu=zt.PROPER,ef=Qu.trim;_n({target:"String",proto:!0,forced:function(e){return ce((function(){return!!qu[e]()||"
"!=="
"[e]()||Zu&&qu[e].name!==e}))}("trim")},{trim:function(){return ef(this)}});var tf=[];function nf(e){tf.push(e)}var rf={};function of(e){var t=e.type,n=e.elemToHtml;rf[t||""]=n}function af(e,t,n){var r=n.isInline(e)?"span":"div";return"<".concat(r,">").concat(t,"</").concat(r,">")}function sf(e,n){var r=e.type,o=void 0===r?"":r,i=e.children,a=void 0===i?[]:i,s=t.isVoid(n,e),c="";s||(c=a.map((function(e){return cf(e,n)})).join(""));var l=function(e){return rf[e]||af}(o),u=l(e,c,n),f="";if(f="string"==typeof u?u:u.html||"",s||tf.forEach((function(t){return f=t(e,f)})),"string"==typeof u)return f;var d=u.prefix,h=void 0===d?"":d,p=u.suffix,g=void 0===p?"":p;return h&&(f=h+f),g&&(f+=g),f}function cf(e,t){return a.isElement(e)?sf(e,t):function(e,t){var n=e.text;if(null==n)throw new Error("Current node is not slate Text ".concat(JSON.stringify(e)));var r=n;r=function(e){return e.replace(/ {2}/g," ").replace(/</g,"<").replace(/>/g,">").replace(/®/g,"®").replace(/©/g,"©").replace(/™/g,"™")}(r);var o=$u.getParentsNodes(t,e).some((function(e){return"pre"===$u.getNodeType(e)}));if(o||(r=r.replace(/\r\n|\r|\n/g,"<br>")),o&&(r=r.replace(/ /g," ")),""===r){var i=$u.getParentNode(null,e);if(!i||0!==i.children.length)return r;r="<br>"}return tf.forEach((function(t){return r=t(e,r)})),r}(e,t)}function lf(e){return"w-e-element-".concat(e)}var uf=function(e,t){var n=(t.top+t.bottom)/2;return e.top<=n&&e.bottom>=n},ff=function(e,t,n){var r=$u.toDOMRange(e,t).getBoundingClientRect(),o=$u.toDOMRange(e,n).getBoundingClientRect();return uf(r,o)&&uf(o,r)},df=["span","b","strong","i","em","s","strike","u","font","sub","sup"],hf=[];function pf(e){hf.push(e)}var gf=[];function vf(e){gf.push(e)}var yf={};function mf(e){var t=e.selector,n=e.parseElemHtml;yf[t]=n}var bf=Bt.f,wf=function(e,t,n){n in e||bf(e,n,{configurable:!0,get:function(){return t[n]},set:function(e){t[n]=e}})},xf=Cn.f,Sf=an.enforce,Ef=yt("match"),Of=se.RegExp,kf=Of.prototype,Cf=se.SyntaxError,Tf=xe(kf.exec),Nf=xe("".charAt),Lf=xe("".replace),Mf=xe("".indexOf),Pf=xe("".slice),Df=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,Rf=/a/g,jf=/a/g,Af=new Of(Rf)!==Rf,If=Fo.MISSED_STICKY,Ff=Fo.UNSUPPORTED_Y,Bf=le&&(!Af||If||_o||Wo||ce((function(){return jf[Ef]=!1,Of(Rf)!==Rf||Of(jf)===jf||"/a/i"!==String(Of(Rf,"i"))})));if(Fn("RegExp",Bf)){for(var _f=function(e,t){var n,r,o,i,a,s,c=Ie(kf,this),l=ni(e),u=void 0===t,f=[],d=e;if(!c&&l&&u&&e.constructor===_f)return e;if((l||Ie(kf,e))&&(e=e.source,u&&(t=Rr(d))),e=void 0===e?"":Mr(e),t=void 0===t?"":Mr(t),d=e,_o&&"dotAll"in Rf&&(r=!!t&&Mf(t,"s")>-1)&&(t=Lf(t,/s/g,"")),n=t,If&&"sticky"in Rf&&(o=!!t&&Mf(t,"y")>-1)&&Ff&&(t=Lf(t,/y/g,"")),Wo&&(i=function(e){for(var t,n=e.length,r=0,o="",i=[],a=vo(null),s=!1,c=!1,l=0,u="";r<=n;r++){if("\\"===(t=Nf(e,r)))t+=Nf(e,++r);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:if(o+=t,"?:"===Pf(e,r+1,r+3))continue;Tf(Df,Pf(e,r+1))&&(r+=2,c=!0),l++;continue;case">"===t&&c:if(""===u||lt(a,u))throw new Cf("Invalid capture group name");a[u]=!0,i[i.length]=[u,l],c=!1,u="";continue}c?u+=t:o+=t}return[o,i]}(e),e=i[0],f=i[1]),a=Al(Of(e,t),c?this:kf,_f),(r||o||f.length)&&(s=Sf(a),r&&(s.dotAll=!0,s.raw=_f(function(e){for(var t,n=e.length,r=0,o="",i=!1;r<=n;r++)"\\"!==(t=Nf(e,r))?i||"."!==t?("["===t?i=!0:"]"===t&&(i=!1),o+=t):o+="[\\s\\S]":o+=t+Nf(e,++r);return o}(e),n)),o&&(s.sticky=!0),f.length&&(s.groups=f)),e!==d)try{_t(a,"source",""===d?"(?:)":d)}catch(e){}return a},$f=xf(Of),Wf=0;$f.length>Wf;)wf(_f,Of,$f[Wf++]);kf.constructor=_f,_f.prototype=kf,cn(se,"RegExp",_f,{constructor:!0})}Ya("RegExp");var Vf=new RegExp(String.fromCharCode(160),"g");function zf(e){return e.replace(Vf," ")}function Hf(e,t){var n=e.length;if(n){var r=e[n-1];if(s.isText(r)){var o=Object.keys(r);if(1===o.length&&"text"===o[0])return r.text=r.text+t,!0}}return!1}function Uf(e,t,n){return{type:"paragraph",children:[{text:f(e).text().replace(/\s+/gm," ")}]}}function Kf(e,n){var r=function(e,t){var n=[];if(null!=e.attr("data-w-e-is-void"))return n;var r=e[0].childNodes;return 1===r.length&&"BR"===r[0].nodeName?(n.push({text:""}),n):(r.forEach((function(e){if(e.nodeType!==Ic.ELEMENT_NODE)if(e.nodeType!==Ic.TEXT_NODE);else{var r=e.textContent||"";if(""===r.trim()&&r.indexOf("\n")>=0)return;r&&(r=zf(r),Hf(n,r)||n.push({text:r}))}else{if("BR"===e.nodeName)return void(Hf(n,"\n")||n.push({text:"\n"}));var o=Gf(f(e),t);Array.isArray(o)?o.forEach((function(e){return n.push(e)})):n.push(o)}})),n)}(e,n),o=function(e){for(var t in yf)if(e[0].matches(t))return yf[t];return Uf}(e),i=o(e[0],r,n);return Array.isArray(i)||(i=[i]),i.forEach((function(o){t.isVoid(n,o)||(0===r.length&&(o.children=[{text:e.text().replace(/\s+/gm," ")}]),gf.forEach((function(t){o=t(e[0],o,n)})))})),i}function qf(e,t){0===e.parents("pre").length&&(e[0].innerHTML=e[0].innerHTML.replace(/\s+/gm," ").replace(/<br>/g,"\n"));var n=e[0].textContent||"";n=function(e){return e.replace(/ /g," ").replace(/</g,"<").replace(/>/g,">").replace(/®/g,"®").replace(/©/g,"©").replace(/™/g,"™").replace(/"/g,'"')}(n);var r={text:n=zf(n)};return gf.forEach((function(n){r=n(e[0],r,t)})),r}function Gf(e,t){hf.forEach((function(t){var n=t.selector,r=t.preParseHtml;e[0].matches(n)&&(e=f(r(e[0])))}));var n=ul(e);if("span"===n){if(e.attr("data-w-e-type"))return Kf(e,t);if(e[0].childNodes.length>1){var r=e[0].childNodes;return Array.from(r).map((function(e){return qf(f(e),t)}))}return qf(e,t)}if("code"===n)return"pre"===ul(e.parent())?Kf(e,t):qf(e,t);if(df.includes(n)){if(e[0].childNodes.length>0&&3!==e[0].childNodes[0].nodeType){r=e[0].childNodes;return Ta(Ta({},Gf(f(r[0]),t)),qf(e,t))}return qf(e,t)}return Kf(e,t)}var Jf=Fo.UNSUPPORTED_Y,Yf=Math.min,Xf=xe([].push),Qf=xe("".slice),Zf=!ce((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),ed="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length;function td(e,t,n){var r=f(n);return!!r.attr(t)||(r.attr(t,"true"),e.on("destroyed",(function(){r.removeAttr(t)})),!1)}function nd(e,t){void 0===t&&(t="");var n=[];""===t&&(t="<p><br></p>"),0!==t.indexOf("<")&&(t=t.split(/\n/).map((function(e){return"<p>".concat(e,"</p>")})).join(""));var r=f("<div>".concat(t,"</div>"));return Array.from(r.children()).forEach((function(t){var r=Gf(f(t),e);Array.isArray(r)?r.forEach((function(e){return n.push(e)})):n.push(r)})),n}ta("split",(function(e,t,n){var r="0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:de(t,this,e,n)}:t;return[function(t,n){var o=Me(this),i=Ne(t)?void 0:et(t,e);return i?de(i,t,o,n):de(r,Mr(o),t,n)},function(e,o){var i=Pt(this),a=Mr(e);if(!ed){var s=n(r,i,a,o,r!==t);if(s.done)return s.value}var c=ts(i,RegExp),l=i.unicode,u=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(Jf?"g":"y"),f=new c(Jf?"^(?:"+i.source+")":i,u),d=void 0===o?4294967295:o>>>0;if(0===d)return[];if(0===a.length)return null===da(f,a)?[a]:[];for(var h=0,p=0,g=[];p<a.length;){f.lastIndex=Jf?0:p;var v,y=da(f,Jf?Qf(a,p):a);if(null===y||(v=Yf(yn(f.lastIndex+(Jf?p:0)),a.length))===h)p=ra(a,p,l);else{if(Xf(g,Qf(a,h,p)),g.length===d)return g;for(var m=1;m<=y.length-1;m++)if(Xf(g,y[m]),g.length===d)return g;p=h=v}}return Xf(g,Qf(a,h)),g}]}),ed||!Zf,Jf);var rd=jl.fastKey,od=an.set,id=an.getterFor,ad={getConstructor:function(e,t,n,r){var o=e((function(e,o){Qa(e,i),od(e,{type:t,index:vo(null),first:null,last:null,size:0}),le||(e.size=0),Ne(o)||Nc(o,e[r],{that:e,AS_ENTRIES:n})})),i=o.prototype,a=id(t),s=function(e,t,n){var r,o,i=a(e),s=c(e,t);return s?s.value=n:(i.last=s={index:o=rd(t,!0),key:t,value:n,previous:r=i.last,next:null,removed:!1},i.first||(i.first=s),r&&(r.next=s),le?i.size++:e.size++,"F"!==o&&(i.index[o]=s)),e},c=function(e,t){var n,r=a(e),o=rd(t);if("F"!==o)return r.index[o];for(n=r.first;n;n=n.next)if(n.key===t)return n};return Tl(i,{clear:function(){for(var e=a(this),t=e.first;t;)t.removed=!0,t.previous&&(t.previous=t.previous.next=null),t=t.next;e.first=e.last=null,e.index=vo(null),le?e.size=0:this.size=0},delete:function(e){var t=this,n=a(t),r=c(t,e);if(r){var o=r.next,i=r.previous;delete n.index[r.index],r.removed=!0,i&&(i.next=o),o&&(o.previous=i),n.first===r&&(n.first=o),n.last===r&&(n.last=i),le?n.size--:t.size--}return!!r},forEach:function(e){for(var t,n=a(this),r=tr(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!c(this,e)}}),Tl(i,n?{get:function(e){var t=c(this,e);return t&&t.value},set:function(e,t){return s(this,0===e?0:e,t)}}:{add:function(e){return s(this,e=0===e?0:e,e)}}),le&&Ga(i,"size",{configurable:!0,get:function(){return a(this).size}}),o},setStrong:function(e,t,n){var r=t+" Iterator",o=id(t),i=id(r);zi(e,t,(function(e,t){od(this,{type:r,target:e,state:o(e),kind:t,last:null})}),(function(){for(var e=i(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?Hi("keys"===t?n.key:"values"===t?n.value:[n.key,n.value],!1):(e.target=null,Hi(void 0,!0))}),n?"entries":"values",!n,!0),Ya(t)}};Il("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),ad);var sd=new Set(["doctype","!doctype","meta","script","style","link","frame","iframe","title","svg"]);function cd(t,n){t.isInline(n)?(t.insertNode(n),"link"===n.type&&t.insertFragment([{text:""}])):e.insertNodes(t,n,{mode:"highest"})}var ld=function(n){var c=n,l=c.onChange,u=c.insertText,d=c.apply,h=c.deleteBackward;return c.insertText=function(e){c.getConfig().readOnly||u(e)},c.apply=function(e){var n,o,i,a,s,l,u,f,h=[];switch(e.type){case"insert_text":case"remove_text":case"set_node":try{for(var p=Na(t.levels(c,{at:e.path})),g=p.next();!g.done;g=p.next()){var v=La(g.value,2),y=v[0],m=v[1],b=$u.findKey(c,y);h.push([m,b])}}catch(e){n={error:e}}finally{try{g&&!g.done&&(o=p.return)&&o.call(p)}finally{if(n)throw n.error}}break;case"insert_node":case"remove_node":case"merge_node":case"split_node":try{for(var w=Na(t.levels(c,{at:r.parent(e.path)})),x=w.next();!x.done;x=w.next()){var S=La(x.value,2);y=S[0],m=S[1],b=$u.findKey(c,y);h.push([m,b])}}catch(e){i={error:e}}finally{try{x&&!x.done&&(a=w.return)&&a.call(w)}finally{if(i)throw i.error}}break;case"move_node":try{for(var E=Na(t.levels(c,{at:r.common(r.parent(e.path),r.parent(e.newPath))})),O=E.next();!O.done;O=E.next()){var k=La(O.value,2);y=k[0],m=k[1],b=$u.findKey(c,y);h.push([m,b])}}catch(e){s={error:e}}finally{try{O&&!O.done&&(l=E.return)&&l.call(E)}finally{if(s)throw s.error}}}d(e);try{for(var C=Na(h),T=C.next();!T.done;T=C.next()){var N=La(T.value,2);m=N[0],b=N[1],y=La(t.node(c,m),1)[0];ju.set(y,b)}}catch(e){u={error:e}}finally{try{T&&!T.done&&(f=C.return)&&f.call(C)}finally{if(u)throw u.error}}},c.deleteBackward=function(r){if("line"!==r)return h(r);if(n.selection&&i.isCollapsed(n.selection)){var o=t.above(n,{match:function(e){return t.isBlock(n,e)},at:n.selection});if(o){var a=La(o,2)[1],s=t.range(n,a,n.selection.anchor),l=function(e,n){var r=t.range(e,i.end(n)),o=Array.from(t.positions(e,{at:n})),a=0,s=o.length,c=Math.floor(s/2);if(ff(e,t.range(e,o[a]),r))return t.range(e,o[a],r);if(o.length<2)return t.range(e,o[o.length-1],r);for(;c!==o.length&&c!==a;)ff(e,t.range(e,o[c]),r)?s=c:a=c,c=Math.floor((a+s)/2);return t.range(e,o[s],r)}(c,s);i.isCollapsed(l)||e.delete(n,{at:l})}}},c.onChange=function(){var e=c.selection;null!=e&&Fu.set(c,e),c.emit("change"),l()},c.handleTab=function(){c.insertText(" ")},c.getHtml=function(){var e=c.children;return(void 0===e?[]:e).map((function(e){return cf(e,c)})).join("")},c.getText=function(){var e=c.children;return(void 0===e?[]:e).map((function(e){return o.string(e)})).join("\n")},c.getSelectionText=function(){var e=c.selection;return null==e?"":t.string(n,e)},c.getElemsByType=function(e,n){var r,o;void 0===n&&(n=!1);var i=[],s=t.nodes(c,{at:[],universal:!0});try{for(var l=Na(s),u=l.next();!u.done;u=l.next()){var f=La(u.value,1)[0];if(a.isElement(f))if(n?f.type.indexOf(e)>=0:f.type===e){var d=lf($u.findKey(c,f).id);i.push(Ta(Ta({},f),{id:d}))}}}catch(e){r={error:e}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(r)throw r.error}}return i},c.getElemsByTypePrefix=function(e){return c.getElemsByType(e,!0)},c.isEmpty=function(){var e=c.children,t=void 0===e?[]:e;if(t.length>1)return!1;var n=t[0];if(null==n)return!0;if(a.isElement(n)&&"paragraph"===n.type){var r=n.children,o=void 0===r?[]:r;if(o.length>1)return!1;var i=o[0];if(null==i)return!0;if(s.isText(i)&&""===i.text)return!0}return!1},c.clear=function(){e.delete(c,{at:{anchor:t.start(c,[]),focus:t.end(c,[])}}),0===c.children.length&&e.insertNodes(c,[{type:"paragraph",children:[{text:""}]}])},c.getParentNode=function(e){return $u.getParentNode(c,e)},c.dangerouslyInsertHtml=function(t,n){if(void 0===t&&(t=""),void 0===n&&(n=!1),t){var r=document.createElement("div");r.innerHTML=t;var o=Array.from(r.childNodes);if(o=o.filter((function(e){var t=e.nodeType,n=e.nodeName;return t===Ic.TEXT_NODE||t===Ic.ELEMENT_NODE&&!sd.has(n.toLowerCase())})),0!==o.length){var i=c.selection;if(null!=i){var a=null;if($u.isSelectedEmptyParagraph(c)&&!n)a=[i.focus.path[0]];r.setAttribute("hidden","true"),document.body.appendChild(r);var s=0;o.forEach((function(e,t){var n=e.nodeType,r=e.nodeName,i=e.textContent,a=void 0===i?"":i;if(n!==Ic.TEXT_NODE)if("BR"!==r){var l=e,u=!1;if(df.includes(r.toLowerCase()))u=!0;else for(var d in yf)if(l.matches(d)){u=!0;break}if(u){var h=Gf(f(l),c);return Array.isArray(h)?(h.forEach((function(e){return cd(c,e)})),s++):(cd(c,h),s++),void($u.isSelectedVoidNode(c)&&c.move(1))}var p=window.getComputedStyle(l).display;if(!$u.isSelectedEmptyParagraph(c)&&p.indexOf("inline")<0){if(t>=1){var g=o[t-1];"matches"in g&&g.matches("ul:not([data-w-e-type]),ol:not([data-w-e-type])")&&c.insertBreak()}c.insertBreak()}c.dangerouslyInsertHtml(l.innerHTML,!0)}else c.insertText("\n");else{if(!a||!a.trim())return;c.insertNode({text:a})}})),s&&a&&$u.isEmptyPath(c,a)&&e.removeNodes(c,{at:a}),r.remove()}}}},c.setHtml=function(n){void 0===n&&(n="");var r=c.isDisabled(),o=c.isFocused(),i=JSON.stringify(c.selection);c.enable(),c.focus(),c.clear();var a=nd(c,null==n?"":n);if(e.insertFragment(c,a),o||(c.deselect(),c.blur()),r&&(c.deselect(),c.disable()),c.isFocused())try{c.select(JSON.parse(i))}catch(e){c.select(t.start(c,[]))}},c},ud=function(e){return null!=e},fd={object:!0,function:!0,undefined:!0},dd=function(e){if(!function(e){return!!ud(e)&&hasOwnProperty.call(fd,typeof e)}(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(e){return!1}},hd=/^\s*class[\s{/}]/,pd=Function.prototype.toString,gd=function(e){return!!function(e){if("function"!=typeof e)return!1;if(!hasOwnProperty.call(e,"length"))return!1;try{if("number"!=typeof e.length)return!1;if("function"!=typeof e.call)return!1;if("function"!=typeof e.apply)return!1}catch(e){return!1}return!dd(e)}(e)&&!hd.test(pd.call(e))},vd=function(e){return null!=e},yd=Object.keys,md=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}()?Object.keys:function(e){return yd(vd(e)?Object(e):e)},bd=Math.max,wd=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}()?Object.assign:function(e,t){var n,r,o,i=bd(arguments.length,2);for(e=Object(function(e){if(!vd(e))throw new TypeError("Cannot use null or undefined");return e}(e)),o=function(r){try{e[r]=t[r]}catch(e){n||(n=e)}},r=1;r<i;++r)md(t=arguments[r]).forEach(o);if(void 0!==n)throw n;return e},xd=Array.prototype.forEach,Sd=Object.create,Ed=function(e){var t=Sd(null);return xd.call(arguments,(function(e){vd(e)&&function(e,t){var n;for(n in e)t[n]=e[n]}(Object(e),t)})),t},Od="razdwatrzy",kd=String.prototype.indexOf,Cd="function"==typeof Od.contains&&!0===Od.contains("dwa")&&!1===Od.contains("foo")?String.prototype.contains:function(e){return kd.call(this,e,arguments[1])>-1},Td=re((function(e){var t=e.exports=function(e,t){var n,r,o,i,a;return arguments.length<2||"string"!=typeof e?(i=t,t=e,e=null):i=arguments[2],ud(e)?(n=Cd.call(e,"c"),r=Cd.call(e,"e"),o=Cd.call(e,"w")):(n=o=!0,r=!1),a={value:t,configurable:n,enumerable:r,writable:o},i?wd(Ed(i),a):a};t.gs=function(e,t,n){var r,o,i,a;return"string"!=typeof e?(i=n,n=t,t=e,e=null):i=arguments[3],ud(t)?gd(t)?ud(n)?gd(n)||(i=n,n=void 0):n=void 0:(i=t,t=n=void 0):t=void 0,ud(e)?(r=Cd.call(e,"c"),o=Cd.call(e,"e")):(r=!0,o=!1),a={get:t,set:n,configurable:r,enumerable:o},i?wd(Ed(i),a):a}})),Nd=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e},Ld=re((function(e,t){var n,r,o,i,a,s,c,l=Function.prototype.apply,u=Function.prototype.call,f=Object.create,d=Object.defineProperty,h=Object.defineProperties,p=Object.prototype.hasOwnProperty,g={configurable:!0,enumerable:!1,writable:!0};n=function(e,t){var n;return Nd(t),p.call(this,"__ee__")?n=this.__ee__:(n=g.value=f(null),d(this,"__ee__",g),g.value=null),n[e]?"object"==typeof n[e]?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},r=function(e,t){var r,i;return Nd(t),i=this,n.call(this,e,r=function(){o.call(i,e,r),l.call(t,this,arguments)}),r.__eeOnceListener__=t,this},o=function(e,t){var n,r,o,i;if(Nd(t),!p.call(this,"__ee__"))return this;if(!(n=this.__ee__)[e])return this;if("object"==typeof(r=n[e]))for(i=0;o=r[i];++i)o!==t&&o.__eeOnceListener__!==t||(2===r.length?n[e]=r[i?0:1]:r.splice(i,1));else r!==t&&r.__eeOnceListener__!==t||delete n[e];return this},i=function(e){var t,n,r,o,i;if(p.call(this,"__ee__")&&(o=this.__ee__[e]))if("object"==typeof o){for(n=arguments.length,i=new Array(n-1),t=1;t<n;++t)i[t-1]=arguments[t];for(o=o.slice(),t=0;r=o[t];++t)l.call(r,this,i)}else switch(arguments.length){case 1:u.call(o,this);break;case 2:u.call(o,this,arguments[1]);break;case 3:u.call(o,this,arguments[1],arguments[2]);break;default:for(n=arguments.length,i=new Array(n-1),t=1;t<n;++t)i[t-1]=arguments[t];l.call(o,this,i)}},a={on:n,once:r,off:o,emit:i},s={on:Td(n),once:Td(r),off:Td(o),emit:Td(i)},c=h({},s),e.exports=t=function(e){return null==e?f(c):h(Object(e),s)},t.methods=a}));function Md(e){var t=Bu.get(e);return null==t&&(t=Ld(),Bu.set(e,t)),t}var Pd=new WeakMap;function Dd(e,t){var n=Pd.get(e);null==n&&(n=new Set,Pd.set(e,n)),n.add(t)}var Rd=function(e){var t=e;return t.on=function(e,n){var r=Md(t);if(r.on(e,n),"destroyed"===e&&Dd(t,n),"destroyed"!==e){var o=function(){return r.off(e,n)};r.on("destroyed",o),Dd(t,o)}},t.once=function(e,n){Md(t).once(e,n)},t.off=function(e,n){Md(t).off(e,n)},t.emit=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=Md(t);if(o.emit.apply(o,Ma([e],La(n),!1)),"destroyed"===e){var i=function(e){return Pd.get(e)||new Set}(t);i.forEach((function(e){return o.off("destroyed",e)})),function(e){Pd.set(e,new Set)}(t)}},t};function jd(e){var t=$u.getTextarea(e).$textAreaContainer,n=t.width(),r=t.height(),o=t.offset();return{top:o.top,left:o.left,width:n,height:r}}function Ad(e){var t={top:"0",left:"0"},n=e.selection;if(null==n)return t;var r=jd(e);if(null==r)return t;var o=r.top,i=r.left,a=r.width,s=r.height,c=$u.toDOMRange(e,n).getClientRects()[0];if(null==c)return t;c.width;var l=c.height,u={},f=c.top-o,d=c.left-i;if(d>a/2){var h=a-d;u.right="".concat(h+5,"px")}else u.left="".concat(d+5,"px");if(f>s/2){var p=s-f;u.bottom="".concat(p+5,"px")}else{var g=f+l;g<0&&(g=0),u.top="".concat(g+5,"px")}return u}function Id(e,t,n){void 0===n&&(n="modal");var r={top:"0",left:"0"};if(null==e.selection)return r;var o=a.isElement(t)&&e.isVoid(t),i=a.isElement(t)&&e.isInline(t),s=Ru.get(t);if(null==s)return r;var c=s.getBoundingClientRect(),l=c.top,u=c.left,f=c.height,d=c.width;if(o){var h=cl(s);if(null!=h){var p=h.getBoundingClientRect();l=p.top,f=p.height}}var g=jd(e);if(null==g)return r;var v=g.top,y=g.left,m=g.width,b=g.height,w={},x=l-v,S=u-y;if("bar"===n)return w.left="".concat(S,"px"),x>40?w.bottom="".concat(b-x+5,"px"):w.top="".concat(x+f+5,"px"),w;if("modal"===n){var E;if(o?i?S>(m-d)/2?w.right="".concat(m-S+5,"px"):w.left="".concat(S+d+5,"px"):w.left="20px":w.left="".concat(S,"px"),o)(E=x)<0&&(E=0),w.top="".concat(E,"px");else if(x>(b-f)/2)w.bottom="".concat(b-x+5,"px");else(E=x+f)<0&&(E=0),w.top="".concat(E+5,"px");return w}throw new Error("type '".concat(n,"' is invalid"))}function Fd(e,t){jc((function(){var n=jd(e);if(null!=n){var r,o=n.top,i=n.left,a=n.width,s=n.height,c=t.offset(),l=c.top,u=c.left,f=t.width(),d=t.height(),h=l-o,p=u-i,g=t.attr("style");if(g.indexOf("top")>=0)if((r=h+d-s)>0){var v=t.css("top"),y=parseInt(v.toString())-r;y<0&&(y=0),t.css("top","".concat(y,"px"))}if(g.indexOf("bottom")>=0&&l<0){var m=t.css("bottom"),b=parseInt(m.toString())-Math.abs(l);t.css("bottom","".concat(b,"px"))}if(g.indexOf("left")>=0)if((r=p+f-a)>0){var w=t.css("left"),x=parseInt(w.toString())-r;x<0&&(x=0),t.css("left","".concat(x,"px"))}if(g.indexOf("right")>=0&&u<0){var S=t.css("right"),E=parseInt(S.toString())-Math.abs(u);t.css("right","".concat(E,"px"))}}}))}var Bd=Co("slice"),_d=yt("species"),$d=Array,Wd=Math.max;_n({target:"Array",proto:!0,forced:!Bd},{slice:function(e,t){var n,r,o,i=Pe(this),a=mn(i),s=gn(e,a),c=gn(void 0===t?a:t,a);if(nr(i)&&(n=i.constructor,(ur(n)&&(n===$d||nr(n.prototype))||je(n)&&null===(n=n[_d]))&&(n=void 0),n===$d||void 0===n))return ns(i,s,c);for(r=new(void 0===n?$d:n)(Wd(c-s,0)),o=0;s<c;s++,o++)s in i&&Kr(r,o,i[s]);return r.length=o,r}});var Vd=Object.assign,zd=Object.defineProperty,Hd=xe([].concat),Ud=!Vd||ce((function(){if(le&&1!==Vd({b:1},Vd(zd({},"a",{enumerable:!0,get:function(){zd(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol("assign detection"),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!==Vd({},e)[n]||$n(Vd({},t)).join("")!==r}))?function(e,t){for(var n=st(e),r=arguments.length,o=1,i=Tn.f,a=ve.f;r>o;)for(var s,c=Te(arguments[o++]),l=i?Hd($n(c),i(c)):$n(c),u=l.length,f=0;u>f;)s=l[f++],le&&!de(a,c,s)||(n[s]=c[s]);return n}:Vd;_n({target:"Object",stat:!0,arity:2,forced:Object.assign!==Ud},{assign:Ud});var Kd=Tt.f,qd=Zn("".slice),Gd=Math.min,Jd=ai("startsWith"),Yd=!Jd&&!!function(){var e=Kd(String.prototype,"startsWith");return e&&!e.writable}();_n({target:"String",proto:!0,forced:!Yd&&!Jd},{startsWith:function(e){var t=Mr(Me(this));oi(e);var n=yn(Gd(arguments.length>1?arguments[1]:void 0,t.length)),r=Mr(e);return qd(t,n,n+r.length)===r}});var Xd=["props","attrs","style","dataset","on","hook"];function Qd(e){var t=e.data,n=void 0===t?{}:t,r=e.children,o=void 0===r?[]:r;Object.keys(n).forEach((function(t){var r,o,i=n[t];if("key"!==t){if(!Xd.includes(t)){if(t.startsWith("data-")){var a=t.slice(5);return a=J(a),function(e,t){null==e.data&&(e.data={});var n=e.data;null==n.dataset&&(n.dataset={});Object.assign(n.dataset,t)}(e,((r={})[a]=i,r)),void delete n[t]}!function(e,t){null==e.data&&(e.data={});var n=e.data;null==n.props&&(n.props={});Object.assign(n.props,t)}(e,(o={},o[t]=i,o)),delete n[t]}}else e.key=i})),o.length>0&&o.forEach((function(e){"string"!=typeof e&&Qd(e)}))}var Zd=[];function eh(e){Zd.push(e)}var th={};function nh(e){var t=e.type,n=e.renderElem;th[t||""]=n}function rh(e,t,n){var r=n.isInline(e)?"span":"div";return q(r,null,t)}function oh(e,n){var r,i=$u.findKey(n,e),a=n.isInline(e),s=t.isVoid(n,e),c=lf(i.id),l={id:c,key:i.id,"data-slate-node":"element","data-slate-inline":a},u=e.type,f=e.children,d=void 0===f?[]:f,h=function(e){return th[e]||rh}(u);r=s?null:d.map((function(t,r){return ch(t,r,e,n)}));var p=h(e,r,n);if(s){l["data-slate-void"]=!0;var g=a?"span":"div",v=La(o.texts(e),1),y=La(v[0],1)[0],m=ch(y,0,e,n),b=q(g,{"data-slate-spacer":!0,style:{height:"0",color:"transparent",outline:"none",position:"absolute"}},m);p=q(g,{style:{position:"relative"}},p,b),Nu.set(y,0),Lu.set(y,e)}return null==p.data&&(p.data={}),Object.assign(p.data,l),s||a||(p=function(e,t){var n=t;return Zd.forEach((function(r){n=r(e,t)})),n}(e,p)),jc((function(){var t=ol(c);null!=t&&(Du.set(i,t),Ru.set(e,t),Pu.set(t,e))})),p}function ih(e,t){return void 0===t&&(t=!1),q("span",{"data-slate-string":!0},t?e+"\n":e)}function ah(e,t){return void 0===e&&(e=0),void 0===t&&(t=!1),q("span",{"data-slate-zero-width":t?"n":"z","data-slate-length":e},"\ufeff",t?q("br",null):null)}function sh(e,n,i){if(null==e.text)throw new Error("Current node is not slate Text ".concat(JSON.stringify(e)));var a=$u.findKey(i,e),c=i.getConfig().decorate;if(null==c)throw new Error("Can not get config.decorate");var l=$u.findPath(i,e),u=c([e,l]),f=s.decorations(e,u),d=f.map((function(a,s){var c=function(e,n,i,a,s){void 0===n&&(n=!1);var c=e.text,l=$u.findPath(s,i),u=r.parent(l);if(t.isEditor(a))throw new Error("Text node ".concat(JSON.stringify(i)," parent is Editor"));return s.isVoid(a)?ah(o.string(a).length):""!==c||a.children[a.children.length-1]!==i||s.isInline(a)||""!==t.string(s,u)?""===c?ah():n&&"\n"===c.slice(-1)?ih(c,!0):ih(c):ah(0,!0)}(a,s===f.length-1,e,n,i);return c=function(e,t){var n=t;return Zd.forEach((function(t){n=t(e,n)})),n}(a,c),q("span",{"data-slate-leaf":!0},c)})),h=function(e){return"w-e-text-".concat(e)}(a.id),p=q("span",{"data-slate-node":"text",id:h,key:a.id},d);return jc((function(){var t=ol(h);null!=t&&(Du.set(a,t),Ru.set(e,t),Pu.set(t,e))})),p}function ch(e,t,n,r){return Nu.set(e,t),Lu.set(e,n),a.isElement(e)?oh(e,r):sh(e,n,r)}function lh(e,t){var n,r=e.$scroll,o=function(e){return"w-e-textarea-".concat(e)}(e.id),i=t.getConfig(),a=i.readOnly,s=i.autoFocus,c=function(e,t){return void 0===t&&(t=!1),G("div#".concat(e),{props:{contentEditable:!t}})}(o,a),l=t.children||[];c.children=l.map((function(e,n){var r=ch(e,n,t,t);return Qd(r),r}));var u=ku.get(e);if(null==u&&(u=!0),u){var d=function(e){return f('<div\n id="'.concat(e,'"\n data-slate-editor\n data-slate-node="value"\n suppressContentEditableWarning\n role="textarea"\n spellCheck="true"\n autoCorrect="true"\n autoCapitalize="true"\n ></div>'))}(o);r.append(d),e.$textArea=d,n=d[0],(p=$([W,V,z,H,U,K]))(n,c),ku.set(e,!1),Cu.set(e,p)}else{var h=Tu.get(e),p=Cu.get(e);if(null==h||null==p)return;n=h.elm,p(h,c)}if(null!=n||null!=(n=ol(o))){if((u?s:t.isFocused())&&n.focus({preventScroll:!0}),u){var g=Jc(n);g&&Au.set(t,g)}Mu.set(t,n),Ru.set(t,n),Pu.set(n,t),Tu.set(e,c)}}function uh(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function fh(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function dh(e,t){if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){var n=getComputedStyle(e,null);return fh(n.overflowY,t)||fh(n.overflowX,t)||function(e){var t=function(e){if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}}(e);return!!t&&(t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth)}(e)}return!1}function hh(e,t,n,r,o,i,a,s){return i<e&&a>t||i>e&&a<t?0:i<=e&&s<=n||a>=t&&s>=n?i-e-r:a>t&&s<n||i<e&&s>n?a-t+o:0}var ph=function(e,t){var n=window,r=t.scrollMode,o=t.block,i=t.inline,a=t.boundary,s=t.skipOverflowHiddenElements,c="function"==typeof a?a:function(e){return e!==a};if(!uh(e))throw new TypeError("Invalid target");for(var l,u,f=document.scrollingElement||document.documentElement,d=[],h=e;uh(h)&&c(h);){if((h=null==(u=(l=h).parentElement)?l.getRootNode().host||null:u)===f){d.push(h);break}null!=h&&h===document.body&&dh(h)&&!dh(document.documentElement)||null!=h&&dh(h,s)&&d.push(h)}for(var p=n.visualViewport?n.visualViewport.width:innerWidth,g=n.visualViewport?n.visualViewport.height:innerHeight,v=window.scrollX||pageXOffset,y=window.scrollY||pageYOffset,m=e.getBoundingClientRect(),b=m.height,w=m.width,x=m.top,S=m.right,E=m.bottom,O=m.left,k="start"===o||"nearest"===o?x:"end"===o?E:x+b/2,C="center"===i?O+w/2:"end"===i?S:O,T=[],N=0;N<d.length;N++){var L=d[N],M=L.getBoundingClientRect(),P=M.height,D=M.width,R=M.top,j=M.right,A=M.bottom,I=M.left;if("if-needed"===r&&x>=0&&O>=0&&E<=g&&S<=p&&x>=R&&E<=A&&O>=I&&S<=j)return T;var F=getComputedStyle(L),B=parseInt(F.borderLeftWidth,10),_=parseInt(F.borderTopWidth,10),$=parseInt(F.borderRightWidth,10),W=parseInt(F.borderBottomWidth,10),V=0,z=0,H="offsetWidth"in L?L.offsetWidth-L.clientWidth-B-$:0,U="offsetHeight"in L?L.offsetHeight-L.clientHeight-_-W:0,K="offsetWidth"in L?0===L.offsetWidth?0:D/L.offsetWidth:0,q="offsetHeight"in L?0===L.offsetHeight?0:P/L.offsetHeight:0;if(f===L)V="start"===o?k:"end"===o?k-g:"nearest"===o?hh(y,y+g,g,_,W,y+k,y+k+b,b):k-g/2,z="start"===i?C:"center"===i?C-p/2:"end"===i?C-p:hh(v,v+p,p,B,$,v+C,v+C+w,w),V=Math.max(0,V+y),z=Math.max(0,z+v);else{V="start"===o?k-R-_:"end"===o?k-A+W+U:"nearest"===o?hh(R,A,P,_,W+U,k,k+b,b):k-(R+P/2)+U/2,z="start"===i?C-I-B:"center"===i?C-(I+D/2)+H/2:"end"===i?C-j+$+H:hh(I,j,D,B,$+H,C,C+w,w);var G=L.scrollLeft,J=L.scrollTop;k+=J-(V=Math.max(0,Math.min(J+V/q,L.scrollHeight-P/q+U))),C+=G-(z=Math.max(0,Math.min(G+z/K,L.scrollWidth-D/K+H)))}T.push({el:L,top:V,left:z})}return T};function gh(e){return e===Object(e)&&0!==Object.keys(e).length}function vh(e,t){var n=e.isConnected||e.ownerDocument.documentElement.contains(e);if(gh(t)&&"function"==typeof t.behavior)return t.behavior(n?ph(e,t):[]);if(n){var r=function(e){return!1===e?{block:"end",inline:"nearest"}:gh(e)?e:{block:"start",inline:"nearest"}}(t);return function(e,t){void 0===t&&(t="auto");var n="scrollBehavior"in document.body.style;e.forEach((function(e){var r=e.el,o=e.top,i=e.left;r.scroll&&n?r.scroll({top:o,left:i,behavior:t}):(r.scrollTop=o,r.scrollLeft=i)}))}(ph(e,r),r.behavior)}}function yh(e,t){return Qc(t)&&$u.hasDOMNode(e,t,{editable:!0})}function mh(e,n){if(e.getConfig().readOnly)return!1;var r=bh(e,n)&&$u.toSlateNode(e,n);return t.isVoid(e,r)}function bh(e,t){return Qc(t)&&$u.hasDOMNode(e,t)}function wh(e,t,n){void 0===n&&(n=!1);var r=t.selection,o=t.getConfig(),a=$u.findDocumentOrShadowRoot(t).getSelection();if(a&&(!e.isComposing||n)&&t.isFocused()){var s="None"!==a.type;if(r||s){var c=Mu.get(t),l=!1;if(c.contains(a.anchorNode)&&c.contains(a.focusNode)&&(l=!0),s&&l&&r){var u=$u.toSlateRange(t,a,{exactMatch:!0,suppressThrow:!0});if(u&&i.equals(u,r)){var f=!0;if(i.isCollapsed(r)){var d=a.anchorNode,h=a.anchorOffset;if(d===c){var p=c.childNodes,g=void 0;(g=p[h])&&g.matches("table")&&(f=!1),(g=p[h-1])&&g.matches("table")&&(f=!1)}}if(f)return}}if(!r||$u.hasRange(t,r)){e.isUpdatingSelection=!0;var v=r&&$u.toDOMRange(t,r);if(v){i.isBackward(r)?a.setBaseAndExtent(v.endContainer,v.endOffset,v.startContainer,v.startOffset):a.setBaseAndExtent(v.startContainer,v.startOffset,v.endContainer,v.endOffset);var y=v.startContainer.parentElement;if(!y.closest("[data-slate-spacer]")){y.getBoundingClientRect=v.getBoundingClientRect.bind(v);var m=document.body;vh(y,{scrollMode:"if-needed",boundary:o.scroll?c.parentElement:m,block:"end",behavior:"smooth"}),delete y.getBoundingClientRect}}else a.removeAllRanges();setTimeout((function(){v&&pl&&c.focus(),e.isUpdatingSelection=!1}))}else t.selection=$u.toSlateRange(t,a,{exactMatch:!1,suppressThrow:!1})}}}var xh=new WeakMap,Sh=new WeakMap;var Eh={bold:"mod+b",compose:["down","left","right","up","backspace","enter"],moveBackward:"left",moveForward:"right",moveWordBackward:"ctrl+left",moveWordForward:"ctrl+right",deleteBackward:"shift?+backspace",deleteForward:"shift?+delete",extendBackward:"shift+left",extendForward:"shift+right",italic:"mod+i",splitBlock:"shift?+enter",undo:"mod+z",tab:"tab",selectAll:"mod+a"},Oh={moveLineBackward:"opt+up",moveLineForward:"opt+down",moveWordBackward:"opt+left",moveWordForward:"opt+right",deleteBackward:["ctrl+backspace","ctrl+h"],deleteForward:["ctrl+delete","ctrl+d"],deleteLineBackward:"cmd+shift?+backspace",deleteLineForward:["cmd+shift?+delete","ctrl+k"],deleteWordBackward:"opt+shift?+backspace",deleteWordForward:"opt+shift?+delete",extendLineBackward:"opt+shift+up",extendLineForward:"opt+shift+down",redo:"cmd+shift+z",transposeCharacter:"ctrl+t"},kh={deleteWordBackward:"ctrl+shift?+backspace",deleteWordForward:"ctrl+shift?+delete",redo:["ctrl+y","ctrl+shift+z"]},Ch=function(e){var t=Eh[e],n=Oh[e],r=kh[e],o=t&&Y(t),i=n&&Y(n),a=r&&Y(r);return function(e){return!(!o||!o(e))||(!!(hl&&i&&i(e))||!(hl||!a||!a(e)))}},Th={isBold:Ch("bold"),isCompose:Ch("compose"),isMoveBackward:Ch("moveBackward"),isMoveForward:Ch("moveForward"),isDeleteBackward:Ch("deleteBackward"),isDeleteForward:Ch("deleteForward"),isDeleteLineBackward:Ch("deleteLineBackward"),isDeleteLineForward:Ch("deleteLineForward"),isDeleteWordBackward:Ch("deleteWordBackward"),isDeleteWordForward:Ch("deleteWordForward"),isExtendBackward:Ch("extendBackward"),isExtendForward:Ch("extendForward"),isExtendLineBackward:Ch("extendLineBackward"),isExtendLineForward:Ch("extendLineForward"),isItalic:Ch("italic"),isMoveLineBackward:Ch("moveLineBackward"),isMoveLineForward:Ch("moveLineForward"),isMoveWordBackward:Ch("moveWordBackward"),isMoveWordForward:Ch("moveWordForward"),isRedo:Ch("redo"),isSplitBlock:Ch("splitBlock"),isTransposeCharacter:Ch("transposeCharacter"),isUndo:Ch("undo"),isTab:Ch("tab"),isSelectAll:Ch("selectAll")};function Nh(e){e.preventDefault()}var Lh={beforeinput:function(n,r,o){var a=n,s=o.getConfig().readOnly;if(bl&&!s&&yh(o,a.target)){var c=o.selection,l=a.inputType,u=a.dataTransfer||a.data||void 0;if("insertCompositionText"!==l&&"deleteCompositionText"!==l){if(a.preventDefault(),!l.startsWith("delete")||l.startsWith("deleteBy")){var f=La(a.getTargetRanges(),1)[0];if(f){var d=$u.toSlateRange(o,f,{exactMatch:!1,suppressThrow:!1});c&&i.equals(c,d)||e.select(o,d)}}if(c&&i.isExpanded(c)&&l.startsWith("delete")){var h=l.endsWith("Backward")?"backward":"forward";t.deleteFragment(o,{direction:h})}else switch(l){case"deleteByComposition":case"deleteByCut":case"deleteByDrag":t.deleteFragment(o);break;case"deleteContent":case"deleteContentForward":t.deleteForward(o);break;case"deleteContentBackward":t.deleteBackward(o);break;case"deleteEntireSoftLine":t.deleteBackward(o,{unit:"line"}),t.deleteForward(o,{unit:"line"});break;case"deleteHardLineBackward":t.deleteBackward(o,{unit:"block"});break;case"deleteSoftLineBackward":t.deleteBackward(o,{unit:"line"});break;case"deleteHardLineForward":t.deleteForward(o,{unit:"block"});break;case"deleteSoftLineForward":t.deleteForward(o,{unit:"line"});break;case"deleteWordBackward":t.deleteBackward(o,{unit:"word"});break;case"deleteWordForward":t.deleteForward(o,{unit:"word"});break;case"insertLineBreak":case"insertParagraph":t.insertBreak(o);break;case"insertFromDrop":case"insertFromPaste":case"insertFromYank":case"insertReplacementText":case"insertText":if("insertFromPaste"===l&&!_u.get(o))break;_c(u)?o.insertData(u):"string"==typeof u&&t.insertText(o,u)}}}},blur:function(e,t,n){var r=e,o=t.isUpdatingSelection,i=t.latestElement;if(!n.getConfig().readOnly&&!o&&yh(n,r.target)){var s=$u.findDocumentOrShadowRoot(n);if(i!==s.activeElement){var c=r.relatedTarget;if(!(c===$u.toDOMNode(n,n)||Xc(c)&&c.hasAttribute("data-slate-spacer"))){if(null!=c&&Qc(c)&&$u.hasDOMNode(n,c)){var l=$u.toSlateNode(n,c);if(a.isElement(l)&&!n.isVoid(l))return}if(gl){var u=s.getSelection();null==u||u.removeAllRanges()}Iu.delete(n)}}}},focus:function(e,t,n){var r=$u.toDOMNode(n,n),o=$u.findDocumentOrShadowRoot(n);t.latestElement=o.activeElement,pl&&e.target!==r?r.focus():Iu.set(n,!0)},click:function(n,i,a){if(!a.getConfig().readOnly&&bh(a,n.target)&&Qc(n.target)){var s=$u.toSlateNode(a,n.target),c=$u.findPath(a,s);if(t.hasPath(a,c))if(o.get(a,c)===s){var l=t.start(a,c),u=t.end(a,c),f=t.void(a,{at:l}),d=t.void(a,{at:u});if(f&&d&&r.equals(f[1],d[1])){var h=t.range(a,l);e.select(a,h)}}}},compositionstart:function(e,n,r){if(yh(r,e.target)){var o=r.selection;if(o&&i.isExpanded(o)&&(t.deleteFragment(r),Promise.resolve().then((function(){wh(n,r,!0)}))),o&&(i.isExpanded(o)||i.isCollapsed(o))){var a=$u.toDOMRange(r,o).startContainer,s=a.textContent||"";xh.set(r,s),Sh.set(r,a)}n.isComposing=!0,function(e,t){var n;t.getConfig().placeholder&&t.isEmpty()&&e.showPlaceholder&&(null===(n=e.$placeholder)||void 0===n||n.hide(),e.showPlaceholder=!1)}(n,r)}},compositionend:function(e,n,r){var o=e;if(yh(r,o.target)){n.isComposing=!1;var c=r.selection;if(null!=c){(ml||pl)&&$u.cleanExposedTexNodeInSelectionBlock(r);for(var l=i.isBackward(c)?c.focus:c.anchor,u=La(t.node(r,[l.path[0]]),1)[0],f=0;f<l.path.length;f++){var d=La(t.node(r,l.path.slice(0,f+1)),1)[0];if(a.isElement(d)&&((gl||pl)&&"link"===d.type||"code"===d.type)){$u.setNewKey(u);break}}var h=o.data;if(h){if(r.getConfig().maxLength){var p=$u.getLeftLengthOfMaxLength(r);if(p<h.length)$u.toDOMRange(r,c).startContainer.textContent=xh.get(r)||"",p>0&&t.insertText(r,h.slice(0,p)),n.changeViewState();else t.insertText(r,h)}else{var g=$u.findDocumentOrShadowRoot(r).getSelection();g&&function(e,n){if(i.isCollapsed(n)){var r=n.anchor,o=n.focus;if(2===r.path.length&&2===o.path.length&&(0===r.offset||0===o.path.offset)){var a=t.node(e,r.path),c=0===r.offset?r.path:o.path,l=[c[0],c[1]-1];if(0===c[1])return!1;var u=t.node(e,l);if(s.isText(u[0])&&s.isText(a[0]))return!0}}}(r,c)&&(r.selection=$u.toSlateRange(r,g,{exactMatch:!1,suppressThrow:!1})),t.insertText(r,h)}gl||setTimeout((function(){var e=r.selection;if(null!=e){var t=Sh.get(r);if(null!=t)$u.toDOMRange(r,e).startContainer!==t&&(t.textContent=xh.get(r)||"")}}))}}}},compositionupdate:function(e,t,n){yh(n,e.target)&&(t.isComposing=!0)},keydown:function(n,r,s){var c=n,l=s.selection;if(!s.getConfig().readOnly&&!r.isComposing&&yh(s,c.target)){if(function(e,t){var n=mu.get(e),r=n&&n.getMenus(),o=wu.get(e),i=o&&o.getMenus(),a=Ta(Ta({},r),i);for(var s in a){var c=a[s],l=c.hotkey;if(l&&X(l,t)&&!c.isDisabled(e)){var u=c.getValue(e);c.exec(e,u)}}}(s,c),Th.isTab(c))return Nh(c),void s.handleTab();if(Th.isRedo(c))return Nh(c),void("function"==typeof s.redo&&s.redo());if(Th.isUndo(c))return Nh(c),void("function"==typeof s.undo&&s.undo());if(Th.isMoveLineBackward(c))return Nh(c),void e.move(s,{unit:"line",reverse:!0});if(Th.isMoveLineForward(c))return Nh(c),void e.move(s,{unit:"line"});if(Th.isExtendLineBackward(c))return Nh(c),void e.move(s,{unit:"line",edge:"focus",reverse:!0});if(Th.isExtendLineForward(c))return Nh(c),void e.move(s,{unit:"line",edge:"focus"});if(Th.isMoveBackward(c))return Nh(c),void(l&&i.isCollapsed(l)?e.move(s,{reverse:!0}):e.collapse(s,{edge:"start"}));if(Th.isMoveForward(c))return Nh(c),void(l&&i.isCollapsed(l)?e.move(s):e.collapse(s,{edge:"end"}));if(Th.isMoveWordBackward(c))return Nh(c),l&&i.isExpanded(l)&&e.collapse(s,{edge:"focus"}),void e.move(s,{unit:"word",reverse:!0});if(Th.isMoveWordForward(c))return Nh(c),l&&i.isExpanded(l)&&e.collapse(s,{edge:"focus"}),void e.move(s,{unit:"word"});if(Th.isSelectAll(c))return Nh(c),void s.selectAll();if(bl){if((ml||gl)&&l&&(Th.isDeleteBackward(c)||Th.isDeleteForward(c))&&i.isCollapsed(l)){var u=o.parent(s,l.anchor.path);if(a.isElement(u)&&t.isVoid(s,u)&&t.isInline(s,u))return c.preventDefault(),void e.delete(s,{unit:"block"})}}else{if(Th.isBold(c)||Th.isItalic(c)||Th.isTransposeCharacter(c))return void Nh(c);if(Th.isSplitBlock(c))return Nh(c),void t.insertBreak(s);if(Th.isDeleteBackward(c))return Nh(c),void(l&&i.isExpanded(l)?t.deleteFragment(s,{direction:"backward"}):t.deleteBackward(s));if(Th.isDeleteForward(c))return Nh(c),void(l&&i.isExpanded(l)?t.deleteFragment(s,{direction:"forward"}):t.deleteForward(s));if(Th.isDeleteLineBackward(c))return Nh(c),void(l&&i.isExpanded(l)?t.deleteFragment(s,{direction:"backward"}):t.deleteBackward(s,{unit:"line"}));if(Th.isDeleteLineForward(c))return Nh(c),void(l&&i.isExpanded(l)?t.deleteFragment(s,{direction:"forward"}):t.deleteForward(s,{unit:"line"}));if(Th.isDeleteWordBackward(c))return Nh(c),void(l&&i.isExpanded(l)?t.deleteFragment(s,{direction:"backward"}):t.deleteBackward(s,{unit:"word"}));if(Th.isDeleteWordForward(c))return Nh(c),void(l&&i.isExpanded(l)?t.deleteFragment(s,{direction:"forward"}):t.deleteForward(s,{unit:"word"}))}}},keypress:function(e,n,r){if(!bl&&!r.getConfig().readOnly&&yh(r,e.target)){e.preventDefault();var o=e.key;t.insertText(r,o)}},copy:function(e,t,n){var r=e;if(yh(n,r.target)){r.preventDefault();var o=r.clipboardData;null!=o&&n.setFragmentData(o)}},cut:function(n,r,a){var s=n,c=a.selection;if(!a.getConfig().readOnly&&yh(a,s.target)){s.preventDefault();var l=s.clipboardData;if(null!=l&&(a.setFragmentData(l),c))if(i.isExpanded(c))t.deleteFragment(a);else{var u=o.parent(a,c.anchor.path);t.isVoid(a,u)&&e.delete(a)}}},paste:function(e,t,n){_u.set(n,!0);var r=e;if(!n.getConfig().readOnly&&yh(n,r.target)){var o=n.getConfig().customPaste;if(o)if(!1===o(n,r))return void _u.set(n,!1);if(!bl||tl(r)){r.preventDefault();var i=r.clipboardData;null!=i&&n.insertData(i)}}},dragover:function(e,n,r){if(bh(r,e.target)){var o=$u.toSlateNode(r,e.target);t.isVoid(r,o)&&e.preventDefault()}},dragstart:function(n,r,o){var i=n;if(bh(o,i.target)&&!o.getConfig().readOnly){var a=$u.toSlateNode(o,i.target),s=$u.findPath(o,a);if(t.isVoid(o,a)||t.void(o,{at:s,voids:!0})){var c=t.range(o,s);e.select(o,c)}var l=i.dataTransfer;null!=l&&(r.isDraggingInternally=!0,o.setFragmentData(l))}},dragend:function(e,t,n){var r=e;n.getConfig().readOnly||t.isDraggingInternally&&bh(n,r.target)&&(t.isDraggingInternally=!1)},drop:function(t,n,r){var o=t,i=o.dataTransfer;if(!r.getConfig().readOnly&&bh(r,o.target)&&null!=i&&!(bl&&gl&&i.files.length>0)){o.preventDefault();var a=r.selection,s=$u.findEventRange(r,o);e.select(r,s),n.isDraggingInternally&&(a&&e.delete(r,{at:a}),n.isDraggingInternally=!1),r.insertData(i),r.isFocused()||r.focus()}}},Mh=1,Ph=function(){function t(t){var n=this;this.id=Mh++,this.$textArea=null,this.$progressBar=f('<div class="w-e-progress-bar"></div>'),this.$maxLengthInfo=f('<div class="w-e-max-length-info"></div>'),this.isComposing=!1,this.isUpdatingSelection=!1,this.isDraggingInternally=!1,this.latestElement=null,this.showPlaceholder=!1,this.$placeholder=null,this.latestEditorSelection=null,this.onDOMSelectionChange=_((function(){var t=n.editorInstance;!function(t,n){var r=t.isComposing,o=t.isUpdatingSelection,i=t.isDraggingInternally;if(!(n.getConfig().readOnly||r||o||i)){var a=$u.findDocumentOrShadowRoot(n),s=a.activeElement,c=$u.toDOMNode(n,n),l=a.getSelection();if(s!==c)return Iu.delete(n),void e.deselect(n);if(t.latestElement=s,Iu.set(n,!0),!l)return e.deselect(n);var u=l.anchorNode,f=l.focusNode,d=yh(n,u)||mh(n,u),h=yh(n,f)||mh(n,f);if(d&&h){var p=$u.toSlateRange(n,l,{exactMatch:!1,suppressThrow:!1});e.select(n,p)}}}(n,t)}),100);var r=f(t);if(0===r.length)throw new Error("Cannot find textarea DOM by selector '".concat(t,"'"));this.$box=r;var o=f('<div class="w-e-text-container"></div>');o.append(this.$progressBar),o.append(this.$maxLengthInfo),r.append(o);var i=f('<div class="w-e-scroll"></div>');o.append(i),this.$scroll=i,this.$textAreaContainer=o,jc((function(){var e=n.editorInstance,t=$u.getWindow(e);t.document.addEventListener("selectionchange",n.onDOMSelectionChange),e.on("destroyed",(function(){t.document.removeEventListener("selectionchange",n.onDOMSelectionChange)})),o.on("click",(function(){return e.hidePanelOrModal()})),e.on("change",n.changeViewState.bind(n));var i=e.getConfig(),a=i.onChange,s=i.scroll;a&&e.on("change",(function(){return a(e)})),s||(r.css("position","relative"),o.addClass("no-scroll")),n.onFocusAndOnBlur(),e.on("change",n.changeMaxLengthInfo.bind(n)),n.bindEvent()}))}return Object.defineProperty(t.prototype,"editorInstance",{get:function(){var e=vu.get(this);if(null==e)throw new Error("Can not get editor instance");return e},enumerable:!1,configurable:!0}),t.prototype.bindEvent=function(){var e=this,t=this.$textArea,n=this.$scroll,r=this.editorInstance;null!=t&&(B(Lh,(function(n,o){t.on(o,(function(t){n(t,e,r)}))})),r.getConfig().scroll&&(n.css("overflow-y","auto"),n.on("scroll",_((function(){r.emit("scroll")}),100))))},t.prototype.onFocusAndOnBlur=function(){var e=this,t=this.editorInstance,n=t.getConfig(),r=n.onBlur,o=n.onFocus;this.latestEditorSelection=t.selection,t.on("change",(function(){null==e.latestEditorSelection&&null!=t.selection?setTimeout((function(){return o&&o(t)})):null!=e.latestEditorSelection&&null==t.selection&&setTimeout((function(){return r&&r(t)})),e.latestEditorSelection=t.selection}))},t.prototype.changeMaxLengthInfo=function(){var e=this.editorInstance,t=e.getConfig().maxLength;if(t){var n=t-$u.getLeftLengthOfMaxLength(e);this.$maxLengthInfo[0].innerHTML="".concat(n,"/").concat(t)}},t.prototype.changeProgress=function(e){var t=this.$progressBar;t.css("width","".concat(e,"%")),e>=100&&setTimeout((function(){t.hide(),t.css("width","0"),t.show()}),1e3)},t.prototype.changeViewState=function(){var e=this,t=this.editorInstance;lh(this,t),function(e,t){var n,r=t.getConfig().placeholder;if(r){var o=t.isEmpty();if(o&&!e.showPlaceholder&&!e.isComposing){if(null==e.$placeholder){var i=f('<div class="w-e-text-placeholder">'.concat(r,"</div>"));e.$textAreaContainer.append(i),e.$placeholder=i}return e.$placeholder.show(),void(e.showPlaceholder=!0)}!o&&e.showPlaceholder&&(null===(n=e.$placeholder)||void 0===n||n.hide(),e.showPlaceholder=!1)}}(this,t),jc((function(){wh(e,t)}))},t.prototype.destroy=function(){this.$textAreaContainer.remove()},t}();ta("match",(function(e,t,n){return[function(t){var n=Me(this),r=Ne(t)?void 0:et(t,e);return r?de(r,t,n):new RegExp(t)[e](Mr(n))},function(e){var r=Pt(this),o=Mr(e),i=n(t,r,o);if(i.done)return i.value;if(!r.global)return da(r,o);var a=r.unicode;r.lastIndex=0;for(var s,c=[],l=0;null!==(s=da(r,o));){var u=Mr(s[0]);c[l]=u,""===u&&(r.lastIndex=ra(o,yn(r.lastIndex),a)),l++}return 0===l?null:c}]}));function Dh(e){if(e.removeAttr){e.removeAttr("width"),e.removeAttr("height"),e.removeAttr("fill"),e.removeAttr("class"),e.removeAttr("t"),e.removeAttr("p-id");var t=e.children();t.length&&Dh(t)}}function Rh(){return f('<svg viewBox="0 0 1024 1024"><path d="M498.7 655.8l-197.6-268c-8.1-10.9-0.3-26.4 13.3-26.4h395.2c13.6 0 21.4 15.4 13.3 26.4l-197.6 268c-6.6 9-20 9-26.6 0z"></path></svg>')}function jh(){return f('<div class="w-e-bar-divider"></div>')}function Ah(e,t,n,r,o){if(void 0===r&&(r=""),void 0===o&&(o=!1),t){if(r){var i=hl?"cmd":"ctrl";r=r.replace("mod",i)}if(o)r&&(e.attr("data-tooltip",r),e.addClass("w-e-menu-tooltip-v5"),e.addClass("tooltip-right"));else{var a=r?"".concat(n,"\n").concat(r):n;e.attr("data-tooltip",a),e.addClass("w-e-menu-tooltip-v5")}}}var Ih=function(){function e(e,t,n){void 0===n&&(n=!1);var r=this;this.$elem=f('<div class="w-e-bar-item"></div>'),this.$button=f('<button type="button"></button>'),this.disabled=!1,this.menu=t;var o=t.tag,i=t.width;if("button"!==o)throw new Error("Invalid tag '".concat(o,"', expected 'button'"));var a=t.title,s=t.hotkey,c=void 0===s?"":s,l=t.iconSvg,u=void 0===l?"":l,d=this.$button;if(u){var h=f(u);Dh(h),d.append(h)}else d.text(a);Ah(d,u,a,c,n),n&&u&&d.append(f('<span class="title">'.concat(a,"</span>"))),i&&d.css("width","".concat(i,"px")),d.attr("data-menu-key",e),this.$elem.append(d),jc((function(){return r.init()}))}return e.prototype.init=function(){var e=this;this.setActive(),this.setDisabled(),this.$button.on("click",(function(t){t.preventDefault(),Yh(e).hidePanelOrModal(),e.disabled||(e.exec(),e.onButtonClick())}))},e.prototype.exec=function(){var e=Yh(this),t=this.menu,n=t.getValue(e);this.setIcon(),this.setTooltip(),t.exec(e,n)},e.prototype.setActive=function(){var e=Yh(this),t=this.$button,n="active";this.menu.isActive(e)?t.addClass(n):t.removeClass(n)},e.prototype.setDisabled=function(){var e=Yh(this),t=this.$button,n=this.menu.isDisabled(e);(null==e.selection||e.isDisabled())&&(n=!0),this.menu.alwaysEnable&&(n=!1);var r="disabled";n?t.addClass(r):t.removeClass(r),this.disabled=n},e.prototype.setIcon=function(){var e=Yh(this),t=this.$button;if(this.menu.getIcon){var n=this.menu.getIcon(e);if(n){t.find("svg").remove();var r=f(n);Dh(r),t.append(r)}}},e.prototype.setTooltip=function(){var e=Yh(this),t=this.$button;if(this.menu.getTitle){var n=this.menu.getTitle(e),r=this.menu.iconSvg;n&&r&&Ah(t,r,n)}},e.prototype.changeMenuState=function(){this.setActive(),this.setDisabled()},e}(),Fh=function(e){function t(t,n,r){return void 0===r&&(r=!1),e.call(this,t,n,r)||this}return Ca(t,e),t.prototype.onButtonClick=function(){},t}(Ih),Bh=function(){function e(e){this.isShow=!1,this.showTime=0,this.record(e)}return e.prototype.record=function(e){var t=Su.get(e);null==t&&(t=new Set,Su.set(e,t)),t.add(this),Eu.set(this,e)},e.prototype.renderContent=function(e){var t=this.$elem;t.empty(),t.append(e);var n=this.genSelfElem();n&&t.append(n)},e.prototype.appendTo=function(e){var t=this.$elem;e.append(t)},e.prototype.show=function(){if(!this.isShow){this.showTime=Date.now(),this.$elem.show(),this.isShow=!0;var e=Eu.get(this);e&&e.emit("modalOrPanelShow",this)}},e.prototype.hide=function(){if(this.isShow&&!(Date.now()-this.showTime<200)){this.$elem.hide(),this.isShow=!1;var e=Eu.get(this);e&&e.emit("modalOrPanelHide")}},e}(),_h=function(e){function t(t){var n=e.call(this,t)||this;return n.type="dropPanel",n.$elem=f('<div class="w-e-drop-panel"></div>'),n}return Ca(t,e),t.prototype.genSelfElem=function(){return null},t}(Bh),$h=function(e){function t(t,n,r){void 0===r&&(r=!1);var o=e.call(this,t,n,r)||this;if(o.dropPanel=null,o.menu=n,n.showDropPanel){var i=Rh();o.$button.append(i)}return o}return Ca(t,e),t.prototype.onButtonClick=function(){this.menu.showDropPanel&&this.handleDropPanel()},t.prototype.handleDropPanel=function(){var e=this.menu;if(null!=e.getPanelContentElem){var t=Yh(this);if(null==this.dropPanel){var n=new _h(t),r=e.getPanelContentElem(t);n.renderContent(r),n.appendTo(this.$elem),n.show(),this.dropPanel=n}else{var o=this.dropPanel;if(o.isShow)o.hide();else{r=e.getPanelContentElem(t);o.renderContent(r),o.show()}}var i=this.dropPanel;if(i.isShow){var a=this.$elem,s=a.offset().left,c=a.parents(".w-e-bar");s-c.offset().left>=c.width()/2?i.$elem.css({left:"none",right:"0"}):i.$elem.css({left:"0",right:"none"})}}},t}(Ih),Wh=function(e){function t(t,n){void 0===n&&(n=0);var r=e.call(this,t)||this;r.type="modal",r.$elem=f('<div class="w-e-modal"></div>'),r.width=0,n&&(r.width=n);var o=r.$elem;return o.on("click",(function(e){return e.stopPropagation()})),o.on("keyup",(function(e){"Escape"===e.code&&(r.hide(),t.restoreSelection())})),r}return Ca(t,e),t.prototype.genSelfElem=function(){var e=this,t=f('<span class="btn-close">'.concat('<svg viewBox="0 0 1024 1024"><path d="M1024 896.1024l-128 128L512 640 128 1024 0 896 384 512 0 128 128 0 512 384 896.1024 0l128 128L640 512z"></path></svg>',"</span>")),n=Eu.get(this);return t.on("click",(function(){e.hide(),null==n||n.restoreSelection()})),t},t.prototype.setStyle=function(e){var t=this.width,n=this.$elem;n.attr("style",""),t&&n.css("width","".concat(t,"px")),n.css(e)},t}(Bh);function Vh(e,t,n){var r=f('<label class="babel-container"></label>');r.append("<span>".concat(e,"</span>"));var o=f('<input type="text" id="'.concat(t,'" placeholder="').concat(n||"",'">'));return r.append(o),[r[0],o[0]]}function zh(e,t,n){var r=f('<label class="babel-container"></label>');r.append("<span>".concat(e,"</span>"));var o=f('<textarea type="text" id="'.concat(t,'" placeholder="').concat(n||"",'"></textarea>'));return r.append(o),[r[0],o[0]]}function Hh(e,t){var n=f('<div class="button-container"></div>'),r=f('<button type="button" id="'.concat(e,'">').concat(t,"</button>"));return n.append(r),[n[0],r[0]]}var Uh=function(e){function t(t,n,r){void 0===r&&(r=!1);var o=e.call(this,t,n,r)||this;return o.$body=f("body"),o.modal=null,o.menu=n,o}return Ca(t,e),t.prototype.onButtonClick=function(){this.menu.showModal&&this.handleModal()},t.prototype.getPosition=function(){var e=Yh(this),t=this.menu.getModalPositionNode(e);return a.isElement(t)?Id(e,t,"modal"):Ad(e)},t.prototype.handleModal=function(){var e=Yh(this),t=this.menu;if(null==this.modal){var n=new Wh(e,t.modalWidth);this.renderAndShowModal(n,!0),this.modal=n}else{(n=this.modal).isShow?n.hide():this.renderAndShowModal(n,!1)}},t.prototype.renderAndShowModal=function(e,t){void 0===t&&(t=!1);var n=Yh(this),r=this.menu;if(null!=r.getModalContentElem){var o=$u.getTextarea(n),i=$u.getToolbar(n),a=((null==i?void 0:i.getConfig())||{}).modalAppendToBody,s=r.getModalContentElem(n);if(e.renderContent(s),a)e.setStyle({left:"0",right:"0"});else{var c=this.getPosition();e.setStyle(c)}t&&(a?e.appendTo(this.$body):e.appendTo(o.$textAreaContainer)),e.show(),a||Fd(n,e.$elem),setTimeout((function(){n.blur()}))}},t}(Ih);var Kh=function(e){function t(t,n){var r=e.call(this,t)||this;return r.type="selectList",r.$elem=f('<div class="w-e-select-list"></div>'),n&&r.$elem.css("width","".concat(n,"px")),r.$elem.on("click",(function(e){e.stopPropagation()})),r}return Ca(t,e),t.prototype.renderList=function(e){var t=this.$elem;t.empty();var n=f("<ul></ul>");e.forEach((function(e){var t=e.value,r=e.text,o=e.selected,i=e.styleForRenderMenuList,a=f('<li data-value="'.concat(t,'"></li>'));if(i&&a.css(i),o){var s=f('<svg viewBox="0 0 1446 1024"><path d="M574.116299 786.736392 1238.811249 48.517862C1272.390222 11.224635 1329.414799 7.827718 1366.75664 41.450462 1403.840015 74.840484 1406.731043 132.084741 1373.10189 169.433699L655.118888 966.834607C653.072421 969.716875 650.835807 972.514337 648.407938 975.210759 615.017957 1012.29409 558.292155 1015.652019 521.195664 982.250188L72.778218 578.493306C35.910826 545.297758 32.859041 488.584019 66.481825 451.242134 99.871807 414.158803 156.597563 410.800834 193.694055 444.202665L574.116299 786.736392Z"></path></svg>');a.append(s),a.addClass("selected")}a.append(f('<span data-value="'.concat(t,'">').concat(r,"</span>"))),a.attr("title",r),n.append(a)})),t.append(n)},t.prototype.genSelfElem=function(){return null},t}(Bh);var qh=function(){function e(e,t,n){void 0===n&&(n=!1);var r=this;this.$elem=f('<div class="w-e-bar-item"></div>'),this.$button=f('<button type="button" class="select-button"></button>'),this.disabled=!1,this.selectList=null;var o=t.tag,i=t.title,a=t.width,s=t.iconSvg,c=void 0===s?"":s,l=t.hotkey,u=void 0===l?"":l;if("select"!==o)throw new Error("Invalid tag '".concat(o,"', expected 'select'"));var d=this.$button;a&&d.css("width","".concat(a,"px")),d.attr("data-menu-key",e),Ah(d,c,i,u,n),this.$elem.append(d),this.menu=t,jc((function(){return r.init()}))}return e.prototype.init=function(){var e=this;this.setSelectedValue(),this.$button.on("click",(function(t){t.preventDefault(),Yh(e).hidePanelOrModal(),e.trigger()}))},e.prototype.trigger=function(){var e=this,t=Yh(this);if(!t.isDisabled()&&!this.disabled){var n=this.menu;if(null==this.selectList){this.selectList=new Kh(t,n.selectPanelWidth);var r=this.selectList,o=n.getOptions(t);r.renderList(o),r.appendTo(this.$elem),r.show(),r.$elem.on("click","li",(function(t){var n=t.target;if(null!=n){t.preventDefault();var r=f(n).attr("data-value");e.onChange(r)}}))}else{if((r=this.selectList).isShow)r.hide();else{o=n.getOptions(t);r.renderList(o),r.show()}}}},e.prototype.onChange=function(e){var t=Yh(this),n=this.menu;n.exec&&n.exec(t,e)},e.prototype.setSelectedValue=function(){var e=Yh(this),t=this.menu,n=t.getValue(e),r=function(e,t){for(var n=e.length,r="",o=0;o<n;o++){var i=e[o];if(i.value===t){r=i.text;break}}return r}(t.getOptions(e),n.toString()),o=this.$button,i=Rh();o.empty(),o.text(r),o.append(i)},e.prototype.setDisabled=function(){var e=Yh(this),t=this.menu.isDisabled(e),n=this.$button;(null==e.selection||e.isDisabled())&&(t=!0);var r="disabled";t?n.addClass(r):n.removeClass(r),this.disabled=t},e.prototype.changeMenuState=function(){this.setSelectedValue(),this.setDisabled()},e}(),Gh=function(){function e(e){this.$elem=f('<div class="w-e-bar-item w-e-bar-item-group"></div>'),this.$container=f('<div class="w-e-bar-item-menus-container"></div>'),this.$button=f('<button type="button"></button>');var t=e.key,n=e.iconSvg,r=e.title,o=this.$elem,i=this.$button;if(n){var a=f(n);Dh(a),i.append(a)}else i.text(r);i.attr("data-menu-key",t);var s=Rh();i.append(s),o.append(i);var c=this.$container;o.append(c);var l=this.createObserver();this.observe(l)}return e.prototype.appendBarItem=function(e){var t=e.$elem;this.$container.append(t)},e.prototype.observe=function(e){var t=this.$container;e.observe(t[0],{childList:!0,subtree:!0,attributes:!0})},e.prototype.createObserver=function(){var e=this,t=this.$container,n=this.$button,r=new MutationObserver((function(){var o=t.find("button"),i=o.length;if(0!==i){var a=0;o.each((function(e){f(e).hasClass("disabled")&&a++})),r.disconnect(),a===i?n.addClass("disabled"):n.removeClass("disabled"),e.observe(r)}}));return r},e}(),Jh=new WeakMap;function Yh(e){var t=xu.get(e);if(null==t)throw new Error("Can not get editor instance");return t}function Xh(e,t,n){void 0===n&&(n=!1);var r=Jh.get(t);if(r)return r;var o=t.tag;if("button"===o){var i=t.showDropPanel,a=t.showModal;r=i?new $h(e,t,n):a?new Uh(e,t,n):new Fh(e,t,n)}if("select"===o&&(r=new qh(e,t,n)),null==r)throw new Error("Invalid tag in menu ".concat(JSON.stringify(t)));return Jh.set(t,r),r}function Qh(e){return Qh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qh(e)}function Zh(e){var t=function(e,t){if("object"!=Qh(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Qh(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Qh(t)?t:t+""}function ep(e,t,n){return(t=Zh(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tp(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach((function(t){ep(e,t,n[t])}))}return e}function np(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Zh(r.key),r)}}function op(e,t,n){return t&&rp(e.prototype,t),n&&rp(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ip(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ap(e,t){if(t&&("object"==Qh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ip(e)}function sp(e){return sp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},sp(e)}function cp(e,t){return cp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},cp(e,t)}function lp(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cp(e,t)}var up={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},fp=new(function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};np(this,e),this.init(t,n)}return op(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||up,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,tp({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),e}()),dp=function(){function e(){np(this,e),this.observers={}}return op(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.observers[e]&&[].concat(this.observers[e]).forEach((function(e){e.apply(void 0,n)}));this.observers["*"]&&[].concat(this.observers["*"]).forEach((function(t){t.apply(t,[e].concat(n))}))}}]),e}();function hp(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function pp(e){return null==e?"":""+e}function gp(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}for(var i="string"!=typeof t?[].concat(t):t.split(".");i.length>1;){if(o())return{};var a=r(i.shift());!e[a]&&n&&(e[a]=new n),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return o()?{}:{obj:e,k:r(i.shift())}}function vp(e,t,n){var r=gp(e,t,Object);r.obj[r.k]=n}function yp(e,t){var n=gp(e,t),r=n.obj,o=n.k;if(r)return r[o]}function mp(e,t,n){var r=yp(e,n);return void 0!==r?r:yp(t,n)}function bp(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):bp(e[r],t[r],n):e[r]=t[r]);return e}function wp(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var xp={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function Sp(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return xp[e]})):e}var Ep="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1;function Op(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),o=e,i=0;i<r.length;++i){if(!o)return;if("string"==typeof o[r[i]]&&i+1<r.length)return;if(void 0===o[r[i]]){for(var a=2,s=r.slice(i,i+a).join(n),c=o[s];void 0===c&&r.length>i+a;)a++,c=o[s=r.slice(i,i+a).join(n)];if(void 0===c)return;if("string"==typeof c)return c;if(s&&"string"==typeof c[s])return c[s];var l=r.slice(i+a).join(n);return l?Op(c,l,n):void 0}o=o[r[i]]}return o}}var kp=function(){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return np(this,e),n=ap(this,sp(e).call(this)),Ep&&dp.call(ip(n)),n.data=t||{},n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),void 0===n.options.ignoreJSONStructure&&(n.options.ignoreJSONStructure=!0),n}return lp(e,dp),op(e,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."));var s=yp(this.data,a);return s||!i||"string"!=typeof n?s:Op(this.data&&this.data[e]&&this.data[e][t],n,o)}},{key:"addResource",value:function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(r=t,t=(a=e.split("."))[1]),this.addNamespaces(t),vp(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in n)"string"!=typeof n[o]&&"[object Array]"!==Object.prototype.toString.apply(n[o])||this.addResource(e,t,o,n[o],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var s=yp(this.data,a)||{};r?bp(s,n,o):s=tp({},s,n),vp(this.data,a,s),i.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?tp({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),e}(),Cp={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,o){var i=this;return e.forEach((function(e){i.processors[e]&&(t=i.processors[e].process(t,n,r,o))})),t}},Tp={},Np=function(){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return np(this,e),n=ap(this,sp(e).call(this)),Ep&&dp.call(ip(n)),function(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,ip(n)),n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=fp.create("translator"),n}return lp(e,dp),op(e,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS;if(n&&e.indexOf(n)>-1){var i=e.match(this.interpolator.nestingRegexp);if(i&&i.length>0)return{key:e,namespaces:o};var a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(o=a.shift()),e=a.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}},{key:"translate",value:function(t,n,r){var o=this;if("object"!==Qh(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);var i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,a=this.extractFromKey(t[t.length-1],n),s=a.key,c=a.namespaces,l=c[c.length-1],u=n.lng||this.language,f=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&"cimode"===u.toLowerCase()){if(f){var d=n.nsSeparator||this.options.nsSeparator;return l+d+s}return s}var h=this.resolve(t,n),p=h&&h.res,g=h&&h.usedKey||s,v=h&&h.exactUsedKey||s,y=Object.prototype.toString.apply(p),m=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject;if(b&&p&&("string"!=typeof p&&"boolean"!=typeof p&&"number"!=typeof p)&&["[object Number]","[object Function]","[object RegExp]"].indexOf(y)<0&&("string"!=typeof m||"[object Array]"!==y)){if(!n.returnObjects&&!this.options.returnObjects)return this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,p,tp({},n,{ns:c})):"key '".concat(s," (").concat(this.language,")' returned an object instead of string.");if(i){var w="[object Array]"===y,x=w?[]:{},S=w?v:g;for(var E in p)if(Object.prototype.hasOwnProperty.call(p,E)){var O="".concat(S).concat(i).concat(E);x[E]=this.translate(O,tp({},n,{joinArrays:!1,ns:c})),x[E]===O&&(x[E]=p[E])}p=x}}else if(b&&"string"==typeof m&&"[object Array]"===y)(p=p.join(m))&&(p=this.extendTranslation(p,t,n,r));else{var k=!1,C=!1,T=void 0!==n.count&&"string"!=typeof n.count,N=e.hasDefaultValue(n),L=T?this.pluralResolver.getSuffix(u,n.count):"",M=n["defaultValue".concat(L)]||n.defaultValue;!this.isValidLookup(p)&&N&&(k=!0,p=M),this.isValidLookup(p)||(C=!0,p=s);var P=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&C?void 0:p,D=N&&M!==p&&this.options.updateMissing;if(C||k||D){if(this.logger.log(D?"updateKey":"missingKey",u,l,s,D?M:p),i){var R=this.resolve(s,tp({},n,{keySeparator:!1}));R&&R.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var j=[],A=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&A&&A[0])for(var I=0;I<A.length;I++)j.push(A[I]);else"all"===this.options.saveMissingTo?j=this.languageUtils.toResolveHierarchy(n.lng||this.language):j.push(n.lng||this.language);var F=function(e,t,r){o.options.missingKeyHandler?o.options.missingKeyHandler(e,l,t,D?r:P,D,n):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(e,l,t,D?r:P,D,n),o.emit("missingKey",e,l,t,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?j.forEach((function(e){o.pluralResolver.getSuffixes(e).forEach((function(t){F([e],s+t,n["defaultValue".concat(t)]||M)}))})):F(j,s,M))}p=this.extendTranslation(p,t,n,h,r),C&&p===s&&this.options.appendNamespaceToMissingKey&&(p="".concat(l,":").concat(s)),(C||k)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(p))}return p}},{key:"extendTranslation",value:function(e,t,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,n,r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(tp({},n,{interpolation:tp({},this.options.interpolation,n.interpolation)}));var a,s=n.interpolation&&n.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;if(s){var c=e.match(this.interpolator.nestingRegexp);a=c&&c.length}var l=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(l=tp({},this.options.interpolation.defaultVariables,l)),e=this.interpolator.interpolate(e,l,n.lng||this.language,n),s){var u=e.match(this.interpolator.nestingRegexp);a<(u&&u.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return o&&o[0]===r[0]&&!n.context?(i.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):i.translate.apply(i,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var f=n.postProcess||this.options.postProcess,d="string"==typeof f?[f]:f;return null!=e&&d&&d.length&&!1!==n.applyPostProcessor&&(e=Cp.handle(d,e,t,this.options&&this.options.postProcessPassResolved?tp({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,o,i,a=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var c=a.extractFromKey(e,s),l=c.key;n=l;var u=c.namespaces;a.options.fallbackNS&&(u=u.concat(a.options.fallbackNS));var f=void 0!==s.count&&"string"!=typeof s.count,d=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,h=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);u.forEach((function(e){a.isValidLookup(t)||(i=e,!Tp["".concat(h[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(i)&&(Tp["".concat(h[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(h.join(", "),'" won\'t get resolved as namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach((function(n){if(!a.isValidLookup(t)){o=n;var i,c,u=l,h=[u];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(h,l,n,e,s);else f&&(i=a.pluralResolver.getSuffix(n,s.count)),f&&d&&h.push(u+i),d&&h.push(u+="".concat(a.options.contextSeparator).concat(s.context)),f&&h.push(u+=i);for(;c=h.pop();)a.isValidLookup(t)||(r=c,t=a.getResource(n,e,c,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}]),e}();function Lp(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Mp=function(){function e(t){np(this,e),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=fp.create("languageUtils")}return op(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Lp(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=Lp(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=Lp(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(e)}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],i=function(e){e&&(n.isSupportedCode(e)?o.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),r.forEach((function(e){o.indexOf(e)<0&&i(n.formatLanguageCode(e))})),o}}]),e}(),Pp=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Dp={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}};var Rp=function(){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};np(this,e),this.languageUtils=t,this.options=r,this.logger=fp.create("pluralResolver"),this.rules=(n={},Pp.forEach((function(e){e.lngs.forEach((function(t){n[t]={numbers:e.nr,plurals:Dp[e.fc]}}))})),n)}return op(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){return this.getSuffixes(e).map((function(e){return t+e}))}},{key:"getSuffixes",value:function(e){var t=this,n=this.getRule(e);return n?n.numbers.map((function(n){return t.getSuffix(e,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=this,r=this.getRule(e);if(r){var o=r.noAbs?r.plurals(t):r.plurals(Math.abs(t)),i=r.numbers[o];this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var a=function(){return n.options.prepend&&i.toString()?n.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):a():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),jp=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};np(this,e),this.logger=fp.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return op(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:Sp,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?wp(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?wp(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?wp(t.nestingPrefix):t.nestingPrefixEscaped||wp("$t("),this.nestingSuffix=t.nestingSuffix?wp(t.nestingSuffix):t.nestingSuffixEscaped||wp(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var o,i,a,s=this,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(s.formatSeparator)<0){var o=mp(t,c,e);return s.alwaysFormat?s.format(o,void 0,n,tp({},r,t,{interpolationkey:e})):o}var i=e.split(s.formatSeparator),a=i.shift().trim(),l=i.join(s.formatSeparator).trim();return s.format(mp(t,c,a),l,n,tp({},r,t,{interpolationkey:a}))};this.resetRegExp();var f=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,d=r&&r.interpolation&&r.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables,h=[{regex:this.regexpUnescape,safeValue:function(e){return l(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?l(s.escape(e)):l(e)}}];return h.forEach((function(t){for(a=0;o=t.regex.exec(e);){if(void 0===(i=u(o[1].trim())))if("function"==typeof f){var n=f(e,o,r);i="string"==typeof n?n:""}else{if(d){i=o[0];continue}s.logger.warn("missed to pass in variable ".concat(o[1]," for interpolating ").concat(e)),i=""}else"string"==typeof i||s.useRawValueToEscape||(i=pp(i));var c=t.safeValue(i);if(e=e.replace(o[0],c),d?(t.regex.lastIndex+=c.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++a>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,o=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=tp({},i);function s(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),o="{".concat(r[1]);e=r[0],o=(o=this.interpolate(o,a)).replace(/'/g,'"');try{a=JSON.parse(o),t&&(a=tp({},t,a))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(o)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(e);){var c=[],l=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var u=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=u.shift(),c=u,l=!0}if((r=t(s.call(this,n[1].trim(),a),a))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=pp(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),l&&(r=c.reduce((function(e,t){return o.format(e,t,i.lng,tp({},i,{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();var Ap=function(){function e(t,n,r){var o,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return np(this,e),o=ap(this,sp(e).call(this)),Ep&&dp.call(ip(o)),o.backend=t,o.store=n,o.services=r,o.languageUtils=r.languageUtils,o.options=i,o.logger=fp.create("backendConnector"),o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(r,i.backend,i),o}return lp(e,dp),op(e,[{key:"queueLoad",value:function(e,t,n,r){var o=this,i=[],a=[],s=[],c=[];return e.forEach((function(e){var r=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!n.reload&&o.store.hasResourceBundle(e,t)?o.state[s]=2:o.state[s]<0||(1===o.state[s]?a.indexOf(s)<0&&a.push(s):(o.state[s]=1,r=!1,a.indexOf(s)<0&&a.push(s),i.indexOf(s)<0&&i.push(s),c.indexOf(t)<0&&c.push(t)))})),r||s.push(e)})),(i.length||a.length)&&this.queue.push({pending:a,loaded:{},errors:[],callback:r}),{toLoad:i,pending:a,toLoadLanguages:s,toLoadNamespaces:c}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),n&&this.store.addResourceBundle(o,i,n),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(n){!function(e,t,n,r){var o=gp(e,t,Object),i=o.obj,a=o.k;i[a]=i[a]||[],r&&(i[a]=i[a].concat(n)),r||i[a].push(n)}(n.loaded,[o],i),function(e,t){for(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}(n.pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach((function(e){a[e]||(a[e]=[]),n.loaded[e].length&&n.loaded[e].forEach((function(t){a[e].indexOf(t)<0&&a[e].push(t)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,a=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[n](e,t,(function(s,c){s&&c&&o<5?setTimeout((function(){r.read.call(r,e,t,n,o+1,2*i,a)}),i):a(s,c)})):a(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(function(r,a){r&&t.logger.warn("".concat(n,"loading namespace ").concat(i," for language ").concat(o," failed"),r),!r&&a&&t.logger.log("".concat(n,"loaded namespace ").concat(i," for language ").concat(o),a),t.loaded(e,r,a)}))}},{key:"saveMissing",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,tp({},i,{isUpdate:o})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),e}();function Ip(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Fp(){}var Bp=function(){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(np(this,e),t=ap(this,sp(e).call(this)),Ep&&dp.call(ip(t)),t.options=Ip(n),t.services={},t.logger=fp,t.modules={external:[]},r&&!t.isInitialized&&!n.isClone){if(!t.options.initImmediate)return t.init(n,r),ap(t,ip(t));setTimeout((function(){t.init(n,r)}),0)}return t}return lp(e,dp),op(e,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function r(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(n=t,t={}),t.whitelist&&!t.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),t.nonExplicitWhitelist&&!t.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=tp({},{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===Qh(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===Qh(e[2])||"object"===Qh(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}},this.options,Ip(t)),this.format=this.options.interpolation.format,n||(n=Fp),!this.options.isClone){this.modules.logger?fp.init(r(this.modules.logger),this.options):fp.init(null,this.options);var o=new Mp(this.options);this.store=new kp(this.options.resources,this.options);var i=this.services;i.logger=fp,i.resourceStore=this.store,i.languageUtils=o,i.pluralResolver=new Rp(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),i.interpolator=new jp(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new Ap(r(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(i.languageDetector=r(this.modules.languageDetector),i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=r(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new Np(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.length>0&&"dev"!==a[0]&&(this.options.lng=a[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var s=hp(),c=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),s.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?c():setTimeout(c,0),s}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Fp,r="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase())return n();var o=[],i=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){o.indexOf(e)<0&&o.push(e)}))};if(r)i(r);else this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(e){return i(e)}));this.options.preload&&this.options.preload.forEach((function(e){return i(e)})),this.services.backendConnector.load(o,this.options.ns,n)}else n(null)}},{key:"reloadResources",value:function(e,t,n){var r=hp();return e||(e=this.languages),t||(t=this.options.ns),n||(n=Fp),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Cp.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=hp();this.emit("languageChanging",e);var o=function(o){e||o||!n.services.languageDetector||(o=[]);var i="string"==typeof o?o:n.services.languageUtils.getBestMatchFromCodes(o);i&&(n.language||(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i)),n.translator.language||n.translator.changeLanguage(i),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(i)),n.loadResources(i,(function(e){!function(e,o){o?(n.language=o,n.languages=n.services.languageUtils.toResolveHierarchy(o),n.translator.changeLanguage(o),n.isLanguageChangingTo=void 0,n.emit("languageChanged",o),n.logger.log("languageChanged",o)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,i)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,o=function e(t,o){var i;if("object"!==Qh(o)){for(var a=arguments.length,s=new Array(a>2?a-2:0),c=2;c<a;c++)s[c-2]=arguments[c];i=r.options.overloadTranslationOptionHandler([t,o].concat(s))}else i=tp({},o);i.lng=i.lng||e.lng,i.lngs=i.lngs||e.lngs,i.ns=i.ns||e.ns;var l=r.options.keySeparator||".",u=n?"".concat(n).concat(l).concat(t):t;return r.t(u,i)};return"string"==typeof e?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.languages[0],o=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(r,e)||(!this.services.backendConnector.backend||!(!a(r,e)||o&&!a(i,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=hp();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=hp();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],o=e.filter((function(e){return r.indexOf(e)<0}));return o.length?(this.options.preload=r.concat(o),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"}},{key:"createInstance",value:function(){return new e(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}},{key:"cloneInstance",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Fp,o=tp({},this.options,n,{isClone:!0}),i=new e(o);return["store","services","language"].forEach((function(e){i[e]=t[e]})),i.services=tp({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i.translator=new Np(i.services,i.options),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];i.emit.apply(i,[e].concat(n))})),i.init(o,r),i.translator.options=i.options,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages}}}]),e}(),_p=new Bp,$p="translation";function Wp(e,t){_p.addResourceBundle(e,$p,t,!0,!0)}function Vp(e){_p.changeLanguage(e)}function zp(e){return _p.getResourceBundle(e,$p)}function Hp(e){return _p.on("languageChanged",e),function(){return _p.off("languageChanged",e)}}_p.init({lng:"zh-CN",resources:{}});var Up=_p.t.bind(_p);function Kp(e,t){var n=e.selection;return null!=n&&(!i.isCollapsed(n)&&(!$u.getSelectedElems(e).some((function(t){if(e.isVoid(t))return!0;var n=t.type;return!!["pre","code","table"].includes(n)||void 0}))&&!!s.isText(t)))}var qp=function(){function e(){var e=this;this.$elem=f('<div class="w-e-bar w-e-bar-hidden w-e-hover-bar"></div>'),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null,this.isShow=!1,this.lngListen=function(){},this.changeHoverbarState=Q((function(){var t=e.isShow,n=e.getSelectedNodeAndMenuKeys()||{},r=n.node,o=void 0===r?null:r,i=n.menuKeys,s=void 0===i?[]:i;if((null!=o&&e.changeItemsState(),o&&a.isElement(o))&&(t&&e.isSamePath(o,e.prevSelectedNode)))return;e.hideAndClean(),null!=o&&(e.registerItems(s),e.setPosition(o),e.show()),e.prevSelectedNode=o}),200),jc((function(){var t=e.getEditorInstance(),n=e.$elem;n.on("mousedown",(function(e){return e.preventDefault()}),{passive:!1}),$u.getTextarea(t).$textAreaContainer.append(n),t.on("change",e.changeHoverbarState);var r=e.hideAndClean.bind(e);t.on("scroll",r),t.on("fullScreen",r),t.on("unFullScreen",r)})),this.lngListen=Hp((function(){e.menus={},e.hideAndClean(),e.getEditorInstance().deselect()}))}return e.prototype.getMenus=function(){return this.menus},e.prototype.hideAndClean=function(){var e=this.$elem;e.removeClass("w-e-bar-show").addClass("w-e-bar-hidden"),this.hoverbarItems=[],e.empty(),this.isShow=!1},e.prototype.checkPositionBottom=function(){var e=this.$elem,t=!1,n=window.innerHeight;n&&n>=360&&(n-e[0].getBoundingClientRect().bottom<360&&(t=!0));t?e.addClass("w-e-bar-bottom"):e.removeClass("w-e-bar-bottom")},e.prototype.show=function(){this.$elem.removeClass("w-e-bar-hidden").addClass("w-e-bar-show"),this.isShow=!0,this.checkPositionBottom()},e.prototype.changeItemsState=function(){var e=this;jc((function(){e.hoverbarItems.forEach((function(e){e.changeMenuState()}))}))},e.prototype.registerItems=function(e){var t=this,n=this.$elem;e.forEach((function(e){if("|"!==e)t.registerSingleItem(e);else{var r=jh();n.append(r)}}))},e.prototype.registerSingleItem=function(e){var t=this.getEditorInstance(),n=this.menus,r=n[e];if(null==r){var o=zu[e];if(null==o)throw new Error("Not found menu item factory by key '".concat(e,"'"));if("function"!=typeof o)throw new Error("Menu item factory (key='".concat(e,"') is not a function"));r=o(),n[e]=r}var i=t.getMenuConfig(e);i&&void 0!==i.iconSvg&&(r.iconSvg=i.iconSvg);var a=Xh(e,r);this.hoverbarItems.push(a),xu.set(a,t),this.$elem.append(a.$elem)},e.prototype.setPosition=function(e){var t=this.getEditorInstance(),n=this.$elem;if(n.attr("style",""),a.isElement(e)){var r=Id(t,e,"bar");return n.css(r),void Fd(t,n)}if(s.isText(e)){r=Ad(t);return n.css(r),void Fd(t,n)}throw new Error("hoverbar.setPosition error, current selected node is not elem nor text")},e.prototype.getSelectedNodeAndMenuKeys=function(){var e=this.getEditorInstance();if(null==e.selection)return null;var n=this.getHoverbarKeysConf(),r=null,o=[],i=function(i){var a=n[i],s=a.match,c=a.menuKeys,l=void 0===c?[]:c,u=s||function(e,t){return $u.checkNodeType(t,i)},f=La(t.nodes(e,{match:function(t){return u(e,t)},universal:!0}),1),d=f[0];if(null!=d)return r=d[0],o=l,"break"};for(var a in n){if("break"===i(a))break}return null==r||0===o.length?null:{node:r,menuKeys:o}},e.prototype.getEditorInstance=function(){var e=bu.get(this);if(null==e)throw new Error("Can not get editor instance");return e},e.prototype.getHoverbarKeysConf=function(){var e=this.getEditorInstance().getConfig().hoverbarKeys,t=void 0===e?{}:e,n=t.text;return n&&null==n.match&&(n.match=Kp),t},e.prototype.isSamePath=function(e,t){if(null==e||null==t)return!1;var n=$u.findPath(null,e),o=$u.findPath(null,t);return r.equals(n,o)},e.prototype.destroy=function(){var e;this.changeHoverbarState.cancel(),this.$elem.remove(),null===(e=this.lngListen)||void 0===e||e.call(this),this.menus={},this.hoverbarItems=[],this.prevSelectedNode=null},e}();function Gp(e,n,r,i){if(Nu.set(e,n),Lu.set(e,r),a.isElement(e)){var s=e.children;if((void 0===s?[]:s).forEach((function(t,n){return Gp(t,n,e,i)})),t.isVoid(i,e)){var c=La(o.texts(e),1),l=La(c[0],1)[0];Nu.set(l,0),Lu.set(l,e)}}}function Jp(r){var a=r.selector,s=void 0===a?"":a,u=r.config,d=void 0===u?{}:u,h=r.content,p=r.html,g=r.plugins,v=void 0===g?[]:g,y=(r=>{var o=r,{apply:i}=o;return o.history={undos:[],redos:[]},o.redo=()=>{var{history:n}=o,{redos:r}=n;if(r.length>0){var i=r[r.length-1];i.selectionBefore&&e.setSelection(o,i.selectionBefore),Cr.withoutSaving(o,(()=>{t.withoutNormalizing(o,(()=>{for(var e of i.operations)o.apply(e)}))})),n.redos.pop(),o.writeHistory("undos",i)}},o.undo=()=>{var{history:r}=o,{undos:i}=r;if(i.length>0){var a=i[i.length-1];Cr.withoutSaving(o,(()=>{t.withoutNormalizing(o,(()=>{var t=a.operations.map(n.inverse).reverse();for(var r of t)o.apply(r);a.selectionBefore&&e.setSelection(o,a.selectionBefore)}))})),o.writeHistory("redos",a),r.undos.pop()}},o.apply=e=>{var{operations:t,history:n}=o,{undos:r}=n,a=r[r.length-1],s=a&&a.operations[a.operations.length-1],c=Cr.isSaving(o),l=Cr.isMerging(o);if(null==c&&(c=Nr(e)),c){if(null==l&&(l=null!=a&&(0!==t.length||Tr(e,s))),a&&l)a.operations.push(e);else{var u={operations:[e],selectionBefore:o.selection};o.writeHistory("undos",u)}for(;r.length>100;)r.shift();n.redos=[]}i(e)},o.writeHistory=(e,t)=>{o.history[e].push(t)},o})(function(e){var t=e,n=t.insertText,r=t.insertNode,i=t.insertFragment,a=t.dangerouslyInsertHtml;return t.insertText=function(e){if(t.getConfig().maxLength){var r=$u.getLeftLengthOfMaxLength(t);r<=0||(r<e.length?n(e.slice(0,r)):n(e))}else n(e)},t.insertNode=function(e){if(t.getConfig().maxLength){var n=$u.getLeftLengthOfMaxLength(t);n<=0||n<o.string(e).length||r(e)}else r(e)},t.insertFragment=function(e){if(t.getConfig().maxLength){if(e.length>0){var n=e[0];if($u.getLeftLengthOfMaxLength(t)<o.string(n).length)return;i([n]);for(var r=1;r<e.length;r++)t.insertNode(e[r])}}else i(e)},t.dangerouslyInsertHtml=function(e,n){if(void 0===e&&(e=""),void 0===n&&(n=!1),e)if(t.getConfig().maxLength){var r=$u.getLeftLengthOfMaxLength(t);if(!(r<=0)){var o=document.createElement("div");o.innerHTML=e;var i=Array.from(o.childNodes).reduce((function(e,t){var n=t.nodeType,r=t.nodeName;return t?n===Ic.TEXT_NODE?e+(t.textContent||""):n===Ic.ELEMENT_NODE?sd.has(r.toLowerCase())?e:e+(t.textContent||""):e:e}),"");r<i.length||a(e,n)}}else a(e,n)},t}(Rd(function(n){var r=n;return r.select=function(t){e.select(r,t)},r.deselect=function(){var t=r.selection,o=$u.findDocumentOrShadowRoot(r).getSelection();o&&o.rangeCount>0&&o.removeAllRanges(),t&&e.deselect(n)},r.move=function(t,r){void 0===r&&(r=!1),t&&(t<0||e.move(n,{distance:t,unit:"character",reverse:r}))},r.moveReverse=function(e){r.move(e,!0)},r.restoreSelection=function(){var t=Fu.get(r);null!=t&&(r.focus(),e.select(r,t))},r.getSelectionPosition=function(){return Ad(r)},r.getNodePosition=function(e){return Id(r,e)},r.isSelectedAll=function(){var e=r.selection;if(null==e)return!1;var n=La(i.edges(e),2),o=n[0],a=n[1],s=La(t.edges(r,[]),2),l=s[0],u=s[1];return!(!c.equals(o,l)||!c.equals(a,u))},r.selectAll=function(){var n=t.start(r,[]),o=t.end(r,[]);e.select(r,{anchor:n,focus:o})},r}(ld(function(e){var t=e;return t.getAllMenuKeys=function(){var e=[];for(var t in zu)e.push(t);return e},t.getConfig=function(){var e=Ou.get(t);if(null==e)throw new Error("Can not get editor config");return e},t.getMenuConfig=function(e){var n=t.getConfig().MENU_CONF;return(void 0===n?{}:n)[e]||{}},t.alert=function(e,n){void 0===n&&(n="info");var r=t.getConfig().customAlert;r&&r(e,n)},t}(function(n){var r=n;return r.id="wangEditor-".concat(Wu++),r.isDestroyed=!1,r.isFullScreen=!1,r.focus=function(n){if($u.toDOMNode(r,r).focus({preventScroll:!0}),Iu.set(r,!0),n){var o=t.end(r,[]);e.select(r,o)}else{var i=Fu.get(r);i?e.select(r,i):e.select(r,t.start(r,[]))}},r.isFocused=function(){return!!Iu.get(r)},r.blur=function(){$u.toDOMNode(r,r).blur(),e.deselect(r),Iu.set(r,!1)},r.updateView=function(){$u.getTextarea(r).changeViewState();var e=$u.getToolbar(r);e&&e.changeToolbarState();var t=$u.getHoverbar(r);t&&t.changeHoverbarState()},r.destroy=function(){if(!r.isDestroyed){var e=$u.getTextarea(r);e.destroy(),gu.delete(r),vu.delete(e);var t=$u.getToolbar(r);t&&(t.destroy(),mu.delete(r),yu.delete(t));var n=$u.getHoverbar(r);n&&(n.destroy(),wu.delete(r),bu.delete(n)),r.isDestroyed=!0,r.emit("destroyed")}},r.scrollToElem=function(e){if(!r.getConfig().scroll){var t="编辑器禁用了 scroll ,编辑器内容无法滚动,请自行实现该功能";return t+="\nYou has disabled editor scroll, please do this yourself",void console.warn(t)}var n=f("#".concat(e));if(0!==n.length){var o=n[0];if(!$u.hasDOMNode(r,o))return t="Element (found by id is '".concat(e,"') is not in editor DOM"),t+="\n 通过 id '".concat(e,"' 找到的 element 不在 editor DOM 之内"),void console.error(t,o);var i=$u.getTextarea(r),a=i.$textAreaContainer,s=i.$scroll,c=n.offset().top,l=a.offset().top;s[0].scrollBy({top:c-l,behavior:"smooth"})}},r.showProgressBar=function(e){e<1||$u.getTextarea(r).changeProgress(e)},r.hidePanelOrModal=function(){var e=Su.get(r);null!=e&&e.forEach((function(e){return e.hide()}))},r.enable=function(){r.getConfig().readOnly=!1,r.updateView()},r.disable=function(){r.getConfig().readOnly=!0,r.updateView()},r.isDisabled=function(){return r.getConfig().readOnly},r.toDOMNode=function(e){return $u.toDOMNode(r,e)},r.fullScreen=function(){if(!r.isFullScreen){var e=null,t=$u.getToolbar(r);t&&(e=t.$box);var n=$u.getTextarea(r).$box.parent();if(e&&e.parent()[0]!==n[0])throw new Error("Can not set full screen, cause toolbar DOM parent is not equal to textarea DOM parent\n不能设置全屏,因为 toolbar DOM 父节点和 textarea DOM 父节点不一致");n.addClass("w-e-full-screen-container");var o=n.css("z-index");n.attr("data-z-index",o.toString()),r.isFullScreen=!0,r.emit("fullScreen")}},r.unFullScreen=function(){if(r.isFullScreen){var e=$u.getTextarea(r).$box.parent();setTimeout((function(){e.removeClass("w-e-full-screen-container"),r.isFullScreen=!1,r.emit("unFullScreen")}),200)}},r.getEditableContainer=function(){return $u.getTextarea(r).$textAreaContainer[0]},r}(function(n){var r=n;return r.setFragmentData=function(e){var n=r.selection;if(n){var o=La(i.edges(n),2),a=o[0],s=o[1],c=t.void(r,{at:a.path}),l=t.void(r,{at:s.path});if(!i.isCollapsed(n)||c){var u=$u.toDOMRange(r,n),f=u.cloneContents(),d=f.childNodes[0];if(f.childNodes.forEach((function(e){e.textContent&&""!==e.textContent.trim()&&(d=e)})),l){var h=La(l,1)[0],p=u.cloneRange(),g=$u.toDOMNode(r,h);p.setEndAfter(g),f=p.cloneContents()}if(c&&(d=f.querySelector("[data-slate-spacer]")),Array.from(f.querySelectorAll("[data-slate-zero-width]")).forEach((function(e){var t="n"===e.getAttribute("data-slate-zero-width");e.textContent=t?"\n":""})),el(d)){var v=d.ownerDocument.createElement("span");v.style.whiteSpace="pre",v.appendChild(d),f.appendChild(v),d=v}var y=r.getFragment(),m=JSON.stringify(y),b=window.btoa(encodeURIComponent(m));d.setAttribute("data-slate-fragment",b),e.setData("application/x-slate-fragment",b);var w=f.ownerDocument.createElement("div");return w.appendChild(f),w.setAttribute("hidden","true"),f.ownerDocument.body.appendChild(w),e.setData("text/html",w.innerHTML),e.setData("text/plain",sl(w)),f.ownerDocument.body.removeChild(w),e}}},r.insertData=function(t){var n,o,i=t.getData("application/x-slate-fragment");if(i){var a=decodeURIComponent(window.atob(i)),s=JSON.parse(a);r.insertFragment(s)}else{var c=t.getData("text/plain"),l=t.getData("text/html");if(l)r.dangerouslyInsertHtml(l);else{var u=$u.getLeftLengthOfMaxLength(r);if(c){var f=c.split(/\r\n|\r|\n/),d=!1;try{for(var h=Na(f),p=h.next();!p.done;p=h.next()){var g=p.value;d&&u>0&&e.splitNodes(r,{always:!0}),r.insertText(g),d=!0}}catch(e){n={error:e}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(n)throw n.error}}}}}},r}(l()))))))));if(s&&function(e,t){return td(e,"data-w-e-textarea",t)}(y,s))throw new Error("Repeated create editor by selector '".concat(s,"'"));var m=function(e){void 0===e&&(e={});var t=Z(Vu),n={},r=e.MENU_CONF,o=void 0===r?{}:r;return B(t,(function(e,t){n[t]=Ta(Ta({},e),o[t]||{})})),delete e.MENU_CONF,Ta({scroll:!0,readOnly:!1,autoFocus:!0,decorate:function(){return[]},maxLength:0,MENU_CONF:n,hoverbarKeys:{},customAlert:function(e,t){window.alert("".concat(t,":\n").concat(e))}},e)}(d);Ou.set(y,m);var b=m.hoverbarKeys,w=void 0===b?{}:b;if(v.forEach((function(e){y=e(y)})),null!=p&&(y.children=nd(y,p)),h&&h.length&&(y.children=h),0===y.children.length&&(y.children=[{type:"paragraph",children:[{text:""}]}]),$u.normalizeContent(y),s){var x=new Ph(s);gu.set(y,x),vu.set(x,y),x.changeViewState(),jc((function(){var e=x.$scroll;if(null!=e&&e.height()<300){console.warn("编辑区域高度 < 300px 这可能会导致 modal hoverbar 定位异常\nTextarea height < 300px . This may be cause modal and hoverbar position error",e)}}));var S=void 0;Object.keys(w).length>0&&(S=new qp,bu.set(S,y),wu.set(y,S)),y.on("change",(function(){y.hidePanelOrModal()})),y.on("scroll",(function(){y.hidePanelOrModal()}))}else y.children.forEach((function(e,t){return Gp(e,t,y,y)}));var E=m.onCreated,O=m.onDestroyed;return E&&y.on("created",(function(){return E(y)})),O&&y.on("destroyed",(function(){return O(y)})),jc((function(){return y.emit("created")})),y}var Yp=TypeError,Xp=Object.getOwnPropertyDescriptor,Qp=le&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,t){if(nr(e)&&!Xp(e,"length").writable)throw new Yp("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},Zp=TypeError,eg=function(e,t){if(!delete e[t])throw new Zp("Cannot delete property "+Xe(t)+" of "+Xe(e))},tg=Co("splice"),ng=Math.max,rg=Math.min;_n({target:"Array",proto:!0,forced:!tg},{splice:function(e,t){var n,r,o,i,a,s,c=st(this),l=mn(c),u=gn(e,l),f=arguments.length;for(0===f?n=r=0:1===f?(n=0,r=l-u):(n=f-2,r=rg(ng(dn(t),0),l-u)),Ia(l+n-r),o=hr(c,r),i=0;i<r;i++)(a=u+i)in c&&Kr(o,i,c[a]);if(o.length=r,n<r){for(i=u;i<l-r;i++)s=i+n,(a=i+r)in c?c[s]=c[a]:eg(c,s);for(i=l;i>l-r+n;i--)eg(c,i-1)}else if(n>r)for(i=l-r;i>u;i--)s=i+n-1,(a=i+r-1)in c?c[s]=c[a]:eg(c,s);for(i=0;i<n;i++)c[i+u]=arguments[i+2];return Qp(c,l-r+n),o}});var og=function(){function e(e,t){var n=this;this.$toolbar=f('<div class="w-e-bar w-e-bar-show w-e-toolbar"></div>'),this.menus={},this.toolbarItems=[],this.config={},this.lngListen=function(){},this.changeToolbarState=Q((function(){n.toolbarItems.forEach((function(e){e.changeMenuState()}))}),200),this.config=t;var r=f(e);if(0===r.length)throw new Error("Cannot find toolbar DOM by selector '".concat(e,"'"));this.$box=r;var o=this.$toolbar;o.on("mousedown",(function(e){return e.preventDefault()}),{passive:!1}),r.append(o),jc((function(){n.initToolbar(),n.lngListen=Hp((function(){return n.initToolbar()})),n.getEditorInstance().on("change",n.changeToolbarState)}))}return e.prototype.getMenus=function(){return this.menus},e.prototype.getConfig=function(){return this.config},e.prototype.initToolbar=function(){this.menus={};var e=this.$toolbar;null==e||e.empty(),this.registerItems(),this.changeToolbarState()},e.prototype.registerItems=function(){var e=this,t="",n=this.$toolbar,r=this.config,o=r.toolbarKeys,i=void 0===o?[]:o,a=r.insertKeys,s=void 0===a?{index:0,keys:[]}:a,c=r.excludeKeys,l=void 0===c?[]:c,u=Z(i);s.keys.length>0&&("string"==typeof s.keys&&(s.keys=[s.keys]),s.keys.forEach((function(e,t){u.splice(s.index+t,0,e)})));var f=u.filter((function(e){if("string"==typeof e){if(l.includes(e))return!1}else if(l.includes(e.key))return!1;return!0})),d=f.length;f.forEach((function(r,o){if("|"===r){if(0===o)return;if(o+1===d)return;if("|"===t)return;var i=jh();return n.append(i),void(t=r)}if("string"==typeof r)return e.registerSingleItem(r,e),void(t=r);e.registerGroup(r),t="group"}))},e.prototype.registerGroup=function(e){var t=this,n=this.$toolbar,r=function(e){return new Gh(e)}(e),o=e.menuKeys,i=void 0===o?[]:o,a=this.config.excludeKeys,s=void 0===a?[]:a;i.forEach((function(e){s.includes(e)||t.registerSingleItem(e,r)})),n.append(r.$elem)},e.prototype.registerSingleItem=function(e,t){var n=this.getEditorInstance(),r=t instanceof Gh,o=this.menus,i=o[e];if(null==i){var a=zu[e];if(null==a)throw new Error("Not found menu item factory by key '".concat(e,"'"));if("function"!=typeof a)throw new Error("Menu item factory (key='".concat(e,"') is not a function"));i=a(),o[e]=i}else console.warn("Duplicated toolbar menu key '".concat(e,"'\n重复注册了菜单栏 menu '").concat(e,"'"));var s=n.getMenuConfig(e);s&&void 0!==s.iconSvg&&(i.iconSvg=s.iconSvg);var c=Xh(e,i,r);(this.toolbarItems.push(c),xu.set(c,n),r)?t.appendBarItem(c):t.$toolbar.append(c.$elem)},e.prototype.getEditorInstance=function(){var e=yu.get(this);if(null==e)throw new Error("Can not get editor instance");return e},e.prototype.destroy=function(){var e;this.$toolbar.remove(),null===(e=this.lngListen)||void 0===e||e.call(this),this.menus={},this.toolbarItems=[]},e}();function ig(e,t){if(null==e)throw new Error("Cannot create toolbar, because editor is null");var n=t.selector,r=t.config,o=void 0===r?{}:r;if(function(e,t){return td(e,"data-w-e-toolbar",t)}(e,n))throw new Error("Repeated create toolbar by selector '".concat(n,"'"));var i=Ta({toolbarKeys:[],excludeKeys:[],insertKeys:{index:0,keys:[]},modalAppendToBody:!1},o||{}),a=new og(n,i);return yu.set(a,e),mu.set(e,a),a}var ag=zt.EXISTS,sg=Function.prototype,cg=xe(sg.toString),lg=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,ug=xe(lg.exec);function fg(e){var t=e.server,n=void 0===t?"":t,r=e.fieldName,o=void 0===r?"":r,i=e.maxFileSize,a=void 0===i?10485760:i,s=e.maxNumberOfFiles,c=void 0===s?100:s,l=e.meta,u=void 0===l?{}:l,f=e.metaWithUrl,d=void 0!==f&&f,h=e.headers,p=void 0===h?{}:h,g=e.withCredentials,v=void 0!==g&&g,y=e.timeout,m=void 0===y?1e4:y,b=e.onBeforeUpload,w=void 0===b?function(e){return e}:b,x=e.onSuccess,S=void 0===x?function(e,t){}:x,E=e.onError,O=void 0===E?function(e,t,n){console.error("".concat(e.name," upload error"),t,n)}:E,k=e.onProgress,C=void 0===k?function(e){}:k;if(!n)throw new Error("Cannot get upload server address\n没有配置上传地址");if(!o)throw new Error("Cannot get fieldName\n没有配置 fieldName");var T=n;d&&(T=function(e,t){var n=La(e.split("#"),2),r=n[0],o=n[1],i=[];B(t,(function(e,t){i.push("".concat(t,"=").concat(e))}));var a=i.join("&");return r=r.indexOf("?")>0?"".concat(r,"&").concat(a):"".concat(r,"?").concat(a),o?"".concat(r,"#").concat(o):r}(T,u));var N=new ee({onBeforeUpload:w,restrictions:{maxFileSize:a,maxNumberOfFiles:c},meta:u}).use(te,{endpoint:T,headers:p,formData:!0,fieldName:o,bundle:!0,withCredentials:v,timeout:m});return N.on("upload-success",(function(e,t){var n=t.body,r=void 0===n?{}:n;try{S(e,r)}catch(e){console.error("wangEditor upload file - onSuccess error",e)}N.removeFile(e.id)})),N.on("progress",(function(e){e<1||C(e)})),N.on("upload-error",(function(e,t,n){try{O(e,t,n)}catch(e){console.error("wangEditor upload file - onError error",e)}N.removeFile(e.id)})),N.on("restriction-failed",(function(e,t){try{O(e,t)}catch(e){console.error("wangEditor upload file - onError error",e)}N.removeFile(e.id)})),N}le&&!ag&&Ga(sg,"name",{configurable:!0,get:function(){try{return ug(lg,cg(this))[1]}catch(e){return""}}});export{zc as DOMComment,Hc as DOMElement,Vc as DOMNode,Kc as DOMRange,qc as DOMSelection,Gc as DOMStaticRange,Uc as DOMText,$u as DomEditor,rf as ELEM_TO_HTML_CONF,Ic as NodeType,yf as PARSE_ELEM_HTML_CONF,gf as PARSE_STYLE_HTML_FN_LIST,hf as PRE_PARSE_HTML_CONF_LIST,th as RENDER_ELEM_CONF,Zd as RENDER_STYLE_HANDLER_LIST,tf as STYLE_TO_HTML_FN_LIST,df as TEXT_TAGS,og as Toolbar,Jp as coreCreateEditor,ig as coreCreateToolbar,fg as createUploader,Hh as genModalButtonElems,Vh as genModalInputElems,zh as genModalTextareaElems,Jc as getDefaultView,al as getEditableChild,il as getEditableChildAndIndex,ol as getElementById,cl as getFirstVoidChild,sl as getPlainText,ul as getTagName,rl as hasShadowRoot,Wp as i18nAddResources,Vp as i18nChangeLanguage,zp as i18nGetResources,Hp as i18nListenLanguage,Yc as isDOMComment,Xc as isDOMElement,Qc as isDOMNode,Zc as isDOMSelection,el as isDOMText,_c as isDataTransfer,Fc as isDocument,Wc as isHTMLElememt,tl as isPlainTextOnlyPaste,Bc as isShadowRoot,nl as normalizeDOMPoint,of as registerElemToHtmlConf,Hu as registerMenu,mf as registerParseElemHtmlConf,vf as registerParseStyleHtmlHandler,pf as registerPreParseHtmlConf,nh as registerRenderElemConf,eh as registerStyleHandler,nf as registerStyleToHtmlHandler,Up as t,ll as walkTextNodes};
|
|
9
9
|
//# sourceMappingURL=index.esm.js.map
|