@wangeditor-next/plugin-formula 0.0.7 → 0.0.8
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/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"katex";import n from"katex/dist/katex.css";import{i18nAddResources as r,t as e,DomEditor as o,SlateRange as i,genModalTextareaElems as u,genModalButtonElems as c,SlateTransforms as f}from"@wangeditor-next/editor";import{h as a}from"snabbdom";var l=function(t,n){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])},l(t,n)};function s(t,n){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var e,o,i=r.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(e=i.next()).done;)u.push(e.value)}catch(t){o={error:t}}finally{try{e&&!e.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u}"function"==typeof SuppressedError&&SuppressedError;var p,v,d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={};function y(){if(v)return p;v=1;var t=function(t){return t&&t.Math===Math&&t};return p=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof d&&d)||t("object"==typeof p&&p)||function(){return this}()||Function("return this")()}var m,g,b,w,O,x,E,S,j,T,L,P,I,_,A,M,C,R,k,N,F,D,H,z,$,B,V,U,W,q,G,K,X,Y,J,Q,Z,tt={exports:{}};function nt(){if(w)return b;w=1;var t=y(),n=Object.defineProperty;return b=function(r,e){try{n(t,r,{value:e,configurable:!0,writable:!0})}catch(n){t[r]=e}return e}}function rt(){if(O)return tt.exports;O=1;var t=g?m:(g=1,m=!1),n=y(),r=nt(),e="__core-js_shared__",o=tt.exports=n[e]||r(e,{});return(o.versions||(o.versions=[])).push({version:"3.38.1",mode:t?"pure":"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"}),tt.exports}function et(){if(E)return x;E=1;var t=rt();return x=function(n,r){return t[n]||(t[n]=r||{})}}function ot(){return j?S:(j=1,S=function(t){try{return!!t()}catch(t){return!0}})}function it(){if(L)return T;L=1;var t=ot();return T=!t((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))}function ut(){if(I)return P;I=1;var t=it(),n=Function.prototype,r=n.call,e=t&&n.bind.bind(r,r);return P=t?e:function(t){return function(){return r.apply(t,arguments)}},P}function ct(){return A?_:(A=1,_=function(t){return null==t})}function ft(){if(C)return M;C=1;var t=ct(),n=TypeError;return M=function(r){if(t(r))throw new n("Can't call method on "+r);return r}}function at(){if(k)return R;k=1;var t=ft(),n=Object;return R=function(r){return n(t(r))}}function lt(){if(F)return N;F=1;var t=ut(),n=at(),r=t({}.hasOwnProperty);return N=Object.hasOwn||function(t,e){return r(n(t),e)}}function st(){if(H)return D;H=1;var t=ut(),n=0,r=Math.random(),e=t(1..toString);return D=function(t){return"Symbol("+(void 0===t?"":t)+")_"+e(++n+r,36)}}function pt(){if(V)return B;V=1;var t,n,r=y(),e=function(){if($)return z;$=1;var t=y().navigator,n=t&&t.userAgent;return z=n?String(n):""}(),o=r.process,i=r.Deno,u=o&&o.versions||i&&i.version,c=u&&u.v8;return c&&(n=(t=c.split("."))[0]>0&&t[0]<4?1:+(t[0]+t[1])),!n&&e&&(!(t=e.match(/Edge\/(\d+)/))||t[1]>=74)&&(t=e.match(/Chrome\/(\d+)/))&&(n=+t[1]),B=n}function vt(){if(W)return U;W=1;var t=pt(),n=ot(),r=y().String;return U=!!Object.getOwnPropertySymbols&&!n((function(){var n=Symbol("symbol detection");return!r(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&t&&t<41}))}function dt(){if(G)return q;G=1;var t=vt();return q=t&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function ht(){if(X)return K;X=1;var t=y(),n=et(),r=lt(),e=st(),o=vt(),i=dt(),u=t.Symbol,c=n("wks"),f=i?u.for||u:u&&u.withoutSetter||e;return K=function(t){return r(c,t)||(c[t]=o&&r(u,t)?u[t]:f("Symbol."+t)),c[t]}}function yt(){if(J)return Y;J=1;var t={};return t[ht()("toStringTag")]="z",Y="[object z]"===String(t)}function mt(){if(Z)return Q;Z=1;var t="object"==typeof document&&document.all;return Q=void 0===t&&void 0!==t?function(n){return"function"==typeof n||n===t}:function(t){return"function"==typeof t}}var gt,bt,wt,Ot,xt,Et,St,jt,Tt,Lt,Pt,It,_t,At,Mt,Ct,Rt,kt,Nt,Ft,Dt,Ht,zt,$t,Bt,Vt,Ut,Wt,qt,Gt,Kt,Xt,Yt,Jt={};function Qt(){if(bt)return gt;bt=1;var t=ot();return gt=!t((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))}function Zt(){if(Ot)return wt;Ot=1;var t=mt();return wt=function(n){return"object"==typeof n?null!==n:t(n)}}function tn(){if(Et)return xt;Et=1;var t=y(),n=Zt(),r=t.document,e=n(r)&&n(r.createElement);return xt=function(t){return e?r.createElement(t):{}}}function nn(){if(jt)return St;jt=1;var t=Qt(),n=ot(),r=tn();return St=!t&&!n((function(){return 7!==Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a}))}function rn(){if(Lt)return Tt;Lt=1;var t=Qt(),n=ot();return Tt=t&&n((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))}function en(){if(It)return Pt;It=1;var t=Zt(),n=String,r=TypeError;return Pt=function(e){if(t(e))return e;throw new r(n(e)+" is not an object")}}function on(){if(At)return _t;At=1;var t=it(),n=Function.prototype.call;return _t=t?n.bind(n):function(){return n.apply(n,arguments)},_t}function un(){if(Ct)return Mt;Ct=1;var t=y(),n=mt();return Mt=function(r,e){return arguments.length<2?(o=t[r],n(o)?o:void 0):t[r]&&t[r][e];var o},Mt}function cn(){if(Ft)return Nt;Ft=1;var t=un(),n=mt(),r=function(){if(kt)return Rt;kt=1;var t=ut();return Rt=t({}.isPrototypeOf)}(),e=dt(),o=Object;return Nt=e?function(t){return"symbol"==typeof t}:function(e){var i=t("Symbol");return n(i)&&r(i.prototype,o(e))}}function fn(){if(Ht)return Dt;Ht=1;var t=String;return Dt=function(n){try{return t(n)}catch(t){return"Object"}}}function an(){if($t)return zt;$t=1;var t=mt(),n=fn(),r=TypeError;return zt=function(e){if(t(e))return e;throw new r(n(e)+" is not a function")}}function ln(){if(Vt)return Bt;Vt=1;var t=an(),n=ct();return Bt=function(r,e){var o=r[e];return n(o)?void 0:t(o)}}function sn(){if(Wt)return Ut;Wt=1;var t=on(),n=mt(),r=Zt(),e=TypeError;return Ut=function(o,i){var u,c;if("string"===i&&n(u=o.toString)&&!r(c=t(u,o)))return c;if(n(u=o.valueOf)&&!r(c=t(u,o)))return c;if("string"!==i&&n(u=o.toString)&&!r(c=t(u,o)))return c;throw new e("Can't convert object to primitive value")},Ut}function pn(){if(Gt)return qt;Gt=1;var t=on(),n=Zt(),r=cn(),e=ln(),o=sn(),i=ht(),u=TypeError,c=i("toPrimitive");return qt=function(i,f){if(!n(i)||r(i))return i;var a,l=e(i,c);if(l){if(void 0===f&&(f="default"),a=t(l,i,f),!n(a)||r(a))return a;throw new u("Can't convert object to primitive value")}return void 0===f&&(f="number"),o(i,f)}}function vn(){if(Xt)return Kt;Xt=1;var t=pn(),n=cn();return Kt=function(r){var e=t(r,"string");return n(e)?e:e+""}}function dn(){if(Yt)return Jt;Yt=1;var t=Qt(),n=nn(),r=rn(),e=en(),o=vn(),i=TypeError,u=Object.defineProperty,c=Object.getOwnPropertyDescriptor,f="enumerable",a="configurable",l="writable";return Jt.f=t?r?function(t,n,r){if(e(t),n=o(n),e(r),"function"==typeof t&&"prototype"===n&&"value"in r&&l in r&&!r[l]){var i=c(t,n);i&&i[l]&&(t[n]=r.value,r={configurable:a in r?r[a]:i[a],enumerable:f in r?r[f]:i[f],writable:!1})}return u(t,n,r)}:u:function(t,r,c){if(e(t),r=o(r),e(c),n)try{return u(t,r,c)}catch(t){}if("get"in c||"set"in c)throw new i("Accessors not supported");return"value"in c&&(t[r]=c.value),t},Jt}var hn,yn,mn,gn,bn,wn,On,xn,En,Sn,jn,Tn,Ln,Pn,In,_n,An,Mn,Cn,Rn,kn,Nn,Fn,Dn,Hn,zn,$n={exports:{}};function Bn(){if(yn)return hn;yn=1;var t=Qt(),n=lt(),r=Function.prototype,e=t&&Object.getOwnPropertyDescriptor,o=n(r,"name"),i=o&&"something"===function(){}.name,u=o&&(!t||t&&e(r,"name").configurable);return hn={EXISTS:o,PROPER:i,CONFIGURABLE:u}}function Vn(){if(gn)return mn;gn=1;var t=ut(),n=mt(),r=rt(),e=t(Function.toString);return n(r.inspectSource)||(r.inspectSource=function(t){return e(t)}),mn=r.inspectSource}function Un(){return xn?On:(xn=1,On=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}})}function Wn(){if(Sn)return En;Sn=1;var t=Qt(),n=dn(),r=Un();return En=t?function(t,e,o){return n.f(t,e,r(1,o))}:function(t,n,r){return t[n]=r,t}}function qn(){if(Tn)return jn;Tn=1;var t=et(),n=st(),r=t("keys");return jn=function(t){return r[t]||(r[t]=n(t))}}function Gn(){return Pn?Ln:(Pn=1,Ln={})}function Kn(){if(_n)return In;_n=1;var t,n,r,e=function(){if(wn)return bn;wn=1;var t=y(),n=mt(),r=t.WeakMap;return bn=n(r)&&/native code/.test(String(r))}(),o=y(),i=Zt(),u=Wn(),c=lt(),f=rt(),a=qn(),l=Gn(),s="Object already initialized",p=o.TypeError,v=o.WeakMap;if(e||f.state){var d=f.state||(f.state=new v);d.get=d.get,d.has=d.has,d.set=d.set,t=function(t,n){if(d.has(t))throw new p(s);return n.facade=t,d.set(t,n),n},n=function(t){return d.get(t)||{}},r=function(t){return d.has(t)}}else{var h=a("state");l[h]=!0,t=function(t,n){if(c(t,h))throw new p(s);return n.facade=t,u(t,h,n),n},n=function(t){return c(t,h)?t[h]:{}},r=function(t){return c(t,h)}}return In={set:t,get:n,has:r,enforce:function(e){return r(e)?n(e):t(e,{})},getterFor:function(t){return function(r){var e;if(!i(r)||(e=n(r)).type!==t)throw new p("Incompatible receiver, "+t+" required");return e}}}}function Xn(){if(An)return $n.exports;An=1;var t=ut(),n=ot(),r=mt(),e=lt(),o=Qt(),i=Bn().CONFIGURABLE,u=Vn(),c=Kn(),f=c.enforce,a=c.get,l=String,s=Object.defineProperty,p=t("".slice),v=t("".replace),d=t([].join),h=o&&!n((function(){return 8!==s((function(){}),"length",{value:8}).length})),y=String(String).split("String"),m=$n.exports=function(t,n,r){"Symbol("===p(l(n),0,7)&&(n="["+v(l(n),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(n="get "+n),r&&r.setter&&(n="set "+n),(!e(t,"name")||i&&t.name!==n)&&(o?s(t,"name",{value:n,configurable:!0}):t.name=n),h&&r&&e(r,"arity")&&t.length!==r.arity&&s(t,"length",{value:r.arity});try{r&&e(r,"constructor")&&r.constructor?o&&s(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var u=f(t);return e(u,"source")||(u.source=d(y,"string"==typeof n?n:"")),t};return Function.prototype.toString=m((function(){return r(this)&&a(this).source||u(this)}),"toString"),$n.exports}function Yn(){if(Cn)return Mn;Cn=1;var t=mt(),n=dn(),r=Xn(),e=nt();return Mn=function(o,i,u,c){c||(c={});var f=c.enumerable,a=void 0!==c.name?c.name:i;if(t(u)&&r(u,a,c),c.global)f?o[i]=u:e(i,u);else{try{c.unsafe?o[i]&&(f=!0):delete o[i]}catch(t){}f?o[i]=u:n.f(o,i,{value:u,enumerable:!1,configurable:!c.nonConfigurable,writable:!c.nonWritable})}return o}}function Jn(){if(kn)return Rn;kn=1;var t=ut(),n=t({}.toString),r=t("".slice);return Rn=function(t){return r(n(t),8,-1)}}function Qn(){if(Fn)return Nn;Fn=1;var t=yt(),n=mt(),r=Jn(),e=ht()("toStringTag"),o=Object,i="Arguments"===r(function(){return arguments}());return Nn=t?r:function(t){var u,c,f;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(c=function(t,n){try{return t[n]}catch(t){}}(u=o(t),e))?c:i?r(u):"Object"===(f=r(u))&&n(u.callee)?"Arguments":f}}!function(){if(zn)return h;zn=1;var t=yt(),n=Yn(),r=function(){if(Hn)return Dn;Hn=1;var t=yt(),n=Qn();return Dn=t?{}.toString:function(){return"[object "+n(this)+"]"}}();t||n(Object.prototype,"toString",r,{unsafe:!0})}();var Zn,tr,nr,rr,er,or,ir={},ur={},cr={};function fr(){if(nr)return tr;nr=1;var t=ut(),n=ot(),r=Jn(),e=Object,o=t("".split);return tr=n((function(){return!e("z").propertyIsEnumerable(0)}))?function(t){return"String"===r(t)?o(t,""):e(t)}:e}function ar(){if(er)return rr;er=1;var t=fr(),n=ft();return rr=function(r){return t(n(r))}}function lr(){if(or)return ur;or=1;var t=Qt(),n=on(),r=function(){if(Zn)return cr;Zn=1;var t={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,r=n&&!t.call({1:2},1);return cr.f=r?function(t){var r=n(this,t);return!!r&&r.enumerable}:t,cr}(),e=Un(),o=ar(),i=vn(),u=lt(),c=nn(),f=Object.getOwnPropertyDescriptor;return ur.f=t?f:function(t,a){if(t=o(t),a=i(a),c)try{return f(t,a)}catch(t){}if(u(t,a))return e(!n(r.f,t,a),t[a])},ur}var sr,pr,vr,dr,hr,yr,mr,gr,br,wr,Or,xr,Er,Sr,jr,Tr,Lr,Pr={};function Ir(){if(dr)return vr;dr=1;var t=function(){if(pr)return sr;pr=1;var t=Math.ceil,n=Math.floor;return sr=Math.trunc||function(r){var e=+r;return(e>0?n:t)(e)}}();return vr=function(n){var r=+n;return r!=r||0===r?0:t(r)}}function _r(){if(yr)return hr;yr=1;var t=Ir(),n=Math.max,r=Math.min;return hr=function(e,o){var i=t(e);return i<0?n(i+o,0):r(i,o)}}function Ar(){if(gr)return mr;gr=1;var t=Ir(),n=Math.min;return mr=function(r){var e=t(r);return e>0?n(e,9007199254740991):0}}function Mr(){if(wr)return br;wr=1;var t=Ar();return br=function(n){return t(n.length)}}function Cr(){if(Sr)return Er;Sr=1;var t=ut(),n=lt(),r=ar(),e=function(){if(xr)return Or;xr=1;var t=ar(),n=_r(),r=Mr(),e=function(e){return function(o,i,u){var c=t(o),f=r(c);if(0===f)return!e&&-1;var a,l=n(u,f);if(e&&i!=i){for(;f>l;)if((a=c[l++])!=a)return!0}else for(;f>l;l++)if((e||l in c)&&c[l]===i)return e||l||0;return!e&&-1}};return Or={includes:e(!0),indexOf:e(!1)}}().indexOf,o=Gn(),i=t([].push);return Er=function(t,u){var c,f=r(t),a=0,l=[];for(c in f)!n(o,c)&&n(f,c)&&i(l,c);for(;u.length>a;)n(f,c=u[a++])&&(~e(l,c)||i(l,c));return l}}function Rr(){return Tr?jr:(Tr=1,jr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var kr,Nr,Fr,Dr,Hr,zr,$r,Br,Vr,Ur,Wr,qr,Gr,Kr,Xr,Yr,Jr,Qr,Zr,te={};function ne(){if(Fr)return Nr;Fr=1;var t=un(),n=ut(),r=function(){if(Lr)return Pr;Lr=1;var t=Cr(),n=Rr().concat("length","prototype");return Pr.f=Object.getOwnPropertyNames||function(r){return t(r,n)},Pr}(),e=(kr||(kr=1,te.f=Object.getOwnPropertySymbols),te),o=en(),i=n([].concat);return Nr=t("Reflect","ownKeys")||function(t){var n=r.f(o(t)),u=e.f;return u?i(n,u(t)):n}}function re(){if(Hr)return Dr;Hr=1;var t=lt(),n=ne(),r=lr(),e=dn();return Dr=function(o,i,u){for(var c=n(i),f=e.f,a=r.f,l=0;l<c.length;l++){var s=c[l];t(o,s)||u&&t(u,s)||f(o,s,a(i,s))}}}function ee(){if(Vr)return Br;Vr=1;var t=y(),n=lr().f,r=Wn(),e=Yn(),o=nt(),i=re(),u=function(){if($r)return zr;$r=1;var t=ot(),n=mt(),r=/#|\.prototype\./,e=function(r,e){var f=i[o(r)];return f===c||f!==u&&(n(e)?t(e):!!e)},o=e.normalize=function(t){return String(t).replace(r,".").toLowerCase()},i=e.data={},u=e.NATIVE="N",c=e.POLYFILL="P";return zr=e}();return Br=function(c,f){var a,l,s,p,v,d=c.target,h=c.global,y=c.stat;if(a=h?t:y?t[d]||o(d,{}):t[d]&&t[d].prototype)for(l in f){if(p=f[l],s=c.dontCallGetSet?(v=n(a,l))&&v.value:a[l],!u(h?l:d+(y?".":"#")+l,c.forced)&&void 0!==s){if(typeof p==typeof s)continue;i(p,s)}(c.sham||s&&s.sham)&&r(p,"sham",!0),e(a,l,p,c)}}}function oe(){if(Gr)return qr;Gr=1;var t=ut();return qr=t([].slice)}function ie(){if(Xr)return Kr;Xr=1;var t=ut(),n=an(),r=Zt(),e=lt(),o=oe(),i=it(),u=Function,c=t([].concat),f=t([].join),a={};return Kr=i?u.bind:function(t){var i=n(this),l=i.prototype,s=o(arguments,1),p=function(){var n=c(s,o(arguments));return this instanceof p?function(t,n,r){if(!e(a,n)){for(var o=[],i=0;i<n;i++)o[i]="a["+i+"]";a[n]=u("C,a","return new C("+f(o,",")+")")}return a[n](t,r)}(i,n.length,n):i.apply(t,n)};return r(l)&&(p.prototype=l),p},Kr}function ue(){if(Jr)return Yr;Jr=1;var t=ut(),n=ot(),r=mt(),e=Qn(),o=un(),i=Vn(),u=function(){},c=o("Reflect","construct"),f=/^\s*(?:class|function)\b/,a=t(f.exec),l=!f.test(u),s=function(t){if(!r(t))return!1;try{return c(u,[],t),!0}catch(t){return!1}},p=function(t){if(!r(t))return!1;switch(e(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return l||!!a(f,i(t))}catch(t){return!0}};return p.sham=!0,Yr=!c||n((function(){var t;return s(s.call)||!s(Object)||!s((function(){t=!0}))||t}))?p:s}function ce(){if(Zr)return Qr;Zr=1;var t=ue(),n=fn(),r=TypeError;return Qr=function(e){if(t(e))return e;throw new r(n(e)+" is not a constructor")}}var fe,ae,le,se,pe,ve,de,he,ye={};function me(){if(ae)return fe;ae=1;var t=Cr(),n=Rr();return fe=Object.keys||function(r){return t(r,n)}}function ge(){if(de)return ve;de=1;var t,n=en(),r=function(){if(le)return ye;le=1;var t=Qt(),n=rn(),r=dn(),e=en(),o=ar(),i=me();return ye.f=t&&!n?Object.defineProperties:function(t,n){e(t);for(var u,c=o(n),f=i(n),a=f.length,l=0;a>l;)r.f(t,u=f[l++],c[u]);return t},ye}(),e=Rr(),o=Gn(),i=function(){if(pe)return se;pe=1;var t=un();return se=t("document","documentElement")}(),u=tn(),c=qn(),f="prototype",a="script",l=c("IE_PROTO"),s=function(){},p=function(t){return"<"+a+">"+t+"</"+a+">"},v=function(t){t.write(p("")),t.close();var n=t.parentWindow.Object;return t=null,n},d=function(){try{t=new ActiveXObject("htmlfile")}catch(t){}var n,r,o;d="undefined"!=typeof document?document.domain&&t?v(t):(r=u("iframe"),o="java"+a+":",r.style.display="none",i.appendChild(r),r.src=String(o),(n=r.contentWindow.document).open(),n.write(p("document.F=Object")),n.close(),n.F):v(t);for(var c=e.length;c--;)delete d[f][e[c]];return d()};return o[l]=!0,ve=Object.create||function(t,e){var o;return null!==t?(s[f]=n(t),o=new s,s[f]=null,o[l]=t):o=d(),void 0===e?o:r.f(o,e)}}!function(){if(he)return ir;he=1;var t=ee(),n=un(),r=function(){if(Wr)return Ur;Wr=1;var t=it(),n=Function.prototype,r=n.apply,e=n.call;return Ur="object"==typeof Reflect&&Reflect.apply||(t?e.bind(r):function(){return e.apply(r,arguments)}),Ur}(),e=ie(),o=ce(),i=en(),u=Zt(),c=ge(),f=ot(),a=n("Reflect","construct"),l=Object.prototype,s=[].push,p=f((function(){function t(){}return!(a((function(){}),[],t)instanceof t)})),v=!f((function(){a((function(){}))})),d=p||v;t({target:"Reflect",stat:!0,forced:d,sham:d},{construct:function(t,n){o(t),i(n);var f=arguments.length<3?t:o(arguments[2]);if(v&&!p)return a(t,n,f);if(t===f){switch(n.length){case 0:return new t;case 1:return new t(n[0]);case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[1],n[2]);case 4:return new t(n[0],n[1],n[2],n[3])}var d=[null];return r(s,d,n),new(r(e,t,d))}var h=f.prototype,y=c(u(h)?h:l),m=r(t,y,n);return u(m)?m:y}})}(),function(){if(void 0!==window.Reflect&&void 0!==window.customElements&&!window.customElements.polyfillWrapFlushCallback){var t=HTMLElement,n=function(){return Reflect.construct(t,[],this.constructor)};window.HTMLElement=n,HTMLElement.prototype=t.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,t)}}(),console.log(n);var be=function(r){function e(){var t=r.call(this)||this,e=t.attachShadow({mode:"open"}),o=e.ownerDocument,i=o.createElement("style");i.innerHTML=n,e.appendChild(i);var u=o.createElement("span");return u.style.display="inline-block",e.appendChild(u),t.span=u,t}return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}l(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(e,r),Object.defineProperty(e,"observedAttributes",{get:function(){return["data-value"]},enumerable:!1,configurable:!0}),e.prototype.attributeChangedCallback=function(t,n,r){if("data-value"===t){if(n===r)return;this.render(r||"")}},e.prototype.render=function(n){t.render(n,this.span,{throwOnError:!1})},e}(HTMLElement);window.customElements.get("w-e-formula-card")||window.customElements.define("w-e-formula-card",be),r("en",{formula:{formula:"Formula",placeholder:"Use LateX syntax",insert:"Insert formula",edit:"Edit formula",ok:"OK"}}),r("zh-CN",{formula:{formula:"公式",placeholder:"使用 LateX 语法",insert:"插入公式",edit:"编辑公式",ok:"确定"}});var we,Oe,xe,Ee,Se,je,Te,Le,Pe,Ie,_e,Ae,Me,Ce,Re,ke={type:"formula",elemToHtml:function(t,n){var r=t.value;return'<span data-w-e-type="formula" data-w-e-is-void data-w-e-is-inline data-value="'.concat(void 0===r?"":r,'"></span>')}},Ne={};function Fe(){if(Ee)return xe;Ee=1;var t=function(){if(Oe)return we;Oe=1;var t=Jn(),n=ut();return we=function(r){if("Function"===t(r))return n(r)}}(),n=an(),r=it(),e=t(t.bind);return xe=function(t,o){return n(t),void 0===o?t:r?e(t,o):function(){return t.apply(o,arguments)}},xe}function De(){if(je)return Se;je=1;var t=Jn();return Se=Array.isArray||function(n){return"Array"===t(n)}}function He(){if(Le)return Te;Le=1;var t=De(),n=ue(),r=Zt(),e=ht()("species"),o=Array;return Te=function(i){var u;return t(i)&&(u=i.constructor,(n(u)&&(u===o||t(u.prototype))||r(u)&&null===(u=u[e]))&&(u=void 0)),void 0===u?o:u}}function ze(){if(Ie)return Pe;Ie=1;var t=He();return Pe=function(n,r){return new(t(n))(0===r?0:r)}}function $e(){if(Ce)return Me;Ce=1;var t=ht(),n=ge(),r=dn().f,e=t("unscopables"),o=Array.prototype;return void 0===o[e]&&r(o,e,{configurable:!0,value:n(null)}),Me=function(t){o[e][t]=!0}}!function(){if(Re)return Ne;Re=1;var t=ee(),n=function(){if(Ae)return _e;Ae=1;var t=Fe(),n=ut(),r=fr(),e=at(),o=Mr(),i=ze(),u=n([].push),c=function(n){var c=1===n,f=2===n,a=3===n,l=4===n,s=6===n,p=7===n,v=5===n||s;return function(d,h,y,m){for(var g,b,w=e(d),O=r(w),x=o(O),E=t(h,y),S=0,j=m||i,T=c?j(d,x):f||p?j(d,0):void 0;x>S;S++)if((v||S in O)&&(b=E(g=O[S],S,w),n))if(c)T[S]=b;else if(b)switch(n){case 3:return!0;case 5:return g;case 6:return S;case 2:u(T,g)}else switch(n){case 4:return!1;case 7:u(T,g)}return s?-1:a||l?l:T}};return _e={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterReject:c(7)}}().find,r=$e(),e="find",o=!0;e in[]&&Array(1)[e]((function(){o=!1})),t({target:"Array",proto:!0,forced:o},{find:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),r(e)}();var Be,Ve,Ue,We,qe,Ge,Ke,Xe,Ye,Je,Qe,Ze,to,no={};function ro(){if(Ve)return Be;Ve=1;var t=Qn(),n=String;return Be=function(r){if("Symbol"===t(r))throw new TypeError("Cannot convert a Symbol value to a string");return n(r)}}function eo(){if(We)return Ue;We=1;var t=en();return Ue=function(){var n=t(this),r="";return n.hasIndices&&(r+="d"),n.global&&(r+="g"),n.ignoreCase&&(r+="i"),n.multiline&&(r+="m"),n.dotAll&&(r+="s"),n.unicode&&(r+="u"),n.unicodeSets&&(r+="v"),n.sticky&&(r+="y"),r}}function oo(){if(Ze)return Qe;Ze=1;var t,n,r=on(),e=ut(),o=ro(),i=eo(),u=function(){if(Ge)return qe;Ge=1;var t=ot(),n=y().RegExp,r=t((function(){var t=n("a","y");return t.lastIndex=2,null!==t.exec("abcd")})),e=r||t((function(){return!n("a","y").sticky})),o=r||t((function(){var t=n("^r","gy");return t.lastIndex=2,null!==t.exec("str")}));return qe={BROKEN_CARET:o,MISSED_STICKY:e,UNSUPPORTED_Y:r}}(),c=et(),f=ge(),a=Kn().get,l=function(){if(Xe)return Ke;Xe=1;var t=ot(),n=y().RegExp;return Ke=t((function(){var t=n(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)}))}(),s=function(){if(Je)return Ye;Je=1;var t=ot(),n=y().RegExp;return Ye=t((function(){var t=n("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))}(),p=c("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,d=v,h=e("".charAt),m=e("".indexOf),g=e("".replace),b=e("".slice),w=(n=/b*/g,r(v,t=/a/,"a"),r(v,n,"a"),0!==t.lastIndex||0!==n.lastIndex),O=u.BROKEN_CARET,x=void 0!==/()??/.exec("")[1];return(w||x||O||l||s)&&(d=function(t){var n,e,u,c,l,s,y,E=this,S=a(E),j=o(t),T=S.raw;if(T)return T.lastIndex=E.lastIndex,n=r(d,T,j),E.lastIndex=T.lastIndex,n;var L=S.groups,P=O&&E.sticky,I=r(i,E),_=E.source,A=0,M=j;if(P&&(I=g(I,"y",""),-1===m(I,"g")&&(I+="g"),M=b(j,E.lastIndex),E.lastIndex>0&&(!E.multiline||E.multiline&&"\n"!==h(j,E.lastIndex-1))&&(_="(?: "+_+")",M=" "+M,A++),e=new RegExp("^(?:"+_+")",I)),x&&(e=new RegExp("^"+_+"$(?!\\s)",I)),w&&(u=E.lastIndex),c=r(v,P?e:E,M),P?c?(c.input=b(c.input,A),c[0]=b(c[0],A),c.index=E.lastIndex,E.lastIndex+=c[0].length):E.lastIndex=0:w&&c&&(E.lastIndex=E.global?c.index+c[0].length:u),x&&c&&c.length>1&&r(p,c[0],e,(function(){for(l=1;l<arguments.length-2;l++)void 0===arguments[l]&&(c[l]=void 0)})),c&&L)for(c.groups=s=f(null),l=0;l<L.length;l++)s[(y=L[l])[0]]=c[y[1]];return c}),Qe=d}!function(){if(to)return no;to=1;var t=ee(),n=oo();t({target:"RegExp",proto:!0,forced:/./.exec!==n},{exec:n})}();var io,uo,co,fo,ao,lo,so,po={};function vo(){return uo?io:(uo=1,io="\t\n\v\f\r \u2028\u2029\ufeff")}!function(){if(so)return po;so=1;var t=ee(),n=function(){if(fo)return co;fo=1;var t=ut(),n=ft(),r=ro(),e=vo(),o=t("".replace),i=RegExp("^["+e+"]+"),u=RegExp("(^|[^"+e+"])["+e+"]+$"),c=function(t){return function(e){var c=r(n(e));return 1&t&&(c=o(c,i,"")),2&t&&(c=o(c,u,"$1")),c}};return co={start:c(1),end:c(2),trim:c(3)}}().trim,r=function(){if(lo)return ao;lo=1;var t=Bn().PROPER,n=ot(),r=vo();return ao=function(e){return n((function(){return!!r[e]()||"
"!=="
"[e]()||t&&r[e].name!==e}))}}();t({target:"String",proto:!0,forced:r("trim")},{trim:function(){return n(this)}})}();var ho,yo,mo={};function go(t){return null!==t&&"object"==typeof t&&"constructor"in t&&t.constructor===Object}function bo(t,n){void 0===t&&(t={}),void 0===n&&(n={}),Object.keys(n).forEach((function(r){void 0===t[r]?t[r]=n[r]:go(n[r])&&go(t[r])&&Object.keys(n[r]).length>0&&bo(t[r],n[r])}))}yo||(yo=1,function(){if(ho)return mo;ho=1;var t=ee(),n=y();t({global:!0,forced:n.globalThis!==n},{globalThis:n})}());var wo={body:{},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}},createElementNS:function(){return{}},importNode:function(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function Oo(){var t="undefined"!=typeof document?document:{};return bo(t,wo),t}var xo={document:wo,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState:function(){},pushState:function(){},go:function(){},back:function(){}},CustomEvent:function(){return this},addEventListener:function(){},removeEventListener:function(){},getComputedStyle:function(){return{getPropertyValue:function(){return""}}},Image:function(){},Date:function(){},screen:{},setTimeout:function(){},clearTimeout:function(){},matchMedia:function(){return{}},requestAnimationFrame:function(t){return"undefined"==typeof setTimeout?(t(),null):setTimeout(t,0)},cancelAnimationFrame:function(t){"undefined"!=typeof setTimeout&&clearTimeout(t)}};function Eo(){var t="undefined"!=typeof window?window:{};return bo(t,xo),t}function So(t){return So=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},So(t)}function jo(t,n){return jo=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t},jo(t,n)}function To(t,n,r){return To=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct:function(t,n,r){var e=[null];e.push.apply(e,n);var o=new(Function.bind.apply(t,e));return r&&jo(o,r.prototype),o},To.apply(null,arguments)}function Lo(t){var n="function"==typeof Map?new Map:void 0;return Lo=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return To(t,arguments,So(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),jo(e,t)},Lo(t)}var Po=function(t){var n,r;function e(n){var r,e,o;return r=t.call.apply(t,[this].concat(n))||this,e=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(r),o=e.__proto__,Object.defineProperty(e,"__proto__",{get:function(){return o},set:function(t){o.__proto__=t}}),r}return r=t,(n=e).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,e}(Lo(Array));function Io(t,n){var r=Eo(),e=Oo(),o=[];if(!n&&t instanceof Po)return t;if(!t)return new Po(o);if("string"==typeof t){var i=t.trim();if(i.indexOf("<")>=0&&i.indexOf(">")>=0){var u="div";0===i.indexOf("<li")&&(u="ul"),0===i.indexOf("<tr")&&(u="tbody"),0!==i.indexOf("<td")&&0!==i.indexOf("<th")||(u="tr"),0===i.indexOf("<tbody")&&(u="table"),0===i.indexOf("<option")&&(u="select");var c=e.createElement(u);c.innerHTML=i;for(var f=0;f<c.childNodes.length;f+=1)o.push(c.childNodes[f])}else o=function(t,n){if("string"!=typeof t)return[t];for(var r=[],e=n.querySelectorAll(t),o=0;o<e.length;o+=1)r.push(e[o]);return r}(t.trim(),n||e)}else if(t.nodeType||t===r||t===e)o.push(t);else if(Array.isArray(t)){if(t instanceof Po)return t;o=t}return new Po(function(t){for(var n=[],r=0;r<t.length;r+=1)-1===n.indexOf(t[r])&&n.push(t[r]);return n}(o))}function _o(t){if(void 0===t){var n=this[0];if(!n)return;if(n.multiple&&"select"===n.nodeName.toLowerCase()){for(var r=[],e=0;e<n.selectedOptions.length;e+=1)r.push(n.selectedOptions[e].value);return r}return n.value}for(var o=0;o<this.length;o+=1){var i=this[o];if(Array.isArray(t)&&i.multiple&&"select"===i.nodeName.toLowerCase())for(var u=0;u<i.options.length;u+=1)i.options[u].selected=t.indexOf(i.options[u].value)>=0;else i.value=t}return this}function Ao(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var e=n[0],o=n[1],i=n[2],u=n[3];function c(t){var n=t.target;if(n){var r=t.target.dom7EventData||[];if(r.indexOf(t)<0&&r.unshift(t),Io(n).is(o))i.apply(n,r);else for(var e=Io(n).parents(),u=0;u<e.length;u+=1)Io(e[u]).is(o)&&i.apply(e[u],r)}}function f(t){var n=t&&t.target&&t.target.dom7EventData||[];n.indexOf(t)<0&&n.unshift(t),i.apply(this,n)}"function"==typeof n[1]&&(e=n[0],i=n[1],u=n[2],o=void 0),u||(u=!1);for(var a,l=e.split(" "),s=0;s<this.length;s+=1){var p=this[s];if(o)for(a=0;a<l.length;a+=1){var v=l[a];p.dom7LiveListeners||(p.dom7LiveListeners={}),p.dom7LiveListeners[v]||(p.dom7LiveListeners[v]=[]),p.dom7LiveListeners[v].push({listener:i,proxyListener:c}),p.addEventListener(v,c,u)}else for(a=0;a<l.length;a+=1){var d=l[a];p.dom7Listeners||(p.dom7Listeners={}),p.dom7Listeners[d]||(p.dom7Listeners[d]=[]),p.dom7Listeners[d].push({listener:i,proxyListener:f}),p.addEventListener(d,f,u)}}return this}function Mo(t){if(void 0===t)return this[0]?this[0].innerHTML:null;for(var n=0;n<this.length;n+=1)this[n].innerHTML=t;return this}function Co(t){var n,r,e=Eo(),o=Oo(),i=this[0];if(!i||void 0===t)return!1;if("string"==typeof t){if(i.matches)return i.matches(t);if(i.webkitMatchesSelector)return i.webkitMatchesSelector(t);if(i.msMatchesSelector)return i.msMatchesSelector(t);for(n=Io(t),r=0;r<n.length;r+=1)if(n[r]===i)return!0;return!1}if(t===o)return i===o;if(t===e)return i===e;if(t.nodeType||t instanceof Po){for(n=t.nodeType?[t]:t,r=0;r<n.length;r+=1)if(n[r]===i)return!0;return!1}return!1}function Ro(){for(var t,n=Oo(),r=0;r<arguments.length;r+=1){t=r<0||arguments.length<=r?void 0:arguments[r];for(var e=0;e<this.length;e+=1)if("string"==typeof t){var o=n.createElement("div");for(o.innerHTML=t;o.firstChild;)this[e].appendChild(o.firstChild)}else if(t instanceof Po)for(var i=0;i<t.length;i+=1)this[e].appendChild(t[i]);else this[e].appendChild(t)}return this}function ko(t){for(var n=[],r=0;r<this.length;r+=1)for(var e=this[r].parentNode;e;)t?Io(e).is(t)&&n.push(e):n.push(e),e=e.parentNode;return Io(n)}function No(t){for(var n=[],r=0;r<this.length;r+=1)for(var e=this[r].querySelectorAll(t),o=0;o<e.length;o+=1)n.push(e[o]);return Io(n)}Io.fn=Po.prototype;var Fo="resize scroll".split(" ");var Do,Ho=(Do="focus",function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(void 0===n[0]){for(var e=0;e<this.length;e+=1)Fo.indexOf(Do)<0&&(Do in this[e]?this[e][Do]():Io(this[e]).trigger(Do));return this}return this.on.apply(this,[Do].concat(n))});Ro&&(Io.fn.append=Ro),Mo&&(Io.fn.html=Mo),_o&&(Io.fn.val=_o),Ao&&(Io.fn.on=Ao),Ho&&(Io.fn.focus=Ho),Co&&(Io.fn.is=Co),ko&&(Io.fn.parents=ko),No&&(Io.fn.find=No);var zo,$o,Bo,Vo,Uo,Wo,qo,Go={};function Ko(){if($o)return zo;$o=1;var t=TypeError;return zo=function(n){if(n>9007199254740991)throw t("Maximum allowed index exceeded");return n}}function Xo(){if(Vo)return Bo;Vo=1;var t=Qt(),n=dn(),r=Un();return Bo=function(e,o,i){t?n.f(e,o,r(0,i)):e[o]=i}}function Yo(){if(Wo)return Uo;Wo=1;var t=ot(),n=ht(),r=pt(),e=n("species");return Uo=function(n){return r>=51||!t((function(){var t=[];return(t.constructor={})[e]=function(){return{foo:1}},1!==t[n](Boolean).foo}))}}!function(){if(qo)return Go;qo=1;var t=ee(),n=ot(),r=De(),e=Zt(),o=at(),i=Mr(),u=Ko(),c=Xo(),f=ze(),a=Yo(),l=ht(),s=pt(),p=l("isConcatSpreadable"),v=s>=51||!n((function(){var t=[];return t[p]=!1,t.concat()[0]!==t})),d=function(t){if(!e(t))return!1;var n=t[p];return void 0!==n?!!n:r(t)};t({target:"Array",proto:!0,arity:1,forced:!v||!a("concat")},{concat:function(t){var n,r,e,a,l,s=o(this),p=f(s,0),v=0;for(n=-1,e=arguments.length;n<e;n++)if(d(l=-1===n?s:arguments[n]))for(a=i(l),u(v+a),r=0;r<a;r++,v++)r in l&&c(p,v,l[r]);else u(v+1),c(p,v++,l);return p.length=v,p}})}();let Jo=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce(((t,n)=>t+=(n&=63)<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n>62?"-":"_"),"");function Qo(t){return"".concat(t,"-").concat(Jo())}function Zo(){return Qo("w-e-insert-formula")}var ti=function(){function t(){this.title=e("formula.edit"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M864 0a160 160 0 0 1 128 256l-64 64-224-224 64-64c26.752-20.096 59.968-32 96-32zM64 736l-64 288 288-64 592-592-224-224L64 736z m651.584-372.416l-448 448-55.168-55.168 448-448 55.168 55.168z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.textareaId=Zo(),this.buttonId=Zo()}return t.prototype.getSelectedElem=function(t){var n=o.getSelectedNodeByType(t,"formula");return null==n?null:n},t.prototype.getValue=function(t){var n=this.getSelectedElem(t);return n&&n.value||""},t.prototype.isActive=function(t){return!1},t.prototype.exec=function(t,n){},t.prototype.isDisabled=function(t){var n=t.selection;return null==n||(!!i.isExpanded(n)||null==this.getSelectedElem(t))},t.prototype.getModalPositionNode=function(t){return this.getSelectedElem(t)},t.prototype.getModalContentElem=function(t){var n=this,r=this.textareaId,o=this.buttonId,i=s(u(e("formula.formula"),r,e("formula.placeholder")),2),f=i[0],a=Io(i[1]),l=s(c(o,e("formula.ok")),1)[0];if(null==this.$content){var p=Io("<div></div>");p.on("click","#".concat(o),(function(e){e.preventDefault();var o=p.find("#".concat(r)).val().trim();n.updateFormula(t,o),t.hidePanelOrModal()})),this.$content=p}var v=this.$content;v.html(""),v.append(f),v.append(l);var d=this.getValue(t);return a.val(d),setTimeout((function(){a.focus()})),v[0]},t.prototype.updateFormula=function(t,n){if(n&&(t.restoreSelection(),!this.isDisabled(t))){var r=this.getSelectedElem(t);if(null!=r){var e=o.findPath(t,r),i={value:n};f.setNodes(t,i,{at:e})}}},t}();function ni(){return Qo("w-e-insert-formula")}var ri=function(){function t(){this.title=e("formula.insert"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M941.6 734.72L985.984 640H1024l-64 384H0v-74.24l331.552-391.2L0 227.008V0h980L1024 256h-34.368l-18.72-38.88C935.584 143.744 909.024 128 832 128H169.984l353.056 353.056L225.632 832H768c116 0 146.656-41.568 173.6-97.28z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.textareaId=ni(),this.buttonId=ni()}return t.prototype.getValue=function(t){return""},t.prototype.isActive=function(t){return!1},t.prototype.exec=function(t,n){},t.prototype.isDisabled=function(t){var n=t.selection;if(null==n)return!0;if(i.isExpanded(n))return!0;var r=o.getSelectedElems(t);return!!r.some((function(n){return t.isVoid(n)}))||!!r.some((function(t){return"pre"===o.getNodeType(t)}))},t.prototype.getModalPositionNode=function(t){return null},t.prototype.getModalContentElem=function(t){var n=this,r=this.textareaId,o=this.buttonId,i=s(u(e("formula.formula"),r,e("formula.placeholder")),2),f=i[0],a=Io(i[1]),l=s(c(o,e("formula.ok")),1)[0];if(null==this.$content){var p=Io("<div></div>");p.on("click","#".concat(o),(function(e){e.preventDefault();var o=p.find("#".concat(r)).val().trim();n.insertFormula(t,o),t.hidePanelOrModal()})),this.$content=p}var v=this.$content;return v.html(""),v.append(f),v.append(l),a.val(""),setTimeout((function(){a.focus()})),v[0]},t.prototype.insertFormula=function(t,n){if(n&&(t.restoreSelection(),!this.isDisabled(t))){var r={type:"formula",value:n,children:[{text:""}]};t.insertNode(r)}},t}();var ei={editorPlugin:function(t){var n=t.isInline,r=t.isVoid,e=t;return e.isInline=function(t){return"formula"===o.getNodeType(t)||n(t)},e.isVoid=function(t){return"formula"===o.getNodeType(t)||r(t)},e},renderElems:[{type:"formula",renderElem:function(t,n,r){var e=o.isNodeSelected(r,t),i=t.value,u=a("w-e-formula-card",{dataset:{value:void 0===i?"":i}},null);return a("div",{props:{contentEditable:!1},style:{display:"inline-block",marginLeft:"3px",marginRight:"3px",border:e?"2px solid var(--w-e-textarea-selected-border-color)":"2px solid transparent",borderRadius:"3px",padding:"3px 3px"}},[u])}}],elemsToHtml:[ke],parseElemsHtml:[{selector:'span[data-w-e-type="formula"]',parseElemHtml:function(t,n,r){return{type:"formula",value:t.getAttribute("data-value")||"",children:[{text:""}]}}}],menus:[{key:"insertFormula",factory:function(){return new ri}},{key:"editFormula",factory:function(){return new ti}}]};export{ei as default};
|
|
1
|
+
import t from"katex";import n from"katex/dist/katex.css";import{i18nAddResources as r,t as e,DomEditor as o,SlateRange as i,genModalTextareaElems as u,genModalButtonElems as c,SlateTransforms as f}from"@wangeditor-next/editor";import{h as a}from"snabbdom";var l=function(t,n){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])},l(t,n)};function s(t,n){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var e,o,i=r.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(e=i.next()).done;)u.push(e.value)}catch(t){o={error:t}}finally{try{e&&!e.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u}"function"==typeof SuppressedError&&SuppressedError;var p,v,d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={};function y(){if(v)return p;v=1;var t=function(t){return t&&t.Math===Math&&t};return p=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof d&&d)||t("object"==typeof p&&p)||function(){return this}()||Function("return this")()}var m,g,b,w,O,x,E,S,j,T,L,P,I,_,A,M,C,R,k,N,F,D,H,z,$,B,V,U,W,q,G,K,X,Y,J,Q,Z,tt={exports:{}};function nt(){if(w)return b;w=1;var t=y(),n=Object.defineProperty;return b=function(r,e){try{n(t,r,{value:e,configurable:!0,writable:!0})}catch(n){t[r]=e}return e}}function rt(){if(O)return tt.exports;O=1;var t=g?m:(g=1,m=!1),n=y(),r=nt(),e="__core-js_shared__",o=tt.exports=n[e]||r(e,{});return(o.versions||(o.versions=[])).push({version:"3.38.1",mode:t?"pure":"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"}),tt.exports}function et(){if(E)return x;E=1;var t=rt();return x=function(n,r){return t[n]||(t[n]=r||{})}}function ot(){return j?S:(j=1,S=function(t){try{return!!t()}catch(t){return!0}})}function it(){if(L)return T;L=1;var t=ot();return T=!t((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))}function ut(){if(I)return P;I=1;var t=it(),n=Function.prototype,r=n.call,e=t&&n.bind.bind(r,r);return P=t?e:function(t){return function(){return r.apply(t,arguments)}},P}function ct(){return A?_:(A=1,_=function(t){return null==t})}function ft(){if(C)return M;C=1;var t=ct(),n=TypeError;return M=function(r){if(t(r))throw new n("Can't call method on "+r);return r}}function at(){if(k)return R;k=1;var t=ft(),n=Object;return R=function(r){return n(t(r))}}function lt(){if(F)return N;F=1;var t=ut(),n=at(),r=t({}.hasOwnProperty);return N=Object.hasOwn||function(t,e){return r(n(t),e)}}function st(){if(H)return D;H=1;var t=ut(),n=0,r=Math.random(),e=t(1..toString);return D=function(t){return"Symbol("+(void 0===t?"":t)+")_"+e(++n+r,36)}}function pt(){if(V)return B;V=1;var t,n,r=y(),e=function(){if($)return z;$=1;var t=y().navigator,n=t&&t.userAgent;return z=n?String(n):""}(),o=r.process,i=r.Deno,u=o&&o.versions||i&&i.version,c=u&&u.v8;return c&&(n=(t=c.split("."))[0]>0&&t[0]<4?1:+(t[0]+t[1])),!n&&e&&(!(t=e.match(/Edge\/(\d+)/))||t[1]>=74)&&(t=e.match(/Chrome\/(\d+)/))&&(n=+t[1]),B=n}function vt(){if(W)return U;W=1;var t=pt(),n=ot(),r=y().String;return U=!!Object.getOwnPropertySymbols&&!n((function(){var n=Symbol("symbol detection");return!r(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&t&&t<41}))}function dt(){if(G)return q;G=1;var t=vt();return q=t&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function ht(){if(X)return K;X=1;var t=y(),n=et(),r=lt(),e=st(),o=vt(),i=dt(),u=t.Symbol,c=n("wks"),f=i?u.for||u:u&&u.withoutSetter||e;return K=function(t){return r(c,t)||(c[t]=o&&r(u,t)?u[t]:f("Symbol."+t)),c[t]}}function yt(){if(J)return Y;J=1;var t={};return t[ht()("toStringTag")]="z",Y="[object z]"===String(t)}function mt(){if(Z)return Q;Z=1;var t="object"==typeof document&&document.all;return Q=void 0===t&&void 0!==t?function(n){return"function"==typeof n||n===t}:function(t){return"function"==typeof t}}var gt,bt,wt,Ot,xt,Et,St,jt,Tt,Lt,Pt,It,_t,At,Mt,Ct,Rt,kt,Nt,Ft,Dt,Ht,zt,$t,Bt,Vt,Ut,Wt,qt,Gt,Kt,Xt,Yt,Jt={};function Qt(){if(bt)return gt;bt=1;var t=ot();return gt=!t((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))}function Zt(){if(Ot)return wt;Ot=1;var t=mt();return wt=function(n){return"object"==typeof n?null!==n:t(n)}}function tn(){if(Et)return xt;Et=1;var t=y(),n=Zt(),r=t.document,e=n(r)&&n(r.createElement);return xt=function(t){return e?r.createElement(t):{}}}function nn(){if(jt)return St;jt=1;var t=Qt(),n=ot(),r=tn();return St=!t&&!n((function(){return 7!==Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a}))}function rn(){if(Lt)return Tt;Lt=1;var t=Qt(),n=ot();return Tt=t&&n((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))}function en(){if(It)return Pt;It=1;var t=Zt(),n=String,r=TypeError;return Pt=function(e){if(t(e))return e;throw new r(n(e)+" is not an object")}}function on(){if(At)return _t;At=1;var t=it(),n=Function.prototype.call;return _t=t?n.bind(n):function(){return n.apply(n,arguments)},_t}function un(){if(Ct)return Mt;Ct=1;var t=y(),n=mt();return Mt=function(r,e){return arguments.length<2?(o=t[r],n(o)?o:void 0):t[r]&&t[r][e];var o},Mt}function cn(){if(Ft)return Nt;Ft=1;var t=un(),n=mt(),r=function(){if(kt)return Rt;kt=1;var t=ut();return Rt=t({}.isPrototypeOf)}(),e=dt(),o=Object;return Nt=e?function(t){return"symbol"==typeof t}:function(e){var i=t("Symbol");return n(i)&&r(i.prototype,o(e))}}function fn(){if(Ht)return Dt;Ht=1;var t=String;return Dt=function(n){try{return t(n)}catch(t){return"Object"}}}function an(){if($t)return zt;$t=1;var t=mt(),n=fn(),r=TypeError;return zt=function(e){if(t(e))return e;throw new r(n(e)+" is not a function")}}function ln(){if(Vt)return Bt;Vt=1;var t=an(),n=ct();return Bt=function(r,e){var o=r[e];return n(o)?void 0:t(o)}}function sn(){if(Wt)return Ut;Wt=1;var t=on(),n=mt(),r=Zt(),e=TypeError;return Ut=function(o,i){var u,c;if("string"===i&&n(u=o.toString)&&!r(c=t(u,o)))return c;if(n(u=o.valueOf)&&!r(c=t(u,o)))return c;if("string"!==i&&n(u=o.toString)&&!r(c=t(u,o)))return c;throw new e("Can't convert object to primitive value")},Ut}function pn(){if(Gt)return qt;Gt=1;var t=on(),n=Zt(),r=cn(),e=ln(),o=sn(),i=ht(),u=TypeError,c=i("toPrimitive");return qt=function(i,f){if(!n(i)||r(i))return i;var a,l=e(i,c);if(l){if(void 0===f&&(f="default"),a=t(l,i,f),!n(a)||r(a))return a;throw new u("Can't convert object to primitive value")}return void 0===f&&(f="number"),o(i,f)}}function vn(){if(Xt)return Kt;Xt=1;var t=pn(),n=cn();return Kt=function(r){var e=t(r,"string");return n(e)?e:e+""}}function dn(){if(Yt)return Jt;Yt=1;var t=Qt(),n=nn(),r=rn(),e=en(),o=vn(),i=TypeError,u=Object.defineProperty,c=Object.getOwnPropertyDescriptor,f="enumerable",a="configurable",l="writable";return Jt.f=t?r?function(t,n,r){if(e(t),n=o(n),e(r),"function"==typeof t&&"prototype"===n&&"value"in r&&l in r&&!r[l]){var i=c(t,n);i&&i[l]&&(t[n]=r.value,r={configurable:a in r?r[a]:i[a],enumerable:f in r?r[f]:i[f],writable:!1})}return u(t,n,r)}:u:function(t,r,c){if(e(t),r=o(r),e(c),n)try{return u(t,r,c)}catch(t){}if("get"in c||"set"in c)throw new i("Accessors not supported");return"value"in c&&(t[r]=c.value),t},Jt}var hn,yn,mn,gn,bn,wn,On,xn,En,Sn,jn,Tn,Ln,Pn,In,_n,An,Mn,Cn,Rn,kn,Nn,Fn,Dn,Hn,zn,$n={exports:{}};function Bn(){if(yn)return hn;yn=1;var t=Qt(),n=lt(),r=Function.prototype,e=t&&Object.getOwnPropertyDescriptor,o=n(r,"name"),i=o&&"something"===function(){}.name,u=o&&(!t||t&&e(r,"name").configurable);return hn={EXISTS:o,PROPER:i,CONFIGURABLE:u}}function Vn(){if(gn)return mn;gn=1;var t=ut(),n=mt(),r=rt(),e=t(Function.toString);return n(r.inspectSource)||(r.inspectSource=function(t){return e(t)}),mn=r.inspectSource}function Un(){return xn?On:(xn=1,On=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}})}function Wn(){if(Sn)return En;Sn=1;var t=Qt(),n=dn(),r=Un();return En=t?function(t,e,o){return n.f(t,e,r(1,o))}:function(t,n,r){return t[n]=r,t}}function qn(){if(Tn)return jn;Tn=1;var t=et(),n=st(),r=t("keys");return jn=function(t){return r[t]||(r[t]=n(t))}}function Gn(){return Pn?Ln:(Pn=1,Ln={})}function Kn(){if(_n)return In;_n=1;var t,n,r,e=function(){if(wn)return bn;wn=1;var t=y(),n=mt(),r=t.WeakMap;return bn=n(r)&&/native code/.test(String(r))}(),o=y(),i=Zt(),u=Wn(),c=lt(),f=rt(),a=qn(),l=Gn(),s="Object already initialized",p=o.TypeError,v=o.WeakMap;if(e||f.state){var d=f.state||(f.state=new v);d.get=d.get,d.has=d.has,d.set=d.set,t=function(t,n){if(d.has(t))throw new p(s);return n.facade=t,d.set(t,n),n},n=function(t){return d.get(t)||{}},r=function(t){return d.has(t)}}else{var h=a("state");l[h]=!0,t=function(t,n){if(c(t,h))throw new p(s);return n.facade=t,u(t,h,n),n},n=function(t){return c(t,h)?t[h]:{}},r=function(t){return c(t,h)}}return In={set:t,get:n,has:r,enforce:function(e){return r(e)?n(e):t(e,{})},getterFor:function(t){return function(r){var e;if(!i(r)||(e=n(r)).type!==t)throw new p("Incompatible receiver, "+t+" required");return e}}}}function Xn(){if(An)return $n.exports;An=1;var t=ut(),n=ot(),r=mt(),e=lt(),o=Qt(),i=Bn().CONFIGURABLE,u=Vn(),c=Kn(),f=c.enforce,a=c.get,l=String,s=Object.defineProperty,p=t("".slice),v=t("".replace),d=t([].join),h=o&&!n((function(){return 8!==s((function(){}),"length",{value:8}).length})),y=String(String).split("String"),m=$n.exports=function(t,n,r){"Symbol("===p(l(n),0,7)&&(n="["+v(l(n),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(n="get "+n),r&&r.setter&&(n="set "+n),(!e(t,"name")||i&&t.name!==n)&&(o?s(t,"name",{value:n,configurable:!0}):t.name=n),h&&r&&e(r,"arity")&&t.length!==r.arity&&s(t,"length",{value:r.arity});try{r&&e(r,"constructor")&&r.constructor?o&&s(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var u=f(t);return e(u,"source")||(u.source=d(y,"string"==typeof n?n:"")),t};return Function.prototype.toString=m((function(){return r(this)&&a(this).source||u(this)}),"toString"),$n.exports}function Yn(){if(Cn)return Mn;Cn=1;var t=mt(),n=dn(),r=Xn(),e=nt();return Mn=function(o,i,u,c){c||(c={});var f=c.enumerable,a=void 0!==c.name?c.name:i;if(t(u)&&r(u,a,c),c.global)f?o[i]=u:e(i,u);else{try{c.unsafe?o[i]&&(f=!0):delete o[i]}catch(t){}f?o[i]=u:n.f(o,i,{value:u,enumerable:!1,configurable:!c.nonConfigurable,writable:!c.nonWritable})}return o}}function Jn(){if(kn)return Rn;kn=1;var t=ut(),n=t({}.toString),r=t("".slice);return Rn=function(t){return r(n(t),8,-1)}}function Qn(){if(Fn)return Nn;Fn=1;var t=yt(),n=mt(),r=Jn(),e=ht()("toStringTag"),o=Object,i="Arguments"===r(function(){return arguments}());return Nn=t?r:function(t){var u,c,f;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(c=function(t,n){try{return t[n]}catch(t){}}(u=o(t),e))?c:i?r(u):"Object"===(f=r(u))&&n(u.callee)?"Arguments":f}}!function(){if(zn)return h;zn=1;var t=yt(),n=Yn(),r=function(){if(Hn)return Dn;Hn=1;var t=yt(),n=Qn();return Dn=t?{}.toString:function(){return"[object "+n(this)+"]"}}();t||n(Object.prototype,"toString",r,{unsafe:!0})}();var Zn,tr,nr,rr,er,or,ir={},ur={},cr={};function fr(){if(nr)return tr;nr=1;var t=ut(),n=ot(),r=Jn(),e=Object,o=t("".split);return tr=n((function(){return!e("z").propertyIsEnumerable(0)}))?function(t){return"String"===r(t)?o(t,""):e(t)}:e}function ar(){if(er)return rr;er=1;var t=fr(),n=ft();return rr=function(r){return t(n(r))}}function lr(){if(or)return ur;or=1;var t=Qt(),n=on(),r=function(){if(Zn)return cr;Zn=1;var t={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,r=n&&!t.call({1:2},1);return cr.f=r?function(t){var r=n(this,t);return!!r&&r.enumerable}:t,cr}(),e=Un(),o=ar(),i=vn(),u=lt(),c=nn(),f=Object.getOwnPropertyDescriptor;return ur.f=t?f:function(t,a){if(t=o(t),a=i(a),c)try{return f(t,a)}catch(t){}if(u(t,a))return e(!n(r.f,t,a),t[a])},ur}var sr,pr,vr,dr,hr,yr,mr,gr,br,wr,Or,xr,Er,Sr,jr,Tr,Lr,Pr={};function Ir(){if(dr)return vr;dr=1;var t=function(){if(pr)return sr;pr=1;var t=Math.ceil,n=Math.floor;return sr=Math.trunc||function(r){var e=+r;return(e>0?n:t)(e)}}();return vr=function(n){var r=+n;return r!=r||0===r?0:t(r)}}function _r(){if(yr)return hr;yr=1;var t=Ir(),n=Math.max,r=Math.min;return hr=function(e,o){var i=t(e);return i<0?n(i+o,0):r(i,o)}}function Ar(){if(gr)return mr;gr=1;var t=Ir(),n=Math.min;return mr=function(r){var e=t(r);return e>0?n(e,9007199254740991):0}}function Mr(){if(wr)return br;wr=1;var t=Ar();return br=function(n){return t(n.length)}}function Cr(){if(Sr)return Er;Sr=1;var t=ut(),n=lt(),r=ar(),e=function(){if(xr)return Or;xr=1;var t=ar(),n=_r(),r=Mr(),e=function(e){return function(o,i,u){var c=t(o),f=r(c);if(0===f)return!e&&-1;var a,l=n(u,f);if(e&&i!=i){for(;f>l;)if((a=c[l++])!=a)return!0}else for(;f>l;l++)if((e||l in c)&&c[l]===i)return e||l||0;return!e&&-1}};return Or={includes:e(!0),indexOf:e(!1)}}().indexOf,o=Gn(),i=t([].push);return Er=function(t,u){var c,f=r(t),a=0,l=[];for(c in f)!n(o,c)&&n(f,c)&&i(l,c);for(;u.length>a;)n(f,c=u[a++])&&(~e(l,c)||i(l,c));return l}}function Rr(){return Tr?jr:(Tr=1,jr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var kr,Nr,Fr,Dr,Hr,zr,$r,Br,Vr,Ur,Wr,qr,Gr,Kr,Xr,Yr,Jr,Qr,Zr,te={};function ne(){if(Fr)return Nr;Fr=1;var t=un(),n=ut(),r=function(){if(Lr)return Pr;Lr=1;var t=Cr(),n=Rr().concat("length","prototype");return Pr.f=Object.getOwnPropertyNames||function(r){return t(r,n)},Pr}(),e=(kr||(kr=1,te.f=Object.getOwnPropertySymbols),te),o=en(),i=n([].concat);return Nr=t("Reflect","ownKeys")||function(t){var n=r.f(o(t)),u=e.f;return u?i(n,u(t)):n}}function re(){if(Hr)return Dr;Hr=1;var t=lt(),n=ne(),r=lr(),e=dn();return Dr=function(o,i,u){for(var c=n(i),f=e.f,a=r.f,l=0;l<c.length;l++){var s=c[l];t(o,s)||u&&t(u,s)||f(o,s,a(i,s))}}}function ee(){if(Vr)return Br;Vr=1;var t=y(),n=lr().f,r=Wn(),e=Yn(),o=nt(),i=re(),u=function(){if($r)return zr;$r=1;var t=ot(),n=mt(),r=/#|\.prototype\./,e=function(r,e){var f=i[o(r)];return f===c||f!==u&&(n(e)?t(e):!!e)},o=e.normalize=function(t){return String(t).replace(r,".").toLowerCase()},i=e.data={},u=e.NATIVE="N",c=e.POLYFILL="P";return zr=e}();return Br=function(c,f){var a,l,s,p,v,d=c.target,h=c.global,y=c.stat;if(a=h?t:y?t[d]||o(d,{}):t[d]&&t[d].prototype)for(l in f){if(p=f[l],s=c.dontCallGetSet?(v=n(a,l))&&v.value:a[l],!u(h?l:d+(y?".":"#")+l,c.forced)&&void 0!==s){if(typeof p==typeof s)continue;i(p,s)}(c.sham||s&&s.sham)&&r(p,"sham",!0),e(a,l,p,c)}}}function oe(){if(Gr)return qr;Gr=1;var t=ut();return qr=t([].slice)}function ie(){if(Xr)return Kr;Xr=1;var t=ut(),n=an(),r=Zt(),e=lt(),o=oe(),i=it(),u=Function,c=t([].concat),f=t([].join),a={};return Kr=i?u.bind:function(t){var i=n(this),l=i.prototype,s=o(arguments,1),p=function(){var n=c(s,o(arguments));return this instanceof p?function(t,n,r){if(!e(a,n)){for(var o=[],i=0;i<n;i++)o[i]="a["+i+"]";a[n]=u("C,a","return new C("+f(o,",")+")")}return a[n](t,r)}(i,n.length,n):i.apply(t,n)};return r(l)&&(p.prototype=l),p},Kr}function ue(){if(Jr)return Yr;Jr=1;var t=ut(),n=ot(),r=mt(),e=Qn(),o=un(),i=Vn(),u=function(){},c=o("Reflect","construct"),f=/^\s*(?:class|function)\b/,a=t(f.exec),l=!f.test(u),s=function(t){if(!r(t))return!1;try{return c(u,[],t),!0}catch(t){return!1}},p=function(t){if(!r(t))return!1;switch(e(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return l||!!a(f,i(t))}catch(t){return!0}};return p.sham=!0,Yr=!c||n((function(){var t;return s(s.call)||!s(Object)||!s((function(){t=!0}))||t}))?p:s}function ce(){if(Zr)return Qr;Zr=1;var t=ue(),n=fn(),r=TypeError;return Qr=function(e){if(t(e))return e;throw new r(n(e)+" is not a constructor")}}var fe,ae,le,se,pe,ve,de,he,ye={};function me(){if(ae)return fe;ae=1;var t=Cr(),n=Rr();return fe=Object.keys||function(r){return t(r,n)}}function ge(){if(de)return ve;de=1;var t,n=en(),r=function(){if(le)return ye;le=1;var t=Qt(),n=rn(),r=dn(),e=en(),o=ar(),i=me();return ye.f=t&&!n?Object.defineProperties:function(t,n){e(t);for(var u,c=o(n),f=i(n),a=f.length,l=0;a>l;)r.f(t,u=f[l++],c[u]);return t},ye}(),e=Rr(),o=Gn(),i=function(){if(pe)return se;pe=1;var t=un();return se=t("document","documentElement")}(),u=tn(),c=qn(),f="prototype",a="script",l=c("IE_PROTO"),s=function(){},p=function(t){return"<"+a+">"+t+"</"+a+">"},v=function(t){t.write(p("")),t.close();var n=t.parentWindow.Object;return t=null,n},d=function(){try{t=new ActiveXObject("htmlfile")}catch(t){}var n,r,o;d="undefined"!=typeof document?document.domain&&t?v(t):(r=u("iframe"),o="java"+a+":",r.style.display="none",i.appendChild(r),r.src=String(o),(n=r.contentWindow.document).open(),n.write(p("document.F=Object")),n.close(),n.F):v(t);for(var c=e.length;c--;)delete d[f][e[c]];return d()};return o[l]=!0,ve=Object.create||function(t,e){var o;return null!==t?(s[f]=n(t),o=new s,s[f]=null,o[l]=t):o=d(),void 0===e?o:r.f(o,e)}}!function(){if(he)return ir;he=1;var t=ee(),n=un(),r=function(){if(Wr)return Ur;Wr=1;var t=it(),n=Function.prototype,r=n.apply,e=n.call;return Ur="object"==typeof Reflect&&Reflect.apply||(t?e.bind(r):function(){return e.apply(r,arguments)}),Ur}(),e=ie(),o=ce(),i=en(),u=Zt(),c=ge(),f=ot(),a=n("Reflect","construct"),l=Object.prototype,s=[].push,p=f((function(){function t(){}return!(a((function(){}),[],t)instanceof t)})),v=!f((function(){a((function(){}))})),d=p||v;t({target:"Reflect",stat:!0,forced:d,sham:d},{construct:function(t,n){o(t),i(n);var f=arguments.length<3?t:o(arguments[2]);if(v&&!p)return a(t,n,f);if(t===f){switch(n.length){case 0:return new t;case 1:return new t(n[0]);case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[1],n[2]);case 4:return new t(n[0],n[1],n[2],n[3])}var d=[null];return r(s,d,n),new(r(e,t,d))}var h=f.prototype,y=c(u(h)?h:l),m=r(t,y,n);return u(m)?m:y}})}(),function(){if(void 0!==window.Reflect&&void 0!==window.customElements&&!window.customElements.polyfillWrapFlushCallback){var t=HTMLElement,n=function(){return Reflect.construct(t,[],this.constructor)};window.HTMLElement=n,HTMLElement.prototype=t.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,t)}}();var be=function(r){function e(){var t=r.call(this)||this,e=t.attachShadow({mode:"open"}),o=e.ownerDocument,i=o.createElement("style");i.innerHTML=n,e.appendChild(i);var u=o.createElement("span");return u.style.display="inline-block",e.appendChild(u),t.span=u,t}return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}l(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(e,r),Object.defineProperty(e,"observedAttributes",{get:function(){return["data-value"]},enumerable:!1,configurable:!0}),e.prototype.attributeChangedCallback=function(t,n,r){if("data-value"===t){if(n===r)return;this.render(r||"")}},e.prototype.render=function(n){t.render(n,this.span,{throwOnError:!1})},e}(HTMLElement);window.customElements.get("w-e-formula-card")||window.customElements.define("w-e-formula-card",be),r("en",{formula:{formula:"Formula",placeholder:"Use LateX syntax",insert:"Insert formula",edit:"Edit formula",ok:"OK"}}),r("zh-CN",{formula:{formula:"公式",placeholder:"使用 LateX 语法",insert:"插入公式",edit:"编辑公式",ok:"确定"}});var we,Oe,xe,Ee,Se,je,Te,Le,Pe,Ie,_e,Ae,Me,Ce,Re,ke={type:"formula",elemToHtml:function(t,n){var r=t.value;return'<span data-w-e-type="formula" data-w-e-is-void data-w-e-is-inline data-value="'.concat(void 0===r?"":r,'"></span>')}},Ne={};function Fe(){if(Ee)return xe;Ee=1;var t=function(){if(Oe)return we;Oe=1;var t=Jn(),n=ut();return we=function(r){if("Function"===t(r))return n(r)}}(),n=an(),r=it(),e=t(t.bind);return xe=function(t,o){return n(t),void 0===o?t:r?e(t,o):function(){return t.apply(o,arguments)}},xe}function De(){if(je)return Se;je=1;var t=Jn();return Se=Array.isArray||function(n){return"Array"===t(n)}}function He(){if(Le)return Te;Le=1;var t=De(),n=ue(),r=Zt(),e=ht()("species"),o=Array;return Te=function(i){var u;return t(i)&&(u=i.constructor,(n(u)&&(u===o||t(u.prototype))||r(u)&&null===(u=u[e]))&&(u=void 0)),void 0===u?o:u}}function ze(){if(Ie)return Pe;Ie=1;var t=He();return Pe=function(n,r){return new(t(n))(0===r?0:r)}}function $e(){if(Ce)return Me;Ce=1;var t=ht(),n=ge(),r=dn().f,e=t("unscopables"),o=Array.prototype;return void 0===o[e]&&r(o,e,{configurable:!0,value:n(null)}),Me=function(t){o[e][t]=!0}}!function(){if(Re)return Ne;Re=1;var t=ee(),n=function(){if(Ae)return _e;Ae=1;var t=Fe(),n=ut(),r=fr(),e=at(),o=Mr(),i=ze(),u=n([].push),c=function(n){var c=1===n,f=2===n,a=3===n,l=4===n,s=6===n,p=7===n,v=5===n||s;return function(d,h,y,m){for(var g,b,w=e(d),O=r(w),x=o(O),E=t(h,y),S=0,j=m||i,T=c?j(d,x):f||p?j(d,0):void 0;x>S;S++)if((v||S in O)&&(b=E(g=O[S],S,w),n))if(c)T[S]=b;else if(b)switch(n){case 3:return!0;case 5:return g;case 6:return S;case 2:u(T,g)}else switch(n){case 4:return!1;case 7:u(T,g)}return s?-1:a||l?l:T}};return _e={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterReject:c(7)}}().find,r=$e(),e="find",o=!0;e in[]&&Array(1)[e]((function(){o=!1})),t({target:"Array",proto:!0,forced:o},{find:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),r(e)}();var Be,Ve,Ue,We,qe,Ge,Ke,Xe,Ye,Je,Qe,Ze,to,no={};function ro(){if(Ve)return Be;Ve=1;var t=Qn(),n=String;return Be=function(r){if("Symbol"===t(r))throw new TypeError("Cannot convert a Symbol value to a string");return n(r)}}function eo(){if(We)return Ue;We=1;var t=en();return Ue=function(){var n=t(this),r="";return n.hasIndices&&(r+="d"),n.global&&(r+="g"),n.ignoreCase&&(r+="i"),n.multiline&&(r+="m"),n.dotAll&&(r+="s"),n.unicode&&(r+="u"),n.unicodeSets&&(r+="v"),n.sticky&&(r+="y"),r}}function oo(){if(Ze)return Qe;Ze=1;var t,n,r=on(),e=ut(),o=ro(),i=eo(),u=function(){if(Ge)return qe;Ge=1;var t=ot(),n=y().RegExp,r=t((function(){var t=n("a","y");return t.lastIndex=2,null!==t.exec("abcd")})),e=r||t((function(){return!n("a","y").sticky})),o=r||t((function(){var t=n("^r","gy");return t.lastIndex=2,null!==t.exec("str")}));return qe={BROKEN_CARET:o,MISSED_STICKY:e,UNSUPPORTED_Y:r}}(),c=et(),f=ge(),a=Kn().get,l=function(){if(Xe)return Ke;Xe=1;var t=ot(),n=y().RegExp;return Ke=t((function(){var t=n(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)}))}(),s=function(){if(Je)return Ye;Je=1;var t=ot(),n=y().RegExp;return Ye=t((function(){var t=n("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))}(),p=c("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,d=v,h=e("".charAt),m=e("".indexOf),g=e("".replace),b=e("".slice),w=(n=/b*/g,r(v,t=/a/,"a"),r(v,n,"a"),0!==t.lastIndex||0!==n.lastIndex),O=u.BROKEN_CARET,x=void 0!==/()??/.exec("")[1];return(w||x||O||l||s)&&(d=function(t){var n,e,u,c,l,s,y,E=this,S=a(E),j=o(t),T=S.raw;if(T)return T.lastIndex=E.lastIndex,n=r(d,T,j),E.lastIndex=T.lastIndex,n;var L=S.groups,P=O&&E.sticky,I=r(i,E),_=E.source,A=0,M=j;if(P&&(I=g(I,"y",""),-1===m(I,"g")&&(I+="g"),M=b(j,E.lastIndex),E.lastIndex>0&&(!E.multiline||E.multiline&&"\n"!==h(j,E.lastIndex-1))&&(_="(?: "+_+")",M=" "+M,A++),e=new RegExp("^(?:"+_+")",I)),x&&(e=new RegExp("^"+_+"$(?!\\s)",I)),w&&(u=E.lastIndex),c=r(v,P?e:E,M),P?c?(c.input=b(c.input,A),c[0]=b(c[0],A),c.index=E.lastIndex,E.lastIndex+=c[0].length):E.lastIndex=0:w&&c&&(E.lastIndex=E.global?c.index+c[0].length:u),x&&c&&c.length>1&&r(p,c[0],e,(function(){for(l=1;l<arguments.length-2;l++)void 0===arguments[l]&&(c[l]=void 0)})),c&&L)for(c.groups=s=f(null),l=0;l<L.length;l++)s[(y=L[l])[0]]=c[y[1]];return c}),Qe=d}!function(){if(to)return no;to=1;var t=ee(),n=oo();t({target:"RegExp",proto:!0,forced:/./.exec!==n},{exec:n})}();var io,uo,co,fo,ao,lo,so,po={};function vo(){return uo?io:(uo=1,io="\t\n\v\f\r \u2028\u2029\ufeff")}!function(){if(so)return po;so=1;var t=ee(),n=function(){if(fo)return co;fo=1;var t=ut(),n=ft(),r=ro(),e=vo(),o=t("".replace),i=RegExp("^["+e+"]+"),u=RegExp("(^|[^"+e+"])["+e+"]+$"),c=function(t){return function(e){var c=r(n(e));return 1&t&&(c=o(c,i,"")),2&t&&(c=o(c,u,"$1")),c}};return co={start:c(1),end:c(2),trim:c(3)}}().trim,r=function(){if(lo)return ao;lo=1;var t=Bn().PROPER,n=ot(),r=vo();return ao=function(e){return n((function(){return!!r[e]()||"
"!=="
"[e]()||t&&r[e].name!==e}))}}();t({target:"String",proto:!0,forced:r("trim")},{trim:function(){return n(this)}})}();var ho,yo,mo={};function go(t){return null!==t&&"object"==typeof t&&"constructor"in t&&t.constructor===Object}function bo(t,n){void 0===t&&(t={}),void 0===n&&(n={}),Object.keys(n).forEach((function(r){void 0===t[r]?t[r]=n[r]:go(n[r])&&go(t[r])&&Object.keys(n[r]).length>0&&bo(t[r],n[r])}))}yo||(yo=1,function(){if(ho)return mo;ho=1;var t=ee(),n=y();t({global:!0,forced:n.globalThis!==n},{globalThis:n})}());var wo={body:{},addEventListener:function(){},removeEventListener:function(){},activeElement:{blur:function(){},nodeName:""},querySelector:function(){return null},querySelectorAll:function(){return[]},getElementById:function(){return null},createEvent:function(){return{initEvent:function(){}}},createElement:function(){return{children:[],childNodes:[],style:{},setAttribute:function(){},getElementsByTagName:function(){return[]}}},createElementNS:function(){return{}},importNode:function(){return null},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function Oo(){var t="undefined"!=typeof document?document:{};return bo(t,wo),t}var xo={document:wo,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState:function(){},pushState:function(){},go:function(){},back:function(){}},CustomEvent:function(){return this},addEventListener:function(){},removeEventListener:function(){},getComputedStyle:function(){return{getPropertyValue:function(){return""}}},Image:function(){},Date:function(){},screen:{},setTimeout:function(){},clearTimeout:function(){},matchMedia:function(){return{}},requestAnimationFrame:function(t){return"undefined"==typeof setTimeout?(t(),null):setTimeout(t,0)},cancelAnimationFrame:function(t){"undefined"!=typeof setTimeout&&clearTimeout(t)}};function Eo(){var t="undefined"!=typeof window?window:{};return bo(t,xo),t}function So(t){return So=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},So(t)}function jo(t,n){return jo=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t},jo(t,n)}function To(t,n,r){return To=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct:function(t,n,r){var e=[null];e.push.apply(e,n);var o=new(Function.bind.apply(t,e));return r&&jo(o,r.prototype),o},To.apply(null,arguments)}function Lo(t){var n="function"==typeof Map?new Map:void 0;return Lo=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return To(t,arguments,So(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),jo(e,t)},Lo(t)}var Po=function(t){var n,r;function e(n){var r,e,o;return r=t.call.apply(t,[this].concat(n))||this,e=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(r),o=e.__proto__,Object.defineProperty(e,"__proto__",{get:function(){return o},set:function(t){o.__proto__=t}}),r}return r=t,(n=e).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,e}(Lo(Array));function Io(t,n){var r=Eo(),e=Oo(),o=[];if(!n&&t instanceof Po)return t;if(!t)return new Po(o);if("string"==typeof t){var i=t.trim();if(i.indexOf("<")>=0&&i.indexOf(">")>=0){var u="div";0===i.indexOf("<li")&&(u="ul"),0===i.indexOf("<tr")&&(u="tbody"),0!==i.indexOf("<td")&&0!==i.indexOf("<th")||(u="tr"),0===i.indexOf("<tbody")&&(u="table"),0===i.indexOf("<option")&&(u="select");var c=e.createElement(u);c.innerHTML=i;for(var f=0;f<c.childNodes.length;f+=1)o.push(c.childNodes[f])}else o=function(t,n){if("string"!=typeof t)return[t];for(var r=[],e=n.querySelectorAll(t),o=0;o<e.length;o+=1)r.push(e[o]);return r}(t.trim(),n||e)}else if(t.nodeType||t===r||t===e)o.push(t);else if(Array.isArray(t)){if(t instanceof Po)return t;o=t}return new Po(function(t){for(var n=[],r=0;r<t.length;r+=1)-1===n.indexOf(t[r])&&n.push(t[r]);return n}(o))}function _o(t){if(void 0===t){var n=this[0];if(!n)return;if(n.multiple&&"select"===n.nodeName.toLowerCase()){for(var r=[],e=0;e<n.selectedOptions.length;e+=1)r.push(n.selectedOptions[e].value);return r}return n.value}for(var o=0;o<this.length;o+=1){var i=this[o];if(Array.isArray(t)&&i.multiple&&"select"===i.nodeName.toLowerCase())for(var u=0;u<i.options.length;u+=1)i.options[u].selected=t.indexOf(i.options[u].value)>=0;else i.value=t}return this}function Ao(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var e=n[0],o=n[1],i=n[2],u=n[3];function c(t){var n=t.target;if(n){var r=t.target.dom7EventData||[];if(r.indexOf(t)<0&&r.unshift(t),Io(n).is(o))i.apply(n,r);else for(var e=Io(n).parents(),u=0;u<e.length;u+=1)Io(e[u]).is(o)&&i.apply(e[u],r)}}function f(t){var n=t&&t.target&&t.target.dom7EventData||[];n.indexOf(t)<0&&n.unshift(t),i.apply(this,n)}"function"==typeof n[1]&&(e=n[0],i=n[1],u=n[2],o=void 0),u||(u=!1);for(var a,l=e.split(" "),s=0;s<this.length;s+=1){var p=this[s];if(o)for(a=0;a<l.length;a+=1){var v=l[a];p.dom7LiveListeners||(p.dom7LiveListeners={}),p.dom7LiveListeners[v]||(p.dom7LiveListeners[v]=[]),p.dom7LiveListeners[v].push({listener:i,proxyListener:c}),p.addEventListener(v,c,u)}else for(a=0;a<l.length;a+=1){var d=l[a];p.dom7Listeners||(p.dom7Listeners={}),p.dom7Listeners[d]||(p.dom7Listeners[d]=[]),p.dom7Listeners[d].push({listener:i,proxyListener:f}),p.addEventListener(d,f,u)}}return this}function Mo(t){if(void 0===t)return this[0]?this[0].innerHTML:null;for(var n=0;n<this.length;n+=1)this[n].innerHTML=t;return this}function Co(t){var n,r,e=Eo(),o=Oo(),i=this[0];if(!i||void 0===t)return!1;if("string"==typeof t){if(i.matches)return i.matches(t);if(i.webkitMatchesSelector)return i.webkitMatchesSelector(t);if(i.msMatchesSelector)return i.msMatchesSelector(t);for(n=Io(t),r=0;r<n.length;r+=1)if(n[r]===i)return!0;return!1}if(t===o)return i===o;if(t===e)return i===e;if(t.nodeType||t instanceof Po){for(n=t.nodeType?[t]:t,r=0;r<n.length;r+=1)if(n[r]===i)return!0;return!1}return!1}function Ro(){for(var t,n=Oo(),r=0;r<arguments.length;r+=1){t=r<0||arguments.length<=r?void 0:arguments[r];for(var e=0;e<this.length;e+=1)if("string"==typeof t){var o=n.createElement("div");for(o.innerHTML=t;o.firstChild;)this[e].appendChild(o.firstChild)}else if(t instanceof Po)for(var i=0;i<t.length;i+=1)this[e].appendChild(t[i]);else this[e].appendChild(t)}return this}function ko(t){for(var n=[],r=0;r<this.length;r+=1)for(var e=this[r].parentNode;e;)t?Io(e).is(t)&&n.push(e):n.push(e),e=e.parentNode;return Io(n)}function No(t){for(var n=[],r=0;r<this.length;r+=1)for(var e=this[r].querySelectorAll(t),o=0;o<e.length;o+=1)n.push(e[o]);return Io(n)}Io.fn=Po.prototype;var Fo="resize scroll".split(" ");var Do,Ho=(Do="focus",function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(void 0===n[0]){for(var e=0;e<this.length;e+=1)Fo.indexOf(Do)<0&&(Do in this[e]?this[e][Do]():Io(this[e]).trigger(Do));return this}return this.on.apply(this,[Do].concat(n))});Ro&&(Io.fn.append=Ro),Mo&&(Io.fn.html=Mo),_o&&(Io.fn.val=_o),Ao&&(Io.fn.on=Ao),Ho&&(Io.fn.focus=Ho),Co&&(Io.fn.is=Co),ko&&(Io.fn.parents=ko),No&&(Io.fn.find=No);var zo,$o,Bo,Vo,Uo,Wo,qo,Go={};function Ko(){if($o)return zo;$o=1;var t=TypeError;return zo=function(n){if(n>9007199254740991)throw t("Maximum allowed index exceeded");return n}}function Xo(){if(Vo)return Bo;Vo=1;var t=Qt(),n=dn(),r=Un();return Bo=function(e,o,i){t?n.f(e,o,r(0,i)):e[o]=i}}function Yo(){if(Wo)return Uo;Wo=1;var t=ot(),n=ht(),r=pt(),e=n("species");return Uo=function(n){return r>=51||!t((function(){var t=[];return(t.constructor={})[e]=function(){return{foo:1}},1!==t[n](Boolean).foo}))}}!function(){if(qo)return Go;qo=1;var t=ee(),n=ot(),r=De(),e=Zt(),o=at(),i=Mr(),u=Ko(),c=Xo(),f=ze(),a=Yo(),l=ht(),s=pt(),p=l("isConcatSpreadable"),v=s>=51||!n((function(){var t=[];return t[p]=!1,t.concat()[0]!==t})),d=function(t){if(!e(t))return!1;var n=t[p];return void 0!==n?!!n:r(t)};t({target:"Array",proto:!0,arity:1,forced:!v||!a("concat")},{concat:function(t){var n,r,e,a,l,s=o(this),p=f(s,0),v=0;for(n=-1,e=arguments.length;n<e;n++)if(d(l=-1===n?s:arguments[n]))for(a=i(l),u(v+a),r=0;r<a;r++,v++)r in l&&c(p,v,l[r]);else u(v+1),c(p,v++,l);return p.length=v,p}})}();let Jo=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce(((t,n)=>t+=(n&=63)<36?n.toString(36):n<62?(n-26).toString(36).toUpperCase():n>62?"-":"_"),"");function Qo(t){return"".concat(t,"-").concat(Jo())}function Zo(){return Qo("w-e-insert-formula")}var ti=function(){function t(){this.title=e("formula.edit"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M864 0a160 160 0 0 1 128 256l-64 64-224-224 64-64c26.752-20.096 59.968-32 96-32zM64 736l-64 288 288-64 592-592-224-224L64 736z m651.584-372.416l-448 448-55.168-55.168 448-448 55.168 55.168z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.textareaId=Zo(),this.buttonId=Zo()}return t.prototype.getSelectedElem=function(t){var n=o.getSelectedNodeByType(t,"formula");return null==n?null:n},t.prototype.getValue=function(t){var n=this.getSelectedElem(t);return n&&n.value||""},t.prototype.isActive=function(t){return!1},t.prototype.exec=function(t,n){},t.prototype.isDisabled=function(t){var n=t.selection;return null==n||(!!i.isExpanded(n)||null==this.getSelectedElem(t))},t.prototype.getModalPositionNode=function(t){return this.getSelectedElem(t)},t.prototype.getModalContentElem=function(t){var n=this,r=this.textareaId,o=this.buttonId,i=s(u(e("formula.formula"),r,e("formula.placeholder")),2),f=i[0],a=Io(i[1]),l=s(c(o,e("formula.ok")),1)[0];if(null==this.$content){var p=Io("<div></div>");p.on("click","#".concat(o),(function(e){e.preventDefault();var o=p.find("#".concat(r)).val().trim();n.updateFormula(t,o),t.hidePanelOrModal()})),this.$content=p}var v=this.$content;v.html(""),v.append(f),v.append(l);var d=this.getValue(t);return a.val(d),setTimeout((function(){a.focus()})),v[0]},t.prototype.updateFormula=function(t,n){if(n&&(t.restoreSelection(),!this.isDisabled(t))){var r=this.getSelectedElem(t);if(null!=r){var e=o.findPath(t,r),i={value:n};f.setNodes(t,i,{at:e})}}},t}();function ni(){return Qo("w-e-insert-formula")}var ri=function(){function t(){this.title=e("formula.insert"),this.iconSvg='<svg viewBox="0 0 1024 1024"><path d="M941.6 734.72L985.984 640H1024l-64 384H0v-74.24l331.552-391.2L0 227.008V0h980L1024 256h-34.368l-18.72-38.88C935.584 143.744 909.024 128 832 128H169.984l353.056 353.056L225.632 832H768c116 0 146.656-41.568 173.6-97.28z"></path></svg>',this.tag="button",this.showModal=!0,this.modalWidth=300,this.$content=null,this.textareaId=ni(),this.buttonId=ni()}return t.prototype.getValue=function(t){return""},t.prototype.isActive=function(t){return!1},t.prototype.exec=function(t,n){},t.prototype.isDisabled=function(t){var n=t.selection;if(null==n)return!0;if(i.isExpanded(n))return!0;var r=o.getSelectedElems(t);return!!r.some((function(n){return t.isVoid(n)}))||!!r.some((function(t){return"pre"===o.getNodeType(t)}))},t.prototype.getModalPositionNode=function(t){return null},t.prototype.getModalContentElem=function(t){var n=this,r=this.textareaId,o=this.buttonId,i=s(u(e("formula.formula"),r,e("formula.placeholder")),2),f=i[0],a=Io(i[1]),l=s(c(o,e("formula.ok")),1)[0];if(null==this.$content){var p=Io("<div></div>");p.on("click","#".concat(o),(function(e){e.preventDefault();var o=p.find("#".concat(r)).val().trim();n.insertFormula(t,o),t.hidePanelOrModal()})),this.$content=p}var v=this.$content;return v.html(""),v.append(f),v.append(l),a.val(""),setTimeout((function(){a.focus()})),v[0]},t.prototype.insertFormula=function(t,n){if(n&&(t.restoreSelection(),!this.isDisabled(t))){var r={type:"formula",value:n,children:[{text:""}]};t.insertNode(r)}},t}();var ei={editorPlugin:function(t){var n=t.isInline,r=t.isVoid,e=t;return e.isInline=function(t){return"formula"===o.getNodeType(t)||n(t)},e.isVoid=function(t){return"formula"===o.getNodeType(t)||r(t)},e},renderElems:[{type:"formula",renderElem:function(t,n,r){var e=o.isNodeSelected(r,t),i=t.value,u=a("w-e-formula-card",{dataset:{value:void 0===i?"":i}},null);return a("div",{props:{contentEditable:!1},style:{display:"inline-block",marginLeft:"3px",marginRight:"3px",border:e?"2px solid var(--w-e-textarea-selected-border-color)":"2px solid transparent",borderRadius:"3px",padding:"3px 3px"}},[u])}}],elemsToHtml:[ke],parseElemsHtml:[{selector:'span[data-w-e-type="formula"]',parseElemHtml:function(t,n,r){return{type:"formula",value:t.getAttribute("data-value")||"",children:[{text:""}]}}}],menus:[{key:"insertFormula",factory:function(){return new ri}},{key:"editFormula",factory:function(){return new ti}}]};export{ei as default};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|