@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.
- package/dist/core/src/config/interface.d.ts +10 -4
- package/dist/core/src/parse-html/index.d.ts +0 -1
- 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/dist/table-module/src/module/custom-types.d.ts +5 -0
- package/dist/table-module/src/module/parse-elem-html.d.ts +1 -1
- package/dist/table-module/src/module/render-elem/render-row.d.ts +1 -1
- package/dist/table-module/src/module/row-resize.d.ts +15 -0
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
import t from"katex";import{i18nAddResources as n,t as r,DomEditor as e,SlateRange as o,genModalTextareaElems as i,genModalButtonElems as u,SlateTransforms as c}from"@wangeditor-next/editor";import{h as f}from"snabbdom";var a=function(t,n){return a=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])},a(t,n)};function l(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 s,p,d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},v={};function h(){if(p)return s;p=1;var t=function(t){return t&&t.Math===Math&&t};return s=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof d&&d)||t("object"==typeof s&&s)||function(){return this}()||Function("return this")()}var m,y,g,b,w,x,E,O,S,j,T,L,I,P,A,M,C,R,N,_,k,F,H,D,z,$,B,V,W,U,q,G,K,X,Y,J,Q,Z={exports:{}};function tt(){if(b)return g;b=1;var t=h(),n=Object.defineProperty;return g=function(r,e){try{n(t,r,{value:e,configurable:!0,writable:!0})}catch(n){t[r]=e}return e}}function nt(){if(w)return Z.exports;w=1;var t=y?m:(y=1,m=!1),n=h(),r=tt(),e="__core-js_shared__",o=Z.exports=n[e]||r(e,{});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"}),Z.exports}function rt(){if(E)return x;E=1;var t=nt();return x=function(n,r){return t[n]||(t[n]=r||{})}}function et(){return S?O:(S=1,O=function(t){try{return!!t()}catch(t){return!0}})}function ot(){if(T)return j;T=1;var t=et();return j=!t(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})}function it(){if(I)return L;I=1;var t=ot(),n=Function.prototype,r=n.call,e=t&&n.bind.bind(r,r);return L=t?e:function(t){return function(){return r.apply(t,arguments)}},L}function ut(){return A?P:(A=1,P=function(t){return null==t})}function ct(){if(C)return M;C=1;var t=ut(),n=TypeError;return M=function(r){if(t(r))throw new n("Can't call method on "+r);return r}}function ft(){if(N)return R;N=1;var t=ct(),n=Object;return R=function(r){return n(t(r))}}function at(){if(k)return _;k=1;var t=it(),n=ft(),r=t({}.hasOwnProperty);return _=Object.hasOwn||function(t,e){return r(n(t),e)}}function lt(){if(H)return F;H=1;var t=it(),n=0,r=Math.random(),e=t(1.1.toString);return F=function(t){return"Symbol("+(void 0===t?"":t)+")_"+e(++n+r,36)}}function st(){if(B)return $;B=1;var t,n,r=h(),e=function(){if(z)return D;z=1;var t=h().navigator,n=t&&t.userAgent;return D=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]),$=n}function pt(){if(W)return V;W=1;var t=st(),n=et(),r=h().String;return V=!!Object.getOwnPropertySymbols&&!n(function(){var n=Symbol("symbol detection");return!r(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&t&&t<41})}function dt(){if(q)return U;q=1;var t=pt();return U=t&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function vt(){if(K)return G;K=1;var t=h(),n=rt(),r=at(),e=lt(),o=pt(),i=dt(),u=t.Symbol,c=n("wks"),f=i?u.for||u:u&&u.withoutSetter||e;return G=function(t){return r(c,t)||(c[t]=o&&r(u,t)?u[t]:f("Symbol."+t)),c[t]}}function ht(){if(Y)return X;Y=1;var t={};return t[vt()("toStringTag")]="z",X="[object z]"===String(t)}function mt(){if(Q)return J;Q=1;var t="object"==typeof document&&document.all;return J=void 0===t&&void 0!==t?function(n){return"function"==typeof n||n===t}:function(t){return"function"==typeof t}}var yt,gt,bt,wt,xt,Et,Ot,St,jt,Tt,Lt,It,Pt,At,Mt,Ct,Rt,Nt,_t,kt,Ft,Ht,Dt,zt,$t,Bt,Vt,Wt,Ut,qt,Gt,Kt,Xt,Yt={};function Jt(){if(gt)return yt;gt=1;var t=et();return yt=!t(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}function Qt(){if(wt)return bt;wt=1;var t=mt();return bt=function(n){return"object"==typeof n?null!==n:t(n)}}function Zt(){if(Et)return xt;Et=1;var t=h(),n=Qt(),r=t.document,e=n(r)&&n(r.createElement);return xt=function(t){return e?r.createElement(t):{}}}function tn(){if(St)return Ot;St=1;var t=Jt(),n=et(),r=Zt();return Ot=!t&&!n(function(){return 7!==Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a})}function nn(){if(Tt)return jt;Tt=1;var t=Jt(),n=et();return jt=t&&n(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}function rn(){if(It)return Lt;It=1;var t=Qt(),n=String,r=TypeError;return Lt=function(e){if(t(e))return e;throw new r(n(e)+" is not an object")}}function en(){if(At)return Pt;At=1;var t=ot(),n=Function.prototype.call;return Pt=t?n.bind(n):function(){return n.apply(n,arguments)},Pt}function on(){if(Ct)return Mt;Ct=1;var t=h(),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 un(){if(kt)return _t;kt=1;var t=on(),n=mt(),r=function(){if(Nt)return Rt;Nt=1;var t=it();return Rt=t({}.isPrototypeOf)}(),e=dt(),o=Object;return _t=e?function(t){return"symbol"==typeof t}:function(e){var i=t("Symbol");return n(i)&&r(i.prototype,o(e))}}function cn(){if(Ht)return Ft;Ht=1;var t=String;return Ft=function(n){try{return t(n)}catch(t){return"Object"}}}function fn(){if(zt)return Dt;zt=1;var t=mt(),n=cn(),r=TypeError;return Dt=function(e){if(t(e))return e;throw new r(n(e)+" is not a function")}}function an(){if(Bt)return $t;Bt=1;var t=fn(),n=ut();return $t=function(r,e){var o=r[e];return n(o)?void 0:t(o)}}function ln(){if(Wt)return Vt;Wt=1;var t=en(),n=mt(),r=Qt(),e=TypeError;return Vt=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")},Vt}function sn(){if(qt)return Ut;qt=1;var t=en(),n=Qt(),r=un(),e=an(),o=ln(),i=vt(),u=TypeError,c=i("toPrimitive");return Ut=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 pn(){if(Kt)return Gt;Kt=1;var t=sn(),n=un();return Gt=function(r){var e=t(r,"string");return n(e)?e:e+""}}function dn(){if(Xt)return Yt;Xt=1;var t=Jt(),n=tn(),r=nn(),e=rn(),o=pn(),i=TypeError,u=Object.defineProperty,c=Object.getOwnPropertyDescriptor,f="enumerable",a="configurable",l="writable";return Yt.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},Yt}var vn,hn,mn,yn,gn,bn,wn,xn,En,On,Sn,jn,Tn,Ln,In,Pn,An,Mn,Cn,Rn,Nn,_n,kn,Fn,Hn,Dn,zn={exports:{}};function $n(){if(hn)return vn;hn=1;var t=Jt(),n=at(),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 vn={EXISTS:o,PROPER:i,CONFIGURABLE:u}}function Bn(){if(yn)return mn;yn=1;var t=it(),n=mt(),r=nt(),e=t(Function.toString);return n(r.inspectSource)||(r.inspectSource=function(t){return e(t)}),mn=r.inspectSource}function Vn(){return xn?wn:(xn=1,wn=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}})}function Wn(){if(On)return En;On=1;var t=Jt(),n=dn(),r=Vn();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 Un(){if(jn)return Sn;jn=1;var t=rt(),n=lt(),r=t("keys");return Sn=function(t){return r[t]||(r[t]=n(t))}}function qn(){return Ln?Tn:(Ln=1,Tn={})}function Gn(){if(Pn)return In;Pn=1;var t,n,r,e=function(){if(bn)return gn;bn=1;var t=h(),n=mt(),r=t.WeakMap;return gn=n(r)&&/native code/.test(String(r))}(),o=h(),i=Qt(),u=Wn(),c=at(),f=nt(),a=Un(),l=qn(),s="Object already initialized",p=o.TypeError,d=o.WeakMap;if(e||f.state){var v=f.state||(f.state=new d);v.get=v.get,v.has=v.has,v.set=v.set,t=function(t,n){if(v.has(t))throw new p(s);return n.facade=t,v.set(t,n),n},n=function(t){return v.get(t)||{}},r=function(t){return v.has(t)}}else{var m=a("state");l[m]=!0,t=function(t,n){if(c(t,m))throw new p(s);return n.facade=t,u(t,m,n),n},n=function(t){return c(t,m)?t[m]:{}},r=function(t){return c(t,m)}}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 Kn(){if(An)return zn.exports;An=1;var t=it(),n=et(),r=mt(),e=at(),o=Jt(),i=$n().CONFIGURABLE,u=Bn(),c=Gn(),f=c.enforce,a=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=zn.exports=function(t,n,r){"Symbol("===p(l(n),0,7)&&(n="["+d(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=v(m,"string"==typeof n?n:"")),t};return Function.prototype.toString=y(function(){return r(this)&&a(this).source||u(this)},"toString"),zn.exports}function Xn(){if(Cn)return Mn;Cn=1;var t=mt(),n=dn(),r=Kn(),e=tt();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 Yn(){if(Nn)return Rn;Nn=1;var t=it(),n=t({}.toString),r=t("".slice);return Rn=function(t){return r(n(t),8,-1)}}function Jn(){if(kn)return _n;kn=1;var t=ht(),n=mt(),r=Yn(),e=vt()("toStringTag"),o=Object,i="Arguments"===r(function(){return arguments}());return _n=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(Dn)return v;Dn=1;var t=ht(),n=Xn(),r=function(){if(Hn)return Fn;Hn=1;var t=ht(),n=Jn();return Fn=t?{}.toString:function(){return"[object "+n(this)+"]"}}();t||n(Object.prototype,"toString",r,{unsafe:!0})}();var Qn,Zn,tr,nr,rr,er,or={},ir={},ur={};function cr(){if(tr)return Zn;tr=1;var t=it(),n=et(),r=Yn(),e=Object,o=t("".split);return Zn=n(function(){return!e("z").propertyIsEnumerable(0)})?function(t){return"String"===r(t)?o(t,""):e(t)}:e}function fr(){if(rr)return nr;rr=1;var t=cr(),n=ct();return nr=function(r){return t(n(r))}}function ar(){if(er)return ir;er=1;var t=Jt(),n=en(),r=function(){if(Qn)return ur;Qn=1;var t={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,r=n&&!t.call({1:2},1);return ur.f=r?function(t){var r=n(this,t);return!!r&&r.enumerable}:t,ur}(),e=Vn(),o=fr(),i=pn(),u=at(),c=tn(),f=Object.getOwnPropertyDescriptor;return ir.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])},ir}var lr,sr,pr,dr,vr,hr,mr,yr,gr,br,wr,xr,Er,Or,Sr,jr,Tr,Lr={};function Ir(){if(dr)return pr;dr=1;var t=function(){if(sr)return lr;sr=1;var t=Math.ceil,n=Math.floor;return lr=Math.trunc||function(r){var e=+r;return(e>0?n:t)(e)}}();return pr=function(n){var r=+n;return r!=r||0===r?0:t(r)}}function Pr(){if(hr)return vr;hr=1;var t=Ir(),n=Math.max,r=Math.min;return vr=function(e,o){var i=t(e);return i<0?n(i+o,0):r(i,o)}}function Ar(){if(yr)return mr;yr=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(br)return gr;br=1;var t=Ar();return gr=function(n){return t(n.length)}}function Cr(){if(Or)return Er;Or=1;var t=it(),n=at(),r=fr(),e=function(){if(xr)return wr;xr=1;var t=fr(),n=Pr(),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 wr={includes:e(!0),indexOf:e(!1)}}().indexOf,o=qn(),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 jr?Sr:(jr=1,Sr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var Nr,_r,kr,Fr,Hr,Dr,zr,$r,Br,Vr,Wr,Ur,qr,Gr,Kr,Xr,Yr,Jr,Qr,Zr={};function te(){if(kr)return _r;kr=1;var t=on(),n=it(),r=function(){if(Tr)return Lr;Tr=1;var t=Cr(),n=Rr().concat("length","prototype");return Lr.f=Object.getOwnPropertyNames||function(r){return t(r,n)},Lr}(),e=(Nr||(Nr=1,Zr.f=Object.getOwnPropertySymbols),Zr),o=rn(),i=n([].concat);return _r=t("Reflect","ownKeys")||function(t){var n=r.f(o(t)),u=e.f;return u?i(n,u(t)):n}}function ne(){if(Hr)return Fr;Hr=1;var t=at(),n=te(),r=ar(),e=dn();return Fr=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 re(){if(Br)return $r;Br=1;var t=h(),n=ar().f,r=Wn(),e=Xn(),o=tt(),i=ne(),u=function(){if(zr)return Dr;zr=1;var t=et(),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 Dr=e}();return $r=function(c,f){var a,l,s,p,d,v=c.target,h=c.global,m=c.stat;if(a=h?t:m?t[v]||o(v,{}):t[v]&&t[v].prototype)for(l in f){if(p=f[l],s=c.dontCallGetSet?(d=n(a,l))&&d.value:a[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)&&r(p,"sham",!0),e(a,l,p,c)}}}function ee(){if(qr)return Ur;qr=1;var t=it();return Ur=t([].slice)}function oe(){if(Kr)return Gr;Kr=1;var t=it(),n=fn(),r=Qt(),e=at(),o=ee(),i=ot(),u=Function,c=t([].concat),f=t([].join),a={};return Gr=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},Gr}function ie(){if(Yr)return Xr;Yr=1;var t=it(),n=et(),r=mt(),e=Jn(),o=on(),i=Bn(),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,Xr=!c||n(function(){var t;return s(s.call)||!s(Object)||!s(function(){t=!0})||t})?p:s}function ue(){if(Qr)return Jr;Qr=1;var t=ie(),n=cn(),r=TypeError;return Jr=function(e){if(t(e))return e;throw new r(n(e)+" is not a constructor")}}var ce,fe,ae,le,se,pe,de,ve,he={};function me(){if(fe)return ce;fe=1;var t=Cr(),n=Rr();return ce=Object.keys||function(r){return t(r,n)}}function ye(){if(de)return pe;de=1;var t,n=rn(),r=function(){if(ae)return he;ae=1;var t=Jt(),n=nn(),r=dn(),e=rn(),o=fr(),i=me();return he.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},he}(),e=Rr(),o=qn(),i=function(){if(se)return le;se=1;var t=on();return le=t("document","documentElement")}(),u=Zt(),c=Un(),f="prototype",a="script",l=c("IE_PROTO"),s=function(){},p=function(t){return"<"+a+">"+t+"</"+a+">"},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,r,o;v="undefined"!=typeof document?document.domain&&t?d(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):d(t);for(var c=e.length;c--;)delete v[f][e[c]];return v()};return o[l]=!0,pe=Object.create||function(t,e){var o;return null!==t?(s[f]=n(t),o=new s,s[f]=null,o[l]=t):o=v(),void 0===e?o:r.f(o,e)}}!function(){if(ve)return or;ve=1;var t=re(),n=on(),r=function(){if(Wr)return Vr;Wr=1;var t=ot(),n=Function.prototype,r=n.apply,e=n.call;return Vr="object"==typeof Reflect&&Reflect.apply||(t?e.bind(r):function(){return e.apply(r,arguments)}),Vr}(),e=oe(),o=ue(),i=rn(),u=Qt(),c=ye(),f=et(),a=n("Reflect","construct"),l=Object.prototype,s=[].push,p=f(function(){function t(){}return!(a(function(){},[],t)instanceof t)}),d=!f(function(){a(function(){})}),v=p||d;t({target:"Reflect",stat:!0,forced:v,sham:v},{construct:function(t,n){o(t),i(n);var f=arguments.length<3?t:o(arguments[2]);if(d&&!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 v=[null];return r(s,v,n),new(r(e,t,v))}var h=f.prototype,m=c(u(h)?h:l),y=r(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 ge=function(n){function r(){var t=n.call(this)||this,r=t.attachShadow({mode:"open"}),e=r.ownerDocument.createElement("span");return e.style.display="inline-block",r.appendChild(e),t.span=e,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}a(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(r,n),Object.defineProperty(r,"observedAttributes",{get:function(){return["data-value"]},enumerable:!1,configurable:!0}),r.prototype.attributeChangedCallback=function(t,n,r){if("data-value"===t){if(n===r)return;this.render(r||"")}},r.prototype.render=function(n){t.render(n,this.span,{throwOnError:!1,output:"mathml"})},r}(HTMLElement);window.customElements.get("w-e-formula-card")||window.customElements.define("w-e-formula-card",ge),n("en",{formula:{formula:"Formula",placeholder:"Use LateX syntax",insert:"Insert formula",edit:"Edit formula",ok:"OK"}}),n("zh-CN",{formula:{formula:"公式",placeholder:"使用 LateX 语法",insert:"插入公式",edit:"编辑公式",ok:"确定"}});var be,we,xe,Ee,Oe,Se,je,Te,Le,Ie,Pe,Ae,Me,Ce,Re,Ne={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>')}},_e={};function ke(){if(Ee)return xe;Ee=1;var t=function(){if(we)return be;we=1;var t=Yn(),n=it();return be=function(r){if("Function"===t(r))return n(r)}}(),n=fn(),r=ot(),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 Fe(){if(Se)return Oe;Se=1;var t=Yn();return Oe=Array.isArray||function(n){return"Array"===t(n)}}function He(){if(Te)return je;Te=1;var t=Fe(),n=ie(),r=Qt(),e=vt()("species"),o=Array;return je=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 De(){if(Ie)return Le;Ie=1;var t=He();return Le=function(n,r){return new(t(n))(0===r?0:r)}}function ze(){if(Ce)return Me;Ce=1;var t=vt(),n=ye(),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 _e;Re=1;var t=re(),n=function(){if(Ae)return Pe;Ae=1;var t=ke(),n=it(),r=cr(),e=ft(),o=Mr(),i=De(),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,d=5===n||s;return function(v,h,m,y){for(var g,b,w=e(v),x=r(w),E=o(x),O=t(h,m),S=0,j=y||i,T=c?j(v,E):f||p?j(v,0):void 0;E>S;S++)if((d||S in x)&&(b=O(g=x[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 Pe={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=ze(),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 $e,Be,Ve,We,Ue,qe,Ge,Ke,Xe,Ye,Je,Qe,Ze,to={};function no(){if(Be)return $e;Be=1;var t=Jn(),n=String;return $e=function(r){if("Symbol"===t(r))throw new TypeError("Cannot convert a Symbol value to a string");return n(r)}}function ro(){if(We)return Ve;We=1;var t=rn();return Ve=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 eo(){if(Qe)return Je;Qe=1;var t,n,r=en(),e=it(),o=no(),i=ro(),u=function(){if(qe)return Ue;qe=1;var t=et(),n=h().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 Ue={BROKEN_CARET:o,MISSED_STICKY:e,UNSUPPORTED_Y:r}}(),c=rt(),f=ye(),a=Gn().get,l=function(){if(Ke)return Ge;Ke=1;var t=et(),n=h().RegExp;return Ge=t(function(){var t=n(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)})}(),s=function(){if(Ye)return Xe;Ye=1;var t=et(),n=h().RegExp;return Xe=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),d=RegExp.prototype.exec,v=d,m=e("".charAt),y=e("".indexOf),g=e("".replace),b=e("".slice),w=(n=/b*/g,r(d,t=/a/,"a"),r(d,n,"a"),0!==t.lastIndex||0!==n.lastIndex),x=u.BROKEN_CARET,E=void 0!==/()??/.exec("")[1];return(w||E||x||l||s)&&(v=function(t){var n,e,u,c,l,s,h,O=this,S=a(O),j=o(t),T=S.raw;if(T)return T.lastIndex=O.lastIndex,n=r(v,T,j),O.lastIndex=T.lastIndex,n;var L=S.groups,I=x&&O.sticky,P=r(i,O),A=O.source,M=0,C=j;if(I&&(P=g(P,"y",""),-1===y(P,"g")&&(P+="g"),C=b(j,O.lastIndex),O.lastIndex>0&&(!O.multiline||O.multiline&&"\n"!==m(j,O.lastIndex-1))&&(A="(?: "+A+")",C=" "+C,M++),e=new RegExp("^(?:"+A+")",P)),E&&(e=new RegExp("^"+A+"$(?!\\s)",P)),w&&(u=O.lastIndex),c=r(d,I?e:O,C),I?c?(c.input=b(c.input,M),c[0]=b(c[0],M),c.index=O.lastIndex,O.lastIndex+=c[0].length):O.lastIndex=0:w&&c&&(O.lastIndex=O.global?c.index+c[0].length:u),E&&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[(h=L[l])[0]]=c[h[1]];return c}),Je=v}!function(){if(Ze)return to;Ze=1;var t=re(),n=eo();t({target:"RegExp",proto:!0,forced:/./.exec!==n},{exec:n})}();var oo,io,uo,co,fo,ao,lo,so={};function po(){return io?oo:(io=1,oo="\t\n\v\f\r \u2028\u2029\ufeff")}!function(){if(lo)return so;lo=1;var t=re(),n=function(){if(co)return uo;co=1;var t=it(),n=ct(),r=no(),e=po(),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 uo={start:c(1),end:c(2),trim:c(3)}}().trim,r=function(){if(ao)return fo;ao=1;var t=$n().PROPER,n=et(),r=po();return fo=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 vo,ho,mo={};function yo(t){return null!==t&&"object"==typeof t&&"constructor"in t&&t.constructor===Object}function go(t={},n={}){Object.keys(n).forEach(r=>{void 0===t[r]?t[r]=n[r]:yo(n[r])&&yo(t[r])&&Object.keys(n[r]).length>0&&go(t[r],n[r])})}ho||(ho=1,function(){if(vo)return mo;vo=1;var t=re(),n=h();t({global:!0,forced:n.globalThis!==n},{globalThis:n})}());const bo={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 wo(){const t="undefined"!=typeof document?document:{};return go(t,bo),t}const xo={document:bo,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 Eo(){const t="undefined"!=typeof window?window:{};return go(t,xo),t}class Oo 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 So(t,n){const r=Eo(),e=wo();let o=[];if(!n&&t instanceof Oo)return t;if(!t)return new Oo(o);if("string"==typeof t){const r=t.trim();if(r.indexOf("<")>=0&&r.indexOf(">")>=0){let t="div";0===r.indexOf("<li")&&(t="ul"),0===r.indexOf("<tr")&&(t="tbody"),0!==r.indexOf("<td")&&0!==r.indexOf("<th")||(t="tr"),0===r.indexOf("<tbody")&&(t="table"),0===r.indexOf("<option")&&(t="select");const n=e.createElement(t);n.innerHTML=r;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 r=[],e=n.querySelectorAll(t);for(let t=0;t<e.length;t+=1)r.push(e[t]);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 Oo)return t;o=t}return new Oo(function(t){const n=[];for(let r=0;r<t.length;r+=1)-1===n.indexOf(t[r])&&n.push(t[r]);return n}(o))}function jo(t){if(void 0===t){const t=this[0];if(!t)return;if(t.multiple&&"select"===t.nodeName.toLowerCase()){const n=[];for(let r=0;r<t.selectedOptions.length;r+=1)n.push(t.selectedOptions[r].value);return n}return t.value}for(let n=0;n<this.length;n+=1){const r=this[n];if(Array.isArray(t)&&r.multiple&&"select"===r.nodeName.toLowerCase())for(let n=0;n<r.options.length;n+=1)r.options[n].selected=t.indexOf(r.options[n].value)>=0;else r.value=t}return this}function To(...t){let[n,r,e,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),So(n).is(r))e.apply(n,o);else{const t=So(n).parents();for(let n=0;n<t.length;n+=1)So(t[n]).is(r)&&e.apply(t[n],o)}}function u(t){const n=t&&t.target&&t.target.dom7EventData||[];n.indexOf(t)<0&&n.unshift(t),e.apply(this,n)}"function"==typeof t[1]&&([n,e,o]=t,r=void 0),o||(o=!1);const c=n.split(" ");let f;for(let t=0;t<this.length;t+=1){const n=this[t];if(r)for(f=0;f<c.length;f+=1){const t=c[f];n.dom7LiveListeners||(n.dom7LiveListeners={}),n.dom7LiveListeners[t]||(n.dom7LiveListeners[t]=[]),n.dom7LiveListeners[t].push({listener:e,proxyListener:i}),n.addEventListener(t,i,o)}else for(f=0;f<c.length;f+=1){const t=c[f];n.dom7Listeners||(n.dom7Listeners={}),n.dom7Listeners[t]||(n.dom7Listeners[t]=[]),n.dom7Listeners[t].push({listener:e,proxyListener:u}),n.addEventListener(t,u,o)}}return this}function Lo(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 Io(t){const n=Eo(),r=wo(),e=this[0];let o,i;if(!e||void 0===t)return!1;if("string"==typeof t){if(e.matches)return e.matches(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);for(o=So(t),i=0;i<o.length;i+=1)if(o[i]===e)return!0;return!1}if(t===r)return e===r;if(t===n)return e===n;if(t.nodeType||t instanceof Oo){for(o=t.nodeType?[t]:t,i=0;i<o.length;i+=1)if(o[i]===e)return!0;return!1}return!1}function Po(...t){let n;const r=wo();for(let e=0;e<t.length;e+=1){n=t[e];for(let t=0;t<this.length;t+=1)if("string"==typeof n){const e=r.createElement("div");for(e.innerHTML=n;e.firstChild;)this[t].appendChild(e.firstChild)}else if(n instanceof Oo)for(let r=0;r<n.length;r+=1)this[t].appendChild(n[r]);else this[t].appendChild(n)}return this}function Ao(t){const n=[];for(let r=0;r<this.length;r+=1){let e=this[r].parentNode;for(;e;)t?So(e).is(t)&&n.push(e):n.push(e),e=e.parentNode}return So(n)}function Mo(t){const n=[];for(let r=0;r<this.length;r+=1){const e=this[r].querySelectorAll(t);for(let t=0;t<e.length;t+=1)n.push(e[t])}return So(n)}So.fn=Oo.prototype;const Co="resize scroll".split(" ");const Ro=(No="focus",function(...t){if(void 0===t[0]){for(let t=0;t<this.length;t+=1)Co.indexOf(No)<0&&(No in this[t]?this[t][No]():So(this[t]).trigger(No));return this}return this.on(No,...t)});var No;Po&&(So.fn.append=Po),Lo&&(So.fn.html=Lo),jo&&(So.fn.val=jo),To&&(So.fn.on=To),Ro&&(So.fn.focus=Ro),Io&&(So.fn.is=Io),Ao&&(So.fn.parents=Ao),Mo&&(So.fn.find=Mo);var _o,ko,Fo,Ho,Do,zo,$o,Bo={};function Vo(){if(ko)return _o;ko=1;var t=TypeError;return _o=function(n){if(n>9007199254740991)throw t("Maximum allowed index exceeded");return n}}function Wo(){if(Ho)return Fo;Ho=1;var t=Jt(),n=dn(),r=Vn();return Fo=function(e,o,i){t?n.f(e,o,r(0,i)):e[o]=i}}function Uo(){if(zo)return Do;zo=1;var t=et(),n=vt(),r=st(),e=n("species");return Do=function(n){return r>=51||!t(function(){var t=[];return(t.constructor={})[e]=function(){return{foo:1}},1!==t[n](Boolean).foo})}}!function(){if($o)return Bo;$o=1;var t=re(),n=et(),r=Fe(),e=Qt(),o=ft(),i=Mr(),u=Vo(),c=Wo(),f=De(),a=Uo(),l=vt(),s=st(),p=l("isConcatSpreadable"),d=s>=51||!n(function(){var t=[];return t[p]=!1,t.concat()[0]!==t}),v=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:!d||!a("concat")},{concat:function(t){var n,r,e,a,l,s=o(this),p=f(s,0),d=0;for(n=-1,e=arguments.length;n<e;n++)if(v(l=-1===n?s:arguments[n]))for(a=i(l),u(d+a),r=0;r<a;r++,d++)r in l&&c(p,d,l[r]);else u(d+1),c(p,d++,l);return p.length=d,p}})}();function qo(t){return"".concat(t,"-").concat(((t=21)=>{let n="",r=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)n+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&r[t]];return n})())}function Go(){return qo("w-e-insert-formula")}var Ko=function(){function t(){this.title=r("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=Go(),this.buttonId=Go()}return t.prototype.getSelectedElem=function(t){var n=e.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||(!!o.isExpanded(n)||null==this.getSelectedElem(t))},t.prototype.getModalPositionNode=function(t){return this.getSelectedElem(t)},t.prototype.getModalContentElem=function(t){var n=this,e=this.textareaId,o=this.buttonId,c=l(i(r("formula.formula"),e,r("formula.placeholder")),2),f=c[0],a=So(c[1]),s=l(u(o,r("formula.ok")),1)[0];if(null==this.$content){var p=So("<div></div>");p.on("click","#".concat(o),function(r){r.preventDefault();var o=p.find("#".concat(e)).val().trim();n.updateFormula(t,o),t.hidePanelOrModal()}),this.$content=p}var d=this.$content;d.html(""),d.append(f),d.append(s);var v=this.getValue(t);return a.val(v),setTimeout(function(){a.focus()}),d[0]},t.prototype.updateFormula=function(t,n){if(n&&(t.restoreSelection(),!this.isDisabled(t))){var r=this.getSelectedElem(t);if(null!=r){var o=e.findPath(t,r),i={value:n};c.setNodes(t,i,{at:o})}}},t}();function Xo(){return qo("w-e-insert-formula")}var Yo=function(){function t(){this.title=r("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=Xo(),this.buttonId=Xo()}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(o.isExpanded(n))return!0;var r=e.getSelectedElems(t);return!!r.some(function(n){return t.isVoid(n)})||!!r.some(function(t){return"pre"===e.getNodeType(t)})},t.prototype.getModalPositionNode=function(t){return null},t.prototype.getModalContentElem=function(t){var n=this,e=this.textareaId,o=this.buttonId,c=l(i(r("formula.formula"),e,r("formula.placeholder")),2),f=c[0],a=So(c[1]),s=l(u(o,r("formula.ok")),1)[0];if(null==this.$content){var p=So("<div></div>");p.on("click","#".concat(o),function(r){r.preventDefault();var o=p.find("#".concat(e)).val().trim();n.insertFormula(t,o),t.hidePanelOrModal()}),this.$content=p}var d=this.$content;return d.html(""),d.append(f),d.append(s),a.val(""),setTimeout(function(){a.focus()}),d[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 Jo={editorPlugin:function(t){var n=t.isInline,r=t.isVoid,o=t;return o.isInline=function(t){return"formula"===e.getNodeType(t)||n(t)},o.isVoid=function(t){return"formula"===e.getNodeType(t)||r(t)},o},renderElems:[{type:"formula",renderElem:function(t,n,r){var o=e.isNodeSelected(r,t),i=t.value,u=f("w-e-formula-card",{dataset:{value:void 0===i?"":i}},null);return f("div",{className:"w-e-textarea-formula-container",props:{contentEditable:!1},style:{display:"inline-block",marginLeft:"3px",marginRight:"3px",border:o?"2px solid var(--w-e-textarea-selected-border-color)":"2px solid transparent",borderRadius:"3px",padding:"3px 3px"}},[u])}}],elemsToHtml:[Ne],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 Yo}},{key:"editFormula",factory:function(){return new Ko}}]};export{Jo as default};
|
1
|
+
import t from"katex";import{i18nAddResources as n,t as r,DomEditor as e,SlateRange as o,genModalTextareaElems as i,genModalButtonElems as u,SlateTransforms as c}from"@wangeditor-next/editor";import{h as f}from"snabbdom";var a=function(t,n){return a=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])},a(t,n)};function l(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 s,p,d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},v={};function h(){if(p)return s;p=1;var t=function(t){return t&&t.Math===Math&&t};return s=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof d&&d)||t("object"==typeof s&&s)||function(){return this}()||Function("return this")()}var m,y,g,b,w,x,E,O,S,j,T,L,I,P,A,M,C,R,N,_,k,F,H,D,z,$,B,V,W,U,q,G,K,X,Y,J,Q,Z={exports:{}};function tt(){if(b)return g;b=1;var t=h(),n=Object.defineProperty;return g=function(r,e){try{n(t,r,{value:e,configurable:!0,writable:!0})}catch(n){t[r]=e}return e}}function nt(){if(w)return Z.exports;w=1;var t=y?m:(y=1,m=!1),n=h(),r=tt(),e="__core-js_shared__",o=Z.exports=n[e]||r(e,{});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"}),Z.exports}function rt(){if(E)return x;E=1;var t=nt();return x=function(n,r){return t[n]||(t[n]=r||{})}}function et(){return S?O:(S=1,O=function(t){try{return!!t()}catch(t){return!0}})}function ot(){if(T)return j;T=1;var t=et();return j=!t(function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})}function it(){if(I)return L;I=1;var t=ot(),n=Function.prototype,r=n.call,e=t&&n.bind.bind(r,r);return L=t?e:function(t){return function(){return r.apply(t,arguments)}},L}function ut(){return A?P:(A=1,P=function(t){return null==t})}function ct(){if(C)return M;C=1;var t=ut(),n=TypeError;return M=function(r){if(t(r))throw new n("Can't call method on "+r);return r}}function ft(){if(N)return R;N=1;var t=ct(),n=Object;return R=function(r){return n(t(r))}}function at(){if(k)return _;k=1;var t=it(),n=ft(),r=t({}.hasOwnProperty);return _=Object.hasOwn||function(t,e){return r(n(t),e)}}function lt(){if(H)return F;H=1;var t=it(),n=0,r=Math.random(),e=t(1.1.toString);return F=function(t){return"Symbol("+(void 0===t?"":t)+")_"+e(++n+r,36)}}function st(){if(B)return $;B=1;var t,n,r=h(),e=function(){if(z)return D;z=1;var t=h().navigator,n=t&&t.userAgent;return D=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]),$=n}function pt(){if(W)return V;W=1;var t=st(),n=et(),r=h().String;return V=!!Object.getOwnPropertySymbols&&!n(function(){var n=Symbol("symbol detection");return!r(n)||!(Object(n)instanceof Symbol)||!Symbol.sham&&t&&t<41})}function dt(){if(q)return U;q=1;var t=pt();return U=t&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}function vt(){if(K)return G;K=1;var t=h(),n=rt(),r=at(),e=lt(),o=pt(),i=dt(),u=t.Symbol,c=n("wks"),f=i?u.for||u:u&&u.withoutSetter||e;return G=function(t){return r(c,t)||(c[t]=o&&r(u,t)?u[t]:f("Symbol."+t)),c[t]}}function ht(){if(Y)return X;Y=1;var t={};return t[vt()("toStringTag")]="z",X="[object z]"===String(t)}function mt(){if(Q)return J;Q=1;var t="object"==typeof document&&document.all;return J=void 0===t&&void 0!==t?function(n){return"function"==typeof n||n===t}:function(t){return"function"==typeof t}}var yt,gt,bt,wt,xt,Et,Ot,St,jt,Tt,Lt,It,Pt,At,Mt,Ct,Rt,Nt,_t,kt,Ft,Ht,Dt,zt,$t,Bt,Vt,Wt,Ut,qt,Gt,Kt,Xt,Yt={};function Jt(){if(gt)return yt;gt=1;var t=et();return yt=!t(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})}function Qt(){if(wt)return bt;wt=1;var t=mt();return bt=function(n){return"object"==typeof n?null!==n:t(n)}}function Zt(){if(Et)return xt;Et=1;var t=h(),n=Qt(),r=t.document,e=n(r)&&n(r.createElement);return xt=function(t){return e?r.createElement(t):{}}}function tn(){if(St)return Ot;St=1;var t=Jt(),n=et(),r=Zt();return Ot=!t&&!n(function(){return 7!==Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a})}function nn(){if(Tt)return jt;Tt=1;var t=Jt(),n=et();return jt=t&&n(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})}function rn(){if(It)return Lt;It=1;var t=Qt(),n=String,r=TypeError;return Lt=function(e){if(t(e))return e;throw new r(n(e)+" is not an object")}}function en(){if(At)return Pt;At=1;var t=ot(),n=Function.prototype.call;return Pt=t?n.bind(n):function(){return n.apply(n,arguments)},Pt}function on(){if(Ct)return Mt;Ct=1;var t=h(),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 un(){if(kt)return _t;kt=1;var t=on(),n=mt(),r=function(){if(Nt)return Rt;Nt=1;var t=it();return Rt=t({}.isPrototypeOf)}(),e=dt(),o=Object;return _t=e?function(t){return"symbol"==typeof t}:function(e){var i=t("Symbol");return n(i)&&r(i.prototype,o(e))}}function cn(){if(Ht)return Ft;Ht=1;var t=String;return Ft=function(n){try{return t(n)}catch(t){return"Object"}}}function fn(){if(zt)return Dt;zt=1;var t=mt(),n=cn(),r=TypeError;return Dt=function(e){if(t(e))return e;throw new r(n(e)+" is not a function")}}function an(){if(Bt)return $t;Bt=1;var t=fn(),n=ut();return $t=function(r,e){var o=r[e];return n(o)?void 0:t(o)}}function ln(){if(Wt)return Vt;Wt=1;var t=en(),n=mt(),r=Qt(),e=TypeError;return Vt=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")},Vt}function sn(){if(qt)return Ut;qt=1;var t=en(),n=Qt(),r=un(),e=an(),o=ln(),i=vt(),u=TypeError,c=i("toPrimitive");return Ut=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 pn(){if(Kt)return Gt;Kt=1;var t=sn(),n=un();return Gt=function(r){var e=t(r,"string");return n(e)?e:e+""}}function dn(){if(Xt)return Yt;Xt=1;var t=Jt(),n=tn(),r=nn(),e=rn(),o=pn(),i=TypeError,u=Object.defineProperty,c=Object.getOwnPropertyDescriptor,f="enumerable",a="configurable",l="writable";return Yt.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},Yt}var vn,hn,mn,yn,gn,bn,wn,xn,En,On,Sn,jn,Tn,Ln,In,Pn,An,Mn,Cn,Rn,Nn,_n,kn,Fn,Hn,Dn,zn={exports:{}};function $n(){if(hn)return vn;hn=1;var t=Jt(),n=at(),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 vn={EXISTS:o,PROPER:i,CONFIGURABLE:u}}function Bn(){if(yn)return mn;yn=1;var t=it(),n=mt(),r=nt(),e=t(Function.toString);return n(r.inspectSource)||(r.inspectSource=function(t){return e(t)}),mn=r.inspectSource}function Vn(){return xn?wn:(xn=1,wn=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}})}function Wn(){if(On)return En;On=1;var t=Jt(),n=dn(),r=Vn();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 Un(){if(jn)return Sn;jn=1;var t=rt(),n=lt(),r=t("keys");return Sn=function(t){return r[t]||(r[t]=n(t))}}function qn(){return Ln?Tn:(Ln=1,Tn={})}function Gn(){if(Pn)return In;Pn=1;var t,n,r,e=function(){if(bn)return gn;bn=1;var t=h(),n=mt(),r=t.WeakMap;return gn=n(r)&&/native code/.test(String(r))}(),o=h(),i=Qt(),u=Wn(),c=at(),f=nt(),a=Un(),l=qn(),s="Object already initialized",p=o.TypeError,d=o.WeakMap;if(e||f.state){var v=f.state||(f.state=new d);v.get=v.get,v.has=v.has,v.set=v.set,t=function(t,n){if(v.has(t))throw new p(s);return n.facade=t,v.set(t,n),n},n=function(t){return v.get(t)||{}},r=function(t){return v.has(t)}}else{var m=a("state");l[m]=!0,t=function(t,n){if(c(t,m))throw new p(s);return n.facade=t,u(t,m,n),n},n=function(t){return c(t,m)?t[m]:{}},r=function(t){return c(t,m)}}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 Kn(){if(An)return zn.exports;An=1;var t=it(),n=et(),r=mt(),e=at(),o=Jt(),i=$n().CONFIGURABLE,u=Bn(),c=Gn(),f=c.enforce,a=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=zn.exports=function(t,n,r){"Symbol("===p(l(n),0,7)&&(n="["+d(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=v(m,"string"==typeof n?n:"")),t};return Function.prototype.toString=y(function(){return r(this)&&a(this).source||u(this)},"toString"),zn.exports}function Xn(){if(Cn)return Mn;Cn=1;var t=mt(),n=dn(),r=Kn(),e=tt();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 Yn(){if(Nn)return Rn;Nn=1;var t=it(),n=t({}.toString),r=t("".slice);return Rn=function(t){return r(n(t),8,-1)}}function Jn(){if(kn)return _n;kn=1;var t=ht(),n=mt(),r=Yn(),e=vt()("toStringTag"),o=Object,i="Arguments"===r(function(){return arguments}());return _n=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(Dn)return v;Dn=1;var t=ht(),n=Xn(),r=function(){if(Hn)return Fn;Hn=1;var t=ht(),n=Jn();return Fn=t?{}.toString:function(){return"[object "+n(this)+"]"}}();t||n(Object.prototype,"toString",r,{unsafe:!0})}();var Qn,Zn,tr,nr,rr,er,or={},ir={},ur={};function cr(){if(tr)return Zn;tr=1;var t=it(),n=et(),r=Yn(),e=Object,o=t("".split);return Zn=n(function(){return!e("z").propertyIsEnumerable(0)})?function(t){return"String"===r(t)?o(t,""):e(t)}:e}function fr(){if(rr)return nr;rr=1;var t=cr(),n=ct();return nr=function(r){return t(n(r))}}function ar(){if(er)return ir;er=1;var t=Jt(),n=en(),r=function(){if(Qn)return ur;Qn=1;var t={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,r=n&&!t.call({1:2},1);return ur.f=r?function(t){var r=n(this,t);return!!r&&r.enumerable}:t,ur}(),e=Vn(),o=fr(),i=pn(),u=at(),c=tn(),f=Object.getOwnPropertyDescriptor;return ir.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])},ir}var lr,sr,pr,dr,vr,hr,mr,yr,gr,br,wr,xr,Er,Or,Sr,jr,Tr,Lr={};function Ir(){if(dr)return pr;dr=1;var t=function(){if(sr)return lr;sr=1;var t=Math.ceil,n=Math.floor;return lr=Math.trunc||function(r){var e=+r;return(e>0?n:t)(e)}}();return pr=function(n){var r=+n;return r!=r||0===r?0:t(r)}}function Pr(){if(hr)return vr;hr=1;var t=Ir(),n=Math.max,r=Math.min;return vr=function(e,o){var i=t(e);return i<0?n(i+o,0):r(i,o)}}function Ar(){if(yr)return mr;yr=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(br)return gr;br=1;var t=Ar();return gr=function(n){return t(n.length)}}function Cr(){if(Or)return Er;Or=1;var t=it(),n=at(),r=fr(),e=function(){if(xr)return wr;xr=1;var t=fr(),n=Pr(),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 wr={includes:e(!0),indexOf:e(!1)}}().indexOf,o=qn(),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 jr?Sr:(jr=1,Sr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var Nr,_r,kr,Fr,Hr,Dr,zr,$r,Br,Vr,Wr,Ur,qr,Gr,Kr,Xr,Yr,Jr,Qr,Zr={};function te(){if(kr)return _r;kr=1;var t=on(),n=it(),r=function(){if(Tr)return Lr;Tr=1;var t=Cr(),n=Rr().concat("length","prototype");return Lr.f=Object.getOwnPropertyNames||function(r){return t(r,n)},Lr}(),e=(Nr||(Nr=1,Zr.f=Object.getOwnPropertySymbols),Zr),o=rn(),i=n([].concat);return _r=t("Reflect","ownKeys")||function(t){var n=r.f(o(t)),u=e.f;return u?i(n,u(t)):n}}function ne(){if(Hr)return Fr;Hr=1;var t=at(),n=te(),r=ar(),e=dn();return Fr=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 re(){if(Br)return $r;Br=1;var t=h(),n=ar().f,r=Wn(),e=Xn(),o=tt(),i=ne(),u=function(){if(zr)return Dr;zr=1;var t=et(),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 Dr=e}();return $r=function(c,f){var a,l,s,p,d,v=c.target,h=c.global,m=c.stat;if(a=h?t:m?t[v]||o(v,{}):t[v]&&t[v].prototype)for(l in f){if(p=f[l],s=c.dontCallGetSet?(d=n(a,l))&&d.value:a[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)&&r(p,"sham",!0),e(a,l,p,c)}}}function ee(){if(qr)return Ur;qr=1;var t=it();return Ur=t([].slice)}function oe(){if(Kr)return Gr;Kr=1;var t=it(),n=fn(),r=Qt(),e=at(),o=ee(),i=ot(),u=Function,c=t([].concat),f=t([].join),a={};return Gr=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},Gr}function ie(){if(Yr)return Xr;Yr=1;var t=it(),n=et(),r=mt(),e=Jn(),o=on(),i=Bn(),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,Xr=!c||n(function(){var t;return s(s.call)||!s(Object)||!s(function(){t=!0})||t})?p:s}function ue(){if(Qr)return Jr;Qr=1;var t=ie(),n=cn(),r=TypeError;return Jr=function(e){if(t(e))return e;throw new r(n(e)+" is not a constructor")}}var ce,fe,ae,le,se,pe,de,ve,he={};function me(){if(fe)return ce;fe=1;var t=Cr(),n=Rr();return ce=Object.keys||function(r){return t(r,n)}}function ye(){if(de)return pe;de=1;var t,n=rn(),r=function(){if(ae)return he;ae=1;var t=Jt(),n=nn(),r=dn(),e=rn(),o=fr(),i=me();return he.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},he}(),e=Rr(),o=qn(),i=function(){if(se)return le;se=1;var t=on();return le=t("document","documentElement")}(),u=Zt(),c=Un(),f="prototype",a="script",l=c("IE_PROTO"),s=function(){},p=function(t){return"<"+a+">"+t+"</"+a+">"},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,r,o;v="undefined"!=typeof document?document.domain&&t?d(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):d(t);for(var c=e.length;c--;)delete v[f][e[c]];return v()};return o[l]=!0,pe=Object.create||function(t,e){var o;return null!==t?(s[f]=n(t),o=new s,s[f]=null,o[l]=t):o=v(),void 0===e?o:r.f(o,e)}}!function(){if(ve)return or;ve=1;var t=re(),n=on(),r=function(){if(Wr)return Vr;Wr=1;var t=ot(),n=Function.prototype,r=n.apply,e=n.call;return Vr="object"==typeof Reflect&&Reflect.apply||(t?e.bind(r):function(){return e.apply(r,arguments)}),Vr}(),e=oe(),o=ue(),i=rn(),u=Qt(),c=ye(),f=et(),a=n("Reflect","construct"),l=Object.prototype,s=[].push,p=f(function(){function t(){}return!(a(function(){},[],t)instanceof t)}),d=!f(function(){a(function(){})}),v=p||d;t({target:"Reflect",stat:!0,forced:v,sham:v},{construct:function(t,n){o(t),i(n);var f=arguments.length<3?t:o(arguments[2]);if(d&&!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 v=[null];return r(s,v,n),new(r(e,t,v))}var h=f.prototype,m=c(u(h)?h:l),y=r(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 ge=function(n){function r(){var t=n.call(this)||this,r=t.attachShadow({mode:"open"}),e=r.ownerDocument.createElement("span");return e.style.display="inline-block",r.appendChild(e),t.span=e,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}a(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(r,n),Object.defineProperty(r,"observedAttributes",{get:function(){return["data-value"]},enumerable:!1,configurable:!0}),r.prototype.attributeChangedCallback=function(t,n,r){if("data-value"===t){if(n===r)return;this.render(r||"")}},r.prototype.render=function(n){t.render(n,this.span,{throwOnError:!1,output:"mathml"})},r}(HTMLElement);window.customElements.get("w-e-formula-card")||window.customElements.define("w-e-formula-card",ge),n("en",{formula:{formula:"Formula",placeholder:"Use LateX syntax",insert:"Insert formula",edit:"Edit formula",ok:"OK"}}),n("zh-CN",{formula:{formula:"公式",placeholder:"使用 LateX 语法",insert:"插入公式",edit:"编辑公式",ok:"确定"}});var be,we,xe,Ee,Oe,Se,je,Te,Le,Ie,Pe,Ae,Me,Ce,Re,Ne={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>')}},_e={};function ke(){if(Ee)return xe;Ee=1;var t=function(){if(we)return be;we=1;var t=Yn(),n=it();return be=function(r){if("Function"===t(r))return n(r)}}(),n=fn(),r=ot(),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 Fe(){if(Se)return Oe;Se=1;var t=Yn();return Oe=Array.isArray||function(n){return"Array"===t(n)}}function He(){if(Te)return je;Te=1;var t=Fe(),n=ie(),r=Qt(),e=vt()("species"),o=Array;return je=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 De(){if(Ie)return Le;Ie=1;var t=He();return Le=function(n,r){return new(t(n))(0===r?0:r)}}function ze(){if(Ce)return Me;Ce=1;var t=vt(),n=ye(),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 _e;Re=1;var t=re(),n=function(){if(Ae)return Pe;Ae=1;var t=ke(),n=it(),r=cr(),e=ft(),o=Mr(),i=De(),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,d=5===n||s;return function(v,h,m,y){for(var g,b,w=e(v),x=r(w),E=o(x),O=t(h,m),S=0,j=y||i,T=c?j(v,E):f||p?j(v,0):void 0;E>S;S++)if((d||S in x)&&(b=O(g=x[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 Pe={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=ze(),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 $e,Be,Ve,We,Ue,qe,Ge,Ke,Xe,Ye,Je,Qe,Ze,to={};function no(){if(Be)return $e;Be=1;var t=Jn(),n=String;return $e=function(r){if("Symbol"===t(r))throw new TypeError("Cannot convert a Symbol value to a string");return n(r)}}function ro(){if(We)return Ve;We=1;var t=rn();return Ve=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 eo(){if(Qe)return Je;Qe=1;var t,n,r=en(),e=it(),o=no(),i=ro(),u=function(){if(qe)return Ue;qe=1;var t=et(),n=h().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 Ue={BROKEN_CARET:o,MISSED_STICKY:e,UNSUPPORTED_Y:r}}(),c=rt(),f=ye(),a=Gn().get,l=function(){if(Ke)return Ge;Ke=1;var t=et(),n=h().RegExp;return Ge=t(function(){var t=n(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)})}(),s=function(){if(Ye)return Xe;Ye=1;var t=et(),n=h().RegExp;return Xe=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),d=RegExp.prototype.exec,v=d,m=e("".charAt),y=e("".indexOf),g=e("".replace),b=e("".slice),w=(n=/b*/g,r(d,t=/a/,"a"),r(d,n,"a"),0!==t.lastIndex||0!==n.lastIndex),x=u.BROKEN_CARET,E=void 0!==/()??/.exec("")[1];return(w||E||x||l||s)&&(v=function(t){var n,e,u,c,l,s,h,O=this,S=a(O),j=o(t),T=S.raw;if(T)return T.lastIndex=O.lastIndex,n=r(v,T,j),O.lastIndex=T.lastIndex,n;var L=S.groups,I=x&&O.sticky,P=r(i,O),A=O.source,M=0,C=j;if(I&&(P=g(P,"y",""),-1===y(P,"g")&&(P+="g"),C=b(j,O.lastIndex),O.lastIndex>0&&(!O.multiline||O.multiline&&"\n"!==m(j,O.lastIndex-1))&&(A="(?: "+A+")",C=" "+C,M++),e=new RegExp("^(?:"+A+")",P)),E&&(e=new RegExp("^"+A+"$(?!\\s)",P)),w&&(u=O.lastIndex),c=r(d,I?e:O,C),I?c?(c.input=b(c.input,M),c[0]=b(c[0],M),c.index=O.lastIndex,O.lastIndex+=c[0].length):O.lastIndex=0:w&&c&&(O.lastIndex=O.global?c.index+c[0].length:u),E&&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[(h=L[l])[0]]=c[h[1]];return c}),Je=v}!function(){if(Ze)return to;Ze=1;var t=re(),n=eo();t({target:"RegExp",proto:!0,forced:/./.exec!==n},{exec:n})}();var oo,io,uo,co,fo,ao,lo,so={};function po(){return io?oo:(io=1,oo="\t\n\v\f\r \u2028\u2029\ufeff")}!function(){if(lo)return so;lo=1;var t=re(),n=function(){if(co)return uo;co=1;var t=it(),n=ct(),r=no(),e=po(),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 uo={start:c(1),end:c(2),trim:c(3)}}().trim,r=function(){if(ao)return fo;ao=1;var t=$n().PROPER,n=et(),r=po();return fo=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 vo,ho,mo={};function yo(t){return null!==t&&"object"==typeof t&&"constructor"in t&&t.constructor===Object}function go(t={},n={}){Object.keys(n).forEach(r=>{void 0===t[r]?t[r]=n[r]:yo(n[r])&&yo(t[r])&&Object.keys(n[r]).length>0&&go(t[r],n[r])})}ho||(ho=1,function(){if(vo)return mo;vo=1;var t=re(),n=h();t({global:!0,forced:n.globalThis!==n},{globalThis:n})}());const bo={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 wo(){const t="undefined"!=typeof document?document:{};return go(t,bo),t}const xo={document:bo,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 Eo(){const t="undefined"!=typeof window?window:{};return go(t,xo),t}class Oo 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 So(t,n){const r=Eo(),e=wo();let o=[];if(!n&&t instanceof Oo)return t;if(!t)return new Oo(o);if("string"==typeof t){const r=t.trim();if(r.indexOf("<")>=0&&r.indexOf(">")>=0){let t="div";0===r.indexOf("<li")&&(t="ul"),0===r.indexOf("<tr")&&(t="tbody"),0!==r.indexOf("<td")&&0!==r.indexOf("<th")||(t="tr"),0===r.indexOf("<tbody")&&(t="table"),0===r.indexOf("<option")&&(t="select");const n=e.createElement(t);n.innerHTML=r;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 r=[],e=n.querySelectorAll(t);for(let t=0;t<e.length;t+=1)r.push(e[t]);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 Oo)return t;o=t}return new Oo(function(t){const n=[];for(let r=0;r<t.length;r+=1)-1===n.indexOf(t[r])&&n.push(t[r]);return n}(o))}function jo(t){if(void 0===t){const t=this[0];if(!t)return;if(t.multiple&&"select"===t.nodeName.toLowerCase()){const n=[];for(let r=0;r<t.selectedOptions.length;r+=1)n.push(t.selectedOptions[r].value);return n}return t.value}for(let n=0;n<this.length;n+=1){const r=this[n];if(Array.isArray(t)&&r.multiple&&"select"===r.nodeName.toLowerCase())for(let n=0;n<r.options.length;n+=1)r.options[n].selected=t.indexOf(r.options[n].value)>=0;else r.value=t}return this}function To(...t){let[n,r,e,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),So(n).is(r))e.apply(n,o);else{const t=So(n).parents();for(let n=0;n<t.length;n+=1)So(t[n]).is(r)&&e.apply(t[n],o)}}function u(t){const n=t&&t.target&&t.target.dom7EventData||[];n.indexOf(t)<0&&n.unshift(t),e.apply(this,n)}"function"==typeof t[1]&&([n,e,o]=t,r=void 0),o||(o=!1);const c=n.split(" ");let f;for(let t=0;t<this.length;t+=1){const n=this[t];if(r)for(f=0;f<c.length;f+=1){const t=c[f];n.dom7LiveListeners||(n.dom7LiveListeners={}),n.dom7LiveListeners[t]||(n.dom7LiveListeners[t]=[]),n.dom7LiveListeners[t].push({listener:e,proxyListener:i}),n.addEventListener(t,i,o)}else for(f=0;f<c.length;f+=1){const t=c[f];n.dom7Listeners||(n.dom7Listeners={}),n.dom7Listeners[t]||(n.dom7Listeners[t]=[]),n.dom7Listeners[t].push({listener:e,proxyListener:u}),n.addEventListener(t,u,o)}}return this}function Lo(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 Io(t){const n=Eo(),r=wo(),e=this[0];let o,i;if(!e||void 0===t)return!1;if("string"==typeof t){if(e.matches)return e.matches(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);for(o=So(t),i=0;i<o.length;i+=1)if(o[i]===e)return!0;return!1}if(t===r)return e===r;if(t===n)return e===n;if(t.nodeType||t instanceof Oo){for(o=t.nodeType?[t]:t,i=0;i<o.length;i+=1)if(o[i]===e)return!0;return!1}return!1}function Po(...t){let n;const r=wo();for(let e=0;e<t.length;e+=1){n=t[e];for(let t=0;t<this.length;t+=1)if("string"==typeof n){const e=r.createElement("div");for(e.innerHTML=n;e.firstChild;)this[t].appendChild(e.firstChild)}else if(n instanceof Oo)for(let r=0;r<n.length;r+=1)this[t].appendChild(n[r]);else this[t].appendChild(n)}return this}function Ao(t){const n=[];for(let r=0;r<this.length;r+=1){let e=this[r].parentNode;for(;e;)t?So(e).is(t)&&n.push(e):n.push(e),e=e.parentNode}return So(n)}function Mo(t){const n=[];for(let r=0;r<this.length;r+=1){const e=this[r].querySelectorAll(t);for(let t=0;t<e.length;t+=1)n.push(e[t])}return So(n)}So.fn=Oo.prototype;const Co="resize scroll".split(" ");const Ro=(No="focus",function(...t){if(void 0===t[0]){for(let t=0;t<this.length;t+=1)Co.indexOf(No)<0&&(No in this[t]?this[t][No]():So(this[t]).trigger(No));return this}return this.on(No,...t)});var No;Po&&(So.fn.append=Po),Lo&&(So.fn.html=Lo),jo&&(So.fn.val=jo),To&&(So.fn.on=To),Ro&&(So.fn.focus=Ro),Io&&(So.fn.is=Io),Ao&&(So.fn.parents=Ao),Mo&&(So.fn.find=Mo);var _o,ko,Fo,Ho,Do,zo,$o,Bo={};function Vo(){if(ko)return _o;ko=1;var t=TypeError;return _o=function(n){if(n>9007199254740991)throw t("Maximum allowed index exceeded");return n}}function Wo(){if(Ho)return Fo;Ho=1;var t=Jt(),n=dn(),r=Vn();return Fo=function(e,o,i){t?n.f(e,o,r(0,i)):e[o]=i}}function Uo(){if(zo)return Do;zo=1;var t=et(),n=vt(),r=st(),e=n("species");return Do=function(n){return r>=51||!t(function(){var t=[];return(t.constructor={})[e]=function(){return{foo:1}},1!==t[n](Boolean).foo})}}!function(){if($o)return Bo;$o=1;var t=re(),n=et(),r=Fe(),e=Qt(),o=ft(),i=Mr(),u=Vo(),c=Wo(),f=De(),a=Uo(),l=vt(),s=st(),p=l("isConcatSpreadable"),d=s>=51||!n(function(){var t=[];return t[p]=!1,t.concat()[0]!==t}),v=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:!d||!a("concat")},{concat:function(t){var n,r,e,a,l,s=o(this),p=f(s,0),d=0;for(n=-1,e=arguments.length;n<e;n++)if(v(l=-1===n?s:arguments[n]))for(a=i(l),u(d+a),r=0;r<a;r++,d++)r in l&&c(p,d,l[r]);else u(d+1),c(p,d++,l);return p.length=d,p}})}();function qo(t){return"".concat(t,"-").concat(((t=21)=>{let n="",r=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)n+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&r[t]];return n})())}function Go(){return qo("w-e-insert-formula")}var Ko=function(){function t(){this.title=r("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=Go(),this.buttonId=Go()}return t.prototype.getSelectedElem=function(t){var n=e.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||(!!o.isExpanded(n)||null==this.getSelectedElem(t))},t.prototype.getModalPositionNode=function(t){return this.getSelectedElem(t)},t.prototype.getModalContentElem=function(t){var n=this,e=this.textareaId,o=this.buttonId,c=l(i(r("formula.formula"),e,r("formula.placeholder")),2),f=c[0],a=So(c[1]),s=l(u(o,r("formula.ok")),1)[0];if(null==this.$content){var p=So("<div></div>");p.on("click","#".concat(o),function(r){r.preventDefault();var o=p.find("#".concat(e)).val().trim();n.updateFormula(t,o),t.hidePanelOrModal()}),this.$content=p}var d=this.$content;d.html(""),d.append(f),d.append(s);var v=this.getValue(t);return a.val(v),setTimeout(function(){a.focus()}),d[0]},t.prototype.updateFormula=function(t,n){if(n&&(t.restoreSelection(),!this.isDisabled(t))){var r=this.getSelectedElem(t);if(null!=r){var o=e.findPath(t,r),i={value:n};c.setNodes(t,i,{at:o})}}},t}();function Xo(){return qo("w-e-insert-formula")}var Yo=function(){function t(){this.title=r("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=Xo(),this.buttonId=Xo()}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(o.isExpanded(n))return!0;var r=e.getSelectedElems(t);return!!r.some(function(n){return t.isVoid(n)})||!!r.some(function(t){return"pre"===e.getNodeType(t)})},t.prototype.getModalPositionNode=function(t){return null},t.prototype.getModalContentElem=function(t){var n=this,e=this.textareaId,o=this.buttonId,c=l(i(r("formula.formula"),e,r("formula.placeholder")),2),f=c[0],a=So(c[1]),s=l(u(o,r("formula.ok")),1)[0];if(null==this.$content){var p=So("<div></div>");p.on("click","#".concat(o),function(r){r.preventDefault();var o=p.find("#".concat(e)).val().trim();n.insertFormula(t,o),t.hidePanelOrModal()}),this.$content=p}var d=this.$content;return d.html(""),d.append(f),d.append(s),a.val(""),setTimeout(function(){a.focus()}),d[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 Jo={editorPlugin:function(t){var n=t.isInline,r=t.isVoid,o=t;return o.isInline=function(t){return"formula"===e.getNodeType(t)||n(t)},o.isVoid=function(t){return"formula"===e.getNodeType(t)||r(t)},o},renderElems:[{type:"formula",renderElem:function(t,n,r){var o=e.isNodeSelected(r,t),i=t.value,u=f("w-e-formula-card",{dataset:{value:void 0===i?"":i}},null);return f("div",{className:"w-e-textarea-formula-container",props:{contentEditable:!1},style:{display:"inline-block",marginLeft:"3px",marginRight:"3px",border:o?"2px solid var(--w-e-textarea-selected-border-color)":"2px solid transparent",borderRadius:"3px",padding:"3px 3px"}},[u])}}],elemsToHtml:[Ne],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 Yo}},{key:"editFormula",factory:function(){return new Ko}}]};export{Jo as default};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|