@wangeditor/core
Version:
23 lines (21 loc) • 173 kB
JavaScript
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 N,is as T,dataset as L,val as M,text as P,html as D,children as R,remove as j,find as A,each as F,empty as I}from"dom7";import _ from"lodash.foreach";import"nanoid";import B 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=Object.defineProperty,ue=function(e,t){try{le(se,e,{value:t,configurable:!0,writable:!0})}catch(n){se[e]=t}return t},ce=se["__core-js_shared__"]||ue("__core-js_shared__",{}),fe=re((function(e){(e.exports=function(e,t){return ce[e]||(ce[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.19.3",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),de=Function.prototype,he=de.bind,pe=de.call,ge=he&&he.bind(pe),ve=he?function(e){return e&&ge(pe,e)}:function(e){return e&&function(){return pe.apply(e,arguments)}},ye=se.TypeError,me=function(e){if(null==e)throw ye("Can't call method on "+e);return e},be=se.Object,we=function(e){return be(me(e))},xe=ve({}.hasOwnProperty),Se=Object.hasOwn||function(e,t){return xe(we(e),t)},ke=0,Ee=Math.random(),Oe=ve(1..toString),Ce=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Oe(++ke+Ee,36)},Ne=function(e){return"function"==typeof e},Te=function(e){return Ne(e)?e:void 0},Le=function(e,t){return arguments.length<2?Te(se[e]):se[e]&&se[e][t]},Me=Le("navigator","userAgent")||"",Pe=se.process,De=se.Deno,Re=Pe&&Pe.versions||De&&De.version,je=Re&&Re.v8;je&&(ie=(oe=je.split("."))[0]>0&&oe[0]<4?1:+(oe[0]+oe[1])),!ie&&Me&&(!(oe=Me.match(/Edge\/(\d+)/))||oe[1]>=74)&&(oe=Me.match(/Chrome\/(\d+)/))&&(ie=+oe[1]);var Ae=ie,Fe=function(e){try{return!!e()}catch(e){return!0}},Ie=!!Object.getOwnPropertySymbols&&!Fe((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&Ae&&Ae<41})),_e=Ie&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Be=fe("wks"),$e=se.Symbol,We=$e&&$e.for,Ve=_e?$e:$e&&$e.withoutSetter||Ce,ze=function(e){if(!Se(Be,e)||!Ie&&"string"!=typeof Be[e]){var t="Symbol."+e;Ie&&Se($e,e)?Be[e]=$e[e]:Be[e]=_e&&We?We(t):Ve(t)}return Be[e]},He={};He[ze("toStringTag")]="z";var Ue="[object z]"===String(He),Ke=!Fe((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),qe=function(e){return"object"==typeof e?null!==e:Ne(e)},Ge=se.document,Je=qe(Ge)&&qe(Ge.createElement),Ye=function(e){return Je?Ge.createElement(e):{}},Xe=!Ke&&!Fe((function(){return 7!=Object.defineProperty(Ye("div"),"a",{get:function(){return 7}}).a})),Qe=se.String,Ze=se.TypeError,et=function(e){if(qe(e))return e;throw Ze(Qe(e)+" is not an object")},tt=Function.prototype.call,nt=tt.bind?tt.bind(tt):function(){return tt.apply(tt,arguments)},rt=ve({}.isPrototypeOf),ot=se.Object,it=_e?function(e){return"symbol"==typeof e}:function(e){var t=Le("Symbol");return Ne(t)&&rt(t.prototype,ot(e))},at=se.String,st=function(e){try{return at(e)}catch(e){return"Object"}},lt=se.TypeError,ut=function(e){if(Ne(e))return e;throw lt(st(e)+" is not a function")},ct=function(e,t){var n=e[t];return null==n?void 0:ut(n)},ft=se.TypeError,dt=se.TypeError,ht=ze("toPrimitive"),pt=function(e,t){if(!qe(e)||it(e))return e;var n,r=ct(e,ht);if(r){if(void 0===t&&(t="default"),n=nt(r,e,t),!qe(n)||it(n))return n;throw dt("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var n,r;if("string"===t&&Ne(n=e.toString)&&!qe(r=nt(n,e)))return r;if(Ne(n=e.valueOf)&&!qe(r=nt(n,e)))return r;if("string"!==t&&Ne(n=e.toString)&&!qe(r=nt(n,e)))return r;throw ft("Can't convert object to primitive value")}(e,t)},gt=function(e){var t=pt(e,"string");return it(t)?t:t+""},vt=se.TypeError,yt=Object.defineProperty,mt={f:Ke?yt:function(e,t,n){if(et(e),t=gt(t),et(n),Xe)try{return yt(e,t,n)}catch(e){}if("get"in n||"set"in n)throw vt("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},bt=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},wt=Ke?function(e,t,n){return mt.f(e,t,bt(1,n))}:function(e,t,n){return e[t]=n,e},xt=ve(Function.toString);Ne(ce.inspectSource)||(ce.inspectSource=function(e){return xt(e)});var St,kt,Et,Ot=ce.inspectSource,Ct=se.WeakMap,Nt=Ne(Ct)&&/native code/.test(Ot(Ct)),Tt=fe("keys"),Lt=function(e){return Tt[e]||(Tt[e]=Ce(e))},Mt={},Pt=se.TypeError,Dt=se.WeakMap;if(Nt||ce.state){var Rt=ce.state||(ce.state=new Dt),jt=ve(Rt.get),At=ve(Rt.has),Ft=ve(Rt.set);St=function(e,t){if(At(Rt,e))throw new Pt("Object already initialized");return t.facade=e,Ft(Rt,e,t),t},kt=function(e){return jt(Rt,e)||{}},Et=function(e){return At(Rt,e)}}else{var It=Lt("state");Mt[It]=!0,St=function(e,t){if(Se(e,It))throw new Pt("Object already initialized");return t.facade=e,wt(e,It,t),t},kt=function(e){return Se(e,It)?e[It]:{}},Et=function(e){return Se(e,It)}}var _t={set:St,get:kt,has:Et,enforce:function(e){return Et(e)?kt(e):St(e,{})},getterFor:function(e){return function(t){var n;if(!qe(t)||(n=kt(t)).type!==e)throw Pt("Incompatible receiver, "+e+" required");return n}}},Bt=Function.prototype,$t=Ke&&Object.getOwnPropertyDescriptor,Wt=Se(Bt,"name"),Vt={EXISTS:Wt,PROPER:Wt&&"something"===function(){}.name,CONFIGURABLE:Wt&&(!Ke||Ke&&$t(Bt,"name").configurable)},zt=re((function(e){var t=Vt.CONFIGURABLE,n=_t.get,r=_t.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;Ne(i)&&("Symbol("===String(f).slice(0,7)&&(f="["+String(f).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!Se(i,"name")||t&&i.name!==f)&&wt(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:wt(e,n,i)):u?e[n]=i:ue(n,i)})(Function.prototype,"toString",(function(){return Ne(this)&&n(this).source||Ot(this)}))})),Ht=ve({}.toString),Ut=ve("".slice),Kt=function(e){return Ut(Ht(e),8,-1)},qt=ze("toStringTag"),Gt=se.Object,Jt="Arguments"==Kt(function(){return arguments}()),Yt=Ue?Kt: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=Gt(e),qt))?n:Jt?Kt(t):"Object"==(r=Kt(t))&&Ne(t.callee)?"Arguments":r},Xt=Ue?{}.toString:function(){return"[object "+Yt(this)+"]"};Ue||zt(Object.prototype,"toString",Xt,{unsafe:!0});var Qt={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},Zt=Ye("span").classList,en=Zt&&Zt.constructor&&Zt.constructor.prototype,tn=en===Object.prototype?void 0:en,nn=ve(ve.bind),rn=function(e,t){return ut(e),void 0===t?e:nn?nn(e,t):function(){return e.apply(t,arguments)}},on=se.Object,an=ve("".split),sn=Fe((function(){return!on("z").propertyIsEnumerable(0)}))?function(e){return"String"==Kt(e)?an(e,""):on(e)}:on,ln=Math.ceil,un=Math.floor,cn=function(e){var t=+e;return t!=t||0===t?0:(t>0?un:ln)(t)},fn=Math.min,dn=function(e){return e>0?fn(cn(e),9007199254740991):0},hn=function(e){return dn(e.length)},pn=Array.isArray||function(e){return"Array"==Kt(e)},gn=function(){},vn=[],yn=Le("Reflect","construct"),mn=/^\s*(?:class|function)\b/,bn=ve(mn.exec),wn=!mn.exec(gn),xn=function(e){if(!Ne(e))return!1;try{return yn(gn,vn,e),!0}catch(e){return!1}},Sn=!yn||Fe((function(){var e;return xn(xn.call)||!xn(Object)||!xn((function(){e=!0}))||e}))?function(e){if(!Ne(e))return!1;switch(Yt(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return wn||!!bn(mn,Ot(e))}:xn,kn=ze("species"),En=se.Array,On=function(e,t){return new(function(e){var t;return pn(e)&&(t=e.constructor,(Sn(t)&&(t===En||pn(t.prototype))||qe(t)&&null===(t=t[kn]))&&(t=void 0)),void 0===t?En:t}(e))(0===t?0:t)},Cn=ve([].push),Nn=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=we(l),g=sn(p),v=rn(u,c),y=hn(g),m=0,b=f||On,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:Cn(w,d)}else switch(e){case 4:return!1;case 7:Cn(w,d)}return i?-1:r||o?o:w}},Tn={forEach:Nn(0),map:Nn(1),filter:Nn(2),some:Nn(3),every:Nn(4),find:Nn(5),findIndex:Nn(6),filterReject:Nn(7)},Ln=function(e,t){var n=[][e];return!!n&&Fe((function(){n.call(null,t||function(){throw 1},1)}))},Mn=Tn.forEach,Pn=Ln("forEach")?[].forEach:function(e){return Mn(this,e,arguments.length>1?arguments[1]:void 0)},Dn=function(e){if(e&&e.forEach!==Pn)try{wt(e,"forEach",Pn)}catch(t){e.forEach=Pn}};for(var Rn in Qt)Qt[Rn]&&Dn(se[Rn]&&se[Rn].prototype);Dn(tn);var jn={}.propertyIsEnumerable,An=Object.getOwnPropertyDescriptor,Fn=An&&!jn.call({1:2},1)?function(e){var t=An(this,e);return!!t&&t.enumerable}:jn,In={f:Fn},_n=function(e){return sn(me(e))},Bn=Object.getOwnPropertyDescriptor,$n={f:Ke?Bn:function(e,t){if(e=_n(e),t=gt(t),Xe)try{return Bn(e,t)}catch(e){}if(Se(e,t))return bt(!nt(In.f,e,t),e[t])}},Wn=Math.max,Vn=Math.min,zn=function(e,t){var n=cn(e);return n<0?Wn(n+t,0):Vn(n,t)},Hn=function(e){return function(t,n,r){var o,i=_n(t),a=hn(i),s=zn(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}},Un={includes:Hn(!0),indexOf:Hn(!1)},Kn=Un.indexOf,qn=ve([].push),Gn=function(e,t){var n,r=_n(e),o=0,i=[];for(n in r)!Se(Mt,n)&&Se(r,n)&&qn(i,n);for(;t.length>o;)Se(r,n=t[o++])&&(~Kn(i,n)||qn(i,n));return i},Jn=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Yn=Jn.concat("length","prototype"),Xn={f:Object.getOwnPropertyNames||function(e){return Gn(e,Yn)}},Qn={f:Object.getOwnPropertySymbols},Zn=ve([].concat),er=Le("Reflect","ownKeys")||function(e){var t=Xn.f(et(e)),n=Qn.f;return n?Zn(t,n(e)):t},tr=function(e,t){for(var n=er(t),r=mt.f,o=$n.f,i=0;i<n.length;i++){var a=n[i];Se(e,a)||r(e,a,o(t,a))}},nr=/#|\.prototype\./,rr=function(e,t){var n=ir[or(e)];return n==sr||n!=ar&&(Ne(t)?Fe(t):!!t)},or=rr.normalize=function(e){return String(e).replace(nr,".").toLowerCase()},ir=rr.data={},ar=rr.NATIVE="N",sr=rr.POLYFILL="P",lr=rr,ur=$n.f,cr=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]||ue(s,{}):(se[s]||{}).prototype)for(r in t){if(i=t[r],o=e.noTargetGet?(a=ur(n,r))&&a.value:n[r],!lr(l?r:s+(u?".":"#")+r,e.forced)&&void 0!==o){if(typeof i==typeof o)continue;tr(i,o)}(e.sham||o&&o.sham)&&wt(i,"sham",!0),zt(n,r,i,e)}},fr=Object.keys||function(e){return Gn(e,Jn)},dr=Fe((function(){fr(1)}));
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
function hr(e){return"[object Object]"===Object.prototype.toString.call(e)}cr({target:"Object",stat:!0,forced:dr},{keys:function(e){return fr(we(e))}});var pr={isHistory(e){return!1!==hr(n=e)&&(void 0===(r=n.constructor)||!1!==hr(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}},gr=new WeakMap,vr=new WeakMap,yr={isHistoryEditor:t=>pr.isHistory(t.history)&&e.isEditor(t),isMerging:e=>vr.get(e),isSaving:e=>gr.get(e),redo(e){e.redo()},undo(e){e.undo()},withoutMerging(e,t){var n=yr.isMerging(e);vr.set(e,!1),t(),vr.set(e,n)},withoutSaving(e,t){var n=yr.isSaving(e);gr.set(e,!1),t(),gr.set(e,n)}},mr=(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))),br=(e,t)=>"set_selection"!==e.type||null!=e.properties&&null!=e.newProperties,wr=(e,t)=>!(!t||"set_selection"!==e.type||"set_selection"!==t.type),xr=e=>"set_selection"!==e.type,Sr=se.String,kr=function(e){if("Symbol"===Yt(e))throw TypeError("Cannot convert a Symbol value to a string");return Sr(e)},Er=function(){var e=et(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},Or=Vt.PROPER,Cr=RegExp.prototype,Nr=Cr.toString,Tr=ve(Er),Lr=Fe((function(){return"/a/b"!=Nr.call({source:"a",flags:"b"})})),Mr=Or&&"toString"!=Nr.name;(Lr||Mr)&&zt(RegExp.prototype,"toString",(function(){var e=et(this),t=kr(e.source),n=e.flags;return"/"+t+"/"+kr(void 0===n&&rt(Cr,e)&&!("flags"in Cr)?Tr(e):n)}),{unsafe:!0});var Pr,Dr=Ke?Object.defineProperties:function(e,t){et(e);for(var n,r=_n(t),o=fr(t),i=o.length,a=0;i>a;)mt.f(e,n=o[a++],r[n]);return e},Rr=Le("document","documentElement"),jr=Lt("IE_PROTO"),Ar=function(){},Fr=function(e){return"<script>"+e+"<\/script>"},Ir=function(e){e.write(Fr("")),e.close();var t=e.parentWindow.Object;return e=null,t},_r=function(){try{Pr=new ActiveXObject("htmlfile")}catch(e){}var e,t;_r="undefined"!=typeof document?document.domain&&Pr?Ir(Pr):((t=Ye("iframe")).style.display="none",Rr.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Fr("document.F=Object")),e.close(),e.F):Ir(Pr);for(var n=Jn.length;n--;)delete _r.prototype[Jn[n]];return _r()};Mt[jr]=!0;var Br=Object.create||function(e,t){var n;return null!==e?(Ar.prototype=et(e),n=new Ar,Ar.prototype=null,n[jr]=e):n=_r(),void 0===t?n:Dr(n,t)},$r=ze("unscopables"),Wr=Array.prototype;null==Wr[$r]&&mt.f(Wr,$r,{configurable:!0,value:Br(null)});var Vr=function(e){Wr[$r][e]=!0},zr=Un.includes;cr({target:"Array",proto:!0},{includes:function(e){return zr(this,e,arguments.length>1?arguments[1]:void 0)}}),Vr("includes");var Hr=ze("match"),Ur=function(e){var t;return qe(e)&&(void 0!==(t=e[Hr])?!!t:"RegExp"==Kt(e))},Kr=se.TypeError,qr=function(e){if(Ur(e))throw Kr("The method doesn't accept regular expressions");return e},Gr=ze("match"),Jr=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Gr]=!1,"/./"[e](t)}catch(e){}}return!1},Yr=ve("".indexOf);cr({target:"String",proto:!0,forced:!Jr("includes")},{includes:function(e){return!!~Yr(kr(me(this)),kr(qr(e)),arguments.length>1?arguments[1]:void 0)}});var Xr,Qr=/"/g,Zr=ve("".replace);cr({target:"String",proto:!0,forced:(Xr="anchor",Fe((function(){var e=""[Xr]('"');return e!==e.toLowerCase()||e.split('"').length>3})))},{anchor:function(e){return t="a",n="name",r=e,o=kr(me(this)),i="<"+t,""!==n&&(i+=" "+n+'="'+Zr(kr(r),Qr,""")+'"'),i+">"+o+"</"+t+">";var t,n,r,o,i}});var eo=function(e,t,n){var r,o;et(e);try{if(!(r=ct(e,"return"))){if("throw"===t)throw n;return n}r=nt(r,e)}catch(e){o=!0,r=e}if("throw"===t)throw n;if(o)throw r;return et(r),n},to=function(e,t,n,r){try{return r?t(et(n)[0],n[1]):t(n)}catch(t){eo(e,"throw",t)}},no={},ro=ze("iterator"),oo=Array.prototype,io=function(e){return void 0!==e&&(no.Array===e||oo[ro]===e)},ao=function(e,t,n){var r=gt(t);r in e?mt.f(e,r,bt(0,n)):e[r]=n},so=ze("iterator"),lo=function(e){if(null!=e)return ct(e,so)||ct(e,"@@iterator")||no[Yt(e)]},uo=se.TypeError,co=function(e,t){var n=arguments.length<2?lo(e):t;if(ut(n))return et(nt(n,e));throw uo(st(e)+" is not iterable")},fo=se.Array,ho=ze("iterator"),po=!1;try{var go=0,vo={next:function(){return{done:!!go++}},return:function(){po=!0}};vo[ho]=function(){return this},Array.from(vo,(function(){throw 2}))}catch(e){}var yo=function(e,t){if(!t&&!po)return!1;var n=!1;try{var r={};r[ho]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},mo=!yo((function(e){Array.from(e)}));cr({target:"Array",stat:!0,forced:mo},{from:function(e){var t=we(e),n=Sn(this),r=arguments.length,o=r>1?arguments[1]:void 0,i=void 0!==o;i&&(o=rn(o,r>2?arguments[2]:void 0));var a,s,l,u,c,f,d=lo(t),h=0;if(!d||this==fo&&io(d))for(a=hn(t),s=n?new this(a):fo(a);a>h;h++)f=i?o(t[h],h):t[h],ao(s,h,f);else for(c=(u=co(t,d)).next,s=n?new this:[];!(l=nt(c,u)).done;h++)f=i?to(u,o,[l.value,h],!0):l.value,ao(s,h,f);return s.length=h,s}});var bo,wo,xo,So=ve("".charAt),ko=ve("".charCodeAt),Eo=ve("".slice),Oo=function(e){return function(t,n){var r,o,i=kr(me(t)),a=cn(n),s=i.length;return a<0||a>=s?e?"":void 0:(r=ko(i,a))<55296||r>56319||a+1===s||(o=ko(i,a+1))<56320||o>57343?e?So(i,a):r:e?Eo(i,a,a+2):o-56320+(r-55296<<10)+65536}},Co={codeAt:Oo(!1),charAt:Oo(!0)},No=!Fe((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),To=Lt("IE_PROTO"),Lo=se.Object,Mo=Lo.prototype,Po=No?Lo.getPrototypeOf:function(e){var t=we(e);if(Se(t,To))return t[To];var n=t.constructor;return Ne(n)&&t instanceof n?n.prototype:t instanceof Lo?Mo:null},Do=ze("iterator"),Ro=!1;[].keys&&("next"in(xo=[].keys())?(wo=Po(Po(xo)))!==Object.prototype&&(bo=wo):Ro=!0);var jo=null==bo||Fe((function(){var e={};return bo[Do].call(e)!==e}));jo&&(bo={}),Ne(bo[Do])||zt(bo,Do,(function(){return this}));var Ao={IteratorPrototype:bo,BUGGY_SAFARI_ITERATORS:Ro},Fo=mt.f,Io=ze("toStringTag"),_o=function(e,t,n){e&&!Se(e=n?e:e.prototype,Io)&&Fo(e,Io,{configurable:!0,value:t})},Bo=Ao.IteratorPrototype,$o=function(){return this},Wo=se.String,Vo=se.TypeError,zo=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=ve(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return et(n),function(e){if("object"==typeof e||Ne(e))return e;throw Vo("Can't set "+Wo(e)+" as a prototype")}(r),t?e(n,r):n.__proto__=r,n}}():void 0),Ho=Vt.PROPER,Uo=Vt.CONFIGURABLE,Ko=Ao.IteratorPrototype,qo=Ao.BUGGY_SAFARI_ITERATORS,Go=ze("iterator"),Jo=function(){return this},Yo=function(e,t,n,r,o,i,a){!function(e,t,n,r){var o=t+" Iterator";e.prototype=Br(Bo,{next:bt(+!r,n)}),_o(e,o,!1),no[o]=$o}(n,t,r);var s,l,u,c=function(e){if(e===o&&g)return g;if(!qo&&e in h)return h[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},f=t+" Iterator",d=!1,h=e.prototype,p=h[Go]||h["@@iterator"]||o&&h[o],g=!qo&&p||c(o),v="Array"==t&&h.entries||p;if(v&&(s=Po(v.call(new e)))!==Object.prototype&&s.next&&(Po(s)!==Ko&&(zo?zo(s,Ko):Ne(s[Go])||zt(s,Go,Jo)),_o(s,f,!0)),Ho&&"values"==o&&p&&"values"!==p.name&&(Uo?wt(h,"name","values"):(d=!0,g=function(){return nt(p,this)})),o)if(l={values:c("values"),keys:i?g:c("keys"),entries:c("entries")},a)for(u in l)(qo||d||!(u in h))&&zt(h,u,l[u]);else cr({target:t,proto:!0,forced:qo||d},l);return h[Go]!==g&&zt(h,Go,g,{name:o}),no[t]=g,l},Xo=Co.charAt,Qo=_t.set,Zo=_t.getterFor("String Iterator");Yo(String,"String",(function(e){Qo(this,{type:"String Iterator",string:kr(e),index:0})}),(function(){var e,t=Zo(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=Xo(n,r),t.index+=e.length,{value:e,done:!1})}));var ei,ti=$n.f,ni=ve("".endsWith),ri=ve("".slice),oi=Math.min,ii=Jr("endsWith"),ai=!(ii||(ei=ti(String.prototype,"endsWith"),!ei||ei.writable));cr({target:"String",proto:!0,forced:!ai&&!ii},{endsWith:function(e){var t=kr(me(this));qr(e);var n=arguments.length>1?arguments[1]:void 0,r=t.length,o=void 0===n?r:oi(dn(n),r),i=kr(e);return ni?ni(t,i,o):ri(t,o-i.length,o)===i}});var si=ve([].join),li=sn!=Object,ui=Ln("join",",");cr({target:"Array",proto:!0,forced:li||!ui},{join:function(e){return si(_n(this),void 0===e?",":e)}});var ci=ze("species"),fi=function(e){return Ae>=51||!Fe((function(){var t=[];return(t.constructor={})[ci]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},di=Tn.map,hi=fi("map");cr({target:"Array",proto:!0,forced:!hi},{map:function(e){return di(this,e,arguments.length>1?arguments[1]:void 0)}});var pi=se.RegExp,gi=Fe((function(){var e=pi("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),vi=gi||Fe((function(){return!pi("a","y").sticky})),yi={BROKEN_CARET:gi||Fe((function(){var e=pi("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:vi,UNSUPPORTED_Y:gi},mi=se.RegExp,bi=Fe((function(){var e=mi(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),wi=se.RegExp,xi=Fe((function(){var e=wi("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Si=_t.get,ki=fe("native-string-replace",String.prototype.replace),Ei=RegExp.prototype.exec,Oi=Ei,Ci=ve("".charAt),Ni=ve("".indexOf),Ti=ve("".replace),Li=ve("".slice),Mi=function(){var e=/a/,t=/b*/g;return nt(Ei,e,"a"),nt(Ei,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),Pi=yi.BROKEN_CARET,Di=void 0!==/()??/.exec("")[1];(Mi||Di||Pi||bi||xi)&&(Oi=function(e){var t,n,r,o,i,a,s,l=this,u=Si(l),c=kr(e),f=u.raw;if(f)return f.lastIndex=l.lastIndex,t=nt(Oi,f,c),l.lastIndex=f.lastIndex,t;var d=u.groups,h=Pi&&l.sticky,p=nt(Er,l),g=l.source,v=0,y=c;if(h&&(p=Ti(p,"y",""),-1===Ni(p,"g")&&(p+="g"),y=Li(c,l.lastIndex),l.lastIndex>0&&(!l.multiline||l.multiline&&"\n"!==Ci(c,l.lastIndex-1))&&(g="(?: "+g+")",y=" "+y,v++),n=new RegExp("^(?:"+g+")",p)),Di&&(n=new RegExp("^"+g+"$(?!\\s)",p)),Mi&&(r=l.lastIndex),o=nt(Ei,h?n:l,y),h?o?(o.input=Li(o.input,v),o[0]=Li(o[0],v),o.index=l.lastIndex,l.lastIndex+=o[0].length):l.lastIndex=0:Mi&&o&&(l.lastIndex=l.global?o.index+o[0].length:r),Di&&o&&o.length>1&&nt(ki,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=Br(null),i=0;i<d.length;i++)a[(s=d[i])[0]]=o[s[1]];return o});var Ri=Oi;cr({target:"RegExp",proto:!0,forced:/./.exec!==Ri},{exec:Ri});var ji=Function.prototype,Ai=ji.apply,Fi=ji.bind,Ii=ji.call,_i="object"==typeof Reflect&&Reflect.apply||(Fi?Ii.bind(Ai):function(){return Ii.apply(Ai,arguments)}),Bi=ze("species"),$i=RegExp.prototype,Wi=function(e,t,n,r){var o=ze(e),i=!Fe((function(){var t={};return t[o]=function(){return 7},7!=""[e](t)})),a=i&&!Fe((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[Bi]=function(){return n},n.flags="",n[o]=/./[o]),n.exec=function(){return t=!0,null},n[o](""),!t}));if(!i||!a||n){var s=ve(/./[o]),l=t(o,""[e],(function(e,t,n,r,o){var a=ve(e),l=t.exec;return l===Ri||l===$i.exec?i&&!o?{done:!0,value:s(t,n,r)}:{done:!0,value:a(n,t,r)}:{done:!1}}));zt(String.prototype,e,l[0]),zt($i,o,l[1])}r&&wt($i[o],"sham",!0)},Vi=Co.charAt,zi=function(e,t,n){return t+(n?Vi(e,t).length:1)},Hi=Math.floor,Ui=ve("".charAt),Ki=ve("".replace),qi=ve("".slice),Gi=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Ji=/\$([$&'`]|\d{1,2})/g,Yi=function(e,t,n,r,o,i){var a=n+e.length,s=r.length,l=Ji;return void 0!==o&&(o=we(o),l=Gi),Ki(i,l,(function(i,l){var u;switch(Ui(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=Hi(c/10);return 0===f?i:f<=s?void 0===r[f-1]?Ui(l,1):r[f-1]+Ui(l,1):i}u=r[c-1]}return void 0===u?"":u}))},Xi=se.TypeError,Qi=function(e,t){var n=e.exec;if(Ne(n)){var r=nt(n,e,t);return null!==r&&et(r),r}if("RegExp"===Kt(e))return nt(Ri,e,t);throw Xi("RegExp#exec called on incompatible receiver")},Zi=ze("replace"),ea=Math.max,ta=Math.min,na=ve([].concat),ra=ve([].push),oa=ve("".indexOf),ia=ve("".slice),aa="$0"==="a".replace(/./,"$0"),sa=!!/./[Zi]&&""===/./[Zi]("a","$0");Wi("replace",(function(e,t,n){var r=sa?"$":"$0";return[function(e,n){var r=me(this),o=null==e?void 0:ct(e,Zi);return o?nt(o,e,r,n):nt(t,kr(r),e,n)},function(e,o){var i=et(this),a=kr(e);if("string"==typeof o&&-1===oa(o,r)&&-1===oa(o,"$<")){var s=n(t,i,a,o);if(s.done)return s.value}var l=Ne(o);l||(o=kr(o));var u=i.global;if(u){var c=i.unicode;i.lastIndex=0}for(var f=[];;){var d=Qi(i,a);if(null===d)break;if(ra(f,d),!u)break;""===kr(d[0])&&(i.lastIndex=zi(a,dn(i.lastIndex),c))}for(var h,p="",g=0,v=0;v<f.length;v++){for(var y=kr((d=f[v])[0]),m=ea(ta(cn(d.index),a.length),0),b=[],w=1;w<d.length;w++)ra(b,void 0===(h=d[w])?h:String(h));var x=d.groups;if(l){var S=na([y],b,m,a);void 0!==x&&ra(S,x);var k=kr(_i(o,void 0,S))}else k=Yi(y,a,m,b,x,o);m>=g&&(p+=ia(a,g,m)+k,g=m+y.length)}return p+ia(a,g)}]}),!!Fe((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!aa||sa);
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var la=function(e,t){return la=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])},la(e,t)};function ua(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}la(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var ca=function(){return ca=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},ca.apply(this,arguments)};function fa(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 da(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 ha(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e}var pa=0,ga=function(){this.id=""+pa++},va=_t.set,ya=_t.getterFor("Array Iterator"),ma=Yo(Array,"Array",(function(e,t){va(this,{type:"Array Iterator",target:_n(e),index:0,kind:t})}),(function(){var e=ya(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");no.Arguments=no.Array,Vr("keys"),Vr("values"),Vr("entries");var ba=function(e,t,n){for(var r in t)zt(e,r,t[r],n);return e},wa=se.Array,xa=Math.max,Sa=function(e,t,n){for(var r=hn(e),o=zn(t,r),i=zn(void 0===n?r:n,r),a=wa(xa(i-o,0)),s=0;o<i;o++,s++)ao(a,s,e[o]);return a.length=s,a},ka=Xn.f,Ea="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Oa={f:function(e){return Ea&&"Window"==Kt(e)?function(e){try{return ka(e)}catch(e){return Sa(Ea)}}(e):ka(_n(e))}},Ca=Fe((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),Na=Object.isExtensible,Ta=Fe((function(){Na(1)}))||Ca?function(e){return!!qe(e)&&((!Ca||"ArrayBuffer"!=Kt(e))&&(!Na||Na(e)))}:Na,La=!Fe((function(){return Object.isExtensible(Object.preventExtensions({}))})),Ma=re((function(e){var t=mt.f,n=!1,r=Ce("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=Xn.f,t=ve([].splice),o={};o[r]=1,e(o).length&&(Xn.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},cr({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:Oa.f}))},fastKey:function(e,t){if(!qe(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!Se(e,r)){if(!Ta(e))return"F";if(!t)return"E";i(e)}return e[r].objectID},getWeakData:function(e,t){if(!Se(e,r)){if(!Ta(e))return!0;if(!t)return!1;i(e)}return e[r].weakData},onFreeze:function(e){return La&&n&&Ta(e)&&!Se(e,r)&&i(e),e}};Mt[r]=!0})),Pa=se.TypeError,Da=function(e,t){this.stopped=e,this.result=t},Ra=Da.prototype,ja=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=rn(t,c),g=function(e){return r&&eo(r,"normal",e),new Da(!0,e)},v=function(e){return f?(et(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=lo(e)))throw Pa(st(e)+" is not iterable");if(io(o)){for(i=0,a=hn(e);a>i;i++)if((s=v(e[i]))&&rt(Ra,s))return s;return new Da(!1)}r=co(e,o)}for(l=r.next;!(u=nt(l,r)).done;){try{s=v(u.value)}catch(e){eo(r,"throw",e)}if("object"==typeof s&&s&&rt(Ra,s))return s}return new Da(!1)},Aa=se.TypeError,Fa=function(e,t){if(rt(t,e))return e;throw Aa("Incorrect invocation")},Ia=function(e,t,n){var r,o;return zo&&Ne(r=t.constructor)&&r!==n&&qe(o=r.prototype)&&o!==n.prototype&&zo(e,o),e},_a=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=ve(s[e]);zt(s,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(o&&!qe(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return o&&!qe(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(o&&!qe(e))&&t(this,0===e?0:e)}:function(e,n){return t(this,0===e?0:e,n),this})};if(lr(e,!Ne(a)||!(o||s.forEach&&!Fe((function(){(new a).entries().next()})))))l=n.getConstructor(t,e,r,i),Ma.enable();else if(lr(e,!0)){var f=new l,d=f[i](o?{}:-0,1)!=f,h=Fe((function(){f.has(1)})),p=yo((function(e){new a(e)})),g=!o&&Fe((function(){for(var e=new a,t=5;t--;)e[i](t,t);return!e.has(-0)}));p||((l=t((function(e,t){Fa(e,s);var n=Ia(new a,e,l);return null!=t&&ja(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,cr({global:!0,forced:l!=a},u),_o(l,e),o||n.setStrong(l,e,r),l},Ba=Ma.getWeakData,$a=_t.set,Wa=_t.getterFor,Va=Tn.find,za=Tn.findIndex,Ha=ve([].splice),Ua=0,Ka=function(e){return e.frozen||(e.frozen=new qa)},qa=function(){this.entries=[]},Ga=function(e,t){return Va(e.entries,(function(e){return e[0]===t}))};qa.prototype={get:function(e){var t=Ga(this,e);if(t)return t[1]},has:function(e){return!!Ga(this,e)},set:function(e,t){var n=Ga(this,e);n?n[1]=t:this.entries.push([e,t])},delete:function(e){var t=za(this.entries,(function(t){return t[0]===e}));return~t&&Ha(this.entries,t,1),!!~t}};var Ja,Ya={getConstructor:function(e,t,n,r){var o=e((function(e,o){Fa(e,i),$a(e,{type:t,id:Ua++,frozen:void 0}),null!=o&&ja(o,e[r],{that:e,AS_ENTRIES:n})})),i=o.prototype,a=Wa(t),s=function(e,t,n){var r=a(e),o=Ba(et(t),!0);return!0===o?Ka(r).set(t,n):o[r.id]=n,e};return ba(i,{delete:function(e){var t=a(this);if(!qe(e))return!1;var n=Ba(e);return!0===n?Ka(t).delete(e):n&&Se(n,t.id)&&delete n[t.id]},has:function(e){var t=a(this);if(!qe(e))return!1;var n=Ba(e);return!0===n?Ka(t).has(e):n&&Se(n,t.id)}}),ba(i,n?{get:function(e){var t=a(this);if(qe(e)){var n=Ba(e);return!0===n?Ka(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}},Xa=_t.enforce,Qa=!se.ActiveXObject&&"ActiveXObject"in se,Za=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},es=_a("WeakMap",Za,Ya);if(Nt&&Qa){Ja=Ya.getConstructor(Za,"WeakMap",!0),Ma.enable();var ts=es.prototype,ns=ve(ts.delete),rs=ve(ts.has),os=ve(ts.get),is=ve(ts.set);ba(ts,{delete:function(e){if(qe(e)&&!Ta(e)){var t=Xa(this);return t.frozen||(t.frozen=new Ja),ns(this,e)||t.frozen.delete(e)}return ns(this,e)},has:function(e){if(qe(e)&&!Ta(e)){var t=Xa(this);return t.frozen||(t.frozen=new Ja),rs(this,e)||t.frozen.has(e)}return rs(this,e)},get:function(e){if(qe(e)&&!Ta(e)){var t=Xa(this);return t.frozen||(t.frozen=new Ja),rs(this,e)?os(this,e):t.frozen.get(e)}return os(this,e)},set:function(e,t){if(qe(e)&&!Ta(e)){var n=Xa(this);n.frozen||(n.frozen=new Ja),rs(this,e)?is(this,e,t):n.frozen.set(e,t)}else is(this,e,t);return this}})}var as=ze("iterator"),ss=ze("toStringTag"),ls=ma.values,us=function(e,t){if(e){if(e[as]!==ls)try{wt(e,as,ls)}catch(t){e[as]=ls}if(e[ss]||wt(e,ss,t),Qt[t])for(var n in ma)if(e[n]!==ma[n])try{wt(e,n,ma[n])}catch(t){e[n]=ma[n]}}};for(var cs in Qt)us(se[cs]&&se[cs].prototype,cs);us(tn,"DOMTokenList");var fs=new WeakMap,ds=new WeakMap,hs=new WeakMap,ps=new WeakMap,gs=new WeakMap,vs=new WeakMap,ys=new WeakMap,ms=new WeakMap,bs=new WeakMap,ws=new WeakMap,xs=new WeakMap,Ss=new WeakMap,ks=new WeakMap,Es=new WeakMap,Os=new WeakMap,Cs=new WeakMap,Ns=new WeakMap,Ts=new WeakMap,Ls=new WeakMap,Ms=new WeakMap,Ps=new WeakMap,Ds=new WeakMap,Rs=new WeakMap,js=new WeakMap,As=new WeakMap,Fs=Tn.find,Is=!0;"find"in[]&&Array(1).find((function(){Is=!1})),cr({target:"Array",proto:!0,forced:Is},{find:function(e){return Fs(this,e,arguments.length>1?arguments[1]:void 0)}}),Vr("find"),cr({global:!0},{globalThis:se});const _s=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","isindex","keygen","link","menuitem","meta","nextid","param","source","track","wbr"];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),N&&(f.fn.parents=N),T&&(f.fn.is=T),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),F&&(f.fn.each=F),I&&(f.fn.empty=I);var Bs,$s=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||null},Ws=function(e){return Vs(e)&&1===e.nodeType},Vs=function(e){var t=$s(e);return!!t&&e instanceof t.Node},zs=function(e){var t=e&&e.anchorNode&&$s(e.anchorNode);return!!t&&e instanceof t.Selection},Hs=function(e){return Vs(e)&&3===e.nodeType},Us=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},Ks=function(e,t,n){for(var r,o=e.childNodes,i=o[t],a=t,s=!1,l=!1;(Vs(r=i)&&8===r.nodeType||Ws(i)&&0===i.childNodes.length||Ws(i)&&"false"===i.getAttribute("contenteditable"))&&(!s||!l);)a>=o.length?(s=!0,a=t-1,n="backward"):a<0?(l=!0,a=t+1,n="forward"):(i=o[a],t=a,a+="forward"===n?1:-1);return[i,t]},qs=function(e,t,n){return da(Ks(e,t,n),1)[0]},Gs=function e(t){var n,r,o="";if(Hs(t)&&t.nodeValue)return t.nodeValue;if(Ws(t)){try{for(var i=fa(Array.from(t.childNodes)),a=i.next();!a.done;a=i.next()){o+=e(a.value)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}var s=getComputedStyle(t).getPropertyValue("display");"block"!==s&&"list"!==s&&"table-row"!==s&&"BR"!==t.tagName||(o+="\n")}return o};function Js(e,t){if(!(e instanceof HTMLElement&&"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||Js(o,t)}}function Ys(e){if(0===e.length)return"";var t=e[0];return t.nodeType!==Bs.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"}(Bs||(Bs={})),void 0!==globalThis.navigator&&void 0!==globalThis.window&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&globalThis.window.MSStream;var Xs="undefined"!=typeof navigator&&/Mac OS X/.test(navigator.userAgent),Qs="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 Zs="undefined"!=typeof navigator&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),el="undefined"!=typeof navigator&&/Edge?\/(?:[0-6][0-9]|[0-7][0-8])(?:\.)/i.test(navigator.userAgent),tl="undefined"!=typeof navigator&&/Chrome?\/(?:[0-7][0-5]|[0-6][0-9])(?:\.)/i.test(navigator.userAgent),nl="undefined"!=typeof navigator&&/Chrome/i.test(navigator.userAgent);"undefined"!=typeof navigator&&/.*QQBrowser/.test(navigator.userAgent);var rl=!tl&&!el&&"undefined"!=typeof globalThis&&globalThis.InputEvent&&"function"==typeof globalThis.InputEvent.prototype.getTargetRanges,ol={getWindow:function(e){var t=Ps.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=Ms.get(t);return n||(n=new ga,Ms.set(t,n)),n},setNewKey:function(e){var t=new ga;Ms.set(e,t)},findPath:function(t,n){for(var r=[],o=n;;){var i=Os.get(o);if(null==i){if(e.isEditor(o))return r;break}var a=Es.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=ol.toDOMNode(e,e),n=t.getRootNode();return(n instanceof Document||n instanceof ShadowRoot)&&null!=n.getSelection?n:t.ownerDocument},getParentNode:function(e,t){return Os.get(t)||null},getParentsNodes:function(e,t){for(var n=[],r=t;r!==e&&null!=r;){var o=ol.getParentNode(e,r);if(null==o)break;n.push(o),r=o}return n},getTopNode:function(e,t){var n=[ol.findPath(e,t)[0]];return r.get(e,n)},toDOMNode:function(t,n){var r;if(e.isEditor(n))r=Cs.get(t);else{var o=ol.findKey(t,n);r=Ts.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=ol.toDOMNode(e,e);try{r=Ws(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")))},toDOMRange:function(e,t){var n=t.anchor,r=t.focus,i=o.isBackward(t),a=ol.toDOMPoint(e,n),s=o.isCollapsed(t)?a:ol.toDOMPoint(e,r),l=ol.getWindow(e).document.createRange(),u=da(i?s:a,2),c=u[0],f=u[1],d=da(i?a:s,2),h=d[0],p=d[1],g=!!(Ws(c)?c:c.parentElement).getAttribute("data-slate-zero-width"),v=!!(Ws(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=da(e.node(t,n.path),1)[0],s=ol.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=fa(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=Ws(t)?t:t.parentElement;n&&!n.hasAttribute("data-slate-node")&&(n=n.closest("[data-slate-node]"));var r=n?Ns.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=ol.toSlateNode(t,n.target),l=ol.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 ol.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((zs(n)?n.anchorNode:n.startContainer)&&(zs(n)?(i=n.anchorNode,a=n.anchorOffset,s=n.focusNode,l=n.focusOffset,u=nl&&window.document.activeElement&&window.document.activeElement.shadowRoot?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=ol.toSlatePoint(t,[i,a],{exactMatch:c,suppressThrow:f});if(!d)return null;var h=u?d:ol.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)&&Ws(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=da(o?t:function(e){var t,n=da(e,2),r=n[0],o=n[1];if(Ws(r)&&r.childNodes.length){var i=o===r.childNodes.length,a=i?o-1:o;for(r=(t=da(Ks(r,a,i?"backward":"forward"),2))[0],i=(a=t[1])<o;Ws(r)&&r.childNodes.length;){var s=i?r.childNodes.length-1:0;r=qs(r,s,i?"backward":"forward")}o=i&&null!=r.textContent?r.textContent.length:0}return[r,o]}(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=ol.getWindow(e).document.createRange();v.setStart(f,0),v.setEnd(s,l);var y=v.cloneContents();ha(ha([],da(c(y.querySelectorAll("[data-slate-zero-width]")))),da(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")||Qs&&(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=ol.toSlateNode(e,f);return{path:ol.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=fa(a),l=s.next();!l.done;l=s.next()){var u=da(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=da(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=da(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=da(e.nodes(t,{match:function(e){return e===n},universal:!0}),1),o=r[0];return null!=o&&da(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=fs.get(e);if(null==t)throw new Error("Cannot find textarea instance by editor");return t},getToolbar:function(e){return ps.get(e)||null},getHoverbar:function(e){return vs.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=ol.getTextarea(t).$textArea,l=null==s?void 0:s[0].childNodes;if(l)try{for(var u=fa(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=fa(h),g=p.next();!g.done;g=p.next()){var v=g.value;if(null!=v){var y=v[0];Js(ol.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=fa(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=ol.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=da(r,1)[0].children;if(1===o.length&&""===o[0].text)return!0;return!1}},il=1,al={};var sl={};function ll(e,t){var n=e.key,r=e.factory,o=e.config,i=ca(ca({},o),t||{});if(null!=sl[n])throw new Error("Duplicated key '"+n+"' in menu items");sl[n]=r,function(e,t){null!=t&&(al[e]=t)}(n,i)}var ul=Tn.filter,cl=fi("filter");cr({target:"Array",proto:!0,forced:!cl},{filter:function(e){return ul(this,e,arguments.length>1?arguments[1]:void 0)}});var fl="\t\n\v\f\r \u2028\u2029\ufeff",dl=ve("".replace),hl="["+fl+"]",pl=RegExp("^"+hl+hl+"*"),gl=RegExp(hl+hl+"*$"),vl=function(e){return function(t){var n=kr(me(t));return 1&e&&(n=dl(n,pl,"")),2&e&&(n=dl(n,gl,"")),n}},yl={start:vl(1),end:vl(2),trim:vl(3)},ml=Vt.PROPER,bl=yl.trim;cr({target:"String",proto:!0,forced:function(e){return Fe((function(){return!!fl[e]()||"
"!=="
"[e]()||ml&&fl[e].name!==e}))}("trim")},{trim:function(){return bl(this)}});var wl=[];function xl(e){wl.push(e)}var Sl={};function kl(e){var t=e.type,n=e.elemToHtml;Sl[t||""]=n}function El(e,t,n){var r=n.isInline(e)?"span":"div";return"<"+r+">"+t+"</"+r+">"}function Ol(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 sc(e,n)})).join(""));var u=function(e){return Sl[e]||El}(o),c=u(t,l,n),f="";if(f="string"==typeof c?c:c.html||"",s||wl.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}var Cl,Nl,Tl,Ll,Ml=se.Promise,Pl=ze("species"),Dl=function(e){var t=Le(e),n=mt.f;Ke&&t&&!t[Pl]&&n(t,Pl,{configurable:!0,get:function(){return this}})},Rl=se.TypeError,jl=ze("species"),Al=function(e,t){var n,r=et(e).constructor;return void 0===r||null==(n=et(r)[jl])?t:function(e){if(Sn(e))return e;throw Rl(st(e)+" is not a constructor")}(n)},Fl=ve([].slice),Il=/(?:ipad|iphone|ipod).*applewebkit/i.test(Me),_l="process"==Kt(se.process),Bl=se.setImmediate,$l=se.clearImmediate,Wl=se.process,Vl=se.Dispatch,zl=se.Function,Hl=se.MessageChannel,Ul=se.String,Kl=0,ql={};try{Cl=se.location}catch(e){}var Gl=function(e){if(Se(ql,e)){var t=ql[e];delete ql[e],t()}},Jl=function(e){return function(){Gl(e)}},Yl=function(e){Gl(e.data)},Xl=function(e){se.postMessage(Ul(e),Cl.protocol+"//"+Cl.host)};Bl&&$l||(Bl=function(e){var t=Fl(arguments,1);return ql[++Kl]=function(){_i(Ne(e)?e:zl(e),void 0,t)},Nl(Kl),Kl},$l=function(e){delete ql[e]},_l?Nl=function(e){Wl.nextTick(Jl(e))}:Vl&&Vl.now?Nl=function(e){Vl.now(Jl(e))}:Hl&&!Il?(Ll=(Tl=new Hl).port2,Tl.port1.onmessage=Yl,Nl=rn(Ll.postMessage,Ll)):se.addEventListener&&Ne(se.postMessage)&&!se.importScripts&&Cl&&"file:"!==Cl.protocol&&!Fe(Xl)?(Nl=Xl,se.addEventListener("message",Yl,!1)):Nl="onreadystatechange"in Ye("script")?function(e){Rr.appendChild(Ye("script")).onreadystatechange=function(){Rr.removeChild(this),Gl(e)}}:function(e){setTimeout(Jl(e),0)});var Ql,Zl,eu,tu,nu,ru,ou,iu,au={set:Bl,clear:$l},su=/ipad|iphone|ipod/i.test(Me)&&void 0!==se.Pebble,lu=/web0s(?!.*chrome)/i.test(Me),uu=$n.f,cu=au.set,fu=se.MutationObserver||se.