@wangeditor-next/plugin-formula 1.0.29 → 1.0.31

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.
@@ -25,6 +25,8 @@ export type AlertType = 'success' | 'info' | 'warning' | 'error';
25
25
  * @property {string} SCROLL - 编辑器滚动时触发,用于同步滚动状态或执行相关操作。
26
26
  * @property {string} FULLSCREEN - 编辑器进入全屏时触发,通常用于调整布局或容器尺寸。
27
27
  * @property {string} UNFULLSCREEN - 编辑器退出全屏时触发,恢复原始布局状态。
28
+ * @property {string} MODALORPANELSHOW - 弹窗或面板显示时触发,用于执行相关操作。
29
+ * @property {string} MODALORPANELHIDE - 弹窗或面板隐藏时触发,用于执行相关操作。
28
30
  */
29
31
  export declare const EditorEvents: {
30
32
  readonly CREATED: "created";
@@ -33,6 +35,8 @@ export declare const EditorEvents: {
33
35
  readonly SCROLL: "scroll";
34
36
  readonly FULLSCREEN: "fullscreen";
35
37
  readonly UNFULLSCREEN: "unFullScreen";
38
+ readonly MODALORPANELSHOW: "modalOrPanelShow";
39
+ readonly MODALORPANELHIDE: "modalOrPanelHide";
36
40
  };
37
41
  export type EditorEventType = typeof EditorEvents[keyof typeof EditorEvents];
38
42
  export interface ISingleMenuConfig {
@@ -201,15 +205,17 @@ export interface IEditorConfig {
201
205
  EXTEND_CONF?: any;
202
206
  skipCacheTypes?: string[];
203
207
  }
208
+ export interface IInsertKeysConfig {
209
+ index: number;
210
+ keys: string | Array<string | IMenuGroup>;
211
+ replaceFn?: (config: string | IMenuGroup) => string | IMenuGroup;
212
+ }
204
213
  /**
205
214
  * toolbar config
206
215
  */
207
216
  export interface IToolbarConfig {
208
217
  toolbarKeys: Array<string | IMenuGroup>;
209
- insertKeys: {
210
- index: number;
211
- keys: string | Array<string | IMenuGroup>;
212
- };
218
+ insertKeys: IInsertKeysConfig | Array<IInsertKeysConfig>;
213
219
  excludeKeys: Array<string>;
214
220
  modalAppendToBody: boolean;
215
221
  }
@@ -6,7 +6,6 @@ import { Descendant, Element as SlateElement } from 'slate';
6
6
  import { IDomEditor } from '../editor/interface';
7
7
  import { DOMElement } from '../utils/dom';
8
8
  export declare const TEXT_TAGS: string[];
9
- export declare const SPAN_WITH_SPECIAL_TAGS: string[];
10
9
  export type PreParseHtmlFnType = ($node: DOMElement) => DOMElement;
11
10
  export interface IPreParseHtmlConf {
12
11
  selector: string;
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("katex"),require("@wangeditor-next/editor"),require("snabbdom")):"function"==typeof define&&define.amd?define(["katex","@wangeditor-next/editor","snabbdom"],n):(t="undefined"!=typeof globalThis?globalThis:t||self).WangEditorFormulaPlugin=n(t.katex,t.editor,t.snabbdom)}(this,function(t,n,e){"use strict";var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},r(t,n)};function o(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,i=e.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return u}"function"==typeof SuppressedError&&SuppressedError;var i,u,c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},a={};function f(){if(u)return i;u=1;var t=function(t){return t&&t.Math===Math&&t};return i=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof c&&c)||t("object"==typeof i&&i)||function(){return this}()||Function("return this")()}var l,s,p,d,v,h,m,y,g,b,w,E,x,S,O,j,T,L,I,M,A,P,C,R,k,N,_,F,D,H,z,$,B,V,q,W,U,G={exports:{}};function K(){if(d)return p;d=1;var t=f(),n=Object.defineProperty;return p=function(e,r){try{n(t,e,{value:r,configurable:!0,writable:!0})}catch(n){t[e]=r}return r}}function X(){if(v)return G.exports;v=1;var t=s?l:(s=1,l=!1),n=f(),e=K(),r="__core-js_shared__",o=G.exports=n[r]||e(r,{});return(o.versions||(o.versions=[])).push({version:"3.45.0",mode:t?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.45.0/LICENSE",source:"https://github.com/zloirock/core-js"}),G.exports}function Y(){if(m)return h;m=1;var t=X();return h=function(n,e){return t[n]||(t[n]=e||{})}}function J(){return g?y:(g=1,y=function(t){try{return!!t()}catch(t){return!0}})}function Q(){if(w)return b;w=1;var t=J();return b=!t(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})}function Z(){if(x)return E;x=1;var t=Q(),n=Function.prototype,e=n.call,r=t&&n.bind.bind(e,e);return E=t?r:function(t){return function(){return e.apply(t,arguments)}},E}function tt(){return O?S:(O=1,S=function(t){return null==t})}function nt(){if(T)return j;T=1;var t=tt(),n=TypeError;return j=function(e){if(t(e))throw new n("Can't call method on "+e);return e}}function et(){if(I)return L;I=1;var t=nt(),n=Object;return L=function(e){return n(t(e))}}function rt(){if(A)return M;A=1;var t=Z(),n=et(),e=t({}.hasOwnProperty);return M=Object.hasOwn||function(t,r){return e(n(t),r)}}function ot(){if(C)return P;C=1;var t=Z(),n=0,e=Math.random(),r=t(1.1.toString);return P=function(t){return"Symbol("+(void 0===t?"":t)+")_"+r(++n+e,36)}}function it(){if(_)return N;_=1;var t,n,e=f(),r=function(){if(k)return R;k=1;var t=f().navigator,n=t&&t.userAgent;return R=n?String(n):""}(),o=e.process,i=e.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&&r&&(!(t=r.match(/Edge\/(\d+)/))||t[1]>=74)&&(t=r.match(/Chrome\/(\d+)/))&&(n=+t[1]),N=n}function ut(){if(D)return F;D=1;var t=it(),n=J(),e=f().String;return F=!!Object.getOwnPropertySymbols&&!n(function(){var n=Symbol("symbol detection");return!e(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&t&&t<41})}function ct(){if(z)return H;z=1;var t=ut();return H=t&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function at(){if(B)return $;B=1;var t=f(),n=Y(),e=rt(),r=ot(),o=ut(),i=ct(),u=t.Symbol,c=n("wks"),a=i?u.for||u:u&&u.withoutSetter||r;return $=function(t){return e(c,t)||(c[t]=o&&e(u,t)?u[t]:a("Symbol."+t)),c[t]}}function ft(){if(q)return V;q=1;var t={};return t[at()("toStringTag")]="z",V="[object z]"===String(t)}function lt(){if(U)return W;U=1;var t="object"==typeof document&&document.all;return W=void 0===t&&void 0!==t?function(n){return"function"==typeof n||n===t}:function(t){return"function"==typeof t}}var st,pt,dt,vt,ht,mt,yt,gt,bt,wt,Et,xt,St,Ot,jt,Tt,Lt,It,Mt,At,Pt,Ct,Rt,kt,Nt,_t,Ft,Dt,Ht,zt,$t,Bt,Vt,qt={};function Wt(){if(pt)return st;pt=1;var t=J();return st=!t(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}function Ut(){if(vt)return dt;vt=1;var t=lt();return dt=function(n){return"object"==typeof n?null!==n:t(n)}}function Gt(){if(mt)return ht;mt=1;var t=f(),n=Ut(),e=t.document,r=n(e)&&n(e.createElement);return ht=function(t){return r?e.createElement(t):{}}}function Kt(){if(gt)return yt;gt=1;var t=Wt(),n=J(),e=Gt();return yt=!t&&!n(function(){return 7!==Object.defineProperty(e("div"),"a",{get:function(){return 7}}).a})}function Xt(){if(wt)return bt;wt=1;var t=Wt(),n=J();return bt=t&&n(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}function Yt(){if(xt)return Et;xt=1;var t=Ut(),n=String,e=TypeError;return Et=function(r){if(t(r))return r;throw new e(n(r)+" is not an object")}}function Jt(){if(Ot)return St;Ot=1;var t=Q(),n=Function.prototype.call;return St=t?n.bind(n):function(){return n.apply(n,arguments)},St}function Qt(){if(Tt)return jt;Tt=1;var t=f(),n=lt();return jt=function(e,r){return arguments.length<2?(o=t[e],n(o)?o:void 0):t[e]&&t[e][r];var o},jt}function Zt(){if(At)return Mt;At=1;var t=Qt(),n=lt(),e=function(){if(It)return Lt;It=1;var t=Z();return Lt=t({}.isPrototypeOf)}(),r=ct(),o=Object;return Mt=r?function(t){return"symbol"==typeof t}:function(r){var i=t("Symbol");return n(i)&&e(i.prototype,o(r))}}function tn(){if(Ct)return Pt;Ct=1;var t=String;return Pt=function(n){try{return t(n)}catch(t){return"Object"}}}function nn(){if(kt)return Rt;kt=1;var t=lt(),n=tn(),e=TypeError;return Rt=function(r){if(t(r))return r;throw new e(n(r)+" is not a function")}}function en(){if(_t)return Nt;_t=1;var t=nn(),n=tt();return Nt=function(e,r){var o=e[r];return n(o)?void 0:t(o)}}function rn(){if(Dt)return Ft;Dt=1;var t=Jt(),n=lt(),e=Ut(),r=TypeError;return Ft=function(o,i){var u,c;if("string"===i&&n(u=o.toString)&&!e(c=t(u,o)))return c;if(n(u=o.valueOf)&&!e(c=t(u,o)))return c;if("string"!==i&&n(u=o.toString)&&!e(c=t(u,o)))return c;throw new r("Can't convert object to primitive value")},Ft}function on(){if(zt)return Ht;zt=1;var t=Jt(),n=Ut(),e=Zt(),r=en(),o=rn(),i=at(),u=TypeError,c=i("toPrimitive");return Ht=function(i,a){if(!n(i)||e(i))return i;var f,l=r(i,c);if(l){if(void 0===a&&(a="default"),f=t(l,i,a),!n(f)||e(f))return f;throw new u("Can't convert object to primitive value")}return void 0===a&&(a="number"),o(i,a)}}function un(){if(Bt)return $t;Bt=1;var t=on(),n=Zt();return $t=function(e){var r=t(e,"string");return n(r)?r:r+""}}function cn(){if(Vt)return qt;Vt=1;var t=Wt(),n=Kt(),e=Xt(),r=Yt(),o=un(),i=TypeError,u=Object.defineProperty,c=Object.getOwnPropertyDescriptor,a="enumerable",f="configurable",l="writable";return qt.f=t?e?function(t,n,e){if(r(t),n=o(n),r(e),"function"==typeof t&&"prototype"===n&&"value"in e&&l in e&&!e[l]){var i=c(t,n);i&&i[l]&&(t[n]=e.value,e={configurable:f in e?e[f]:i[f],enumerable:a in e?e[a]:i[a],writable:!1})}return u(t,n,e)}:u:function(t,e,c){if(r(t),e=o(e),r(c),n)try{return u(t,e,c)}catch(t){}if("get"in c||"set"in c)throw new i("Accessors not supported");return"value"in c&&(t[e]=c.value),t},qt}var an,fn,ln,sn,pn,dn,vn,hn,mn,yn,gn,bn,wn,En,xn,Sn,On,jn,Tn,Ln,In,Mn,An,Pn,Cn,Rn,kn={exports:{}};function Nn(){if(fn)return an;fn=1;var t=Wt(),n=rt(),e=Function.prototype,r=t&&Object.getOwnPropertyDescriptor,o=n(e,"name"),i=o&&"something"===function(){}.name,u=o&&(!t||t&&r(e,"name").configurable);return an={EXISTS:o,PROPER:i,CONFIGURABLE:u}}function _n(){if(sn)return ln;sn=1;var t=Z(),n=lt(),e=X(),r=t(Function.toString);return n(e.inspectSource)||(e.inspectSource=function(t){return r(t)}),ln=e.inspectSource}function Fn(){return hn?vn:(hn=1,vn=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}})}function Dn(){if(yn)return mn;yn=1;var t=Wt(),n=cn(),e=Fn();return mn=t?function(t,r,o){return n.f(t,r,e(1,o))}:function(t,n,e){return t[n]=e,t}}function Hn(){if(bn)return gn;bn=1;var t=Y(),n=ot(),e=t("keys");return gn=function(t){return e[t]||(e[t]=n(t))}}function zn(){return En?wn:(En=1,wn={})}function $n(){if(Sn)return xn;Sn=1;var t,n,e,r=function(){if(dn)return pn;dn=1;var t=f(),n=lt(),e=t.WeakMap;return pn=n(e)&&/native code/.test(String(e))}(),o=f(),i=Ut(),u=Dn(),c=rt(),a=X(),l=Hn(),s=zn(),p="Object already initialized",d=o.TypeError,v=o.WeakMap;if(r||a.state){var h=a.state||(a.state=new v);h.get=h.get,h.has=h.has,h.set=h.set,t=function(t,n){if(h.has(t))throw new d(p);return n.facade=t,h.set(t,n),n},n=function(t){return h.get(t)||{}},e=function(t){return h.has(t)}}else{var m=l("state");s[m]=!0,t=function(t,n){if(c(t,m))throw new d(p);return n.facade=t,u(t,m,n),n},n=function(t){return c(t,m)?t[m]:{}},e=function(t){return c(t,m)}}return xn={set:t,get:n,has:e,enforce:function(r){return e(r)?n(r):t(r,{})},getterFor:function(t){return function(e){var r;if(!i(e)||(r=n(e)).type!==t)throw new d("Incompatible receiver, "+t+" required");return r}}}}function Bn(){if(On)return kn.exports;On=1;var t=Z(),n=J(),e=lt(),r=rt(),o=Wt(),i=Nn().CONFIGURABLE,u=_n(),c=$n(),a=c.enforce,f=c.get,l=String,s=Object.defineProperty,p=t("".slice),d=t("".replace),v=t([].join),h=o&&!n(function(){return 8!==s(function(){},"length",{value:8}).length}),m=String(String).split("String"),y=kn.exports=function(t,n,e){"Symbol("===p(l(n),0,7)&&(n="["+d(l(n),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),e&&e.getter&&(n="get "+n),e&&e.setter&&(n="set "+n),(!r(t,"name")||i&&t.name!==n)&&(o?s(t,"name",{value:n,configurable:!0}):t.name=n),h&&e&&r(e,"arity")&&t.length!==e.arity&&s(t,"length",{value:e.arity});try{e&&r(e,"constructor")&&e.constructor?o&&s(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var u=a(t);return r(u,"source")||(u.source=v(m,"string"==typeof n?n:"")),t};return Function.prototype.toString=y(function(){return e(this)&&f(this).source||u(this)},"toString"),kn.exports}function Vn(){if(Tn)return jn;Tn=1;var t=lt(),n=cn(),e=Bn(),r=K();return jn=function(o,i,u,c){c||(c={});var a=c.enumerable,f=void 0!==c.name?c.name:i;if(t(u)&&e(u,f,c),c.global)a?o[i]=u:r(i,u);else{try{c.unsafe?o[i]&&(a=!0):delete o[i]}catch(t){}a?o[i]=u:n.f(o,i,{value:u,enumerable:!1,configurable:!c.nonConfigurable,writable:!c.nonWritable})}return o}}function qn(){if(In)return Ln;In=1;var t=Z(),n=t({}.toString),e=t("".slice);return Ln=function(t){return e(n(t),8,-1)}}function Wn(){if(An)return Mn;An=1;var t=ft(),n=lt(),e=qn(),r=at()("toStringTag"),o=Object,i="Arguments"===e(function(){return arguments}());return Mn=t?e:function(t){var u,c,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(c=function(t,n){try{return t[n]}catch(t){}}(u=o(t),r))?c:i?e(u):"Object"===(a=e(u))&&n(u.callee)?"Arguments":a}}!function(){if(Rn)return a;Rn=1;var t=ft(),n=Vn(),e=function(){if(Cn)return Pn;Cn=1;var t=ft(),n=Wn();return Pn=t?{}.toString:function(){return"[object "+n(this)+"]"}}();t||n(Object.prototype,"toString",e,{unsafe:!0})}();var Un,Gn,Kn,Xn,Yn,Jn,Qn={},Zn={},te={};function ne(){if(Kn)return Gn;Kn=1;var t=Z(),n=J(),e=qn(),r=Object,o=t("".split);return Gn=n(function(){return!r("z").propertyIsEnumerable(0)})?function(t){return"String"===e(t)?o(t,""):r(t)}:r}function ee(){if(Yn)return Xn;Yn=1;var t=ne(),n=nt();return Xn=function(e){return t(n(e))}}function re(){if(Jn)return Zn;Jn=1;var t=Wt(),n=Jt(),e=function(){if(Un)return te;Un=1;var t={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,e=n&&!t.call({1:2},1);return te.f=e?function(t){var e=n(this,t);return!!e&&e.enumerable}:t,te}(),r=Fn(),o=ee(),i=un(),u=rt(),c=Kt(),a=Object.getOwnPropertyDescriptor;return Zn.f=t?a:function(t,f){if(t=o(t),f=i(f),c)try{return a(t,f)}catch(t){}if(u(t,f))return r(!n(e.f,t,f),t[f])},Zn}var oe,ie,ue,ce,ae,fe,le,se,pe,de,ve,he,me,ye,ge,be,we,Ee={};function xe(){if(ce)return ue;ce=1;var t=function(){if(ie)return oe;ie=1;var t=Math.ceil,n=Math.floor;return oe=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}}();return ue=function(n){var e=+n;return e!=e||0===e?0:t(e)}}function Se(){if(fe)return ae;fe=1;var t=xe(),n=Math.max,e=Math.min;return ae=function(r,o){var i=t(r);return i<0?n(i+o,0):e(i,o)}}function Oe(){if(se)return le;se=1;var t=xe(),n=Math.min;return le=function(e){var r=t(e);return r>0?n(r,9007199254740991):0}}function je(){if(de)return pe;de=1;var t=Oe();return pe=function(n){return t(n.length)}}function Te(){if(ye)return me;ye=1;var t=Z(),n=rt(),e=ee(),r=function(){if(he)return ve;he=1;var t=ee(),n=Se(),e=je(),r=function(r){return function(o,i,u){var c=t(o),a=e(c);if(0===a)return!r&&-1;var f,l=n(u,a);if(r&&i!=i){for(;a>l;)if((f=c[l++])!=f)return!0}else for(;a>l;l++)if((r||l in c)&&c[l]===i)return r||l||0;return!r&&-1}};return ve={includes:r(!0),indexOf:r(!1)}}().indexOf,o=zn(),i=t([].push);return me=function(t,u){var c,a=e(t),f=0,l=[];for(c in a)!n(o,c)&&n(a,c)&&i(l,c);for(;u.length>f;)n(a,c=u[f++])&&(~r(l,c)||i(l,c));return l}}function Le(){return be?ge:(be=1,ge=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var Ie,Me,Ae,Pe,Ce,Re,ke,Ne,_e,Fe,De,He,ze,$e,Be,Ve,qe,We,Ue,Ge={};function Ke(){if(Ae)return Me;Ae=1;var t=Qt(),n=Z(),e=function(){if(we)return Ee;we=1;var t=Te(),n=Le().concat("length","prototype");return Ee.f=Object.getOwnPropertyNames||function(e){return t(e,n)},Ee}(),r=(Ie||(Ie=1,Ge.f=Object.getOwnPropertySymbols),Ge),o=Yt(),i=n([].concat);return Me=t("Reflect","ownKeys")||function(t){var n=e.f(o(t)),u=r.f;return u?i(n,u(t)):n}}function Xe(){if(Ce)return Pe;Ce=1;var t=rt(),n=Ke(),e=re(),r=cn();return Pe=function(o,i,u){for(var c=n(i),a=r.f,f=e.f,l=0;l<c.length;l++){var s=c[l];t(o,s)||u&&t(u,s)||a(o,s,f(i,s))}}}function Ye(){if(_e)return Ne;_e=1;var t=f(),n=re().f,e=Dn(),r=Vn(),o=K(),i=Xe(),u=function(){if(ke)return Re;ke=1;var t=J(),n=lt(),e=/#|\.prototype\./,r=function(e,r){var a=i[o(e)];return a===c||a!==u&&(n(r)?t(r):!!r)},o=r.normalize=function(t){return String(t).replace(e,".").toLowerCase()},i=r.data={},u=r.NATIVE="N",c=r.POLYFILL="P";return Re=r}();return Ne=function(c,a){var f,l,s,p,d,v=c.target,h=c.global,m=c.stat;if(f=h?t:m?t[v]||o(v,{}):t[v]&&t[v].prototype)for(l in a){if(p=a[l],s=c.dontCallGetSet?(d=n(f,l))&&d.value:f[l],!u(h?l:v+(m?".":"#")+l,c.forced)&&void 0!==s){if(typeof p==typeof s)continue;i(p,s)}(c.sham||s&&s.sham)&&e(p,"sham",!0),r(f,l,p,c)}}}function Je(){if(ze)return He;ze=1;var t=Z();return He=t([].slice)}function Qe(){if(Be)return $e;Be=1;var t=Z(),n=nn(),e=Ut(),r=rt(),o=Je(),i=Q(),u=Function,c=t([].concat),a=t([].join),f={};return $e=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,e){if(!r(f,n)){for(var o=[],i=0;i<n;i++)o[i]="a["+i+"]";f[n]=u("C,a","return new C("+a(o,",")+")")}return f[n](t,e)}(i,n.length,n):i.apply(t,n)};return e(l)&&(p.prototype=l),p},$e}function Ze(){if(qe)return Ve;qe=1;var t=Z(),n=J(),e=lt(),r=Wn(),o=Qt(),i=_n(),u=function(){},c=o("Reflect","construct"),a=/^\s*(?:class|function)\b/,f=t(a.exec),l=!a.test(u),s=function(t){if(!e(t))return!1;try{return c(u,[],t),!0}catch(t){return!1}},p=function(t){if(!e(t))return!1;switch(r(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return l||!!f(a,i(t))}catch(t){return!0}};return p.sham=!0,Ve=!c||n(function(){var t;return s(s.call)||!s(Object)||!s(function(){t=!0})||t})?p:s}function tr(){if(Ue)return We;Ue=1;var t=Ze(),n=tn(),e=TypeError;return We=function(r){if(t(r))return r;throw new e(n(r)+" is not a constructor")}}var nr,er,rr,or,ir,ur,cr,ar,fr={};function lr(){if(er)return nr;er=1;var t=Te(),n=Le();return nr=Object.keys||function(e){return t(e,n)}}function sr(){if(cr)return ur;cr=1;var t,n=Yt(),e=function(){if(rr)return fr;rr=1;var t=Wt(),n=Xt(),e=cn(),r=Yt(),o=ee(),i=lr();return fr.f=t&&!n?Object.defineProperties:function(t,n){r(t);for(var u,c=o(n),a=i(n),f=a.length,l=0;f>l;)e.f(t,u=a[l++],c[u]);return t},fr}(),r=Le(),o=zn(),i=function(){if(ir)return or;ir=1;var t=Qt();return or=t("document","documentElement")}(),u=Gt(),c=Hn(),a="prototype",f="script",l=c("IE_PROTO"),s=function(){},p=function(t){return"<"+f+">"+t+"</"+f+">"},d=function(t){t.write(p("")),t.close();var n=t.parentWindow.Object;return t=null,n},v=function(){try{t=new ActiveXObject("htmlfile")}catch(t){}var n,e,o;v="undefined"!=typeof document?document.domain&&t?d(t):(e=u("iframe"),o="java"+f+":",e.style.display="none",i.appendChild(e),e.src=String(o),(n=e.contentWindow.document).open(),n.write(p("document.F=Object")),n.close(),n.F):d(t);for(var c=r.length;c--;)delete v[a][r[c]];return v()};return o[l]=!0,ur=Object.create||function(t,r){var o;return null!==t?(s[a]=n(t),o=new s,s[a]=null,o[l]=t):o=v(),void 0===r?o:e.f(o,r)}}!function(){if(ar)return Qn;ar=1;var t=Ye(),n=Qt(),e=function(){if(De)return Fe;De=1;var t=Q(),n=Function.prototype,e=n.apply,r=n.call;return Fe="object"==typeof Reflect&&Reflect.apply||(t?r.bind(e):function(){return r.apply(e,arguments)}),Fe}(),r=Qe(),o=tr(),i=Yt(),u=Ut(),c=sr(),a=J(),f=n("Reflect","construct"),l=Object.prototype,s=[].push,p=a(function(){function t(){}return!(f(function(){},[],t)instanceof t)}),d=!a(function(){f(function(){})}),v=p||d;t({target:"Reflect",stat:!0,forced:v,sham:v},{construct:function(t,n){o(t),i(n);var a=arguments.length<3?t:o(arguments[2]);if(d&&!p)return f(t,n,a);if(t===a){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 v=[null];return e(s,v,n),new(e(r,t,v))}var h=a.prototype,m=c(u(h)?h:l),y=e(t,m,n);return u(y)?y:m}})}(),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 pr=function(n){function e(){var t=n.call(this)||this,e=t.attachShadow({mode:"open"}),r=e.ownerDocument.createElement("span");return r.style.display="inline-block",e.appendChild(r),t.span=r,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 e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}(e,n),Object.defineProperty(e,"observedAttributes",{get:function(){return["data-value"]},enumerable:!1,configurable:!0}),e.prototype.attributeChangedCallback=function(t,n,e){if("data-value"===t){if(n===e)return;this.render(e||"")}},e.prototype.render=function(n){t.render(n,this.span,{throwOnError:!1,output:"mathml"})},e}(HTMLElement);window.customElements.get("w-e-formula-card")||window.customElements.define("w-e-formula-card",pr),n.i18nAddResources("en",{formula:{formula:"Formula",placeholder:"Use LateX syntax",insert:"Insert formula",edit:"Edit formula",ok:"OK"}}),n.i18nAddResources("zh-CN",{formula:{formula:"公式",placeholder:"使用 LateX 语法",insert:"插入公式",edit:"编辑公式",ok:"确定"}});var dr,vr,hr,mr,yr,gr,br,wr,Er,xr,Sr,Or,jr,Tr,Lr,Ir={type:"formula",elemToHtml:function(t,n){var e=t.value;return'<span data-w-e-type="formula" data-w-e-is-void data-w-e-is-inline data-value="'.concat(void 0===e?"":e,'"></span>')}},Mr={};function Ar(){if(mr)return hr;mr=1;var t=function(){if(vr)return dr;vr=1;var t=qn(),n=Z();return dr=function(e){if("Function"===t(e))return n(e)}}(),n=nn(),e=Q(),r=t(t.bind);return hr=function(t,o){return n(t),void 0===o?t:e?r(t,o):function(){return t.apply(o,arguments)}},hr}function Pr(){if(gr)return yr;gr=1;var t=qn();return yr=Array.isArray||function(n){return"Array"===t(n)}}function Cr(){if(wr)return br;wr=1;var t=Pr(),n=Ze(),e=Ut(),r=at()("species"),o=Array;return br=function(i){var u;return t(i)&&(u=i.constructor,(n(u)&&(u===o||t(u.prototype))||e(u)&&null===(u=u[r]))&&(u=void 0)),void 0===u?o:u}}function Rr(){if(xr)return Er;xr=1;var t=Cr();return Er=function(n,e){return new(t(n))(0===e?0:e)}}function kr(){if(Tr)return jr;Tr=1;var t=at(),n=sr(),e=cn().f,r=t("unscopables"),o=Array.prototype;return void 0===o[r]&&e(o,r,{configurable:!0,value:n(null)}),jr=function(t){o[r][t]=!0}}!function(){if(Lr)return Mr;Lr=1;var t=Ye(),n=function(){if(Or)return Sr;Or=1;var t=Ar(),n=Z(),e=ne(),r=et(),o=je(),i=Rr(),u=n([].push),c=function(n){var c=1===n,a=2===n,f=3===n,l=4===n,s=6===n,p=7===n,d=5===n||s;return function(v,h,m,y){for(var g,b,w=r(v),E=e(w),x=o(E),S=t(h,m),O=0,j=y||i,T=c?j(v,x):a||p?j(v,0):void 0;x>O;O++)if((d||O in E)&&(b=S(g=E[O],O,w),n))if(c)T[O]=b;else if(b)switch(n){case 3:return!0;case 5:return g;case 6:return O;case 2:u(T,g)}else switch(n){case 4:return!1;case 7:u(T,g)}return s?-1:f||l?l:T}};return Sr={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,e=kr(),r="find",o=!0;r in[]&&Array(1)[r](function(){o=!1}),t({target:"Array",proto:!0,forced:o},{find:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),e(r)}();var Nr,_r,Fr,Dr,Hr,zr,$r,Br,Vr,qr,Wr,Ur,Gr,Kr={};function Xr(){if(_r)return Nr;_r=1;var t=Wn(),n=String;return Nr=function(e){if("Symbol"===t(e))throw new TypeError("Cannot convert a Symbol value to a string");return n(e)}}function Yr(){if(Dr)return Fr;Dr=1;var t=Yt();return Fr=function(){var n=t(this),e="";return n.hasIndices&&(e+="d"),n.global&&(e+="g"),n.ignoreCase&&(e+="i"),n.multiline&&(e+="m"),n.dotAll&&(e+="s"),n.unicode&&(e+="u"),n.unicodeSets&&(e+="v"),n.sticky&&(e+="y"),e}}function Jr(){if(Ur)return Wr;Ur=1;var t,n,e=Jt(),r=Z(),o=Xr(),i=Yr(),u=function(){if(zr)return Hr;zr=1;var t=J(),n=f().RegExp,e=t(function(){var t=n("a","y");return t.lastIndex=2,null!==t.exec("abcd")}),r=e||t(function(){return!n("a","y").sticky}),o=e||t(function(){var t=n("^r","gy");return t.lastIndex=2,null!==t.exec("str")});return Hr={BROKEN_CARET:o,MISSED_STICKY:r,UNSUPPORTED_Y:e}}(),c=Y(),a=sr(),l=$n().get,s=function(){if(Br)return $r;Br=1;var t=J(),n=f().RegExp;return $r=t(function(){var t=n(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)})}(),p=function(){if(qr)return Vr;qr=1;var t=J(),n=f().RegExp;return Vr=t(function(){var t=n("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")})}(),d=c("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,h=v,m=r("".charAt),y=r("".indexOf),g=r("".replace),b=r("".slice),w=(n=/b*/g,e(v,t=/a/,"a"),e(v,n,"a"),0!==t.lastIndex||0!==n.lastIndex),E=u.BROKEN_CARET,x=void 0!==/()??/.exec("")[1];return(w||x||E||s||p)&&(h=function(t){var n,r,u,c,f,s,p,S=this,O=l(S),j=o(t),T=O.raw;if(T)return T.lastIndex=S.lastIndex,n=e(h,T,j),S.lastIndex=T.lastIndex,n;var L=O.groups,I=E&&S.sticky,M=e(i,S),A=S.source,P=0,C=j;if(I&&(M=g(M,"y",""),-1===y(M,"g")&&(M+="g"),C=b(j,S.lastIndex),S.lastIndex>0&&(!S.multiline||S.multiline&&"\n"!==m(j,S.lastIndex-1))&&(A="(?: "+A+")",C=" "+C,P++),r=new RegExp("^(?:"+A+")",M)),x&&(r=new RegExp("^"+A+"$(?!\\s)",M)),w&&(u=S.lastIndex),c=e(v,I?r:S,C),I?c?(c.input=b(c.input,P),c[0]=b(c[0],P),c.index=S.lastIndex,S.lastIndex+=c[0].length):S.lastIndex=0:w&&c&&(S.lastIndex=S.global?c.index+c[0].length:u),x&&c&&c.length>1&&e(d,c[0],r,function(){for(f=1;f<arguments.length-2;f++)void 0===arguments[f]&&(c[f]=void 0)}),c&&L)for(c.groups=s=a(null),f=0;f<L.length;f++)s[(p=L[f])[0]]=c[p[1]];return c}),Wr=h}!function(){if(Gr)return Kr;Gr=1;var t=Ye(),n=Jr();t({target:"RegExp",proto:!0,forced:/./.exec!==n},{exec:n})}();var Qr,Zr,to,no,eo,ro,oo,io={};function uo(){return Zr?Qr:(Zr=1,Qr="\t\n\v\f\r                 \u2028\u2029\ufeff")}!function(){if(oo)return io;oo=1;var t=Ye(),n=function(){if(no)return to;no=1;var t=Z(),n=nt(),e=Xr(),r=uo(),o=t("".replace),i=RegExp("^["+r+"]+"),u=RegExp("(^|[^"+r+"])["+r+"]+$"),c=function(t){return function(r){var c=e(n(r));return 1&t&&(c=o(c,i,"")),2&t&&(c=o(c,u,"$1")),c}};return to={start:c(1),end:c(2),trim:c(3)}}().trim,e=function(){if(ro)return eo;ro=1;var t=Nn().PROPER,n=J(),e=uo();return eo=function(r){return n(function(){return!!e[r]()||"​…᠎"!=="​…᠎"[r]()||t&&e[r].name!==r})}}();t({target:"String",proto:!0,forced:e("trim")},{trim:function(){return n(this)}})}();var co,ao,fo={};function lo(t){return null!==t&&"object"==typeof t&&"constructor"in t&&t.constructor===Object}function so(t={},n={}){Object.keys(n).forEach(e=>{void 0===t[e]?t[e]=n[e]:lo(n[e])&&lo(t[e])&&Object.keys(n[e]).length>0&&so(t[e],n[e])})}ao||(ao=1,function(){if(co)return fo;co=1;var t=Ye(),n=f();t({global:!0,forced:n.globalThis!==n},{globalThis:n})}());const po={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector:()=>null,querySelectorAll:()=>[],getElementById:()=>null,createEvent:()=>({initEvent(){}}),createElement:()=>({children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName:()=>[]}),createElementNS:()=>({}),importNode:()=>null,location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function vo(){const t="undefined"!=typeof document?document:{};return so(t,po),t}const ho={document:po,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle:()=>({getPropertyValue:()=>""}),Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia:()=>({}),requestAnimationFrame:t=>"undefined"==typeof setTimeout?(t(),null):setTimeout(t,0),cancelAnimationFrame(t){"undefined"!=typeof setTimeout&&clearTimeout(t)}};function mo(){const t="undefined"!=typeof window?window:{};return so(t,ho),t}class yo extends Array{constructor(t){"number"==typeof t?super(t):(super(...t||[]),function(t){const n=t.__proto__;Object.defineProperty(t,"__proto__",{get:()=>n,set(t){n.__proto__=t}})}(this))}}function go(t,n){const e=mo(),r=vo();let o=[];if(!n&&t instanceof yo)return t;if(!t)return new yo(o);if("string"==typeof t){const e=t.trim();if(e.indexOf("<")>=0&&e.indexOf(">")>=0){let t="div";0===e.indexOf("<li")&&(t="ul"),0===e.indexOf("<tr")&&(t="tbody"),0!==e.indexOf("<td")&&0!==e.indexOf("<th")||(t="tr"),0===e.indexOf("<tbody")&&(t="table"),0===e.indexOf("<option")&&(t="select");const n=r.createElement(t);n.innerHTML=e;for(let t=0;t<n.childNodes.length;t+=1)o.push(n.childNodes[t])}else o=function(t,n){if("string"!=typeof t)return[t];const e=[],r=n.querySelectorAll(t);for(let t=0;t<r.length;t+=1)e.push(r[t]);return e}(t.trim(),n||r)}else if(t.nodeType||t===e||t===r)o.push(t);else if(Array.isArray(t)){if(t instanceof yo)return t;o=t}return new yo(function(t){const n=[];for(let e=0;e<t.length;e+=1)-1===n.indexOf(t[e])&&n.push(t[e]);return n}(o))}function bo(t){if(void 0===t){const t=this[0];if(!t)return;if(t.multiple&&"select"===t.nodeName.toLowerCase()){const n=[];for(let e=0;e<t.selectedOptions.length;e+=1)n.push(t.selectedOptions[e].value);return n}return t.value}for(let n=0;n<this.length;n+=1){const e=this[n];if(Array.isArray(t)&&e.multiple&&"select"===e.nodeName.toLowerCase())for(let n=0;n<e.options.length;n+=1)e.options[n].selected=t.indexOf(e.options[n].value)>=0;else e.value=t}return this}function wo(...t){let[n,e,r,o]=t;function i(t){const n=t.target;if(!n)return;const o=t.target.dom7EventData||[];if(o.indexOf(t)<0&&o.unshift(t),go(n).is(e))r.apply(n,o);else{const t=go(n).parents();for(let n=0;n<t.length;n+=1)go(t[n]).is(e)&&r.apply(t[n],o)}}function u(t){const n=t&&t.target&&t.target.dom7EventData||[];n.indexOf(t)<0&&n.unshift(t),r.apply(this,n)}"function"==typeof t[1]&&([n,r,o]=t,e=void 0),o||(o=!1);const c=n.split(" ");let a;for(let t=0;t<this.length;t+=1){const n=this[t];if(e)for(a=0;a<c.length;a+=1){const t=c[a];n.dom7LiveListeners||(n.dom7LiveListeners={}),n.dom7LiveListeners[t]||(n.dom7LiveListeners[t]=[]),n.dom7LiveListeners[t].push({listener:r,proxyListener:i}),n.addEventListener(t,i,o)}else for(a=0;a<c.length;a+=1){const t=c[a];n.dom7Listeners||(n.dom7Listeners={}),n.dom7Listeners[t]||(n.dom7Listeners[t]=[]),n.dom7Listeners[t].push({listener:r,proxyListener:u}),n.addEventListener(t,u,o)}}return this}function Eo(t){if(void 0===t)return this[0]?this[0].innerHTML:null;for(let n=0;n<this.length;n+=1)this[n].innerHTML=t;return this}function xo(t){const n=mo(),e=vo(),r=this[0];let o,i;if(!r||void 0===t)return!1;if("string"==typeof t){if(r.matches)return r.matches(t);if(r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(r.msMatchesSelector)return r.msMatchesSelector(t);for(o=go(t),i=0;i<o.length;i+=1)if(o[i]===r)return!0;return!1}if(t===e)return r===e;if(t===n)return r===n;if(t.nodeType||t instanceof yo){for(o=t.nodeType?[t]:t,i=0;i<o.length;i+=1)if(o[i]===r)return!0;return!1}return!1}function So(...t){let n;const e=vo();for(let r=0;r<t.length;r+=1){n=t[r];for(let t=0;t<this.length;t+=1)if("string"==typeof n){const r=e.createElement("div");for(r.innerHTML=n;r.firstChild;)this[t].appendChild(r.firstChild)}else if(n instanceof yo)for(let e=0;e<n.length;e+=1)this[t].appendChild(n[e]);else this[t].appendChild(n)}return this}function Oo(t){const n=[];for(let e=0;e<this.length;e+=1){let r=this[e].parentNode;for(;r;)t?go(r).is(t)&&n.push(r):n.push(r),r=r.parentNode}return go(n)}function jo(t){const n=[];for(let e=0;e<this.length;e+=1){const r=this[e].querySelectorAll(t);for(let t=0;t<r.length;t+=1)n.push(r[t])}return go(n)}go.fn=yo.prototype;const To="resize scroll".split(" ");const Lo=(Io="focus",function(...t){if(void 0===t[0]){for(let t=0;t<this.length;t+=1)To.indexOf(Io)<0&&(Io in this[t]?this[t][Io]():go(this[t]).trigger(Io));return this}return this.on(Io,...t)});var Io;So&&(go.fn.append=So),Eo&&(go.fn.html=Eo),bo&&(go.fn.val=bo),wo&&(go.fn.on=wo),Lo&&(go.fn.focus=Lo),xo&&(go.fn.is=xo),Oo&&(go.fn.parents=Oo),jo&&(go.fn.find=jo);var Mo,Ao,Po,Co,Ro,ko,No,_o={};function Fo(){if(Ao)return Mo;Ao=1;var t=TypeError;return Mo=function(n){if(n>9007199254740991)throw t("Maximum allowed index exceeded");return n}}function Do(){if(Co)return Po;Co=1;var t=Wt(),n=cn(),e=Fn();return Po=function(r,o,i){t?n.f(r,o,e(0,i)):r[o]=i}}function Ho(){if(ko)return Ro;ko=1;var t=J(),n=at(),e=it(),r=n("species");return Ro=function(n){return e>=51||!t(function(){var t=[];return(t.constructor={})[r]=function(){return{foo:1}},1!==t[n](Boolean).foo})}}!function(){if(No)return _o;No=1;var t=Ye(),n=J(),e=Pr(),r=Ut(),o=et(),i=je(),u=Fo(),c=Do(),a=Rr(),f=Ho(),l=at(),s=it(),p=l("isConcatSpreadable"),d=s>=51||!n(function(){var t=[];return t[p]=!1,t.concat()[0]!==t}),v=function(t){if(!r(t))return!1;var n=t[p];return void 0!==n?!!n:e(t)};t({target:"Array",proto:!0,arity:1,forced:!d||!f("concat")},{concat:function(t){var n,e,r,f,l,s=o(this),p=a(s,0),d=0;for(n=-1,r=arguments.length;n<r;n++)if(v(l=-1===n?s:arguments[n]))for(f=i(l),u(d+f),e=0;e<f;e++,d++)e in l&&c(p,d,l[e]);else u(d+1),c(p,d++,l);return p.length=d,p}})}();function zo(t){return"".concat(t,"-").concat(((t=21)=>{let n="",e=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)n+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&e[t]];return n})())}function $o(){return zo("w-e-insert-formula")}var Bo=function(){function t(){this.title=n.t("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=$o(),this.buttonId=$o()}return t.prototype.getSelectedElem=function(t){var e=n.DomEditor.getSelectedNodeByType(t,"formula");return null==e?null:e},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 e=t.selection;return null==e||(!!n.SlateRange.isExpanded(e)||null==this.getSelectedElem(t))},t.prototype.getModalPositionNode=function(t){return this.getSelectedElem(t)},t.prototype.getModalContentElem=function(t){var e=this,r=this.textareaId,i=this.buttonId,u=o(n.genModalTextareaElems(n.t("formula.formula"),r,n.t("formula.placeholder")),2),c=u[0],a=go(u[1]),f=o(n.genModalButtonElems(i,n.t("formula.ok")),1)[0];if(null==this.$content){var l=go("<div></div>");l.on("click","#".concat(i),function(n){n.preventDefault();var o=l.find("#".concat(r)).val().trim();e.updateFormula(t,o),t.hidePanelOrModal()}),this.$content=l}var s=this.$content;s.html(""),s.append(c),s.append(f);var p=this.getValue(t);return a.val(p),setTimeout(function(){a.focus()}),s[0]},t.prototype.updateFormula=function(t,e){if(e&&(t.restoreSelection(),!this.isDisabled(t))){var r=this.getSelectedElem(t);if(null!=r){var o=n.DomEditor.findPath(t,r),i={value:e};n.SlateTransforms.setNodes(t,i,{at:o})}}},t}();function Vo(){return zo("w-e-insert-formula")}var qo=function(){function t(){this.title=n.t("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=Vo(),this.buttonId=Vo()}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 e=t.selection;if(null==e)return!0;if(n.SlateRange.isExpanded(e))return!0;var r=n.DomEditor.getSelectedElems(t);return!!r.some(function(n){return t.isVoid(n)})||!!r.some(function(t){return"pre"===n.DomEditor.getNodeType(t)})},t.prototype.getModalPositionNode=function(t){return null},t.prototype.getModalContentElem=function(t){var e=this,r=this.textareaId,i=this.buttonId,u=o(n.genModalTextareaElems(n.t("formula.formula"),r,n.t("formula.placeholder")),2),c=u[0],a=go(u[1]),f=o(n.genModalButtonElems(i,n.t("formula.ok")),1)[0];if(null==this.$content){var l=go("<div></div>");l.on("click","#".concat(i),function(n){n.preventDefault();var o=l.find("#".concat(r)).val().trim();e.insertFormula(t,o),t.hidePanelOrModal()}),this.$content=l}var s=this.$content;return s.html(""),s.append(c),s.append(f),a.val(""),setTimeout(function(){a.focus()}),s[0]},t.prototype.insertFormula=function(t,n){if(n&&(t.restoreSelection(),!this.isDisabled(t))){var e={type:"formula",value:n,children:[{text:""}]};t.insertNode(e)}},t}();return{editorPlugin:function(t){var e=t.isInline,r=t.isVoid,o=t;return o.isInline=function(t){return"formula"===n.DomEditor.getNodeType(t)||e(t)},o.isVoid=function(t){return"formula"===n.DomEditor.getNodeType(t)||r(t)},o},renderElems:[{type:"formula",renderElem:function(t,r,o){var i=n.DomEditor.isNodeSelected(o,t),u=t.value,c=void 0===u?"":u,a=e.h("w-e-formula-card",{dataset:{value:c}},null);return e.h("div",{className:"w-e-textarea-formula-container",props:{contentEditable:!1},style:{display:"inline-block",marginLeft:"3px",marginRight:"3px",border:i?"2px solid var(--w-e-textarea-selected-border-color)":"2px solid transparent",borderRadius:"3px",padding:"3px 3px"}},[a])}}],elemsToHtml:[Ir],parseElemsHtml:[{selector:'span[data-w-e-type="formula"]',parseElemHtml:function(t,n,e){return{type:"formula",value:t.getAttribute("data-value")||"",children:[{text:""}]}}}],menus:[{key:"insertFormula",factory:function(){return new qo}},{key:"editFormula",factory:function(){return new Bo}}]}});
1
+ !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("katex"),require("@wangeditor-next/editor"),require("snabbdom")):"function"==typeof define&&define.amd?define(["katex","@wangeditor-next/editor","snabbdom"],n):(t="undefined"!=typeof globalThis?globalThis:t||self).WangEditorFormulaPlugin=n(t.katex,t.editor,t.snabbdom)}(this,function(t,n,e){"use strict";var r=function(t,n){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])},r(t,n)};function o(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,i=e.call(t),u=[];try{for(;(void 0===n||n-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return u}"function"==typeof SuppressedError&&SuppressedError;var i,u,c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},a={};function f(){if(u)return i;u=1;var t=function(t){return t&&t.Math===Math&&t};return i=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof c&&c)||t("object"==typeof i&&i)||function(){return this}()||Function("return this")()}var l,s,p,d,v,h,m,y,g,b,w,E,x,S,O,j,T,L,I,M,A,P,C,R,k,N,_,F,D,H,z,$,B,V,q,W,U,G={exports:{}};function K(){if(d)return p;d=1;var t=f(),n=Object.defineProperty;return p=function(e,r){try{n(t,e,{value:r,configurable:!0,writable:!0})}catch(n){t[e]=r}return r}}function X(){if(v)return G.exports;v=1;var t=s?l:(s=1,l=!1),n=f(),e=K(),r="__core-js_shared__",o=G.exports=n[r]||e(r,{});return(o.versions||(o.versions=[])).push({version:"3.45.1",mode:t?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.45.1/LICENSE",source:"https://github.com/zloirock/core-js"}),G.exports}function Y(){if(m)return h;m=1;var t=X();return h=function(n,e){return t[n]||(t[n]=e||{})}}function J(){return g?y:(g=1,y=function(t){try{return!!t()}catch(t){return!0}})}function Q(){if(w)return b;w=1;var t=J();return b=!t(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})}function Z(){if(x)return E;x=1;var t=Q(),n=Function.prototype,e=n.call,r=t&&n.bind.bind(e,e);return E=t?r:function(t){return function(){return e.apply(t,arguments)}},E}function tt(){return O?S:(O=1,S=function(t){return null==t})}function nt(){if(T)return j;T=1;var t=tt(),n=TypeError;return j=function(e){if(t(e))throw new n("Can't call method on "+e);return e}}function et(){if(I)return L;I=1;var t=nt(),n=Object;return L=function(e){return n(t(e))}}function rt(){if(A)return M;A=1;var t=Z(),n=et(),e=t({}.hasOwnProperty);return M=Object.hasOwn||function(t,r){return e(n(t),r)}}function ot(){if(C)return P;C=1;var t=Z(),n=0,e=Math.random(),r=t(1.1.toString);return P=function(t){return"Symbol("+(void 0===t?"":t)+")_"+r(++n+e,36)}}function it(){if(_)return N;_=1;var t,n,e=f(),r=function(){if(k)return R;k=1;var t=f().navigator,n=t&&t.userAgent;return R=n?String(n):""}(),o=e.process,i=e.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&&r&&(!(t=r.match(/Edge\/(\d+)/))||t[1]>=74)&&(t=r.match(/Chrome\/(\d+)/))&&(n=+t[1]),N=n}function ut(){if(D)return F;D=1;var t=it(),n=J(),e=f().String;return F=!!Object.getOwnPropertySymbols&&!n(function(){var n=Symbol("symbol detection");return!e(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&t&&t<41})}function ct(){if(z)return H;z=1;var t=ut();return H=t&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function at(){if(B)return $;B=1;var t=f(),n=Y(),e=rt(),r=ot(),o=ut(),i=ct(),u=t.Symbol,c=n("wks"),a=i?u.for||u:u&&u.withoutSetter||r;return $=function(t){return e(c,t)||(c[t]=o&&e(u,t)?u[t]:a("Symbol."+t)),c[t]}}function ft(){if(q)return V;q=1;var t={};return t[at()("toStringTag")]="z",V="[object z]"===String(t)}function lt(){if(U)return W;U=1;var t="object"==typeof document&&document.all;return W=void 0===t&&void 0!==t?function(n){return"function"==typeof n||n===t}:function(t){return"function"==typeof t}}var st,pt,dt,vt,ht,mt,yt,gt,bt,wt,Et,xt,St,Ot,jt,Tt,Lt,It,Mt,At,Pt,Ct,Rt,kt,Nt,_t,Ft,Dt,Ht,zt,$t,Bt,Vt,qt={};function Wt(){if(pt)return st;pt=1;var t=J();return st=!t(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}function Ut(){if(vt)return dt;vt=1;var t=lt();return dt=function(n){return"object"==typeof n?null!==n:t(n)}}function Gt(){if(mt)return ht;mt=1;var t=f(),n=Ut(),e=t.document,r=n(e)&&n(e.createElement);return ht=function(t){return r?e.createElement(t):{}}}function Kt(){if(gt)return yt;gt=1;var t=Wt(),n=J(),e=Gt();return yt=!t&&!n(function(){return 7!==Object.defineProperty(e("div"),"a",{get:function(){return 7}}).a})}function Xt(){if(wt)return bt;wt=1;var t=Wt(),n=J();return bt=t&&n(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}function Yt(){if(xt)return Et;xt=1;var t=Ut(),n=String,e=TypeError;return Et=function(r){if(t(r))return r;throw new e(n(r)+" is not an object")}}function Jt(){if(Ot)return St;Ot=1;var t=Q(),n=Function.prototype.call;return St=t?n.bind(n):function(){return n.apply(n,arguments)},St}function Qt(){if(Tt)return jt;Tt=1;var t=f(),n=lt();return jt=function(e,r){return arguments.length<2?(o=t[e],n(o)?o:void 0):t[e]&&t[e][r];var o},jt}function Zt(){if(At)return Mt;At=1;var t=Qt(),n=lt(),e=function(){if(It)return Lt;It=1;var t=Z();return Lt=t({}.isPrototypeOf)}(),r=ct(),o=Object;return Mt=r?function(t){return"symbol"==typeof t}:function(r){var i=t("Symbol");return n(i)&&e(i.prototype,o(r))}}function tn(){if(Ct)return Pt;Ct=1;var t=String;return Pt=function(n){try{return t(n)}catch(t){return"Object"}}}function nn(){if(kt)return Rt;kt=1;var t=lt(),n=tn(),e=TypeError;return Rt=function(r){if(t(r))return r;throw new e(n(r)+" is not a function")}}function en(){if(_t)return Nt;_t=1;var t=nn(),n=tt();return Nt=function(e,r){var o=e[r];return n(o)?void 0:t(o)}}function rn(){if(Dt)return Ft;Dt=1;var t=Jt(),n=lt(),e=Ut(),r=TypeError;return Ft=function(o,i){var u,c;if("string"===i&&n(u=o.toString)&&!e(c=t(u,o)))return c;if(n(u=o.valueOf)&&!e(c=t(u,o)))return c;if("string"!==i&&n(u=o.toString)&&!e(c=t(u,o)))return c;throw new r("Can't convert object to primitive value")},Ft}function on(){if(zt)return Ht;zt=1;var t=Jt(),n=Ut(),e=Zt(),r=en(),o=rn(),i=at(),u=TypeError,c=i("toPrimitive");return Ht=function(i,a){if(!n(i)||e(i))return i;var f,l=r(i,c);if(l){if(void 0===a&&(a="default"),f=t(l,i,a),!n(f)||e(f))return f;throw new u("Can't convert object to primitive value")}return void 0===a&&(a="number"),o(i,a)}}function un(){if(Bt)return $t;Bt=1;var t=on(),n=Zt();return $t=function(e){var r=t(e,"string");return n(r)?r:r+""}}function cn(){if(Vt)return qt;Vt=1;var t=Wt(),n=Kt(),e=Xt(),r=Yt(),o=un(),i=TypeError,u=Object.defineProperty,c=Object.getOwnPropertyDescriptor,a="enumerable",f="configurable",l="writable";return qt.f=t?e?function(t,n,e){if(r(t),n=o(n),r(e),"function"==typeof t&&"prototype"===n&&"value"in e&&l in e&&!e[l]){var i=c(t,n);i&&i[l]&&(t[n]=e.value,e={configurable:f in e?e[f]:i[f],enumerable:a in e?e[a]:i[a],writable:!1})}return u(t,n,e)}:u:function(t,e,c){if(r(t),e=o(e),r(c),n)try{return u(t,e,c)}catch(t){}if("get"in c||"set"in c)throw new i("Accessors not supported");return"value"in c&&(t[e]=c.value),t},qt}var an,fn,ln,sn,pn,dn,vn,hn,mn,yn,gn,bn,wn,En,xn,Sn,On,jn,Tn,Ln,In,Mn,An,Pn,Cn,Rn,kn={exports:{}};function Nn(){if(fn)return an;fn=1;var t=Wt(),n=rt(),e=Function.prototype,r=t&&Object.getOwnPropertyDescriptor,o=n(e,"name"),i=o&&"something"===function(){}.name,u=o&&(!t||t&&r(e,"name").configurable);return an={EXISTS:o,PROPER:i,CONFIGURABLE:u}}function _n(){if(sn)return ln;sn=1;var t=Z(),n=lt(),e=X(),r=t(Function.toString);return n(e.inspectSource)||(e.inspectSource=function(t){return r(t)}),ln=e.inspectSource}function Fn(){return hn?vn:(hn=1,vn=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}})}function Dn(){if(yn)return mn;yn=1;var t=Wt(),n=cn(),e=Fn();return mn=t?function(t,r,o){return n.f(t,r,e(1,o))}:function(t,n,e){return t[n]=e,t}}function Hn(){if(bn)return gn;bn=1;var t=Y(),n=ot(),e=t("keys");return gn=function(t){return e[t]||(e[t]=n(t))}}function zn(){return En?wn:(En=1,wn={})}function $n(){if(Sn)return xn;Sn=1;var t,n,e,r=function(){if(dn)return pn;dn=1;var t=f(),n=lt(),e=t.WeakMap;return pn=n(e)&&/native code/.test(String(e))}(),o=f(),i=Ut(),u=Dn(),c=rt(),a=X(),l=Hn(),s=zn(),p="Object already initialized",d=o.TypeError,v=o.WeakMap;if(r||a.state){var h=a.state||(a.state=new v);h.get=h.get,h.has=h.has,h.set=h.set,t=function(t,n){if(h.has(t))throw new d(p);return n.facade=t,h.set(t,n),n},n=function(t){return h.get(t)||{}},e=function(t){return h.has(t)}}else{var m=l("state");s[m]=!0,t=function(t,n){if(c(t,m))throw new d(p);return n.facade=t,u(t,m,n),n},n=function(t){return c(t,m)?t[m]:{}},e=function(t){return c(t,m)}}return xn={set:t,get:n,has:e,enforce:function(r){return e(r)?n(r):t(r,{})},getterFor:function(t){return function(e){var r;if(!i(e)||(r=n(e)).type!==t)throw new d("Incompatible receiver, "+t+" required");return r}}}}function Bn(){if(On)return kn.exports;On=1;var t=Z(),n=J(),e=lt(),r=rt(),o=Wt(),i=Nn().CONFIGURABLE,u=_n(),c=$n(),a=c.enforce,f=c.get,l=String,s=Object.defineProperty,p=t("".slice),d=t("".replace),v=t([].join),h=o&&!n(function(){return 8!==s(function(){},"length",{value:8}).length}),m=String(String).split("String"),y=kn.exports=function(t,n,e){"Symbol("===p(l(n),0,7)&&(n="["+d(l(n),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),e&&e.getter&&(n="get "+n),e&&e.setter&&(n="set "+n),(!r(t,"name")||i&&t.name!==n)&&(o?s(t,"name",{value:n,configurable:!0}):t.name=n),h&&e&&r(e,"arity")&&t.length!==e.arity&&s(t,"length",{value:e.arity});try{e&&r(e,"constructor")&&e.constructor?o&&s(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var u=a(t);return r(u,"source")||(u.source=v(m,"string"==typeof n?n:"")),t};return Function.prototype.toString=y(function(){return e(this)&&f(this).source||u(this)},"toString"),kn.exports}function Vn(){if(Tn)return jn;Tn=1;var t=lt(),n=cn(),e=Bn(),r=K();return jn=function(o,i,u,c){c||(c={});var a=c.enumerable,f=void 0!==c.name?c.name:i;if(t(u)&&e(u,f,c),c.global)a?o[i]=u:r(i,u);else{try{c.unsafe?o[i]&&(a=!0):delete o[i]}catch(t){}a?o[i]=u:n.f(o,i,{value:u,enumerable:!1,configurable:!c.nonConfigurable,writable:!c.nonWritable})}return o}}function qn(){if(In)return Ln;In=1;var t=Z(),n=t({}.toString),e=t("".slice);return Ln=function(t){return e(n(t),8,-1)}}function Wn(){if(An)return Mn;An=1;var t=ft(),n=lt(),e=qn(),r=at()("toStringTag"),o=Object,i="Arguments"===e(function(){return arguments}());return Mn=t?e:function(t){var u,c,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(c=function(t,n){try{return t[n]}catch(t){}}(u=o(t),r))?c:i?e(u):"Object"===(a=e(u))&&n(u.callee)?"Arguments":a}}!function(){if(Rn)return a;Rn=1;var t=ft(),n=Vn(),e=function(){if(Cn)return Pn;Cn=1;var t=ft(),n=Wn();return Pn=t?{}.toString:function(){return"[object "+n(this)+"]"}}();t||n(Object.prototype,"toString",e,{unsafe:!0})}();var Un,Gn,Kn,Xn,Yn,Jn,Qn={},Zn={},te={};function ne(){if(Kn)return Gn;Kn=1;var t=Z(),n=J(),e=qn(),r=Object,o=t("".split);return Gn=n(function(){return!r("z").propertyIsEnumerable(0)})?function(t){return"String"===e(t)?o(t,""):r(t)}:r}function ee(){if(Yn)return Xn;Yn=1;var t=ne(),n=nt();return Xn=function(e){return t(n(e))}}function re(){if(Jn)return Zn;Jn=1;var t=Wt(),n=Jt(),e=function(){if(Un)return te;Un=1;var t={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,e=n&&!t.call({1:2},1);return te.f=e?function(t){var e=n(this,t);return!!e&&e.enumerable}:t,te}(),r=Fn(),o=ee(),i=un(),u=rt(),c=Kt(),a=Object.getOwnPropertyDescriptor;return Zn.f=t?a:function(t,f){if(t=o(t),f=i(f),c)try{return a(t,f)}catch(t){}if(u(t,f))return r(!n(e.f,t,f),t[f])},Zn}var oe,ie,ue,ce,ae,fe,le,se,pe,de,ve,he,me,ye,ge,be,we,Ee={};function xe(){if(ce)return ue;ce=1;var t=function(){if(ie)return oe;ie=1;var t=Math.ceil,n=Math.floor;return oe=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}}();return ue=function(n){var e=+n;return e!=e||0===e?0:t(e)}}function Se(){if(fe)return ae;fe=1;var t=xe(),n=Math.max,e=Math.min;return ae=function(r,o){var i=t(r);return i<0?n(i+o,0):e(i,o)}}function Oe(){if(se)return le;se=1;var t=xe(),n=Math.min;return le=function(e){var r=t(e);return r>0?n(r,9007199254740991):0}}function je(){if(de)return pe;de=1;var t=Oe();return pe=function(n){return t(n.length)}}function Te(){if(ye)return me;ye=1;var t=Z(),n=rt(),e=ee(),r=function(){if(he)return ve;he=1;var t=ee(),n=Se(),e=je(),r=function(r){return function(o,i,u){var c=t(o),a=e(c);if(0===a)return!r&&-1;var f,l=n(u,a);if(r&&i!=i){for(;a>l;)if((f=c[l++])!=f)return!0}else for(;a>l;l++)if((r||l in c)&&c[l]===i)return r||l||0;return!r&&-1}};return ve={includes:r(!0),indexOf:r(!1)}}().indexOf,o=zn(),i=t([].push);return me=function(t,u){var c,a=e(t),f=0,l=[];for(c in a)!n(o,c)&&n(a,c)&&i(l,c);for(;u.length>f;)n(a,c=u[f++])&&(~r(l,c)||i(l,c));return l}}function Le(){return be?ge:(be=1,ge=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var Ie,Me,Ae,Pe,Ce,Re,ke,Ne,_e,Fe,De,He,ze,$e,Be,Ve,qe,We,Ue,Ge={};function Ke(){if(Ae)return Me;Ae=1;var t=Qt(),n=Z(),e=function(){if(we)return Ee;we=1;var t=Te(),n=Le().concat("length","prototype");return Ee.f=Object.getOwnPropertyNames||function(e){return t(e,n)},Ee}(),r=(Ie||(Ie=1,Ge.f=Object.getOwnPropertySymbols),Ge),o=Yt(),i=n([].concat);return Me=t("Reflect","ownKeys")||function(t){var n=e.f(o(t)),u=r.f;return u?i(n,u(t)):n}}function Xe(){if(Ce)return Pe;Ce=1;var t=rt(),n=Ke(),e=re(),r=cn();return Pe=function(o,i,u){for(var c=n(i),a=r.f,f=e.f,l=0;l<c.length;l++){var s=c[l];t(o,s)||u&&t(u,s)||a(o,s,f(i,s))}}}function Ye(){if(_e)return Ne;_e=1;var t=f(),n=re().f,e=Dn(),r=Vn(),o=K(),i=Xe(),u=function(){if(ke)return Re;ke=1;var t=J(),n=lt(),e=/#|\.prototype\./,r=function(e,r){var a=i[o(e)];return a===c||a!==u&&(n(r)?t(r):!!r)},o=r.normalize=function(t){return String(t).replace(e,".").toLowerCase()},i=r.data={},u=r.NATIVE="N",c=r.POLYFILL="P";return Re=r}();return Ne=function(c,a){var f,l,s,p,d,v=c.target,h=c.global,m=c.stat;if(f=h?t:m?t[v]||o(v,{}):t[v]&&t[v].prototype)for(l in a){if(p=a[l],s=c.dontCallGetSet?(d=n(f,l))&&d.value:f[l],!u(h?l:v+(m?".":"#")+l,c.forced)&&void 0!==s){if(typeof p==typeof s)continue;i(p,s)}(c.sham||s&&s.sham)&&e(p,"sham",!0),r(f,l,p,c)}}}function Je(){if(ze)return He;ze=1;var t=Z();return He=t([].slice)}function Qe(){if(Be)return $e;Be=1;var t=Z(),n=nn(),e=Ut(),r=rt(),o=Je(),i=Q(),u=Function,c=t([].concat),a=t([].join),f={};return $e=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,e){if(!r(f,n)){for(var o=[],i=0;i<n;i++)o[i]="a["+i+"]";f[n]=u("C,a","return new C("+a(o,",")+")")}return f[n](t,e)}(i,n.length,n):i.apply(t,n)};return e(l)&&(p.prototype=l),p},$e}function Ze(){if(qe)return Ve;qe=1;var t=Z(),n=J(),e=lt(),r=Wn(),o=Qt(),i=_n(),u=function(){},c=o("Reflect","construct"),a=/^\s*(?:class|function)\b/,f=t(a.exec),l=!a.test(u),s=function(t){if(!e(t))return!1;try{return c(u,[],t),!0}catch(t){return!1}},p=function(t){if(!e(t))return!1;switch(r(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return l||!!f(a,i(t))}catch(t){return!0}};return p.sham=!0,Ve=!c||n(function(){var t;return s(s.call)||!s(Object)||!s(function(){t=!0})||t})?p:s}function tr(){if(Ue)return We;Ue=1;var t=Ze(),n=tn(),e=TypeError;return We=function(r){if(t(r))return r;throw new e(n(r)+" is not a constructor")}}var nr,er,rr,or,ir,ur,cr,ar,fr={};function lr(){if(er)return nr;er=1;var t=Te(),n=Le();return nr=Object.keys||function(e){return t(e,n)}}function sr(){if(cr)return ur;cr=1;var t,n=Yt(),e=function(){if(rr)return fr;rr=1;var t=Wt(),n=Xt(),e=cn(),r=Yt(),o=ee(),i=lr();return fr.f=t&&!n?Object.defineProperties:function(t,n){r(t);for(var u,c=o(n),a=i(n),f=a.length,l=0;f>l;)e.f(t,u=a[l++],c[u]);return t},fr}(),r=Le(),o=zn(),i=function(){if(ir)return or;ir=1;var t=Qt();return or=t("document","documentElement")}(),u=Gt(),c=Hn(),a="prototype",f="script",l=c("IE_PROTO"),s=function(){},p=function(t){return"<"+f+">"+t+"</"+f+">"},d=function(t){t.write(p("")),t.close();var n=t.parentWindow.Object;return t=null,n},v=function(){try{t=new ActiveXObject("htmlfile")}catch(t){}var n,e,o;v="undefined"!=typeof document?document.domain&&t?d(t):(e=u("iframe"),o="java"+f+":",e.style.display="none",i.appendChild(e),e.src=String(o),(n=e.contentWindow.document).open(),n.write(p("document.F=Object")),n.close(),n.F):d(t);for(var c=r.length;c--;)delete v[a][r[c]];return v()};return o[l]=!0,ur=Object.create||function(t,r){var o;return null!==t?(s[a]=n(t),o=new s,s[a]=null,o[l]=t):o=v(),void 0===r?o:e.f(o,r)}}!function(){if(ar)return Qn;ar=1;var t=Ye(),n=Qt(),e=function(){if(De)return Fe;De=1;var t=Q(),n=Function.prototype,e=n.apply,r=n.call;return Fe="object"==typeof Reflect&&Reflect.apply||(t?r.bind(e):function(){return r.apply(e,arguments)}),Fe}(),r=Qe(),o=tr(),i=Yt(),u=Ut(),c=sr(),a=J(),f=n("Reflect","construct"),l=Object.prototype,s=[].push,p=a(function(){function t(){}return!(f(function(){},[],t)instanceof t)}),d=!a(function(){f(function(){})}),v=p||d;t({target:"Reflect",stat:!0,forced:v,sham:v},{construct:function(t,n){o(t),i(n);var a=arguments.length<3?t:o(arguments[2]);if(d&&!p)return f(t,n,a);if(t===a){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 v=[null];return e(s,v,n),new(e(r,t,v))}var h=a.prototype,m=c(u(h)?h:l),y=e(t,m,n);return u(y)?y:m}})}(),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 pr=function(n){function e(){var t=n.call(this)||this,e=t.attachShadow({mode:"open"}),r=e.ownerDocument.createElement("span");return r.style.display="inline-block",e.appendChild(r),t.span=r,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 e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}(e,n),Object.defineProperty(e,"observedAttributes",{get:function(){return["data-value"]},enumerable:!1,configurable:!0}),e.prototype.attributeChangedCallback=function(t,n,e){if("data-value"===t){if(n===e)return;this.render(e||"")}},e.prototype.render=function(n){t.render(n,this.span,{throwOnError:!1,output:"mathml"})},e}(HTMLElement);window.customElements.get("w-e-formula-card")||window.customElements.define("w-e-formula-card",pr),n.i18nAddResources("en",{formula:{formula:"Formula",placeholder:"Use LateX syntax",insert:"Insert formula",edit:"Edit formula",ok:"OK"}}),n.i18nAddResources("zh-CN",{formula:{formula:"公式",placeholder:"使用 LateX 语法",insert:"插入公式",edit:"编辑公式",ok:"确定"}});var dr,vr,hr,mr,yr,gr,br,wr,Er,xr,Sr,Or,jr,Tr,Lr,Ir={type:"formula",elemToHtml:function(t,n){var e=t.value;return'<span data-w-e-type="formula" data-w-e-is-void data-w-e-is-inline data-value="'.concat(void 0===e?"":e,'"></span>')}},Mr={};function Ar(){if(mr)return hr;mr=1;var t=function(){if(vr)return dr;vr=1;var t=qn(),n=Z();return dr=function(e){if("Function"===t(e))return n(e)}}(),n=nn(),e=Q(),r=t(t.bind);return hr=function(t,o){return n(t),void 0===o?t:e?r(t,o):function(){return t.apply(o,arguments)}},hr}function Pr(){if(gr)return yr;gr=1;var t=qn();return yr=Array.isArray||function(n){return"Array"===t(n)}}function Cr(){if(wr)return br;wr=1;var t=Pr(),n=Ze(),e=Ut(),r=at()("species"),o=Array;return br=function(i){var u;return t(i)&&(u=i.constructor,(n(u)&&(u===o||t(u.prototype))||e(u)&&null===(u=u[r]))&&(u=void 0)),void 0===u?o:u}}function Rr(){if(xr)return Er;xr=1;var t=Cr();return Er=function(n,e){return new(t(n))(0===e?0:e)}}function kr(){if(Tr)return jr;Tr=1;var t=at(),n=sr(),e=cn().f,r=t("unscopables"),o=Array.prototype;return void 0===o[r]&&e(o,r,{configurable:!0,value:n(null)}),jr=function(t){o[r][t]=!0}}!function(){if(Lr)return Mr;Lr=1;var t=Ye(),n=function(){if(Or)return Sr;Or=1;var t=Ar(),n=Z(),e=ne(),r=et(),o=je(),i=Rr(),u=n([].push),c=function(n){var c=1===n,a=2===n,f=3===n,l=4===n,s=6===n,p=7===n,d=5===n||s;return function(v,h,m,y){for(var g,b,w=r(v),E=e(w),x=o(E),S=t(h,m),O=0,j=y||i,T=c?j(v,x):a||p?j(v,0):void 0;x>O;O++)if((d||O in E)&&(b=S(g=E[O],O,w),n))if(c)T[O]=b;else if(b)switch(n){case 3:return!0;case 5:return g;case 6:return O;case 2:u(T,g)}else switch(n){case 4:return!1;case 7:u(T,g)}return s?-1:f||l?l:T}};return Sr={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,e=kr(),r="find",o=!0;r in[]&&Array(1)[r](function(){o=!1}),t({target:"Array",proto:!0,forced:o},{find:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),e(r)}();var Nr,_r,Fr,Dr,Hr,zr,$r,Br,Vr,qr,Wr,Ur,Gr,Kr={};function Xr(){if(_r)return Nr;_r=1;var t=Wn(),n=String;return Nr=function(e){if("Symbol"===t(e))throw new TypeError("Cannot convert a Symbol value to a string");return n(e)}}function Yr(){if(Dr)return Fr;Dr=1;var t=Yt();return Fr=function(){var n=t(this),e="";return n.hasIndices&&(e+="d"),n.global&&(e+="g"),n.ignoreCase&&(e+="i"),n.multiline&&(e+="m"),n.dotAll&&(e+="s"),n.unicode&&(e+="u"),n.unicodeSets&&(e+="v"),n.sticky&&(e+="y"),e}}function Jr(){if(Ur)return Wr;Ur=1;var t,n,e=Jt(),r=Z(),o=Xr(),i=Yr(),u=function(){if(zr)return Hr;zr=1;var t=J(),n=f().RegExp,e=t(function(){var t=n("a","y");return t.lastIndex=2,null!==t.exec("abcd")}),r=e||t(function(){return!n("a","y").sticky}),o=e||t(function(){var t=n("^r","gy");return t.lastIndex=2,null!==t.exec("str")});return Hr={BROKEN_CARET:o,MISSED_STICKY:r,UNSUPPORTED_Y:e}}(),c=Y(),a=sr(),l=$n().get,s=function(){if(Br)return $r;Br=1;var t=J(),n=f().RegExp;return $r=t(function(){var t=n(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)})}(),p=function(){if(qr)return Vr;qr=1;var t=J(),n=f().RegExp;return Vr=t(function(){var t=n("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")})}(),d=c("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,h=v,m=r("".charAt),y=r("".indexOf),g=r("".replace),b=r("".slice),w=(n=/b*/g,e(v,t=/a/,"a"),e(v,n,"a"),0!==t.lastIndex||0!==n.lastIndex),E=u.BROKEN_CARET,x=void 0!==/()??/.exec("")[1];return(w||x||E||s||p)&&(h=function(t){var n,r,u,c,f,s,p,S=this,O=l(S),j=o(t),T=O.raw;if(T)return T.lastIndex=S.lastIndex,n=e(h,T,j),S.lastIndex=T.lastIndex,n;var L=O.groups,I=E&&S.sticky,M=e(i,S),A=S.source,P=0,C=j;if(I&&(M=g(M,"y",""),-1===y(M,"g")&&(M+="g"),C=b(j,S.lastIndex),S.lastIndex>0&&(!S.multiline||S.multiline&&"\n"!==m(j,S.lastIndex-1))&&(A="(?: "+A+")",C=" "+C,P++),r=new RegExp("^(?:"+A+")",M)),x&&(r=new RegExp("^"+A+"$(?!\\s)",M)),w&&(u=S.lastIndex),c=e(v,I?r:S,C),I?c?(c.input=b(c.input,P),c[0]=b(c[0],P),c.index=S.lastIndex,S.lastIndex+=c[0].length):S.lastIndex=0:w&&c&&(S.lastIndex=S.global?c.index+c[0].length:u),x&&c&&c.length>1&&e(d,c[0],r,function(){for(f=1;f<arguments.length-2;f++)void 0===arguments[f]&&(c[f]=void 0)}),c&&L)for(c.groups=s=a(null),f=0;f<L.length;f++)s[(p=L[f])[0]]=c[p[1]];return c}),Wr=h}!function(){if(Gr)return Kr;Gr=1;var t=Ye(),n=Jr();t({target:"RegExp",proto:!0,forced:/./.exec!==n},{exec:n})}();var Qr,Zr,to,no,eo,ro,oo,io={};function uo(){return Zr?Qr:(Zr=1,Qr="\t\n\v\f\r                 \u2028\u2029\ufeff")}!function(){if(oo)return io;oo=1;var t=Ye(),n=function(){if(no)return to;no=1;var t=Z(),n=nt(),e=Xr(),r=uo(),o=t("".replace),i=RegExp("^["+r+"]+"),u=RegExp("(^|[^"+r+"])["+r+"]+$"),c=function(t){return function(r){var c=e(n(r));return 1&t&&(c=o(c,i,"")),2&t&&(c=o(c,u,"$1")),c}};return to={start:c(1),end:c(2),trim:c(3)}}().trim,e=function(){if(ro)return eo;ro=1;var t=Nn().PROPER,n=J(),e=uo();return eo=function(r){return n(function(){return!!e[r]()||"​…᠎"!=="​…᠎"[r]()||t&&e[r].name!==r})}}();t({target:"String",proto:!0,forced:e("trim")},{trim:function(){return n(this)}})}();var co,ao,fo={};function lo(t){return null!==t&&"object"==typeof t&&"constructor"in t&&t.constructor===Object}function so(t={},n={}){Object.keys(n).forEach(e=>{void 0===t[e]?t[e]=n[e]:lo(n[e])&&lo(t[e])&&Object.keys(n[e]).length>0&&so(t[e],n[e])})}ao||(ao=1,function(){if(co)return fo;co=1;var t=Ye(),n=f();t({global:!0,forced:n.globalThis!==n},{globalThis:n})}());const po={body:{},addEventListener(){},removeEventListener(){},activeElement:{blur(){},nodeName:""},querySelector:()=>null,querySelectorAll:()=>[],getElementById:()=>null,createEvent:()=>({initEvent(){}}),createElement:()=>({children:[],childNodes:[],style:{},setAttribute(){},getElementsByTagName:()=>[]}),createElementNS:()=>({}),importNode:()=>null,location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""}};function vo(){const t="undefined"!=typeof document?document:{};return so(t,po),t}const ho={document:po,navigator:{userAgent:""},location:{hash:"",host:"",hostname:"",href:"",origin:"",pathname:"",protocol:"",search:""},history:{replaceState(){},pushState(){},go(){},back(){}},CustomEvent:function(){return this},addEventListener(){},removeEventListener(){},getComputedStyle:()=>({getPropertyValue:()=>""}),Image(){},Date(){},screen:{},setTimeout(){},clearTimeout(){},matchMedia:()=>({}),requestAnimationFrame:t=>"undefined"==typeof setTimeout?(t(),null):setTimeout(t,0),cancelAnimationFrame(t){"undefined"!=typeof setTimeout&&clearTimeout(t)}};function mo(){const t="undefined"!=typeof window?window:{};return so(t,ho),t}class yo extends Array{constructor(t){"number"==typeof t?super(t):(super(...t||[]),function(t){const n=t.__proto__;Object.defineProperty(t,"__proto__",{get:()=>n,set(t){n.__proto__=t}})}(this))}}function go(t,n){const e=mo(),r=vo();let o=[];if(!n&&t instanceof yo)return t;if(!t)return new yo(o);if("string"==typeof t){const e=t.trim();if(e.indexOf("<")>=0&&e.indexOf(">")>=0){let t="div";0===e.indexOf("<li")&&(t="ul"),0===e.indexOf("<tr")&&(t="tbody"),0!==e.indexOf("<td")&&0!==e.indexOf("<th")||(t="tr"),0===e.indexOf("<tbody")&&(t="table"),0===e.indexOf("<option")&&(t="select");const n=r.createElement(t);n.innerHTML=e;for(let t=0;t<n.childNodes.length;t+=1)o.push(n.childNodes[t])}else o=function(t,n){if("string"!=typeof t)return[t];const e=[],r=n.querySelectorAll(t);for(let t=0;t<r.length;t+=1)e.push(r[t]);return e}(t.trim(),n||r)}else if(t.nodeType||t===e||t===r)o.push(t);else if(Array.isArray(t)){if(t instanceof yo)return t;o=t}return new yo(function(t){const n=[];for(let e=0;e<t.length;e+=1)-1===n.indexOf(t[e])&&n.push(t[e]);return n}(o))}function bo(t){if(void 0===t){const t=this[0];if(!t)return;if(t.multiple&&"select"===t.nodeName.toLowerCase()){const n=[];for(let e=0;e<t.selectedOptions.length;e+=1)n.push(t.selectedOptions[e].value);return n}return t.value}for(let n=0;n<this.length;n+=1){const e=this[n];if(Array.isArray(t)&&e.multiple&&"select"===e.nodeName.toLowerCase())for(let n=0;n<e.options.length;n+=1)e.options[n].selected=t.indexOf(e.options[n].value)>=0;else e.value=t}return this}function wo(...t){let[n,e,r,o]=t;function i(t){const n=t.target;if(!n)return;const o=t.target.dom7EventData||[];if(o.indexOf(t)<0&&o.unshift(t),go(n).is(e))r.apply(n,o);else{const t=go(n).parents();for(let n=0;n<t.length;n+=1)go(t[n]).is(e)&&r.apply(t[n],o)}}function u(t){const n=t&&t.target&&t.target.dom7EventData||[];n.indexOf(t)<0&&n.unshift(t),r.apply(this,n)}"function"==typeof t[1]&&([n,r,o]=t,e=void 0),o||(o=!1);const c=n.split(" ");let a;for(let t=0;t<this.length;t+=1){const n=this[t];if(e)for(a=0;a<c.length;a+=1){const t=c[a];n.dom7LiveListeners||(n.dom7LiveListeners={}),n.dom7LiveListeners[t]||(n.dom7LiveListeners[t]=[]),n.dom7LiveListeners[t].push({listener:r,proxyListener:i}),n.addEventListener(t,i,o)}else for(a=0;a<c.length;a+=1){const t=c[a];n.dom7Listeners||(n.dom7Listeners={}),n.dom7Listeners[t]||(n.dom7Listeners[t]=[]),n.dom7Listeners[t].push({listener:r,proxyListener:u}),n.addEventListener(t,u,o)}}return this}function Eo(t){if(void 0===t)return this[0]?this[0].innerHTML:null;for(let n=0;n<this.length;n+=1)this[n].innerHTML=t;return this}function xo(t){const n=mo(),e=vo(),r=this[0];let o,i;if(!r||void 0===t)return!1;if("string"==typeof t){if(r.matches)return r.matches(t);if(r.webkitMatchesSelector)return r.webkitMatchesSelector(t);if(r.msMatchesSelector)return r.msMatchesSelector(t);for(o=go(t),i=0;i<o.length;i+=1)if(o[i]===r)return!0;return!1}if(t===e)return r===e;if(t===n)return r===n;if(t.nodeType||t instanceof yo){for(o=t.nodeType?[t]:t,i=0;i<o.length;i+=1)if(o[i]===r)return!0;return!1}return!1}function So(...t){let n;const e=vo();for(let r=0;r<t.length;r+=1){n=t[r];for(let t=0;t<this.length;t+=1)if("string"==typeof n){const r=e.createElement("div");for(r.innerHTML=n;r.firstChild;)this[t].appendChild(r.firstChild)}else if(n instanceof yo)for(let e=0;e<n.length;e+=1)this[t].appendChild(n[e]);else this[t].appendChild(n)}return this}function Oo(t){const n=[];for(let e=0;e<this.length;e+=1){let r=this[e].parentNode;for(;r;)t?go(r).is(t)&&n.push(r):n.push(r),r=r.parentNode}return go(n)}function jo(t){const n=[];for(let e=0;e<this.length;e+=1){const r=this[e].querySelectorAll(t);for(let t=0;t<r.length;t+=1)n.push(r[t])}return go(n)}go.fn=yo.prototype;const To="resize scroll".split(" ");const Lo=(Io="focus",function(...t){if(void 0===t[0]){for(let t=0;t<this.length;t+=1)To.indexOf(Io)<0&&(Io in this[t]?this[t][Io]():go(this[t]).trigger(Io));return this}return this.on(Io,...t)});var Io;So&&(go.fn.append=So),Eo&&(go.fn.html=Eo),bo&&(go.fn.val=bo),wo&&(go.fn.on=wo),Lo&&(go.fn.focus=Lo),xo&&(go.fn.is=xo),Oo&&(go.fn.parents=Oo),jo&&(go.fn.find=jo);var Mo,Ao,Po,Co,Ro,ko,No,_o={};function Fo(){if(Ao)return Mo;Ao=1;var t=TypeError;return Mo=function(n){if(n>9007199254740991)throw t("Maximum allowed index exceeded");return n}}function Do(){if(Co)return Po;Co=1;var t=Wt(),n=cn(),e=Fn();return Po=function(r,o,i){t?n.f(r,o,e(0,i)):r[o]=i}}function Ho(){if(ko)return Ro;ko=1;var t=J(),n=at(),e=it(),r=n("species");return Ro=function(n){return e>=51||!t(function(){var t=[];return(t.constructor={})[r]=function(){return{foo:1}},1!==t[n](Boolean).foo})}}!function(){if(No)return _o;No=1;var t=Ye(),n=J(),e=Pr(),r=Ut(),o=et(),i=je(),u=Fo(),c=Do(),a=Rr(),f=Ho(),l=at(),s=it(),p=l("isConcatSpreadable"),d=s>=51||!n(function(){var t=[];return t[p]=!1,t.concat()[0]!==t}),v=function(t){if(!r(t))return!1;var n=t[p];return void 0!==n?!!n:e(t)};t({target:"Array",proto:!0,arity:1,forced:!d||!f("concat")},{concat:function(t){var n,e,r,f,l,s=o(this),p=a(s,0),d=0;for(n=-1,r=arguments.length;n<r;n++)if(v(l=-1===n?s:arguments[n]))for(f=i(l),u(d+f),e=0;e<f;e++,d++)e in l&&c(p,d,l[e]);else u(d+1),c(p,d++,l);return p.length=d,p}})}();function zo(t){return"".concat(t,"-").concat(((t=21)=>{let n="",e=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)n+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&e[t]];return n})())}function $o(){return zo("w-e-insert-formula")}var Bo=function(){function t(){this.title=n.t("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=$o(),this.buttonId=$o()}return t.prototype.getSelectedElem=function(t){var e=n.DomEditor.getSelectedNodeByType(t,"formula");return null==e?null:e},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 e=t.selection;return null==e||(!!n.SlateRange.isExpanded(e)||null==this.getSelectedElem(t))},t.prototype.getModalPositionNode=function(t){return this.getSelectedElem(t)},t.prototype.getModalContentElem=function(t){var e=this,r=this.textareaId,i=this.buttonId,u=o(n.genModalTextareaElems(n.t("formula.formula"),r,n.t("formula.placeholder")),2),c=u[0],a=go(u[1]),f=o(n.genModalButtonElems(i,n.t("formula.ok")),1)[0];if(null==this.$content){var l=go("<div></div>");l.on("click","#".concat(i),function(n){n.preventDefault();var o=l.find("#".concat(r)).val().trim();e.updateFormula(t,o),t.hidePanelOrModal()}),this.$content=l}var s=this.$content;s.html(""),s.append(c),s.append(f);var p=this.getValue(t);return a.val(p),setTimeout(function(){a.focus()}),s[0]},t.prototype.updateFormula=function(t,e){if(e&&(t.restoreSelection(),!this.isDisabled(t))){var r=this.getSelectedElem(t);if(null!=r){var o=n.DomEditor.findPath(t,r),i={value:e};n.SlateTransforms.setNodes(t,i,{at:o})}}},t}();function Vo(){return zo("w-e-insert-formula")}var qo=function(){function t(){this.title=n.t("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=Vo(),this.buttonId=Vo()}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 e=t.selection;if(null==e)return!0;if(n.SlateRange.isExpanded(e))return!0;var r=n.DomEditor.getSelectedElems(t);return!!r.some(function(n){return t.isVoid(n)})||!!r.some(function(t){return"pre"===n.DomEditor.getNodeType(t)})},t.prototype.getModalPositionNode=function(t){return null},t.prototype.getModalContentElem=function(t){var e=this,r=this.textareaId,i=this.buttonId,u=o(n.genModalTextareaElems(n.t("formula.formula"),r,n.t("formula.placeholder")),2),c=u[0],a=go(u[1]),f=o(n.genModalButtonElems(i,n.t("formula.ok")),1)[0];if(null==this.$content){var l=go("<div></div>");l.on("click","#".concat(i),function(n){n.preventDefault();var o=l.find("#".concat(r)).val().trim();e.insertFormula(t,o),t.hidePanelOrModal()}),this.$content=l}var s=this.$content;return s.html(""),s.append(c),s.append(f),a.val(""),setTimeout(function(){a.focus()}),s[0]},t.prototype.insertFormula=function(t,n){if(n&&(t.restoreSelection(),!this.isDisabled(t))){var e={type:"formula",value:n,children:[{text:""}]};t.insertNode(e)}},t}();return{editorPlugin:function(t){var e=t.isInline,r=t.isVoid,o=t;return o.isInline=function(t){return"formula"===n.DomEditor.getNodeType(t)||e(t)},o.isVoid=function(t){return"formula"===n.DomEditor.getNodeType(t)||r(t)},o},renderElems:[{type:"formula",renderElem:function(t,r,o){var i=n.DomEditor.isNodeSelected(o,t),u=t.value,c=void 0===u?"":u,a=e.h("w-e-formula-card",{dataset:{value:c}},null);return e.h("div",{className:"w-e-textarea-formula-container",props:{contentEditable:!1},style:{display:"inline-block",marginLeft:"3px",marginRight:"3px",border:i?"2px solid var(--w-e-textarea-selected-border-color)":"2px solid transparent",borderRadius:"3px",padding:"3px 3px"}},[a])}}],elemsToHtml:[Ir],parseElemsHtml:[{selector:'span[data-w-e-type="formula"]',parseElemHtml:function(t,n,e){return{type:"formula",value:t.getAttribute("data-value")||"",children:[{text:""}]}}}],menus:[{key:"insertFormula",factory:function(){return new qo}},{key:"editFormula",factory:function(){return new Bo}}]}});
2
2
  //# sourceMappingURL=index.js.map